UM10208_2
© NXP B.V. 2007. All rights reserved.
User manual
Rev. 02 — 1 June 2007
206 of 362
NXP Semiconductors
UM10208
Chapter 16: LPC2800 I
2
C
8.6 Slave Receive mode
If the direction bit is 0, the ISR should set the central state variable to “slave receive”.
Then it should read the I2RX register until RFE in I2STS is 1, and store the data in the
slave receive buffer. Then the ISR can check the ACTIVE bit in I2STS. If it’s 0, the slave
receive frame is still going, and it should just dismiss the interrupt. If it’s 1, the slave
receive frame is over, and the ISR should restore the central state variable and I2CTL
from the saved values.
8.7 Slave Transmit mode
When the I
2
C ISR has read an address/direction byte and found that the direction bit is 1,
it should set the central state variable to “slave transmit”. It should then call “set_IEs” to or
NAIE and DRSIE into the previously enabled interrupts, and write the result back to
I2CTL. Then it should write as many characters as desired to the Slave Transmit FIFO via
the I2TXS register, and dismiss the interrupt.
Any subsequent interrupt with DRSI=1 in I2STS and DRSIE=1 in I2CTL means that the
master wants more data than we provided at the last interrupt. Once again the ISR should
write as many characters as desired to the Slave Transmit FIFO via the I2TXS register,
and dismiss the interrupt.
An interrupt with NAI=1, NAIE=1, and the central state variable set to “slave transmit”
means that the master followed the I
2
C specification and did not acknowledge the last
byte that it wanted. The ISR should restore the central state and I2CTL from the saved
values, and dismiss the interrupt.
Any other interrupt with the central state variable set to “slave transmit” means that the
master violated the I
2
C specification and acknowledged the last byte that it wanted. The
ISR should restore the central state and I2CTL from the saved values, before proceeding
as described in other sections based on I2STS and I2CTL.