4.9.5 Sleep Modes and Active Power Reduction
Sleep modes enable the application to shut down unused modules in the MCU to save power. The AVR provides various sleep modes.
To enter any of the sleep modes, the SE bit in SMCR must be written to logic
‘1
’, and the user must execute a SLEEP instruction. The SM[2:0] bits in
the SMCR register select which sleep mode (Idle, Extended Power Save Power Down, Power
Save) is activated by the AVR SLEEP instruction. The MCU wakes up if an enabled
interrupt occurs while the MCU is in Sleep mode. The MCU is, then, stopped for four
cycles in addition to the start-up time, executes the interrupt routine and resumes
execution from the instruction following SLEEP. The contents of the register file and
SRAM are not altered when the device wakes up. If a reset occurs during Sleep mode, the
MCU wakes up and executes from the reset vector. For more details on overview of the
clocks and their distribution, See AVR Clock Systems in the System Clock and
Clock Options from Related Links. The following table provides details about the
available sleep modes with the corresponding active clock domains and wake-up
sources.
IDLEMode
When the SM[2:0] bits are written to 0b000, the SLEEP instruction makes the MCU enter the IDLEMode, stopping the CPU but allowing the peripherals, for example, SPI, RX DSP, timer and the interrupt system to continue operating. This sleep mode basically stops CLKCPU and CLKNVM while allowing the other clocks to run.
IDLEMode enables the MCU to wake up from externally-triggered interrupts as well as internal interrupts, such as the timer overflow or a receive buffer full interrupt of the on-chip digital data demodulator.
Extended Power-Save Mode
When the SM[2:0] bits are written to 0b001, the SLEEP instruction makes the MCU enter the extended power-save mode, stopping the CPU and the peripherals on the I/O bus but allowing the SPI, RX DSP, timer, watchdog and the interrupt system to continue operating. This sleep mode basically stops CLKCPU, CLKI/O and CLKNVM while allowing the other clocks to run.
The Extended Power-save mode enables the MCU to wake up from external triggered interrupts as well as internal interrupts such as the timer overflow or a receive buffer full interrupt of the on-chip digital data demodulator.
Power-Save Mode
When the SM[2:0] bits are written to 0b011, the SLEEP instruction makes the MCU enter the power-save mode. In this mode, the FRC oscillator and the external input clock are stopped, while the external interrupts and the watchdog continues operation (if enabled). Only an external reset, a watchdog reset, RX DSP interrupts, an external level interrupt or a pin change interrupt can wake up the MCU. This sleep mode basically stops all generated clocks, allowing the operation of asynchronous modules only.
Power Down Mode
When the SM[2:0] bits are written to 0b010, the SLEEP instruction makes the MCU enter Power-down mode, stopping the CPU and the peripherals on the I/O bus but allowing the RX DSP interrupts, timer and the asynchronous interrupts to continue operating. This sleep mode basically stops all generated clocks, allowing operation of asynchronous modules only.
Active Clock Domains | Oscillators and External Clocks | Wake-up Sources | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Sleep Mode | CLKCPU | CLKNVM | CLKI/O | CLKT | External Clock | CLKFRC | CLKSRC | CLKWDT | CLKXTO2,4,6 | CLKADIV | CLKVDIV | INT0/1 and Pin Change | UHF-Receiver | EEPROM | SPI | SSM | Supply | Ext. input clock monitor | Timer0 | Timer1/2/3/4 | Timer5 |
IDLE | — | — | X | X | X | X | X | X | X (1) | X | (2) | X | X | X | X | X | X | X | X | X | X |
Extended Power-Save | — | — | — | X | X | X | X | X | X (1) | X | (2) | X | — | X | — | — | X | X | X | X | — |
Power-Save | — | — | — | — | — | (4) | X | X | X (1) | X | (2) | X | — | — | — | — | X | — | X | X | — |
Power-Down | — | — | — | — | — | (4) | X (3) | X (3) | X (1) | — | (2) | X | — | — | — | — | X | — | X | X | — |
- Only if XTO and AVCC voltage regulator are enabled in the RF front end.
- Active only if enabled.
- Turned off if not selected as the clock source for the AVR or any peripheral (for example, timer), the watchdog is disabled by fuse and the CMCR.SRCD bit is set.
- Active only if forced on by CMOCR.FRCAO or used by the port debouncing logic.