63
8272E–AVR–04/2013
ATmega164A/PA/324A/PA/644A/PA/1284/P
The most typical and general program setup for the Reset and Interrupt Vector Addresses in
Atmel ATmega164A/164PA/324A/324PA/644A/644PA/1284/1284P is:
Address
Labels
Code
Comments
0x0000
jmp
RESET
; Reset
0x0002
jmp
INT0
; IRQ0
0x0004
jmp
INT1
; IRQ1
0x0006
jmp
INT2
; IRQ2
0x0008
jmp
PCINT0
; PCINT0
0x000A
jmp
PCINT1
; PCINT1
0x000C
jmp
PCINT2
; PCINT2
0x000E
jmp
PCINT3
; PCINT3
0x0010
jmp
WDT
; Watchdog Timeout
0x0012
jmp
TIM2_COMPA
; Timer2 CompareA
0x0014
jmp
TIM2_COMPB
; Timer2 CompareB
0x0016
jmp
TIM2_OVF
; Timer2 Overflow
0x0018
jmp
TIM1_CAPT
; Timer1 Capture
0x001A
jmp
TIM1_COMPA
; Timer1 CompareA
0x001C
jmp
TIM1_COMPB
; Timer1 CompareB
0x001E
jmp
TIM1_OVF
; Timer1 Overflow
0x0020
jmp
TIM0_COMPA
; Timer0 CompareA
0x0022
jmp
TIM0_COMPB
; Timer0 CompareB
0x0024
jmp
TIM0_OVF
; Timer0 Overflow
0x0026
jmp
SPI_STC
; SPI Transfer Complete
0x0028
jmp
USART0_RXC
; USART0 RX Complete
0x002A
jmp
USART0_UDRE
; USART0,UDR Empty
0x002C
jmp
USART0_TXC
; USART0 TX Complete
0x002E
jmp
ANA_COMP
; Analog Comparator
0x0030
jmp
ADC
; ADC Conversion
Complete
0x0032
jmp
EE_RDY
; EEPROM Ready
0x0034
jmp
TWI
; two-wire Serial
0x0036
jmp
SPM_RDY
; SPM Ready
0x0038
jmp
USART1_RXC
; USART1 RX Complete
0x003A
jmp
USART1_UDRE
; USART1,UDR Empty
0x003C
jmp
USART1_TXC
; USART1 TX Complete
0x003E
jmp
TIM3_CAPT
; Timer3 Capture
0x0040
jmp
TIM3_COMPA
; Timer3 Compare
0x0042
jmp
TIM3_COMPB
; Timer3 CompareB
0x0044
jmp
TIM3_OVF
; Timer3 Overflow
;
0x003E
RESET:
ldi
r16,high(RAMEND)
; Main program start
0x003F
out
SPH,r16
; Set Stack Pointer to
top of RAM
0x0040
ldi
r16,low(RAMEND)
0x0041
out
SPL,r16
0x0042
sei
; Enable interrupts
0x0043
<instr
>
xxx
...