2020-08-17 07:25 AM
Hi,
I am using multiple (40) VL53L1x sensors. Is it possible to let the sensors continuously range and updating measurement results in the register without clearing the interrupt with the full-API function VL53L1_ClearInterruptAndStartMeasurement?
In the API documentation (UM2356) it says:
"The sensor performs the ranging continuously and autonomously with a programmable inter-measurement period". Is it possible make this autonomous measurements be reflected in the data register? The goal is to obtain the last valid measurement result according to time-budget and inter-measurement period without clearing every interrupt of all 40 sensors. E.g. each sensor automatically start a new ranging after the inter-measurement period.
Thanks for your help.
Solved! Go to Solution.
2020-08-26 07:33 AM
In Lite_Ranging mode the host and the sensor work in lock-step to get a faster answer, so you are right.
but Autonomous, means exactly that. It works alone.
I cannot guarantee that that the data will all be from the same data collect, but if you do one IO operation it is extremely unlikely you will have an issue.
2020-08-26 07:15 AM
If you want to use the interrupts then of course you have to clear them, but if you simply want to read a result of the latest range whenever you want to you can.
When you issue the start command, the sensor will continue to range until you stop it.
The range data you read will be the last valid range.
There is a small possibility that if you read the distance, the RangeStatus, the ambient light and all the other things that you need that the sensor will be updating as you read.
So you might get the distance from the prior range and the RangeStatus from the current range.
But if your object is moving slowly, both will be valid.
To limit the likelihood of this, consider using the VL53L1_GetRangingMeasurementData function. It reads the output of the sensor in one I2C read, limiting your exposure to the issue.
But if you don't clear the 'done' register, using the Wait-for-done function clearly won't work.
2020-08-26 07:24 AM
Hi John,
Thanks for your reply. I finally got it to work. Maybe it is worth mentioning if continuous ranging is desired one should use VL53L1_PRESETMODE_AUTONOMOUS mode and not VL53L1_PRESETMODE_LITE_RANGING.
VL53L1_SetPresetMode(&Dev, VL53L1_PRESETMODE_AUTONOMOUS); // use this
VL53L1_SetPresetMode(&Dev,VL53L1_PRESETMODE_LITE_RANGING); // do not use this
In case of VL53L1_PRESETMODE_LITE_RANGING the measurement output will stay always the same if the interrupt is not cleared, but if VL53L1_PRESETMODE_AUTONOMOUS is used the output data is updated continuously.
I already use the function VL53L1_GetRangingMeasurementData from the driver library. So is it correct that when reading with this function all data contained in it are consistent to each other, i.e. status and range are from the same measurement?
2020-08-26 07:33 AM
In Lite_Ranging mode the host and the sensor work in lock-step to get a faster answer, so you are right.
but Autonomous, means exactly that. It works alone.
I cannot guarantee that that the data will all be from the same data collect, but if you do one IO operation it is extremely unlikely you will have an issue.
2020-08-26 07:41 AM
Ok, thanks for the information.