UM10360 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2013. All rights reserved.
User manual Rev. 3 — 19 December 2013 371 of 841
NXP Semiconductors
UM10360
Chapter 16: LPC176x/5x CAN1/2
16.7.18 CAN Wake-up Flags register (CANWAKEFLAGS - 0x400F C114)
This register provides the wake-up status for the two CAN channels and allows clearing
wake-up events. Refer to Section 16.8.2 “
Sleep mode” for more information on the CAN
sleep feature.
16.8 CAN controller operation
16.8.1 Error handling
The CAN Controllers count and handle transmit and receive errors as specified in CAN
Spec 2.0B. The Transmit and Receive Error Counters are incriminated for each detected
error and are decremented when operation is error-free. If the Transmit Error counter
contains 255 and another error occurs, the CAN Controller is forced into a state called
Bus-Off. In this state, the following register bits are set: BS in CANxSR, BEI and EI in
CANxIR if these are enabled, and RM in CANxMOD. RM resets and disables much of the
CAN Controller. Also at this time the Transmit Error Counter is set to 127 and the Receive
Error Counter is cleared. Software must next clear the RM bit. Thereafter the Transmit
Error Counter will count down 128 occurrences of the Bus Free condition (11 consecutive
recessive bits). Software can monitor this countdown by reading the Tx Error Counter.
When this countdown is complete, the CAN Controller clears BS and ES in CANxSR, and
sets EI in CANxSR if EIE in IER is 1.
The Tx and Rx error counters can be written if RM in CANxMOD is 1. Writing 255 to the
Tx Error Counter forces the CAN Controller to Bus-Off state. If Bus-Off (BS in CANxSR) is
1, writing any value 0 through 254 to the Tx Error Counter clears Bus-Off. When software
clears RM in CANxMOD thereafter, only one Bus Free condition (11 consecutive
recessive bits) is needed before operation resumes.
16.8.2 Sleep mode
The CAN Controller will enter sleep mode if the SM bit in the CAN Mode register is 1, no
CAN interrupt is pending, and there is no activity on the CAN bus. Software can only set
SM when RM in the CAN Mode register is 0; it can also set the WUIE bit in the CAN
Interrupt Enable register to enable an interrupt on any wake-up condition.
Table 336. CAN Wake-up Flags register (CANWAKEFLAGS - address 0x400F C114) bit description
Bit Symbol Function Reset Value
0 - Reserved, user software should not write ones to reserved bits. The value read from
a reserved bit is not defined.
NA
1 CAN1WAKE Wake-up status for CAN channel 1.
Read: when 1, indicates that a falling edge has occurred on the receive data line of
CAN channel 1.
Write: writing a 1 clears this bit.
0
2 CAN2WAKE Wake-up status for CAN channel 2.
Read: when 1, indicates that a falling edge has occurred on the receive data line of
CAN channel 2.
Write: writing a 1 clears this bit.
0
31:3 - Reserved, user software should not write ones to reserved bits. The value read from
a reserved bit is not defined.
NA