2023-04-19 05:59 AM
I've been implementing the platform functions for the VL53L4CD ULD. I have used and I2C library that I have been using for many years to interface many I2C devices such as EEPROM, rheostats and Vishay proximity sensors with no issue. I started by testing the VL53L4CD_RdByte function with index 0x010F and all works as expected. However, whenever I request index 0x0110, the VL53L4CD works the first time, but the VL53L4CD holds the SDA line low (as validated by oscilloscope) and all I2C communication is dead until I power cycle the VL53L4CD. I know it is the VL53L4CD as I've pulled power from both my MCU and VL53L4CD one at a time and the problem is fixed only when power cycling the VL53L4CD.
For reference, I'm using the Sparkfun VL53L4CD breakout board, so it's possible it may be an older version of the VL53L4CD? Any help would be greatly appreciated.
Thanks,
Tom
2023-04-20 07:58 PM
Hi Tom
I have test with our STM32F401+ VL53L4CD expansion board, not seen your problem. it should not come from L4 itself, please check other parts.
Test code as below:
status |= VL53L4CD_RdWord(dev, 0x010F, &Test_Value_16);
printf("Status is %d, and Test_Value is 0x%x\n", status, Test_Value_16);
status |= VL53L4CD_RdByte(dev, 0x0110, &Test_Value_8);
printf("Status is %d, and Test_Value is 0x%x\n", status, Test_Value_8);
status |= VL53L4CD_RdWord(dev, 0x0110, &Test_Value_16);
printf("Status is %d, and Test_Value is 0x%x\n", status, Test_Value_16);
Test log as below:
Starting VL53L4CD driver version 2.1.1
Status is 0, and Test_Value is 0xebaa
Status is 0, and Test_Value is 0xaa
Status is 0, and Test_Value is 0xaa10
Ranging starts
Status = 0, Distance = 165 mm, Signal = 191 kcps/spad
Status = 0, Distance = 155 mm, Signal = 232 kcps/spad
Status = 0, Distance = 149 mm, Signal = 259 kcps/spad
Br
Zhiyuan.Han
2023-04-21 11:34 AM
there is no 'older version' of the L4. It's too new a part. If we made a change, we would have changed the part number.
I'm going to make a guess here. With 99% of I2C devices the register addresses are a single byte. But the VL53 parts, there are so many registers we need 16 bit addresses.
Could it be that the chip is still waiting for the next address byte?