2020-04-01 11:59 PM
I connect a vl53l1x-satel to a stm32wb55rg6 with 4 essantial pins (sda, sdl, gnd, vdd). I have a problem to wait for a result. With de function VL53L1_WaitMeasurementDataReady() i haven't problems but for my project I must not use a blocking function. So I try VL53L1_GetMeasurementDataReady() whitout success. I would like use a physical interrupt but i don't understant it's works and how use it.
2020-04-02 07:25 AM
It's the job of the sensor to raise the interrupt and the job of the STM32 (and the programmer) to handle it. :)
But let me try to give you some ideas.
First you can try posting your question the STM32 MCU community.
You will get a lot of answers - and perhaps some code.
Another option is to tell the VL53L1x to range continuously and autonomously forever.
Then just read the result whenever you felt like it.
With a 30ms TimingBudget, you might get some data that's 29ms old, or you might get the same data twice, but as new data becomes available you'd get it.
This is how a lot of robots work.
Another idea would be:
The VL53L1_WaitMeasurementDataReady() does a loop
loop forever {
done = VL53L1_GetMeasurementDataReady()
if done, exit loop
wait a bit
{
Simply create a function similar to this and change the "wait a bit" to "do something useful here"
Thirdly - it's always a good idea when looking for technical information to simply "Google it".
I googled "STM32 Interrupt" and got some good articles.
Don't be thrown off by the mention of ARM Cortex - that's the architecture inside the STM32.