
64
2490R–AVR–02/2013
ATmega64(L)
When the BOOTRST Fuse is programmed and the Boot section size set to 8 Kbytes, 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
EXT_INT1
; IRQ1 Handler
...
;
0x0044
jmp
SPM_RDY
; Store Program Memory Ready Handler
;
.org 0x7000
0x7000
RESET:
ldi
r16,high(RAMEND); Main program start
0x7001
out
SPH,r16
; Set Stack Pointer to top of RAM
0x7002
ldi
r16,low(RAMEND)
0x7003
out
SPL,r16
0x7004
sei
; Enable interrupts
0x7005
<instr>
xxx
When the BOOTRST Fuse is programmed, the Boot section size set to 8 Kbytes 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
;
.org 0x7000
0x7000
jmp
RESET
; Reset handler
0x7002
jmp
EXT_INT0
; IRQ0 Handler
0x7004
jmp
EXT_INT1
; IRQ1 Handler
...
;
0x7044
jmp
SPM_RDY ; Store Program Memory Ready Handler
0x7046
RESET:
ldi
r16,high(RAMEND); Main program start
0x7047
out
SPH,r16
; Set Stack Pointer to top of RAM
0x7048
ldi
r16,low(RAMEND)
0x7049
out
SPL,r16
0x704A
sei
; Enable interrupts
0x704B
<instr>
xxx
Moving Interrupts
Between Application
and Boot Space
The General Interrupt Control Register controls the placement of the Interrupt Vector table.
MCUCR – MCU
Control Register
Bit 1 – IVSEL: Interrupt Vector Select
When the IVSEL bit is cleared (zero), the Interrupt Vectors are placed at the start of the Flash
memory. When this bit is set (one), the Interrupt Vectors are moved to the beginning of the Boot
Bit
765
4321
0
SRE
SRW10
SE
SM1
SM0
SM2
IVSEL
IVCE
MCUCR
Read/Write
R/W
Initial Value
000
0000
0