Message Handling
1438
SPNU563A – March 2018
Copyright © 2018, Texas Instruments Incorporated
Controller Area Network (DCAN) Module
27.8 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 enable and request their
transmission. The transmission is requested automatically when a matching Remote Frame is received.
The application may read messages that 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 based on interrupts or by polling.
27.8.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 same or
higher as 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 the 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.
27.8.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 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.