AT32WB415
Series Reference Manual
2022.04.13
Page 271
Ver 2.00
19.6.4 Message filtering
The received message has to go through filtering by its identifier. If passed,the message will be stored
in the correspoinding FIFOs. If not, the message will be discarded. The whole operation is done by
hardware without using CPU resources.
Filter bit width
The CAN controller provides 14 configurable and scalable filter banks (0~13). Each filter bank has
two 32-bit registers, CAN_FiFB1 and CAN_FiFB2. The filter bit width can be configured as two 16 bits
or one 32 bits, depending on the corresponding bits in the CAN_FBWCFG register.
32-bit fliter register CAN_FiFBx includes the SID[10: 0], EID[17: 0], IDT and RTR bits.
CAN_FiFB1[31: 21]
CAN_FiFB1[20: 3]
CAN_FiFB1[2: 0]
CAN_FiFB2[31: 21]
CAN_FiFB2[20: 3]
CAN_FiFB2[2: 0]
SID[10: 0]/EID[28: 18]
EID[17: 0]
IDT
RTR
0
Two 16-bit filter register CAN_FiFBx includes SID[10: 0], IDT, RTR and EID[17: 15] bits
CAN_FiFB1[31: 21]
CAN_FiFB1
[20: 19]
CAN_FiFB1
[18: 16]
CAN_FiFB1[15: 5]
CAN_FiFB1
[4: 3]
CAN_FiFB1
[2: 0]
CAN_FiFB2[31: 21]
CAN_FiFB2
[20: 19]
CAN_FiFB2
[18: 16]
CAN_FiFB2[15: 5]
AN_FiFB2
[4: 3]
CAN_FiFB2
[2: 0]
SID[10: 0]
IDT
RTR
EID[17: 15] SID[10: 0]
IDT
RTR
EID[17: 15]
Filtering mode
The filter can be configured in identifier mask mode or in identifier list mode by setting the FMSELx bit
in the CAN_FMCFG register. The mask mode is used to specify which bits must match the pre-
programmed identifiers, and which bits do not need. In identifier list mode, the identifier must match
the pre-programmed identifier. The two modes can be used in conjunction with filter width to deliver
four filtering modes below:
Figure 19-8 32-bit identifier mask mode
CAN_FiFB1[31:21]
CAN_FiFB1[20:3]
CAN_FiFB2[31:21]
CAN_FiFB2[20:3]
CAN_FiFB1
[2:0]
CAN_FiFB2
[2:0]
SID[10:0]
EID[17:0]
IDT
RTR
0
ID
Mask
Mapping
Figure 19-9 32-bit identifier list mode
CAN_FiFB1[20:3]
CAN_FiFB1
[2:0]
CAN_FiFB2[20:3]
CAN_FiFB2
[2:0]
IDT
RTR
0
CAN_FiFB1[31:21]
CAN_FiFB2[31:21]
SID[10:0]
EID[17:0]
ID
ID
Mapping
Figure 19-10 16-bit identifier mask mode
CAN_FiFB1[15:5]
CAN_FiFB1[4:0]
CAN_FiFB1[31:21]
CAN_FiFB1[20:16]
CAN_FiFB2[15:5]
CAN_FiFB2[4:0]
CAN_FiFB2[31:21]
CAN_FiFB2[20:16]
SID[10:0]
RTR
EID[17:15]
IDT
ID
Mask
ID
Mask
Mapping