
C
CAN PROTOCOL
Rev. 3
MOTOROLA
C-7
THE MOTOROLA SCALEABLE CAN (MSCAN08)
For More Information On This Product,
Go to: www.freescale.com
C.3.3
Transmit Structures
The MSCAN08 has a triple transmit buffer scheme in order to allow multiple messages to be set
up in advance and to achieve an optimized real-time performance. The three buffers are arranged
as shown in
Figure C-2
.
All three buffers have a 13 byte data structure similar to the outline of the receive buffers (see
Section C.11
). An additional Transmit Buffer Priority Register (TBPR) contains an 8-bit so called
Local Priority field (PRIO) (see
Section C.11.5
).
In order to transmit a message, the CPU08 has to identify an available transmit buffer which is
indicated by a set Transmit Buffer Empty (TXE) Flag in the MSCAN08 Transmitter Flag Register
(CTFLG) (see
Section C.12.8
).
The CPU08 then stores the Identifier, the control bits and the data content into one of the transmit
buffers. Finally, the buffer has to be flagged as being ready for transmission by clearing the TXE
flag.
The MSCAN08 will then schedule the message for transmission and will signal the successful
transmission of the buffer by setting the TXE flag. A transmit interrupt will be emitted
when TXE
is set and can be used to drive the application software to re-load the buffer.
In case more than one buffer is scheduled for transmission when the CAN bus becomes available
for arbitration, the MSCAN08 uses the local priority setting of the three buffers for priorisation. For
this purpose every transmit buffer has an 8-bit local priority field (PRIO). The application software
sets this field when the message is set up. The local priority reflects the priority of this particular
message relative to the set of messages being emitted from this node. The lowest binary value of
the PRIO field is defined to be the highest priority.
The internal scheduling process takes places whenever the MSCAN08 arbitrates for the bus. This
is also the case after the occurrence of a transmission error.
When a high priority message is scheduled by the application software it may become necessary
to abort a lower priority message being set up in one of the three transmit buffers. As messages
that are already under transmission can not be aborted, the user has to request the abort by
setting the corresponding Abort Request Flag (ABTRQ) in the Transmission Control Register
(CTCR). The MSCAN08 will then grant the request if possible by setting the corresponding Abort
Request Acknowledge (ABTAK) and the TXE flag in order to release the buffer and by emitting a
transmit interrupt. The transmit interrupt handler software can tell from the setting of the ABTAK
flag whether the message was actually aborted (ABTAK=1) or has been sent in the meantime
(ABTAK=0).
The transmit interrupt will occur only if not masked. A polling scheme can be applied on TXE
also.
TPG
F
.
Freescale Semiconductor, Inc.