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

does I2C functions handle errors?

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



Joined: 01 Jun 2004
Posts: 39
Location: Trois-Rivières

View user's profile Send private message

does I2C functions handle errors?
PostPosted: Tue Jun 01, 2004 3:44 pm     Reply with quote

Hi,

I'm about to implement an I2C bus between two PIC18F452. Since this communication is critical to the system, I want to be able to know if the slave ACKs the data transfers. There's no documentation on this issue in CCS compiler... I just want to know what i2c_write() will do in this situation and if I can still read the ACKSTAT bit after the call to i2c_write().

Thanks
_________________
Alex
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Tue Jun 01, 2004 3:53 pm     Reply with quote

If you will examine the help file it states that the i2c_write() function returns the ACK bit. 0 means ACK and 1 means NO ACK. So, if you had a statement that read:

check_ack = i2c_write(address);

or

if(!i2c_write(address))// enters 'if' statement if ACK'd

you could check to see if the device ACK'd back.

Ronald
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