2023-06-26 12:35 AM
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
Solved! Go to Solution.
2023-07-18 02:16 AM
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.
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.
I did a quick test at myside, no matter single shot or continuous API is called, VL53L0CX can range correctly.
Br
Zhiyuan.Han
2023-07-18 12:38 AM
Hello,
This question has been raised internally. We will do the trials on our side and come back to you soon.
Regards
2023-07-18 02:16 AM
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.
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.
I did a quick test at myside, no matter single shot or continuous API is called, VL53L0CX can range correctly.
Br
Zhiyuan.Han
2023-07-19 08:15 PM
thank you very much. I'll try it with your API.