beautypg.com

Atmega8515(l) – Rainbow Electronics ATmega8515L User Manual

Page 53

background image

53

ATmega8515(L)

2512A–AVR–04/02

When the BOOTRST Fuse is unprogrammed, the Boot section size set to 2K bytes and
the IVSEL bit in the GICR 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

$000

RESET:

ldi

r16,high(RAMEND); Main program start

$001

out

SPH,r16

; Set stack pointer to top of RAM

$002

ldi

r16,low(RAMEND)

$003

out

SPL,r16

$004

sei

; Enable interrupts

$005

xxx

;

.org $C02

$C02

rjmp

EXT_INT0

; IRQ0 Handler

$C04

rjmp

EXT_INT1

; IRQ1 Handler

...

....

..

;

$C2A

rjmp

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

Comments

.org $002

$001

rjmp

EXT_INT0

; IRQ0 Handler

$002

rjmp

EXT_INT1

; IRQ1 Handler

...

....

..

;

$010

rjmp

SPM_RDY

; Store Program Memory Ready Handler

;

.org $C00

$C00

RESET:

ldi

r16,high(RAMEND); Main program start

$C01

out

SPH,r16

; Set stack pointer to top of RAM

$C02

ldi

r16,low(RAMEND)

$C03

out

SPL,r16

$C04

sei

; Enable interrupts

$C05

xxx

When the BOOTRST Fuse is programmed, the Boot section size set to 2K bytes and the
IVSEL bit in the GICR 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 $C00

$C00

rjmp

RESET

; Reset handler

$C01

rjmp

EXT_INT0

; IRQ0 Handler

$C02

rjmp

EXT_INT1

; IRQ1 Handler

...

....

..

;

$C10

rjmp

SPM_RDY

; Store Program Memory Ready Handler

;

$C11

RESET:

ldi

r16,high(RAMEND); Main program start

$C12

out

SPH,r16

; Set stack pointer to top of RAM

$C13

ldi

r16,low(RAMEND)

$C14

out

SPL,r16

$C15

sei

; Enable interrupts

$C16

xxx