The USC Andrew and Erna Viterbi School of Engineering USC Ming Hsieh Department of Electrical Engineering University of Southern California

EE 459Lx - Embedded System Design Laboratory

AVR Interrupt Vectors

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 NumberInterrupt 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
10Timer/Counter2 Overflow TIMER2_OVF_vect
11Timer/Counter1 Capture Event TIMER1_CAPT_vect
12Timer/Counter1 Compare Match A TIMER1_COMPA_vect
13Timer/Counter1 Compare Match B TIMER1_COMPB_vect
14Timer/Counter1 Overflow TIMER1_OVF_vect
15Timer/Counter0 Compare Match A TIMER0_COMPA_vect
16Timer/Counter0 Compare Match B TIMER0_COMPB_vect
17Timer/Counter0 Overflow TIMER0_OVF_vect
18SPI Serial Transfer Complete SPI_STC_vect
19USART Rx Complete USART_RX_vect
20USART Data Register Empty USART_UDRE_vect
21USART Tx Complete USART_TX_vect
22ADC Conversion Complete ADC_vect
23EEPROM Ready EE_READY_vect
24Analog Comparator ANALOG_COMP_vect
25Two-wire Serial Interface TWI_vect
26Store Program Memory Read SPM_READY_vect

ATtiny4313

Vector NumberInterrupt 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
10USART Tx Complete USART0_TX_vect
11Analog Comparator ANA_COMP_vect
12Pin Change Interrupt Request 0 PCINT_B_vect
13Timer/Counter1 Compare Match B TIMER1_COMPB_vect
14Timer/Counter0 Compare Match A TIMER0_COMPA_vect
15Timer/Counter0 Compare Match B TIMER0_COMPB_vect
16USI Start Condition USI_START_vect
17USI Overflow USI_OVERFLOW_vect
18EEPROM Ready EEPROM_READY_vect
19Watchdog Timer Overflow WDT_OVERFLOW_vect
20Pin Change Interrupt Request 1 PCINT_A_vect
21Pin Change Interrupt Request 2 PCINT_D_vect

ATtiny85

Vector NumberInterrupt 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
10Timer/Counter0 Compare Match A TIMER0_COMPA_vect
11Timer/Counter0 Compare Match B TIMER0_COMPB_vect
12Watchdog Time-out WDT_vect
13USI Start Condition USI_START_vect
14USI Overflow USI_OVF_vect