Hardware Reference Manual
UG-1262
Rev. B | Page 229 of 312
In the slave, if there is no valid data to transmit when the transmit shifter is loaded, the transmit underflow status bit asserts (MSTAT,
Bit 12 or SSTAT, Bit 1). In slave mode, the transmit FIFO must be loaded with a byte before the falling edge of I2C_SCL and before the
acknowledge or no acknowledge is asserted. If the transmit FIFO is empty on the falling edge of I2C_SCL for a R/W bit, the slave returns
a no acknowledge because the slave in this case controls the acknowledge or no acknowledge.
If the first byte is transmitted correctly in a slave transmit sequence, but the transmit FIFO is empty for any subsequent bytes in the same
transfer, the slave returns the previous transmitted byte. This operation is due to the master having control of the acknowledge or no
acknowledge during a slave transfer sequence. The master generates a stop condition if there is no data in the transmit FIFO and the
master is writing data.
The receive data path consists of a master and slave receive FIFO, the MRX register and the SRX register. Both are two bytes deep. The
receive request interrupt bit (MSTAT, Bit 3 or SSTAT, Bit 3) indicates whether there is valid data in the receive FIFO. Data is loaded into
the receive FIFO after each byte is received. If valid data in the receive FIFO is overwritten by the receive shifter, the receive overflow
status bit is asserted (MSTAT, Bit 9 or SSTAT, Bit 4).
Automatic Clock Stretching
The ASTRETCH_SCL register controls automatic clock stretching. If automatic clock stretching is enabled, the I
2
C hardware holds the
I2C_SCL pin low after the falling edge of I2C_SCL before an acknowledge or no acknowledge under the following conditions:
The transmit FIFO is empty when a valid read request is active for the master or slave.
The receive FIFO is full when another byte is about to be received. If the receive FIFO has still not been read at the end of the
timeout period, a no acknowledge is returned, and the master ends the sequence with a stop condition.
When enabling automatic clock stretching, enable the timeout feature to support recovery from incomplete data transfers. A separate
status bit for master and slave mode indicates if a stretch timeout has occurred. It is recommended that automatic clock stretching be
enabled, especially in slave mode.
If the transmit FIFO is empty on the falling edge of I2C_SCL for a R/W bit at the end of the timeout period, the slave returns a no acknowledge
after the timeout period. If the first byte is transmitted correctly in a slave transmit sequence, but the transmit FIFO is empty for any
subsequent bytes in the same transfer with clock stretch enabled, the slave returns the previous transmitted byte at the end of the timeout period.
Master No Acknowledge
When receiving data, the master responds with a no acknowledge if its FIFO is full and an attempt is made to write another byte to the
FIFO. This last byte received is not written to the FIFO and is lost.
No Acknowledge from the Slave
If the slave does not want to acknowledge a read access, not writing data into the slave transmit FIFO results in a no acknowledge. If the
slave does not want to acknowledge a master write, assert the no acknowledge bit in the slave control register, SCTL, Bit 7.
Normally, the slave acknowledges all bytes written into the receive FIFO. If the receive FIFO fills up, the slave cannot write further bytes
to it, and the slave does not acknowledge subsequent bytes not written to the FIFO. The master must then stop the transaction.
The slave does not acknowledge a matching device address if the R/W bit is set and the transmit FIFO is empty. Therefore, there is very
little time for the microcontroller to respond to a slave transmit request and the assertion of an acknowledge. It is recommended that
SCTL, Bit 5 be asserted for this reason.
General Call
An I
2
C general call is for addressing every device on the I
2
C bus. A general call address is 0x00 or 0x01. The first byte, the address byte, is
followed by a command byte.
If the address byte is 0x00, Byte 2 (the command byte) can be one of the following:
0x6. The I
2
C interface (master and slave) is reset. The general call interrupt status asserts, and the general call ID bits, SSTAT,
Bits[9:8], are 0x1. User code must take corrective action to reset the entire system or simply reenable the I
2
C interface.
0x4. The general call interrupt status bit is asserted, and the general call ID bits (SSTAT, Bits[9:8]) are 0x2.
If the address byte is 0x01, a hardware general call is issued. Byte 2 in this case is the hardware master address.
The general call interrupt status bit is set on any general call after the second byte is received, and user code must take corrective action
to reprogram the device address.
If SCTL, Bit 2 is set to 1, the slave always acknowledges the first byte of a general call. The slave acknowledges the second byte of a
general call if the second byte is 0x04 or 0x06, or if the second byte is a hardware general call and SCTL, Bit 3 is set to 1.