![](http://datasheet.mmic.net.cn/290000/XPC801ZP25_datasheet_16187868/XPC801ZP25_400.png)
Serial Communication Modules
MOTOROLA
MPC801 USER’S MANUAL
16-29
16
The I
2
C sets the E bit of the I2CER and issues a maskable interrupt to the system interface
unit interrupt controller whenever its transmit buffer is not full. The I
2
C also sets the E bit after
sending the last word. In response, the core should read the exception flags that relate to
the last word. When a master I
2
C read operation is to be performed, the core should supply
the I
2
C with a first byte that contains the slave’s address with the R/W bit set. The master
I
2
C determines the length of the incoming massage. The core continues to supply data to
the I
2
C master’s transmitter, but the following data bytes are ignored by the I
2
C controller
and the transmission procedure is performed without actual transmission occurring. That is,
until it encounters a byte containing the L bit. When this byte is encountered, the
transmission procedure is performed and the reception process ends.
The receiver starts reception after it finds the start condition on the SDA and SCL pins.The
I
2
C notifies the core by setting the F bit in the I2CER.The core is responsible for emptying
the buffer for the next data. This process continues until a new start or stop condition is
detected. If a mismatch is found, the receiver stops receiving and searches again for a new
start condition. The receiver acknowledges each data byte as long as an overrun condition
does not occur.
16.3.3.3.2 I
2
C Slave Mode.
When the I
2
C controller is in slave mode, it receives messages
from an I
2
C master and replies to them. Once a slave mode operation is selected in the
I2MOD register, the SCL pin becomes an input from the master to the slave. The SCL pin
may vary from DC to the BRGCLK/48 (520KHz for a 25MHz system). Before data is
exchanged, the core writes the data to be transmitted into the I2CTD register. The core then
clears the M/S bits and sets the STR bit in the I2COM register to enable the I
2
C controller to
prepare the data for transmission and wait for a read request from the master.
When a match is detected between the first byte received after a start condition and the
slave address, the R/W bit is checked. If a write operation was requested by the master
(R/W =0), the data received is acknowledged and written into a receive FIFO. A maskable
interrupt is issued when a character is fully received. This process continues until the last
character has been sent or an error has occurred. The PowerPC master is responsible for
emptying the buffer to ensure smooth operation.
If a read operation was requested by the I
2
C master (R/W=1), the recently received address
byte is only acknowledged if the transmitter FIFO has been loaded by the core. If the
transmitter is ready, transmission starts on the next clock pulse after the acknowledgment.
Otherwise, the transaction is aborted and the UN bit in the I2CER is set to notify the software
to prepare data for transmission on the next attempt. If an underrun condition occurred, the
slave transmits ones until a stop condition is detected.
After each byte, the transmitter checks the acknowledge bit. If the master receiver fails to
acknowledge a byte transmission is aborted and the NAK bit in the I2CER is set. Data is
shifted out from the slave on the SDA pin.