There are five sleep modes to select from:
To enter any of the sleep modes, the Sleep Enable bit in the Sleep Mode Control Register (SMCR.SE) must be written to '1' and a SLEEP instruction must be executed. Sleep Mode Select bits (SMCR.SM[2:0]) select which sleep mode (Idle, Power-down, Power-save, Standby, or Extended Standby) will be activated by the SLEEP instruction. The sleep modes shown in Fig. 1 are for the ATmega328PB.
| SM2, SM1, SM0 | Sleep Mode |
|---|---|
| 000 | Idle |
| 001 | |
| 010 | Power-down |
| 011 | Power-save |
| 100 | Reserved |
| 101 | Reserved |
| 110 | Standby |
| 111 | Extended Standby |
Idle Mode
When the SM[2:0] bits are set to '000', the SLEEP instruction puts the MCU into Idle mode, stopping the CPU but allowing peripherals like SPI, USART, Analogue Comparator, 2-wire Serial Interface, Timer/Counters, Watchdog, and interrupts to continue operating. This mode halts the CPU and Flash clocks but keeps other clocks running. The MCU can wake up from both external and internal interrupts.
Power-Down Mode
When the SM[2:0] bits are set to '010', the SLEEP instruction puts the MCU into Power-Down mode, stopping the external oscillator. Only external interrupts, 2-wire Serial Interface address watch, and Watchdog (if enabled) can wake the MCU. This mode halts all generated clocks, allowing only asynchronous modules to operate.
Power-Save Mode
When the SM[2:0] bits are set to '011', the SLEEP instruction puts the MCU into Power-Save mode, similar to Power-Down but with Timer/Counter2 running if enabled. The device can wake up from Timer Overflow or Output Compare events from Timer/Counter2.
Standby Mode
When the SM[2:0] bits are set to '110', and an external clock option is selected, the SLEEP instruction puts the MCU into Standby mode, similar to Power-Down but with the oscillator running. The device wakes up in six clock cycles.
Extended Standby Mode
When the SM[2:0] bits are set to '111', and an external clock option is selected, the SLEEP instruction puts the MCU into Extended Standby mode, similar to Power-Save but with the oscillator running. The device wakes up in six clock cycles.
| Layer | What it does | Your interaction |
|---|---|---|
| HAL (Arduino + avr-libc) | Sets SMCR bits for you | Easy, high-level |
| Assembly (sleep) | Executes sleep instruction | Uses SMCR settings |
| Hardware (SMCR register) | Controls sleep mode | Hidden unless accessed manually |
Summary Table: SMCR Differences Across AVR Families
| Feature | tinyAVR | megaAVR | XMEGA |
|---|---|---|---|
| Register name | SMCR | SMCR | SLEEP.CTRL |
| Sleep enable bit | Yes (SE) | Yes (SE) | No |
| Mode bits | SM1:SM0 (sometimes SM2) | SM2:SM0 | SLEEPMODE1:0 |
| Number of modes | 3–4 | 5–6 | 4 |
| Power save mode | Rare | Yes | Yes |
| Standby mode | Some models | Yes | Yes |
| Extended Standby | Rare | Yes | Yes |
| Architecture | Simple | Standard | Advanced |
AVR® 8-bit microcontrollers include several sleep modes to save power. The AVR device can also lower power consumption by shutting down the clock for select peripherals via a register setting. That register is called the Power Reduction Register (PRR), as presented in Fig. 2. The Power Reduction Register (PRR) is another place where AVR families differ quite a bit — sometimes even more than SMCR. If SMCR controls how deeply the CPU sleeps, then PRR controls which peripherals are powered at all.
The PRR provides a runtime method to stop the clock to select individual peripherals. The peripheral is currently frozen, and the I/O registers cannot be read or written. Resources used by the peripheral when stopping the clock will remain committed. Hence, the peripheral should, in most cases, be disabled before stopping the clock. Waking up a module by clearing the bit in PRR puts it back into the state it was in before shutdown. The PRR clock shutdown can be used in Idle and Active modes to significantly reduce overall power consumption. In all other sleep modes, the clock is already stopped.
PRR Differences Across AVR Families
| Feature | tinyAVR | megaAVR | XMEGA |
|---|---|---|---|
| PRR exists | Sometimes | Yes | No (replaced by PR.* registers) |
| Number of registers | 0–1 | 1–2 | Many |
| Peripheral coverage | Very limited | Full | Very granular |
| Architecture | Simple | Standard | Advanced |
| Arduino support | Partial | Full | None (Arduino doesn’t support XMEGA) |
Tips to Minimise Power Consumption.