cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to interface Vl53L1X with a TI controller. What does the response 0xA5 from the sensor mean?

VBhag
Associate II

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?

1 ACCEPTED SOLUTION

Accepted Solutions
John E KVAM
ST Employee

And here is the code itself.


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.

View solution in original post

6 REPLIES 6
VBhag
Associate II

Update - 0xA5 was a junk value in the memory. Basically, I am not getting any response from the sensor

John E KVAM
ST Employee

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.


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.
John E KVAM
ST Employee

And here is the code itself.


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.
VBhag
Associate II

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.

Hi john,

I am also working on TI controller , can you help me , how you developed platform.c file.

John E KVAM
ST Employee

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;

  • john

If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.