CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

I2C Set up for PIC18F66K22.

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
mayur.k.vadukul



Joined: 07 Jul 2022
Posts: 47

View user's profile Send private message

I2C Set up for PIC18F66K22.
PostPosted: Mon Oct 19, 2026 4:39 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group