32
ATmega8A [DATASHEET]
8159E–AVR–02/2013
10. Power Management and Sleep Modes
10.1
Sleep Modes
Sleep modes enable the application to shut down unused modules in the MCU, thereby saving power. The AVR
provides various sleep modes allowing the user to tailor the power consumption to the application’s requirements.
Figure 9-1 on page 24 presents the different clock systems in the ATmega8A, and their distribution. The figure is
helpful in selecting an appropriate sleep mode.
Table 10-1 shows the different clock options and their wake-up
sources.
Notes:
1. External Crystal or resonator selected as clock source.
2. If AS
2 bit in ASSR is set.
3. Only level interrupt INT1 and INT0.
To enter any of the five sleep modes, the SE bit in MCUCR must be written to logic one and a SLEEP instruction
must be executed. The SM2, SM1, and SM0 bits in the MCUCR Register select which sleep mode (Idle, ADC
Noise Reduction, Power-down, Power-save, or Standby) will be activated by the SLEEP instruction. See
Table 10-If an enabled interrupt occurs while the MCU is in a sleep mode, the MCU wakes up. The MCU is then halted for
four cycles in addition to the start-up time, it executes the interrupt routine, and resumes execution from the instruc-
tion following SLEEP. The contents of the Register File and SRAM are unaltered when the device wakes up from
sleep. If a reset occurs during sleep mode, the MCU wakes up and executes from the Reset Vector.
Note that the Extended Standby mode present in many other AVR MCUs has been removed in the ATmega8A, as
the TOSC and XTAL inputs share the same physical pins.
10.2
Idle Mode
When the SM2:0 bits are written to 000, the SLEEP instruction makes the MCU enter Idle mode, stopping the CPU
but allowing SPI, USART, Analog Comparator, ADC, Two-wire Serial Interface, Timer/Counters, Watchdog, and
Table 10-1.
Active Clock Domains and Wake-up Sources in the Different Sleep Modes
Active Clock Domains
Oscillators
Wake-up Sources
Sleep Mode
clk
CP
U
clk
FLAS
H
clk
IO
clk
AD
C
clk
AS
Y
Ma
in
Cloc
k
Sour
c
e
Enab
led
Timer
Osc.
Enab
led
INT
1
/INT
0
TW
IAd
d
re
ss
Ma
tc
h
Ti
mer
2
SPM
/E
EPR
OM
Read
y
ADC
Oth
e
rI/
O
Idle
X
XX
X
ADC Noise
Reduction
XX
X
XX
X
Power-down
X
Power-save
X