
51
2552K–AVR–04/11
ATmega329/3290/649/6490
When the BOOTRST Fuse is unprogrammed, the Boot section size set to 4K bytes and the
IVSEL bit in the MCUCR Register is set before any interrupts are enabled, the most typical and
general program setup for the Reset and Interrupt Vector Addresses is:
Address
Labels Code
Comments
0x0000
RESET: ldi
r16,high(RAMEND); Main program start
0x0001
out
SPH,r16
; Set Stack Pointer to top of RAM
0x0002
ldi
r16,low(RAMEND)
0x0003
out
SPL,r16
0x0004
sei
; Enable interrupts
0x0005
<instr> xxx
;
.org 0x3802/0x7802
0x3804/0x7804
jmp
EXT_INT0
; IRQ0 Handler
0x3806/0x7806
jmp
PCINT0
; PCINT0 Handler
...
;
0x1C2C
jmp
SPM_RDY
; Store Program Memory Ready Handler
When the BOOTRST Fuse is programmed and the Boot section size set to 4K bytes, the most
typical and general program setup for the Reset and Interrupt Vector Addresses is:
Address
Labels Code
Comments
.org 0x0002
0x0002
jmp
EXT_INT0
; IRQ0 Handler
0x002
2
jmp
USI_OVF
; USI Overflow Handler
0x002
4
jmp
ANA_COMP
; Analog Comparator Handler
0x002
6
jmp
ADC
; ADC Conversion Complete
Handler
0x002
8
jmp
EE_RDY
; EEPROM Ready Handler
0x002
A
jmp
SPM_RDY
; SPM Ready Handler
0x002
C
jmp
LCD_SOF
; LCD Start of Frame Handler
0x002
E
jmp
PCINT2
; PCINT2 Handler
0x003
0
jmp
PCINT3
; PCINT3 Handler
;
0x003
2
RESET
:
ldi
r16,
high(RAMEND)
; Main program start
0x003
3
out
SPH,r16
; Set Stack Pointer to top of
RAM
0x003
4
ldi
r16, low(RAMEND)
0x003
5
out
SPL,r16
0x003
6
sei
; Enable interrupts
0x003
7
<ins
tr>
xxx
...