This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:multiasm:piot:chapter_4_12 [2025/05/31 10:01] – marcin | en:multiasm:piot:chapter_4_12 [2026/01/19 15:16] (current) – marcin | ||
|---|---|---|---|
| Line 8: | Line 8: | ||
| * Extended Standby | * Extended Standby | ||
| - | To enter any of the sleep modes, the Sleep Enable bit in the Sleep Mode Control Register (SMCR.SE) must be written to ' | + | To enter any of the sleep modes, the Sleep Enable bit in the Sleep Mode Control Register (SMCR.SE) must be written to ' |
| + | <figure avr_sleepmodes> | ||
| + | {{: | ||
| + | < | ||
| + | </ | ||
| - | {{: | + | |
| + | ^ 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** | **Idle Mode** | ||
| - | When the SM[2:0] bits are set to ' | + | When the SM[2:0] bits are set to ' |
| **Power-Down Mode** | **Power-Down Mode** | ||
| Line 26: | Line 39: | ||
| **Standby Mode** | **Standby Mode** | ||
| - | When the SM[2:0] bits are set to ' | + | When the SM[2:0] bits are set to ' |
| **Extended Standby Mode** | **Extended Standby Mode** | ||
| - | When the SM[2:0] bits are set to ' | + | When the SM[2:0] bits are set to ' |
| + | ^ Layer ^ What it does ^ Your interaction | ||
| + | | HAL (Arduino + avr-libc) | Sets SMCR bits for you | Easy, high-level | ||
| + | | Assembly (sleep) | ||
| + | | Hardware (SMCR register) | Controls sleep mode | Hidden unless accessed manually | | ||
| - | 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). | + | Summary Table: SMCR Differences Across AVR Families |
| + | |||
| + | ^ Feature | ||
| + | | Register name | SMCR | SMCR | SLEEP.CTRL | ||
| + | | Sleep enable bit | Yes (SE) | Yes (SE) | No | | ||
| + | | Mode bits | SM1:SM0 (sometimes SM2) | SM2: | ||
| + | | Number of modes | 3–4 | 5–6 | 4 | | ||
| + | | Power save mode | Rare | Yes | Yes | | ||
| + | | Standby mode | Some models | ||
| + | | Extended Standby | ||
| + | | Architecture | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | 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. {{ref> | ||
| + | |||
| + | <figure avr_prrdetails> | ||
| + | {{: | ||
| + | < | ||
| + | </ | ||
| - | {{: | ||
| - | The PRR provides a runtime method to stop the clock to select individual peripherals. The current state of the peripheral is 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, which is done by clearing the bit in PRR, puts the module | + | The PRR provides a runtime method to stop the clock to select individual peripherals. The peripheral is currently |
| - | PRR clock shutdown can be used in Idle mode and Active | + | The PRR clock shutdown can be used in Idle and Active |
| + | |||
| + | PRR Differences Across AVR Families | ||
| + | |||
| + | ^ Feature | ||
| + | | PRR exists | ||
| + | | Number of registers | ||
| + | | Peripheral coverage | ||
| + | | Architecture | ||
| + | | Arduino support | ||
| - | Tips to Minimize | + | Tips to Minimise |
| - | * Analog | + | * Analogue |
| - | * Analog | + | * Analogue |
| * Brown-Out Detector (BOD): Turn off the BOD if not needed, as it consumes power in all sleep modes. | * Brown-Out Detector (BOD): Turn off the BOD if not needed, as it consumes power in all sleep modes. | ||
| - | * Internal Voltage Reference: Disable it if not needed by the ADC, Analog | + | * Internal Voltage Reference: Disable it if not needed by the ADC, Analogue |
| * Watchdog Timer: Turn off the Watchdog Timer if not needed, as it consumes power in all sleep modes. | * Watchdog Timer: Turn off the Watchdog Timer if not needed, as it consumes power in all sleep modes. | ||
| - | * Port Pins: Configure port pins to minimize | + | * Port Pins: Configure port pins to minimise |
| * On-chip Debug System: Disable the On-chip debug system if not needed, as it consumes power in sleep modes. | * On-chip Debug System: Disable the On-chip debug system if not needed, as it consumes power in sleep modes. | ||