13.2 Interrupt Vectors
Interrupt vectors are described in the table below.
Vector No. | Program Address | Source | Interrupt Definition |
---|---|---|---|
1 | 0x000 | RESET | External Pin, Power-on Reset, VLM Reset and Watchdog Reset |
2 | 0x001 | INT0 | External Interrupt Request 0 |
3 | 0x002 | PCINT0 | Pin Change Interrupt Request 0 |
4 | 0x003 | PCINT1 | Pin Change Interrupt Request 1 |
5 | 0x004 | TIM0_CAPT | Timer/Counter0 Capture |
6 | 0x005 | TIM0_OVF | Timer/Counter0 Overflow |
7 | 0x006 | TIM0_COMPA | Timer/Counter0 Compare Match A |
8 | 0x007 | TIM0_COMPB | Timer/Counter0 Compare Match B |
9 | 0x008 | ANA_COMP | Analog Comparator |
10 | 0x009 | WDT | Watchdog Time-out Interrupt |
11 | 0x00A | VLM | VCC Voltage Level Monitor |
12 | 0x00B | ADC | ADC Conversion Complete |
13 | 0x00C | USART0_RXS | USART0 Rx Start |
14 | 0x00D | USART0_RXC | USART0 Rx Complete |
15 | 0x00E | USART0_DRE | USART0 Data Register Empty |
16 | 0x00F | USART0_TXC | USART0 Tx Complete |
In case the program never enables an interrupt source, the Interrupt Vectors will not be used and, consequently, regular program code can be placed at these locations.
The most typical and general program setup for the Reset and Interrupt Vector Addresses in this device is:
Address Labels Code Comments
0x000 rjmp RESET ; Reset Handler
0x001 rjmp INT0 ; IRQ0 Handler
0x002 rjmp PCINT0 ; PCINT0 Handler
0x003 rjmp PCINT1 ; PCINT1 Handler
0x004 rjmp TIM0_CAPT ; Timer/Counter0 Capture Handler
0x005 rjmp TIM0_OVF ; Timer/Counter0 Overflow Handler
0x006 rjmp TIM0_COMPA ; Timer/Counter0 Compare Match A Handler
0x007 rjmp TIM0_COMPB ; Timer/Counter0 Compare Match B Handler
0x008 rjmp ANA_COMP ; Analog Comparator Handler
0x009 rjmp WDT ; Watchdog Timer Handler
0x00A rjmp VLM ; Voltage Level Monitor Handler
0x00B rjmp ADC ; ADC Conversion Handler
0x00C rjmp USART0_RXS ; USART0 Rx Start Handler
0x00D rjmp USART0_RXC ; USART0 Rx Complete Handler
0x00E rjmp USART0_DRE ; USART0 Data Register Empty Handler
0x00F rjmp USART0_TXC ; USART0 Tx Complete Handler
0x010 RESET: ldi r16, high (RAMEND) ; Main program start
0x011 out SPH, r16 ; Set Stack Pointer
0x012 ldi r16, low(RAMEND) ; to top of RAM
0x013 out SPL, r16
0x014 sei ; Enable interrupts
0x015 <instr>
... ...