
AT32F413
Series Reference Manual
2022.06.27
Page 297
Rev 2.00
Loop back mode is selected by setting the LBEN bit in the CAN_BTMG register. In this mode, The
CAN only receives the level signal on its CANTX pin. Meanwhile, the CAN can also send data to
the external bus. The Loop back mode is mainly used for self-test functions.
It is possible to enable both the Listen-only and Loop back mode by setting the LOEN and LBEN
bits in the CAN_BTMG register. In this case, the CAN is disconnected from the bus network, the
CANTX pin remains in recessive state, and the transmit side is connected to the receive side.
20.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_FiFB. 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 register 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 20-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 20-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