
M0A21/M0A23 Series
May 06, 2022
Page
616
of 746
Rev 1.02
M0
A21
/M
0
A
2
3
SE
RIES
TEC
H
NICAL
RE
FEREN
C
E
M
ANUAL
updating the data bytes and setting TxRqst.
To prevent the reset of TxRqst at the end of a transmission that may already be in progress while the
data is updated, NewDat (CAN_IFn_MCON[15]) has to be set together with TxRqst.
When NewDat is set together with TxRqst, NewDat will be reset as soon as the new transmission has
started.
Configuring a Receive Object
Table 6.16-2 shows how a Receive Object should be initialized.
MsgVal
Arb
Data
Mask
EoB
Dir
NewDat MsgLst
RxIE
TxIE
IntPnd RmtEn TxRqst
1
appl.
appl.
appl.
1
0
0
0
appl.
0
0
0
0
Table 6.16-2 Initialization of a Receive Object
The Arbitration Registers values (ID28-0 (CAN_IFn_ARB1/2) and Xtd bit (CAN_IFn_ARB2[14])) are
provided by the application. They define the identifier and type of accepted received messages. If an
11-
bit Identifier (“Standard Frame”) is used, it is programmed to ID28 - ID18. Then ID17 - ID0 can be
disregarded. When a Data Frame with an 11-bit Identifier is received, ID17 -
ID0 will be set to ‘0’.
If the RxIE bit (CAN_IFn_MCON[10]) is set, the IntPnd bit (CAN_IFn_MCON[13]) will be set when a
received Data Frame is accepted and stored in the Message Object.
The Data Length Code (DLC3-0 (CAN_IFn_MCON[3:0])) is provided by the application. When the
Message Handler stores a Data Frame in the Message Object, it will store the received Data Length
Code and eight data bytes. If the Data Length Code is less than 8, the remaining bytes of the Message
Object will be overwritten by unspecified values.
The Mask Registers (Msk28-0, UMask, MXtd and MDir bits) may be used (UMask
(CAN_IFn_MCON[12]) =
’1’) to allow groups of Data Frames with similar identifiers to be accepted. The
Dir bit (CAN_IFn_ARB2[13]) should not be masked in typical applications.
Handling Received Messages
The application software may read a received message any time through the IFn Interface registers.
The data consistency is guaranteed by the Message Handler state machine.
Typically, the software will write first 0x007F to the Command Mask Register and then the number of
the Message Object to the Command Request Register. This combination will transfer the whole
received message from the Message RAM into the Message Buffer Register. Additionally, the bits
NewDat (CAN_IFn_MCON[15]) and IntPnd (CAN_IFn_MCON[13]) are cleared in the Message RAM
(not in the Message Buffer).
If the Message Object uses masks for acceptance filtering, the arbitration bits show which of the
matching messages have been received.
The actual value of NewDat shows whether a new message has been received since the last time this
Message Object was read. The actual value of MsgLst (CAN_IFn_MCON[14]) shows whether more
than one message has been received since the last time this Message Object was read. MsgLst will not
be automatically reset.
By means of a Remote Frame, the software may request another CAN node to provide new data for a
receive object. Setting the TxRqst bit (CAN_IFn_MCON[8]) of a receive object will cause 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.