Skip to main content
anusuya
Visitor II
December 23, 2021
Question

VL53L0X - How to Interface VL53L0X with PIC18F57Q43?

  • December 23, 2021
  • 1 reply
  • 745 views

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?

This topic has been closed for replies.

1 reply

John E KVAM
ST Employee
January 4, 2022

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?