Page 1 of 1

I2C not working in V9

Posted: Fri May 08, 2026 2:47 pm
by jollybv
Hi Guys

I've been battling with this for the whole day but cant seem to find out why the I2C component wont work. I've tried in software mode 100Khz but still nothing. In the attached file write near the top there is the first call macro that says RaadBuildingName once in there it calls a macro Read_I2C but when it goes to read it it just hangs I have been over this code numerous times but cant get it to work. So im thinking that the I2C component is faulty. This program was original done in V6 and has worked well but now for some reason cant get it to work. Please help

What i have just noticed is i have a 5 second delay that is taking 23 seconds maybe the problem is in the delay component?

Re: I2C not working in V9

Posted: Fri May 08, 2026 5:58 pm
by mnfisher
Sounds like a clock setting error if the delay is taking 4.5x ? Have you done a 1s blinkie?

Martin

Re: I2C not working in V9

Posted: Sat May 09, 2026 6:53 am
by chipfryer27
Hi

For the PIC to use it's own internal oscillator then you need to use a C-block to enable it.

Fortunately Flowcode can assist by using the IntOsc Helper found under Component Libraries > Runtime.

Add that to your chart then in properties select from the drop down list the frequency you wish. It will then generate the required code for you. Copy the code and add a C-Block as the first icon in Main, then paste the code in there.

It shows the code to be :- OSCFRQ = 0x08;

Hope this helps.