ATmega32(L)
Table 19. Reset and Interrupt Vectors Placement(1)
BOOTRST
IVSEL
Reset address
$0000
Interrupt Vectors Start Address
$0002
1
1
0
0
0
1
0
1
$0000
Boot Reset Address + $0002
$0002
Boot Reset Address
Boot Reset Address
Boot Reset Address + $0002
Note:
1. The Boot Reset Address is shown in Table 99 on page 255. 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 ATmega32 is:
Address Labels
$000
$002
$004
$006
$008
$00A
$00C
$00E
$010
$012
$014
$016
$018
$01A
$01C
$01E
$020
$022
$024
$026
$028
;
Code
jmp
jmp
jmp
jmp
jmp
jmp
jmp
jmp
jmp
jmp
jmp
jmp
jmp
jmp
jmp
jmp
jmp
jmp
jmp
jmp
jmp
Comments
RESET
; Reset Handler
EXT_INT0
EXT_INT1
EXT_INT2
TIM2_COMP
TIM2_OVF
TIM1_CAPT
TIM1_COMPA
TIM1_COMPB
TIM1_OVF
TIM0_COMP
TIM0_OVF
SPI_STC
; IRQ0 Handler
; IRQ1 Handler
; IRQ2 Handler
; Timer2 Compare Handler
; Timer2 Overflow Handler
; Timer1 Capture Handler
; Timer1 CompareA Handler
; Timer1 CompareB Handler
; Timer1 Overflow Handler
; Timer0 Compare Handler
; Timer0 Overflow Handler
; SPI Transfer Complete Handler
; USART RX Complete Handler
; UDR Empty Handler
USART_RXC
USART_UDRE
USART_TXC
ADC
; 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
TWI
SPM_RDY
$02A
$02B
$02C
$02D
$02E
$02F
...
RESET:
ldi
out
ldi
out
sei
r16,high(RAMEND) ; Main program start
SPH,r16
; Set Stack Pointer to top of RAM
r16,low(RAMEND)
SPL,r16
; Enable interrupts
<instr> xxx
...
...
45
2503J–AVR–10/06