Datasheet

ATmega164A/PA/324A/PA/644A/PA/1284/P
2018 Microchip Technology Inc. Data Sheet Complete DS40002070A-page 72
Notes: 1. Applies only to ATmega1284P.
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 Labels CodeComments
0x00000 RESET: ldir16,high(RAMEND); Main
program start
0x00001 outSPH,r16; Set Stack
Pointer to top of RAM
0x00002 ldir16,low(RAMEND)
0x00003 outSPL,r16
0x00004 sei; Enable interrupts
0x00005 <instr> xxx
;
.org 0x1F002
0x1F002 jmpEXT_INT0; IRQ0 Handler
0x1F004 jmpEXT_INT1; IRQ1 Handler
... ......;
0x1FO36 jmpSPM_RDY; SPM 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 Labels CodeComments
.org 0x0002
0x00002 jmpEXT_INT0; IRQ0 Handler
0x00004 jmpEXT_INT1; IRQ1 Handler
... ......;
0x00036 jmpSPM_RDY; SPM Ready
Handler
;
.org 0x1F000
0x1F000 RESET: ldir16,high(RAMEND); Main
program start
0x1F001 outSPH,r16; Set Stack
Pointer to top of RAM
0x1F002 ldir16,low(RAMEND)
;
0x0046 RESET: ldi r16,high(RAMEND) ; Main program start
0x0047 out SPH,r16 ; Set Stack Pointer to top of RAM
0x0048 ldi r16,low(RAMEND)
0x0049 out SPL,r16
0x004A sei ; Enable interrupts
0x004B <instr> xxx
... ... ... ...