beautypg.com

Interrupts, Interrupt vectors in atmega16, Atmega16(l) – Rainbow Electronics ATmega64L User Manual

Page 42

background image

42

ATmega16(L)

2466B–09/01

Interrupts

This section describes the specifics of the interrupt handling as performed in
ATmega16. For a general explanation of the AVR interrupt handling, refer to “Reset and
Interrupt Handling” on page 11.

Interrupt Vectors in
ATmega16

Notes:

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”
on page 240.

2. When the IVSEL bit in GICR 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.

Table 19 shows reset and interrupt vectors placement for the various combinations of
BOOTRST and 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 loca-
tions. 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 18. Reset and Interrupt Vectors

Vector No.

Program

Address

(2)

Source

Interrupt Definition

1

$000

(1)

RESET

External Pin, Power-on Reset, Brown-out
Reset, Watchdog Reset, and JTAG AVR
Reset

2

$002

INT0

External Interrupt Request 0

3

$004

INT1

External Interrupt Request 1

4

$006

TIMER2 COMP

Timer/Counter2 Compare Match

5

$008

TIMER2 OVF

Timer/Counter2 Overflow

6

$00A

TIMER1 CAPT

Timer/Counter1 Capture Event

7

$00C

TIMER1 COMPA

Timer/Counter1 Compare Match A

8

$00E

TIMER1 COMPB

Timer/Counter1 Compare Match B

9

$010

TIMER1 OVF

Timer/Counter1 Overflow

10

$012

TIMER0 OVF

Timer/Counter0 Overflow

11

$014

SPI, STC

Serial Transfer Complete

12

$016

USART, RXC

USART, Rx Complete

13

$018

USART, UDRE

USART Data Register Empty

14

$01A

USART, TXC

USART, Tx Complete

15

$01C

ADC

ADC Conversion Complete

16

$01E

EE_RDY

EEPROM Ready

17

$020

ANA_COMP

Analog Comparator

18

$022

TWI

2-wire Serial Interface

19

$024

INT2

External Interrupt Request 2

20

$026

TIMER0 COMP

Timer/Counter0 Compare Match

21

$028

SPM_RDY

Store Program Memory Ready