
C
CAN PROTOCOL
Rev. 3
MOTOROLA
C-5
THE MOTOROLA SCALEABLE CAN (MSCAN08)
For More Information On This Product,
Go to: www.freescale.com
C.3.2
Receive Structures
The received messages are stored in a two stage input FIFO. The two message buffers are
mapped using a ‘ping pong’ arrangement into a single memory area (see
Figure C-2
). While the
background receive buffer (RxBG) is exclusively associated to the MSCAN08, the foreground
receive buffer (RxFG) is addressable by the CPU08. This scheme simplifies the handler software
as only one address area is applicable for the receive process.
Both buffers have a size of 13 byte to store the CAN control bits, the identifier (standard or
extended) and the data content (for details see
Section C.11
).
The Receiver Full flag (RXF) in the MSCAN08 Receiver Flag Register (CRFLG) (see
Section C.12.6
) signals the status of the foreground receive buffer. When the buffer contains a
correctly received message with matching identifier this flag is set.
After the MSCAN08 successfully received a message into the background buffer it copies the
content of RxBG into RxFG
, sets the RXF flag, and emits a receive interrupt to the CPU
. A new
message - which may follow immediately after the IFS field of the CAN frame - will be received into
RxBG.
The user’s receive handler has to read the received message from RxFG and to reset the RXF flag
in order to acknowledge the interrupt and to release the foreground buffer.
An overrun conditions occurs when both the foreground and the background receive message
buffers are filled with correctly received messages, and a further message is being received from
the bus. The latter message will be discarded and an error interrupt with overrun indication will
occur if enabled. The over-writing of the background buffer is independent of the identifier filter
function. While in the overrun situation, the MSCAN08 will stay synchronized to the CAN bus and
is able to transmit messages but will discard all incoming messages.
Note:
MSCAN08 will receive its own messages into the background receive buffer RxBG but
will NOT overwrite RxFG and will NOT emit a receive interrupt nor will it acknowledge
(ACK) its own messages on the CAN bus. The exception to this rule is that when in
loop-back mode MSCAN08 will treat its own messages exactly like all other incoming
messages.
Only if the RXF flag is not set.
The receive interrupt will occur only if not masked. A polling scheme can be applied on RXF
also.
TPG
F
.
Freescale Semiconductor, Inc.