
AT32F413
Series Reference Manual
2022.06.27
Page 301
Rev 2.00
20.6.6 Message reception
Register configuration
The CAN_RFIx, CAN_RFCx, CAN_RFDTLx and CAN_RFDTHx registers can be used by user
applications to obtain valid messages.
Message reception
The CAN controller boasts two FIFO with three levels to receive messages. FIFO rule is adopted. When
the message is received correctly and has passed the identifier filtering, it is regarded as a valid message
and is stored in the corresponding FIFO. The number of the received messages RFxMN[1: 0] will be
incremented by one whenever the receive FIFO receives a valid message. If a valid message is received
when RFxMN[1: 0]=3, the controller will select either to overwrite the previous messages or discard the
new incoming message through the MDRSEL bit in the CAN_MCTRL register.
In the meantime, when the user reads a frame of message and the RFxR is set in the CAN_RFx register,
one FIFO mailbox is released, and RFxMN[1: 0] bit is descremented by one in the CAN_RFx register.
Receive FIFO status
RFxMN[1: 0], RFxFF and RFxOF bits in the RFx register are used to indicate receive FIFO status.
RFxMN[1: 0]: indicates the number of valid messages stored in the FIFOx.
RFxFF: indicates that three valid messages are stroed in the FIFOx (i.e. the three
mailboxes are full), as shown in (c) of Figure 20-13.
RFxOF: indicates that a new valid message has been received while the FIFOx is full, as shown in (d)
of
Figure 20-13
Receive FIFO status
Address
0
Address
1
Read
Addr
Write
Addr
(
a
)
Receive a valid frame
(
b
)
Receive a valid frame
(
c
)
Receive a valid frame
(
d
)
Receive a valid frame
(
e
)
Release a frame
(
f
)
Release a frame
Address
2
Address
0
Address
1
Address
2
Address
0
Address
1
Address
2
Address
0
Address
1
Address
2
Address
0
Address
1
Address
2
Address
0
Address
1
Address
2
Read
Addr
Read
Addr
Read
Addr
Read
Addr
Read
Addr
Write
Addr
Write
Addr
Write
Addr
Write
Addr
Write
Addr