
- •Features
- •Pin Configuration
- •Disclaimer
- •Description
- •Pin Descriptions
- •AVCC
- •Port A (PA7..PA0)
- •Port B (PB7..PB0)
- •XTAL1
- •XTAL2
- •SRAM Data Memory
- •I/O Direct
- •Data Direct
- •Data Indirect with Displacement
- •Data Indirect
- •EEPROM Data Memory
- •I/O Memory
- •Status Register – SREG
- •Stack Pointer – SP
- •Reset Sources
- •Power-on Reset
- •External Reset
- •Brown-out Detection
- •Watchdog Reset
- •Clock Systems and their Distribution
- •CPU Clock – clkCPU
- •I/O Clock – clkI/O
- •Flash Clock – clkFLASH
- •ADC Clock – clkADC
- •Internal PLL for Fast Peripheral Clock Generation – clkPCK
- •Clock Sources
- •Crystal Oscillator
- •External RC Oscillator
- •External Clock
- •Interrupt Handling
- •Interrupt Response Time
- •External Interrupt
- •Pin Change Interrupt
- •Idle Mode
- •ADC Noise Reduction Mode
- •Power-down Mode
- •Standby Mode
- •Analog to Digital Converter
- •Analog Comparator
- •Brown-out Detector
- •Internal Voltage Reference
- •Watchdog Timer
- •Port Pins
- •Timer/Counters
- •Timer/Counter0 Prescaler
- •Timer/Counter1 Prescaler
- •8-bit Timer/Counter0
- •Timer/Counter0 – TCNT0
- •8-bit Timer/Counter1
- •Timer/Counter1 – TCNT1
- •Timer/Counter1 in PWM Mode
- •Watchdog Timer
- •Overview
- •Register Descriptions
- •USI Data Register – USIDR
- •USI Status Register – USISR
- •USI Control Register – USICR
- •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
- •ADC Conversion Result
- •ADLAR = 0
- •ADLAR = 1
- •I/O Ports
- •Introduction
- •Configuring the Pin
- •Reading the Pin Value
- •Alternate Port Functions
- •Alternate Functions of Port A
- •Alternate Functions Of Port B
- •Register Description for I/O Ports
- •Port A Data Register – PORTA
- •Port B Data Register – PORTB
- •Fuse Bits
- •Latching of Fuses
- •Signature Bytes
- •Calibration Byte
- •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*
- •External Clock Drive Waveforms
- •External Clock Drive
- •ADC Characteristics – Preliminary Data
- •ATtiny26/L Register Summary
- •Ordering Information(1)
- •Packaging Information
- •Data Sheet Change Log for ATtiny26
- •Changes from Rev. 1477A-03/02 to Rev. 1477B-04/02
- •Table of Contents

In-System
Programmable Flash
Program Memory
SRAM Data Memory
1477B–AVR–04/02
ATtiny26(L)
The ATtiny26/L contains 2K bytes On-chip In-System Programmable Flash memory for program storage. Since all instructions are 16or 32-bit words, the Flash is organized as 1K x 16. The Flash memory has an endurance of at least 1,000 write/erase cycles. The ATtiny26/L Program Counter – PC – is 10 bits wide, thus addressing the 1024 program memory addresses, see “Memory Programming” on page 106 for a detailed description on Flash data downloading. See “Program and Data Addressing Modes” on page 10 for the different program memory addressing modes.
Figure 5. SRAM Organization
Register File |
Data Address Space |
|
R0 |
|
$0000 |
|
|
|
R1 |
|
$0001 |
|
|
|
R2 |
|
$0002 |
|
|
|
... |
|
... |
|
|
|
R29 |
|
$001D |
|
|
|
R30 |
|
$001E |
|
|
|
R31 |
|
$001F |
|
|
|
I/O Registers |
|
|
|
|
|
$00 |
|
$0020 |
|
|
|
$01 |
|
$0021 |
|
|
|
$02 |
|
$0022 |
|
|
|
… |
|
… |
|
|
|
$3D |
|
$005D |
|
|
|
$3E |
|
$005E |
|
|
|
$3F |
|
$005F |
|
|
|
|
|
Internal SRAM |
|
|
|
|
|
$0060 |
|
|
$0061 |
|
|
... |
|
|
$00DE |
|
|
$00DF |
|
|
|
Figure 5 above shows how the ATtiny26/L SRAM Memory is organized.
The lower 224 Data Memory locations address the Register File, the I/O Memory and the internal data SRAM. The first 96 locations address the Register File and I/O Memory, and the next 128 locations address the internal data SRAM.
The five different addressing modes for the data memory cover: Direct, Indirect with Displacement, Indirect, Indirect with Pre-decrement, and Indirect with Post-increment. In the Register File, registers R26 to R31 feature the indirect addressing pointer registers.
The direct addressing reaches the entire data space. The Indirect with Displacement mode features a 63 address locations reach from the base address given by the Y- or Z- register.
When using register indirect addressing modes with automatic pre-decrement and postincrement, the address registers X, Y, and Z are decremented and incremented.
The 32 general purpose working registers, 64 I/O Registers and the 128 bytes of internal data SRAM in the ATtiny26/L are all accessible through all these addressing modes.
See the next section for a detailed description of the different addressing modes.
9

