Datasheet

107
2549O–AVR–05/12
ATmega640/1280/1281/2560/2561
14.2 Reset and Interrupt Vector placement
Table 14-2 shows Reset and Interrupt Vectors placement for the various combinations of
BOOTRST and IVSEL settings. If the program never enables an interrupt source, the Interrupt
Vectors are not used, and regular program code can be placed at these locations. This is also
the case if the Reset Vector is in the Application section while the Interrupt Vectors are in the
Boot section or vice versa.
Note: 1. The Boot Reset Address is shown in Table 29-7 on page 328 through Table 29-15 on page
332. 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
ATmega640/1280/1281/2560/2561 is:
Table 14-2. Reset and Interrupt Vectors Placement
(1)
BOOTRST IVSEL Reset Address Interrupt Vectors Start Address
1 0 0x0000 0x0002
1 1 0x0000 Boot Reset Address + 0x0002
0 0 Boot Reset Address 0x0002
0 1 Boot Reset Address Boot Reset Address + 0x0002
Address Labels Code Comments
0x0000 jmp RESET ; Reset Handler
0x0002 jmp INT0 ; IRQ0 Handler
0x0004 jmp INT1 ; IRQ1 Handler
0x0006 jmp INT2 ; IRQ2 Handler
0x0008 jmp INT3 ; IRQ3 Handler
0x000A jmp INT4 ; IRQ4 Handler
0x000C jmp INT5 ; IRQ5 Handler
0x000E jmp INT6 ; IRQ6 Handler
0x0010 jmp INT7 ; IRQ7 Handler
0x0012 jmp PCINT0 ; PCINT0 Handler
0x0014 jmp PCINT1 ; PCINT1 Handler
0x0016 jmp PCINT2 ; PCINT2 Handler
0X0018 jmp WDT ; Watchdog Timeout Handler
0x001A jmp TIM2_COMPA ; Timer2 CompareA Handler
0x001C jmp TIM2_COMPB ; Timer2 CompareB Handler
0x001E jmp TIM2_OVF ; Timer2 Overflow Handler
0x0020 jmp TIM1_CAPT ; Timer1 Capture Handler
0x0022 jmp TIM1_COMPA ; Timer1 CompareA Handler
0x0024 jmp TIM1_COMPB ; Timer1 CompareB Handler
0x0026 jmp TIM1_COMPC ; Timer1 CompareC Handler
0x0028 jmp TIM1_OVF ; Timer1 Overflow Handler
0x002A jmp TIM0_COMPA ; Timer0 CompareA Handler
0x002C jmp TIM0_COMPB ; Timer0 CompareB Handler
0x002E jmp TIM0_OVF ; Timer0 Overflow Handler
0x0030 jmp SPI_STC ; SPI Transfer Complete Handler
0x0032 jmp USART0_RXC ; USART0 RX Complete Handler
0x0034 jmp USART0_UDRE ; USART0,UDR Empty Handler
0x0036 jmp USART0_TXC ; USART0 TX Complete Handler
0x0038 jmp ANA_COMP ; Analog Comparator Handler
0x003A jmp ADC ; ADC Conversion Complete Handler
0x003C jmp EE_RDY ; EEPROM Ready Handler
0x003E jmp TIM3_CAPT ; Timer3 Capture Handler