AT32F425
Series Reference Manual
2022.03.30
Page 324
Ver 2.01
Exit Sleep mode in two ways: The CAN controller can be woke up by hardware clearing the DZEN
bit when the AEDEN bit in the CAN_MCTRL register and the CAN bus activity is detected. It can
also be woke up by software clearing the DZEN bit.
Switch to Frozen mode: The CAN controller switches from Sleep mode to Frozen mode when the
FZEN bit is set in the CAN_MCTRL register and the DZEN bit is cleared. Such switch operation is
confirmed by hardware setting the FZC bit in the CAN_MSTS register.
Switch to Communication mode: The CAN controller enters Communication mode when the FZEN
and DZEN bits are both cleared and the CAN controller has synchronized with the bus. In other
words, it must wait for 11 consecutive recessive bits to be detected on the CANRX pin.
Frozen mode
The software initialization can be done only in Frozen mode, including the CAN_BTMG and
CAN_MCTRL registers. But the initialization of the 14 CAN filter banks (mode, scale, FIFO
association, activation and filter values) can be done in non-Frozen mode. When the CAN controller
is in Frozen mode, message reception and transmission are both disabled.
Switch to Communication mode: The CAN controller leaves Frozen mode when the FZEN bit is
cleared in the CAN_MCTRL register. This switch operation is confirmed by hardware clearing the
FZC bit in the CAN_MSTS register. The CAN controller must be synchronized with the bus.
Switch to Sleep mode: The CAN controller enters Sleep mode if DZEN=1 and FZEN=0 in the
CAN_MCTRL register. This switch operation is confirmed by hardware setting the DZC bit in the
CAN_MSTS register.
Communication mode
After the CAN_BTMG and CAN_MCTRL registers are configured in Frozen mode, the CAN
controller enters Communication mode and is ready for message reception and transmission.
Switch to Sleep mode: The CAN controller switches to Sleep mode when the DZEN bit is set in the
CAN_MCTRL register and the current CAN bus transmission is complete.
Switch to Frozen mode: The CAN controller enters Frozen mode when the FZEN bit is set in the
CAN_MCTRL register and the current CAN bus transmission is complete.
19.6.3 Test modes
The CAN controller defines three test modes, including Listen-only mode, Loop back mode and
combined Listen-only and Loop back mode. Test mode can be selected by setting the LOEN and LBEN
bits in the CAN_BTMG register.
Listen-only mode is selected when the LOEN bit is set in the CAN_BTMG register. In this mode,
the CAN is able to receive data, but only recessive bits are output on the CANTX pin. In the
meantime, the dominant bits output on the CANTX can be monitored by the receive side but
without affecting the CAN bus.
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 combine 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.
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 28 configurable and scalable filter banks (0~27). 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.