Communication Processor Module
MOTOROLA
MPC823e REFERENCE MANUAL
16-459
I
2
C
COMMUNICATION
16
PROCESSOR MODULE
16.13.3.1.1 Master Write.
To begin a write operation to a slave device that contains
internal addresses, you must prepare a TX data buffer that is N+2 bytes in length. The first
byte contains the 7-bit device address followed by the write bit asserted (R/W
= 0). The
second byte contains the internal base address of the write. The remaining N bytes contain
the data to be written to the slave. The slave device will process the N bytes of data
sequentially, starting at the specified base address.
To begin a master write operation to a slave device that does not contain internal addresses,
you must prepare a TX data buffer that is N+1 bytes long. The first byte contains the 7-bit
slave device address followed by the write bit asserted (R/W
= 0). The remaining N bytes
contain the data to be written to the slave.
Next, when communicating to either slave device, the W and L bits must be set in the TX
buffer descriptor. Set the I bit in the TX buffer descriptor to enable the transmission status
to be updated in the I2CE register and to enable I
2
C interrupts to the core. Set the R bit in
the TX buffer descriptor to prepare the buffer for transmission. The final step is to set the
STR bit in the I2COM register to initiate transmission. The data starts transmitting once the
SDMA channel loads the transmit FIFO with data and the I
2
C bus is not busy.
Figure 16-128. Byte Write to Device with Internal Addresses
Figure 16-129. Byte Write to Device without Internal Addresses
Note:
Some slave devices, such as serial E2PROMs, may have a minimum write cycle
time. For these devices, the
I
2
C
controller must wait a minimum amount of time
after a write before initiating the next read or write. The required delay must be
implemented in software.
SDA
DEVICE ADDR
W
BASE ADDR
DATA BYTE
A
C
K
A
C
K
A
C
K
S
T
A
R
T
S
T
O
P
NOTE: DATA AND ACK ARE REPEATED N TIMES.
SDA
DEVICE ADDR
W
DATA BYTE
S
T
A
R
T
S
T
O
P
A
C
K
A
C
K
NOTE: DATA AND ACK ARE REPEATED N TIMES.