Texas Instruments Development Kit for TM4C129x,Tiva™ ARM® Cortex™ -M4 Microcontroller DK-TM4C129X DK-TM4C129X Datenbogen

Produktcode
DK-TM4C129X
Seite von 2182
23.3.9
Receive/Transmit Priority
The receive/transmit priority for the message objects is controlled by the message number. Message
object 1 has the highest priority, while message object 32 has the lowest priority. If more than one
transmission request is pending, the message objects are transmitted in order based on the message
object with the lowest message number. This prioritization is separate from that of the message
identifier which is enforced by the CAN bus. As a result, if message object 1 and message object
2 both have valid messages to be transmitted, message object 1 is always transmitted first regardless
of the message identifier in the message object itself.
23.3.10
Configuring a Receive Message Object
The following steps illustrate how to configure a receive message object.
1.
Program the CAN IFn Command Mask (CANIFnCMASK) register as described in the
“Configuring a Transmit Message Object” on page 1539 section, except that the
WRNRD
bit is set
to specify a write to the message RAM.
2.
Program the CANIFnMSK1and CANIFnMSK2 registers as described in the “Configuring a
Transmit Message Object” on page 1539 
section to configure which bits are used for acceptance
filtering. Note that in order for these bits to be used for acceptance filtering, they must be enabled
by setting the
UMASK
bit in the CANIFnMCTL register.
3.
In the CANIFnMSK2 register, use the
MSK[12:0]
bits to specify which of the bits in the 29-bit
or 11-bit message identifier are used for acceptance filtering. Note that
MSK[12:0]
are used
for bits [28:16] of the 29-bit message identifier; whereas
MSK[12:2]
are used for bits [10:0] of
the 11-bit message identifier. Use the
MXTD
and
MDIR
bits to specify whether to use
XTD
and
DIR
for acceptance filtering. A value of 0x00 enables all messages to pass through the
acceptance filtering. Also note that in order for these bits to be used for acceptance filtering,
they must be enabled by setting the
UMASK
bit in the CANIFnMCTL register.
4.
Program the CANIFnARB1 and CANIFnARB2 registers as described in the “Configuring a
Transmit Message Object” on page 1539 
section to program
XTD
and
ID
bits for the message
identifier to be received; set the
MSGVAL
bit to indicate a valid message; and clear the
DIR
bit
to specify receive.
5.
In the CANIFnMCTL register:
■ Optionally set the
UMASK
bit to enable the mask (
MSK
,
MXTD
, and
MDIR
specified in the
CANIFnMSK1 and CANIFnMSK2 registers) for acceptance filtering
■ Optionally set the
RXIE
bit to enable the
INTPND
bit to be set after a successful reception
■ Clear the
RMTEN
bit to leave the
TXRQST
bit unchanged
■ Set the
EOB
bit for a single message object
■ Configure the
DLC[3:0]
field to specify the size of the data frame
Take care during this configuration not to set the
NEWDAT
,
MSGLST
,
INTPND
or
TXRQST
bits.
6.
Program the number of the message object to be received in the
MNUM
field in the CAN IFn
Command Request (CANIFnCRQ) register. Reception of the message object begins as soon
as a matching frame is available on the CAN bus.
December 13, 2013
1542
Texas Instruments-Advance Information
Controller Area Network (CAN) Module