Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Sleep refers to a form of power management, where the processor can be instructed to enter various levels of "sleep". Use this tag for discussions about sleep mode.

Modern micro-controllers are designed to be able to be used in battery-powered applications where conservation of power can be paramount. By "putting the processor to sleep" substantial power savings can be achieved.

Also some sleep modes are useful for managing things like processing timing-critical events, or doing ADC conversions without too much digital noise.


Sleep modes

The Atmega328P processor, used in the Arduino Uno, Duemilanove, Pro Mini, Nano, and others, for example has the following sleep modes:

  • Idle Mode

    Basically useful for waking from an interrupt in a controlled way. Useful for highly timing-critical applications like generating video data.

  • ADC Noise Reduction Mode

    This improves the noise environment for the Analog to Digital Converter (ADC), enabling higher resolution measurements. If the ADC is enabled, a conversion starts automatically when this mode is entered.

  • Power-save Mode

    Same as power-down mode, except if Timer 2 is enabled, it keeps running. Useful for saving some power, but still timing an event with Timer 2.

  • Extended Standby Mode

    This mode is identical to Power-save with the exception that the Oscillator is kept running. From Extended Standby mode, the device wakes up in six clock cycles.

  • Standby Mode

    This mode is identical to Power-down with the exception that the Oscillator is kept running. From Standby mode, the device wakes up in six clock cycles.

    (That's what the datasheet says - the difference between Standby Mode and Extended Standby Mode seems subtle)

  • Power-down Mode

    In this mode, the external Oscillator is stopped, while the external interrupts, the 2-wire Serial Interface address watch, and the Watchdog continue operating (if enabled). Only an External Reset, a Watchdog System Reset, a Watchdog Interrupt, a Brown-out Reset, a 2-wire Serial Interface address match, an external interrupt on INT0 or INT1, or a pin change interrupt can wake up the MCU. This sleep mode basically halts all generated clocks, allowing operation of asynchronous modules only.


Waking

Generally speaking, enabled interrupts will wake the processor. These include things like:

  • Pin change interrupts
  • External interrupts
  • Watchdog timer interrupt
  • Brown-out detected
  • Timer interrupts (if timers are running)

A reset will always wake the processor.

history | excerpt history