Nxp semiconductors, 8 selecting the appropriate i, C data rate and duty cycle – NXP Semiconductors LPC24XX UM10237 User Manual

Page 585

Advertising
background image

UM10237_4

© NXP B.V. 2009. All rights reserved.

User manual

Rev. 04 — 26 August 2009

585 of 792

NXP Semiconductors

UM10237

Chapter 22: LPC24XX I

2

C interfaces I

2

C0/1/2

8.4 I

2

C Data Register (I2C[0/1/2]DAT - 0xE001 C008, 0xE005 C008,

0xE008 0008)

This register contains the data to be transmitted or the data just received. The CPU can
read and write to this register only while it is not in the process of shifting a byte, when the
SI bit is set. Data in I2DAT remains stable as long as the SI bit is set. Data in I2DAT is
always shifted from right to left: the first bit to be transmitted is the MSB (bit 7), and after a
byte has been received, the first bit of received data is located at the MSB of I2DAT.

8.5 I

2

C Slave Address Register (I2C[0/1/2]ADR - 0xE001 C00C,

0xE005 C00C, 0xE008 000C)

These registers are readable and writable, and is only used when an I

2

C interface is set to

slave mode. In master mode, this register has no effect. The LSB of I2ADR is the general
call bit. When this bit is set, the general call address (0x00) is recognized.

8.6 I

2

C SCL High Duty Cycle Register (I2C[0/1/2]SCLH - 0xE001 C010,

0xE005 C010, 0xE008 0010)

8.7 I

2

C SCL Low Duty Cycle Register (I2C[0/1/2]SCLL - 0xE001 C014,

0xE005 C014, 0xE008 0014)

8.8 Selecting the appropriate I

2

C data rate and duty cycle

Software must set values for the registers I2SCLH and I2SCLL to select the appropriate
data rate and duty cycle. I2SCLH defines the number of PCLK cycles for the SCL high
time, I2SCLL 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):

Table 516. I

2

C Data Register ( I2C[0/1/2]DAT - addresses 0xE001 C008, 0xE005 C008,

0xE008 0008) bit description

Bit Symbol

Description

Reset Value

7:0 Data

This register holds data values that have been received, or are to
be transmitted.

0

Table 517. I

2

C Slave Address register (I2C[0/1/2]ADR - addresses 0xE001 C00C,

0xE005 C00C, 0xE008 000C) bit description

Bit Symbol

Description

Reset Value

0

GC

General Call enable bit.

0

7:1 Address

The I

2

C device address for slave mode.

0x00

Table 518. I

2

C SCL High Duty Cycle register (I2C[0/1/2]SCLH - addresses 0xE001 C010,

0xE005 C010, 0xE008 0010) bit description

Bit

Symbol

Description

Reset Value

15:0

SCLH

Count for SCL HIGH time period selection.

0x0004

Table 519. I

2

C SCL Low Duty Cycle register (I2C[0/1/2]SCLL - addresses 0xE001 C014,

0xE005 C014, 0xE008 0014) bit description

Bit

Symbol

Description

Reset Value

15:0

SCLL

Count for SCL LOW time period selection.

0x0004

Advertising