msCAN08 Controller (msCAN08)
Message storage
MC68HC08AZ32
MOTOROLA
msCAN08 Controller (msCAN08)
355
exception to this rule is that when in loop-back mode msCAN08 will treat
its own messages exactly like all other incoming messages.
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 2
.
All three buffers have a 13 byte data structure similar to the outline of the
receive buffers (see
Programmer’s model of message storage
on page
371). An additional Transmit Buffer Priority Register (TBPR) contains an
8-bit so called “Local Priority” field (PRIO) (see
Transmit buffer priority
registers (TBPR)
on page 375).
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
msCAN08 Transmitter Flag Register (CTFLG)
on page 386).
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
1
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
“l(fā)ocal priority” setting of the three buffers for prioritization. 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.
1. The transmit interrupt will occur only if not masked. A polling scheme can be applied on TXE
also.
9-can