23
ATmega161(L)
1228B–09/01
Note:
1. If BOOTRST fuse is programmed, the reset vector is located on program address
$1e00, see Table 39 on page 110 for details.
The most typical and general program setup for the Reset and Interrupt vector
addresses are:
Address
Labels
Code
Comments
$000
jmp
RESET
; Reset Handler
$002
jmp
EXT_INT0
; IRQ0 Handler
$004
jmp
EXT_INT1
; IRQ1 Handler
$006
jmp
EXT_INT2
; IRQ2 Handler
$008
jmp
TIM2_COMP
; Timer2 Compare Handler
$00a
jmp
TIM2_OVF
; Timer2 Overflow Handler
$00c
jmp
TIM1_CAPT
; Timer1 Capture Handler
$00e
jmp
TIM1_COMPA
; Timer1 CompareA Handler
$010
jmp
TIM1_COMPB
; Timer1 CompareB Handler
$012
jmp
TIM1_OVF
; Timer1 Overflow Handler
$014
jmp
TIM0_COMP
; Timer0 Compare Handler
$016
jmp
TIM0_OVF
; Timer0 Overflow Handler
$018
jmp
SPI_STC;
; SPI Transfer Complete Handler
Table 2.
Reset and Interrupt Vectors
Vector
No.
Program Address
Source
Interrupt Definition
1
$000
RESET
External Pin, Power-on Reset, Brown-out
Reset and Watchdog Reset
2
$002
INT0
External Interrupt Request 0
3
$004
INT1
External Interrupt Request 1
4
$006
INT2
External Interrupt Request 2
5
$008
TIMER2 COMP
Timer/Counter2 Compare Match
6
$00a
TIMER2 OVF
Timer/Counter2 Overflow
7
$00c
TIMER1 CAPT
Timer/Counter1 Capture Event
8
$00e
TIMER1 COMPA
Timer/Counter1 Compare Match A
9
$010
TIMER1 COMPB
Timer/Counter1 Compare Match B
10
$012
TIMER1 OVF
Timer/Counter1 Overflow
11
$014
TIMER0 COMP
Timer/Counter0 Compare Match
12
$016
TIMER0 OVF
Timer/Counter0 Overflow
13
$018
SPI, STC
Serial Transfer Complete
14
$01a
UART0, RX
UART0, Rx Complete
15
$01c
UART1, RX
UART1, Rx Complete
16
$01e
UART0, UDRE
UART0 Data Register Empty
17
$020
UART1, UDRE
UART1 Data Register Empty
18
$022
UART0, TX
UART0, Tx Complete
19
$024
UART1, TX
UART1, Tx Complete
20
$026
EE_RDY
EEPROM Ready
21
$028
ANA_COMP
Analog Comparator