Skip to main content
Hardwariano
Associate III
October 9, 2020
Solved

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

  • October 9, 2020
  • 4 replies
  • 1622 views

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?

This topic has been closed for replies.
Best answer by Julien NGUYEN

Hi Hardwariano,

Please try that :

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

Thanks,

4 replies

Hardwariano
Associate III
October 22, 2020

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?

Julien NGUYEN
Julien NGUYENBest answer
ST Employee
October 22, 2020

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.
Hardwariano
Associate III
October 23, 2020

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
October 23, 2020

​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.