2022-12-20 06:47 AM
I am trying to interface the VL53L1x sensor with a TI controller. I have checked the I2C read and write operations on the board, and they are working properly. The data sent and received over I2C are correct.
However, when I try to read Model_ID 0x010F or Module_Type 0x0110, the response I get is 0xA5. What does this value mean? I get this value for both the reads. I am not able to solve this issue. What could I possibly be doing wrong?
Solved! Go to Solution.
2022-12-21 07:22 AM
And here is the code itself.
2022-12-20 09:48 PM
Update - 0xA5 was a junk value in the memory. Basically, I am not getting any response from the sensor
2022-12-21 07:21 AM
I'm going to guess that your I2C is not working as well as you think it does. And this is where most people have issues.
One must translate the platform.c file to work in your envionment. And that causes the issues.
Sometimes the I2C single byte reads and writes work, but byte swap issues kill you.
I'm going to add a bit of code. Place it just after you initialize your I2C. When you get this to work then you know the rest will work just fine.
And do try a GitHub search for your processor and the VL53L1. Chances are good that someone else has solved this for you.
2022-12-21 07:22 AM
2022-12-27 10:05 PM
John E KVAM : Thank you so much for the information and the code. It helped me fix a bug that was present in my platform interface layer. I am able to communicate with the sensor now.
2023-01-27 02:44 AM
Hi john,
I am also working on TI controller , can you help me , how you developed platform.c file.
2023-01-27 08:00 AM
The A5 does not come from the sensor. The A5 comes from your I2C driver telling you your transaction did not complete as expected.
if you are using an L1, L3, or L4 you can use the verification code above to insure your reads and writes are completeing successfully.
Common problems are byte swap, word swap, and inability to send longer sequences of bytes.
My go-to is to search GitHub and look for an existing project that uses a VL53L1, L3 or L4 and the MCU you are using.
If you don't find one, look for any project that uses your MCU and the I2C.
Then of course you will have to work out the issues.
Good luck;