cancel
Showing results for 
Search instead for 
Did you mean: 

vl53l1 measurement takes up to 30 seconds

pannagger
Visitor

Hi,

 

I use 2 VL53L1 Sensoren via I2C for measuring distance. 
At first I used a raspberry pi and the provided API and it seems to work properly and all fine. Since I need to reduce my power consumption I migrated my Code to an atmega644 and therfore I use Atmel Studio for developing Code.

Using this Controller I observe some strange behavior. Using the default setting, it takes around 30 seconds for a measurement to provide data, the interrupt show the same time frame. If I start a measurement immediately (continuous mode) it again takes ~30 seconds. If I start waiting 10 seconds delayed it takes around 20 seconds. So it seems the interrupt show measurment time is 30seconds. 

I tried to configure it, as well as time budget to 200ms. I also set long range mode explicitly and preset mode to autonomously.

What i saw is the same behavior but with about 19 seconds not 30. 

So i started debugging and comparing. The lib seems to read some values from the Sensor at start up. These values are the same on radpberry and atmega for me. Then after setup an calling „..StartMeasurment“ the Api sends a big stream of ~136 bytes. But here i see a difference for my two setups in some bytes sent by the API. Eventhough the Code is the same. 

So i asked my self:

- how can it be that it takes that long to have data ready for the sensor

- is the api depending on the compiler and my have unser values or invalid pointer on the avr c compiler? On raspberry i use gcc

- how can i proper investigate the issue? Since i can not apply changes to the setup.

 

can someone help me?

kind regards 

philip

0 REPLIES 0