0% found this document useful (0 votes)
24 views1 page

Atmel 0051

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 1

When the BOOTRST fuse is unprogrammed, 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 Atmel® ATmega328P is:
Address Labels Code Comments
0x0000 RESET: ldi r16,high(RAMEND); Main program start
0x0001 out SPH,r16 ; Set Stack Pointer to top of RAM
0x0002 ldi r16,low(RAMEND)
0x0003 out SPL,r16
0x0004 sei ; Enable interrupts
0x0005 <instr> xxx
;
.org 0x3C02
0x3C02 jmp EXT_INT0 ; IRQ0 Handler
0x3C04 jmp EXT_INT1 ; IRQ1 Handler
... ... ... ;
0x3C32 jmp 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 Atmel ATmega328P is:
Address Labels Code Comments
.org 0x0002
0x0002 jmp EXT_INT0 ; IRQ0 Handler
0x0004 jmp EXT_INT1 ; IRQ1 Handler
... ... ... ;
0x0032 jmp SPM_RDY ; Store Program Memory Ready Handler
;
.org 0x3C00
0x3C00 RESET: ldi r16,high(RAMEND); Main program start
0x3C01 out SPH,r16 ; Set Stack Pointer to top of RAM
0x3C02 ldi r16,low(RAMEND)
0x3C03 out SPL,r16
0x3C04 sei ; Enable interrupts
0x3C05 <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 Atmel ATmega328P is:
Address Labels Code Comments
;
.org 0x3C00
0x3C00 jmp RESET ; Reset handler
0x3C02 jmp EXT_INT0 ; IRQ0 Handler
0x3C04 jmp EXT_INT1 ; IRQ1 Handler
... ... ... ;
0x3C32 jmp SPM_RDY ; Store Program Memory Ready Handler
;
0x3C33 RESET: ldi r16,high(RAMEND); Main program start
0x3C34 out SPH,r16 ; Set Stack Pointer to top of RAM
0x3C35 ldi r16,low(RAMEND)
0x3C36 out SPL,r16
0x3C37 sei ; Enable interrupts
0x3C38 <instr> xxx

ATmega328P [DATASHEET] 51
7810D–AVR–01/15

You might also like