36
ATmega161(L)
1228B–09/01
Extended MCU Control
Register – EMCUCR
The Extended MCU Control Register contains control bits for external interrupt 2, sleep
mode bit and control bits for the external memory interface.
• Bit 7
–
SM0: Sleep Mode Bit 0
When this bit is set (one) and sleep mode bit 1 (SM1) in MCUCR is set, Power-save
mode is selected as sleep mode. Refer to page 37 for a detailed description of the sleep
modes.
• Bits 6..4
–
SRL2, SRL1, SRL0: External SRAM Limit
It is possible to configure different wait states for different external memory addresses in
ATmega161. The SRL2 - SRL0 bits are used to define at which address the different
wait states will be configured. See “Interface to External Memory” on page 82 for a
detailed description.
• Bits 3..1
–
SRW01, SRW00, SRW11: External SRAM Wait State Select Bits
The SRW01, SRW00 and SRW11 bits are used to set up extra wait states in the exter-
nal memory interface. See “Interface to External Memory” on page 82 for a detailed
description.
• Bit 0
–
ISC2: Interrupt Sense Control 2
The external interrupt 2 is activated by the external pin INT2 if the SREG I-flag and the
corresponding interrupt mask in the GIMSK are set. If ISC2 is cleared (zero), a falling
edge on INT2 activates the interrupt. If ISC2 is set (one), a rising edge on INT2 activates
the interrupt. Edges on INT2 are registered asynchronously. Pulses on INT2 wider than
50 ns will generate an interrupt. Shorter pulses are not guaranteed to generate an
interrupt.
When changing the ISC2 bit, an interrupt can occur. Therefore, it is recommended to
first disable INT2 by clearing its Interrupt Enable bit in the GIMSK register. Then, ISC2
bit can be changed. Finally, the INT2 interrupt flag should be cleared by writing a logical
“1” to its Interrupt Flag bit in the GIFR register before the interrupt is re-enabled.
Table 8.
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.
Bit
7
6
5
4
3
2
1
0
$36 ($56)
SM0
SRL2
SRL1
SRL0
SRW01
SRW00
SRW11
ISC2
EMCUCR
Read/Write
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Initial Value
0
0
0
0
0
0
0
0