2021-12-23 01:53 AM
I interfaced VL53L0X with PIC18F57Q43 and managed to obtain the data, but the sensor requires a hard reset (manually removing the supply and reconnecting it) to obtain continues ranging data. I would like to know how I can obtain the data continuously?
2022-01-04 07:40 AM
There is an XShut line that you can drop and lift. This will completely reset the sensor.
You should not have reset the sensor.
Once you set it up and issue the start, the sensor should take off ranging until you tell it to stop.
It might be an issue with resetting the interrupt line. On the first range, the interrupt will trigger and it will stay that way until you issue the 'clear interrupt'.
Something like:
for(measurement=0; measurement<no_of_measurements; measurement++)
{
Status = WaitMeasurementDataReady(pMyDevice);
if(Status == VL53L0X_ERROR_NONE)
{
Status = VL53L0X_GetRangingMeasurementData(pMyDevice, pRangingMeasurementData);
*(pResults + measurement) = pRangingMeasurementData->RangeMilliMeter;
printf("In loop measurement %d: %d\n", measurement, pRangingMeasurementData->RangeMilliMeter);
// Clear the interrupt
VL53L0X_ClearInterruptMask(pMyDevice, VL53L0X_REG_SYSTEM_INTERRUPT_GPIO_NEW_SAMPLE_READY);
VL53L0X_PollingDelay(pMyDevice);
} else {
break;
}
}
Could that be the issue?