24
ATmega161(L)
1228B–09/01
$01a
jmp
UART_RXC0
; UART0 RX Complete Handler
$01c
jmp
UART_RXC1
; UART1 RX Complete Handler
$01e
jmp
UART_DRE0
; UDR0 Empty Handler
$020
jmp
UART_DRE1
; UDR1 Empty Handler
$022
jmp
UART_TXC0
; UART0 TX Complete Handler
$024
jmp
UART_TXC1
; UART1 TX Complete Handler
$026
jmp
EE_RDY
; EEPROM Ready Handler
$028
jmp
ANA_COMP
; Analog Comparator Handler
;
$02a
MAIN:
ldi r16,high(RAMEND) ; Main program start
$02b
out SPH,r16
$02c
ldi r16,low(RAMEND)
$02d
out SPL,r16
$02e
<instr>
xxx
…
…
…
…
When the BOOTRST fuse is programmed, the most typical and general program setup
for the Reset and Interrupt vector addresses are:
Address
Labels
Code
Comments
.org $002
; Reset is located at $1e000
$002
jmp
EXT_INT0
; IRQ0 Handler
$004
jmp
EXT_INT1
; IRQ1 Handler
$006
jmp
EXT_INT2
; IRQ2 Handler
$008
jmp
TIM2_COMP
; Timer2 Compare Handler
$00a
jmp
TIM2_OVF
; Timer2 Overflow Handler
$00c
jmp
TIM1_CAPT
; Timer1 Capture Handler
$00e
jmp
TIM1_COMPA
; Timer1 CompareA Handler
$010
jmp
TIM1_COMPB
; Timer1 CompareB Handler
$012
jmp
TIM1_OVF
; Timer1 Overflow Handler
$014
jmp
TIM0_COMP
; Timer0 Compare Handler
$016
jmp
TIM0_OVF
; Timer0 Overflow Handler
$018
jmp
SPI_STC;
; SPI Transfer Complete Handler
$01a
jmp
UART_RXC0
; UART0 RX Complete Handler
$01c
jmp
UART_RXC1
; UART1 RX Complete Handler
$01e
jmp
UART_DRE0
; UDR0 Empty Handler
$020
jmp
UART_DRE1
; UDR1 Empty Handler
$022
jmp
UART_TXC0
; UART0 TX Complete Handler
$024
jmp
UART_TXC1
; UART1 TX Complete Handler
$026
jmp
EE_RDY
; EEPROM Ready Handler
$028
jmp
ANA_COMP
; Analog Comparator Handler
;
$02a
MAIN:
ldi r16,high(RAMEND); Main program start
$02b
out SPH,r16
$02c
ldi r16,low(RAMEND)
$02d
out SPL,r16
$02e
<instr>
xxx
;
.org $1e00
$1e00
jmp
RESET
; Reset handler
…
…
…
…