2024-01-25 07:27 AM - edited 2024-01-25 07:30 AM
I have a VL53L8CX time of flight sensor connected via I2C on a custom board. The Board has other devices that can talk on I2C no problem.
now i cant see the i2c address of the ToF device.
from my understanding everything seems to be fine and in accordance with the datasheet.
However there are two things that might be not correct and i want to make sure that my assumptions are not wrong.
about the LPn pin (A2) in the datasheet this is written:
Enables communication. Drive this pin to logic 0
to disable I²C communication when the device is
in low-power mode. Drive this pin to logic 1 to
enable I²C communication in low-power mode.
This pin is typically used when you need to
change the I²C address in multidevice systems. If
it is not used, or if interfacing via the SPI,
connect to IOVDD with a 47 kΩ pullup resistor
I dont plan to use the low power i2c mode. so i connected it to IOVDD via a 47kohm resistor. Was this correct?
the other thing i am not sure about are these pins: SYNC, INT
i was planning not to use them so i didnt connect them to anything. basically they are floating.
however for the INT pin it states:
Interrupt output, defaults to open drain output
(tristate), 47 kΩ pullup resistor to IOVDD required
so is it required to have the 47kohm even if you dont want to use the interrupt pin? Would that prevent the device address from showing up at all?
almost the same text is written for the SYNC pin:
General purpose I/O, defaults to open drain
output (tristate), 47 kΩ pullup resistor required to
IOVDD
TLDR:
i2c scanner does not show the ToF device. communication not possible.
i have two pins that i am not using and have left floating: INT and SYNC.
i was using this datasheet: https://www.st.com/resource/en/datasheet/vl53l8cx.pdf
question: is this the reason why the device does not show up in a i2c address scan?
2024-05-08 08:43 AM
When you say I2C scan, I'm guessing you have a linux based machine and are using something like i2cdetect?
The sensor is a bit complex, but the I2C part of it is dead simple. If the sensor is powered on, and the LPn is high, and the I2C/SPI line is set correctly, you should get a response.
The INT is handy - you really should connect to something. Even if you don't use it now, maybe someday? Otherwise, you end up polling "are you done yet" and that uses a lot of bandwidth.
you asked, "I don't plan to use the low power i2c mode. so i connected it (LPn) to IOVDD via a 47kohm resistor. Was this correct?" - YES it is.
So with that pin high you should be talking. So that leaves power. Are those correct?
Put a scope on the SCL and SDA lines. You should get a response from 0x29.
are C1 and C2 connected to GND.
C1 - SPI_I2C_N Digital input
I2C: connect to GND
SPI: connect to IOVDD
C2 - nCS Digital input
I2C: connect to GND
SPI: active low chip select