The CAN mask registers can be used to allow groups of data frames to be received by a message
object. The CAN mask registers,
CANIFnMSKn
, configure which groups of frames are received by
a message object. The
UMASK
bit in the
CANIFnMCTL
register enables the
MSK
bits in the
CANIFnMSKn
register to filter which frames are received. The
MXTD
bit in the
CANIFnMSK2
register
should be set if only 29-bit extended identifiers are expected by this message object.
19.3.11
Handling of Received Message Objects
The CPU may read a received message any time via the CAN Interface registers because the data
consistency is guaranteed by the message handler state machine.
Typically, the CPU first writes 0x007F to the
CANIFnCMSK
register and then writes the number of
the message object to the
CANIFnCRQ
register. That combination transfers the whole received
message from the message RAM into the Message Buffer registers (
CANIFnMSKn
,
CANIFnARBn
,
and
CANIFnMCTL
). Additionally, the
NEWDAT
and
INTPND
bits are cleared in the message RAM,
acknowledging that the message has been read and clearing the pending interrupt generated by
this message object.
If the message object uses masks for acceptance filtering, the
CANIFnARBn
registers show the
full, unmasked ID for the received message.
The
NEWDAT
bit in the
CANIFnMCTL
register shows whether a new message has been received
since the last time this message object was read. The
MSGLST
bit in the
CANIFnMCTL
register
shows whether more than one message has been received since the last time this message object
was read.
MSGLST
is not automatically cleared, and should be cleared by software after reading its
status.
Using a remote frame, the CPU may request new data from another CAN node on the CAN bus.
Setting the
TXRQST
bit of a receive object causes the transmission of a remote frame with the receive
object's identifier. This remote frame triggers the other CAN node to start the transmission of the
matching data frame. If the matching data frame is received before the remote frame could be
transmitted, the
TXRQST
bit is automatically reset. This prevents the possible loss of data when the
other device on the CAN bus has already transmitted the data slightly earlier than expected.
19.3.11.1 Configuration of a FIFO Buffer
With the exception of the
EOB
bit in the
CANIFnMCTL
register, the configuration of receive message
objects belonging to a FIFO buffer is the same as the configuration of a single receive message
object (see “Configuring a Receive Message Object” on page 1364). To concatenate two or more
message objects into a FIFO buffer, the identifiers and masks (if used) of these message objects
have to be programmed to matching values. Due to the implicit priority of the message objects, the
message object with the lowest message object number is the first message object in a FIFO buffer.
The
EOB
bit of all message objects of a FIFO buffer except the last one must be cleared. The
EOB
bit of the last message object of a FIFO buffer is set, indicating it is the last entry in the buffer.
19.3.11.2 Reception of Messages with FIFO Buffers
Received messages with identifiers matching to a FIFO buffer are stored starting with the message
object with the lowest message number. When a message is stored into a message object of a
FIFO buffer, the
NEWDAT
of the
CANIFnMCTL
register bit of this message object is set. By setting
NEWDAT
while
EOB
is clear, the message object is locked and cannot be written to by the message
handler until the CPU has cleared the
NEWDAT
bit. Messages are stored into a FIFO buffer until the
last message object of this FIFO buffer is reached. Until all of the preceding message objects have
been released by clearing the
NEWDAT
bit, all further messages for this FIFO buffer are written into
the last message object of the FIFO buffer and therefore overwrite previous messages.
1365
June 18, 2014
Texas Instruments-Production Data
Tiva
™
TM4C1294NCPDT Microcontroller