
AT32F413
Series Reference Manual
2022.06.27
Page 296
Rev 2.00
20.6.2 Operating modes
The CAN controller has three operating modes:
Sleep mode
After a system reset, the CAN controller is in Sleep mode. In this mode, the CAN clock is stopped
to reduce power consumption and an internal pull-up resistance is disabled. However, the software
can still access to the mailbox registers.
The software requests the CAN controller to enter Sleep mode by setting the DZEN bit in the
CAN_MCTRL register. The hardware confirms the request by setting DZC=1 in the CAN_MSTS
register.
Exit Sleep mode in two ways:
The CAN controller can be woke up by hardware clearing the DZEN bit when the AEDEN bit is set
to 1in the CAN_MCTRL register and the CAN bus activity is detected. It can also be woke up by
software clearing the DZEN bit.
Switch from Sleep mode to Frozen mode:
The CAN controller switches from Sleep mode to
Frozen mode when the FZEN bit is set to 1 in the CAN_MCTRL register and the DZEN bit is cleared.
Such switch operation is confirmed by hardware setting the FZC bit to 1 in the CAN_MSTS register.
Switch from Sleep mode 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 CAN controller initialization can be done by software only in Frozen mode, including the
CAN_BTMG and CAN_MCTRL registers. But the 14 CAN filter banks (mode, scale, FIFO
association, activation and filter values) can be initialized in non-Frozen mode. When the CAN
controller is in Frozen mode, message reception and transmission are both disabled.
Switch from Frozen mode 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 from Communication mode 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 from Communication mode 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 has
been complete.
Switch from Communication mode 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 has
been complete.
20.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.