
Controller Area Network (FlexCAN)
PXN20 Microcontroller Reference Manual, Rev. 1
Freescale Semiconductor
29-31
•
The code field is either EMPTY or else it is FULL or OVERRUN but the CPU has already serviced
the MB (read the C/S word and then unlocked the MB)
If the first MB with a matching ID is not free to receive the new frame, then the matching algorithm keeps
looking for another free MB until it finds one. If it cannot find one that is free, then it overwrites the last
matching MB (unless it is locked) and sets the code field to OVERRUN (refer to
and
). If the last matching MB is locked, then the new message remains in the SMB, waiting for the
Section 29.4.5.3, Message Buffer Lock Mechanism
).
Suppose, for example, that the FIFO is disabled and there are two MBs with the same ID, and FlexCAN
starts receiving messages with that ID. Let us say that these MBs are the second and the fifth in the array.
When the first message arrives, the matching algorithm finds the first match in MB number 2. The code
of this MB is EMPTY, so the message is stored there. When the second message arrives, the matching
algorithm finds MB number 2 again, but it is not free to receive, so it keeps looking and finds MB number
5 and stores the message there. If yet another message with the same ID arrives, the matching algorithm
finds out that there are no matching MBs that are free to receive, so it decides to overwrite the last matched
MB, which is number 5. In doing so, it sets the code field of the MB to indicate OVERRUN.
The ability to match the same ID in more than one MB can be exploited to implement a reception queue
(in addition to the full featured FIFO) to allow more time for the CPU to service the MBs. By programming
more than one MB with the same ID, received messages are queued into the MBs. The CPU can examine
the time stamp field of the MBs to determine the order in which the messages arrived.
The matching algorithm described above can be changed to be the same one used in previous versions of
the FlexCAN module. When the BCC bit in CAN
x
_MCR is negated, the matching algorithm stops at the
first MB with a matching ID that it founds, whether this MB is free or not. As a result, the message
queueing feature does not work if the BCC bit is negated.
Matching to a range of IDs is possible by using ID Acceptance Masks. FlexCAN supports individual
masking per MB. Please refer to
Section 29.3.4.11, Rx Individual Mask Registers (CANx_RXIMR0 –
During the matching algorithm, if a mask bit is asserted, then the corresponding ID
bit is compared. If the mask bit is negated, the corresponding ID bit is “don’t care”. Please note that the
individual mask registers are implemented in RAM, so they are not initialized out of reset. Also, they can
only be programmed if the BCC bit is asserted and while the module is in freeze mode.
FlexCAN also supports an alternate masking scheme with only three mask registers (RGXMASK,
CAN
x
_RX14MASK, and CAN
x
_RX15MASK) for backwards compatibility. This alternate masking
scheme is enabled when the BCC bit in the CAN
x
_MCR Register is negated.
29.4.5
Data Coherence
To maintain data coherency and FlexCAN proper operation, the CPU must obey the rules described in
Section 29.4.1, Transmit Process,
and
Section 29.4.3, Receive Process.
Any form of CPU accessing an
MB structure within FlexCAN other than those specified may cause FlexCAN to behave in an
unpredictable way.
Содержание PXN2020
Страница 1: ...PXN20 Microcontroller Reference Manual Devices Supported PXN2020 PXN2120 PXN20RM Rev 1 06 2011...
Страница 42: ...PXN20 Microcontroller Reference Manual Rev 1 lxiv Freescale Semiconductor...
Страница 64: ...Introduction PXN20 Microcontroller Reference Manual Rev 1 1 22 Freescale Semiconductor...
Страница 112: ...Signal Description PXN20 Microcontroller Reference Manual Rev 1 3 44 Freescale Semiconductor...
Страница 118: ...Resets PXN20 Microcontroller Reference Manual Rev 1 4 6 Freescale Semiconductor...
Страница 162: ...Clocks Reset and Power CRP PXN20 Microcontroller Reference Manual Rev 1 6 30 Freescale Semiconductor...
Страница 182: ...Frequency Modulated Phase Locked Loop FMPLL PXN20 Microcontroller Reference Manual Rev 1 7 20 Freescale Semiconductor...
Страница 268: ...Boot Assist Module BAM PXN20 Microcontroller Reference Manual Rev 1 9 14 Freescale Semiconductor...
Страница 318: ...Interrupts and Interrupt Controller INTC PXN20 Microcontroller Reference Manual Rev 1 10 50 Freescale Semiconductor...
Страница 326: ...General Purpose Static RAM SRAM PXN20 Microcontroller Reference Manual Rev 1 11 8 Freescale Semiconductor...
Страница 372: ...e200z6 Core Z6 PXN20 Microcontroller Reference Manual Rev 1 13 8 Freescale Semiconductor...
Страница 412: ...e200z0 Core Z0 PXN20 Microcontroller Reference Manual Rev 1 14 14 Freescale Semiconductor...
Страница 460: ...Memory Protection Unit MPU PXN20 Microcontroller Reference Manual Rev 1 18 20 Freescale Semiconductor...
Страница 478: ...Error Correction Status Module ECSM PXN20 Microcontroller Reference Manual Rev 1 19 18 Freescale Semiconductor...
Страница 488: ...Software Watchdog Timer SWT PXN20 Microcontroller Reference Manual Rev 1 20 10 Freescale Semiconductor...
Страница 494: ...System Timer Module STM PXN20 Microcontroller Reference Manual Rev 1 21 6 Freescale Semiconductor...
Страница 821: ...Media Local Bus MLB PXN20 Microcontroller Reference Manual Rev 1 Freescale Semiconductor 27 49...
Страница 822: ...Media Local Bus MLB PXN20 Microcontroller Reference Manual Rev 1 27 50 Freescale Semiconductor...
Страница 926: ...Controller Area Network FlexCAN PXN20 Microcontroller Reference Manual Rev 1 29 42 Freescale Semiconductor...
Страница 990: ...Deserial Serial Peripheral Interface DSPI PXN20 Microcontroller Reference Manual Rev 1 30 64 Freescale Semiconductor...
Страница 1044: ...Enhanced Serial Communication Interface eSCI PXN20 Microcontroller Reference Manual Rev 1 31 54 Freescale Semiconductor...
Страница 1080: ...Cross Triggering Unit CTU PXN20 Microcontroller Reference Manual Rev 1 33 12 Freescale Semiconductor...
Страница 1134: ...Analog to Digital Converter ADC PXN20 Microcontroller Reference Manual Rev 1 34 54 Freescale Semiconductor...
Страница 1150: ...IEEE 1149 1 Test Access Port Controller JTAGC PXN20 Microcontroller Reference Manual Rev 1 35 16 Freescale Semiconductor...
Страница 1257: ...Nexus Development Interface NDI PXN20 Microcontroller Reference Manual Rev 1 Freescale Semiconductor 36 107...
Страница 1258: ...Nexus Development Interface NDI PXN20 Microcontroller Reference Manual Rev 1 36 108 Freescale Semiconductor...
Страница 1376: ...Memory Map PXN20 Microcontroller Reference Manual Rev 1 A 118 Freescale Semiconductor...