![Freescale Semiconductor MCF52230 ColdFire Скачать руководство пользователя страница 561](http://html1.mh-extra.com/html/freescale-semiconductor/mcf52230-coldfire/mcf52230-coldfire_reference-manual_2330648561.webp)
FlexCAN
30-21
Freescale Semiconductor
MCF52235 ColdFire® Integrated Microcontroller Reference Manual, Rev. 6
NOTE
The first and last steps are mandatory.
The first write to the control/status word is important in case there was pending reception or transmission.
The write operation immediately deactivates the MB, removing it from any currently ongoing arbitration
or ID matching processes, giving time for the CPU to program the rest of the MB (see
). After the MB is activated in the fourth step, it participates in the
arbitration process and eventually be transmitted according to its priority. At the end of the successful
transmission, the value of the free running timer (TIMER) is written into the message buffer’s time stamp
field, the code field in the control and status word is updated, a status flag is set in the IFLAG register, and
an interrupt is generated if allowed by the corresponding IMASK register bit. The new code field after
transmission depends on the code that was used to activate the MB in step four (see
30.3.12 Arbitration Process
The arbitration process is an algorithm executed by the message buffer management (MBM) that scans the
entire MB memory looking for the highest priority message to be transmitted. All MBs programmed as
transmit buffers are scanned to find the lowest ID or the lowest MB number, depending on the
CANCTRL[LBUF] bit.
NOTE
If CANCTRL[LBUF] is cleared, the arbitration considers not only the ID,
but also the RTR and IDE bits placed inside the ID at the same positions they
are transmitted in the CAN frame.
The arbitration process is triggered in the following events:
•
During the CRC field of the CAN frame
•
During the error delimiter field of the CAN frame
•
During intermission, if the winner MB defined in a previous arbitration was deactivated, or if there
was no MB to transmit, but the CPU wrote to the C/S word of any MB after the previous arbitration
finished
•
When MBM is in idle or bus off state and the CPU writes to the C/S word of any MB
•
Upon leaving freeze mode
After the highest priority MB is selected, it is transferred to a temporary storage space called serial
message buffer (SMB), which has the same structure as a normal MB but is not user accessible. This
operation is called move-out.
At the first opportunity window on the CAN bus, the message on the SMB is transmitted according to the
CAN protocol rules. FlexCAN transmits up to 8 data bytes, even if the data length code (DLC) value is
bigger.
30.3.13 Receive Process
The CPU prepares or changes an MB for frame reception by writing the following:
1. Control/status word to hold Rx MB inactive (CODE = 0000)
Because
of
an
order
from
the
United
States
International
Trade
Commission,
BGA-packaged
product
lines
and
part
numbers
indicated
here
currently
are
not
available
from
Freescale
for
import
or
sale
in
the
United
States
prior
to
September
2010:MCF52234CVM60,
MCF52235CVM60