The stand-alone I2C module has a dedicated receive buffer register, I2CxRXB, which operates independently from the transmit buffer. This differs from the MSSP module in that the MSSP module has only one buffer, SSPxBUF, to handle both transmit and receive functions.
The receive buffer holds one byte of data (or address when ABD = 1
) that
is shifted in from the receive shift register. User software can read the byte through
the I2CxRXB register. When a new byte is received, the Receive Buffer Full (RXBF) Status
bit is set. The RXBF bit replaces the Buffer Full (BF) bit used in the MSSP module upon
reception of a full byte. Reading I2CxRXB will clear the RXBF bit. If the buffer is read
while empty (RXBF = 0
), the Receive Read Error (RXRE) bit is set, and
the module generates a NACK. User software must clear the RXRE bit to resume normal
operation. Additionally, setting the Clear Buffer (CLRBF) bit clears both the receive
and transmit buffers, as well as the Receive Interrupt Flag (RXIF) bit and Transmit
Interrupt Flag (TXIF) bit.