
AT32WB415
Series Reference Manual
2022.04.13
Page 273
Ver 2.00
Priority rules
When the CAN controller receives a frame of message, the message may pass through several 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 filters ar configured by setting the FCS bit 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 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~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.
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