cancel
Showing results for 
Search instead for 
Did you mean: 

"vl53l0x_ContinuousRanging_Example", it cannot be measured.

Satoru
Associate

When executing "vl53l0x_SingleRanging_Example" or "vl53l0x_SingleRanging_High_Accuracy_Example", the distance can be measured correctly, but when executing "vl53l0x_ContinuousRanging_Example", it cannot be measured.
Is there somewhere I can check?

Below is the log when running "vl53l0x_ContinuousRanging_Example".

VL53L0X PAL Continuous Ranging example
Call of VL53L0X_DataInit
API Status: 0 : No Error

VL53L0X_GetDeviceInfo:
Device Name : VL53L0X ES1 or later
Device Type : VL53L0X
Device ID : VL53L0CXV0DH/1$C
ProductRevisionMajor : 1
ProductRevisionMinor : 1
Call of VL53L0X_StaticInit
API Status: 0 : No Error
Call of VL53L0X_PerformRefCalibration
API Status: 0 : No Error
Call of VL53L0X_PerformRefSpadManagement
API Status: 0 : No Error
Call of VL53L0X_SetDeviceMode
API Status: 0 : No Error
Call of VL53L0X_StartMeasurement
API Status: 0 : No Error
In loop measurement 0: 0
In loop measurement 1: 0
In loop measurement 2: 0
In loop measurement 3: 0
In loop measurement 4: 0
In loop measurement 5: 0
In loop measurement 6: 0
In loop measurement 7: 0
In loop measurement 8: 0
In loop measurement 9: 0
In loop measurement 10: 0
In loop measurement 11: 0
In loop measurement 12: 0
In loop measurement 13: 0
In loop measurement 14: 0
In loop measurement 15: 0
In loop measurement 16: 0
In loop measurement 17: 0
In loop measurement 18: 0
In loop measurement 19: 0
In loop measurement 20: 0
In loop measurement 21: 0
In loop measurement 22: 0
In loop measurement 23: 0
In loop measurement 24: 0
In loop measurement 25: 0
In loop measurement 26: 0
In loop measurement 27: 0
In loop measurement 28: 0
In loop measurement 29: 0
In loop measurement 30: 0
In loop measurement 31: 0
measurement 0: 0
measurement 1: 0
measurement 2: 0
measurement 3: 0
measurement 4: 0
measurement 5: 0
measurement 6: 0
measurement 7: 0
measurement 8: 0
measurement 9: 0
measurement 10: 0
measurement 11: 0
measurement 12: 0
measurement 13: 0
measurement 14: 0
measurement 15: 0
measurement 16: 0
measurement 17: 0
measurement 18: 0
measurement 19: 0
measurement 20: 0
measurement 21: 0
measurement 22: 0
measurement 23: 0
measurement 24: 0
measurement 25: 0
measurement 26: 0
measurement 27: 0
measurement 28: 0
measurement 29: 0
measurement 30: 0
measurement 31: 0
Call of VL53L0X_StopMeasurement
Wait Stop to be competed
API Status: 0 : No Error
API Status: 0 : No Error

 


Below is the log when running "vl53l0x_SingleRanging_High_Accuracy_Example".

Call of VL53L0X_DataInit
API Status: 0 : No Error
VL53L0X_GetDeviceInfo:
Device Name : VL53L0X ES1 or later
Device Type : VL53L0X
Device ID : VL53L0CXV0DH/1$C
ProductRevisionMajor : 1
ProductRevisionMinor : 1
API Status: 0 : No Error
Call of VL53L0X_StaticInit
API Status: 0 : No Error
Call of VL53L0X_PerformRefCalibration
API Status: 0 : No Error
Call of VL53L0X_PerformRefSpadManagement
refSpadCount = 6, isApertureSpads = 0
API Status: 0 : No Error
Call of VL53L0X_SetDeviceMode
API Status: 0 : No Error
Call of VL53L0X_PerformSingleRangingMeasurement
API Status: 0 : No Error
Range Status: 0 : Range Valid
RANGE IGNORE THRESHOLD: 0.312500
Measured distance: 224
Call of VL53L0X_PerformSingleRangingMeasurement
API Status: 0 : No Error
Range Status: 0 : Range Valid
RANGE IGNORE THRESHOLD: 0.304687
Measured distance: 223
Call of VL53L0X_PerformSingleRangingMeasurement
API Status: 0 : No Error
Range Status: 0 : Range Valid
RANGE IGNORE THRESHOLD: 0.328125
Measured distance: 223
Call of VL53L0X_PerformSingleRangingMeasurement
API Status: 0 : No Error
Range Status: 0 : Range Valid
RANGE IGNORE THRESHOLD: 0.312500
Measured distance: 225
Call of VL53L0X_PerformSingleRangingMeasurement
API Status: 0 : No Error
Range Status: 0 : Range Valid
RANGE IGNORE THRESHOLD: 0.359375
Measured distance: 222
Call of VL53L0X_PerformSingleRangingMeasurement
API Status: 0 : No Error
Range Status: 0 : Range Valid
RANGE IGNORE THRESHOLD: 0.343750
Measured distance: 224
Call of VL53L0X_PerformSingleRangingMeasurement
API Status: 0 : No Error
Range Status: 0 : Range Valid
RANGE IGNORE THRESHOLD: 0.335937
Measured distance: 225
Call of VL53L0X_PerformSingleRangingMeasurement
API Status: 0 : No Error
Range Status: 0 : Range Valid
RANGE IGNORE THRESHOLD: 0.375000
Measured distance: 223
Call of VL53L0X_PerformSingleRangingMeasurement
API Status: 0 : No Error
Range Status: 0 : Range Valid
RANGE IGNORE THRESHOLD: 0.335937
Measured distance: 224
Call of VL53L0X_PerformSingleRangingMeasurement
API Status: 0 : No Error
Range Status: 0 : Range Valid
RANGE IGNORE THRESHOLD: 0.359375
Measured distance: 223
API Status: 0 : No Error
API Status: 0 : No Error

