cancel
Showing results for 
Search instead for 
Did you mean: 

VL53L7CX SDA stuck at zero

electronicsbjorn
Associate

Hi, I am testing the SATEL VL53L7CX board, but the SDA on this board is stuck at zero. I have checked that there are no short cuts and that the pull up is there. Any ideas how to solve this?

4 REPLIES 4
John E KVAM
ST Employee

The absolute classic I2C problem is 'bus stuck low'. It happens because the sensor either got an un-intended bit or missed a bit. Either way, the sensor and MCU are out of sync, each device waiting for the other to pull up the SLK or SDA line. 

It happens due to noise. A bit is 'clocked' on a transition of the SCK line. But a bit of noise can clock an extra bit if there is a small glitch on the line just at the wrong time.

If you google "I2C bus stuck low" you will get lots of good advice. Everything from shorten your wires to use a stronger pull-up. But if you happen to know a good EE, get them to calculate the capacitance on the line and you can tweak your MCU to maybe put a little stronger pull-up on that line. 

If you do get stuck there are two things you can do.

1) drop the XShut line, wait 10ms and bring it back up. This reboots the sensor.

2) you can hack you I2C driver and clock 9 clk pulses. (Generally, the system clears after 1, but clocking 9 is a guaranteed solution. This works simply because a lot of clock pulses will complete whatever byte the sensor is waiting for and end the transmission. 

But the best way is put a scope on the line and look at the pulses. Are they nice and square? Is there any noise on them? Then adjust the pull-ups and decoupling caps until you get nice square shapes with not too much overshoot or undershoot. AND no noise.

And this issue is NOT limited to the VL53 sensors. Every I2C communication potentially has this issue. But the VL53L5, L7 and L8 all send a lot of data over the bus. So, it shows up here a lot.

- john


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.

Thanks a lot. The line is only a few cm long, so there should be no significant capacitance. Also the pullup is 2.2k so this should be small enough? The XShut line would that be the LPn or the I2C_RST?

 

John E KVAM
ST Employee

Toggling the I2C_RST line is the best way to clear a stuck I2C line. And you know you are stuck if the either of the I2C lines are pulled low for any amount of time. 

Dropping the LPn will stop the sensor from communicating. And it might clear the issue as well.

LPn going low, turns off the power to the i2C communication engine in the chip. It's generally used if you want to disable communications while you talk to some other VL53 sensor on the bus. 

if you are absolutely sure there is no noise on the communication lines, then there is something wrong with your power rails. 

I2C noise and power issues are the only two issues there can be.

 

- john


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.

> I2C noise and power issues are the only two issues there can be.

It could be bad software too, no? I would consider that separate from noise. Perhaps something gets reset mid-transaction, or otherwise fails to behave according to I2C protocol.

A logic analyzer on the line would reveal the answer.

 

Unclear from the problem description, but if SDA is stuck low immediately after reset, definitely have a hardware problem somewhere.

If you feel a post has answered your question, please click "Accept as Solution".