English
Language : 

Z8F4822AR020SG Datasheet, PDF (152/323 Pages) Zilog, Inc. – High Performance 8-Bit Microcontrollers
Z8 Encore! XP® F64xx Series
Product Specification
132
Start and Stop Conditions
The master (I2C) drives all Start and Stop signals and initiates all transactions. To start a
transaction, the I2C Controller generates a start condition by pulling the SDA signal Low
while SCL is High. To complete a transaction, the I2C Controller generates a Stop condi-
tion by creating a low-to-High transition of the SDA signal while the SCL signal is High.
The start and stop bits in the I2C Control Register control the sending of the Start and Stop
conditions. A master is also allowed to end one transaction and begin a new one by issuing
a Restart. This is accomplished by setting the start bit at the end of a transaction, rather
than the stop bit. Note that the Start condition not sent until the start bit is set and data has
been written to the I2C Data Register.
Master Write and Read Transactions
The following sections provide a recommended procedure for performing I2C write and
read transactions from the I2C Controller (master) to slave I2C devices. In general soft-
ware should rely on the TDRE, RDRF and NCKI bits of the status register (these bits gen-
erate interrupts) to initiate software actions. When using interrupts or DMA, the TXI bit is
set to start each transaction and cleared at the end of each transaction to eliminate a trail-
ing transmit interrupt.
Caution should be used in using the ACK status bit within a transaction because it is diffi-
cult for software to tell when it is updated by hardware.
When writing data to a slave, the I2C pauses at the beginning of the Acknowledge cycle if
the data register has not been written with the next value to be sent (TDRE bit in the I2C
Status Register = 1). In this scenario where software is not keeping up with the I2C bus
(TDRE asserted longer than one byte time), the Acknowledge clock cycle for byte n is
delayed until the Data Register is written with byte n + 1, and appears to be grouped with
the data clock cycles for byte n+1. If either the start or stop bit is set, the I2C does not
pause prior to the Acknowledge cycle because no additional data is sent.
When a Not Acknowledge condition is received during a write (either during the address
or data phases), the I2C Controller generates the Not Acknowledge interrupt (NCKI = 1)
and pause until either the stop or start bit is set. Unless the Not Acknowledge was received
on the last byte, the Data Register will already have been written with the next address or
data byte to send. In this case the flush bit of the Control Register should be set at the same
time the stop or start bit is set to remove the stale transmit data and enable subsequent
transmit interrupts.
When reading data from the slave, the I2C pauses after the data Acknowledge cycle until
the receive interrupt is serviced and the RDRF bit of the status register is cleared by read-
ing the I2C Data Register. Once the I2C data register has been read, the I2C reads the next
data byte.
PS019924-0113
PRELIMINARY
Operation