Datasheet

Table Of Contents
MSCAN
Functional Description
MC9S12DP256 — Revision 1.1
MSCAN
All three buffers have a 13 byte data structure similar to the outline of the
receive buffers (see Programmer’s Model of Message Storage). An
additional Transmit Buffer Priority Register (TBPR) contains an 8-bit
‘Local Priority’ field (PRIO). The remaining two bytes are used for time
stamping of a message, if required (see Time Stamp Register (TSRH,
TSRL)).
To transmit a message, the CPU has to identify an available transmit
buffer which is indicated by a set Transmitter Buffer Empty (TXEx) flag
(see MSCAN Transmitter Flag Register (CANTFLG)). If a transmit buffer
is available, the CPU has to set a pointer to this buffer by writing to the
CANTBSEL register (see MSCAN Transmit Buffer Selection
(CANTBSEL)). This makes the respective buffer accessible within the
CANTXFG address space (see Programmer’s Model of Message
Storage). The algorithmic feature associated with the CANTBSEL
register simplifies the transmit buffer selection. In addition this scheme
makes the handler software simpler as only one address area is
applicable for the transmit process. In addition the required address
space is minimized.
The CPU then stores the identifier, the control bits and the data content
into one of the transmit buffers. Finally, the buffer is flagged as ready for
transmission by clearing the associated TXE flag.
The MSCAN then schedules the message for transmission and signals
the successful transmission of the buffer by setting the associated TXE
flag. A transmit interrupt (see Interrupt Operation) is generated
1
when
TXEx 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 MSCAN uses the ‘local
priority’ setting of the three buffers to determine the prioritization. For this
purpose, every transmit buffer has an 8-bit local priority field (PRIO). The
application software programs 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 transmitted from this node. The lowest binary
1. The transmit interrupt occurs only if not masked. A polling scheme can be applied on TXEx
also.
Freescale Semiconductor, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...