Matching Process - Freescale Semiconductor MCF52277 Reference Manual

Table of Contents

Advertisement

FlexCAN
the third step, it is able to receive CAN frames that match the programmed ID. At the end of a successful
reception, the value of the free running timer (TIMER) is written into the time stamp field, the received
ID, data (8 bytes at most) and length fields are stored, the CODE field in the control and status word is
updated (see
Table
23-12), and a status flag is set in the IFLAG register and an interrupt is generated if
allowed by the corresponding IMASK bit.
The CPU should read a receive frame from its MB by reading the following:
1. Control/status word (mandatory—activates internal lock for this buffer)
2. ID (optional—needed only if a mask was used)
3. Data field words
4. Free-running timer (Releases internal lock —optional)
Upon reading the control and status word, if the BUSY bit is set in the CODE field, then the CPU should
defer the access to the MB until this bit is negated. Reading the free running timer is not mandatory. If not
executed the MB remains locked, unless the CPU reads the C/S word of another MB. Only a single MB is
locked at a time. The only mandatory CPU read operation is the one on the control and status word to
assure data coherency.
The CPU should synchronize to frame reception by an IFLAG bit for the specific MB (see
"Interrupt Flag Register
the CODE field does not work because after a frame was received and the CPU services the MB (by
reading the C/S word followed by unlocking the MB), the CODE field does not return to EMPTY. It
remains FULL, as explained in
C/S word to force an EMPTY code after reading the MB, the MB is actually deactivated from any currently
ongoing matching process. As a result, a newly received frame matching the ID of that MB may be lost.
In summary, never do polling by directly reading the C/S word of the MBs. Instead, read the IFLAG
register.
The received identifier field is always stored in the matching MB, thus the contents of the ID field in an
MB may change if the match was due to masking.
23.3.14.1 Self-Received Frames
Self-received frames are frames that are sent by the FlexCAN and received by itself. The FlexCAN sends
a frame externally through the physical layer onto the CAN bus. If the ID of the frame matches the ID of
the FlexCAN MB, the frame is received by the FlexCAN. Such a frame is a self-received frame. FlexCAN
does not receive frames transmitted by itself if another device on the CAN bus has an ID that matches the
FlexCAN Rx MB ID.

23.3.15 Matching Process

The matching process is an algorithm that scans the entire MB memory looking for Rx MBs programmed
with the same ID as the one received from the CAN bus. Only MBs programmed to receive participate in
the matching process for received frames.
While the ID, DLC and data fields are retrieved from the CAN bus, they are stored temporarily in the serial
message buffer
(Section 23.3.16.1, "Serial Message Buffers
23-24
(IFLAG)"), and not by the control/status word CODE field for that MB. Polling
Table
23-12. If the CPU tries to workaround this behavior by writing to the
MCF52277 Reference Manual, Rev. 1
(SMBs)"). The matching process takes place
Section 23.3.8,
Freescale Semiconductor

Advertisement

Table of Contents
loading

Table of Contents