beautypg.com

Idle mode, Power-down mode, Standby mode – Rainbow Electronics ATtiny2313 User Manual

Page 31: Attiny2313

background image

31

ATtiny2313

2543A–AVR–08/03

Idle Mode

When the SM1..0 bits are written to 00, the SLEEP instruction makes the MCU enter
Idle mode, stopping the CPU but allowing the UART, Analog Comparator, ADC, USI,
Timer/Counters, Watchdog, and the interrupt system to continue operating. This sleep
mode basically halts clk

CPU

and clk

FLASH

, while allowing the other clocks to run.

Idle mode enables the MCU to wake up from external triggered interrupts as well as
internal ones like the Timer Overflow and UART Transmit Complete interrupts. If wake-
up from the Analog Comparator interrupt is not required, the Analog Comparator can be
powered down by setting the ACD bit in the Analog Comparator Control and Status
Register – ACSR. This will reduce power consumption in Idle mode.

Power-down Mode

When the SM1..0 bits are written to 01 or 11, the SLEEP instruction makes the MCU
enter Power-down mode. In this mode, the external Oscillator is stopped, while the
external interrupts, the USI start condition detection, and the Watchdog continue operat-
ing (if enabled). Only an External Reset, a Watchdog Reset, a Brown-out Reset, USI
start condition interrupt, an external level interrupt on INT0, or a pin change interrupt can
wake up the MCU. This sleep mode basically halts all generated clocks, allowing opera-
tion of asynchronous modules only.

Note that if a level triggered interrupt is used for wake-up from Power-down mode, the
changed level must be held for some time to wake up the MCU. Refer to “External Inter-
rupts” on page 61 f
or details.

When waking up from Power-down mode, there is a delay from the wake-up condition
occurs until the wake-up becomes effective. This allows the clock to restart and become
stable after having been stopped. The wake-up period is defined by the same CKSEL
Fuses that define the Reset Time-out period, as described in “Clock Sources” on page
23.

Standby Mode

When the SM1..0 bits are 10 and an external crystal/resonator clock option is selected,
the SLEEP instruction makes the MCU enter 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.

Notes:

1. Only recommended with external crystal or resonator selected as clock source.
2. For INT0, only level interrupt.

Table 14. Active Clock Domains and Wake-up Sources in the Different Sleep Modes.

Active Clock Domains

Oscillators

Wake-up Sources

Sleep Mode

clk

CPU

clk

FLAS

H

clk

IO

En

a

b

le

d

INT

0

, INT

1

an

d

Pi

n

Cha

n

ge

US

I S

ta

rt

Co

n

d

it

io

n

SP

M

/E

EPRO

M

Re

a

d

y

Oth

e

r I/O

Idle

X

X

X

X

X

X

Power-down

X

(2)

X

Standby

(1)

X

X

(2)

X