AnsweredAssumed Answered

VL53L1X Timing Issue

Question asked by Matthew Mottola on May 7, 2018
Latest reply on May 11, 2018 by john kvam

I'm developing an applications where an array of VL53L1X sensors would be used. During that development effort it became apparent that there were some timing issues while cycling through the sensors and when I expected them to complete ranging. I reverted back to the X-CUBE-53L1A1's example code while troubleshooting this issue. The P-NUCLEO-53L1A1 (X-NUCLEO-53L1A1 & NUCLEO-F401RE) development boards are being used with only the center sensor in place. The modifications made to the example code are the following:

status = VL53L1_SetDistanceMode(Dev, VL53L1_DISTANCEMODE_SHORT);

status = VL53L1_SetMeasurementTimingBudgetMicroSeconds(Dev, 20000);

status = VL53L1_SetInterMeasurementPeriodMilliSeconds(Dev, 10);



//             status = VL53L1_GetRangingMeasurementData(Dev, &RangingData);
//             if(status==0){
//                printf("%d,%d,%.2f,%.2f\n", RangingData.RangeStatus,RangingData.RangeMilliMeter,
//                RangingData.SignalRateRtnMegaCps/65536.0,RangingData.AmbientRateRtnMegaCps/65336.0);
//             }

Based on Figure 3. VL53L1X autonomous ranging sequence and timings and section 2.5.2 Timing budget and inter-measurement period (particular the below note) from UM2356 - VL53L1X API user manual, I would have expected the falling edges from the GPIO1 interrupt line to be spaced by 20ms independent of the object placed in front of it.

Note:    If the inter-measurement period is shorter than the timing budget, once the device
            completes the ranging, the next ranging starts immediately.

Probing the GPIO1 interrupt line resulted in the attached plots. When no object was placed in front of the sensor the time was 28ms, and when an object was placed in front of the sensor the time varied between 28ms and 37.1ms. Can anyone offer any explanation for this or point out where my misunderstanding of the documentation/API functions is? Timing is very critical in my application especially when obtaining consistent results from multiple sensors.