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

Slave I2C

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



Joined: 24 Nov 2009
Posts: 5

View user's profile Send private message Visit poster's website

Slave I2C
PostPosted: Tue Nov 24, 2009 1:51 pm     Reply with quote

Hi,
I have a question about the I2C communication of PIC16F690 in slave mode.
My question is, How do we know about the acknowledge status after sending a byte to master?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Nov 27, 2009 8:44 pm     Reply with quote

Download the 18C MSSP Reference Manual from Microchip:
http://ww1.microchip.com/downloads/en/DeviceDoc/39520.pdf
Look in this section:
Quote:
20.4.1.3 Slave Transmission

As a slave-transmitter, the ACK pulse from the master-receiver is
latched on the rising edge of the ninth SCL input pulse. If the SDA
line was high (not ACK), then the data transfer is complete. When
the not ACK is latched by the slave, the slave logic is reset and
the slave then monitors for another occurrence of the Start bit.
If the SDA line was low (ACK), the transmit data must be loaded into
the SSPBUF Register, which also loads the SSPSR Register and sets the
BF bit. Then the SCL pin should be enabled by setting the CKP bit.

If the slave logic (the hardware) is reset, this will be seen in the value
returned by the CCS function i2c_isr_state(). Instead of getting
values from that function in the 0x81-0xFF range, you will get values
less than 0x80. See the i2c_isr_state() section of the CCS manual.
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