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 540 of 547
NXP Semiconductors
UM10398
Chapter 29: Supplementary information
15.11.9.3 State: 0xB8 . . . . . . . . . . . . . . . . . . . . . . . . . . 280
15.11.9.4 State: 0xC0. . . . . . . . . . . . . . . . . . . . . . . . . . 281
15.11.9.5 State: 0xC8 . . . . . . . . . . . . . . . . . . . . . . . . . 281
Chapter 16: LPC111x/LPC11Cxx C_CAN controller
16.1 How to read this chapter. . . . . . . . . . . . . . . . 282
16.2 Basic configuration . . . . . . . . . . . . . . . . . . . . 282
16.3 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
16.4 General description. . . . . . . . . . . . . . . . . . . . 283
16.5 Pin description. . . . . . . . . . . . . . . . . . . . . . . . 284
16.6 Register description . . . . . . . . . . . . . . . . . . . 284
16.6.1 CAN protocol registers . . . . . . . . . . . . . . . . . 286
16.6.1.1 CAN control register . . . . . . . . . . . . . . . . . . . 286
16.6.1.2 CAN status register . . . . . . . . . . . . . . . . . . . 287
16.6.1.3 CAN error counter . . . . . . . . . . . . . . . . . . . . 289
16.6.1.4 CAN bit timing register . . . . . . . . . . . . . . . . . 290
Baud rate prescaler . . . . . . . . . . . . . . . . . . . .290
Time segments 1 and 2 . . . . . . . . . . . . . . . . .290
Synchronization jump width . . . . . . . . . . . . . .290
16.6.1.5 CAN interrupt register . . . . . . . . . . . . . . . . . 291
16.6.1.6 CAN test register . . . . . . . . . . . . . . . . . . . . . 291
16.6.1.7 CAN baud rate prescaler extension register 292
16.6.2 Message interface registers . . . . . . . . . . . . . 292
16.6.2.1 Message objects . . . . . . . . . . . . . . . . . . . . . 293
16.6.2.2 CAN message interface command request
registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
16.6.2.3 CAN message interface command mask
registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
16.6.2.4 IF1 and IF2 message buffer registers. . . . . . 296
16.6.2.4.1 CAN message interface mask 1 registers . . 297
16.6.2.4.2 CAN message interface mask 2 registers . . 297
16.6.2.4.3 CAN message interface c arbitration 1
registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
16.6.2.4.4 CAN message interface arbitration 2
registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
16.6.2.4.5 CAN message interface message control
registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
16.6.2.4.6 CAN message interface data A1 registers . 300
16.6.2.4.7 CAN message interface data A2 registers . . 300
16.6.2.4.8 CAN message interface data B1 registers . 301
16.6.2.4.9 CAN message interface data B2 registers . 301
16.6.3 Message handler registers . . . . . . . . . . . . . . 301
16.6.3.1 CAN transmission request 1 register . . . . . . 301
16.6.3.2 CAN transmission request 2 register . . . . . . 301
16.6.3.3 CAN new data 1 register. . . . . . . . . . . . . . . . 302
16.6.3.4 CAN new data 2 register . . . . . . . . . . . . . . . 302
16.6.3.5 CAN interrupt pending 1 register . . . . . . . . 303
16.6.3.6 CAN interrupt pending 2 register . . . . . . . . 303
16.6.3.7 CAN message valid 1 register . . . . . . . . . . 303
16.6.3.8 CAN message valid 2 register . . . . . . . . . . 304
16.6.4 CAN timing register . . . . . . . . . . . . . . . . . . . 304
16.6.4.1 CAN clock divider register . . . . . . . . . . . . . . 304
16.7 Functional description . . . . . . . . . . . . . . . . . 304
16.7.1 C_CAN controller state after reset. . . . . . . . 304
16.7.2 C_CAN operating modes . . . . . . . . . . . . . . . 305
16.7.2.1 Software initialization . . . . . . . . . . . . . . . . . . 305
16.7.2.2 CAN message transfer. . . . . . . . . . . . . . . . . 305
16.7.2.3 Disabled Automatic Retransmission (DAR) . 306
16.7.2.4 Test modes. . . . . . . . . . . . . . . . . . . . . . . . . . 306
16.7.2.4.1 Silent mode . . . . . . . . . . . . . . . . . . . . . . . . . 306
16.7.2.4.2 Loop-back mode . . . . . . . . . . . . . . . . . . . . . 307
16.7.2.4.3 Loop-back mode combined with Silent mode 307
16.7.2.4.4 Basic mode . . . . . . . . . . . . . . . . . . . . . . . . . 308
16.7.2.4.5 Software control of pin CAN_TXD . . . . . . . . 308
16.7.3 CAN message handler . . . . . . . . . . . . . . . . 309
16.7.3.1 Management of message objects . . . . . . . . 310
16.7.3.2 Data Transfer between IFx Registers and the
Message RAM . . . . . . . . . . . . . . . . . . . . . . . . 311
16.7.3.3 Transmission of messages between the shift
registers in the CAN core and the Message
buffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
16.7.3.4 Acceptance filtering of received messages . . 311
16.7.3.4.1 Reception of a data frame . . . . . . . . . . . . . . 312
16.7.3.4.2 Reception of a remote frame . . . . . . . . . . . . 312
16.7.3.5 Receive/transmit priority . . . . . . . . . . . . . . . 312
16.7.3.6 Configuration of a transmit object . . . . . . . . 312
16.7.3.7 Updating a transmit object . . . . . . . . . . . . . . 313
16.7.3.8 Configuration of a receive object . . . . . . . . . 313
16.7.3.9 Handling of received messages. . . . . . . . . . 314
16.7.3.10 Configuration of a FIFO buffer . . . . . . . . . . . 315
16.7.3.10.1 Reception of messages with FIFO buffers. 315
16.7.3.10.2 Reading from a FIFO buffer. . . . . . . . . . . . 315
16.7.4 Interrupt handling . . . . . . . . . . . . . . . . . . . . . 316
16.7.5 Bit timing . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
16.7.5.1 Bit time and bit rate . . . . . . . . . . . . . . . . . . . 318
16.7.5.2 Calculating the C_CAN bit rate . . . . . . . . . . 319
Chapter 17: LPC11Cxx C_CAN on-chip drivers
17.1 How to read this chapter. . . . . . . . . . . . . . . . 320
17.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
17.3 General description. . . . . . . . . . . . . . . . . . . . 320
17.3.1 Differences to fully-compliant CANopen. . . . 320
17.4 API description . . . . . . . . . . . . . . . . . . . . . . . 321
17.4.1 Calling the C_CAN API. . . . . . . . . . . . . . . . . 321
17.4.2 CAN initialization . . . . . . . . . . . . . . . . . . . . . 322
17.4.3 CAN interrupt handler. . . . . . . . . . . . . . . . . . 322
17.4.4 CAN Rx message object configuration . . . . 322
17.4.5 CAN receive. . . . . . . . . . . . . . . . . . . . . . . . . 323
17.4.6 CAN transmit . . . . . . . . . . . . . . . . . . . . . . . . 323
17.4.7 CANopen configuration . . . . . . . . . . . . . . . . 324
17.4.8 CANopen handler . . . . . . . . . . . . . . . . . . . . 326
17.4.9 CAN/CANopen callback functions . . . . . . . . 326
17.4.10 CAN message received callback . . . . . . . . . 327
17.4.11 CAN message transmit callback . . . . . . . . . 327
17.4.12 CAN error callback. . . . . . . . . . . . . . . . . . . . 328