48
Atmel ATmega16/32/64/M1/C1 [DATASHEET]
7647K–AVR–12/13
Table 8-2 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:
1.
while “0” means programmed.
The most typical and general program setup for the Reset and Interrupt Vector Addresses in ATmega16/32/64/M1/C1 is:
Address Labels Code
Comments
0x000
jmp
RESET
; Reset Handler
0x002
jmp
ANA_COMP_0
; analog comparator 0 Handler
0x004
jmp
ANA_COMP_1
; analog comparator 1 Handler
0x006
jmp
ANA_COMP_2
; analog comparator 2 Handler
0x008
jmp
ANA_COMP_3
; analog comparator 3 Handler
0x00A
jmp
PSC_FAULT
; PSC Fault Handler
0x00C
jmp
PSC_EC
; PSC End of Cycle Handler
0x00E
jmp
EXT_INT0
; IRQ0 Handler
0x010
jmp
EXT_INT1
; IRQ1 Handler
0x012
jmp
EXT_INT2
; IRQ2 Handler
0x014
jmp
EXT_INT3
; IRQ3 Handler
0x016
jmp
TIM1_CAPT
; Timer1 Capture Handler
0x018
jmp
TIM1_COMPA
; Timer1 Compare A Handler
0x01A
jmp
TIM1_COMPB
; Timer1 Compare B Handler
0x01C
jmp
TIM1_OVF
; Timer1 Overflow Handler
0x01E
jmp
TIM0_COMPA
; Timer0 Compare A Handler
0x020
jmp
TIM0_COMPB
; Timer0 Compare B Handler
0x022
jmp
TIM0_OVF
; Timer0 Overflow Handler
0x024
jmp
CAN_INT
; CAN MOB,Burst,General Errors Handler
0x026
jmp
CAN_TOVF
; CAN Timer Overflow Handler
0x028
jmp
LIN_TC
; LIN Transfer Complete Handler
0x02A
jmp
LIN_ERR
; LIN Error Handler
0x02C
jmp
PCINT0
; Pin Change Int Request 0 Handler
0x02E
jmp
PCINT1
; Pin Change Int Request 1 Handler
0x030
jmp
PCINT2
; Pin Change Int Request 2 Handler
0x032
jmp
PCINT3
; Pin Change Int Request 3 Handler
0x034
jmp
SPI_STC
; SPI Transfer Complete Handler
0x036
jmp
ADC
; ADC Conversion Complete Handler
0x038
jmp
WDT
; Watchdog Timer Handler
0x03A
jmp
EE_RDY
; EEPROM Ready Handler
0x03C
jmp
SPM_RDY
; Store Program Memory Ready Handler
;
0x03E
RESET: ldi
r16, high(RAMEND)
; Main program start
0x03F
out
SPH,r16
; Set Stack Pointer to top of RAM
0x040
ldi
r16, low(RAMEND)
0x041
out
SPL,r16
0x042
sei
; Enable interrupts
0x043
<instr>
xxx
...
Table 8-2.
Reset and Interrupt Vectors Placement in ATmega16/32/64/M1/C1(1)
BOOTRST
IVSEL
Reset Address
Interrupt Vectors Start Address
1
0
0x000
0x001
1
0x000
Boot reset address + 0x002
0
Boot reset address
0x001
0
1
Boot reset address
Boot reset address + 0x002