Download LPC2131/2132/2138 User Manual

Transcript
Philips Semiconductors
Preliminary User Manual
ARM-based Microcontroller
Reception of the ow n
Slave Address and one or
more Data bytes
All are acknow ledged
LPC2131/2132/2138
S
SLA
R
A
A8H
Arbitration lost as Master
and addressed as Slave
Data
A
Data
B8H
A
P or S
C0H
A
B0H
Last data byte
transmitted. Sw itched to
Not Addressed Slave
(AA bit in I2CON = “0”)
A
all ones P or S
C8H
From Master to Slave
From Slave to Master
Data
n
A
Any number of data bytes and their associated Acknow ledge bits
This number (contained in I2STA) corresponds to a defined state of the I2C
bus.
Figure 32: Format and States of the Slave Transmitter Mode
Slave Transmitter Mode
In the slave transmitter mode, a number of data bytes are transmitted to a master receiver (see Figure 32). Data transfer is
initialized as in the slave receiver mode. When I2ADR and I2CON have been initialized, the I2C block waits until it is addressed
by its own slave address followed by the data direction bit which must be “1” (R) for the I2C block to operate in the slave
transmitter mode. After its own slave address and the R bit have been received, the serial interrupt flag (SI) is set and a valid
status code can be read from I2STAT. This status code is used to vector to a state service routine, and the appropriate action to
be taken for each of these status codes is detailed in Table 105. The slave transmitter mode may also be entered if arbitration is
lost while the I2C block is in the master mode (see state B0H).
If the AA bit is reset during a transfer, the I2C block will transmit the last byte of the transfer and enter state C0H or C8H. The I2C
block is switched to the not addressed slave mode and will ignore the master receiver if it continues the transfer. Thus the master
receiver receives all 1s as serial data. While AA is reset, the I2C block does not respond to its own slave address or a general
call address. However, the I2C bus is still monitored, and address recognition may be resumed at any time by setting AA. This
means that the AA bit may be used to temporarily isolate the I2C block from the I2C bus.
I2C Interfaces I2C0 and I2C1
134
November 22, 2004