59
2513L–AVR–03/2013
ATmega162/V
Table 26 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 locations. 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.
Note:
means unprogrammed while “0” means programmed.
The most typical and general program setup for the Reset and Interrupt Vector Addresses in
ATmega162 is:
Address
Labels
Code
Comments
0x000
jmp
RESET
; Reset Handler
0x002
jmp
EXT_INT0
; IRQ0 Handler
0x004
jmp
EXT_INT1
; IRQ1 Handler
0x006
jmp
EXT_INT2
; IRQ2 Handler
0x008
jmp
PCINT0
; PCINT0 Handler
0x00A
jmp
PCINT1
; PCINT1 Handler
0x00C
jmp
TIM3_CAPT
; Timer3 Capture Handler
0x00E
jmp
TIM3_COMPA
; Timer3 CompareA Handler
0x010
jmp
TIM3_COMPB
; Timer3 CompareB Handler
0x012
jmp
TIM3_OVF
; Timer3 Overflow Handler
0x014
jmp
TIM2_COMP
; Timer2 Compare Handler
0x016
jmp
TIM2_OVF
; Timer2 Overflow Handler
0x018
jmp
TIM1_CAPT
; Timer1 Capture Handler
0x01A
jmp
TIM1_COMPA
; Timer1 CompareA Handler
0x01C
jmp
TIM1_COMPB
; Timer1 CompareB Handler
0x01E
jmp
TIM1_OVF
; Timer1 Overflow Handler
0x020
jmp
TIM0_COMP
; Timer0 Compare Handler
0x022
jmp
TIM0_OVF
; Timer0 Overflow Handler
0x024
jmp
SPI_STC
; SPI Transfer Complete Handler
0x026
jmp
USART0_RXC
; USART0 RX Complete Handler
0x028
jmp
USART1_RXC
; USART1 RX Complete Handler
0x02A
jmp
USART0_UDRE
; UDR0 Empty Handler
0x02C
jmp
USART1_UDRE
; UDR1 Empty Handler
0x02E
jmp
USART0_TXC
; USART0 TX Complete Handler
0x030
jmp
USART1_TXC
; USART1 TX Complete Handler
0x032
jmp
EE_RDY
; EEPROM Ready Handler
0x034
jmp
ANA_COMP
; Analog Comparator Handler
0x036
jmp
SPM_RDY
; Store Program Memory Ready Handler
;
0x038 RESET:
ldi
r16,high(RAMEND) ; Main program start
0x039
out
SPH,r16
; Set Stack Pointer to top of RAM
Table 26. Reset and Interrupt Vectors
Placement BOOTRST
IVSEL
Reset address
Interrupt Vectors Start Address
1
0
0x0000
0x0002
1
0x0000
Boot Reset Address + 0x0002
0
Boot Reset Address
0x0002
0
1
Boot Reset Address
Boot Reset Address + 0x0002