ES_LPC12D27 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2013. All rights reserved.
Errata sheet Rev. 1.2 — 13 September 2013 5 of 8
NXP Semiconductors
ES_LPC12D27
Errata sheet LPC12D27
3.3 I2C.1: In the slave-transmitter mode, the device set in the monitor
mode must write a dummy value of 0xFF into the DAT register
Introduction:
The I2C monitor allows the device to monitor the I2C traffic on the I
2
C-bus in a
non-intrusive way.
Problem:
In the slave-transmitter mode, the device set in the monitor mode must write a dummy
value of 0xFF into the DAT register. If this is not done, the received data from the slave
device will be corrupted. To allow the monitor mode to have sufficient time to process the
data on the I
2
C-bus, the device may need to have the ability to stretch the I2C clock.
Under this condition, the I2C monitor mode is not 100 % non-intrusive.
Work-around:
When setting the device in monitor mode, enable the ENA_SCL bit in the MMCTRL
register to allow clock stretching.
Software code example to enable the ENA_SCL bit:
LPC_I2C_MMCTRL |= (1<<1); //Enable ENA_SCL bit
In the I2C ISR routine, for the status code related to the slave-transmitter mode, write the
value of 0xFF into the DAT register to prevent data corruption. In order to avoid stretching
the SCL clock, the data byte can be saved in a buffer and processed in the Main loop.
This ensures the SI flag is cleared as fast as possible.
Software code example for the slave-transmitter mode:
case 0xA8: // Own SLA + R has been received, ACK returned
case 0xB0:
case 0xB8: // data byte in DAT transmitted, ACK received
case 0xC0: // (last) data byte transmitted, NACK received
case 0xC8: // last data byte in DAT transmitted, ACK received
DataByte = LPC_I2C->DATA_BUFFER;//Save data. Data can be process in Main loop
LPC_I2C->DAT = 0xFF; // Pretend to shift out 0xFF
LPC_I2C->CONCLR = 0x08; // clear flag SI
break;