Questions tagged [sleep]

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.

166 questions
2
votes
1 answer

Push and hold on/off switch for arduino

Many electronic devices turn on/off, or more correctly on/sleep, by pressing a button and holding it for two or three seconds. I would like to put this ability into a project using an Adafruit Feather board. The sleep side is easy, I can detect a…
PhotoKevin
  • 21
  • 2
1
vote
1 answer

Low-Power library question

i'm study the Low-Power library to better undertand how it works. In this part of code i have some question. Sometime he uses commands like: power_timer1_disable(); power_timer0_disable(); but in other part of code, example "TIMER2_OFF": if…
0
votes
1 answer

Wake-UP the ATtiniy44 from sleep_mode_pwr_down with a PushButton

I'm curently playing with sleep modes. When I push the button, melody starts, push again go to deep down sleep and save 3v battery, push again wake up and melody starts again. But seems like it doesn't completely goes to sleep and can't wake…
tommy
  • 29
  • 6
0
votes
1 answer

Can Arduino go in and out of Sleep or Deep Sleep Automatically?

I am wondering if an Arduino Uno can go in and out of deep sleep automatically with some sort of cue such as a certain time. In my case I have a small light connected to my Arduino Uno as well as a DS1302 clock module which is being powered via a…
Swiss Gnome
  • 103
  • 2
0
votes
1 answer

MKR Fox 1200 doesn't wake up from sleep

I have a Sigfox Arduino meassuring some sensors, sending it to the cloud and then falling asleep. void setup() { Serial.begin(9600); while (!Serial) {}; if (!SigFox.begin()) { Serial.println("Shield error or not present!"); return; } …
Flo
  • 131
  • 4
0
votes
1 answer

How to put arduino in sleep mode?

I need to put arduino in sleep mode. I did not find the library avr/sleep.h . From where to download it.
Bhavika
  • 1
  • 1