Datasheet

38
ATmega323(L)
1457E11/01
Bit 1, 0 - ISC01, ISC00: Interrupt Sense Control 0 Bit 1 and Bit 0
The External Interrupt 0 is activated by the external pin INT0 if the SREG I-flag and the
corresponding interrupt mask are set. The level and edges on the external INT0 pin that
activate the interrupt are defined in Table 10. The value on the INT0 pin is sampled
before detecting edges. If edge or toggle interrupt is selected, pulses that last longer
than one clock period will generate an interrupt. Shorter pulses are not guaranteed to
generate an interrupt. If low level interrupt is selected, the low level must be held until
the completion of the currently executing instruction to generate an interrupt.
Sleep Modes To enter any of the six sleep modes, the SE bit in MCUCR must be set (one) and a
SLEEP instruction must be executed. The SM2, SM1 and SM0 bits in the MCUCR regis-
ter select which sleep mode (Idle, ADC Noise Reduction, Power-down, Power-save,
Standby or Extended Standby) will be activated by the SLEEP instruction. See Table 8
for a summary. 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, executes the interrupt routine,
and resumes execution from the instruction following SLEEP. The contents of the regis-
ter file, SRAM, and I/O memory 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.
Idle Mode When the SM2..0 bits are set to 000, the SLEEP instruction makes the MCU enter Idle
Mode, stopping the CPU but allowing SPI, USART, Analog Comparator, ADC, 2-wire
Serial Interface, Timer/Counters, Watchdog, and the interrupt system to continue oper-
ating. This enables the MCU to wake up from external triggered interrupts as well as
internal ones like the Timer Overflow and USART 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 Sta-
tus register
ACSR. This will reduce power consumption in Idle Mode. If the ADC is
enabled, a conversion starts automatically when this mode is entered.
ADC Noise Reduction Mode When the SM2..0 bits are set to 001, the SLEEP instruction makes the MCU enter ADC
Noise Reduction Mode, stopping the MCU but allowing the ADC, the external interrupts,
the 2-wire Serial Interface address watch, Timer/Counter2 and the Watchdog to con-
tinue operating (if enabled). This improves the noise environment for the ADC, enabling
higher resolution measurements. If the ADC is enabled, a conversion starts automati-
cally when this mode is entered. Apart form the ADC Conversion Complete interrupt,
only an external reset, a Watchdog Reset, a Brown-out Reset, a 2-wire Serial Interface
address match interrupt, or an external level interrupt on INT0 or INT1, or an external
edge interrupt on INT2, can wake up the MCU from ADC Noise Reduction Mode. A
Timer/Counter2 output compare or overflow event will wake up the MCU, but will not
generate an interrupt unless Timer/Counter2 is clocked asynchronously.
Table 10. Interrupt 0 Sense Control
ISC01 ISC00 Description
0 0 The low level of INT0 generates an interrupt request.
0 1 Any logical change on INT0 generates an interrupt request.
1 0 The falling edge of INT0 generates an interrupt request.
1 1 The rising edge of INT0 generates an interrupt request.