ATmega48PA/88PA/168PA/328P
Table 11-6. Reset and Interrupt Vectors in ATmega328P (Continued)
Program
VectorNo.
Address(2)
Source
Interrupt Definition
EEPROM Ready
23
24
25
26
0x002C
0x002E
0x0030
0x0032
EE READY
ANALOG COMP
TWI
Analog Comparator
2-wire Serial Interface
Store Program Memory Ready
SPM READY
Notes: 1. When the BOOTRST Fuse is programmed, the device will jump to the Boot Loader address at reset, see ”Boot Loader Sup-
port – Read-While-Write Self-Programming, ATmega88PA, ATmega168PA and ATmega328P” on page 277.
2. When the IVSEL bit in MCUCR 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 11-7 on page 66 shows reset and Interrupt Vectors placement for the various combina-
tions 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.
Table 11-7. Reset and Interrupt Vectors Placement in ATmega328P(1)
BOOTRST
IVSEL
Reset Address
0x000
Interrupt Vectors Start Address
0x002
1
1
0
0
0
1
0
1
0x000
Boot Reset Address + 0x0002
0x002
Boot Reset Address
Boot Reset Address
Boot Reset Address + 0x0002
Note:
1. The Boot Reset Address is shown in Table 26-7 on page 289. For the BOOTRST Fuse “1”
means unprogrammed while “0” means programmed.
The most typical and general program setup for the Reset and Interrupt Vector Addresses in
ATmega328P is:
Address Labels Code
Comments
0x0000
0x0002
0x0004
0x0006
0x0008
0x000A
0x000C
0x000E
0x0010
0x0012
0x0014
0x0016
0x0018
0x001A
0x001C
0x001E
jmp
jmp
jmp
jmp
jmp
jmp
jmp
jmp
jmp
jmp
jmp
jmp
jmp
jmp
jmp
jmp
RESET
; Reset Handler
EXT_INT0
EXT_INT1
PCINT0
; IRQ0 Handler
; IRQ1 Handler
; PCINT0 Handler
PCINT1
; PCINT1 Handler
PCINT2
; PCINT2 Handler
WDT
; Watchdog Timer Handler
; Timer2 Compare A Handler
; Timer2 Compare B Handler
; Timer2 Overflow Handler
; Timer1 Capture Handler
; Timer1 Compare A Handler
; Timer1 Compare B Handler
; Timer1 Overflow Handler
; Timer0 Compare A Handler
; Timer0 Compare B Handler
TIM2_COMPA
TIM2_COMPB
TIM2_OVF
TIM1_CAPT
TIM1_COMPA
TIM1_COMPB
TIM1_OVF
TIM0_COMPA
TIM0_COMPB
66
8161D–AVR–10/09