Program and Data
Addressing Modes
Register Direct, Single
Register Rd
The ATtiny26/L AVR Enhanced RISC microcontroller supports powerful and efficient addressing modes for access to the Flash program memory, SRAM, Register File, and I/O Data memory. This section describes the different addressing modes supported by the AVR architecture. In the figures, OP means the operation code part of the instruction word. To simplify, not all figures show the exact location of the addressing bits.
Figure 6. Direct Single Register Addressing
The operand is contained in register d (Rd).
Register Direct, Two Registers Figure 7. Direct Register Addressing, Two Registers
Rd and Rr
Operands are contained in register r (Rr) and d (Rd). The result is stored in register d (Rd).
10 ATtiny26(L)
1477B–AVR–04/02

ATtiny26(L)
I/O Direct |
Figure 8. I/O Direct Addressing |
|||
|
|
|
|
|
|
|
|
|
|
Operand address is contained in 6 bits of the instruction word. n is the destination or source register address.
Data Direct |
Figure 9. Direct Data Addressing |
|
|
|
|
|||
|
|
|
|
|
|
|
Data Space |
|
|
31 |
20 19 |
16 |
|
||||
|
|
|
$0000 |
|||||
|
|
|
OP |
|
Rr/Rd |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 LSBs |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
|
0 |
|
|
|
$00DF
A 16-bit Data Address is contained in the 16 LSBs of a two-word instruction. Rd/Rr specify the destination or source register.
Data Indirect with |
Figure 10. |
Data Indirect with Displacement |
||||
Displacement |
|
|
|
|
Data Space |
|
|
15 |
0 |
|
|
$0000 |
|
|
|
|||||
|
|
|
|
|||
|
|
|
|
|
||
|
|
|
Y OR Z - REGISTER |
|
|
|
|
|
|
|
|
|
|
15 |
10 |
6 |
5 |
0 |
|
|
OP |
n |
|
|
a |
|
|
|
|
|
|
$00DF
11
1477B–AVR–04/02

Data Indirect
Data Indirect with Predecrement
Data Indirect with Postincrement
Operand address is the result of the Y- or Z-register contents added to the address contained in 6 bits of the instruction word.
Figure 11. Data Indirect Addressing
Data Space
$0000
15 |
0 |
X-, Y-, OR Z-REGISTER
$00DF
Operand address is the contents of the X-, Y-, or the Z-register.
Figure 12. Data Indirect Addressing with Pre-decrement
Data Space
$0000
15 |
0 |
X-, Y-, OR Z-REGISTER
-1
$00DF
The X-, Y-, or Z-register is decremented before the operation. Operand address is the decremented contents of the X-, Y-, or Z-register.
Figure 13. Data Indirect Addressing with Post-increment
Data Space
$0000
15 |
0 |
X-, Y-, OR Z-REGISTER
1
$00DF
12 ATtiny26(L)
1477B–AVR–04/02

ATtiny26(L)
The X-, Y-, or Z-register is incremented after the operation. Operand address is the content of the X-, Y-, or Z-register prior to incrementing.
Constant Addressing Using |
Figure 14. Code Memory Constant Addressing |
||||
the LPM Instruction |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PROGRAM MEMORY
$000
$3FF
|
Constant byte address is specified by the Z-register contents. The 15 MSBs select word |
|||||
|
address (0 - 1K), the LSB selects low byte if cleared (LSB = 0) or high byte if set |
|||||
|
(LSB = 1). |
|||||
Indirect Program Addressing, |
Figure 15. Indirect Program Memory Addressing |
|||||
IJMP and ICALL |
|
|
|
|
PROGRAM MEMORY |
|
|
|
|
|
|
|
$000 |
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$3FF
Program execution continues at address contained by the Z-register (i.e., the PC is loaded with the contents of the Z-register).
13
1477B–AVR–04/02