UG-498
ADuCM320 Hardware Reference Manual
Rev. C | Page 104 of 196
I
2
C Slave Mode Late Loading of I2CSTX Issue
If a byte with the MSB equal to 0 is loaded into I2CxSTX just after the ninth rising edge of SCL during a read operation, the I
2
C slave pulls
the SDA pin low and holds it indefinitely. I2CxSTX can be loaded before the rising edge of the ninth clock by preloading it in advance or
during the preceding Rx interrupt. The SDA pin can be released by performing a chip reset, or the master can generate more clocks until
the slave releases the SDA pin, and then the master should generate a stop condition.
Master NACK
When receiving data, the master responds with a NACK 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, then simply not writing data into the slave transmit FIFO results in a NACK.
If the slave does not want to acknowledge a master write, assert the NACK bit in the slave control register, I2CxSCON[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 it does not acknowledge subsequent bytes not written to the FIFO. The master should then stop the transaction.
The slave does not acknowledge a matching device address if the read/write 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 ACK. It is recommended that
EARLYTXR (I2CxSCON[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, address byte is
followed by a command byte.
If the address byte is 0x00, then 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, GCID
(I2CxSSTA[9:8]), are 0x1. User code should 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 (GCID) 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 should take corrective action
to reprogram the device address.
If GCEN is asserted, the slave always acknowledges the first byte of a general call. It 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 HGCEN (I2CxSCON[3]) is asserted.
The I2CxALT register contains the alternate device ID for a hardware general call sequence. If the hardware general call enable bit
(HGCEN), the general call enable bit (GCEN), and the slave enable bit (SLVEN) are all set, the device recognizes a hardware general call.
When a general call sequence is issued and the second byte of the sequence is identical to ALT, the hardware call sequence is recognized
for the device.
I
2
C Reset Mode
The slave state machine is reset when SLVEN is written to 0.
The master state machine is reset when MASEN is written to 0.
I
2
C Test Modes
The device can be placed in an internal loopback mode by setting the LOOPBACK bit (I2CxMCON[2]). There are four FIFOs (master Tx
and Rx, and slave Tx and Rx); therefore the I
2
C peripheral can, in effect, be set up to talk to itself. External loopback can be performed if
the master is set up to address the slave address.
I
2
C Low Power Mode
If the master and slave are both disabled (MASEN = SLVEN = 0), the I
2
C section is off. To fully power down the I
2
C block, the clock to
the I
2
C section of the chip should be disabled by setting CLKCON5[4:3] = 0x3
DMA Requests
Four DMA channels are required to service the I
2
C master and slave. DMA enable bits are provided in the slave control register and in the
master control register.