cancel
Showing results for 
Search instead for 
Did you mean: 

VL53L1X - GPIO interrupt works when range status is different from 0

Hardwariano
Associate III

Hello.

I have VL53L1X working in window mode with GPIO polarity active low:

  • Window mode = 3 (within the distance range (min/max)).
  • Min = 50mm
  • Max = 200 mm

It is working well. If my hand is:

  • Within window: GPIO interrupt goes up and down
  • Below or beyond window: GPIO is high all the time

The problem comes when there is nothing in front of the sensor and range status is 4 (phase fail). In this cases, GPIO interrupt still works, causing my code to malfunction.

Why does GPIO works if distance is outside window thresholds and range status is different from 0?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi Hardwariano,

Please try that :

status = VL53L1X_SetDistanceThreshold(dev,50,200,3,0); // fifth parameter of the function must to set to 0.

Thanks,


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

4 REPLIES 4
Hardwariano
Associate III

I include some images to better illustrate my problem.

If my hand is:

  • Within window --> status = 0 --> GPIO interrupt goes up and down --> OK

0693W00000590b0QAA.png

  • Below or beyond window --> status = 0 --> GPIO interrut is high all the time --> OK

0693W00000590cSQAQ.png

  • Beyond window --> status != 0 --> GPIO interrupt goes up and down --> Is this correct behaviour??

0693W00000590duQAA.png 

Is this the correct behaviour of GPIO pin?

Hi Hardwariano,

Please try that :

status = VL53L1X_SetDistanceThreshold(dev,50,200,3,0); // fifth parameter of the function must to set to 0.

Thanks,


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hello Julien,

Thanks for your response. It seems that with value = 0 now GPIO pin works well.

I used value = 1 as indicated by the API comment:

0693W00000595iBQAQ.png

Julien NGUYEN
ST Employee

​Hi Hardwariano,

It is a mistake of our part. We will correct the error. Thanks, Julien


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.