Connect multiple VL53L5CX on the same I2C bus of Jetson Nano
Hi, I have a jetson nano and am trying to connect multiple VL53L5CX sensors to its I2C Bus 1. Therefore, I have to update the address for the sensors. According to the documentation, I need to initially pull down all the Lpn pins for the connected sensors, then pull up the Lpn pin for one of the sensor whose address I would like to change. Then I would have to call the following function after the sensor has been initialized.
status = vl53l5cx_set_i2c_address(&Dev, 0x40);Now, I am facing multiple issues: -
- First of all, according to the docs, my sensor should be detected at address 0x52, but instead, It is getting detected at 0x29.
- My second issue is that the return status for the above mentioned function call is 254 instead of 0.
- The third issue is that the address of the sensor does get updated after calling the function, but instead of whatever address I give it, it sets it to its half. For example, in the above case, instead of setting the new address to 0x40, it sets the new address to 0x20.
- Lastly, and the most important one, let's say as mentioned in the above point, if I try to access the sensor at the updated address (0x20), the program gives me an error of "VL53L5CX not detected at requested address". I am running the examples provided by the Linux_driver_1.1.1. I made sure to update the vl53l5cx_comms_init function in platform.cpp file from this
if (ioctl(p_platform->fd, I2C_SLAVE, 0x29) <0) {to
if (ioctl(p_platform->fd, I2C_SLAVE, 0x20) <0) {Any help would be appreciated.
Note: I am connecting the sensors with SCL, SDA using pull-up resistors of 2.2k whereas, the LPn have been pulled up/down using 47k resistors. Moreover, I had updated the platform.cpp file to use address 0x29.
