Interrupts
This section describes the specifics of the interrupt handling as performed in
ATmega16. For a general explanation of the AVR interrupt handling, refer to “Reset and
Interrupt Handling” on page 11.
Interrupt Vectors in
ATmega16
Table 18. Reset and Interrupt Vectors
Program
Vector No. Address(2)
Source
Interrupt Definition
1
$000(1)
RESET
External Pin, Power-on Reset, Brown-out
Reset, Watchdog Reset, and JTAG AVR
Reset
2
3
$002
$004
$006
$008
$00A
$00C
$00E
$010
$012
$014
$016
$018
$01A
$01C
$01E
$020
$022
$024
$026
$028
INT0
External Interrupt Request 0
External Interrupt Request 1
Timer/Counter2 Compare Match
Timer/Counter2 Overflow
INT1
4
TIMER2 COMP
TIMER2 OVF
TIMER1 CAPT
5
6
Timer/Counter1 Capture Event
7
TIMER1 COMPA Timer/Counter1 Compare Match A
TIMER1 COMPB Timer/Counter1 Compare Match B
8
9
TIMER1 OVF
TIMER0 OVF
SPI, STC
Timer/Counter1 Overflow
Timer/Counter0 Overflow
Serial Transfer Complete
USART, Rx Complete
10
11
12
13
14
15
16
17
18
19
20
21
USART, RXC
USART, UDRE
USART, TXC
ADC
USART Data Register Empty
USART, Tx Complete
ADC Conversion Complete
EEPROM Ready
EE_RDY
ANA_COMP
TWI
Analog Comparator
Two-wire Serial Interface
External Interrupt Request 2
Timer/Counter0 Compare Match
Store Program Memory Ready
INT2
TIMER0 COMP
SPM_RDY
Notes: 1. When the BOOTRST fuse is programmed, the device will jump to the Boot Loader
address at reset, see “Boot Loader Support – Read-While-Write Self-Programming”
on page 241.
2. When the IVSEL bit in GICR is set, interrupt vectors will be moved to the start of the
Boot Flash section. The address of each Interrupt Vector will then be the address in
this table added to the start address of the Boot Flash section.
Table 19 shows Reset and Interrupt Vectors placement for the various combinations of
BOOTRST and IVSEL settings. If the program never enables an interrupt source, the
Interrupt Vectors are not used, and regular program code can be placed at these loca-
tions. This is also the case if the Reset Vector is in the Application section while the
Interrupt Vectors are in the Boot section or vice versa.
42
ATmega16(L)
2466E–AVR–10/02