UM10237_2 © NXP B.V. 2008. All rights reserved.
User manual Rev. 02 — 19 December 2008 787 o f 792
NXP Semiconductors UM10237
Chapter 36: LPC24XX Supplementary information
6.14 FIFO Counter Register (MCIFifoCnt -
0xE008 C048). . . . . . . . . . . . . . . . . . . . . . . . 571 6.15 Data FIFO Register (MCIFIFO - 0xE008 C080 to
0xE008 C0BC). . . . . . . . . . . . . . . . . . . . . . . 571
Chapter 22: LPC24XX I2C interfaces I2C0/1/2
1 Basic configuration. . . . . . . . . . . . . . . . . . . . 572
2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 572
3 Applications. . . . . . . . . . . . . . . . . . . . . . . . . . 572
4 Description. . . . . . . . . . . . . . . . . . . . . . . . . . . 572
5 Pin description. . . . . . . . . . . . . . . . . . . . . . . . 574
6I
2C operating modes . . . . . . . . . . . . . . . . . . . 574
6.1 Master Transmitter mode . . . . . . . . . . . . . . . 574
6.2 Master Receiver mode . . . . . . . . . . . . . . . . . 575
6.3 Slave Receiver mode . . . . . . . . . . . . . . . . . . 576
6.4 Slave Transmitter mode . . . . . . . . . . . . . . . . 577
7I
2C implementation and operation . . . . . . . . 577
7.1 Input filters and output stages. . . . . . . . . . . . 577
7.2 Address Register I2ADDR . . . . . . . . . . . . . . 579
7.3 Comparator. . . . . . . . . . . . . . . . . . . . . . . . . . 579
7.4 Shift register I2DAT. . . . . . . . . . . . . . . . . . . . 579
7.5 Arbitration and synchronization logic . . . . . . 579
7.6 Serial clock generator. . . . . . . . . . . . . . . . . . 580
7.7 Timing and control . . . . . . . . . . . . . . . . . . . . 580
7.8 Control register I2CONSET and I2CONCLR 580
7.9 Status decoder and status register. . . . . . . . 581
8 Register description . . . . . . . . . . . . . . . . . . . 581
8.1 I2C Control Set Register (I2C[0/1/2]CONSET:
0xE001 C000, 0xE005 C000, 0xE008 0000) 582
8.2 I2C Control Clear Register (I2C[0/1/2]CONCLR:
0xE001 C018, 0xE005 C018, 0xE008 0018) 584
8.3 I2C Status Register (I2C[0/1/2]STAT -
0xE001 C004, 0xE005 C004, 0xE008 0004) 584
8.4 I2C Data Register (I2C[0/1/2]DAT - 0xE001 C008,
0xE005 C008, 0xE0080008) . . . . . . . . . . . . 585
8.5 I2C Slave Address Register (I2C[0/1/2]ADR -
0xE001 C00C, 0xE005 C00C, 0xE008 000C) 585
8.6 I2C SCL High Duty Cycle Register
(I2C[0/1/2]SCLH - 0xE001 C010, 0xE005 C010,
0xE008 0010). . . . . . . . . . . . . . . . . . . . . . . . 585
8.7 I2C SCL Low Duty Cycle Register
(I2C[0/1/2]SCLL - 0xE001C014, 0xE005 C014,
0xE008 0014). . . . . . . . . . . . . . . . . . . . . . . . 585
8.8 Selecting the appropriate I2C data rate and duty
cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585
9 Details of I2C operating modes. . . . . . . . . . . 586
9.1 Master Transmitter mode . . . . . . . . . . . . . . . 587
9.2 Master Receiver mode . . . . . . . . . . . . . . . . . 588
9.3 Slave Receiver mode . . . . . . . . . . . . . . . . . . 588
9.4 Slave Transmitter mode . . . . . . . . . . . . . . . . 593
9.5 Miscellaneous states . . . . . . . . . . . . . . . . . . 599
22.9.5.1 I2STAT = 0xF8 . . . . . . . . . . . . . . . . . . . . . . . 599
22.9.5.2 I2STAT = 0x00 . . . . . . . . . . . . . . . . . . . . . . . 599
9.6 Some special cases . . . . . . . . . . . . . . . . . . . 600
9.7 Simultaneous repeated START conditions from
two masters . . . . . . . . . . . . . . . . . . . . . . . . . 600
9.8 Data transfer after loss of arbitration . . . . . . 600
9.9 Forced access to the I2C bus. . . . . . . . . . . . 600
9.10 I2C Bus obstructed by a Low level on SCL or SDA
601
9.11 Bus error . . . . . . . . . . . . . . . . . . . . . . . . . . . 601
9.12 I2C State service routines. . . . . . . . . . . . . . . 602
9.12.1 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . 602
9.12.2 I2C interrupt service. . . . . . . . . . . . . . . . . . . 603
9.12.3 The state service routines . . . . . . . . . . . . . . 603
9.12.4 Adapting state services to an appli cation. . . 603
10 Software example . . . . . . . . . . . . . . . . . . . . . 603
10.1 Initialization routine . . . . . . . . . . . . . . . . . . . 603
10.2 Start master transmit function . . . . . . . . . . . 603
10.3 Start master receive function . . . . . . . . . . . . 603
10.4 I2C interrupt routine . . . . . . . . . . . . . . . . . . . 604
10.5 Non mode specific states. . . . . . . . . . . . . . . 604
10.5.1 State : 0x00 . . . . . . . . . . . . . . . . . . . . . . . . . 604
10.6 Master states . . . . . . . . . . . . . . . . . . . . . . . . 604
10.6.1 State : 0x08 . . . . . . . . . . . . . . . . . . . . . . . . . 604
10.6.2 State : 0x10 . . . . . . . . . . . . . . . . . . . . . . . . . 604
10.7 Master Transmitter states . . . . . . . . . . . . . . 605
10.7.1 State : 0x18 . . . . . . . . . . . . . . . . . . . . . . . . . 605
10.7.2 State : 0x20 . . . . . . . . . . . . . . . . . . . . . . . . . 605
10.7.3 State : 0x28 . . . . . . . . . . . . . . . . . . . . . . . . . 605
10.7.4 State : 0x30 . . . . . . . . . . . . . . . . . . . . . . . . . 605
10.7.5 State : 0x38 . . . . . . . . . . . . . . . . . . . . . . . . . 606
10.8 Master Receive states . . . . . . . . . . . . . . . . . 606
10.8.1 State : 0x40 . . . . . . . . . . . . . . . . . . . . . . . . . 606
10.8.2 State : 0x48 . . . . . . . . . . . . . . . . . . . . . . . . . 606
10.8.3 State : 0x50 . . . . . . . . . . . . . . . . . . . . . . . . . 606
10.8.4 State : 0x58 . . . . . . . . . . . . . . . . . . . . . . . . . 606
10.9 Slave Receiver states . . . . . . . . . . . . . . . . . 607
10.9.1 State : 0x60 . . . . . . . . . . . . . . . . . . . . . . . . . 607
10.9.2 State : 0x68 . . . . . . . . . . . . . . . . . . . . . . . . . 607
10.9.3 State : 0x70 . . . . . . . . . . . . . . . . . . . . . . . . . 607
10.9.4 State : 0x78 . . . . . . . . . . . . . . . . . . . . . . . . . 607
10.9.5 State : 0x80 . . . . . . . . . . . . . . . . . . . . . . . . . 608
10.9.6 State : 0x88 . . . . . . . . . . . . . . . . . . . . . . . . . 608
10.9.7 State : 0x90 . . . . . . . . . . . . . . . . . . . . . . . . . 608
10.9.8 State : 0x98 . . . . . . . . . . . . . . . . . . . . . . . . . 608
10.9.9 State : 0xA0 . . . . . . . . . . . . . . . . . . . . . . . . . 608
10.10 Slave Transmitter States . . . . . . . . . . . . . . . 609
10.10.1 State : 0xA8 . . . . . . . . . . . . . . . . . . . . . . . . . 609
10.10.2 State : 0xB0 . . . . . . . . . . . . . . . . . . . . . . . . . 609
10.10.3 State : 0xB8 . . . . . . . . . . . . . . . . . . . . . . . . . 609
10.10.4 State : 0xC0 . . . . . . . . . . . . . . . . . . . . . . . . . 609
10.10.5 State : 0xC8 . . . . . . . . . . . . . . . . . . . . . . . . . 610
Chapter 23: LPC24XX I2S interface
1 Basic configuration. . . . . . . . . . . . . . . . . . . . 611 2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611