Below are tables of the interrupts available on the AVR microcontrollers used in class.
The vector name is the identifier that should be used at the start of the
the interrupt service routine (ISR). For example, the ISR for the ATmega328P Pin
Change Interrupt Request 0 would look like this.
ISR(PCINT0_vect)
{
// ISR code
}
Note: The names of the vectors are not always the same for the same interrupt
in different processors. Check the table for the correct processor before
writing the ISR.
ATmega328P
Vector Number | Interrupt definition | Vector name |
2 | External Interrupt Request 0 | INT0_vect |
3 | External Interrupt Request 1 | INT1_vect |
4 | Pin Change Interrupt Request 0 | PCINT0_vect |
5 | Pin Change Interrupt Request 1 | PCINT1_vect |
6 | Pin Change Interrupt Request 2 | PCINT2_vect |
7 | Watchdog Time-out Interrupt | WDT_vect |
8 | Timer/Counter2 Compare Match A | TIMER2_COMPA_vect |
9 | Timer/Counter2 Compare Match B | TIMER2_COMPB_vect |
10 | Timer/Counter2 Overflow | TIMER2_OVF_vect |
11 | Timer/Counter1 Capture Event | TIMER1_CAPT_vect |
12 | Timer/Counter1 Compare Match A | TIMER1_COMPA_vect |
13 | Timer/Counter1 Compare Match B | TIMER1_COMPB_vect |
14 | Timer/Counter1 Overflow | TIMER1_OVF_vect |
15 | Timer/Counter0 Compare Match A | TIMER0_COMPA_vect |
16 | Timer/Counter0 Compare Match B | TIMER0_COMPB_vect |
17 | Timer/Counter0 Overflow | TIMER0_OVF_vect |
18 | SPI Serial Transfer Complete | SPI_STC_vect |
19 | USART Rx Complete | USART_RX_vect |
20 | USART Data Register Empty | USART_UDRE_vect |
21 | USART Tx Complete | USART_TX_vect |
22 | ADC Conversion Complete | ADC_vect |
23 | EEPROM Ready | EE_READY_vect |
24 | Analog Comparator | ANALOG_COMP_vect |
25 | Two-wire Serial Interface | TWI_vect |
26 | Store Program Memory Read | SPM_READY_vect |
ATtiny4313
Vector Number | Interrupt definition | Vector name |
2 | External Interrupt Request 0 | INT0_vect |
3 | External Interrupt Request 1 | INT1_vect |
4 | Timer/Counter1 Capture Event | TIMER1_CAPT_vect |
5 | Timer/Counter1 Compare Match A | TIMER1_COMPA_vect |
6 | Timer/Counter1 Overflow | TIMER1_OVF_vect |
7 | Timer/Counter0 Overflow | TIMER0_OVF_vect |
8 | USART Rx Complete | USART0_RX_vect |
9 | USART Data Register Empty | USART0_UDRE_vect |
10 | USART Tx Complete | USART0_TX_vect |
11 | Analog Comparator | ANA_COMP_vect |
12 | Pin Change Interrupt Request 0 | PCINT_B_vect |
13 | Timer/Counter1 Compare Match B | TIMER1_COMPB_vect |
14 | Timer/Counter0 Compare Match A | TIMER0_COMPA_vect |
15 | Timer/Counter0 Compare Match B | TIMER0_COMPB_vect |
16 | USI Start Condition | USI_START_vect |
17 | USI Overflow | USI_OVERFLOW_vect |
18 | EEPROM Ready | EEPROM_READY_vect |
19 | Watchdog Timer Overflow | WDT_OVERFLOW_vect |
20 | Pin Change Interrupt Request 1 | PCINT_A_vect |
21 | Pin Change Interrupt Request 2 | PCINT_D_vect |
ATtiny85
Vector Number | Interrupt definition | Vector name |
1 | External Interrupt Request 0 | INT0_vect |
2 | Pin Change Interrupt Request 0 | PCINT0_vect |
3 | Timer/Counter1 Compare Match A | TIMER1_COMPA_vect |
4 | Timer/Counter1 Overflow | TIMER1_OVF_vect |
5 | Timer/Counter0 Overflow | TIMER0_OVF_vect |
6 | EEPROM Ready | EE_RDY_vect |
7 | Analog Comparator | ANA_COMP_vect |
8 | ADC Conversion Complete | ADC_vect |
9 | Timer/Counter1 Compare Match B | TIMER1_COMPB_vect |
10 | Timer/Counter0 Compare Match A | TIMER0_COMPA_vect |
11 | Timer/Counter0 Compare Match B | TIMER0_COMPB_vect |
12 | Watchdog Time-out | WDT_vect |
13 | USI Start Condition | USI_START_vect |
14 | USI Overflow | USI_OVF_vect |