
AT32F413
Series Reference Manual
2022.06.27
Page 299
Rev 2.00
CAN_F10FB2[31:
16]-
Mask
CAN_F11FB2[31: 0]-ID
13
12
CAN_F12FB1[15: 0]-ID
No
13
13
CAN_F13FB1[15: 0]-ID
Yes
14
CAN_F12FB1[31: 16]-ID
14
CAN_F13FB1[31: 16]-
ID
15
CAN_F12FB2[15: 0]-ID
15
CAN_F13FB2[15: 0]-ID
16
CAN_F12FB2[31: 16]-ID
16
CAN_F13FB2[31: 16]-
ID
17
Priority rules
When the CAN controller receives a frame of message, the message may pass through severl filters. In
this case, the filter match number stored in the receive mailbox is determined according to the following
priority rules:
A 32-bit filter has priority over a 16-bit filter
For filters with identical bit width, the identifier list mode has priority over the identifier mask
mode
For filter with identical bit width and identifier mode, the lower number has priority over the higher
number.
Filter configuration
The CAN filter can be configured by setting the FCS=1 in the CAN_FCTRL register.
Identifier mask mode or identifier list mode can be selected by setting the FMSELx bit in the
CAN_FMCFG register.
The filter bit width can be configured as two 16 bits or one 32 bits by setting the FBWSELx bit in
the CAN_FBWCFG register.
The filter x is associated with FIFO0 or FIFO1 by writing 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~13 filter banks by writing to the CAN_FiFBx register (i=0…13; x=1,2).
Complete the CAN filter configuration by setting FCS=0 in the CAN_FCTRL register.
20.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.