When the BOOTRST fuse is unprogrammed, the Boot section size set to 2K 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 in ATmega16/32/64/M1/C1 is:
Address
Labels Code
Comments
0x000 RESET: ldi
r16,high(RAMEND)
SPH,r16
r16,low(RAMEND)
SPL,r16
; Main program start
; Set Stack Pointer to top of RAM
0x001
0x002
0x003
0x004
0x005
;
out
ldi
out
sei
; Enable interrupts
<instr> xxx
.org 0xC02
0xC02
0xC04
...
jmp
jmp
...
jmp
ANA_COMP_0
ANA_COMP_1
...
; analog comparator 0 Handler
; analog comparator 1 Handler
;
0xC3C
SPM_RDY
; Store Program Memory Ready Handler
When the BOOTRST fuse is programmed and the boot section size set to 2Kbytes, the most typical and general program
setup for the reset and interrupt vector addresses in ATmega16/32/64/M1/C1 is:
Address
.org 0x002
0x002
0x004
...
Labels Code
Comments
jmp
jmp
...
jmp
ANA_COMP_0
ANA_COMP_1
...
; analog comparator 0 Handler
; analog comparator 1 Handler
;
0x03C
SPM_RDY
; Store Program Memory Ready Handler
;
.org 0xC00
0xC00 RESET: ldi
r16,high(RAMEND)
SPH,r16
r16,low(RAMEND)
SPL,r16
; Main program start
; Set Stack Pointer to top of RAM
0xC01
0xC02
0xC03
0xC04
0xC05
out
ldi
out
sei
; Enable interrupts
<instr> xxx
When the BOOTRST fuse is programmed, the boot section size set to 2Kbytes 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 in ATmega16/32/64/M1/C116/32 is:
Address
;
Labels Code
Comments
.org 0xC00
0xC00
0xC02
0xC04
...
jmp
jmp
jmp
RESET
ANA_COMP_0
ANA_COMP_1
; Reset handler
; analog comparator 0 Handler
; analog comparator 1 Handler
;
...
...
0xC3C
;
jmp
SPM_RDY
; Store Program Memory Ready Handler
0xC3E RESET: ldi
r16,high(RAMEND)
SPH,r16
r16,low(RAMEND)
SPL,r16
; Main program start
; Set Stack Pointer to top of RAM
0xC3F
0xC40
0xC41
0xC42
0xC43
out
ldi
out
sei
; Enable interrupts
<instr> xxx
ATmega16/32/64/M1/C1 [DATASHEET]
49
7647O–AVR–01/15