AT32F425
Series Reference Manual
2022.03.30
Page 327
Ver 2.01
The filter x is associated with FIFO0 or FIFO1 by setting the FRFSELx bit in the CAN_FRF
register.
The filter banks x are activated by setting FAENx=1 in the CAN_FACFG register.
Configure 0~27 filter banks by writing to the CAN_FiFBx register (i=0…27; x=1,2).
Complete the CAN filter configuration by setting FCS=0 in the CAN_FCTRL register.
19.6.5 Message transmission
Register configuration
To transmit a message, it is necessary to select one transmit mailbox and configure it through the
CAN_TMIx, CAN_TMCx, CAN_TMDTLx and CAN_TMDTHx registers. Once the mailbox
configuration is complete, setting the TMSR bit in the CAN_TMIx register can initiate CAN
transmission.
Message transmission
The mailbox enters pending state immediately after the mailbox is configured and the CAN controller
receives the transmit request. At this point, the CAN controlle will confirm whether the mailbox is given
the highest priority or not. If yes, it will enter SCHEDULED STATE, otherwise, it will wait to get the highest
priority. The mailbox in SCHEDULED state will monitor the CAN bus state so that the messages in
SCHEDULED mailbox can be transmitted as soon as the CAN bus becomes idle. The mailbox will enter
EMPTY state at the end of the message transmission.
Figure 19-12
Transmit mailbox status
EMPTY
PENDING
Send request(TMSR = 1)
Is it the highest
priority
SCHEDULED
Yes
Is the bus idle
SENDING
Yes
Send success or send failed with
auto retransmission forbidden
Abort sending(TMxCT = 1)
Abort sending(TMxCT = 1)
Send failed with automatic
retransmission
No
No
Transmit priority configuration
When two or more transmit boxes are in PENDING state, their transmit priority must be given.
By identifier: When MMSSR=0 in the CAN_MCTRL register, the transmit order is defined by the identifier
of the message in the mailbox. The message with lower identifier value has the highest priority. If the
identifier values are the same, the message with lower mailbox number will be transmitted first.
By transmit request order: When MMSSR=1 in the CAN_MCTRL register, the transmit priority is given
by the transmit request order of mailboxes.
Transmit status and error status
The TMxTCF, TMxTSF, TMxALF, TMxTEF and TMxEF bits in the CAN_TSTS register are used to
indicate transmit status and error status.
TMxTCF bit: Transmission complete flag, indicating that the data transmission is complete when
TMxTCF=1.
TMxTSF bit: Transmission success flag, indicating that the data has been transmitted successfully when