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

How do I reset the I2C interrupt

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
vik



Joined: 28 Apr 2006
Posts: 3

View user's profile Send private message

How do I reset the I2C interrupt
PostPosted: Fri May 05, 2006 9:19 am     Reply with quote

Hi,

I am using a PIC16F876 as a slave and sometimes during I2C communications it freezes up and doesn't respond to any commands from the Master(PIC16F877). If I reset the power it comes back online. Is there a way that I can reset the PIC or the interrupt without resetting the Power.



thanks
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Fri May 05, 2006 11:08 am     Reply with quote

The interrupt is cleared whenever you read SSPBUF. Make sure that everytime the interrupt is entered that you have something like: var = SSPBUF; so that it is cleared. You will, also, want to check to see if the SSPOV bit is set. This means that an over-flow situation has happened and the Slave will not respond correctly until it is cleared.

There could be a matter of timing as well. If your Master is sending i2c commands faster than the Slave can address the interrupt then it could lock up. Try inserting delays between each i2c command and see what happens. On one of my projects I was sending an i2c_stop() command before the Slave had time to service the interrupt and it didn't want to cooperate so I had to insert a delay before the stop command and the Slave started working.

Ronald
vik



Joined: 28 Apr 2006
Posts: 3

View user's profile Send private message

PostPosted: Fri May 05, 2006 2:30 pm     Reply with quote

Does anyone know how to enable and disable the I2C communication using the built in function provided by CCS compiler

thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri May 05, 2006 2:35 pm     Reply with quote

http://www.ccsinfo.com/forum/viewtopic.php?t=18152
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