3.3.1 Interrupt Vectors in ATmega328P Automotive

A clarification for the source names of the Interrupt vectors has been made to comply with the header file naming convention.

Table 11-1. Reset and Interrupt Vectors in ATmega328P Automotive

Vector NoProgram Address(2)SourceInterrupts definition
10x0000(1)RESETExternal pin, Power-on Reset, Brown-out Reset and Watchdog System Reset
20x0002INT0External Interrupt Request 0
30x0004INT1External Interrupt Request 1
40x0006PCINT0Pin Change Interrupt Request 0
50x0008PCINT1Pin Change Interrupt Request 1
60x000APCINT2Pin Change Interrupt Request 2
70x000CWDTWatchdog Time-out Interrupt
80x000ETIMER2_COMPATimer/Counter2 Compare Match A
90x0010TIMER2_COMPBTimer/Coutner2 Compare Match B
100x0012TIMER2_OVFTimer/Counter2 Overflow
110x0014TIMER1_CAPTTimer/Counter1 Capture Event
120x0016TIMER1_COMPATimer/Counter1 Compare Match A
130x0018TIMER1_COMPBTimer/Coutner1 Compare Match B
140x001ATIMER1_OVFTimer/Counter1 Overflow
150x001CTIMER0_COMPATimer/Counter0 Compare Match A
160x001ETIMER0_COMPBTimer/Coutner0 Compare Match B
170x0020TIMER0_OVFTimer/Counter0 Overflow
180x0022SPI_STCSPI Serial Transfer Complete
190x0024USART_RXUSART Rx complete
200x0026USART_UDREUSART Data Register Empty
210x0028USART_TXUSART Tx complete
220x002AADCADC Conversion complete
230x002CEE_READYEEPROM Ready
240x002EANALOG_COMPAnalog Comparator
250x0030TWITwo-wire Serial Interface (I2C)
260x0032SPM_READYStore Program Memory Ready
Note:
  1. When the BOOTRST fuse is programmed, the device will jump to the boot loader address at Reset. See “Boot Loader Support – Read-While-Write Self- Programming”.
  2. When setting the IVSEL bit in MCUCR, Interrupt Vectors will be moved to the start of the boot Flash section. The address of each Interrupt Vector will then be the address in this table added to the start address of the boot Flash section.
The most typical and general program setup for the Reset and Interrupt Vector Addresses for ATmega328P Automotive is:
Address   Labels    Code                         Comments
0x0000               jmp      RESET               ; Reset
0x0001               jmp      INT0                ; IRQ0
0x0002               jmp      INT1                ; IRQ1
0x0003               jmp      PCINT0              ; PCINT0
0x0004               jmp      PCINT1              ; PCINT1
0x0005               jmp      PCINT2              ; PCINT2
0x0006               jmp      WDT                 ; Watchdog Timeout
0x0007               jmp      TIMER2_COMPA        ; Timer2 CompareA
0x0008               jmp      TIMER2_COMPB        ; Timer2 CompareB
0x0009               jmp      TIMER2_OVF          ; Timer2 Overflow
0x000A               jmp      TIMER1_CAPT         ; Timer1 Capture
0x000B               jmp      TIMER1_COMPA        ; Timer1 CompareA
0x000C               jmp      TIMER1_COMPB        ; Timer1 CompareB
0x000C               jmp      TIMER1_OVF          ; Timer1 Overflow
0x000E               jmp      TIMER0_COMPA        ; Timer0 CompareA
0x000F               jmp      TIMER0_COMPB        ; Timer0 CompareB
0x0010               jmp      TIMER0_OVF          ; Timer0 Overflow
0x0011               jmp      SPI_STC             ; SPI Transfer Complete
0x0012               jmp      USART_RXC           ; USART RX Complete
0x0013               jmp      USART_UDRE          ; USART UDR Empty
0x0014               jmp      USART_TXC           ; USART TX Complete
0x0015               jmp      ADC                 ; ADC Conversion Complete
0x0016               jmp      EE_READY            ; EEPROM Ready
0x0017               jmp      ANA_COMP            ; Analog Comparator
0x0018               jmp      TWI                 ; 2-wire Serial
0x0019               jmp      SPM_READY           ; SPM Ready
;
0x001A    RESET:     ldi      r16,high(RAMEND)    ; Main program start     
0x001B               out      SPH,r16             ; Set Stack Pointer to top of RAM
0x001C               ldi      r16,low(RAMEND)
0x001D               out      SPL,r16
0x001E               sei                          ; Enable interrupts
0x001F               <instr>  xxx
...       ...        ...                             ...