cancel
Showing results for 
Search instead for 
Did you mean: 

On the vl5VL53L5cx, the vl3l5cx_check_data_ready function,

MKhou.1
Associate

 the expected results on the temp_buffer are:

 if((p_dev->temp_buffer[0] != p_dev->streamcount)

            && (p_dev->temp_buffer[0] != (uint8_t)255)

            && (p_dev->temp_buffer[1] == (uint8_t)0x5)

            && ((p_dev->temp_buffer[2] & (uint8_t)0x5) == (uint8_t)0x5)

            && ((p_dev->temp_buffer[3] & (uint8_t)0x10) ==(uint8_t)0x10)

I got:

temp_buffer[0]=255

temp_buffer[1]=0

ttemp_buffer[2]=2

temp_buffer[3]=1

streamcountr=0

after successfully calling the vl53l5cx_init() function, so check_data_ready is never true. Is there any other function that must be called before running the  vl3l5cx_check_data_ready? At which point in the initialization is the correct data to be read on the temp_buffer set?

1 REPLY 1
John E KVAM
ST Employee

That's an interesting one.

After the init call you get an opportunity to change a few settings if you want to and then one calls the start function.

After a bit, the check_data_ready should come true.

As the init function clearly passes and it generates a lot of I2C traffic I'm going to guess your I2C is working fine.

Try placing the senor in front of a laptop camera. You should see the IR light on.

(one cannot use a cellphone camera for this. Most new phones have really good IR filters on them as they generate their own IR.)

If that light is on, you should be getting a data ready.

If it's not on, then the chip didn't get started.

-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.