2024-08-26 03:11 PM - last edited on 2024-08-26 03:12 PM by Andrew Neil
I'm using VL53L3CX. The development board is nucleo f103rb. Power was supplied from the laptop, and pin connections were the same as shown in the notes in the example code.(sensor - pololu / code - stm32arduino helloworld)
The sensor was powered to 3.3 V in the vin
At first, the data came out well. However, after several repeated measurements, suddenly there was a problem with "initsensor." The code has not progressed since "initsensor."
I2C was the problem. I tried to search the address with scanner code but it failed.
After removing the sensor and board from all power connections, I tried again after a lot of time, and it went intermittently and then it didn't. When I took SDA and SCL with my oscilloscope, the signal was caught only when it was intermittent and I stayed in HIGH state when it was not
I've been suffering from this issue for weeks. I wonder if the sensor is broken or if there's something wrong.
Solved! Go to Solution.
2024-08-27 06:50 AM
There is something wrong all right, but it's not your fault - or ST's. It's the I2C bus itself. That bus in simply not very good.
What you are getting is 'bus held low' and it's caused by noise on the line. Either the sensor or the host as clocked a bit due to noise and now the devices are out of sync.
One can fix it in software if you can toggle the clock line a few times. (Theoretically, you can need 9 clocks.)
But to fix the real problem one must mitigate the noise.
And that is a lot of trial and error.
And the list goes on.
But I generally go with shorter wires - just to prove the system works.
2024-08-27 06:50 AM
There is something wrong all right, but it's not your fault - or ST's. It's the I2C bus itself. That bus in simply not very good.
What you are getting is 'bus held low' and it's caused by noise on the line. Either the sensor or the host as clocked a bit due to noise and now the devices are out of sync.
One can fix it in software if you can toggle the clock line a few times. (Theoretically, you can need 9 clocks.)
But to fix the real problem one must mitigate the noise.
And that is a lot of trial and error.
And the list goes on.
But I generally go with shorter wires - just to prove the system works.