mayur.k.vadukul
Joined: 07 Jul 2022 Posts: 47
|
| I2C Set up for PIC18F66K22. |
Posted: Mon Oct 19, 2026 4:39 am |
|
|
I am trying to set up the I2C mode on PIC18F66K22.
I have used the following to define the parameters:-
#use i2c (I2C2, MASTER, FAST = 100000, RESTART_WDT, NOINIT, STREAM = FM_2)
in my code I have initialised the I2C with following function:-
i2c_init(FM_2, TRUE);
in my mains loop, i am constantly doing the following at the rate of 10msec and I am monitoring the clock - SCL2 (50) & SDA2 (51) pins on scope.
i2c_start (FM_2);
i2c_write(FM_2,0x55);
i2c_stop (FM_2);
However, I do not see any response on the osciloscope. I am expecting the clock to be 100Khz and data pin to be high and low.
I am using external 16MHz crystal with PLL and my program is running properly as I have some LEDs which work. I am also running in Debug mode and confirmed that the code is working properly.
Any suggestions? _________________ MVadukul |
|