37.5.5 Sleep Mode Operation

The CAN can be configured to operate in any sleep mode where AHB and GCLK clocks are provided.

The CAN has its own low power mode that may be used at any time. This is performed by writing one to the Clock Stop Request bit in the CC Control register (CCCR.CSR = 1).

Once all pending transactions are completed and the idle bus state is detected, the CAN will automatically set the Clock Stop Acknowledge bit (CCCR.CSA = 1). The CAN then reverts back to its initial state (CCCR.INIT = 1), blocking further transfers.

To leave low power mode, CSR bit in CCCR register must be written to 0. Afterwards, the application can restart CAN communication by resetting bit CCCR.INIT.

After reset, the GCLK_CAN and CLK_CAN_SYS clocks are not requested, except for each APB bus access. After the CAN initialization (CCCR.INIT =0), both GCLK_CAN and CLK_CAN_SYS clocks are requested as long as Clock Stop Request bit in the CC Control register is cleared (CCCR.CSR = 0), and stopped when Clock Stop Request bit in the CC Control register is set (CCCR.CSR = 1) and the Clock Stop Acknowledge bit is set (CCCR.CSA = 1).

In Standby sleep mode, when the RUNSTDBY bit is set (CTRLA.RUNSTDBY=1), the CAN IP is allowed to continue to run its operation.

When the RUNSTDBY bit is cleared (CTRLA.RUNSTDBY=0) and the Standby sleep mode is detected, a hardware mechanism will request the M_CAN peripheral to stop its operation, and enables the CAN low power mode automatically. The CCCR.CSR bit is automatically set one as long as the stop request operation is active

When all pending transmission requests have completed, the M_CAN waits until bus idle state is detected. Then the M_CAN sets then CCCR.INIT to one to prevent any further CAN transfers. The hardware stop request is acknowledged and CCCR.CSA bit is set one. The clocks requests are switched off.

When the system exits the Standby sleep mode, CSR bit in CCCR register must be written to 0. Afterwards, the application can restart CAN communication by resetting bit CCCR.INIT.

Note: In case of a heavily disturbed CAN bus, it may happen that idle state is never reached and CCCR.INIT is therefore not set by the M_CAN. This situation can be detected by polling PSR.ACT. In case there is a risk the M_CAN does not enter idle state, it is recommended to use the software procedure to put the M_CAN in low power mode, before the system goes to Standby sleep mode. In this way, the software can write CCCR.INIT = ‘1’, which stops CAN communication of the M_CAN immediately, regardless whether there is a transmission/reception ongoing or not.