17.2 Interrupt Vectors in ATmega88PB

Table 17-2. Reset and Interrupt Vectors in ATmega88PB
Vector No.Program Address(2)SourceInterrupt Definition
10x000(1)RESETExternal Pin, Power-on Reset, Brown-out Reset and Watchdog System Reset
20x001INT0External Interrupt Request 0
30x002INT1External Interrupt Request 1
40x003PCINT0Pin Change Interrupt Request 0
50x004PCINT1Pin Change Interrupt Request 1
60x005PCINT2Pin Change Interrupt Request 2
70x006WDTWatchdog Time-out Interrupt
80x007TIMER2 COMPATimer/Counter2 Compare Match A
90x008TIMER2 COMPBTimer/Counter2 Compare Match B
100x009TIMER2 OVFTimer/Counter2 Overflow
110x00ATIMER1 CAPTTimer/Counter1 Capture Event
120x00BTIMER1 COMPATimer/Counter1 Compare Match A
130x00CTIMER1 COMPBTimer/Coutner1 Compare Match B
140x00DTIMER1 OVFTimer/Counter1 Overflow
150x00ETIMER0 COMPATimer/Counter0 Compare Match A
160x00FTIMER0 COMPBTimer/Counter0 Compare Match B
170x010TIMER0 OVFTimer/Counter0 Overflow
180x011SPI, STCSPI Serial Transfer Complete
190x012USART, RXUSART Rx Complete
200x013USART, UDREUSART, Data Register Empty
210x014USART, TXUSART, Tx Complete
220x015ADCADC Conversion Complete
230x016EE READYEEPROM Ready
240x017ANALOG COMPAnalog Comparator
250x018TWI2-wire Serial Interface (I2C)
260x019SPM READYStore Program Memory Ready
270x01AUSART, STARTUSART Start Edge Interrupt
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 chapter.
  2. When the IVSEL bit in MCUCR (MCUCR.IVSEL) is set, 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 following table shows reset and Interrupt Vectors placement for the various combinations of BOOTRST and MCUCR.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.

Table 17-3. Reset and Interrupt Vectors Placement in ATmega88PB
BOOTRSTIVSELReset AddressInterrupt Vectors Start Address
100x0000x001
110x000Boot Reset Address + 0x001
00Boot Reset Address0x001
01Boot Reset AddressBoot Reset Address + 0x001
Note: The Boot Reset Address is shown in Table. Boot Size Configuration, ATmega88PB in ATmega88PB Boot Loader Parameters. 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 ATmega88PB is:

AddressLabelsCode Comments
0x000rjmpRESET; Reset Handler
0x001rjmpEXT_INT0; IRQ0 Handler
0x002rjmpEXT_INT1; IRQ1 Handler
0x003rjmpPCINT0; PCINT0 Handler
0x004rjmpPCINT1; PCINT1 Handler
0x005rjmpPCINT2; PCINT2 Handler
0x006rjmpWDT; Watchdog Timer Handler
0x007rjmpTIM2_COMPA; Timer2 Compare A Handler
0X008rjmpTIM2_COMPB; Timer2 Compare B Handler
0x009rjmpTIM2_OVF; Timer2 Overflow Handler
0x00ArjmpTIM1_CAPT; Timer1 Capture Handler
0x00BrjmpTIM1_COMPA; Timer1 Compare A Handler
0x00CrjmpTIM1_COMPB; Timer1 Compare B Handler
0x00DrjmpTIM1_OVF; Timer1 Overflow Handler
0x00ErjmpTIM0_COMPA; Timer0 Compare A Handler
0x00FrjmpTIM0_COMPB; Timer0 Compare B Handler
0x010rjmpTIM0_OVF; Timer0 Overflow Handler
0x011rjmpSPI_STC; SPI Transfer Complete Handler
0x012rjmpUSART_RXC; USART, RX Complete Handler
0x013rjmpUSART_UDRE; USART, UDR Empty Handler
0x014rjmpUSART_TXC; USART, TX Complete Handler
0x015rjmpADC; ADC Conversion Complete Handler
0x016rjmpEE_RDY; EEPROM Ready Handler
0x017rjmpANA_COMP; Analog Comparator Handler
0x018rjmpTWI; 2-wire Serial Interface Handler
0x019rjmpSPM_RDY; Store Program Memory Ready Handler
;
0x01ARESET: ldir16, high(RAMEND); Main program start
0x01Bout SPH,r16; Set Stack Pointer to top of RAM
0x01Cldi r16, low(RAMEND)
0x01Dout SPL,r16
0x01Esei; Enable interrupts
0x01F<instr> xxx

When the BOOTRST Fuse is unprogrammed, the Boot section size set to 2Kbytes and the IVSEL bit in the MCUCR Register (MCUCR.IVSEL) is set before any interrupts are enabled, the most typical and general program setup for the Reset and Interrupt Vector Addresses in ATmega88PB is:

AddressLabelsCode Comments
0x000RESET: ldir16,high(RAMEND); Main program start
0x001outSPH,r16; Set Stack Pointer to top of RAM
0x002ldir16,low(RAMEND)
0x003outSPL,r16
0x004sei; Enable interrupts
0x005<instr>xxx
;
.org0xC01
0xC01rjmpEXT_INT0; IRQ0 Handler
0xC02rjmpEXT_INT1; IRQ1 Handler
.........
;
0xC19rjmpSPM_RDY; Store Program Memory Ready Handler

When the BOOTRST Fuse is programmed and the Boot section size set to 2Kbytes, the most typical and general program setup for the Reset and Interrupt Vector Addresses in ATmega88PB is:

AddressLabelsCode Comments
.org0x001
0x001rjmpEXT_INT0; IRQ0 Handler
0x002rjmpEXT_INT1; IRQ1 Handler
.........
0x019rjmpSPM_RDY; Store Program Memory Ready Handler
;
.org0xC00
0xC00RESET: ldir16,high(RAMEND); Main program start
0xC01outSPH,r16; Set Stack Pointer to top of RAM
0xC02ldir16,low(RAMEND)
0xC03outSPL,r16
0xC04sei; Enable interrupts
0xC05<instr> xxx

When the BOOTRST Fuse is programmed, the Boot section size set to 2Kbytes and the IVSEL bit in the MCUCR Register (MCUCR.IVSEL) is set before any interrupts are enabled, the most typical and general program setup for the Reset and Interrupt Vector Addresses in ATmega88PB is:

AddressLabelsCode Comments
;
.org0xC00
0xC00rjmpRESET; Reset handler
0xC01rjmpEXT_INT0; IRQ0 Handler
0xC02rjmpEXT_INT1; IRQ1 Handler
.........
;
0xC19rjmpSPM_RDY; Store Program Memory Ready Handler
;
0xC1ARESET: ldi r16,high(RAMEND); Main program start
0xC1BoutSPH,r16;; Set Stack Pointer to top of RAM
0xC1Cldir16,low(RAMEND)
0xC1DoutSPL,r16
0xC1Esei; Enable interrupts
0xC1F<instr> xxx