Skip to main content
MKhou.1
Visitor II
November 10, 2021
Question

On the vl5VL53L5cx, the vl3l5cx_check_data_ready function,

  • November 10, 2021
  • 1 reply
  • 596 views

 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?

This topic has been closed for replies.

1 reply

John E KVAM
ST Employee
November 12, 2021

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