0x0031
0x0032
out
sei
SPL,r16
; Enable interrupts
0x0033
...
<instr> xxx
... ...
...
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 is:
Address Labels Code
0x0000 RESET: ldi
Comments
r16,high(RAMEND); Main program start
0x0001
0x0002
out
ldi
SPH,r16
; Set Stack Pointer to top of RAM
r16,low(RAMEND)
SPL,r16
0x0003
0x0004
out
sei
; Enable interrupts
0x0005
;
<instr> xxx
.org 0x1C02
0x1C02
0x1C04
...
jmp
jmp
...
jmp
EXT_INT0
; IRQ0 Handler
PCINT0
...
; PCINT0 Handler
;
0x1C2C
SPM_RDY
; Store Program Memory Ready Handler
When the BOOTRST Fuse is programmed and the Boot section size set to 2K bytes, the most
typical and general program setup for the Reset and Interrupt Vector Addresses is:
Address Labels Code
.org 0x0002
Comments
0x0002
0x0004
...
jmp
jmp
...
jmp
EXT_INT0
PCINT0
...
; IRQ0 Handler
; PCINT0 Handler
;
0x002C
;
SPM_RDY
; Store Program Memory Ready Handler
.org 0x1C00
0x1C00 RESET: ldi
r16,high(RAMEND); Main program start
0x1C01
0x1C02
out
ldi
SPH,r16
; Set Stack Pointer to top of RAM
r16,low(RAMEND)
SPL,r16
0x1C03
0x1C04
out
sei
; Enable interrupts
0x1C05
<instr> xxx
When the BOOTRST Fuse is programmed, 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 is:
Address Labels Code
Comments
;
.org 0x1C00
0x1C00
0x1C02
jmp
jmp
RESET
EXT_INT0
; Reset handler
; IRQ0 Handler
0x1C04
...
jmp
...
jmp
PCINT0
...
; PCINT0 Handler
;
0x1C2C
SPM_RDY
; Store Program Memory Ready Handler
58
ATmega169P
8018A–AVR–03/06