ATmega8(L)
Table 19. Reset and Interrupt Vectors Placement
BOOTRST(1)
IVSEL
Reset Address
0x000
Interrupt Vectors Start Address
1
1
0
0
0
1
0
1
0x001
0x000
Boot Reset Address + 0x001
0x001
Boot Reset Address
Boot Reset Address
Boot Reset Address + 0x001
Note:
1. The Boot Reset Address is shown in Table 82 on page 213. For the BOOTRST Fuse “1”
means unprogrammed while “0” means programmed
The most typical and general program setup for the Reset and Interrupt Vector Addresses in
ATmega8 is:
addressLabelsCode
Comments
$000
$001
$002
$003
$004
$005
$006
$007
$008
$009
$00a
$00b
$00c
$00d
$00e
$00f
$010
$011
$012
;
rjmp
rjmp
rjmp
rjmp
rjmp
rjmp
rjmp
rjmp
rjmp
rjmp
rjmp
rjmp
rjmp
rjmp
rjmp
rjmp
rjmp
rjmp
rjmp
RESET
; Reset Handler
EXT_INT0
EXT_INT1
TIM2_COMP
TIM2_OVF
TIM1_CAPT
TIM1_COMPA
TIM1_COMPB
TIM1_OVF
TIM0_OVF
SPI_STC
USART_RXC
USART_UDRE
USART_TXC
ADC
; IRQ0 Handler
; IRQ1 Handler
; Timer2 Compare Handler
; Timer2 Overflow Handler
; Timer1 Capture Handler
; Timer1 CompareA Handler
; Timer1 CompareB Handler
; Timer1 Overflow Handler
; Timer0 Overflow Handler
; SPI Transfer Complete Handler
; USART RX Complete Handler
; UDR Empty Handler
; USART TX Complete Handler
; ADC Conversion Complete Handler
; EEPROM Ready Handler
; Analog Comparator Handler
; Two-wire Serial Interface Handler
; Store Program Memory Ready Handler
EE_RDY
ANA_COMP
TWSI
SPM_RDY
$013
$014
$015
$016
$017
$018
...
RESET: ldi
out
r16,high(RAMEND); Main program start
SPH,r16
; Set Stack Pointer to top of RAM
ldi
r16,low(RAMEND)
SPL,r16
out
sei
; Enable interrupts
<instr> xxx
...
...
47
2486AA–AVR–02/2013