PIC18F27Q10 I2C problem [SOLVED]

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

Flowcode v10 PIC18F27Q10 I2C problem [SOLVED]

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.

a.) I’ve observed that when I set the channel 1, there is no activity on the I2C bus at all.

b.) When I use channel 2, 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.
18F27Q10_I2C_test.fcfx
(19.46 KiB) Downloaded 57 times
I would be very happy if this could be resolved.
Regards,
Sasi
Last edited by Sasi on Sun Sep 21, 2025 1:34 pm, edited 1 time in total.

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

Re: PIC18F27Q10 I2C problem

Post by Sasi »

I forgot to mention that I also tested the attached project with a PIC16F18875 MCU and it works fine with it.

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

Re: PIC18F27Q10 I2C problem

Post by Sasi »

Dear Support Team,
The problem still persists, and I would truly appreciate any assistance or technical support you could provide.
Thank you very much in advance.
Sasi

medelec35
Matrix Staff
Posts: 2129
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 659 times
Been thanked: 716 times

Re: PIC18F27Q10 I2C problem

Post by medelec35 »

Hi Sasi.
Apologies for the delay in replying.
I2C on later 18F devices is a known issue.
We have made some progress in getting I2C to work, but we are not finished yet.
Hopefully next week we will have a working I2C component.
Martin

BenR
Matrix Staff
Posts: 1978
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 519 times
Been thanked: 707 times

Re: PIC18F27Q10 I2C problem

Post by BenR »

Hello,

This should be resolved now with the latest library updates.

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

Flowcode v10 Re: PIC18F27Q10 I2C problem

Post by Sasi »

Hello,

Thank you for the notification.
I updated the libraries, restarted Flowcode, and recompiled the test program, but the situation hasn't changed on my end.
The original issue still persists.

When channel 1 is selected, there is no communication on the I2C bus.

If I set it to channel 2, it communicates correctly with the display.
However, it cannot communicate with the TOF sensor, because in this case, the idle state of the CLK line is Low while the TOF device macro is running.

Regards,
Sasi

BenR
Matrix Staff
Posts: 1978
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 519 times
Been thanked: 707 times

Re: PIC18F27Q10 I2C problem

Post by BenR »

Hi Sasi,

Many thanks for letting us know. I've had another quick look at the definition file and for the device you're using the remap parameters for I2C channel 1 were a little off and so this likely is the cause of the problem and explains why channel 2 works fine.

The fix is now available on the library updates so let us know how you get on.

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

Flowcode v10 Re: PIC18F27Q10 I2C problem

Post by Sasi »

Hi Ben, I
2C peripheral channel 1 is now working.
Thanks for the fix. :)
The TOF sensor error still exists.
I will write another post about that.
Regards,
Sasi

Post Reply