2023-07-20 02:45 PM
I'm looking into using the VL53L7CX on a board designed for the VL53L5CX. I expected it to be a drop-in replacement on the hardware side with only a change in software needed (using the L7CX API instead of the L5CX API), but when I compared the two APIs (current versions L5CX 1.3.9 and L7CX 1.2.8), ignoring all the instances of "VL53L5CX" changing to "VL53L7CX", I can find no substantial differences at all, and in fact the L7CX seems to work just fine with the L5CX API. Can an ST engineer confirm that the two APIs are functionally identical and interchangeable at this point?
Also, is there a way to tell the two sensors apart via I2C? As far as I can tell, they share the same I2C address and the contents of their identification registers are the same; is there something else that can be used to distinguish them other than visual inspection of the IC?
Solved! Go to Solution.
2023-07-28 05:46 AM
Hello,
Indeed the two APIs were initially different but we have only one for the two products now. Many things were integrated directly in the FW. This i more transparent for the host.
You could think that the API is also shared with the VL53L8CX BUT be carefull, there are still many differences for this product.
To differenciate the L5CX from the L7CX devices, you can add the three following lines in your main file :
uint8_t fw_flags[8];
status |= vl53l5cx_dci_read_data(&Dev, fw_flags, 0xE0C4, sizeof(fw_flags));
printf("Module type = %u (0 for vl53l5cx, 1 for vl53l7cx)\n", fw_flags[1]);
Hope this helps,
Anne
2023-07-27 01:08 PM
Hello Kwc!
It seems that you already have the L5 ULD working with an L7. Congratulations! In fact, it is known that the chip is identical in both versions, with different optics. We can set aside any differences in initialization values in the drivers or even in the firmware that is downloaded to the chip during initialization. You can compare the files vl53l5cx_buffer.h and vl53l7cx_buffer.h.
Regarding how to distinguish between the two, it is understood that by knowing the hardware, you are aware that you need to disable the LPM (low power mode, even if only to silence the I2C communications) that is exclusive to each chip, in order to mute the I2C communications of that chip while you communicate with the other and eventually change its hardware address. Additionally, in the API, you have the function VL53L5CX_ReadID(), which, for example, should return 61442 for the L5.
Hopefully, this answers your question.
Best regards, Alex
2023-07-27 10:12 PM
Hello, Alex.
Thanks for your reply. I'm not seeing that function in the ULD (VL53L5CX_ULD_driver_1.3.9); is there a different API that you're talking about?
I do see a function vl53l5cx_is_alive() that checks for device_id and revision_id of 0xF0 and 0x02 (0xF002 = 61442). The corresponding VL53L7CX function checks for the same value, and that is what I would expect if the two chips share the same silicon. So is there no way for a host controller to identify whether it's talking to a VL53L5CX or VL53L7CX?
Kevin
2023-07-28 05:46 AM
Hello,
Indeed the two APIs were initially different but we have only one for the two products now. Many things were integrated directly in the FW. This i more transparent for the host.
You could think that the API is also shared with the VL53L8CX BUT be carefull, there are still many differences for this product.
To differenciate the L5CX from the L7CX devices, you can add the three following lines in your main file :
uint8_t fw_flags[8];
status |= vl53l5cx_dci_read_data(&Dev, fw_flags, 0xE0C4, sizeof(fw_flags));
printf("Module type = %u (0 for vl53l5cx, 1 for vl53l7cx)\n", fw_flags[1]);
Hope this helps,
Anne