2020-02-09 11:53 PM
Hello, I'm using a VL53L0X and it returns 0x1FFFF depending on whether a function within "VL53L0X_StaticInit" is commented or not during initialization.
If "VL53L0X_set_reference_spads" is commented, the sensor sends values (with a large offset). But, if "VL53L0X_set_reference_spads" is not commented, the sensor sends 0x1FFFF all the time.
Is this problem related to this other ST forum thread?
Regards
2020-02-10 12:10 AM
Hi ,
We recommend you do not modify the basic functions of the driver.
To correct the offset error, you have to call the offset calibration function once the VL53L0X_StaticInit() function is called.
Thanks,
Julien
2020-02-10 12:52 AM
Hi Julien, thanks for your answer.
Sorry, I think I explained it wrong.
My main problem is not the offset (I will use the function "VL53L0X_PerformOffsetCalibration" as you suggest to correct it).
My problem is within the "StaticInit" function. I don't want to modify the API that ST gives me, but the thing is that without modifiying the library, the sensor doesn't work (sends 0x1FFFF all the time). The VL53L0X only does something when I comment "VL53L0X_set_reference_spads" (I figured it out by trial and error).
That's why I asked if this problem was related to this other "initialization problem" thread. I'd like to know if it's an internal sensor problem or has to do with my program.
Regards
2020-02-10 01:31 AM
Hi DDSG-1
The VL53L0X_set_reference_spads() function returns 0 from my side.
Could you please go inside the function and tell me where you get a returned status different of 0 for the first time.
Thanks,
2020-02-10 03:41 AM
Hi Julien,
The function "VL53L0X_set_reference_spads" returns 0 all the time. This function sends the following frames:
When I request distance measured, I get the following all the time:
The strange thing comes when I change the "local Status" variable to a "volatile local/global Status" variable (I only make this change in my code). In this case, sent frames are the same as before (56 FF 01, 56 4F 00, etc) except for the distance:
As you can see, now the sensors detects my hand movements.
Any idea?
[EDIT] It seems that the weird "volatile trick" only works sometimes, so there must be something else I don't understand.
Anyway, the problem related to commenting or not commenting the function "VL53L0X_set_reference_spads" is the same: the sensor returns 0x1FFF if not commented, and real distances if commented.
Regards
2020-03-04 09:34 AM
The only thing I can think of is you somehow got bad reference SPADs when you first calibrated and called the "VL53L0X_get_reference_spads", so when you set them after the next boot, you make a mess.
Is it possible?
2020-05-11 11:03 PM
I'll take a look at the calibration process.
Thanks
2020-07-09 12:31 AM
Hello John.
I checked the program and the calibration process and now it works well. I'm not sure what happened but I didn't get the wrong measurement again. I think that SPAD calibration is now correct.
Now I have some doubts about SPAD calibration. Function "VL53L0X_perform_ref_spad_management()" returns two values: refSpadCount and isApertureSpads:
1) Are these parameters manufacturing dependant? I ask because my board has 3 VL53L0X and each one returns different values before and after VL53L0X_perform_ref_spad_management():
After VL53L0X_perform_ref_spad_management() --> refSpadCount = 12 /// isApertureSpads = 0
After VL53L0X_perform_ref_spad_management() --> refSpadCount = 10 /// isApertureSpads = 0
After VL53L0X_perform_ref_spad_management() --> refSpadCount = 11 /// isApertureSpads = 0
2) ¿Could you please explain briefly what exactly those parameters are? I get an idea of what refSpadCount means, but I can't understand the meaning of isApertureSpads and why some sensors return 0 and others return 1 after staticInit().
I also can't understand why after VL53L0X_perform_ref_spad_management() they all have similar values (12,10,11 and 0,0,0)
Regards.
2020-07-10 12:06 PM
To combat getting too much light in the sensor, some SPADS are covered with an Aperture to limit the amount of light that can get in. This is why we return the SPAD count as a floating point number.
The RefSpad is a region of the photon detect array that we use to determine when the laser is turned on. There is a fairly long time from the time we put power to the laser and when the laser starts emitting.
The calibration establishes which detector elements get triggered when the laser comes on and how many. As the geometry of the chip changes during the reflow process, we need to calibrate for this geometry. And if the light shines on some of the occluded 'aperture' SPADS, we need to use more.
Before you calibrate you get our factory calibration. After you calibrate you get the changes induced by the reflow process.
2022-03-31 07:21 AM
Hi,
I have the exact same behaviour. Did you ever figure out what the problem was?