Page 1 of 1

The VL53L0X1 sensor does not work with the PIC18F27Q10 MCU.

Posted: Sun Sep 21, 2025 1:52 pm
by Sasi
Hello,
I would like to implement distance measurement using a PIC18F27Q10 MCU.
I have connected a VL53L0X sensor and an SSD1306 OLED display to a common I2C bus.
The display works, but the TOF sensor does not.
In the test project, when the TOF sensor Component Macro runs, the CLK line remains "LOW" level in idle state, which causes the protocol not to work.

I updated all component macros to the latest release before testing.
I also tested the attached project with a PIC16F18875 MCU and it works fine with it.
18F27Q10_I2C_test.fcfx
(19.46 KiB) Downloaded 6 times
Thank you in advance for your help.
Regards,
Sasi

Re: The VL53L0X1 sensor does not work with the PIC18F27Q10 MCU.

Posted: Mon Sep 22, 2025 11:52 am
by BenR
Hi Sasi,

I've had a look at the component source and though there is a lot of code to drive this sensor I cannot see a reason for the lockup.

I think I have the sensor somewhere so I'll have a dig for it and see if I can find a way to replicate.

Re: The VL53L0X1 sensor does not work with the PIC18F27Q10 MCU.

Posted: Mon Sep 22, 2025 2:56 pm
by Sasi
Hi Ben,

I am attaching two pictures of the issue.
TOF initialization does not happen at startup either, the MCU tries to program the sensor, but they "don't understand each other".
It would be great if you could find a solution to this error.
TOF SCL idle state is LOW.jpg
TOF SCL idle state is LOW.jpg (33.79 KiB) Viewed 42 times
TOF SCL zoomed in on the first I2C data packet.jpg
TOF SCL zoomed in on the first I2C data packet.jpg (33.09 KiB) Viewed 42 times
Regards,
Sasi

Re: The VL53L0X1 sensor does not work with the PIC18F27Q10 MCU.

Posted: Tue Sep 23, 2025 12:37 am
by Sasi
Hello Ben,

Since both I2C channels are operational, I attempted to connect the sensor and the display to separate channels.
In this configuration, the TOF sensor functioned correctly. The SCL line remained in its expected idle high state.
(I re-tested the setup using a PIC16F18857 MCU, and observed the same malfunction when the display and sensor were connected to the same I2C bus. Therefore, this issue is not specific to the PIC18F27Q10 device. :oops: )

Regards,
Sasi