
AT32F435/437
Series Reference Manual
2022.11.11
Page 403
Rev 2.03
Figure 20-11
16-bit identifier list m ode
CAN_FiFB1[15:8]
CAN_FiFB1[7:0]
CAN_FiFB1[31:24]
CAN_FiFB1[23:16]
CAN_FiFB2[15:8]
CAN_FiFB2[7:0]
CAN_FiFB2[31:24]
CAN_FiFB2[23:16]
SID[10:0]
RTR
EID[17:15]
IDT
ID
ID
ID
ID
Mapping
Filter match number
28 filter banks have different filtering effects dependent on the bit width mode. For example, 32-bit
identifier mask mode contains the filters numbered n while 16-bit identifier list mode contains the filters
numbered n, n+1, n+2 and n+3. When a frame of message passes through the filter number N, the
number N is stored in the RFFMN[7: 0] bit in the CAN_RFCx register. The distribution of the filter number
does not take into account the activation state of the filter banks.
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 are 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~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.
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 controller 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.