Issues with I2C Communication to VL53L0X Sensor Using STM32F103C8 Without ST Library
I am using the VL53L0X sensor with an STM32F103C8 microcontroller and want to communicate with the sensor directly over I2C without using ST's library. My goal is to minimize project size and better understand the low-level protocol.
I’ve initialized the I2C interface using CMSIS and am sending commands like setting the control register and reading measurement data, but I’m getting inconsistent responses.
See how I initialized the i2c:
Has anyone successfully worked with the VL53L0X directly over I2C without the library? Any tips on improving communication?
If the ST library is necessary, could someone explain how to integrate it with CMSIS? I prefer CMSIS due to size constraints and learning purposes, but I'm open to using the library if needed.
Any help would be appreciated!
5 Replies
what error are you facing? Its possible to use CMSIS
You are missing the start condition and proper addressing for the device. The VL53L0X expects a start condition and the 7bit address followed by the R/W bit
After finishing the transaction , you should generate a stop condition
Nice nice, your suggestion worked out pretty fine for me... Thanks @Marvee Amasi
Glad it was fixed