Rainbow Electronics ATmega3290P_V User Manual
Page 51

51
ATmega329/339/649/659
2552H–AVR–11/06
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
;
.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
0x0004
jmp
PCINT0
; PCINT0 Handler
...
...
...
;
0x002C
jmp
SPM_RDY
; Store Program Memory Ready
Handler
;
.org 0x3800/0x7800
0x3800/0x7801RESET:ldir16,high(RAMEND); Main program start
0x3801/0x7801
out
SPH,r16
; Set Stack Pointer to top of RAM
0x3802/0x7802
ldi
r16,low(RAMEND)
0x3803/0x7803
out
SPL,r16
0x3804/0x7804
sei
; Enable interrupts
0x3805/0x7805
When the BOOTRST Fuse is programmed, 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 typ-
ical and general program setup for the Reset and Interrupt Vector Addresses is:
Address
Labels Code
Comments
;
.org 0x3800/0x7800
0x3800/0x7800
jmp
RESET
; Reset handler
0x3802/0x7802
jmp
EXT_INT0
; IRQ0 Handler
0x3804/0x7804
jmp
PCINT0
; PCINT0 Handler
...
...
...
;
0x382C/0x782C
jmp
SPM_RDY
; Store Program Memory Ready Handler
;