|
|
View previous topic :: View next topic |
Author |
Message |
ahmadkamalnasir
Joined: 24 Nov 2009 Posts: 5
|
Slave I2C |
Posted: Tue Nov 24, 2009 1:51 pm |
|
|
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
|
|
Posted: Fri Nov 27, 2009 8:44 pm |
|
|
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. |
|
|
|
|
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
|