The following section describes the sequence of events when using the I2C in Slave mode transmission.
If the slave is configured in 7-bit Addressing mode (no masking), the received address is independently compared to each of the I2CxADR0/1/2/3 registers. In 7-bit Addressing mode with masking, the received address is masked with the value in the I2CxADR1 and I2CxADR3 and compared to the value of I2CxADR0 and I2CxADR2.
If a match occurs, the Slave Mode Active (SMA) bit is set, the
R/W bit information (bit ‘0’ of
the matching address) is transferred to the Read Information (R) bit of the
I2CxSTAT0 register, the Data (D) bit of the I2CxSTAT0 register is cleared, and
the Address Interrupt Flag (ADRIF) bit is set. If the ABD is cleared, the
matching address is copied into the I2CxADB0 register. If ABD is set, the
matching address is copied into the receive buffer, I2CxRXB, setting the Receive
Buffer Full (RXBF) and I2C Receive Interrupt Flag (I2CxRXIF) bits.
I2CRXIF is a read-only bit, and must be cleared by setting the Clear Buffer
(CLRBF) bit or reading I2CxRXB.
If there is not an address match, the module goes idle.
1, I2CxCNT
has a non-zero value, and I2CxTXIF = 1, the slave hardware sets
CSTR, and waits for the software to load I2CxTXB. I2CxTXB must be loaded to clear
I2CxTXIF and release SCL. I2CxCNT is decremented after the byte is transferred to
the Shift register.0, the Byte Count
Interrupt Flag (CNTIF) is set.0, CNTIF is set.