Functional Description
23.3.15 Message Handling
When initialization is finished, the DCAN module synchronizes itself to the traffic on the CAN bus. It does
acceptance filtering on received messages and stores those frames that are accepted into the designated
message objects. The application has to update the data of the messages to be transmitted and to enable
and request their transmission. The transmission is requested automatically when a matching remote
frame is received.
The application may read messages which are received and accepted. Messages that are not read before
the next messages is accepted for the same message object will be overwritten.
Messages may be read interrupt-driven or after polling of NewDat.
23.3.15.1 Message Handler Overview
The message handler state machine controls the data transfer between the Rx/Tx shift register of the CAN
core and the message RAM. It performs the following tasks:
•
Data transfer from message RAM to CAN core (messages to be transmitted)
•
Data transfer from CAN core to the message RAM (received messages)
•
Data transfer from CAN core to the acceptance filtering unit
•
Scanning of message RAM for a matching message object (acceptance filtering)
•
Scanning the same message object after being changed by IF1/IF2 registers when priority is the same
or higher as the message the object found by last scanning
•
Handling of TxRqst flags
•
Handling of interrupt flags
The message handler registers contains status flags of all message objects grouped into the following
topics:
•
Transmission Request Flags
•
New Data Flags
•
Interrupt Pending Flags
•
Message Valid Registers
Instead of collecting above listed status information of each message object via IFx registers separately,
these message handler registers provides a fast and easy way to get an overview, for example, about all
pending transmission requests.
All message handler registers are read-only.
23.3.15.2 Receive/Transmit Priority
The receive/transmit priority for the message objects is attached to the message number, not to the CAN
identifier. Message object 1 has the highest priority, while the last implemented message object has the
lowest priority. If more than one transmission request is pending, they are serviced due to the priority of
the corresponding message object so messages with the highest priority, for example, can be placed in
the message objects with the lowest numbers.
The acceptance filtering for received data frames or remote frames is also done in ascending order of
message objects, so a frame that has been accepted by a message object cannot be accepted by another
message object with a higher message number. The last message object may be configured to accept
any data frame or remote frame that was not accepted by any other message object, for nodes that need
to log the complete message traffic on the CAN bus.
23.3.15.3 Transmission of Messages in Event-Driven CAN Communication
If the shift register of the CAN core is ready for loading and if there is no data transfer between the IFx
registers and message RAM, the D bits in the Message Valid register (DCAN MSGVAL12 to DCAN
MSGVAL78) and the TxRqst bits in the transmission request register are evaluated. The valid message
object with the highest priority pending transmission request is loaded into the shift register by the
message handler and the transmission is started. The message object’s NewDat bit is reset.
3902
Controller Area Network (CAN)
SPRUH73H – October 2011 – Revised April 2013
Copyright © 2011–2013, Texas Instruments Incorporated