Skip to main content
Jesus Reina
Associate II
Question

VL53L1´S API implementation for Microchip devices: Doubts.

Hi friends,

I´m trying to include a Vl53l1 in my project. I am working with a PIC32MX440 microntroller.

I have filled with correct functions in the files vl53l1_platfom.h and .c to use the APIs with my hardware.

The commication with the sensor is right, the microcontroller can read and write in to the sensor, everything goes well...

I have read the ST APIs manual (UM2356), I have write the recomended calls to start to measure distances, the program works but the range I get isn´t correct, I always get the same result (0x196). I am using the sensor without calibration, I think this behavior is for that reason. Maybe?

So I am trying to execute a calibration process. I have followed the manual (UM2356), but when I try to run the Offset calibration I get the next error:

VL53L1_ERROR_GPH_SYNC_CHECK_FAIL

I am blocked, because I can´t measure and can´t calibrate the sensor.

I have two doubts:

  1. Can I use the sensor without calibration?
  2. What is the meaning of the error VL53L1_ERROR_GPH_SYNC_CHECK_FAIL?

???

Best regards.

Jesus

PS: I apologize my english.

    This topic has been closed for replies.

    6 replies

    Jesus Reina
    Associate II

    Dear friends,

    I have found the problem, I had a bug in the routine:

    VL53L1_Error VL53L1_ReadMulti(VL53L1_DEV Dev, uint16_t index, uint8_t *pdata, uint32_t count) 

    I have fixed the mistake. The ST´s APIs work fine.

    it seems I can use the sensor without calibration.

    Thanks and best regards.

    Jesus

    anonymous.8
    Senior II

    Hi,

    I have the same issue with my sensor, what was your error on the VL53L1_ReadMulti function ?

    Thanks in advance.

    Regards,

    Elise

    Jesus Reina
    Associate II

    Hi Elise,

    I wrote some wrong lines in the function, the sensor wasn´t able to communicate with the uC.

    My code didn´t follow the next structure:

    The others vl53l1_platform´s function were implemented without problems, and the sensor replied something, so I thought the problem was in the sensor... ;)

    It was my fault. I had to check the communication with a Logic Analyzer.

    Best regards.

    Jesus Reina
    Associate II

    This is the communication struture:

    anonymous.8
    Senior II

    Hi Jesus,

    Thank you for your quick answer.

    I'm using ST platform code from their example and it seems to go right, It's following the communication structure I think. Could you possibly share with me your platform code ? By private message maybe ?

    0690X000006Dh96QAC.png

    Regards,

    Elise

    Jesus Reina
    Associate II

    Hi Elise,

    If you are using the ST´s platform the communication process should be functional. The communication you have attached above seems right. The problem may be in the sensor, is it right? Can you use another sensor?

    I am sorry to inform you I can´t share code (company policy).

    Regards,

    Jesus