The following section describes the sequence of events that occur when the module is receiving data in 7-bit Addressing mode:
If an address match occurs:
0) by hardware, indicating the last received byte was
an address.1). If the Address Interrupt and Hold Enable (ADRIE) bit is set (ADRIE =
1), and the Clock Stretching Disable (CSD) bit is clear (CSD =
0), hardware sets the Slave Clock Stretching (CSTR) bit and the generic I2CxIF bit.
This allows time for the slave to read either I2CxADB0 or I2CxRXB and selectively
ACK/NACK based on the received address. When the
slave has finished processing the address, software must clear CSTR to
resume operation.0), the matching address is copied to I2CxADB0. When
ABD is set (ABD = 1), the matching address is copied to
I2CxRXB, which also sets the Receive Buffer Full Status (RXBF) bit and the I2C
Receive Interrupt Flag (I2CxRXIF) bit. I2CxRXIF is a read-only bit, and must
be cleared by either reading I2CxRXB or by setting the Clear Buffer (CLRBF) bit (CLRBF =
1).If no address match occurs, the module remains idle.
1), slave hardware
automatically generates a NACK condition. NACKIF is set, and the module goes idle. 0). If a NACK was
generated, the CSTR bit remains unchanged. Once complete, software must clear CSTR
and ACKTIF to release the clock and continue operation.1 and I2CxRXIF =
1) when the first seven bits of the new byte are received by
the shift register, CSTR is set, and if CSD is clear, the clock is stretched after the
7th falling edge of SCL. This allows time for the slave to read I2CxRXB, which
clears RXBF and I2CxRXIF, and prevents a receive buffer overflow. Once RXBF and
I2CxRXIF are cleared, hardware releases SCL.1),
hardware sets CSTR (when CSD = 0) and stretches the
clock, allowing time for slave software to read I2CxRXB and determine the state of the ACKDT bit that is transmitted back to the
master. Once the slave determines the acknowledgement response, software clears
CSTR to allow further communication.0), slave hardware
transmits the value of ACKDT as the acknowledgement response to the
master. It is up to software to configure ACKDT appropriately. In most cases, the
ACKDT bit should be clear (ACKDT = 0) so that the master receives
an ACK response (logic low level on SDA during the 9th
clock pulse). 0), slave hardware
transmits the value of the Acknowledge End of Count (ACKCNT) bit as the Acknowledgement
response, rather than the value of ACKDT. It is up to software to configure
ACKCNT appropriately. In most cases, ACKCNT should be set (ACKCNT =
1), which represents a NACK condition. When master hardware
detects a NACK on the bus, it will generate a Stop condition. If ACKCNT is clear
(ACKCNT = 0), an ACK will be issued,
and master hardware will not issue a Stop condition.0), or until the
master issues a Stop or Restart condition.
1)
1)
1)