Controller Area Network (FlexCAN)
MPC5510 Microcontroller Family Reference Manual, Rev. 1
Freescale Semiconductor
25-33
Preliminary
25.4.5
Data Coherence
To maintain data coherency and FlexCAN proper operation, the CPU must obey the rules described in
Section 25.4.1, “Transmit Process
,” and
Section 25.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.
25.4.5.1
Transmission Abort Mechanism
The abort mechanism provides a safe way to request the abortion of a pending transmission. A feedback
mechanism is provided to inform the CPU if the transmission was aborted or if the frame could not be
aborted and was transmitted instead. To maintain backwards compatibility, the abort mechanism must be
explicitly enabled by asserting the AEN bit in the CANx_MCR.
in order to abort a transmission, the CPU must write a specific abort code (1001) to the code field of the
control and status word. When the abort mechanism is enabled, the active MBs configured as transmission
must be aborted first and then they may be updated. If the abort code is written to an MB that is currently
being transmitted, or to an MB that was already loaded into the SMB for transmission, the write operation
is blocked and the MB is not deactivated, but the abort request is captured and kept pending until one of
the following conditions are satisfied:
•
The module loses the bus arbitration
•
There is an error during the transmission
•
The module is put into freeze mode
If none of conditions above are reached, the MB is transmitted correctly, the interrupt flag is set in the
CANx_IFLAG register and an interrupt to the CPU is generated (if enabled). The abort request is
automatically cleared when the interrupt flag is set. In the other hand, if one of the above conditions is
reached, the frame is not transmitted, therefore the abort code is written into the code field, the interrupt
flag is set in the CANx_IFLAG and an interrupt is (optionally) generated to the CPU.
If the CPU writes the abort code before the transmission begins internally, then the write operation is not
blocked, therefore the MB is updated and no interrupt flag is set. In this way the CPU needs to read the
abort code to make sure the active MB was deactivated. Although the AEN bit is asserted and the CPU
wrote the abort code, in this case the MB is deactivated and not aborted, because the transmission did not
start yet. One MB is only aborted when the abort request is captured and kept pending until one of the
previous conditions are satisfied.
The abort procedure can be summarized as follows:
•
CPU writes 1001 into the code field of the C/S word
•
CPU reads the CODE field and compares it to the value that was written
•
If the CODE field that was read is different from the value that was written, the CPU must read the
corresponding CANx_IFLAG to check if the frame was transmitted or it is being currently
transmitted. If the corresponding CANx_IFLAG is set, the frame was transmitted. If the
corresponding CANx_IFLAG is reset, the CPU must wait for it to be set, and then the CPU must
read the CODE field to check if the MB was aborted (CODE=1001) or it was transmitted
(CODE=1000).