Idle Mode.

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What is the Idle mode in AVR MCU?

শূন্য  - The ZeRo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

According to ATmega128RFA1 datasheet:

Quote:
The Idle mode stops the CPU while allowing the SRAM, Timer/Counters, SPI port, and interrupt system to continue functioning. The Power-down mode saves the register contents but freezes the Oscillator, disabling all other chip functions until the next interrupt or hardware reset. In Power-save mode, the asynchronous timer continues to run, allowing the user to maintain a timer base while the rest of the device is sleeping. The ADC Noise Reduction mode stops the CPU and all I/O modules except asynchronous timer and ADC, to minimize switching noise during ADC conversions. In Standby mode, the RC oscillator is running while the rest of the device is sleeping. This allows very fast start-up combined with low power consumption. In Extended Standby mode, both the main RC oscillator and the asynchronous timer continue to run.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Your AVR datasheet should have a chapter called something like "Power Management and sleep modes". In that you will find that "Idle" is just one of a number of levels of sleep mode offered by an AVR. You tell the sleep controller which one you'd like. Then you execute the SLEEP opcode. The CPU then stops all the clocks it offers to stop in the given mode and stops fetching opcodes. What wakes it up is some kind of interrupt ("wake up sources"). See this typical table:

 

So this particular AVR offers "Idle", "ADC Noise Reduction Mode", "Power-Down", and so on. More and more of the clocks are stopped as you get further down the table and consequently the amount of energy required to operate the CPU is reduced down as far a a fraction of a micro Amp. This is all to do with operating AVRs on batteries. To make the battery last as long as possible you try to make the code sleep as often as possible in the deepest sleep mode possible but which one you can use will often be determined by the wake-up source you plan to use.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

This is common to pretty much all microcontrollers today: there are various levels of sleep/idle to give various levels of power saving traded-off against the options for waking the device up again...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...