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 support@ccsinfo.com

I2C Reset

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



Joined: 07 Sep 2003
Posts: 755
Location: Florida

View user's profile Send private message AIM Address

I2C Reset
PostPosted: Wed Aug 15, 2012 7:44 pm     Reply with quote

We know that I2C doesn't have a reset. The issue is when using the hardware I2C with other hardware interrupts the I2C bus can get hung on rare occasions. When this happens the PIC watchdog resets the PIC but the external I2C ( Ex. DS1307) is a slave and expects the PIC to complete the transfer it started that the watchdog shut down before the I2C byte was fully transferred.
The following procedure is suggested and I'm hoping someone has tried it.

The procedure is as follows:
1) Master tries to assert a Logic 1 on the SDA line
2) Master still sees a Logic 0 and then generates a clock
pulse on SCL (1-0-1 transition)
3) Master examines SDA. If SDA = 0, go to Step 2; if
SDA = 1, go to Step 4
4) Generate a STOP condition
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Wed Aug 15, 2012 11:21 pm     Reply with quote

See Philips/NXP AN10216 Slide 42 http://www.nxp.com/documents/application_note/AN10216.pdf
Ttelmah



Joined: 11 Mar 2010
Posts: 19346

View user's profile Send private message

PostPosted: Thu Aug 16, 2012 2:27 am     Reply with quote

and, yes, it does work.

Have done it on a long I2C bus (using 8296 drivers), where occasionally the hardware would get hung.

Best Wishes
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