Can't switch VL53L1 and VL53L1x sensors into threshold mode.
- July 17, 2021
- 2 replies
- 1966 views
Dear Sirs,
I have some problems with VL53L1 and VL53L1X sensors which i'm using in my project.
Now i'm trying to figure out how to switch them to different modes and apply different settings in accordance with API manuals and datasheets. I'm also using STM32F3DISCOVERY board to control sensors.
After i configured I2C bus and other stuff in CubeMX, i included driver files using this instruction: https://forum.digikey.com/t/adding-the-vl53l1x-driver-to-an-stm32cube-project/13276
After that i'm able to receive range data in single ranging mode for both sensors (VL53L1 and VL53L1X) with the same code. I'm sending single range data via UART and it's correct.
After that i've tried to set my sensors in threshold mode (Autonomous mode for VL53L1) and nothing happened. I used UM2356 API Manual for VL53L1X (and also manual for VL54L1). Both sensors still works in signle ranging mode. Code example in the attachment.
Checking the status of the sensor pins with oscilloscope showed that I2C is working (I can see messages sending to 0x29 address, even if i'm specified sensor address as 0x52 in my code). Anyway i guess I2C is working because single ranging works correct. But I continue to see interruptions occurring on the corresponding sensor pin, regardless of the distance (threshold) settings at which the object must be located for the measurement to be triggered.
I've seen the thame question on this forum, but it's still without answer: https://community.st.com/s/question/0D53W00000N9zBpSAJ/vl53l1setthresholdconfig-api-not-working-when-setting-up-threshold-in-vl53l1x-sensor
I've checked all fucntions in debug mode using CebeIDE and everything returns '0' ERROR CODE. I also tried to add delays between functions but still no effect.
Can you please help me to understand where i'm wrong? If you need more information, i'll be glad to answer. Thank you.
