The VL53L0X1 sensor does not work with the PIC18F27Q10 MCU.

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
Sasi
Posts: 127
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 12:11 pm
Has thanked: 41 times
Been thanked: 15 times

Flowcode v10 The VL53L0X1 sensor does not work with the PIC18F27Q10 MCU.

Post 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

BenR
Matrix Staff
Posts: 1965
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 514 times
Been thanked: 701 times

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

Post 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.

Sasi
Posts: 127
Joined: Wed Dec 02, 2020 12:11 pm
Has thanked: 41 times
Been thanked: 15 times

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

Post 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 44 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 44 times
Regards,
Sasi

Sasi
Posts: 127
Joined: Wed Dec 02, 2020 12:11 pm
Has thanked: 41 times
Been thanked: 15 times

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

Post 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

Post Reply