Skip to main content
Karsten1
Associate
April 8, 2021
Question

VL53L1X: Interrupt-Pin stays low after first ranging

  • April 8, 2021
  • 4 replies
  • 1573 views

Hello,

I am desperate, have been looking for the cause of a malfunction for quite a long time now.

I use the VL53L1X with the ULD API.

My code looks like the example code:

  • Enable EN-Pin
  • wait for CheckBootState == ok
  • SensorInit (Config like ULD, no changes)
  • SetDistanceMode: 2
  • SetTimingBudgetInMs: 100
  • SetInterMeasurementInMs: 100
  • StartRanging

An IRQ occured,

In ISR, I read the distance and clear the interrupt:

  • wait for ChecKForDataReady != 0
  • GetDistance: 0x0B5E (no overlapping of the sensor, may be ok(?))
  • ClearInterrupt

After that, no more IRQ occured, the GPIO pins stayed at low level.

When I hold my hand over the sensor, the measured distance is much smaller. The sensor should therefore work.

Why then does it not trigger any further interrupts?

Any ideas?

Best regards,

Karsten

This topic has been closed for replies.

4 replies

Dominique LOYER
Visitor II
April 8, 2021

​Hello,

The intermeasurment time is the same as the timing budget. Set 200ms as intermeasurement and you should have what you need.

Best regards

Dom

Karsten1
Karsten1Author
Associate
April 8, 2021

I did it as in the sample settings. I am surprised that just these settings should not work.

Nevertheless, I found the error, it was a faulty logical link in a conversion of a 32-bit value into four 8-bit values. Rookie mistake ;)

Dominique LOYER
Visitor II
April 9, 2021

​The intermeasurment time includes by definition the Timing budget. In theory, they can be equal but to be safe, few µs delay might help. I propose you 200ms because I thought you wanted a 100ms measurement every 100ms. That's good you found the issue!

Karsten1
Karsten1Author
Associate
April 9, 2021

Ok, now I use 200ms for the intermeasurement time and 100ms for the time budget.

For a while it works quite well.

But suddenly the INT pin is high, but when I ask the chip if data is ready, I get a "not ready".

VL53L1_get_interrupt_polarity: 0x00

VL53L1_GPIO_TIO_HV_STATUS: 0x03

-> data not ready

What happens here? What can I do?

ClearInterrupt lets the INT Pin stay at high signal.