Flexcan Error Counter Register (Errcnt) - Freescale Semiconductor MCF5329 Reference Manual

Devices supported: mcf5327; mcf5328; mcf53281; mcf5329
Table of Contents

Advertisement

FlexCAN
Address: 0xFC02_0010 (RXGMASK)
0xFC02_0014 (RX14MASK)
0xFC02_0018 (RX15MASK)
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9
R 0 0 0
W
Reset 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Figure 23-7. FlexCAN Rx Mask Registers (RXGMASK, RX14MASK, RX15MASK)
Field
31–29
Reserved, must be cleared.
28–18
Standard ID mask bits. These bits are the same mask bits for the Standard and Extended Formats.
MI28–18
17–0
Extended ID mask bits. These bits are used to mask comparison only in Extended Format.
MI17–0
23.3.5

FlexCAN Error Counter Register (ERRCNT)

This register has two 8-bit fields reflecting the value of two FlexCAN error counters: transmit error counter
(TXECTR) and receive error counter (RXECTR). The rules for increasing and decreasing these counters
are described in the CAN protocol and are completely implemented in the FlexCAN module. Both
counters are read-only, except in freeze mode, where they can be written by the CPU.
Writing to the ERRCNT register while in freeze mode is an indirect operation. The data is first written to
an auxiliary register, then an internal request/acknowledge procedure across clock domains is executed.
All this is transparent to the user, except for the fact that the data takes some time to be actually written to
the register. If desired, software can poll the register to discover when the data was actually written.
FlexCAN responds to any bus state as described in the protocol, e.g. transmit error-active or error-passive
flag, delay its transmission start time (error-passive), and avoid any influence on the bus when in bus off
state. The following are the basic rules for FlexCAN bus state transitions:
If the value of TXECTR or RXECTR increases to be greater than or equal to 128, the FLTCONF
field in the error and status register (ERRSTAT) is updated to reflect error-passive state.
If the FlexCAN state is error-passive, and TXECTR or RXECTR decrements to a value less than
or equal to 127 while the other already satisfies this condition, the ERRSTAT[FLTCONF] field is
updated to reflect error-active state.
If the value of TXECTR increases to be greater than 255, the ERRSTAT[FLTCONF] field is
updated to reflect bus off state, and an interrupt may be issued. The value of TXECTR is then reset
to zero.
If FlexCAN is in bus off state, then TXECTR is cascaded together with another internal counter to
count the 128th occurrences of 11 consecutive recessive bits on the bus. Hence, TXECTR is reset
to zero and counts in a manner where the internal counter counts 11 such bits and then wraps
around while incrementing the TXECTR. When TXECTR reaches the value of 128, the
23-12
MI
Standard ID
Table 23-6. RXxxMASK Field Descriptions
Description
MCF5329 Reference Manual, Rev 3
Access: User read/write
8
7
6
5
4
3
2
MI
Extended ID
Freescale Semiconductor
1
0

Advertisement

Table of Contents
loading

Table of Contents