cancel
Showing results for 
Search instead for 
Did you mean: 

VL53L0X returns 0x1FFFF (8191)

Hardwariano
Associate III

Hello, I'm using a VL53L0X and it returns 0x1FFFF depending on whether a function within "VL53L0X_StaticInit" is commented or not during initialization.

0690X00000D96y2QAB.png

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

14 REPLIES 14
John E KVAM
ST Employee

The RefSpads are those SPADs that trigger when the laser turns on. It's how we know the exact time the laser starts emittng. But the VCSEL is a different bit of silicon that the SPAD array, and really tiny differences in placement mean we need to know which are most effected by the laser - and those become the RefSpad.

At the factory we did a calibation. But during the reflow process, the gemotry of the chip changes every so slightly. And that means we have to recalibrate.

And thus some calibrations will return different numbers. That's not an issue.

Early on, we noticed that some chips were failing the RefSpad calibration - because the Factory number was so different from the current geometry that the calibration fails.

The trick, when this happens, is to set the RefSpad to 3 and try again. By bringing the RefSpad back to 'nominal', the calibration will pass. (This should have been fixed in a more recent release.)

-john


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.

Thanks for the reply. But this still doesn't work.

I've inserted a call to

    VL53L0X_SetReferenceSpads(&myDev, 3, 0);

either before the staticInit() or the PerformRefSpadManagement() but neither works. VL53L0X_PerformRefSpadManagement() constantly returns (0,0) for refSpadCnt and isApertureSpads for any device.

Hi MMeng

Unfortunately I could not solve the problem.

What I did was to change the TOF sensor. I chose the VL53L1CX and VL53L1CB sensors.

Personally I think VL53L1CX/CB works better and are much easier to control and understand than VL53L0X. Also, the documentation and API are much better explained.

Regards

Hi,

I was hoping I could avoid changing sensors, but thanks anyways. Especially for finding the "VL53L0X_set_reference_spads" "fix". That got everything working decently enough for now. Thanks again for that.

Cheers

John E KVAM
ST Employee

the 8191 is what the sensor returns when something is wrong. (Check the RangeStatus. It's not 0.)

If you are having trouble getting PerformRefSpadManagement() to pass, try setting the refSpads to 3 and run the calibration again.

(On some chips, the reflow process warped the sensor so much that the internally set value is not close enough to allow the sensor to calibrate. Setting it to 3 prior to running the calibration seems to fix it.)

There are legitimate reasons to get 8191, but assuming you have a target within range, you should see it and get a good value.

But you need to set some reference SPADs, So that bit of code checks the NVM for them and if valid uses them, but it would be better if you calibrated the RefSpads and stored them in your memory and used those at boot up instead.

  • john


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.