ChipFind - Datasheet

Part Number ATTINY22L

Download:  PDF   ZIP

Document Outline

1
Features
·
Utilizes the AVR
®
RISC Architecture
·
AVR - High-performance and Low-power RISC Architecture
­ 118 Powerful Instructions - Most Single Clock Cycle Execution
­ 32 x 8 General Purpose Working Registers
­ Up to 1MIPS Throughput at 1MHz
·
Data and Nonvolatile Program Memory
­ 2K Bytes of In-System Programmable Flash
Endurance 1,000 Write/Erase Cycles
­ 128 Bytes of internal SRAM
­ 128 Bytes of In-System Programmable EEPROM
Endurance: 100,000 Write/Erase Cycles
­ Programming Lock for Flash Program and EEPROM Data Security
·
Peripheral Features
­ One 8-bit Timer/Counter with Separate Prescaler
­ Programmable Watchdog Timer with On-chip Oscillator
­ SPI Serial Interface for In-System Programming
·
Special Microcontroller Features
­ Low-power Idle and Power Down Modes
­ External and Internal Interrupt Sources
­ Power-on Reset Circuit
­ On-chip RC Oscillator
·
Specifications
­ Low-power, High-speed CMOS Process Technology
­ Fully Static Operation
·
Power Consumption at 3V, 25°C
­ Active: 1.5 mA
­ Idle Mode: 100 µA
­ Power Down Mode: <1 µA
·
I/O and Packages
­ 5 Programmable I/O Lines
­ 8-pin PDIP and SOIC
·
Operating Voltages
­ 2.7 - 6.0V
·
Speed Grade
­ Internal Oscillator ~1MHz @ 5.0V
Description
The ATtiny22L is a low-power CMOS 8-bit microcontroller based on the AVR RISC
architecture. By executing powerful instructions in a single clock cycle, the ATtiny22L
achieves throughputs approaching 1 MIPS per MHz allowing the system designer to
optimize power consumption versus processing speed.
The AVR core combines a rich instruction set with 32 general purpose working regis-
ters. All the 32 registers are directly connected to the Arithmetic Logic Unit (ALU),
Rev. 1273BS­02/00
8-bit
Microcontroller
with 2K Bytes of
In-System
Programmable
Flash
ATtiny22L
Preliminary
Pin Configuration
PDIP/SOIC
1
2
3
4
8
7
6
5
RESET
PB3
PB4
GND
VCC
PB2 (SCK/T0)
PB1 (MISO/INT0)
PB0 (MOSI)
Note: This is a summary document. For the complete 56-page
document, please visit our web site at www.atmel.com or e-mail at
literature@atmel.com and request literature #1273B.
2
ATtiny22L
allowing two independent registers to be accessed in one single instruction executed in one clock cycle. The resulting
architecture is more code efficient while achieving throughputs up to ten times faster than conventional CISC
microcontrollers.
Block Diagram
Figure 1. The ATtiny22L Block Diagram
PROGRAM
COUNTER
INTERNAL
OSCILLATOR
WATCHDOG
TIMER
STACK
POINTER
PROGRAM
FLASH
MCU CONTROL
REGISTER
SRAM
GENERAL
PURPOSE
REGISTERS
INSTRUCTION
REGISTER
TIMER/
COUNTER
INSTRUCTION
DECODER
DATA DIR.
REG. PORTB
DATA REGISTER
PORTB
PROGRAMMING
LOGIC
TIMING AND
CONTROL
INTERRUPT
UNIT
EEPROM
SPI
STATUS
REGISTER
Z
Y
X
ALU
PORTB DRIVERS
PB0 - PB4
RESET
VCC
GND
CONTROL
LINES
8-BIT DATA BUS
3
ATtiny22L
The ATtiny22L provides the following features: 2K bytes of In-System Programmable Flash, 128 bytes EEPROM,
128 bytes SRAM, five general purpose I/O lines, 32 general purpose working registers, an 8-bit timer/counter, internal and
external interrupts, programmable Watchdog Timer with internal oscillator, an SPI serial port for Flash Memory download-
ing and two software selectable power saving modes. The Idle Mode stops the CPU while allowing the SRAM,
timer/counters, SPI port and interrupt system to continue functioning. The power down mode saves the register contents
but freezes the oscillator, disabling all other chip functions until the next interrupt or hardware reset.
The device is manufactured using Atmel's high density nonvolatile memory technology. The on-chip Flash allows the
program memory to be reprogrammed in-system through an SPI serial interface. By combining an 8-bit RISC CPU with ISP
Flash on a monolithic chip, the Atmel ATtiny22L is a powerful microcontroller that provides a highly flexible and cost effec-
tive solution to many embedded control applications.
The ATtiny22L AVR is supported with a full suite of program and system development tools including: C compilers, macro
assemblers, program debugger/simulators, in-circuit emulators, and evaluation kits.
Pin Descriptions ATtiny22L
VCC
Supply voltage pin.
GND
Ground pin.
Port B (PB4..PB0)
Port B is a 5-bit bi-directional I/O port with internal pull-up resistors. The Port B output buffers can sink 20 mA. As inputs,
Port B pins that are externally pulled low, will source current if the pull-up resistors are activated.
Port B also serves the functions of various special features.
Port pins can provide internal pull-up resistors (selected for each bit). The port B pins are tri-stated when a reset condition
becomes active.
RESET
Reset input. An external reset is generated by a low level on the RESET pin. Reset pulses longer than 50 ns will generate
a reset, even if the clock is not running. Shorter pulses are not guaranteed to generate a reset.
Clock Source
The ATtiny22L is clocked by an on-chip RC oscillator. This RC oscillator runs at a nominal frequency of 1 MHz (VCC = 5V).
Architectural Overview
The fast-access register file concept contains 32 x 8-bit general purpose working registers with a single clock cycle access
time. This means that during one single clock cycle, one arithmetic logic unit (ALU) operation is executed. Two operands
are output from the register file, the operation is executed, and the result is stored back in the register file in one clock
cycle.
Six of the 32 registers can be used as three 16-bit indirect address register pointers for Data Space addressing enabling
efficient address calculations. One of the three address pointers is also used as the address pointer for the constant table
look up function. These added function registers are the 16-bit X-register, Y-register and Z-register.
4
ATtiny22L
Figure 2. The ATtiny22L AVR RISC Architecture
The ALU supports arithmetic and logic functions between registers or between a constant and a register. Single register
operations are also executed in the ALU. Figure 2 shows the ATtiny22L AVR RISC microcontroller architecture.
In addition to the register operation, the conventional memory addressing modes can be used on the register file as well.
This is enabled by the fact that the register file is assigned the 32 lowermost Data Space addresses ($00 - $1F), allowing
them to be accessed as though they were ordinary memory locations.
The I/O memory space contains 64 addresses for CPU peripheral functions as Control Registers, Timer/Counters,
A/D-converters, and other I/O functions. The I/O memory can be accessed directly, or as the Data Space locations follow-
ing those of the register file, $20 - $5F.
The AVR has Harvard architecture - with separate memories and buses for program and data. The program memory is
accessed with a two stage pipeline. While one instruction is being executed, the next instruction is pre-fetched from the
program memory. This concept enables instructions to be executed in every clock cycle. The program memory is in-system
downloadable Flash memory.
With the relative jump and call instructions, the whole 1K address space is directly accessed. Most AVR instructions have a
single 16-bit word format. Every program memory address contains a 16- or 32-bit instruction.
During interrupts and subroutine calls, the return address program counter (PC) is stored on the stack. The stack is
effectively allocated in the general data SRAM, and consequently the stack size is only limited by the total SRAM size and
the usage of the SRAM. All user programs must initialize the SP in the reset routine (before subroutines or interrupts are
executed). The 8-bit stack pointer SP is read/write accessible in the I/O space.
The 128 bytes data SRAM + register file and I/O registers can be easily accessed through the five different addressing
modes supported in the AVR architecture.
The memory spaces in the AVR architecture are all linear and regular memory maps.
1K x 16
Program
Flash
Instruction
Register
Instruction
Decoder
Program
Counter
Control Lines
32 x 8
General
Purpose
Registers
ALU
Status
and Test
Control
Registers
Interrupt
Unit
SPI
Unit
8-bit
Timer/Counter
Watchdog
Timer
I/O Lines
128 x 8
EEPROM
Data Bus 8-bit
AVR ATtiny22L Architecture
128 x 8
Data
SRAM
Direct Addressing
Indirect Addressing
5
ATtiny22L
Figure 3. Memory Maps
A flexible interrupt module has its control registers in the I/O space with an additional global interrupt enable bit in the status
register. All the different interrupts have a separate interrupt vector in the interrupt vector table at the beginning of the
program memory. The different interrupts have priority in accordance with their interrupt vector position. The lower the
interrupt vector address, the higher the priority.
EEPROM
(128 x 8)
$000
$07F
EEPROM Data Memory