2021-09-30 04:34 PM
A couple of questions.
First there seems to be some conflicting comments. In the vl53l5cx_plugin_detection_thresholds.h file there is the following statement in regard to the mathematical operators for multiple checkers. "Please note that the first checker MUST always be a OR operation." Then in the file Example_9_detection_thresholds.c there is the statement " Please note that the first one must always be set with a mathematic_operation VL53L5CX_OPERATION_NONE." I've tried the example with both OR and NONE and it works either way.
The seconds question is I can't seem to get the AND operation to work. I want it trigger when the distance is between 200 and 400 mm AND the SIGNAL_PER_SPAD_KCPS > 10. When I use the VL53L5CX_OPERATION_AND operator it never triggers. If I change it to look for VL53L5CX_TARGET_STATUS == 5 instead of VL53L5CX_SIGNAL_PER_SPAD_KCPS > 10 then it triggers, but none of the zones have a distance between 200 and 400 mm. Looks like it is triggering when the distance is between 50 and 100 mm AND status == 5.
Thank you
Solved! Go to Solution.
2021-10-13 08:01 AM
Hi John, BBald.1,
We just committed the driver version 1.1.2 on ST.com with this patch.
Thanks for finding and correcting this issue.
Regards,
Thomas
2021-10-11 09:53 AM
if you look at the definition of the VL53L5CX_OPERATION_NONE and the OR, you will find they are both defined as Zero.
But you have a point about the documentation.
And we believe you have found a legitimate bug in the AND condition software.
We are trying to track that down.
I'll repost when a solution is published.
(Turns out this is proving to be a bit tricky.)
2021-10-11 02:36 PM
I think we found the problem...
It seems this is a pointer bug in ULD. Can you please review my test change that I verified:
File name: vl53l5cx_plugin_detection_thresholds.c
Function name: vl53l5cx_set_detection_thresholds()
Line 168 :
change from
switch(p_thresholds->measurement)
to
switch(p_thresholds[i].measurement)
in this section of code we are scaling the input parameter to the format required by the chip.
and by using a pointer (and not incrementing it) we applied the wrong scaling factor to all the interrupt checkers.
2021-10-12 03:58 PM
John,
That seems to have got it. The AND is now working.
Thanks!
Barry
2021-10-13 08:01 AM
Hi John, BBald.1,
We just committed the driver version 1.1.2 on ST.com with this patch.
Thanks for finding and correcting this issue.
Regards,
Thomas