Datasheet

UM10398 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2014. All rights reserved.
User manual Rev. 12.3 — 10 June 2014 539 of 547
NXP Semiconductors
UM10398
Chapter 29: Supplementary information
14.7.2.3 SPI format with CPOL=0,CPHA=1 . . . . . . . . 234
14.7.2.4 SPI format with CPOL = 1,CPHA = 0 . . . . . . 234
14.7.2.5 SPI format with CPOL = 1,CPHA = 1 . . . . . . 236
14.7.3 Semiconductor Microwire frame format . . . . 236
14.7.3.1 Setup and hold time requirements on CS with
respect to SK in Microwire mode . . . . . . . . . 238
Chapter 15: LPC111x/LPC11Cxx I2C-bus controller
15.1 How to read this chapter. . . . . . . . . . . . . . . . 239
15.2 Basic configuration . . . . . . . . . . . . . . . . . . . . 239
15.3 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
15.4 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . 239
15.5 General description. . . . . . . . . . . . . . . . . . . . 240
15.5.1 I
2
C Fast-mode Plus . . . . . . . . . . . . . . . . . . . 240
15.6 Pin description. . . . . . . . . . . . . . . . . . . . . . . . 241
15.7 Register description . . . . . . . . . . . . . . . . . . . 241
15.7.1 I
2
C Control Set register (I2C0CONSET -
0x4000 0000) . . . . . . . . . . . . . . . . . . . . . . . . 242
15.7.2 I
2
C Status register (I2C0STAT - 0x4000
0004) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
15.7.3 I
2
C Data register (I2C0DAT - 0x4000 0008) . 244
15.7.4 I
2
C Slave Address register 0 (I2C0ADR0-
0x4000 000C) . . . . . . . . . . . . . . . . . . . . . . . . 244
15.7.5 I
2
C SCL HIGH and LOW duty cycle registers
(I2C0SCLH - 0x4000 0010 and I2C0SCLL-
0x4000 0014) . . . . . . . . . . . . . . . . . . . . . . . . 245
15.7.5.1 Selecting the appropriate I
2
C data rate and duty
cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
15.7.6 I
2
C Control Clear register (I2C0CONCLR -
0x4000 0018) . . . . . . . . . . . . . . . . . . . . . . . . 246
15.7.7 I
2
C Monitor mode control register (I2C0MMCTRL
- 0x4000 001C). . . . . . . . . . . . . . . . . . . . . . . 246
15.7.7.1 Interrupt in Monitor mode . . . . . . . . . . . . . . . 247
15.7.7.2 Loss of arbitration in Monitor mode . . . . . . . 248
15.7.8 I
2
C Slave Address registers (I2C0ADR[1, 2, 3] -
0x4000 00[20, 24, 28]) . . . . . . . . . . . . . . . . . 248
15.7.9 I
2
C Data buffer register (I2C0DATA_BUFFER -
0x4000 002C) . . . . . . . . . . . . . . . . . . . . . . . . 248
15.7.10 I
2
C Mask registers (I2C0MASK[0, 1, 2, 3] -
0x4000 00[30, 34, 38, 3C]) . . . . . . . . . . . . . . 249
15.8 I
2
C operating modes . . . . . . . . . . . . . . . . . . . 249
15.8.1 Master Transmitter mode . . . . . . . . . . . . . . . 249
15.8.2 Master Receiver mode . . . . . . . . . . . . . . . . . 250
15.8.3 Slave Receiver mode . . . . . . . . . . . . . . . . . . 251
15.8.4 Slave Transmitter mode . . . . . . . . . . . . . . . . 252
15.9 I
2
C implementation and operation . . . . . . . . 252
15.9.1 Input filters and output stages. . . . . . . . . . . . 253
15.9.2 Address Registers, ADDR0 to ADDR3. . . . . 254
15.9.3 Address mask registers, MASK0 to MASK3. 254
15.9.4 Comparator. . . . . . . . . . . . . . . . . . . . . . . . . . 254
15.9.5 Shift register, DAT. . . . . . . . . . . . . . . . . . . . . 254
15.9.6 Arbitration and synchronization logic . . . . . . 254
15.9.7 Serial clock generator. . . . . . . . . . . . . . . . . . 255
15.9.8 Timing and control . . . . . . . . . . . . . . . . . . . . 256
15.9.9 Control register, CONSET and CONCLR . . . 256
15.9.10 Status decoder and status register . . . . . . . . 256
15.10 Details of I
2
C operating modes. . . . . . . . . . . 256
15.10.1 Master Transmitter mode . . . . . . . . . . . . . . . 257
15.10.2 Master Receiver mode . . . . . . . . . . . . . . . . . 261
15.10.3 Slave Receiver mode. . . . . . . . . . . . . . . . . . 264
15.10.4 Slave Transmitter mode. . . . . . . . . . . . . . . . 268
15.10.5 Miscellaneous states . . . . . . . . . . . . . . . . . . 270
15.10.5.1 STAT = 0xF8 . . . . . . . . . . . . . . . . . . . . . . . . 270
15.10.5.2 STAT = 0x00 . . . . . . . . . . . . . . . . . . . . . . . . 270
15.10.6 Some special cases. . . . . . . . . . . . . . . . . . . 271
15.10.6.1 Simultaneous Repeated START conditions from
two masters . . . . . . . . . . . . . . . . . . . . . . . . . 271
15.10.6.2 Data transfer after loss of arbitration . . . . . . 272
15.10.6.3 Forced access to the I
2
C-bus. . . . . . . . . . . . 272
15.10.6.4 I
2
C-bus obstructed by a LOW level on SCL or
SDA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
15.10.6.5 Bus error . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
15.10.7 I
2
C state service routines. . . . . . . . . . . . . . . 273
15.10.8 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . 274
15.10.9 I
2
C interrupt service . . . . . . . . . . . . . . . . . . . 274
15.10.10 The state service routines . . . . . . . . . . . . . . 274
15.10.11 Adapting state services to an application. . . 274
15.11 Software example . . . . . . . . . . . . . . . . . . . . . 274
15.11.1 Initialization routine . . . . . . . . . . . . . . . . . . . 274
15.11.2 Start Master Transmit function . . . . . . . . . . . 274
15.11.3 Start Master Receive function . . . . . . . . . . . 275
15.11.4 I
2
C interrupt routine . . . . . . . . . . . . . . . . . . . 275
15.11.5 Non mode specific states. . . . . . . . . . . . . . . 275
15.11.5.1 State: 0x00. . . . . . . . . . . . . . . . . . . . . . . . . . 275
15.11.5.2 Master States. . . . . . . . . . . . . . . . . . . . . . . . 275
15.11.5.3 State: 0x08. . . . . . . . . . . . . . . . . . . . . . . . . . 275
15.11.5.4 State: 0x10. . . . . . . . . . . . . . . . . . . . . . . . . . 276
15.11.6 Master Transmitter states . . . . . . . . . . . . . . 276
15.11.6.1 State: 0x18. . . . . . . . . . . . . . . . . . . . . . . . . . 276
15.11.6.2 State: 0x20. . . . . . . . . . . . . . . . . . . . . . . . . . 276
15.11.6.3 State: 0x28. . . . . . . . . . . . . . . . . . . . . . . . . . 276
15.11.6.4 State: 0x30. . . . . . . . . . . . . . . . . . . . . . . . . . 277
15.11.6.5 State: 0x38. . . . . . . . . . . . . . . . . . . . . . . . . . 277
15.11.7 Master Receive states . . . . . . . . . . . . . . . . . 277
15.11.7.1 State: 0x40. . . . . . . . . . . . . . . . . . . . . . . . . . 277
15.11.7.2 State: 0x48. . . . . . . . . . . . . . . . . . . . . . . . . . 277
15.11.7.3 State: 0x50. . . . . . . . . . . . . . . . . . . . . . . . . . 277
15.11.7.4 State: 0x58. . . . . . . . . . . . . . . . . . . . . . . . . . 278
15.11.8 Slave Receiver states . . . . . . . . . . . . . . . . . 278
15.11.8.1 State: 0x60. . . . . . . . . . . . . . . . . . . . . . . . . . 278
15.11.8.2 State: 0x68. . . . . . . . . . . . . . . . . . . . . . . . . . 278
15.11.8.3 State: 0x70. . . . . . . . . . . . . . . . . . . . . . . . . . 278
15.11.8.4 State: 0x78. . . . . . . . . . . . . . . . . . . . . . . . . . 279
15.11.8.5 State: 0x80. . . . . . . . . . . . . . . . . . . . . . . . . . 279
15.11.8.6 State: 0x88. . . . . . . . . . . . . . . . . . . . . . . . . . 279
15.11.8.7 State: 0x90. . . . . . . . . . . . . . . . . . . . . . . . . . 279
15.11.8.8 State: 0x98. . . . . . . . . . . . . . . . . . . . . . . . . . 280
15.11.8.9 State: 0xA0. . . . . . . . . . . . . . . . . . . . . . . . . . 280
15.11.9 Slave Transmitter states . . . . . . . . . . . . . . . 280
15.11.9.1 State: 0xA8. . . . . . . . . . . . . . . . . . . . . . . . . . 280
15.11.9.2 State: 0xB0. . . . . . . . . . . . . . . . . . . . . . . . . . 280