
M0A21/M0A23 Series
May 06, 2022
Page
614
of 746
Rev 1.02
M0
A21
/M
0
A
2
3
SE
RIES
TEC
H
NICAL
RE
FEREN
C
E
M
ANUAL
Message Transmission
If the shift register of the CAN Core cell is ready for loading and if there is no data transfer between the
IFn Registers and Message RAM, the MsgVal bit (CAN_IFn_ARB2[15]) and TxRqst bits
(CAN_TXREQ1/2) 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 NewDat (CAN_IFn_MCON[15]) bit of the Message Object is reset.
After a successful transmission and also if no new data was written to the Message Object (NewDat =
‘0’) since the start of the transmission, the TxRqst bit of the Message Control register
(CAN_IFn_MCON[8]) will be reset. If TxIE bit (CAN_IFn_MCON[11]) is set, IntPnd bit
(CAN_IFn_MCON[13]) of the Interrupt Identifier register will be set after a successful transmission. If
the C_CAN has lost the arbitration or if an error occurred during the transmission, the message will be
retransmitted as soon as the CAN bus is free again. Meanwhile, if the transmission of a message with
higher priority has been requested, the messages will be transmitted in the order of their priority.
Acceptance Filtering of Received Messages
When the arbitration and control field (Identifier + IDE + RTR + DLC) of an incoming message is
completely shifted into the Rx/Tx Shift Register of the CAN Core, the Message Handler FSM starts the
scanning of the Message RAM for a matching valid Message Object.
To scan the Message RAM for a matching Message Object, the Acceptance Filtering unit is loaded with
the arbitration bits from the CAN Core shift register. The arbitration and mask fields (including MsgVal
(CAN_IFn_ARB2[15]), UMask (CAN_IFn_MCON[12]), NewDat (CAN_IFn_MCON[15]) and EoB
(CAN_IFn_MCON[7])) of Message Object 1 are then loaded into the Acceptance Filtering unit and
compared with the arbitration field from the shift register. This is repeated with each following Message
Object until a matching Message Object is found or until the end of the Message RAM is reached.
If a match occurs, the scan is stopped and the Message Handler FSM proceeds depending on the type
of frame (Data Frame or Remote Frame) received.
Reception of Data Frame
The Message Handler FSM stores the message from the CAN Core shift register into the respective
Message Object in the Message RAM. Not only the data bytes, but all arbitration bits and the Data
Length Code are stored into the corresponding Message Object. This is done to keep the data bytes
connected with the identifier even if arbitration mask registers are used.
The NewDat bit (CAN_IFn_MCON[15]) is set to indicate that new data (not yet seen by the software)
has been received. The application software should reset NewDat bit when the Message Object has
been read. If at the time of reception, the NewDat bit was already set, MsgLst (CAN_IFn_MCON[14]) is
set to indicate that the previous data (supposedly not seen by the software) is lost. If the RxIE bit
(CAN_IFn_MCON[10]) is set, the IntPnd bit (CAN_IFn_MCON[13]) is set, causing the Interrupt Register
to point to this Message Object.
The TxRqst bit (CAN_IFn_MCON[8]) of this Message Object is reset to prevent the transmission of a
Remote Frame, while the requested Data Frame has just been received.
Reception of Remote Frame
When a Remote Frame is received, three different configurations of the matching Message Object have
to be considered:
1. Dir (CAN_IFn_ARB2[13])
= ‘1’ (direction = transmit), RmtEn (CAN_IFn_MCON[9]) = ‘1’ and
UMask (CAN_IFn_MCON[12])
= ‘1’ or ’0’
2. At the reception of a matching Remote Frame, the TxRqst bit of this Message Object is set.
The rest of the Message Object remains unchanged.
3.
Dir = ‘1’ (direction = transmit), RmtEn = ‘0’ and UMask = ’0’
4. At the reception of a matching Remote Frame, the TxRqst bit of this Message Object remains