1 ACCEPTED SOLUTION

Accepted Solutions
Zhiyuan.Han
ST Employee

Hi 

Single mode can range correct means there is no issue from HW point of view, so let's focus on SW configuration. 

in single mode, from the log, I see you are calling"VL53L0X_PerformSingleRangingMeasurement()" actually this is an all-in-one function. it includes below functions, the clear interrupt function is very important to start a new ranging. 

  • Status = VL53L0X_SetDeviceMode(Dev, VL53L0X_DEVICEMODE_SINGLE_RANGING);
  • Status = VL53L0X_PerformSingleMeasurement(Dev);
  • Status = VL53L0X_GetRangingMeasurementData(Dev,pRangingMeasurementData);
  • Status = VL53L0X_ClearInterruptMask(Dev, 0);

For continuous mode, there is also a all-in-one function you can use, which is "VL53L0X_PerformContinuousRangingMeasurement", it includes below functions, I suggest you use this API for a try.

  • Status = VL53L0X_SetDeviceMode(Dev, VL53L0X_DEVICEMODE_CONTINUOUS_RANGING);
  • Status = VL53L0X_PerformContinuousMeasurement(Dev);
  • Status = VL53L0X_GetRangingMeasurementData(Dev,pRangingMeasurementData);
  • Status = VL53L0X_ClearInterruptMask(Dev, 0);

I did a quick test at myside, no matter single shot or continuous API is called, VL53L0CX can range correctly. 

 

 

Br

Zhiyuan.Han


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

3 REPLIES 3
Anne BIGOT
ST Employee

Hello,
This question has been raised internally. We will do the trials on our side and come back to you soon. 
Regards


Our community relies on fruitful exchanges and good quality content. You can thank and reward helpful and positive contributions by marking them as 'Accept as Solution'. When marking a solution, make sure it answers your original question or issue that you raised.

ST Employees that act as moderators have the right to accept the solution, judging by their expertise. This helps other community members identify useful discussions and refrain from raising the same question. If you notice any false behavior or abuse of the action, do not hesitate to 'Report Inappropriate Content'
Zhiyuan.Han
ST Employee

Hi 

Single mode can range correct means there is no issue from HW point of view, so let's focus on SW configuration. 

in single mode, from the log, I see you are calling"VL53L0X_PerformSingleRangingMeasurement()" actually this is an all-in-one function. it includes below functions, the clear interrupt function is very important to start a new ranging. 

  • Status = VL53L0X_SetDeviceMode(Dev, VL53L0X_DEVICEMODE_SINGLE_RANGING);
  • Status = VL53L0X_PerformSingleMeasurement(Dev);
  • Status = VL53L0X_GetRangingMeasurementData(Dev,pRangingMeasurementData);
  • Status = VL53L0X_ClearInterruptMask(Dev, 0);

For continuous mode, there is also a all-in-one function you can use, which is "VL53L0X_PerformContinuousRangingMeasurement", it includes below functions, I suggest you use this API for a try.

  • Status = VL53L0X_SetDeviceMode(Dev, VL53L0X_DEVICEMODE_CONTINUOUS_RANGING);
  • Status = VL53L0X_PerformContinuousMeasurement(Dev);
  • Status = VL53L0X_GetRangingMeasurementData(Dev,pRangingMeasurementData);
  • Status = VL53L0X_ClearInterruptMask(Dev, 0);

I did a quick test at myside, no matter single shot or continuous API is called, VL53L0CX can range correctly. 

 

 

Br

Zhiyuan.Han


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

thank you very much. I'll try it with your API.