- •Features
- •Pin Configuration
- •Description
- •Block Diagram
- •Pin Descriptions
- •AVCC
- •Port A (PA7..PA0)
- •Port B (PB7..PB0)
- •XTAL1
- •XTAL2
- •Resources
- •AVR CPU Core
- •Architectural Overview
- •I/O Direct
- •Data Direct
- •Data Indirect with Displacement
- •Data Indirect
- •Memories
- •SRAM Data Memory
- •EEPROM Data Memory
- •EEPROM Read/Write Access
- •I/O Memory
- •Clock Systems and their Distribution
- •Clock Sources
- •Default Clock Source
- •Crystal Oscillator
- •External RC Oscillator
- •External Clock
- •Power-on Reset
- •External Reset
- •Brown-out Detection
- •Watchdog Reset
- •Idle Mode
- •Power-down Mode
- •Standby Mode
- •Analog to Digital Converter
- •Analog Comparator
- •Brown-out Detector
- •Internal Voltage Reference
- •Watchdog Timer
- •Port Pins
- •I/O Ports
- •Introduction
- •Configuring the Pin
- •Reading the Pin Value
- •Unconnected Pins
- •Alternate Port Functions
- •Alternate Functions of Port A
- •Alternate Functions Of Port B
- •Register Description for I/O Ports
- •Interrupts
- •Interrupt Vectors
- •Interrupt Handling
- •Interrupt Response Time
- •External Interrupt
- •Pin Change Interrupt
- •Timer/Counters
- •Timer/Counter0 Prescaler
- •Timer/Counter1 Prescaler
- •8-bit Timer/Counter0
- •8-bit Timer/Counter1
- •Timer/Counter1 in PWM Mode
- •Watchdog Timer
- •Overview
- •Register Descriptions
- •Functional Descriptions
- •Three-wire Mode
- •SPI Slave Operation Example
- •Two-wire Mode
- •Start Condition Detector
- •Alternative USI Usage
- •4-bit Counter
- •12-bit Timer/Counter
- •Software Interrupt
- •Analog Comparator
- •Analog to Digital Converter
- •Features
- •Operation
- •Changing Channel or Reference Selection
- •ADC Conversion Result
- •ADLAR = 0
- •ADLAR = 1
- •Fuse Bits
- •Latching of Fuses
- •Signature Bytes
- •Calibration Byte
- •Page Size
- •Signal Names
- •Parallel Programming
- •Enter Programming Mode
- •Chip Erase
- •Programming the Flash
- •Programming the EEPROM
- •Reading the Flash
- •Reading the EEPROM
- •Programming the Lock Bits
- •Reading the Signature Bytes
- •Reading the Calibration Byte
- •Serial Downloading
- •Data Polling Flash
- •Data Polling EEPROM
- •Electrical Characteristics
- •Absolute Maximum Ratings*
- •DC Characteristics
- •External Clock Drive Waveforms
- •External Clock Drive
- •ADC Characteristics
- •Active Supply Current
- •Idle Supply Current
- •Power-down Supply Current
- •Standby Supply Current
- •Pin Pull-up
- •Internal Oscillator Speed
- •Register Summary
- •Instruction Set Summary
- •Ordering Information
- •Packaging Information
- •Errata
- •ATtiny26 Rev. B/C/D
- •Table of Contents
ATtiny26(L)
Interrupts
Interrupt Vectors
The ATtiny26(L) provides eleven interrupt sources. These interrupts and the separate Reset Vector, each have a separate program vector in the program memory space. All the interrupts are assigned individual enable bits which must be set (one) together with the I-bit in the Status Register in order to enable the interrupt.
The lowest addresses in the program memory space are automatically defined as the Reset and Interrupt vectors. The complete list of vectors is shown in Table 29. The list also determines the priority levels of the different interrupts. The lower the address the higher is the priority level. RESET has the highest priority, and next is INT0 – the External Interrupt Request 0 etc.
Table 29. Reset and Interrupt Vectors
Vector No |
Program Address |
Source |
Interrupt Definition |
|
|
|
|
1 |
$000 |
RESET |
Hardware Pin and Watchdog Reset |
|
|
|
|
2 |
$001 |
INT0 |
External Interrupt Request 0 |
|
|
|
|
3 |
$002 |
I/O Pins |
Pin Change Interrupt |
|
|
|
|
4 |
$003 |
TIMER1, CMPA |
Timer/Counter1 Compare Match 1A |
|
|
|
|
5 |
$004 |
TIMER1, CMPB |
Timer/Counter1 Compare Match 1B |
|
|
|
|
6 |
$005 |
TIMER1, OVF1 |
Timer/Counter1 Overflow |
|
|
|
|
7 |
$006 |
TIMER0, OVF0 |
Timer/Counter0 Overflow |
|
|
|
|
8 |
$007 |
USI_STRT |
USI Start |
|
|
|
|
9 |
$008 |
USI_OVF |
USI Overflow |
|
|
|
|
A |
$009 |
EE_RDY |
EEPROM Ready |
|
|
|
|
B |
$00A |
ANA_COMP |
Analog Comparator |
|
|
|
|
C |
$00B |
ADC |
ADC Conversion Complete |
|
|
|
|
The most typical and general program setup for the Reset and Interrupt Vector
Addresses are:
Address |
Labels |
Code |
|
Comments |
$000 |
|
rjmp |
RESET |
; Reset handler |
$001 |
|
rjmp |
EXT_INT0 |
; IRQ0 handler |
$002 |
|
rjmp |
PIN_CHANGE |
; Pin change handler |
$003 |
|
rjmp |
TIM1_CMP1A |
; Timer1 compare match 1A |
$004 |
|
rjmp |
TIM1_CMP1B |
; Timer1 compare match 1B |
$005 |
|
rjmp |
TIM1_OVF |
; Timer1 overflow handler |
$006 |
|
rjmp |
TIM0_OVF |
; Timer0 overflow handler |
$007 |
|
rjmp |
USI_STRT |
; USI Start handler |
$008 |
|
rjmp |
USI_OVF |
; USI Overflow handler |
$009 |
|
rjmp |
EE_RDY |
; EEPROM Ready handler |
$00A |
|
rjmp |
ANA_COMP |
; Analog Comparator handler |
$00B |
|
rjmp |
ADC |
; ADC Conversion Handler |
; |
|
|
|
|
$009 |
RESET: |
ldi |
r16, RAMEND |
; Main program start |
$00A |
|
out |
SP, r16 |
|
59
1477J–AVR–06/07