EasyManua.ls Logo

Freescale Semiconductor MPC5604B - 8. FlexCAN usage explained with an example

Default Icon
150 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
PRIO: Local priority, for internal Tx arbitration, only used when LPRIO_EN is set, these
extra 3 bits are appended to the ID (making 32-bit ID), for giving more possibilities over
priority. MB’s with 000 PRIO have the highest priority.
ID: equivalent to the frame identifier. In standard mode, only the 11 most significant bits
are considered. In Tx this ID is transmitted, and in Rx it is used as a filter.
DATA: equivalent to the frame data.
The CODE field is used as a state variable which allows the MB to go through different processes
for achieving some task.
Figure 119: CODE usage in MB for Rx and Tx, before and after transfer
Some details about these states:
RX INACTIVE(0000): as the MBs are in the SRAM, after reset their values are random, so
they have to be initialized before doing anything else with this module. They should all
be put to the INACTIVE state.
RX EMPTY(0100): in this state MB gets activated as a Rx buffer, it will only receive a
frame containing the same ID. After this the MB’s state will be RX FULL.
RX FULL(0010): after receiving a frame, an empty frame gets into this state. Reading the
data of this buffer will not make it go back to RX EMPTY, but after a read, if a new frame
is received, then the state will remain the same. If a new frame is received before the
buffer is read, the next state will be RX OVERRUN.
RX OVERRUN(0110): an unread full buffer was overwritten by a new frame. If the buffer
is read before a new reception, the state will go back to FULL, otherwise it will remain in
OVERRUN.
RX BUSY(0xx1): some states are used as transitions for RX process.
TX INACTIVE(1000): similar to RX INACTIVE, the MB could be used as a TX, but does not
participate in the arbitration.
TX ONCE(1100): Tx buffer transmits a frame once and returns to the TX INACTIVE.
TX ABORT(1001): when MB is in a Tx state and AEN bit of the MCR is set, the
transmission is aborted and the buffer no longer participates in the arbitration. An abort
is not always guaranteed, so after writing the ABORT code, the user has to check if the
read CODE is 1001, if not, it hast to wait for IFLAG to be set and the read CODE again to
see if transmission war aborted (1001) or normally completed (1000).
TX REMOTE_REQUEST(1100): transmits a remote frame once and then becomes a Rx
MB with the same ID, by going to RX EMPTY.
TX REMOTE_ANSWER(1010): buffer replies by transmitting a frame when a remote
frame with its ID is received. (1110 is used as an internal state here, but the user can
select 1110 for forcing a transmission first then going into remote answering mode).

Table of Contents

Other manuals for Freescale Semiconductor MPC5604B

Related product manuals