The I2C module has a dedicated transmit buffer, I2CxTXB, which is independent from the receive buffer.
1
), or a data byte, that is copied into the transmit
shift register and transmitted onto the bus. When the I2CxTXB
register does not contain any transmit data, the Transmit Buffer Empty Status (TXBE) bit is set (TXBE = 1
), allowing user software or the
DMA to load a new byte into the buffer. When the TXBE bit is set and the I2CxCNT
register is nonzero (I2CxCNT != 0
), the I2C Transmit
Interrupt Flag (I2CxTXIF) bit of the PIR registers is set, and can be used as a DMA
trigger. A write to I2CxTXB will clear both the TXBE and I2CxTXIF bits. Setting the
Clear Buffer (CLRBF) bit clears I2CxTXIF, the I2Cx Receive Buffer (I2CxRXB) and
I2CxTXB.