cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to disable hardware interrupt on VL53L1, but still receive measurements?

EVuša.1
Associate II

In our application, we have two modes. In first mode, proximity is in interrupt mode and host is in standby. When user defined threshold is met (distance of object to proximity sensor is below certain distance) interrupt is raised. Now host processes this interrupt and disables interrupts from proximity. Proximity is now in polling mode. From this point on host, when needed, polls measurements to find out how far object is from proximity. No interrupts should occur at this point.

This use case is possible to achieve with VL53L0X sensor, by stopping measurement, changing config, and starting measurement again. But VL53L0X has too short range for our application. I am wondering if similar flow can be achieved with VL53L1, which has a longer range.

From what I can tell from documentation, when measurement is ready (and meets thresholds) physical interrupt is always raised on GPIO1 pin. What we want is to get measurement by polling but without physical interrupt happening. One idea was to change threshold, but it seems that even polling measurements are not available if threshold is not met. I'm not sure why interrupt and measurements are so coupled together on VL53L1.

Is there any way achieve this with VL53L1 sensor.

6 REPLIES 6
Julien NGUYEN
ST Employee

​Hi EVuša.1,

I understand your requirement and agree that such use case should be handled. Let me check the code and come back to you with a correct answer.

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.
John E KVAM
ST Employee

Sorry for the slow answer. It's not a question that we've encountered before.

I'm thinking it's not the interrupt that's the issue, but what you do when the interrupt pin fires.

Can you not decide to ignore the interrupt in your system?

Or even if your interrupt routine gets triggered just do nothing when you are in the polling mode?

Might you consider having your interrupt routine act in one way when looking for a near target? And acting in a different way when in you 'poling mode'?

I'm going to pass this one to see if anyone else has an opinion.


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. It helps the next guy.
EVuša.1
Associate II

Hi,

Thank you for answer. From what we were able to find there is no easy way to tell our system to ignore interrupts. Then we tried making interrupt handling routine do nothing when interrupt happens but this has also resulted with low performance because of the often routine calls.

John E KVAM
ST Employee

​how about this...

When you no longer want interrupts, set the threshold to something ridiculously short - say 15cm, or 5.

that will reduce the number of interrupts if not eliminate them completely.

When you are ready, move the threshold back to the old position.

You might even try changing the threshold without stopping the sensor. I think that works, although I've never tried it.

I've never tried to range without getting an interrupt - finding easy to simply ignore the interrupt - but I suspect you are right.


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. It helps the next guy.
EVuša.1
Associate II

Thank you for your answer, John.

That was one of the ideas that I wanted to try, but I wasn't able to get values by polling that are outside of the set threshold.

This is because function `VL53L1_WaitMeasurementDataReady` waits for interrupt to be raised. \

So VL53L1_WaitMeasurementDataReady calls VL53L1_poll_for_range_completion which then "polls bit 0 of VL53L1_GPIO__TIO_HV_STATUS to determine the state of output interrupt pin".

John E KVAM
ST Employee

​Ouch. The 'done' bit and the interrupt are tied together. I think I knew that but never considered the implication.

Looks like your only choice is to disable the interrupt bit on your host.

Sorry about  that.


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. It helps the next guy.