ATmega128(L)
When the BOOTRST fuse is unprogrammed, the Boot section size set to 8K 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 LabelsCode
Comments
$0000
$0001
$0002
RESET:ldi
out
r16,high(RAMEND); Main program start
SPH,r16
; Set stack pointer to top of RAM
ldi
r16,low(RAMEND)
SPL,r16
$0003
$0004
out
sei
; Enable interrupts
$0005
;
<instr> xxx
.org $F002
$F002
jmp
jmp
...
jmp
EXT_INT0 ; IRQ0 Handler
EXT_INT1 ; IRQ1 Handler
$F004
...
...
;
$F044
SPM_RDY
; Store Program Memory Ready Handler
When the BOOTRST fuse is programmed and the Boot section size set to 8K bytes, the most
typical and general program setup for the Reset and Interrupt Vector Addresses is:
Address
.org $0002
$0002
LabelsCode
Comments
jmp
jmp
...
jmp
EXT_INT0 ; IRQ0 Handler
EXT_INT1 ; IRQ1 Handler
$0004
...
...
;
$0044
SPM_RDY
; Store Program Memory Ready Handler
;
.org $F000
$F000
$F001
$F002
RESET: ldi
r16,high(RAMEND); Main program start
SPH,r16 ; Set stack pointer to top of RAM
out
ldi
r16,low(RAMEND)
SPL,r16
$F003
$F004
out
sei
; Enable interrupts
$F005
<instr> xxx
When the BOOTRST fuse is programmed, the Boot section size set to 8K 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
;
.org $F000
$F000
$F002
jmp
jmp
RESET
; Reset handler
EXT_INT0 ; IRQ0 Handler
$F004
...
jmp
...
jmp
EXT_INT1 ; IRQ1 Handler
...
;
$F044
SPM_RDY ; Store Program Memory Ready Handler
r16,high(RAMEND); Main program start
$F046
$F047
$F048
RESET: ldi
out
SPH,r16
; Set stack pointer to top of RAM
ldi
r16,low(RAMEND)
63
2467P–AVR–08/07