54
ATmega165A/PA/325A/PA/3250A/PA/645A/P/6450A/P [DATASHEET]
8285E–AVR–02/2013
The most typical and general program setup for the Reset and Interrupt Vector Addresses in Atmel
ATmega325A/325PA/3250A/3250PA/625A/645P/6450A/6450P is:
When the BOOTRST Fuse is unprogrammed, the Boot section size set to 4K 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
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 0x3802/0x7802
0x3804/0x7804
jmp
EXT_INT0
; IRQ0 Handler
0x3806/0x7806
jmp
PCINT0
; PCINT0 Handler
...
;
0x1C2C
jmp
SPM_RDY
; Store Program Memory Ready Handler
Address
Labels
Code
Comments
0x0000
jmp
RESET
; Reset Handler
0x0002
jmp
EXT_INT0
; IRQ0 Handler
0x0004
jmp
PCINT0
; PCINT0 Handler
0x0006
jmp
PCINT1
; PCINT1 Handler
0x0008
jmp
TIM2_COMP
; Timer2 Compare Handler
0x000A
jmp
TIM2_OVF
; Timer2 Overflow Handler
0x000C
jmp
TIM1_CAPT
; Timer1 Capture Handler
0x000E
jmp
TIM1_COMPA
; Timer1 CompareA Handler
0x0010
jmp
TIM1_COMPB
; Timer1 CompareB Handler
0x0012
jmp
TIM1_OVF
; Timer1 Overflow Handler
0x0014
jmp
TIM0_COMP
; Timer0 Compare Handler
0x0016
jmp
TIM0_OVF
; Timer0 Overflow Handler
0X0018
jmp
SPI_STC
; SPI Transfer Complete Handler
0x001A
jmp
USART_RXC
; USART0 RX Complete Handler
0x001C
jmp
USART_UDRE
; USART0,UDR0 Empty Handler
0x001E
jmp
USART_TXC
; USART0 TX Complete Handler
0x0020
jmp
USI_STRT
; USI Start Condition Handler
0x0022
jmp
USI_OVF
; USI Overflow Handler
0x0024
jmp
ANA_COMP
; Analog Comparator Handler
0x0026
jmp
ADC
; ADC Conversion Complete Handler
0x0028
jmp
EE_RDY
; EEPROM Ready Handler
0x002A
jmp
SPM_RDY
; SPM Ready Handler
0x002C
jmp
NOT_USED
; RESERVED
0x002E
jmp
PCINT2
; PCINT2 Handler
0x0030
jmp
PCINT3
; PCINT3 Handler
;
0x0032
RESET:
ldi
r16, high(RAMEND)
; Main program start
0x0033
out
SPH,r16
; Set Stack Pointer to top of RAM
0x0034
ldi
r16, low(RAMEND)
0x0035
out
SPL,r16
0x0036
sei
; Enable interrupts
0x0037
<inst
r>
xxx
...