Read through this ATtiny85 Sleep Modes Tutorial series to learn how to save power on your ATtiny85 MCUs and use them efficiently on batteries.
INTRODUCTION
Microcontrollers have become indispensable tools, especially for portable applications. Nowadays, so many gadgets use microcontrollers that fit your pocket or can be brought anywhere. One of the main requirements of being portable is having a long battery life. With this, you must know how to save power when operating your MCU.
How to Save Power on an ATtiny85
Like other MCUs, the ATtiny85 MCU has power-saving features. These features include sleep modes, powering down peripherals and clocks, using timers and your watchdog, and manipulating I/O sources and buffers. Combining these features will give you the best power-saving technique for your particular application.
ATtiny85 Sleep Modes
It’s best to begin this ATtiny85 sleep modes tutorial by discussing the different ATtiny85 sleep modes. These modes include the Idle, ADC Noise Reduction, and Power Down modes. Note that all sleep modes halt the CPU and stop it from executing any program instruction; however, depending on the mode, other peripherals and systems may continue to run. When the system wakes up from your chosen sleep mode, program execution continues from where it left; this means executing the statements following the sleep mode command.Â
Idle MOde
Idle mode halts the fewest clock sources, the CPU and Flash clock, thus offering the least power savings. Conversely, other peripherals, such as the Comparator, ADC, USI, Timer, and Watchdog, can still run. The interrupt system will also continue to run, so you can use an interrupt source to wake up the system and continue from where it left off. You can optionally power down the comparator or other peripherals for more power savings.
ADC Noise Reduction Mode
If you want leaner ADC values, the ADC Noise Reduction power-saving mode is the way to go. This mode disables clock sources that may affect ADC values during acquisition in sleep mode, including the I/O, CPU, and Flash clocks. With this, you can increase ADC resolution without worries.Â
Several interrupt sources can wake up the CPU in this mode including:
- ADC Interrupt
- External Reset
- Watchdog Reset
- Brown-out Reset
- SPM/EEPROM ready interrupt
- External level interrupt on INT0 or a Pin Change Interrupt
Power Down MOde
Ideally, Power Down sleep mode should have the lowest current consumption because it disables all clock sources, including the oscillator block, which consumes some current. When the CPU halts, the external interrupts, the USI start condition detection, and the Watchdog can continue operating. The events that can wake up the CPU are:
- External Reset
- Watchdog Reset
- Brown-out Reset
- USI start condition
interrupt - External level interrupt on INT0 or a pin change interrupt
Now that you know the different sleep modes, you can begin writing example codes for each and discover their usefulness.
SHOP THIS PROJECT
-
Digital LCD Thermometer Temperature Gauge with Probe
$15.95Original price was: $15.95.$14.95Current price is: $14.95. Add to cart