UM10208_2
© NXP B.V. 2007. All rights reserved.
User manual
Rev. 02 — 1 June 2007
201 of 362
NXP Semiconductors
UM10208
Chapter 16: LPC2800 I
2
C
6.11 I
2
C Tx Byte Count Register (I2TXB - 0x8002 0824)
6.12 I
2
C Slave Transmit Register (I2TXS - 0x8002 0828)
6.13 I
2
C Slave Tx FIFO Level Register (I2STFL - 0x8002 082C)
7.
Selecting the appropriate I
2
C data rate and duty cycle
Software must set values for the registers I2CLKHI and I2CLKLO to select the appropriate
data rate and duty cycle. I2CLKLO defines the number of PCLK cycles for the SCL high
time, I2CLKLO defines the number of PCLK cycles for the SCL low time. The frequency is
determined by the following formula (f
PCLK
being the frequency of PCLK):
(5)
The values for I2CLKHI and I2CLKLO should not necessarily be the same. Software can
set different duty cycles on SCL by setting these two registers. For example, the I
2
C bus
specification defines the SCL low time and high time at different values for a 400 kHz I
2
C
rate. The values of the registers must ensure that the data rate is less than or equal to the
maximum I
2
C data rate range of 400 kHz. Each register value must be greater than or
equal to 4.
gives some examples of I
2
C bus rates based on PCLK
frequency and I2CLKLO and I2CLKHI values.
Table 226: I
2
C Tx Byte Count Register (I2TXB - 0x8002 0824)
Bit
Description
Reset
value
6:0
This read-only register is cleared whenever the I
2
C interface becomes active as a
transmitter, and is incremented by 1 for each byte sent. If more than 127 bytes
are sent, this counter rolls over to zero.
0
31:7
Reserved. The value read from a reserved bit is not defined.
-
Table 227: I
2
C Slave Transmit Register (I2TXS - 0x8002 0828)
Bit
Description
Reset
value
7:0
If the Slave Transmit FIFO is not full, software or a DMA channel can write a byte
into the Slave Transmit FIFO by writing this write-only register. This register
should not be written if the Slave Transmit FIFO is full. Bit 7 is sent first.
31:8
Reserved, user software should not write ones to reserved bits.
-
Table 228: I
2
C Slave Tx FIFO Level Register (I2STFL - 0x8002 082C)
Bit
Description
Reset
value
4:0
This read-only register contains the number of unsent bytes in the Slave Transmit
FIFO.
0
31:5
Reserved. The value read from a reserved bit is not defined.
-
I2C
bitfrequency
f
PCLK
I2CLKHI
I2CLKLO
+
---------------------------------------------------------
=