Features * High Performance, Low Power AVR(R) 8-bit Microcontroller * Advanced RISC Architecture * * * * * * * * - 120 Powerful Instructions - Most Single Clock Cycle Execution - 32 x 8 General Purpose Working Registers - Fully Static Operation High Endurance, Non-volatile Memory Segments - 2K/4K/8K Bytes of In-System, Self-programmable Flash Program Memory * Endurance: 10,000 Write/Erase Cycles - 128/256/512 Bytes of In-System Programmable EEPROM * Endurance: 100,000 Write/Erase Cycles - 128/256/512 Bytes of Internal SRAM - Data Retention: 20 years at 85C / 100 years at 25C - Programming Lock for Self-programming Flash & EEPROM Data Security Peripheral Features - One 8-bit and One 16-bit Timer/Counter with Two PWM Channels, Each - 10-bit ADC * 8 Single-ended Channels * 12 Differential ADC Channel Pairs with Programmable Gain (1x / 20x) - Programmable Watchdog Timer with Separate On-chip Oscillator - On-chip Analog Comparator - Universal Serial Interface Special Microcontroller Features - debugWIRE On-chip Debug System - In-System Programmable via SPI Port - Internal and External Interrupt Sources * Pin Change Interrupt on 12 Pins - Low Power Idle, ADC Noise Reduction, Standby and Power-down Modes - Enhanced Power-on Reset Circuit - Programmable Brown-out Detection Circuit with Software Disable Function - Internal Calibrated Oscillator - On-chip Temperature Sensor I/O and Packages - Available in 20-pin QFN/MLF/VQFN, 14-pin SOIC, 14-pin PDIP and 15-ball UFBGA - Twelve Programmable I/O Lines Operating Voltage: - 1.8 - 5.5V Speed Grade: - 0 - 4 MHz @ 1.8 - 5.5V - 0 - 10 MHz @ 2.7 - 5.5V - 0 - 20 MHz @ 4.5 - 5.5V Industrial Temperature Range: -40C to +85C Low Power Consumption - Active Mode: * 210 A at 1.8V and 1 MHz - Idle Mode: * 33 A at 1.8V and 1 MHz - Power-down Mode: * 0.1 A at 1.8V and 25C 8-bit Microcontroller with 2K/4K/8K Bytes In-System Programmable Flash ATtiny24A * ATtiny44A ATtiny84A * * Preliminary Rev. 8183C-AVR-03/11 1. Pin Configurations Figure 1-1. Pinout of ATtiny24A/44A/84A PDIP/SOIC VCC (PCINT8/XTAL1/CLKI) PB0 (PCINT9/XTAL2) PB1 (PCINT11/RESET/dW) PB3 (PCINT10/INT0/OC0A/CKOUT) PB2 (PCINT7/ICP/OC0B/ADC7) PA7 (PCINT6/OC1A/SDA/MOSI/DI/ADC6) PA6 1 2 3 4 5 6 7 14 13 12 11 10 9 8 GND PA0 (ADC0/AREF/PCINT0) PA1 (ADC1/AIN0/PCINT1) PA2 (ADC2/AIN1/PCINT2) PA3 (ADC3/T0/PCINT3) PA4 (ADC4/USCK/SCL/T1/PCINT4) PA5 (ADC5/DO/MISO/OC1B/PCINT5) NOTE Bottom pad should be soldered to ground. DNC: Do Not Connect Table 1-1. 6 7 8 9 10 15 14 13 12 11 PA7 (PCINT7/ICP/OC0B/ADC7) PB2 (PCINT10/INT0/OC0A/CKOUT) PB3 (PCINT11/RESET/dW) PB1 (PCINT9/XTAL2) PB0 (PCINT8/XTAL1/CLKI) UFBGA - Pinout ATtiny24A/44A/84A (top view) 1 A 2 1 2 3 4 5 Pin 16: PA6 (PCINT6/OC1A/SDA/MOSI/DI/ADC6) Pin 20: PA5 (ADC5/DO/MISO/OC1B/PCINT5) DNC DNC GND VCC DNC (ADC4/USCK/SCL/T1/PCINT4) PA4 (ADC3/T0/PCINT3) PA3 (ADC2/AIN1/PCINT2) PA2 (ADC1/AIN0/PCINT1) PA1 (ADC0/AREF/PCINT0) PA0 20 19 18 17 16 PA5 DNC DNC DNC PA6 QFN/MLF/VQFN 2 3 4 PA5 PA6 PB2 B PA4 PA7 PB1 PB3 C PA3 PA2 PA1 PB0 D PA0 GND GND VCC ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A 1.1 1.1.1 Pin Descriptions VCC Supply voltage. 1.1.2 GND Ground. 1.1.3 Port B (PB3:PB0) Port B is a 4-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port B output buffers have symmetrical drive characteristics with both high sink and source capability except PB3 which has the RESET capability. To use pin PB3 as an I/O pin, instead of RESET pin, program (`0') RSTDISBL fuse. As inputs, Port B pins that are externally pulled low will source current if the pull-up resistors are activated. The Port B pins are tri-stated when a reset condition becomes active, even if the clock is not running. Port B also serves the functions of various special features of the ATtiny24A/44A/84A as listed in Section 10.2 "Alternate Port Functions" on page 58. 1.1.4 RESET Reset input. A low level on this pin for longer than the minimum pulse length will generate a reset, even if the clock is not running and provided the reset pin has not been disabled. The minimum pulse length is given in Table 20-4 on page 176. Shorter pulses are not guaranteed to generate a reset. The reset pin can also be used as a (weak) I/O pin. 1.1.5 Port A (PA7:PA0) Port A is a 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port A output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port A pins that are externally pulled low will source current if the pull-up resistors are activated. The Port A pins are tri-stated when a reset condition becomes active, even if the clock is not running. Port A has alternate functions as analog inputs for the ADC, analog comparator, timer/counter, SPI and pin change interrupt as described in "Alternate Port Functions" on page 58. 3 8183C-AVR-03/11 2. Overview ATtiny24A/44A/84A are low-power CMOS 8-bit microcontrollers based on the AVR enhanced RISC architecture. By executing powerful instructions in a single clock cycle, the ATtiny24A/44A/84A achieves throughputs approaching 1 MIPS per MHz allowing the system designer to optimize power consumption versus processing speed. Figure 2-1. Block Diagram VCC 8-BIT DATABUS INTERNAL OSCILLATOR INTERNAL CALIBRATED OSCILLATOR TIMING AND CONTROL GND PROGRAM COUNTER STACK POINTER WATCHDOG TIMER PROGRAM FLASH SRAM MCU CONTROL REGISTER INSTRUCTION REGISTER MCU STATUS REGISTER GENERAL PURPOSE REGISTERS TIMER/ COUNTER0 X Y Z INSTRUCTION DECODER TIMER/ COUNTER1 CONTROL LINES ALU STATUS REGISTER INTERRUPT UNIT ANALOG COMPARATOR + _ PROGRAMMING LOGIC EEPROM ISP INTERFACE DATA REGISTER PORT A DATA DIR. REG.PORT A ADC OSCILLATORS DATA REGISTER PORT B DATA DIR. REG.PORT B PORT A DRIVERS PORT B DRIVERS PA[7:0] PB[3:0] The AVR core combines a rich instruction set with 32 general purpose working registers. All 32 registers are directly connected to the Arithmetic Logic Unit (ALU), 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. 4 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A The ATtiny24A/44A/84A provides the following features: 2K/4K/8K byte of In-System Programmable Flash, 128/256/512 bytes EEPROM, 128/256/512 bytes SRAM, 12 general purpose I/O lines, 32 general purpose working registers, an 8-bit Timer/Counter with two PWM channels, a 16-bit timer/counter with two PWM channels, Internal and External Interrupts, a 8-channel 10-bit ADC, programmable gain stage (1x, 20x) for 12 differential ADC channel pairs, a programmable Watchdog Timer with internal oscillator, internal calibrated oscillator, and four software selectable power saving modes. Idle mode stops the CPU while allowing the SRAM, Timer/Counter, ADC, Analog Comparator, and Interrupt system to continue functioning. ADC Noise Reduction mode minimizes switching noise during ADC conversions by stopping the CPU and all I/O modules except the ADC. In Power-down mode registers keep their contents and all chip functions are disbaled until the next interrupt or hardware reset. In Standby mode, the crystal/resonator oscillator is running while the rest of the device is sleeping, allowing very fast start-up combined with low power consumption. The device is manufactured using Atmel's high density non-volatile memory technology. The onchip ISP Flash allows the Program memory to be re-programmed in-system through an SPI serial interface, by a conventional non-volatile memory programmer or by an on-chip boot code running on the AVR core. The ATtiny24A/44A/84A AVR is supported with a full suite of program and system development tools including: C Compilers, Macro Assemblers, Program Debugger/Simulators and Evaluation kits. 5 8183C-AVR-03/11 3. General Information 3.1 Resources A comprehensive set of drivers, application notes, data sheets and descriptions on development tools are available for download at http://www.atmel.com/avr. 3.2 Code Examples This documentation contains simple code examples that briefly show how to use various parts of the device. These code examples assume that the part specific header file is included before compilation. Be aware that not all C compiler vendors include bit definitions in the header files and interrupt handling in C is compiler dependent. Please confirm with the C compiler documentation for more details. For I/O Registers located in the extended I/O map, "IN", "OUT", "SBIS", "SBIC", "CBI", and "SBI" instructions must be replaced with instructions that allow access to extended I/O. Typically, this means "LDS" and "STS" combined with "SBRS", "SBRC", "SBR", and "CBR". Note that not all AVR devices include an extended I/O map. 3.3 Capacitive Touch Sensing Atmel QTouch Library provides a simple to use solution for touch sensitive interfaces on Atmel AVR microcontrollers. The QTouch Library includes support for QTouch(R) and QMatrix(R) acquisition methods. Touch sensing is easily added to any application by linking the QTouch Library and using the Application Programming Interface (API) of the library to define the touch channels and sensors. The application then calls the API to retrieve channel information and determine the state of the touch sensor. The QTouch Library is free and can be downloaded from the Atmel website. For more information and details of implementation, refer to the QTouch Library User Guide - also available from the Atmel website. 3.4 Data Retention Reliability Qualification results show that the projected data retention failure rate is much less than 1 PPM over 20 years at 85C or 100 years at 25C. 3.5 Disclaimer Typical values contained in this datasheet are based on simulations and characterization of other AVR microcontrollers manufactured on the same process technology. Min and Max values will be available after the device has been characterized. 6 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A 4. CPU Core This section discusses the AVR core architecture in general. The main function of the CPU core is to ensure correct program execution. The CPU must therefore be able to access memories, perform calculations, control peripherals, and handle interrupts. 4.1 Architectural Overview Figure 4-1. Block Diagram of the AVR Architecture Data Bus 8-bit Flash Program Memory Program Counter Status and Control 32 x 8 General Purpose Registrers Control Lines Direct Addressing Instruction Decoder Indirect Addressing Instruction Register Interrupt Unit Watchdog Timer ADC ALU Analog Comparator Timer/Counter 0 Data SRAM Timer/Counter 1 Universal Serial Interface EEPROM I/O Lines In order to maximize performance and parallelism, the AVR uses a Harvard architecture - with separate memories and buses for program and data. Instructions in the Program memory are executed with a single level pipelining. 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 Reprogrammable Flash memory. 7 8183C-AVR-03/11 The fast-access Register File contains 32 x 8-bit general purpose working registers with a single clock cycle access time. This allows single-cycle Arithmetic Logic Unit (ALU) operation. In a typical ALU operation, 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 these address pointers can also be used as an address pointer for look up tables in Flash Program memory. These added function registers are the 16-bit X-, Y-, and Z-register, described later in this section. The ALU supports arithmetic and logic operations between registers or between a constant and a register. Single register operations can also be executed in the ALU. After an arithmetic operation, the Status Register is updated to reflect information about the result of the operation. Program flow is provided by conditional and unconditional jump and call instructions, capable of directly addressing the whole address space. Most AVR instructions have a single 16-bit word format but 32-bit wide instructions also exist. The actual instruction set varies, as some devices only implement a part of the instruction set. 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 Stack Pointer (SP) is read/write accessible in the I/O space. The data SRAM can easily be 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. 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 interrupts have a separate Interrupt Vector in the Interrupt Vector table. The interrupts have priority in accordance with their Interrupt Vector position. The lower the Interrupt Vector address, the higher the priority. The I/O memory space contains 64 addresses for CPU peripheral functions as Control Registers, SPI, and other I/O functions. The I/O memory can be accessed directly, or as the Data Space locations following those of the Register File, 0x20 - 0x5F. 4.2 ALU - Arithmetic Logic Unit The high-performance AVR ALU operates in direct connection with all the 32 general purpose working registers. Within a single clock cycle, arithmetic operations between general purpose registers or between a register and an immediate are executed. The ALU operations are divided into three main categories - arithmetic, logical, and bit-functions. Some implementations of the architecture also provide a powerful multiplier supporting both signed/unsigned multiplication and fractional format. See the "Instruction Set" section for a detailed description. 4.3 Status Register The Status Register contains information about the result of the most recently executed arithmetic instruction. This information can be used for altering program flow in order to perform conditional operations. Note that the Status Register is updated after all ALU operations, as specified in the Instruction Set Reference. This will in many cases remove the need for using the dedicated compare instructions, resulting in faster and more compact code. 8 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A The Status Register is neither automatically stored when entering an interrupt routine, nor restored when returning from an interrupt. This must be handled by software. 4.4 General Purpose Register File The Register File is optimized for the AVR Enhanced RISC instruction set. In order to achieve the required performance and flexibility, the following input/output schemes are supported by the Register File: * One 8-bit output operand and one 8-bit result input * Two 8-bit output operands and one 8-bit result input * Two 8-bit output operands and one 16-bit result input * One 16-bit output operand and one 16-bit result input Figure 4-2 below shows the structure of the 32 general purpose working registers in the CPU. Figure 4-2. AVR CPU General Purpose Working Registers 7 0 Addr. R0 0x00 R1 0x01 R2 0x02 ... R13 0x0D General R14 0x0E Purpose R15 0x0F Working R16 0x10 Registers R17 0x11 ... R26 0x1A X-register Low Byte R27 0x1B X-register High Byte R28 0x1C Y-register Low Byte R29 0x1D Y-register High Byte R30 0x1E Z-register Low Byte R31 0x1F Z-register High Byte Most of the instructions operating on the Register File have direct access to all registers, and most of them are single cycle instructions. As shown in Figure 4-2, each register is also assigned a Data memory address, mapping them directly into the first 32 locations of the user Data Space. Although not being physically implemented as SRAM locations, this memory organization provides great flexibility in access of the registers, as the X-, Y- and Z-pointer registers can be set to index any register in the file. 4.4.1 The X-register, Y-register, and Z-register The registers R26..R31 have some added functions to their general purpose usage. These registers are 16-bit address pointers for indirect addressing of the data space. The three indirect address registers X, Y, and Z are defined as described in Figure 4-3 below. Figure 4-3. The X-, Y-, and Z-registers 15 XH XL 0 9 8183C-AVR-03/11 X-register 7 0 R27 (0x1B) 15 Y-register YH 7 YL 0 0 7 0 R28 (0x1C) 15 ZH 7 0 R31 (0x1F) 0 R26 (0x1A) R29 (0x1D) Z-register 7 ZL 7 0 0 R30 (0x1E) In the different addressing modes these address registers have functions as fixed displacement, automatic increment, and automatic decrement (see the instruction set reference for details). 4.5 Stack Pointer The Stack is mainly used for storing temporary data, for storing local variables and for storing return addresses after interrupts and subroutine calls. The Stack Pointer Register always points to the top of the Stack. Note that the Stack is implemented as growing from higher memory locations to lower memory locations. This implies that a Stack PUSH command decreases the Stack Pointer. The Stack Pointer points to the data SRAM Stack area where the Subroutine and Interrupt Stacks are located. This Stack space in the data SRAM must be defined by the program before any subroutine calls are executed or interrupts are enabled. The Stack Pointer must be set to point above 0x60. The Stack Pointer is decremented by one when data is pushed onto the Stack with the PUSH instruction, and it is decremented by two when the return address is pushed onto the Stack with subroutine call or interrupt. The Stack Pointer is incremented by one when data is popped from the Stack with the POP instruction, and it is incremented by two when data is popped from the Stack with return from subroutine RET or return from interrupt RETI. The AVR Stack Pointer is implemented as two 8-bit registers in the I/O space. The number of bits actually used is implementation dependent. Note that the data space in some implementations of the AVR architecture is so small that only SPL is needed. In this case, the SPH Register will not be present. 4.6 Instruction Execution Timing This section describes the general access timing concepts for instruction execution. The AVR CPU is driven by the CPU clock clkCPU, directly generated from the selected clock source for the chip. No internal clock division is used. Figure 4-4 shows the parallel instruction fetches and instruction executions enabled by the Harvard architecture and the fast access Register File concept. This is the basic pipelining concept to obtain up to 1 MIPS per MHz with the corresponding unique results for functions per cost, functions per clocks, and functions per power-unit. 10 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 4-4. The Parallel Instruction Fetches and Instruction Executions T1 T2 T3 T4 clkCPU 1st Instruction Fetch 1st Instruction Execute 2nd Instruction Fetch 2nd Instruction Execute 3rd Instruction Fetch 3rd Instruction Execute 4th Instruction Fetch Figure 4-5 shows the internal timing concept for the Register File. In a single clock cycle an ALU operation using two register operands is executed, and the result is stored back to the destination register. Figure 4-5. Single Cycle ALU Operation T1 T2 T3 T4 clkCPU Total Execution Time Register Operands Fetch ALU Operation Execute Result Write Back 4.7 Reset and Interrupt Handling The AVR provides several different interrupt sources. These interrupts and the separate Reset Vector each have a separate Program Vector in the Program memory space. All interrupts are assigned individual enable bits which must be written logic one together with the Global Interrupt Enable bit in the Status Register in order to enable the interrupt. The lowest addresses in the Program memory space are by default defined as the Reset and Interrupt Vectors. The complete list of vectors is shown in "Interrupts" on page 47. 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. When an interrupt occurs, the Global Interrupt Enable I-bit is cleared and all interrupts are disabled. The user software can write logic one to the I-bit to enable nested interrupts. All enabled interrupts can then interrupt the current interrupt routine. The I-bit is automatically set when a Return from Interrupt instruction - RETI - is executed. There are basically two types of interrupts. The first type is triggered by an event that sets the Interrupt Flag. For these interrupts, the Program Counter is vectored to the actual Interrupt Vector in order to execute the interrupt handling routine, and hardware clears the corresponding Interrupt Flag. Interrupt Flags can also be cleared by writing a logic one to the flag bit position(s) 11 8183C-AVR-03/11 to be cleared. If an interrupt condition occurs while the corresponding interrupt enable bit is cleared, the Interrupt Flag will be set and remembered until the interrupt is enabled, or the flag is cleared by software. Similarly, if one or more interrupt conditions occur while the Global Interrupt Enable bit is cleared, the corresponding Interrupt Flag(s) will be set and remembered until the Global Interrupt Enable bit is set, and will then be executed by order of priority. The second type of interrupts will trigger as long as the interrupt condition is present. These interrupts do not necessarily have Interrupt Flags. If the interrupt condition disappears before the interrupt is enabled, the interrupt will not be triggered. When the AVR exits from an interrupt, it will always return to the main program and execute one more instruction before any pending interrupt is served. Note that the Status Register is not automatically stored when entering an interrupt routine, nor restored when returning from an interrupt routine. This must be handled by software. When using the CLI instruction to disable interrupts, the interrupts will be immediately disabled. No interrupt will be executed after the CLI instruction, even if it occurs simultaneously with the CLI instruction. The following example shows how this can be used to avoid interrupts during the timed EEPROM write sequence. Assembly Code Example in r16, SREG cli ; store SREG value ; disable interrupts during timed sequence sbi EECR, EEMPE ; start EEPROM write sbi EECR, EEPE out SREG, r16 ; restore SREG value (I-bit) C Code Example char cSREG; cSREG = SREG; /* store SREG value */ /* disable interrupts during timed sequence */ _CLI(); EECR |= (1< ... ... ; Set Stack Pointer to top of RAM ; Enable interrupts External Interrupts External Interrupts are triggered by the INT0 pin or any of the PCINT[11:0] pins. Observe that, if enabled, the interrupts will trigger even if the INT0 or PCINT[11:0] pins are configured as outputs. This feature provides a way of generating a software interrupt. Pin change 0 interrupts PCI0 will trigger if any enabled PCINT[7:0] pin toggles. Pin change 1 interrupts PCI1 will trigger if any enabled PCINT[11:8] pin toggles. The PCMSK0 and PCMSK1 Registers control which pins contribute to the pin change interrupts. Pin change interrupts on PCINT[11:0] are detected asynchronously, which means that these interrupts can be used for waking the part also from sleep modes other than Idle mode. The INT0 interrupt can be triggered by a falling or rising edge or a low level. This is set up as shown in "MCUCR - MCU Control Register" on page 50. When the INT0 interrupt is enabled and configured as level triggered, the interrupt will trigger as long as the pin is held low. Note that recognition of falling or rising edge interrupts on INT0 requires the presence of an I/O clock, as described in "Clock Sources" on page 25. 9.2.1 48 Low Level Interrupt A low level interrupt on INT0 is detected asynchronously. This means that the interrupt source can be used for waking the part also from sleep modes other than Idle (the I/O clock is halted in all sleep modes except Idle). ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Note that if a level triggered interrupt is used for wake-up from Power-down, the required level must be held long enough for the MCU to complete the wake-up to trigger the level interrupt. If the level disappears before the end of the Start-up Time, the MCU will still wake up, but no interrupt will be generated. The start-up time is defined by the SUT and CKSEL fuses, as described in "Clock System" on page 24. If the low level on the interrupt pin is removed before the device has woken up then program execution will not be diverted to the interrupt service routine but continue from the instruction following the SLEEP command. 9.2.2 Pin Change Interrupt Timing A timing example of a pin change interrupt is shown in Figure 9-1. Figure 9-1. Timing of pin change interrupts pin_lat PCINT(0) LE clk D pcint_in_(0) Q pin_sync PCINT(0) in PCMSK(x) 0 pcint_syn pcint_setflag PCIF x clk clk PCINT(0) pin_lat pin_sync pcint_in_(0) pcint_syn pcint_setflag PCIF 49 8183C-AVR-03/11 9.3 9.3.1 Register Description MCUCR - MCU Control Register The External Interrupt Control Register A contains control bits for interrupt sense control. Bit 7 6 5 4 3 2 1 0 0x35 (0x55) BODS PUD SE SM1 SM0 BODSE ISC01 ISC00 Read/Write R/W R/W R/W R/W R/W R/W R/W R/W Initial Value 0 0 0 0 0 0 0 0 MCUCR * Bits 1:0 - ISC0[1:0]: Interrupt Sense Control 0 Bit 1 and Bit 0 The External Interrupt 0 is activated by the external pin INT0 if the SREG I-flag and the corresponding interrupt mask are set. The level and edges on the external INT0 pin that activate the interrupt are defined in Table 9-2. The value on the INT0 pin is sampled before detecting edges. If edge or toggle interrupt is selected, pulses that last longer than one clock period will generate an interrupt. Shorter pulses are not guaranteed to generate an interrupt. If low level interrupt is selected, the low level must be held until the completion of the currently executing instruction to generate an interrupt. Table 9-2. 9.3.2 Interrupt 0 Sense Control ISC01 ISC00 Description 0 0 The low level of INT0 generates an interrupt request. 0 1 Any logical change on INT0 generates an interrupt request. 1 0 The falling edge of INT0 generates an interrupt request. 1 1 The rising edge of INT0 generates an interrupt request. GIMSK - General Interrupt Mask Register Bit 7 6 5 4 3 2 1 0x3B (0x5B) - INT0 PCIE1 PCIE0 - - - 0 - Read/Write R R/W R/W R/W1 R R R R Initial Value 0 0 0 0 0 0 0 0 GIMSK * Bits 7, 3:0 - Res: Reserved Bits These bits are reserved in the ATtiny24A/44A and will always read as zero. * Bit 6 - INT0: External Interrupt Request 0 Enable When the INT0 bit is set (one) and the I-bit in the Status Register (SREG) is set (one), the external pin interrupt is enabled. The Interrupt Sense Control bits (ISC01 and ISC00) in the External Interrupt Control Register A (EICRA) define whether the external interrupt is activated on rising and/or falling edge of the INT0 pin or level sensed. Activity on the pin will cause an interrupt request even if INT0 is configured as an output. The corresponding interrupt of External Interrupt Request 0 is executed from the INT0 Interrupt Vector. * Bit 5 - PCIE1: Pin Change Interrupt Enable 1 When the PCIE1 bit is set (one) and the I-bit in the Status Register (SREG) is set (one), pin change interrupt 1 is enabled. Any change on any enabled PCINT[11:8] pin will cause an interrupt. The corresponding interrupt of Pin Change Interrupt Request is executed from the PCI1 Interrupt Vector. PCINT[11:8] pins are enabled individually by the PCMSK1 Register. 50 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A * Bit 4 - PCIE0: Pin Change Interrupt Enable 0 When the PCIE0 bit is set (one) and the I-bit in the Status Register (SREG) is set (one), pin change interrupt 0 is enabled. Any change on any enabled PCINT[7:0] pin will cause an interrupt. The corresponding interrupt of Pin Change Interrupt Request is executed from the PCI0 Interrupt Vector. PCINT[7:0] pins are enabled individually by the PCMSK0 Register. 9.3.3 GIFR - General Interrupt Flag Register Bit 7 6 5 4 3 2 1 0x3A (0x5A) - INTF0 PCIF1 PCIF0 - - - 0 - Read/Write R R/W R/W R/W R R R R Initial Value 0 0 0 0 0 0 0 0 GIFR * Bits 7, 3:0 - Res: Reserved Bits These bits are reserved in the ATtiny24A/44A and will always read as zero. * Bit 6 - INTF0: External Interrupt Flag 0 When an edge or logic change on the INT0 pin triggers an interrupt request, INTF0 becomes set (one). If the I-bit in SREG and the INT0 bit in GIMSK are set (one), the MCU will jump to the corresponding Interrupt Vector. The flag is cleared when the interrupt routine is executed. Alternatively, the flag can be cleared by writing a logical one to it. This flag is always cleared when INT0 is configured as a level interrupt. * Bit 5 - PCIF1: Pin Change Interrupt Flag 1 When a logic change on any PCINT[11:8] pin triggers an interrupt request, PCIF1 becomes set (one). If the I-bit in SREG and the PCIE1 bit in GIMSK are set (one), the MCU will jump to the corresponding Interrupt Vector. The flag is cleared when the interrupt routine is executed. Alternatively, the flag can be cleared by writing a logical one to it. * Bit 4 - PCIF0: Pin Change Interrupt Flag 0 When a logic change on any PCINT[7:0] pin triggers an interrupt request, PCIF becomes set (one). If the I-bit in SREG and the PCIE0 bit in GIMSK are set (one), the MCU will jump to the corresponding Interrupt Vector. The flag is cleared when the interrupt routine is executed. Alternatively, the flag can be cleared by writing a logical one to it. 9.3.4 PCMSK1 - Pin Change Mask Register 1 Bit 7 6 5 4 3 2 1 0 0x20 (0x40) - - - - PCINT11 PCINT10 PCINT9 PCINT8 Read/Write R R R R R/W R/W R/W R/W Initial Value 0 0 0 0 0 0 0 0 PCMSK1 * Bits 7:4 - Res: Reserved Bits These bits are reserved in the ATtiny24A/44A and will always read as zero. * Bits 3:0 - PCINT[11:8]: Pin Change Enable Mask 11:8 Each PCINT[11:8] bit selects whether pin change interrupt is enabled on the corresponding I/O pin. If PCINT[11:8] is set and the PCIE1 bit in GIMSK is set, pin change interrupt is enabled on the corresponding I/O pin. If PCINT[11:8] is cleared, pin change interrupt on the corresponding I/O pin is disabled. 51 8183C-AVR-03/11 9.3.5 PCMSK0 - Pin Change Mask Register 0 Bit 7 6 5 4 3 2 1 0 0x12 (0x32) PCINT7 PCINT6 PCINT5 PCINT4 PCINT3 PCINT2 PCINT1 PCINT0 Read/Write R/W R/W R/W R/W R/W R/W R/W R/W Initial Value 0 0 0 0 0 0 0 0 PCMSK0 * Bits 7:0 - PCINT[7:0]: Pin Change Enable Mask 7:0 Each PCINT[7:0] bit selects whether pin change interrupt is enabled on the corresponding I/O pin. If PCINT[7:0] is set and the PCIE0 bit in GIMSK is set, pin change interrupt is enabled on the corresponding I/O pin. If PCINT[7:0] is cleared, pin change interrupt on the corresponding I/O pin is disabled. 52 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A 10. I/O Ports All AVR ports have true Read-Modify-Write functionality when used as general digital I/O ports. This means that the direction of one port pin can be changed without unintentionally changing the direction of any other pin with the SBI and CBI instructions. The same applies when changing drive value (if configured as output) or enabling/disabling of pull-up resistors (if configured as input). Each output buffer has symmetrical drive characteristics with both high sink and source capability. The pin driver is strong enough to drive LED displays directly. All port pins have individually selectable pull-up resistors with a supply-voltage invariant resistance. All I/O pins have protection diodes to both VCC and Ground as indicated in Figure 10-1 on page 53. See "Electrical Characteristics" on page 173 for a complete list of parameters. Figure 10-1. I/O Pin Equivalent Schematic Rpu Logic Pxn Cpin See Figure "General Digital I/O" for Details All registers and bit references in this section are written in general form. A lower case "x" represents the numbering letter for the port, and a lower case "n" represents the bit number. However, when using the register or bit defines in a program, the precise form must be used. For example, PORTB3 for bit no. 3 in Port B, here documented generally as PORTxn. The physical I/O Registers and bit locations are listed in "Register Description" on page 66. Three I/O memory address locations are allocated for each port, one each for the Data Register - PORTx, Data Direction Register - DDRx, and the Port Input Pins - PINx. The Port Input Pins I/O location is read only, while the Data Register and the Data Direction Register are read/write. However, writing a logic one to a bit in the PINx Register, will result in a toggle in the corresponding bit in the Data Register. In addition, the Pull-up Disable - PUD bit in MCUCR disables the pull-up function for all pins in all ports when set. Using the I/O port as General Digital I/O is described in "Ports as General Digital I/O" on page 54. Most port pins are multiplexed with alternate functions for the peripheral features on the device. How each alternate function interferes with the port pin is described in "Alternate Port Functions" on page 58. Refer to the individual module sections for a full description of the alternate functions. Note that enabling the alternate function of some of the port pins does not affect the use of the other pins in the port as general digital I/O. 53 8183C-AVR-03/11 10.1 Ports as General Digital I/O The ports are bi-directional I/O ports with optional internal pull-ups. Figure 10-2 shows a functional description of one I/O-port pin, here generically called Pxn. Figure 10-2. General Digital I/O(1) PUD Q D DDxn Q CLR WDx RESET DATA BUS RDx 1 Q Pxn D 0 PORTxn Q CLR RESET WRx WPx RRx SLEEP SYNCHRONIZER D Q L Q D RPx Q PINxn Q clk I/O PUD: SLEEP: clkI/O: Note: 10.1.1 PULLUP DISABLE SLEEP CONTROL I/O CLOCK WDx: RDx: WRx: RRx: RPx: WPx: WRITE DDRx READ DDRx WRITE PORTx READ PORTx REGISTER READ PORTx PIN WRITE PINx REGISTER 1. WRx, WPx, WDx, RRx, RPx, and RDx are common to all pins within the same port. clkI/O, SLEEP, and PUD are common to all ports. Configuring the Pin Each port pin consists of three register bits: DDxn, PORTxn, and PINxn. As shown in "Register Description" on page 66, the DDxn bits are accessed at the DDRx I/O address, the PORTxn bits at the PORTx I/O address, and the PINxn bits at the PINx I/O address. The DDxn bit in the DDRx Register selects the direction of this pin. If DDxn is written logic one, Pxn is configured as an output pin. If DDxn is written logic zero, Pxn is configured as an input pin. If PORTxn is written logic one when the pin is configured as an input pin, the pull-up resistor is activated. To switch the pull-up resistor off, PORTxn has to be written logic zero or the pin has to be configured as an output pin. The port pins are tri-stated when reset condition becomes active, even if no clocks are running. If PORTxn is written logic one when the pin is configured as an output pin, the port pin is driven high (one). If PORTxn is written logic zero when the pin is configured as an output pin, the port pin is driven low (zero). 54 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A 10.1.2 Toggling the Pin Writing a logic one to PINxn toggles the value of PORTxn, independent on the value of DDRxn. Note that the SBI instruction can be used to toggle one single bit in a port. 10.1.3 Switching Between Input and Output When switching between tri-state ({DDxn, PORTxn} = 0b00) and output high ({DDxn, PORTxn} = 0b11), an intermediate state with either pull-up enabled {DDxn, PORTxn} = 0b01) or output low ({DDxn, PORTxn} = 0b10) must occur. Normally, the pull-up enabled state is fully acceptable, as a high-impedant environment will not notice the difference between a strong high driver and a pull-up. If this is not the case, the PUD bit in the MCUCR Register can be set to disable all pull-ups in all ports. Switching between input with pull-up and output low generates the same problem. The user must use either the tri-state ({DDxn, PORTxn} = 0b00) or the output high state ({DDxn, PORTxn} = 0b10) as an intermediate step. Table 10-1 summarizes the control signals for the pin value. Table 10-1. 10.1.4 Port Pin Configurations DDxn PORTxn PUD (in MCUCR) I/O Pull-up 0 0 X Input No Tri-state (Hi-Z) 0 1 0 Input Yes Pxn will source current if ext. pulled low 0 1 1 Input No Tri-state (Hi-Z) 1 0 X Output No Output Low (Sink) 1 1 X Output No Output High (Source) Comment Reading the Pin Value Independent of the setting of Data Direction bit DDxn, the port pin can be read through the PINxn Register bit. As shown in Figure 10-2 on page 54, the PINxn Register bit and the preceding latch constitute a synchronizer. This is needed to avoid metastability if the physical pin changes value near the edge of the internal clock, but it also introduces a delay. Figure 10-3 shows a timing diagram of the synchronization when reading an externally applied pin value. The maximum and minimum propagation delays are denoted tpd,max and tpd,min respectively. Figure 10-3. Synchronization when Reading an Externally Applied Pin value SYSTEM CLK INSTRUCTIONS XXX XXX in r17, PINx SYNC LATCH PINxn r17 0x00 0xFF t pd, max t pd, min 55 8183C-AVR-03/11 Consider the clock period starting shortly after the first falling edge of the system clock. The latch is closed when the clock is low, and goes transparent when the clock is high, as indicated by the shaded region of the "SYNC LATCH" signal. The signal value is latched when the system clock goes low. It is clocked into the PINxn Register at the succeeding positive clock edge. As indicated by the two arrows tpd,max and tpd,min, a single signal transition on the pin will be delayed between 1/2 and 11/2 system clock period depending upon the time of assertion. When reading back a software assigned pin value, a nop instruction must be inserted as indicated in Figure 10-4 on page 56. The out instruction sets the "SYNC LATCH" signal at the positive edge of the clock. In this case, the delay tpd through the synchronizer is one system clock period. Figure 10-4. Synchronization when Reading a Software Assigned Pin Value SYSTEM CLK r16 INSTRUCTIONS 0xFF out PORTx, r16 nop in r17, PINx SYNC LATCH PINxn r17 0x00 0xFF t pd 10.1.5 Digital Input Enable and Sleep Modes As shown in Figure 10-2 on page 54, the digital input signal can be clamped to ground at the input of the schmitt-trigger. The signal denoted SLEEP in the figure, is set by the MCU Sleep Controller in Power-down and Standby modes to avoid high power consumption if some input signals are left floating, or have an analog signal level close to VCC/2. SLEEP is overridden for port pins enabled as external interrupt pins. If the external interrupt request is not enabled, SLEEP is active also for these pins. SLEEP is also overridden by various other alternate functions as described in "Alternate Port Functions" on page 58. If a logic high level ("one") is present on an asynchronous external interrupt pin configured as "Interrupt on Rising Edge, Falling Edge, or Any Logic Change on Pin" while the external interrupt is not enabled, the corresponding External Interrupt Flag will be set when resuming from the above mentioned Sleep mode, as the clamping in these sleep mode produces the requested logic change. 10.1.6 Unconnected Pins If some pins are unused, it is recommended to ensure that these pins have a defined level. Even though most of the digital inputs are disabled in the deep sleep modes as described above, floating inputs should be avoided to reduce current consumption in all other modes where the digital inputs are enabled (Reset, Active mode and Idle mode). The simplest method to ensure a defined level of an unused pin, is to enable the internal pull-up. In this case, the pull-up will be disabled during reset. If low power consumption during reset is 56 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A important, it is recommended to use an external pull-up or pulldown. Connecting unused pins directly to VCC or GND is not recommended, since this may cause excessive currents if the pin is accidentally configured as an output. 10.1.7 Program Examples The following code example shows how to set port A pins 0 and 1 high, 2 and 3 low, and define the port pins from 4 to 5 as input with a pull-up assigned to port pin 4. The resulting pin values are read back again, but as previously discussed, a nop instruction is included to be able to read back the value recently assigned to some of the pins. Assembly Code Example ... ; Define pull-ups and set outputs high ; Define directions for port pins ldi r16,(1< 118 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A SPITransfer_loop: out USICR,r17 in r16, USISR sbrs r16, USIOIF rjmp SPITransfer_loop in r16,USIDR ret The code is size optimized using only eight instructions (plus return). The code example assumes that the DO and USCK pins have been enabled as outputs in DDRA. The value stored in register r16 prior to the function is called is transferred to the slave device, and when the transfer is completed the data received from the slave is stored back into the register r16. The second and third instructions clear the USI Counter Overflow Flag and the USI counter value. The fourth and fifth instructions set three-wire mode, positive edge clock, count at USITC strobe, and toggle USCK. The loop is repeated 16 times. The following code demonstrates how to use the USI as an SPI master with maximum speed (fSCK = fCK/2): SPITransfer_Fast: out USIDR,r16 ldi r16,(1< 2 CPU clock cycles for fck < 12 MHz, 3 CPU clock cycles for fck >= 12 MHz * High:> 2 CPU clock cycles for fck < 12 MHz, 3 CPU clock cycles for fck >= 12 MHz 19.5.1 Serial Programming Algorithm When writing serial data to the ATtiny24A/44A/84A, data is clocked on the rising edge of SCK. When reading, data is clocked on the falling edge of SCK. See Figure 20-3 and Figure 20-4 for timing details. To program and verify the ATtiny24A/44A/84A in the Serial Programming mode, the following sequence is recommended (see four byte instruction formats in Table 19-12): 1. Power-up sequence: Apply power between VCC and GND while RESET and SCK are set to "0". In some systems, the programmer can not guarantee that SCK is held low during power-up. In this case, RESET must be given a positive pulse after SCK has been set to '0'. The duration of the pulse must be at least tRST (the minimum pulse width on RESET pin, see Table 20-4 on page 176) plus two CPU clock cycles. 2. Wait for at least 20 ms and enable serial programming by sending the Programming Enable serial instruction to pin MOSI. 3. The serial programming instructions will not work if the communication is out of synchronization. When in sync. the second byte (0x53), will echo back when issuing the third byte of the Programming Enable instruction. Whether the echo is correct or not, all four bytes of the instruction must be transmitted. If the 0x53 did not echo back, give RESET a positive pulse and issue a new Programming Enable command. 4. The Flash is programmed one page at a time. The memory page is loaded one byte at a time by supplying the 5 LSB of the address and data together with the Load Program memory Page instruction. To ensure correct loading of the page, the data low byte must be loaded before data high byte is applied for a given address. The Program memory Page is stored by loading the Write Program memory Page instruction with the 3 MSB of the address. If polling (RDY/BSY) is not used, the user must wait at least tWD_FLASH before issuing the next page. (See Table 19-11 on page 164.) Accessing the serial programming interface before the Flash write operation completes can result in incorrect programming. 5. A: The EEPROM array is programmed one byte at a time by supplying the address and data together with the appropriate Write instruction. An EEPROM memory location is first automatically erased before new data is written. If polling (RDY/BSY) is not used, the user must wait at least tWD_EEPROM before issuing the next byte. (See Table 19-11 on page 164.) In a chip erased device, no 0xFFs in the data file(s) need to be programmed. B: The EEPROM array is programmed one page at a time. The Memory page is loaded one byte at a time by supplying the 2 LSB of the address and data together with the Load EEPROM Memory Page instruction. The EEPROM Memory Page is stored by loading the Write EEPROM Memory Page Instruction with the 4 MSB of the address. When using EEPROM page access only byte locations loaded with the Load EEPROM Memory Page instruction is altered. The remaining locations remain unchanged. If polling (RDY/BSY) is not used, the used must wait at least tWD_EEPROM before issuing the next page (See Table 19-11 on page 164). In a chip erased device, no 0xFF in the data file(s) need to be programmed. 6. Any memory location can be verified by using the Read instruction which returns the content at the selected address at serial output MISO. 163 8183C-AVR-03/11 7. At the end of the programming session, RESET can be set high to commence normal operation. 8. Power-off sequence (if needed): Set RESET to "1". Turn VCC power off. Table 19-11. Minimum Wait Delay Before Writing the Next Flash or EEPROM Location 19.5.2 Symbol Minimum Wait Delay tWD_FLASH 4.5 ms tWD_EEPROM 4.0 ms tWD_ERASE 9.0 ms tWD_FUSE 4.5 ms Serial Programming Instruction set The instruction set is described in Table 19-12 and Figure 19-2 on page 165. Table 19-12. Serial Programming Instruction Set Instruction Format Instruction/Operation(1) Byte 1 Byte 2 Byte 3 Byte4 Programming Enable $AC $53 $00 $00 Chip Erase (Program Memory/EEPROM) $AC $80 $00 $00 Poll RDY/BSY $F0 $00 $00 data byte out Load Extended Address byte $4D $00 Extended adr $00 Load Program Memory Page, High byte $48 adr MSB adr LSB high data byte in Load Program Memory Page, Low byte $40 adr MSB adr LSB low data byte in Load EEPROM Memory Page (page access) $C1 $00 adr LSB data byte in Read Program Memory, High byte $28 adr MSB adr LSB high data byte out Read Program Memory, Low byte $20 adr MSB adr LSB low data byte out Read EEPROM Memory $A0 $00 adr LSB data byte out Read Lock bits $58 $00 $00 data byte out Read Signature Byte $30 $00 adr LSB data byte out Read Fuse bits $50 $00 $00 data byte out Read Fuse High bits $58 $08 $00 data byte out Read Extended Fuse Bits $50 $08 $00 data byte out Read Calibration Byte $38 $00 $00 data byte out Write Program Memory Page $4C adr MSB adr LSB $00 Write EEPROM Memory $C0 $00 adr LSB data byte in Write EEPROM Memory Page (page access) $C2 $00 adr LSB $00 Load Instructions Read Instructions Write Instructions 164 (6) ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Table 19-12. Serial Programming Instruction Set (Continued) Instruction Format (1) Instruction/Operation Byte 1 Byte 2 Byte 3 Byte4 Write Lock bits $AC $E0 $00 data byte in Write Fuse bits $AC $A0 $00 data byte in Write Fuse High bits $AC $A8 $00 data byte in Write Extended Fuse Bits $AC $A4 $00 data byte in Notes: 1. Not all instructions are applicable for all parts. 2. a = address 3. Bits are programmed `0', unprogrammed `1'. 4. To ensure future compatibility, unused Fuses and Lock bits should be unprogrammed (`1') . 5. Refer to the correspondig section for Fuse and Lock bits, Calibration and Signature bytes and Page size. 6. Instructions accessing program memory use a word address. This address may be random within the page range. 7. See http://www.atmel.com/avr for Application Notes regarding programming and programmers. Figure 19-2. Serial Programming Instruction example Serial Programming Instruction Load Program Memory Page (High/Low Byte)/ Load EEPROM Memory Page (page access) Byte 1 Byte 2 Byte 3 Adr MSB A Bit 15 B Write Program Memory Page/ Write EEPROM Memory Page Byte 1 Byte 4 Byte 2 Adr LSB Adr MSB Bit 15 B 0 Byte 3 Byte 4 Adrr LSB B 0 Page Buffer Page Offset Page 0 Page 1 Page 2 Page Number Page N-1 Program Memory/ EEPROM Memory If the LSB in RDY/BSY data byte out is `1', a programming operation is still pending. Wait until this bit returns `0' before the next instruction is carried out. Within the same page, the low data byte must be loaded prior to the high data byte. 165 8183C-AVR-03/11 After data is loaded to the page buffer, program the EEPROM page, see Figure 19-2 on page 165. 19.6 High-voltage Serial Programming This section describes how to program and verify Flash Program memory, EEPROM Data memory, Lock bits and Fuse bits in the ATtiny24A/44A/84A. Figure 19-3. High-voltage Serial Programming +11.5 - 12.5V SCI +4.5 - 5.5V PB3 (RESET) VCC PB0 PA4 SDO PA2:0 PA5 SII GND PA6 SDI Table 19-13. Pin Name Mapping Signal Name in High-voltage Serial Programming Mode Pin Name SDI PA6 I Serial Data Input SII PA5 I Serial Instruction Input SDO PA4 O Serial Data Output SCI PB0 I Serial Clock Input (min. 220ns period) I/O Function The minimum period for the Serial Clock Input (SCI) during High-voltage Serial Programming is 220 ns. Table 19-14. Pin Values Used to Enter Programming Mode 19.7 Pin Symbol Value PA0 Prog_enable[0] 0 PA1 Prog_enable[1] 0 PA2 Prog_enable[2] 0 High-Voltage Serial Programming Algorithm To program and verify the ATtiny24A/44A/84A in the High-voltage Serial Programming mode, the following sequence is recommended (See instruction formats in Table 19-16 on page 170): 166 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A 19.7.1 Enter High-voltage Serial Programming Mode The following algorithm puts the device in High-voltage Serial Programming mode: 1. Set Prog_enable pins listed in Table 19-14 on page 166 to "000", RESET pin and VCC to 0V. 2. Apply 4.5 - 5.5V between VCC and GND. Ensure that VCC reaches at least 1.8V within the next 20 s. 3. Wait 20 - 60 s, and apply 11.5 - 12.5V to RESET. 4. Keep the Prog_enable pins unchanged for at least 10 s after the High-voltage has been applied to ensure the Prog_enable Signature has been latched. 5. Release the Prog_enable[2] pin after tHVRST has elapsed. 6. Wait at least 300 s before giving any serial instructions on SDI/SII. 7. Exit Programming mode by power the device down or by bringing RESET pin to 0V. If the rise time of the VCC is unable to fulfill the requirements listed above, the following alternative algorithm can be used: 1. Set Prog_enable pins listed in Table 19-14 on page 166 to "000", RESET pin and VCC to 0V. 2. Apply 4.5 - 5.5V between VCC and GND. 3. Monitor VCC, and as soon as VCC reaches 0.9 - 1.1V, apply 11.5 - 12.5V to RESET. 4. Keep the Prog_enable pins unchanged for at least 10 s after the High-voltage has been applied to ensure the Prog_enable Signature has been latched. 5. Release the Prog_enable[2] pin to avoid drive contention on the Prog_enable[2]/SDO pin. 6. Wait until VCC actually reaches 4.5 - 5.5V before giving any serial instructions on SDI/SII. 7. Exit Programming mode by power the device down or by bringing RESET pin to 0V. Table 19-15. High-voltage Reset Characteristics RESET Pin High-voltage Threshold Minimum High-voltage Period for Latching Prog_enable VCC VHVRST tHVRST 4.5V 11.5V 100 ns 5.5V 11.5V 100 ns Supply Voltage 167 8183C-AVR-03/11 19.7.2 Considerations for Efficient Programming The loaded command and address are retained in the device during programming. For efficient programming, the following should be considered. * The command needs only be loaded once when writing or reading multiple memory locations. * Skip writing the data value 0xFF that is the contents of the entire EEPROM (unless the EESAVE Fuse is programmed) and Flash after a Chip Erase. * Address High byte needs only be loaded before programming or reading a new 256 word window in Flash or 256 byte EEPROM. This consideration also applies to Signature bytes reading. 19.7.3 Chip Erase The Chip Erase will erase the Flash and EEPROM(1) memories plus Lock bits. The Lock bits are not reset until the Program memory has been completely erased. The Fuse bits are not changed. A Chip Erase must be performed before the Flash and/or EEPROM are reprogrammed. 1. Load command "Chip Erase" (see Table 19-16 on page 170). 2. Wait after Instr. 3 until SDO goes high for the "Chip Erase" cycle to finish. 3. Load Command "No Operation". Note: 19.7.4 1. The EEPROM memory is preserved during Chip Erase if the EESAVE Fuse is programmed. Programming the Flash The Flash is organized in pages, see "Page Size" on page 161. When programming the Flash, the program data is latched into a page buffer. This allows one page of program data to be programmed simultaneously. The following procedure describes how to program the entire Flash memory: 1. Load Command "Write Flash" (see Table 19-16 on page 170). 2. Load Flash Page Buffer. 3. Load Flash High Address and Program Page. Wait after Instr. 3 until SDO goes high for the "Page Programming" cycle to finish. 4. Repeat 2 through 3 until the entire Flash is programmed or until all data has been programmed. 5. End Page Programming by Loading Command "No Operation". When writing or reading serial data to the ATtiny24A/44A/84A, data is clocked on the rising edge of the serial clock, see Figure 20-5 on page 181, Figure 19-3 on page 166 and Table 20-12 on page 181 for details. 168 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 19-4. Addressing the Flash which is Organized in Pages PCMSB PROGRAM COUNTER PAGEMSB PCPAGE PCWORD PAGE ADDRESS WITHIN THE FLASH WORD ADDRESS WITHIN A PAGE PROGRAM MEMORY PAGE PAGE PCWORD[PAGEMSB:0]: 00 INSTRUCTION WORD 01 02 PAGEEND Figure 19-5. High-voltage Serial Programming Waveforms SDI PA6 MSB LSB SII PA5 MSB LSB SDO PA4 SCI PB0 19.7.5 MSB 0 LSB 1 2 3 4 5 6 7 8 9 10 Programming the EEPROM The EEPROM is organized in pages, see Table 20-11 on page 180. When programming the EEPROM, the data is latched into a page buffer. This allows one page of data to be programmed simultaneously. The programming algorithm for the EEPROM Data memory is as follows (refer to Table 19-16 on page 170): 1. Load Command "Write EEPROM". 2. Load EEPROM Page Buffer. 3. Program EEPROM Page. Wait after Instr. 2 until SDO goes high for the "Page Programming" cycle to finish. 4. Repeat 2 through 3 until the entire EEPROM is programmed or until all data has been programmed. 5. End Page Programming by Loading Command "No Operation". 169 8183C-AVR-03/11 19.7.6 Reading the Flash The algorithm for reading the Flash memory is as follows (refer to Table 19-16 on page 170): 1. Load Command "Read Flash". 2. Read Flash Low and High Bytes. The contents at the selected address are available at serial output SDO. 19.7.7 Reading the EEPROM The algorithm for reading the EEPROM memory is as follows (refer to Table 19-16 on page 170): 1. Load Command "Read EEPROM". 2. Read EEPROM Byte. The contents at the selected address are available at serial output SDO. 19.7.8 Programming and Reading the Fuse and Lock Bits The algorithms for programming and reading the Fuse Low/High bits and Lock bits are shown in Table 19-16 on page 170. 19.7.9 Reading the Signature Bytes and Calibration Byte The algorithms for reading the Signature bytes and Calibration byte are shown in Table 19-16 on page 170. 19.7.10 Power-off sequence Set SCI to "0". Set RESET to "1". Turn VCC power off. Table 19-16. High-voltage Serial Programming Instruction Set for ATtiny24A/44A/84A Instruction Format Instruction Chip Erase Load "Write Flash" Command Load Flash Page Buffer Load Flash High Address and Program Page 170 Instr.1/5 Instr.2/6 Instr.3/7 Instr.4 SDI 0_1000_0000_00 0_0000_0000_00 0_0000_0000_00 SII 0_0100_1100_00 0_0110_0100_00 0_0110_1100_00 SDO x_xxxx_xxxx_xx x_xxxx_xxxx_xx x_xxxx_xxxx_xx SDI 0_0001_0000_00 SII 0_0100_1100_00 SDO x_xxxx_xxxx_xx SDI 0_ bbbb_bbbb _00 0_eeee_eeee_00 0_0000_0000_00 0_0000_0000_00 SII 0_0000_1100_00 0_0010_1100_00 0_0110_1101_00 0_0110_1100_00 SDO x_xxxx_xxxx_xx x_xxxx_xxxx_xx x_xxxx_xxxx_xx x_xxxx_xxxx_xx SDI 0_dddd_dddd_00 0_0000_0000_00 0_0000_0000_00 SII 0_0011_1100_00 0_0111_1101_00 0_0111_1100_00 SDO x_xxxx_xxxx_xx x_xxxx_xxxx_xx x_xxxx_xxxx_xx Operation Remarks Wait after Instr.3 until SDO goes high for the Chip Erase cycle to finish. Enter Flash Programming code. SDI 0_0000_000a_00 0_0000_0000_00 0_0000_0000_00 SII 0_0001_1100_00 0_0110_0100_00 0_0110_1100_00 SDO x_xxxx_xxxx_xx x_xxxx_xxxx_xx x_xxxx_xxxx_xx Repeat after Instr. 1 - 7until the entire page buffer is filled or until all data within the page is filled.(2) Instr 5-7. Wait after Instr 3 until SDO goes high. Repeat Instr. 2 - 3 for each loaded Flash Page until the entire Flash or all data is programmed. Repeat Instr. 1 for a new 256 byte page.(2) ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Table 19-16. High-voltage Serial Programming Instruction Set for ATtiny24A/44A/84A (Continued) Instruction Format Instruction Instr.1/5 Instr.2/6 Instr.3/7 Instr.4 SDI 0_0000_0010_00 SII 0_0100_1100_00 SDO x_xxxx_xxxx_xx SDI 0_bbbb_bbbb_00 0_0000_000a_00 0_0000_0000_00 0_0000_0000_00 SII 0_0000_1100_00 0_0001_1100_00 0_0110_1000_00 0_0110_1100_00 SDO x_xxxx_xxxx_xx x_xxxx_xxxx_xx x_xxxx_xxxx_xx q_qqqq_qqqx_xx SDI 0_0000_0000_00 0_0000_0000_00 SII 0_0111_1000_00 0_0111_1100_00 SDO x_xxxx_xxxx_xx p_pppp_pppx_xx SDI 0_0001_0001_00 SII 0_0100_1100_00 SDO x_xxxx_xxxx_xx SDI 0_bbbb_bbbb_00 0_aaaa_aaaa_00 SII 0_0000_1100_00 0_0001_1100_00 SDO x_xxxx_xxxx_xx x_xxxx_xxxx_xx SDI 0_0000_0000_00 SII 0_0110_1100_00 SDO x_xxxx_xxxx_xx SDI 0_0000_0000_00 0_0000_0000_00 SII 0_0110_0100_00 0_0110_1100_00 SDO x_xxxx_xxxx_xx x_xxxx_xxxx_xx SDI 0_bbbb_bbbb_00 0_aaaa_aaaa_00 0_eeee_eeee_00 0_0000_0000_00 SII 0_0000_1100_00 0_0001_1100_00 0_0010_1100_00 0_0110_1101_00 SDO x_xxxx_xxxx_xx x_xxxx_xxxx_xx x_xxxx_xxxx_xx x_xxxx_xxxx_xx SDI 0_0000_0000_00 0_0000_0000_00 SII 0_0110_0100_00 0_0110_1100_00 SDO x_xxxx_xxxx_xx x_xxxx_xxxx_xx Load "Read EEPROM" Command SDI 0_0000_0011_00 SII 0_0100_1100_00 SDO x_xxxx_xxxx_xx Read EEPROM Byte SDI 0_bbbb_bbbb_00 0_aaaa_aaaa_00 0_0000_0000_00 0_0000_0000_00 SII 0_0000_1100_00 0_0001_1100_00 0_0110_1000_00 0_0110_1100_00 SDO x_xxxx_xxxx_xx x_xxxx_xxxx_xx x_xxxx_xxxx_xx q_qqqq_qqq0_00 SDI 0_0100_0000_00 0_A987_6543_00 0_0000_0000_00 0_0000_0000_00 SII 0_0100_1100_00 0_0010_1100_00 0_0110_0100_00 0_0110_1100_00 SDO x_xxxx_xxxx_xx x_xxxx_xxxx_xx x_xxxx_xxxx_xx x_xxxx_xxxx_xx SDI 0_0100_0000_00 0_IHGF_EDCB_00 0_0000_0000_00 0_0000_0000_00 SII 0_0100_1100_00 0_0010_1100_00 0_0111_0100_00 0_0111_1100_00 SDO x_xxxx_xxxx_xx x_xxxx_xxxx_xx x_xxxx_xxxx_xx x_xxxx_xxxx_xx Load "Read Flash" Command Read Flash Low and High Bytes Load "Write EEPROM" Command Load EEPROM Page Buffer Program EEPROM Page Write EEPROM Byte Write Fuse Low Bits Write Fuse High Bits Write Fuse Extended Bits Enter Flash Read mode. Repeat Instr. 1, 3 - 6 for each new address. Repeat Instr. 2 for a new 256 byte page. Instr 5 - 6. Enter EEPROM Programming mode. 0_eeee_eeee_00 0_0010_1100_00 x_xxxx_xxxx_xx 0_0000_0000_00 0_0110_1101_00 x_xxxx_xxxx_xx Repeat Instr. 1 - 5 until the entire page buffer is filled or until all data within the page is filled.(3) Wait after Instr. 2 until SDO goes high. Repeat Instr. 1 - 2 for each loaded EEPROM page until the entire EEPROM or all data is programmed. Repeat Instr. 1 - 6 for each new address. Wait after Instr. 6 until SDO goes high.(4) Instr. 5-6 Enter EEPROM Read mode. SDI 0_0100_0000_00 0_0000_000J_00 0_0000_0000_00 0_0000_0000_00 SII 0_0100_1100_00 0_0010_1100_00 0_0110_0110_00 0_0110_1110_00 x_xxxx_xxxx_xx x_xxxx_xxxx_xx x_xxxx_xxxx_xx x_xxxx_xxxx_xx SDO Operation Remarks Repeat Instr. 1, 3 - 4 for each new address. Repeat Instr. 2 for a new 256 byte page. Wait after Instr. 4 until SDO goes high. Write A - 3 = "0" to program the Fuse bit. Wait after Instr. 4 until SDO goes high. Write F - B = "0" to program the Fuse bit. Wait after Instr. 4 until SDO goes high. Write J = "0" to program the Fuse bit. 171 8183C-AVR-03/11 Table 19-16. High-voltage Serial Programming Instruction Set for ATtiny24A/44A/84A (Continued) Instruction Format Instruction Write Lock Bits Read Fuse Low Bits Read Fuse High Bits Instr.1/5 Instr.2/6 Instr.3/7 Instr.4 SDI 0_0010_0000_00 0_0000_0021_00 0_0000_0000_00 0_0000_0000_00 SII 0_0100_1100_00 0_0010_1100_00 0_0110_0100_00 0_0110_1100_00 SDO x_xxxx_xxxx_xx x_xxxx_xxxx_xx x_xxxx_xxxx_xx x_xxxx_xxxx_xx SDI 0_0000_0100_00 0_0000_0000_00 0_0000_0000_00 SII 0_0100_1100_00 0_0110_1000_00 0_0110_1100_00 SDO x_xxxx_xxxx_xx x_xxxx_xxxx_xx A_9876_543x_xx SDI 0_0000_0100_00 0_0000_0000_00 0_0000_0000_00 SII 0_0100_1100_00 0_0111_1010_00 0_0111_1100_00 SDO x_xxxx_xxxx_xx x_xxxx_xxxx_xx I_HGFE_DCBx_xx Reading F - B = "0" means the Fuse bit is programmed. 0_0000_0100_00 0_0000_0000_00 0_0000_0000_00 SII 0_0100_1100_00 0_0110_1010_00 0_0110_1110_00 x_xxxx_xxxx_xx x_xxxx_xxxx_xx x_xxxx_xxJx_xx SDI 0_0000_0100_00 0_0000_0000_00 0_0000_0000_00 SII 0_0100_1100_00 0_0111_1000_00 0_0110_1100_00 SDO x_xxxx_xxxx_xx x_xxxx_xxxx_xx x_xxxx_x21x_xx Read Signature Bytes SDI 0_0000_1000_00 0_0000_00bb_00 0_0000_0000_00 0_0000_0000_00 SII 0_0100_1100_00 0_0000_1100_00 0_0110_1000_00 0_0110_1100_00 SDO x_xxxx_xxxx_xx x_xxxx_xxxx_xx x_xxxx_xxxx_xx q_qqqq_qqqx_xx Read Calibration Byte SDI 0_0000_1000_00 0_0000_0000_00 0_0000_0000_00 0_0000_0000_00 SII 0_0100_1100_00 0_0000_1100_00 0_0111_1000_00 0_0111_1100_00 SDO x_xxxx_xxxx_xx x_xxxx_xxxx_xx x_xxxx_xxxx_xx p_pppp_pppx_xx Load "No Operation" Command SDI 0_0000_0000_00 SII 0_0100_1100_00 SDO x_xxxx_xxxx_xx Read Lock Bits Notes: SDO Wait after Instr. 4 until SDO goes high. Write 2 - 1 = "0" to program the Lock Bit. Reading A - 3 = "0" means the Fuse bit is programmed. SDI Read Fuse Extended Bits Operation Remarks Reading J = "0" means the Fuse bit is programmed. Reading 2, 1 = "0" means the Lock bit is programmed. Repeats Instr 2 4 for each signature byte address. 1. a = address high bits, b = address low bits, d = data in high bits, e = data in low bits, p = data out high bits, q = data out low bits, x = don't care, 1 = Lock Bit1, 2 = Lock Bit2, 3 = CKSEL0 Fuse, 4 = CKSEL1 Fuse, 5 = CKSEL2 Fuse, 6 = CKSEL3 Fuse, 7 = SUT0 Fuse, 8 = SUT1 Fuse, 9 = CKOUT Fuse, A = CKDIV8 Fuse, B = BODLEVEL0 Fuse, C = BODLEVEL1 Fuse, D= BODLEVEL2 Fuse, E = EESAVE Fuse, F = WDTON Fuse, G = SPIEN Fuse, H = DWEN Fuse, I = RSTDISBL Fuse, J = SELFPRGEN Fuse 2. For page sizes less than 256 words, parts of the address (bbbb_bbbb) will be parts of the page address. 3. For page sizes less than 256 bytes, parts of the address (bbbb_bbbb) will be parts of the page address. 4. The EEPROM is written page-wise. But only the bytes that are loaded into the page are actually written to the EEPROM. Page-wise EEPROM access is more efficient when multiple bytes are to be written to the same page. Note that auto-erase of EEPROM is not available in High-voltage Serial Programming, only in SPI Programming. 172 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A 20. Electrical Characteristics 20.1 Absolute Maximum Ratings* Operating Temperature.................................. -55C to +125C *NOTICE: Storage Temperature ..................................... -65C to +150C Voltage on any Pin except RESET with respect to Ground ................................-0.5V to VCC+0.5V Voltage on RESET with respect to Ground......-0.5V to +13.0V Stresses beyond those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or other conditions beyond those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability. Maximum Operating Voltage ............................................ 6.0V DC Current per I/O Pin ............................................... 40.0 mA DC Current VCC and GND Pins ................................ 200.0 mA 20.2 DC Characteristics Table 20-1. Symbol DC Characteristics. TA = -40C to +85C Parameter Input Low Voltage VIL Input Low Voltage, RESET Pin as Reset (4) Input High-voltage Except RESET pin VIH Input High-voltage RESET pin as Reset (4) Condition Typ(1) Min Max Units (3) V V VCC = 1.8V - 2.4V -0.5 0.2VCC VCC = 2.4V - 5.5V -0.5 0.3VCC(3) VCC = 1.8V - 5.5 -0.5 0.2VCC(3) VCC = 1.8V - 2.4V 0.7VCC(2) VCC +0.5 V VCC = 2.4V - 5.5V 0.6VCC (2) VCC +0.5 V VCC = 1.8V to 5.5V 0.9VCC(2) VCC +0.5 V IOL = 10 mA, VCC = 5V 0.6 V IOL = 5 mA, VCC = 3V 0.5 V VOL Output Low Voltage (5) Except RESET pin (7) Output High-voltage (6) Except RESET pin (7) IOH = -10 mA, VCC = 5V 4.3 V VOH IOH = -5 mA, VCC = 3V 2.5 V ILIL Input Leakage Current I/O Pin VCC = 5.5V, pin low (absolute value) < 0.05 1(8) A ILIH Input Leakage Current I/O Pin VCC = 5.5V, pin high (absolute value) < 0.05 1(8) A Pull-up Resistor, I/O Pin VCC = 5.5V, input low 20 50 k Pull-up Resistor, Reset Pin VCC = 5.5V, input low 30 60 k RPU 173 8183C-AVR-03/11 Table 20-1. Symbol DC Characteristics. TA = -40C to +85C (Continued) Parameter Supply Current, Active Mode (9) ICC Supply Current, Idle Mode (9) Supply Current, Power-Down Mode (10) Notes: Typ(1) Max Units f = 1 MHz, VCC = 2V 0.25 0.5 mA f = 4 MHz, VCC = 3V 1.2 2 mA f = 8 MHz, VCC = 5V 4.4 7 mA f = 1 MHz, VCC = 2V 0.04 0.2 mA f = 4 MHz, VCC = 3V 0.25 0.6 mA f = 8 MHz, VCC = 5V 1.3 2 mA WDT enabled, VCC = 3V 4 10 A WDT disabled, VCC = 3V 0.13 2 A Condition Min 1. Typical values at 25C. 2. "Min" means the lowest value where the pin is guaranteed to be read as high. 3. "Max" means the highest value where the pin is guaranteed to be read as low. 4. Not tested in production. 5. Although each I/O port can sink more than the test conditions (10 mA at VCC = 5V, 5 mA at VCC = 3V) under steady state conditions (non-transient), the sum of all IOL (for all ports) should not exceed 60 mA. If IOL exceeds the test conditions, VOL may exceed the related specification. Pins are not guaranteed to sink current greater than the listed test condition. 6. Although each I/O port can source more than the test conditions (10 mA at VCC = 5V, 5 mA at VCC = 3V) under steady state conditions (non-transient), the sum of all IOH (for all ports) should not exceed 60 mA. If IOH exceeds the test condition, VOH may exceed the related specification. Pins are not guaranteed to source current greater than the listed test condition. 7. The RESET pin must tolerate high voltages when entering and operating in programming modes and, as a consequence, has a weak drive strength as compared to regular I/O pins. See Figure 21-87, Figure 21-88, Figure 21-89, and Figure 21-90 (starting on page 226). 8. These are test limits, which account for leakage currents of the test environment. Actual device leakage currents are lower. 9. Values are with external clock using methods described in "Minimizing Power Consumption" on page 35. Power Reduction is enabled (PRR = 0xFF) and there is no I/O drive. 10. BOD Disabled. 20.3 Speed The maximum operating frequency of the device depends on VCC. As shown in Figure 20-1, the relationship between maximum frequency and VCC is linear in the region 1.8V < VCC < 4.5V. Figure 20-1. Maximum Frequency vs. VCC 20 MHz 4 MHz 1.8V 174 4.5V 5.5V ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A 20.4 Clock Characteristics 20.4.1 Accuracy of Calibrated Internal Oscillator It is possible to manually calibrate the internal oscillator to be more accurate than default factory calibration. Note that the oscillator frequency depends on temperature and voltage. Voltage and temperature characteristics can be found in Figure 21-109 on page 237 and Figure 21-110 on page 238. Table 20-2. Calibration Accuracy of Internal RC Oscillator Target Frequency VCC Temperature Accuracy at given voltage & temperature (1) 8.0 MHz 3V 25C 10% Fixed frequency within: 7.3 - 8.1 MHz Fixed voltage within: 1.8V - 5.5V Fixed temperature within: -40C to +85C 1% Calibration Method Factory Calibration User Calibration Notes: 20.4.2 1. Accuracy of oscillator frequency at calibration point (fixed temperature and fixed voltage). External Clock Drive Figure 20-2. External Clock Drive Waveform V IH1 V IL1 Table 20-3. External Clock Drive Characteristics VCC = 1.8 - 5.5V VCC = 2.7 - 5.5V VCC = 4.5 - 5.5V Min. Max. Min. Max. Min. Max. Units 0 4 0 10 0 20 MHz Symbol Parameter 1/tCLCL Clock Frequency tCLCL Clock Period 250 100 50 ns tCHCX High Time 100 40 20 ns tCLCX Low Time 100 40 20 ns tCLCH Rise Time 2.0 1.6 0.5 s tCHCL Fall Time 2.0 1.6 0.5 s tCLCL Change in period from one clock cycle to the next 2 2 2 % 175 8183C-AVR-03/11 20.5 System and Reset Characteristics Table 20-4. Symbol Parameter VRST RESET pin threshold voltage tRST Minimum pulse width on RESET pin Condition Min(1) Typ(1) 0.2 VCC Max(1) Units 0.9VCC V 2000 700 400 ns Brown-out Detector hysteresis 50 mV tBOD Minimum pulse width on Brown-out Reset 2 s VBG Internal bandgap reference voltage VCC = 5V TA = 25C tBG Internal bandgap reference start-up time IBG Internal bandgap reference current consumption VHYST Note: 20.5.1 Reset, Brown-out, and Internal Voltage Characteristics VCC = 1.8V VCC = 3V VCC = 5V 1.0 1.1 1.2 V VCC = 5V TA = 25C 40 70 s VCC = 5V TA = 25C 15 A 1. Values are guidelines, only Power-On Reset Table 20-5. Symbol Characteristics of Enhanced Power-On Reset. TA = = -40C to +85C Parameter Typ(1) Max(1) Units 1.1 1.4 1.6 V 0.6 1.3 1.6 V Release threshold of power-on reset (2) VPOR VPOA Activation threshold of power-on reset SRON Power-On Slope Rate Note: Min(1) (3) 0.01 V/ms 1. Values are guidelines, only 2. Threshold where device is released from reset when voltage is rising 3. The Power-on Reset will not work unless the supply voltage has been below VPOA 20.5.2 Brown-Out Detection Table 20-6. VBOT vs. BODLEVEL Fuse Coding BODLEVEL[2:0] Fuses Min(1) 111 176 Max(1) Units BOD Disabled 110 1.7 1.8 2.0 101 2.5 2.7 2.9 100 4.1 4.3 4.5 0XX Note: Typ(1) V Reserved 1. VBOT may be below nominal minimum operating voltage for some devices. For devices where this is the case, the device is tested down to VCC = VBOT during the production test. This guarantees that a Brown-out Reset will occur before VCC drops to a voltage where correct operation of the microcontroller is no longer guaranteed. ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A 20.6 ADC Characteristics Table 20-7. Symbol ADC Characteristics, Single Ended Channels. T = -40C to +85C Parameter Condition Min Typ Resolution Units 10 Bits VREF = 4V, VCC = 4V, ADC clock = 200 kHz 2.0 LSB VREF = 4V, VCC = 4V, ADC clock = 1 MHz 2.5 LSB VREF = 4V, VCC = 4V, ADC clock = 200 kHz Noise Reduction Mode 1.5 LSB VREF = 4V, VCC = 4V, ADC clock = 1 MHz Noise Reduction Mode 2.0 LSB Integral Non-Linearity (INL) (Accuracy after Offset and Gain Calibration) VREF = 4V, VCC = 4V, ADC clock = 200 kHz 1.0 LSB Differential Non-linearity (DNL) VREF = 4V, VCC = 4V, ADC clock = 200 kHz 0.5 LSB Gain Error VREF = 4V, VCC = 4V, ADC clock = 200 kHz 2.0 LSB Offset Error (Absolute) VREF = 4V, VCC = 4V, ADC clock = 200 kHz 1.5 LSB Conversion Time Free Running Conversion Absolute accuracy (Including INL, DNL, and Quantization, Gain and Offset Errors) Clock Frequency VIN Max Input Voltage 14 280 s 50 1000 kHz GND VREF V Input Bandwidth 38.5 kHz AREF External Voltage Reference 2.0 VINT Internal Voltage Reference 1.0 RREF Reference Input Resistance 32 k RAIN Analog Input Resistance 100 M ADC Conversion Output 0 1.1 VCC V 1.2 V 1023 LSB 177 8183C-AVR-03/11 Table 20-8. Symbol ADC Characteristics, Differential Channels (Unipolar Mode), TA = -40C to +85C Parameter Condition Min Typ Max Units Gain = 1x 10 Bits Gain = 20x 10 Bits Resolution Absolute accuracy (Including INL, DNL, and Quantization, Gain and Offset Errors) Integral Non-Linearity (INL) (Accuracy after Offset and Gain Calibration) Gain = 1x VREF = 4V, VCC = 5V ADC clock = 50 - 200 kHz 10 LSB Gain = 20x VREF = 4V, VCC = 5V ADC clock = 50 - 200 kHz 15 LSB Gain = 1x VREF = 4V, VCC = 5V ADC clock = 50 - 200 kHz 4 LSB Gain = 20x VREF = 4V, VCC = 5V ADC clock = 50 - 200 kHz 10 LSB Gain = 1x 10 LSB Gain = 20x 15 LSB Gain = 1x VREF = 4V, VCC = 5V ADC clock = 50 - 200 kHz 3 LSB Gain = 20x VREF = 4V, VCC = 5V ADC clock = 50 - 200 kHz 4 LSB Gain Error Offset Error Conversion Time Clock Frequency VIN Input Voltage VDIFF Input Differential Voltage Free Running Conversion 70 280 s 50 200 kHz GND VCC V VREF/Gain V Input Bandwidth 4 kHz AREF External Reference Voltage 2.0 VINT Internal Voltage Reference 1.0 RREF Reference Input Resistance 32 k RAIN Analog Input Resistance 100 M ADC Conversion Output 178 0 1.1 VCC - 1.0 V 1.2 V 1023 LSB ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Table 20-9. Symbol ADC Characteristics, Differential Channels (Bipolar Mode), TA = -40C to +85C Parameter Condition Min Typ Max Units Gain = 1x 10 Bits Gain = 20x 10 Bits Resolution Absolute accuracy (Including INL, DNL, and Quantization, Gain and Offset Errors) Integral Non-Linearity (INL) (Accuracy after Offset and Gain Calibration) Gain = 1x VREF = 4V, VCC = 5V ADC clock = 50 - 200 kHz 8 LSB Gain = 20x VREF = 4V, VCC = 5V ADC clock = 50 - 200 kHz 8 LSB Gain = 1x VREF = 4V, VCC = 5V ADC clock = 50 - 200 kHz 4 LSB Gain = 20x VREF = 4V, VCC = 5V ADC clock = 50 - 200 kHz 5 LSB Gain = 1x 4 LSB Gain = 20x 5 LSB Gain = 1x VREF = 4V, VCC = 5V ADC clock = 50 - 200 kHz 3 LSB Gain = 20x VREF = 4V, VCC = 5V ADC clock = 50 - 200 kHz 4 LSB Gain Error Offset Error Conversion Time Clock Frequency VIN Input Voltage VDIFF Input Differential Voltage Free Running Conversion 70 280 s 50 200 kHz GND VCC V VREF/Gain V Input Bandwidth 4 kHz AREF External Reference Voltage 2.0 VINT Internal Voltage Reference 1.0 RREF Reference Input Resistance 32 k RAIN Analog Input Resistance 100 M ADC Conversion Output -512 1.1 VCC - 1.0 V 1.2 V 511 LSB 179 8183C-AVR-03/11 20.7 Analog Comparator Characteristics Table 20-10. Analog Comparator Characteristics, TA = -40C to +85C Symbol Parameter Condition VAIO Input Offset Voltage VCC = 5V, VIN = VCC / 2 ILAC Input Leakage Current VCC = 5V, VIN = VCC / 2 Analog Propagation Delay (from saturation to slight overdrive) VCC = 2.7V 750 VCC = 4.0V 500 Analog Propagation Delay (large step change) VCC = 2.7V 100 VCC = 4.0V 75 Digital Propagation Delay VCC = 1.8V - 5.5 1 tAPD tDPD Min Max Units < 10 40 mV 50 nA -50 ns Note: All parameters are based on simulation results and are not tested in production 20.8 Serial Programming Characteristics Figure 20-3. Typ 2 CLK Serial Programming Timing MOSI SCK tSLSH tSHOX tOVSH tSHSL MISO Figure 20-4. Serial Programming Waveform SERIAL DATA INPUT (MOSI) MSB LSB SERIAL DATA OUTPUT (MISO) MSB LSB SERIAL CLOCK INPUT (SCK) SAMPLE Table 20-11. Serial Programming Characteristics, TA = -40C to +85C, VCC = 1.8 - 5.5V (Unless Otherwise Noted) Symbol 1/tCLCL tCLCL 1/tCLCL 180 Parameter Oscillator Frequency Oscillator Period Oscillator Freq. (VCC = 4.5V - 5.5V) Min 0 Typ Max Units 4 MHz 250 0 ns 20 MHz ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Table 20-11. Serial Programming Characteristics, TA = -40C to +85C, VCC = 1.8 - 5.5V (Unless Otherwise Noted) Symbol tCLCL Min Oscillator Period (VCC = 4.5V - 5.5V) 50 SCK Pulse Width High tSHSL tSLSH SCK Pulse Width Low tOVSH MOSI Setup to SCK High tSHOX Note: 20.9 Parameter Typ Max Units ns 2 tCLCL (1) ns 2 tCLCL (1) ns MOSI Hold after SCK High tCLCL ns 2 tCLCL ns 1. 2 tCLCL for fck < 12 MHz, 3 tCLCL for fck >= 12 MHz High-Voltage Serial Programming Characteristics Figure 20-5. High-voltage Serial Programming Timing SDI (PA6), SII (PA5) tIVSH SCI (PB0) tSLSH tSHIX tSHSL SDO (PA4) tSHOV Table 20-12. High-voltage Serial Programming Characteristics TA = 25C, VCC = 5V (Unless otherwise noted) Symbol Parameter Min tSHSL SCI (PB0) Pulse Width High 125 ns tSLSH SCI (PB0) Pulse Width Low 125 ns tIVSH SDI (PA6), SII (PB1) Valid to SCI (PB0) High 50 ns tSHIX SDI (PA6), SII (PB1) Hold after SCI (PB0) High 50 ns tSHOV SCI (PB0) High to SDO (PA4) Valid 16 ns Wait after Instr. 3 for Write Fuse Bits 2.5 ms tWLWH_PFB Typ Max Units 181 8183C-AVR-03/11 21. Typical Characteristics The data contained in this section is largely based on simulations and characterization of similar devices in the same process and design methods. Thus, the data should be treated as indications of how the part will behave. The following charts show typical behavior. These figures are not tested during manufacturing. During characterisation devices are operated at frequencies higher than test limits but they are not guaranteed to function properly at frequencies higher than the ordering code indicates. All current consumption measurements are performed with all I/O pins configured as inputs and with internal pull-ups enabled. Current consumption is a function of several factors such as operating voltage, operating frequency, loading of I/O pins, switching rate of I/O pins, code executed and ambient temperature. The dominating factors are operating voltage and frequency. A sine wave generator with rail-to-rail output is used as clock source but current consumption in Power-Down mode is independent of clock selection. The difference between current consumption in Power-Down mode with Watchdog Timer enabled and Power-Down mode with Watchdog Timer disabled represents the differential current drawn by the Watchdog Timer. The current drawn from pins with a capacitive load may be estimated (for one pin) as follows: I CP V CC x C L x f SW where VCC = operating voltage, CL = load capacitance and fSW = average switching frequency of I/O pin. 21.1 Supply Current of I/O Modules The tables and formulas below can be used to calculate the additional current consumption for the different I/O modules in Active and Idle mode. The enabling or disabling of the I/O modules is controlled by the Power Reduction Register. See "Power Reduction Register" on page 35 for details. Table 21-1. Additional Current Consumption for the different I/O modules (absolute values) Typical numbers PRR bit VCC = 2V, f = 1 MHz VCC = 3V, f = 4 MHz VCC = 5V, f = 8 MHz PRTIM1 1.6 A 11 A 48 A PRTIM0 4.4 A 29 A 120 A PRUSI 1.6 A 11 A 48 A PRADC 8.0 A 55 A 240 A Table 21-2 below can be used for calculating typical current consumption for other supply voltages and frequencies than those mentioned in the Table 21-1 above. 182 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Table 21-2. Additional Current Consumption (percentage) in Active and Idle mode Current consumption additional to active mode with external clock (see Figure 21-56 and Figure 21-57) PRR bit 21.1.1 Current consumption additional to idle mode with external clock (see Figure 21-61 and Figure 21-62) PRTIM1 1% 5% PRTIM0 3% 10 % PRUSI 1% 5% PRADC 5% 20 % Example Calculate the expected current consumption in idle mode with USI, TIMER0, and ADC enabled at VCC = 2.0V and f = 1 MHz. From Table 21-2 on page 183, third column, we see that we need to add 5% for the USI, 10% for TIMER0, and 20% for the ADC. Reading from Figure 21-61 on page 213, we find that current consumption in idle mode at 2V and 1 MHz is about 0.04 mA. The total current consumption in idle mode with USI, TIMER0, and ADC enabled is therefore: I CCTOT 0,05mA x ( 1 + 0,05 + 0,10 + 0,20 ) 0,06mA 21.2 21.2.1 ATtiny24A Current Consumption in Active Mode Figure 21-1. Active Supply Current vs. Low Frequency 0.1 - 1.0 MHz, PRR = 0xFF 1 5.5 V 0,8 5.0 V 4.5 V ICC (mA) 0,6 4.0 V 3.3 V 0,4 2.7 V 0,2 1.8 V 0 0 0,1 0,2 0,3 0,4 0,5 0,6 0,7 0,8 0,9 1 Frequency (MHz) 183 8183C-AVR-03/11 Figure 21-2. Active Supply Current vs. Frequency 1 - 20 MHz, PRR = 0xFF 12 10 5.5 V 5.0 V 8 ICC (mA) 4.5 V 6 4.0 V 4 3.3 V 2.7 V 2 1.8 V 0 0 2 4 6 8 10 12 14 16 18 20 Frequency (MHz) Figure 21-3. Active Supply Current vs. VCC Internal RC Oscillator, 8 MHz 6 5 85 C 25 C -40 C ICC (mA) 4 3 2 1 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 184 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-4. Active Supply Current vs. VCC Internal RC Oscillator, 1 MHz 1,2 85 C 25 C -40 C 1 ICC (mA) 0,8 0,6 0,4 0,2 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) Figure 21-5. Active Supply Current vs. VCC Internal RC Oscillator, 128 kHz 0,14 0,12 -40 C 25 C 85 C ICC (mA) 0,1 0,08 0,06 0,04 0,02 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 185 8183C-AVR-03/11 21.2.2 Current Consumption in Idle Mode Figure 21-6. Idle Supply Current vs. Low Frequency 0.1 - 1.0 MHz, PRR = 0xFF 0,14 5.5 V 0,12 5.0 V 0,1 ICC (mA) 4.5 V 0,08 4.0 V 0,06 3.3 V 2.7 V 0,04 1.8 V 0,02 0 0 0,1 0,2 0,3 0,4 0,5 0,6 0,7 0,8 0,9 1 Frequency (MHz) Figure 21-7. Idle Supply Current vs. Frequency 1 - 20 MHz, PRR = 0xFF 4 3,5 3 ICC (mA) 2,5 5.5 V 5.0 V 2 4.5 V 1,5 4.0 V 1 3.3 V 0,5 2.7 V 1.8 V 0 0 2 4 6 8 10 12 14 16 18 20 Frequency (MHz) 186 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-8. Idle Supply Current vs. VCC Internal RC Oscillator, 8 MHz 2 1,8 1,6 1,4 85 C 25 C -40 C ICC (mA) 1,2 1 0,8 0,6 0,4 0,2 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) Figure 21-9. Idle Supply Current vs. VCC Internal RC Oscillator, 1 MHz 0,4 0,35 85 C 25 C -40 C 0,3 ICC (mA) 0,25 0,2 0,15 0,1 0,05 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 187 8183C-AVR-03/11 Figure 21-10. Idle Supply Current vs. VCC Internal RC Oscillator, 128 kHz 0,03 0,025 -40 C 25 C 85 C ICC (mA) 0,02 0,015 0,01 0,005 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 21.2.3 Current Consumption in Power-down Mode Figure 21-11. Power-down Supply Current vs. VCC Watchdog Timer Disabled 0,8 85 C ICC (uA) 0,6 0,4 0,2 25 C -40 C 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 188 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-12. Power-down Supply Current vs. VCC Watchdog Timer Enabled 10 8 -40 C 25 C 85 C ICC (uA) 6 4 2 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 21.2.4 Current Consumption in Reset Figure 21-13. Reset Supply Current vs. VCC 0.1 - 1.0 MHz, Excluding Current through Reset Pull-up 0,16 0,14 0,12 5.5 V 0,1 ICC (mA) 5.0 V 4.5 V 0,08 4.0 V 0,06 3.3 V 2.7 V 0,04 1.8 V 0,02 0 0 0,1 0,2 0,3 0,4 0,5 0,6 0,7 0,8 0,9 1 Frequency (MHz) 189 8183C-AVR-03/11 Figure 21-14. Reset Supply Current vs. VCC 1 - 20 MHz, Excluding Current through Reset Pull-up 3 2,5 5.5 V 2 ICC (mA) 5.0 V 4.5 V 1,5 4.0 V 1 3.3 V 2.7 V 0,5 1.8 V 0 0 2 4 6 8 10 12 14 16 18 20 Frequency (MHz) 21.2.5 Current Consumption of Peripheral Units Figure 21-15. ADC Current vs. VCC 4 MHz Frequency 600 500 ICC (uA) 400 300 200 100 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 190 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-16. AREF Pin Current vs. Pin Voltage 200 180 160 AREF pin current (uA) 140 120 100 80 60 40 20 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 4 4,5 5 5,5 AREF (V) Figure 21-17. Analog Comparator Current vs. VCC 4 MHz Frequency 160 140 120 ICC (uA) 100 80 60 40 20 0 1,5 2 2,5 3 3,5 VCC (V) 191 8183C-AVR-03/11 Figure 21-18. Programming Current vs. VCC 10000 9000 -40 C 8000 7000 ICC (uA) 6000 25 C 5000 4000 85 C 3000 2000 1000 0 1,5 2,5 3,5 4,5 5,5 VCC (V) Figure 21-19. Brownout Detector Current vs. VCC BOD Level = 1.8V 45 40 35 ICC (uA) 30 85 C 25 C -40 C 25 20 15 10 5 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 192 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-20. Watchdog Timer Current vs. VCC 8 -40 C 7 25 C 85 C 6 ICC (uA) 5 4 3 2 1 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 21.2.6 Pull-up Resistors Figure 21-21. Pull-up Resistor Current vs. Input Voltage I/O Pin, VCC = 1.8V 60 50 IOP (uA) 40 30 20 10 25 C -40 C 85 C 0 0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6 1,8 2 VOP (V) 193 8183C-AVR-03/11 Figure 21-22. Pull-up Resistor Current vs. Input Voltage I/O Pin, VCC = 2.7V 80 70 60 IOP (uA) 50 40 30 20 10 25 C 85 C -40 C 0 0 0,5 1 1,5 2 2,5 3 VOP (V) Figure 21-23. Pull-up Resistor Current vs. Input Voltage I/O Pin, VCC = 5V 160 140 120 IOP (uA) 100 80 60 40 20 25 C 85 C -40 C 0 0 1 2 3 4 5 6 VOP (V) 194 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-24. Reset Pull-up Resistor Current vs. Reset Pin Voltage VCC = 1.8V 40 35 30 IRESET (uA) 25 25 C -40 C 20 85 C 15 10 5 0 0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6 1,8 2 VRESET (V) Figure 21-25. Reset Pull-up Resistor Current vs. Reset Pin Voltage VCC = 2.7V 60 50 IRESET (uA) 40 25 C -40 C 30 85 C 20 10 0 0 0,5 1 1,5 2 2,5 3 VRESET (V) 195 8183C-AVR-03/11 Figure 21-26. Reset Pull-up Resistor Current vs. Reset Pin Voltage VCC = 5V 120 100 IRESET (uA) 80 25 C 60 -40 C 85 C 40 20 0 0 1 2 3 4 5 6 VRESET (V) 21.2.7 Output Driver Strength Figure 21-27. VOL: Output Voltage vs. Sink Current I/O Pin, VCC = 3V 1,2 1 85 C 0,8 VOL (V) 25 C 0,6 -40 C 0,4 0,2 0 0 5 10 15 20 IOL (mA) 196 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-28. VOL: Output Voltage vs. Sink Current I/O Pin, VCC = 5V 0,6 85 C 0,5 25 C VOL (V) 0,4 -40 C 0,3 0,2 0,1 0 0 5 10 15 20 IOL (mA) Figure 21-29. VOH: Output Voltage vs. Source Current I/O Pin, VCC = 3V 3,2 3 2,8 VOH (V) 2,6 2,4 -40 C 25 C 2,2 85 C 2 1,8 0 5 10 15 20 IOH (mA) 197 8183C-AVR-03/11 Figure 21-30. VOH: Output Voltage vs. Source Current I/O Pin, VCC = 5V 5,2 5 VOH (V) 4,8 4,6 -40 C 25 C 85 C 4,4 4,2 0 10 5 15 20 IOH (mA) Figure 21-31. VOL: Output Voltage vs. Sink Current Reset Pin as I/O, VCC = 3V 1,4 1,2 85 C 1 25 C VOL (V) 0,8 -40 C 0,6 0,4 0,2 0 0 0,5 1 1,5 2 2,5 3 IOL (mA) 198 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-32. VOL: Output Voltage vs. Sink Current Reset Pin as I/O, VCC = 5V 1,2 85 C 1 VOL (V) 0,8 25 C 0,6 -40 C 0,4 0,2 0 0 0,5 1 1,5 2 2,5 3 3,5 4 4,5 5 IOL (mA) Figure 21-33. VOH: Output Voltage vs. Source Current Reset Pin as I/O, VCC = 3V 3 2,5 VOH (V) 2 1,5 -40 C 25 C 85 C 1 0,5 0 0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6 1,8 2 IOH (mA) 199 8183C-AVR-03/11 Figure 21-34. VOH: Output Voltage vs. Source Current Reset Pin as I/O, VCC = 5V 4,5 4 3,5 VOH (V) 3 -40 C 25 C 85 C 2,5 2 1,5 1 0,5 0 0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6 1,8 2 IOH (mA) 21.2.8 Input Threshold and Hysteresis (for I/O Ports) Figure 21-35. VIH: Input Threshold Voltage vs. VCC I/O Pin, Read as `1' 3,5 85 C 25 C -40 C 3 Threshold (V) 2,5 2 1,5 1 0,5 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 200 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-36. VIL: Input Threshold Voltage vs. VCC I/O Pin, Read as `0' 2,5 Threshold (V) 2 1,5 85 C 25 C -40 C 1 0,5 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 4 4,5 5 5,5 VCC (V) Figure 21-37. VIH-VIL: Input Hysteresis vs. VCC I/O Pin 0,8 0,7 0,6 Input Hysteresis (V) -40 C 0,5 25 C 0,4 85 C 0,3 0,2 0,1 0 1,5 2 2,5 3 3,5 VCC (V) 201 8183C-AVR-03/11 Figure 21-38. VIH: Input Threshold Voltage vs. VCC Reset Pin as I/O, Read as `1' 3 2,5 Threshold (V) 2 1,5 25 C 85 C -40 C 1 0,5 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) Figure 21-39. VIL: Input Threshold Voltage vs. VCC Reset Pin as I/O, Read as `0' 2,5 Threshold (V) 2 1,5 1 85 C 25 C -40 C 0,5 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 202 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-40. VIH-VIL: Input Hysteresis vs. VCC Reset Pin as I/O 1 0.9 0.8 -40 C Input Hysteresis (V) 0.7 25 C 0.6 0.5 85 C 0.4 0.3 0.2 0.1 0 1.5 2 2.5 3 3.5 4 4.5 5 5.5 VCC (V) 21.2.9 BOD, Bandgap and Reset Figure 21-41. BOD Threshold vs. Temperature BODLEVEL is 4.3V 4,4 RISING V CC 4,38 Threshold (V) 4,36 4,34 4,32 FALLING VCC 4,3 4,28 4,26 -40 -30 -20 -10 0 10 20 30 40 50 60 70 80 90 100 Temperature (C) 203 8183C-AVR-03/11 Figure 21-42. BOD Threshold vs. Temperature BODLEVEL is 2.7V 2,8 RISING V CC 2,78 Threshold (V) 2,76 2,74 2,72 FALLING VCC 2,7 2,68 -40 -30 -20 -10 0 10 20 30 40 50 60 70 80 90 100 Temperature (C) Figure 21-43. BOD Threshold vs. Temperature BODLEVEL is 1.8V 1,87 1,86 1,85 RISING V CC Threshold (V) 1,84 1,83 1,82 FALLING VCC 1,81 1,8 1,79 1,78 1,77 -40 -30 -20 -10 0 10 20 30 40 50 60 70 80 90 100 Temperature (C) 204 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-44. Bandgap Voltage vs. Supply Voltage 1,2 1,18 1,16 Bandgap Voltage (V) 1,14 1,12 1,1 1,08 1,06 1,04 1,02 1 1,5 2 2,5 3 3,5 4 4,5 5 5,5 Vcc (V) Figure 21-45. Bandgap Voltage vs. Temperature 1,2 1,18 1,16 Bandgap Voltage (V) 1,14 1,12 1,1 1,08 1,06 1,04 1,02 1 -40 -20 0 20 40 60 80 100 Temperature (C) 205 8183C-AVR-03/11 Figure 21-46. VIH: Input Threshold Voltage vs. VCC Reset Pin, Read as `1' 2,5 Threshold (V) 2 1,5 -40 C 25 C 85 C 1 0,5 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) Figure 21-47. VIL: Input Threshold Voltage vs. VCC Reset Pin, Read as `0' 2,5 85 C 25 C -40 C Threshold (V) 2 1,5 1 0,5 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 206 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-48. VIH-VIL: Input Hysteresis vs. VCC Reset Pin 1 0,9 0,8 Input Hysteresis (V) 0,7 -40 C 0,6 0,5 25 C 0,4 0,3 85 C 0,2 0,1 0 1 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) Figure 21-49. Minimum Reset Pulse Width vs. VCC 2000 1800 1600 Pulsewidth (ns) 1400 1200 1000 800 600 400 85 C 25 C -40 C 200 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 207 8183C-AVR-03/11 21.2.10 Analog Comparator Offset Figure 21-50. Analog Comparator Offset VCC = 5V 0.004 0.002 0 Offset (V) 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 -0.002 -0.004 -40 25 -0.006 85 -0.008 VIN (V) 21.2.11 Internal Oscillator Speed Figure 21-51. Watchdog Oscillator Frequency vs. VCC 124 122 -40 C FRC (kHz) 120 25 C 118 116 114 85 C 112 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 208 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-52. Watchdog Oscillator Frequency vs. Temperature 124 122 FRC (kHz) 120 118 1.8 V 116 3.0 V 114 5.5 V 112 -40 -20 0 20 40 60 80 100 Temperature (C) Figure 21-53. Calibrated 8 MHz RC Oscillator Frequency vs. VCC 8,4 85 C 8,2 25 C FRC (MHz) 8 7,8 -40 C 7,6 7,4 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 209 8183C-AVR-03/11 Figure 21-54. Calibrated 8 MHz RC Oscillator Frequency vs. Temperature 8,4 8,3 5.5 V 8,2 3.0 V FRC (MHz) 8,1 1.8 V 8 7,9 7,8 7,7 7,6 7,5 -40 -20 0 20 40 60 80 100 Temperature (C) Figure 21-55. Calibrated 8 MHz RC Oscillator Frequency vs. OSCCAL Value VCC = 3V 20 85 C 25 C -40 C 16 FRC (MHz) 12 8 4 0 0 16 32 48 64 80 96 112 128 144 160 176 192 208 224 240 OSCCAL (X1) 210 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A 21.3 21.3.1 ATtiny44A Current Consumption in Active Mode Figure 21-56. Active Supply Current vs. Low Frequency 0.1 - 1.0 MHz, PRR = 0xFF 1 5.5 V 5.0 V 0.8 4.5 V 0.6 I CC (mA) 4.0 V 3.3 V 0.4 2.7 V 1.8 V 0.2 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Frequency (MHz) Figure 21-57. Active Supply Current vs. frequency 1 - 20 MHz, PRR = 0xFF 12 5.5 V 10 5.0 V 4.5 V I CC (mA) 8 6 4.0 V 4 3.3 V 2.7 V 2 1.8 V 0 0 2 4 6 8 10 12 14 16 18 20 Frequency (MHz) 211 8183C-AVR-03/11 Figure 21-58. Active Supply Current vs. VCC Internal RC Oscillator, 8 MHz 6 85 C 25 C -40 C 5 I CC (mA) 4 3 2 1 0 1.5 2 2.5 3 3.5 4 4.5 5 5.5 V CC (V) Figure 21-59. Active Supply Current vs. VCC Internal RC Oscillator, 1 MHz 1.2 85 C 25 C -40 C 1 I CC (mA) 0.8 0.6 0.4 0.2 0 1.5 2 2.5 3 3.5 4 4.5 5 5.5 V CC (V) 212 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-60. Active Supply Current vs. VCC Internal RC Oscillator, 128 kHz 0.14 -40 C 25 C 85 C 0.12 I CC (mA) 0.1 0.08 0.06 0.04 0.02 0 1.5 2 2.5 3 3.5 4 4.5 5 5.5 V CC (V) 21.3.2 Current Consumption in Idle Mode Figure 21-61. Idle Supply Current vs. Low Frequency 0.1 - 1.0 MHz, PRR = 0xFF 0.2 0.18 5.5 V 0.16 5.0 V 0.14 4.5 V I CC (mA) 0.12 4.0 V 0.1 0.08 3.3 V 0.06 2.7 V 0.04 1.8 V 0.02 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Frequency (MHz) 213 8183C-AVR-03/11 Figure 21-62. Idle Supply Current vs. Frequency 1 - 20 MHz, PRR = 0xFF I CC (mA) 4 3.5 5.5 V 3 5.0 V 2.5 4.5 V 2 4.0 V 1.5 1 3.3 V 0.5 2.7 V 1.8 V 0 0 2 4 6 8 10 12 14 16 18 20 Frequency (MHz) Figure 21-63. Idle Supply Current vs. VCC Internal RC Oscillator, 8 MHz 2 1.8 1.6 85 C 25 C -40 C 1.4 I CC (mA) 1.2 1 0.8 0.6 0.4 0.2 0 1.5 2 2.5 3 3.5 4 4.5 5 5.5 V CC (V) 214 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-64. Idle Supply Current vs. VCC Internal RC Oscillator, 1 MHz 0.4 85 C 25 C -40 C 0.35 0.3 I CC (mA) 0.25 0.2 0.15 0.1 0.05 0 1.5 2 2.5 3 3.5 4 4.5 5 5.5 V CC (V) Figure 21-65. Idle Supply Current vs. VCC Internal RC Oscillator, 128 kHz 0.03 -40 C 25 C 85 C 0.025 I CC (mA) 0.02 0.015 0.01 0.005 0 1.5 2 2.5 3 3.5 4 4.5 5 5.5 V CC (V) 215 8183C-AVR-03/11 21.3.3 Standby Supply Current Figure 21-66. Standby Supply Current vs. VCC 4 MHz External Crystal, 22 pF External Capacitors, Watchdog Timer Disabled 0.1 85 C 0.08 25 C -40 C I CC (mA) 0.06 0.04 0.02 0 1.5 2 2.5 3 3.5 4 4.5 5 5.5 V CC (V) 21.3.4 Current Consumption in Power-down Mode Figure 21-67. Power-down Supply Current vs. VCC Watchdog Timer Disabled 1.4 85 C 1.2 I CC (uA) 1 0.8 0.6 0.4 25 C 0.2 -40 C 0 1.5 2 2.5 3 3.5 4 4.5 5 5.5 V CC (V) 216 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-68. Power-down Supply Current vs. VCC Watchdog Timer Enabled 10 8 -40 C 85 C 25 C I CC (uA) 6 4 2 0 1.5 2 2.5 3 3.5 4 4.5 5 5.5 V CC (V) 21.3.5 Current Consumption in Reset Figure 21-69. Reset Supply Current vs. VCC 0.1 - 1.0 MHz, Excluding Current through Reset Pull-up 0.16 5.5 V 0.14 5.0 V 0.12 4.5 V I CC (mA) 0.1 4.0 V 0.08 3.3 V 0.06 2.7 V 0.04 1.8 V 0.02 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Frequency (MHz) 217 8183C-AVR-03/11 Figure 21-70. Reset Supply Current vs. VCC 1 - 20 MHz, Excluding Current Through Reset Pull-up 3 5.5 V 2.5 5.0 V 4.5 V I CC (mA) 2 1.5 4.0 V 1 3.3 V 0.5 2.7 V 1.8 V 0 0 2 4 6 8 10 12 14 16 18 20 Frequency (MHz) 21.3.6 Current Consumption of Peripheral Units Figure 21-71. ADC Current vs. VCC 4 MHz Frequency 600 500 I CC (uA) 400 300 200 100 0 1.5 2 2.5 3 3.5 4 4.5 5 5.5 V CC (V) 218 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-72. AREF Pin Current vs. Pin Voltage 180 160 AREF pin current (uA) 140 120 100 80 60 40 20 0 1.5 2 2.5 3 3.5 4 4.5 5 5.5 AREF (V) Figure 21-73. Analog Comparator Current vs. VCC 4 MHz Frequency 160 140 120 I CC (uA) 100 80 60 40 20 0 1.5 2 2.5 3 3.5 4 4.5 5 5.5 V CC (V) 219 8183C-AVR-03/11 Figure 21-74. Programming Current vs. VCC 12000 -40 C 10000 I CC (uA) 8000 25 C 6000 85 C 4000 2000 0 1.5 2 2.5 3 3.5 4 4.5 5 5.5 V CC (V) Figure 21-75. Brownout Detector Current vs. VCC BOD Level = 1.8V 35 30 I CC (uA) 25 85 C 25 C -40 C 20 15 10 5 0 1.5 2 2.5 3 3.5 4 4.5 5 5.5 V CC (V) 220 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-76. Watchdog Timer Current vs. VCC 0.008 -40 C 0.007 25 C 85 C 0.006 I CC (mA) 0.005 0.004 0.003 0.002 0.001 0 1.5 2 2.5 3 3.5 4 4.5 5 5.5 V CC (V) 21.3.7 Pull-up Resistors Figure 21-77. Pull-up Resistor Current vs. Input Voltage I/O Pin, VCC = 1.8V 50 40 I OP (uA) 30 20 10 25 C 85 C -40 C 0 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 V OP (V) 221 8183C-AVR-03/11 Figure 21-78. Pull-up Resistor Current vs. Input Voltage I/O Pin, VCC = 2.7V 80 70 60 I OP (uA) 50 40 30 20 10 25 C 85 C -40 C 0 0 0.5 1 1.5 2 2.5 3 V OP (V) Figure 21-79. Pull-up Resistor Current vs. Input Voltage I/O Pin, VCC = 5V 160 140 120 I OP (uA) 100 80 60 40 20 25 C 85 C -40 C 0 0 1 2 3 4 5 V OP (V) 222 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-80. Reset Pull-up Resistor Current vs. Reset Pin Voltage VCC = 1.8V 40 35 30 I RESET (uA) 25 20 15 10 5 85 C 25 C -40 C 0 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 V RESET (V) Figure 21-81. Reset Pull-up Resistor Current vs. Reset Pin Voltage VCC = 2.7V 60 50 I RESET (uA) 40 30 20 10 85 C 25 C -40 C 0 0 0.5 1 1.5 2 2.5 3 V RESET (V) 223 8183C-AVR-03/11 Figure 21-82. Reset Pull-up Resistor Current vs. Reset Pin Voltage VCC = 5V 120 100 I RESET (uA) 80 60 40 20 85 C 25 C -40 C 0 0 1 2 3 4 5 V RESET (V) 21.3.8 Output Driver Strength Figure 21-83. VOL: Output Voltage vs. Sink Current I/O Pin, VCC = 3V 1.2 1 85 C 0.8 V OL (V) 25 C 0.6 -40 C 0.4 0.2 0 0 5 10 15 20 I OL (mA) 224 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-84. VOL: Output Voltage vs. Sink Current I/O Pin, VCC = 5V 0.7 0.6 85 C 0.5 V OL (V) 25 C 0.4 -40 C 0.3 0.2 0.1 0 0 5 10 15 20 I OL (mA) Figure 21-85. VOH: Output Voltage vs. Source Current I/O Pin, VCC = 3V 3.2 3 V OH (V) 2.8 2.6 2.4 -40 C 2.2 25 C 2 85 C 1.8 0 5 10 15 20 I OH (mA) 225 8183C-AVR-03/11 Figure 21-86. VOH: Output Voltage vs. Source Current I/O Pin, VCC = 5V 5.2 5 V OH (V) 4.8 4.6 -40 C 25 C 4.4 85 C 4.2 0 5 10 15 20 I OH (mA) Figure 21-87. VOL: Output Voltage vs. Sink Current Reset Pin as I/O, VCC = 3V 1.4 1.2 85 C V OL (V) 1 25 C 0.8 0.6 -40 C 0.4 0.2 0 0 0.5 1 1.5 2 2.5 3 I OL (mA) 226 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-88. VOL: Output Voltage vs. Sink Current Reset Pin as I/O, VCC = 5V 2 85 C 1.8 1.6 1.4 25 C V OL (V) 1.2 1 -40 C 0.8 0.6 0.4 0.2 0 0 1 2 3 4 5 6 7 8 I OL (mA) Figure 21-89. VOH: Output Voltage vs. Source Current Reset Pin as I/O, VCC = 3V 3 2.5 V OH (V) 2 1.5 -40 C 1 25 C 85 C 0.5 0 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 I OH (mA) 227 8183C-AVR-03/11 Figure 21-90. VOH: Output Voltage vs. Source Current Reset Pin as I/O, VCC = 5V 5 4.5 4 3.5 V OH (V) 3 -40 C 25 C 85 C 2.5 2 1.5 1 0.5 0 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 I OH (mA) 21.3.9 Input Threshold and Hysteresis (for I/O Ports) Figure 21-91. VIH: Input Threshold Voltage vs. VCC IO Pin, Read as `1' 3.5 -40 C 25 C 85 C 3 Threshold (V) 2.5 2 1.5 1 0.5 0 1.5 2 2.5 3 3.5 4 4.5 5 5.5 V CC (V) 228 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-92. VIL: Input Threshold Voltage vs. VCC I/O Pin, Read as `0' 2.5 85 C 25 C -40 C Threshold (V) 2 1.5 1 0.5 0 1.5 2 2.5 3 3.5 4 4.5 5 5.5 V CC (V) Figure 21-93. VIH-VIL: Input Hysteresis vs. VCC I/O Pin 0.8 0.7 Input Hysteresis (V) 0.6 -40 C 25 C 85 C 0.5 0.4 0.3 0.2 0.1 0 1.5 2 2.5 3 3.5 4 4.5 5 5.5 V CC (V) 229 8183C-AVR-03/11 Figure 21-94. VIH: Input Threshold Voltage vs. VCC Reset Pin as I/O, Read as `1' 3 -40 C 25 C 85 C 2.5 Threshold (V) 2 1.5 1 0.5 0 1.5 2 2.5 3 3.5 4 4.5 5 5.5 V CC (V) Figure 21-95. VIL: Input Threshold Voltage vs. VCC Reset Pin as I/O, Read as `0' 2.5 85 C 25 C -40 C Threshold (V) 2 1.5 1 0.5 0 1.5 2 2.5 3 3.5 4 4.5 5 5.5 V CC (V) 230 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-96. VIH-VIL: Input Hysteresis vs. VCC Reset Pin as I/O 1 0.9 0.8 -40 C Input Hysteresis (V) 0.7 0.6 25 C 0.5 85 C 0.4 0.3 0.2 0.1 0 1.5 2 2.5 3 3.5 4 4.5 5 5.5 V CC (V) 21.3.10 BOD, Bandgap and Reset Figure 21-97. BOD Threshold vs. Temperature BODLEVEL is 4.3V 4.36 4.34 4.32 RISING VCC Threshold (V) 4.3 4.28 4.26 4.24 FALLING VCC 4.22 4.2 -40 -20 0 20 40 60 80 100 Temperature (C) 231 8183C-AVR-03/11 Figure 21-98. BOD Threshold vs. Temperature BODLEVEL is 2.7V 2.78 2.76 2.74 Threshold (V) RISING VCC 2.72 2.7 2.68 FALLING VCC 2.66 2.64 -40 -20 0 20 40 60 80 100 Temperature (C) Figure 21-99. BOD Threshold vs. Temperature BODLEVEL is 1.8V 1.84 1.83 Threshold (V) 1.82 RISING VCC 1.81 1.8 1.79 1.78 FALLING VCC 1.77 -40 -20 0 20 40 60 80 100 Temperature (C) 232 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-100. Bandgap Voltage vs. Supply Voltage 1.2 1.18 1.16 Bandgap Voltage (V) 1.14 1.12 1.1 1.08 1.06 1.04 1.02 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 V CC (V) Figure 21-101. Bandgap Voltage vs. Temperature 1.2 1.18 1.16 Bandgap Voltage (V) 1.14 1.12 1.1 1.08 1.06 1.04 1.02 1 -40 -20 0 20 40 60 80 100 Temperature (C) 233 8183C-AVR-03/11 Figure 21-102. VIH: Input Threshold Voltage vs. VCC Reset Pin, Read as `1' 2,5 Threshold (V) 2 1,5 -40 C 25 C 85 C 1 0,5 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) Figure 21-103. VIL: Input Threshold Voltage vs. VCC Reset Pin, Read as `0' 2,5 85 C 25 C -40 C Threshold (V) 2 1,5 1 0,5 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 234 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-104. VIH-VIL: Input Hysteresis vs. VCC Reset Pin 1 0.9 0.8 Input Hysteresis (V) 0.7 0.6 -40 C 0.5 25 C 0.4 0.3 85 C 0.2 0.1 0 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 V CC (V) Figure 21-105. Minimum Reset Pulse Width vs. VCC 2000 1800 1600 Pulsewidth (ns) 1400 1200 1000 800 600 400 85 C 25 C -40 C 200 0 1.5 2 2.5 3 3.5 4 4.5 5 5.5 V CC (V) 235 8183C-AVR-03/11 21.3.11 Analog Comparator Offset Figure 21-106. Analog Comparator Offset VCC = 5V 0.004 0.003 0.002 0.001 0 Offset (V) 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 -0.001 -0.002 -0.003 -0.004 -40 25 -0.005 85 -0.006 -0.007 VIN (V) 21.3.12 Internal Oscillator Speed Figure 21-107. Watchdog Oscillator Frequency vs. VCC 0.12 0.118 -40 C Frequency (MHz) 0.116 25 C 0.114 0.112 0.11 85 C 0.108 1.5 2 2.5 3 3.5 4 4.5 5 5.5 V CC (V) 236 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-108. Watchdog Oscillator Frequency vs. Temperature 0.12 0.118 Frequency (MHz) 0.116 0.114 1.8 V 0.112 3.0 V 0.11 5.5 V 0.108 0.106 -40 -20 0 20 40 60 80 100 Temperature (C) Figure 21-109. Calibrated 8 MHz RC Oscillator Frequency vs. VCC 8.4 8.2 Frequency (MHz) 85 C 25 C 8 -40 C 7.8 7.6 7.4 1.5 2 2.5 3 3.5 4 4.5 5 5.5 V CC (V) 237 8183C-AVR-03/11 Figure 21-110. Calibrated 8 MHz RC oscillator Frequency vs. Temperature 8.2 5.0 V 3.0 V 8.1 8 Frequency (MHz) 1.8 V 7.9 7.8 7.7 7.6 7.5 -40 -20 0 20 40 60 80 100 Temperature (C) Figure 21-111. Calibrated 8 MHz RC Oscillator Frequency vs. OSCCAL Value VCC = 3V 16 85 C 25 C -40 C 14 Frequency (MHz) 12 10 8 6 4 2 0 0 16 32 48 64 80 96 112 128 144 160 176 192 208 224 240 OSCCAL (X1) 238 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A 21.4 21.4.1 ATtiny84A Current Consumption in Active Mode Figure 21-112. Active Supply Current vs. Low Frequency 0.1 - 1.0 MHz, PRR = 0xFF 1 5.5 V 0,8 5.0 V 4.5 V 0,6 ICC (mA) 4.0 V 3.3 V 0,4 2.7 V 0,2 1.8 V 0 0 0,1 0,2 0,3 0,4 0,5 0,6 0,7 0,8 0,9 1 Frequency (MHz) Figure 21-113. Active Supply Current vs. Frequency 1 - 20 MHz, PRR = 0xFF 12 10 5.5 V 5.0 V 8 ICC (mA) 4.5 V 6 4.0 V 4 3.3 V 2.7 V 2 1.8 V 0 0 2 4 6 8 10 12 14 16 18 20 Frequency (MHz) 239 8183C-AVR-03/11 Figure 21-114. Active Supply Current vs. VCC Internal RC Oscillator, 8 MHz 5 85 C 25 C -40 C 4,5 4 3,5 ICC (mA) 3 2,5 2 1,5 1 0,5 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) Figure 21-115. Active Supply Current vs. VCC Internal RC Oscillator, 1 MHz 1,4 1,2 85 C 25 C -40 C 1 ICC (mA) 0,8 0,6 0,4 0,2 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 240 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-116. Active Supply Current vs. VCC Internal RC Oscillator, 128 kHz 0,14 0,12 -40 C 25 C 85 C 0,1 ICC (mA) 0,08 0,06 0,04 0,02 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 21.4.2 Current Consumption in Idle Mode Figure 21-117. Idle Supply Current vs. Low Frequency 0.1 - 1.0 MHz, PRR = 0xFF 0,14 5.5 V 0,12 5.0 V 0,1 4.5 V 4.0 V 0,06 3.3 V ICC (mA) 0,08 2.7 V 0,04 1.8 V 0,02 0 0 0,1 0,2 0,3 0,4 0,5 0,6 0,7 0,8 0,9 1 Frequency (MHz) 241 8183C-AVR-03/11 Figure 21-118. Idle Supply Current vs. Frequency 1 - 20 MHz, PRR = 0xFF 4 3,5 3 5.5 V ICC (mA) 2,5 5.0 V 2 4.5 V 1,5 4.0 V 1 3.3 V 0,5 2.7 V 1.8 V 0 0 2 4 6 8 10 12 14 16 18 20 Frequency (MHz) Figure 21-119. Idle Supply Current vs. VCC Internal RC Oscillator, 8 MHz 2 1,8 1,6 1,4 85 C 25 C -40 C ICC (mA) 1,2 1 0,8 0,6 0,4 0,2 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 242 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-120. Idle Supply Current vs. VCC Internal RC Oscillator, 1 MHz 0,4 0,35 0,3 85 C 25 C -40 C ICC (mA) 0,25 0,2 0,15 0,1 0,05 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) Figure 21-121. Idle Supply Current vs. VCC Internal RC Oscillator, 128 kHz 0,03 0,025 -40 C 25 C 85 C ICC (mA) 0,02 0,015 0,01 0,005 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 243 8183C-AVR-03/11 21.4.3 Current Consumption in Power-down Mode Figure 21-122. Power-down Supply Current vs. VCC Watchdog Timer Disabled 1,6 1,4 85 C 1,2 ICC (uA) 1 0,8 0,6 0,4 25 C 0,2 -40 C 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 4 4,5 5 5,5 VCC (V) Figure 21-123. Power-down Supply Current vs. VCC Watchdog Timer Enabled 10 8 ICC (uA) 6 -40 C 4 25 C 85 C 2 0 1,5 2 2,5 3 3,5 VCC (V) 244 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A 21.4.4 Current Consumption in Reset Figure 21-124. Reset Supply Current vs. VCC 0.1 - 1.0 MHz, Excluding Current through Reset Pull-up 0,16 0,14 0,12 5.5 V ICC (mA) 0,1 5.0 V 4.5 V 0,08 4.0 V 0,06 3.3 V 2.7 V 0,04 1.8 V 0,02 0 0 0,1 0,2 0,3 0,4 0,5 0,6 0,7 0,8 0,9 1 Frequency (MHz) Figure 21-125. Reset Supply Current vs. VCC 1 - 20 MHz, Excluding Current through Reset Pull-up 3 2,5 ICC (mA) 2 5.5 V 5.0 V 1,5 4.5 V 4.0 V 1 3.3 V 0,5 2.7 V 1.8 V 0 0 2 4 6 8 10 12 14 16 18 20 Frequency (MHz) 245 8183C-AVR-03/11 21.4.5 Current Consumption of Peripheral Units Figure 21-126. ADC Current vs. VCC 4 MHz Frequency 600 500 ICC (uA) 400 300 200 100 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 4 4,5 5 5,5 VCC (V) Figure 21-127. AREF Pin Current vs. Pin Voltage 160 140 AREF pin current (uA) 120 100 80 60 40 20 0 1,5 2 2,5 3 3,5 AREF (V) 246 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-128. Analog Comparator Current vs. VCC 4 MHz Frequency 160 140 120 ICC (uA) 100 80 60 40 20 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) Figure 21-129. Programming Current vs. VCC 7000 6000 -40 C 5000 25 C ICC (uA) 4000 85 C 3000 2000 1000 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 247 8183C-AVR-03/11 Figure 21-130. Brownout Detector Current vs. VCC BOD Level = 1.8V 45 40 35 ICC (uA) 30 25 85 C 25 C -40 C 20 15 10 5 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 21.4.6 Pull-up Resistors Figure 21-131. Pull-up Resistor Current vs. Input Voltage I/O Pin, VCC = 1.8V 60 50 IOP (uA) 40 30 20 10 25 C -40 C 85 C 0 0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6 1,8 2 VOP (V) 248 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-132. Pull-up Resistor Current vs. Input Voltage I/O Pin, VCC = 2.7V 80 70 60 IOP (uA) 50 40 30 20 10 25 C 85 C -40 C 0 0 0,5 1 1,5 2 2,5 3 VOP (V) Figure 21-133. Pull-up Resistor Current vs. Input Voltage I/O Pin, VCC = 5V 160 140 120 IOP (uA) 100 80 60 40 20 25 C 85 C -40 C 0 0 1 2 3 4 5 6 VOP (V) 249 8183C-AVR-03/11 Figure 21-134. Reset Pull-up Resistor Current vs. Reset Pin Voltage VCC = 1.8V 40 35 30 IRESET (uA) 25 20 15 10 5 25 C -40 C 85 C 0 0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6 1,8 2 VRESET (V) Figure 21-135. Reset Pull-up Resistor Current vs. Reset Pin Voltage VCC = 2.7V 60 50 IRESET (uA) 40 30 20 10 25 C -40 C 85 C 0 0 0,5 1 1,5 2 2,5 3 VRESET (V) 250 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-136. Reset Pull-up Resistor Current vs. Reset Pin Voltage VCC = 5V 120 100 IRESET (uA) 80 60 40 20 25 C -40 C 85 C 0 0 0,5 1 1,5 2 2,5 3 3,5 4 4,5 5 VRESET (V) 21.4.7 Output Driver Strength Figure 21-137. VOL: Output Voltage vs. Sink Current I/O Pin, VCC = 3V 1,2 1 85 C 0,8 VOL (V) 25 C -40 C 0,6 0,4 0,2 0 0 2 4 6 8 10 12 14 16 18 20 IOL (mA) 251 8183C-AVR-03/11 Figure 21-138. VOL: Output Voltage vs. Sink Current I/O Pin, VCC = 5V 0,7 0,6 85 C 0,5 25 C -40 C VOL (V) 0,4 0,3 0,2 0,1 0 0 2 4 6 8 10 12 14 16 18 20 IOL (mA) Figure 21-139. VOH: Output Voltage vs. Source Current I/O Pin, VCC = 3V 3,2 3 2,8 VOH (V) 2,6 2,4 -40 C 25 C 2,2 85 C 2 1,8 0 2 4 6 8 10 12 14 16 18 20 IOH (mA) 252 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-140. VOH: Output Voltage vs. Source Current I/O Pin, VCC = 5V 5,2 5 VOH (V) 4,8 4,6 -40 C 25 C 4,4 85 C 4,2 0 2 4 6 8 10 12 14 16 18 20 IOH (mA) Figure 21-141. VOL: Output Voltage vs. Sink Current Reset Pin as I/O, VCC = 3V 1,4 1,2 85 C 1 25 C VOL (V) 0,8 -40 C 0,6 0,4 0,2 0 0 0,5 1 1,5 2 2,5 3 IOL (mA) 253 8183C-AVR-03/11 Figure 21-142. VOL: Output Voltage vs. Sink Current Reset Pin as I/O, VCC = 5V 2 85 C 1,8 1,6 25 C 1,4 VOL (V) 1,2 -40 C 1 0,8 0,6 0,4 0,2 0 0 1 2 3 4 5 6 7 8 IOL (mA) Figure 21-143. VOH: Output Voltage vs. Source Current Reset Pin as I/O, VCC = 3V 3 2,5 VOH (V) 2 1,5 -40 C 1 25 C 85 C 0,5 0 0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6 1,8 2 IOH (mA) 254 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-144. VOH: Output Voltage vs. Source Current Reset Pin as I/O, VCC = 5V 5 4,5 4 3,5 VOH (V) 3 -40 C 25 C 85 C 2,5 2 1,5 1 0,5 0 0 0,2 0,4 0,6 0,8 1 1,2 1,4 1,6 1,8 2 IOH (mA) 21.4.8 Input Threshold and Hysteresis (for I/O Ports) Figure 21-145. VIH: Input Threshold Voltage vs. VCC I/O Pin, Read as `1' 3,5 85 C 25 C -40 C 3 Threshold (V) 2,5 2 1,5 1 0,5 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 255 8183C-AVR-03/11 Figure 21-146. VIL: Input Threshold Voltage vs. VCC I/O Pin, Read as `0' 2,5 85 C 25 C -40 C Threshold (V) 2 1,5 1 0,5 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) Figure 21-147. VIH-VIL: Input Hysteresis vs. VCC I/O Pin 0,6 -40 C 0,5 25 C Input Hysteresis (V) 0,4 85 C 0,3 0,2 0,1 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 256 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-148. VIH: Input Threshold Voltage vs. VCC Reset Pin as I/O, Read as `1' 3 25 C 85 C -40 C 2,5 Threshold (V) 2 1,5 1 0,5 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) Figure 21-149. VIL: Input Threshold Voltage vs. VCC Reset Pin as I/O, Read as `0' 2,5 85 C 25 C -40 C Threshold (V) 2 1,5 1 0,5 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 257 8183C-AVR-03/11 Figure 21-150. VIH-VIL: Input Hysteresis vs. VCC Reset Pin as I/O 1 0,9 0,8 Input Hysteresis (V) 0,7 85 C 0,6 25 C 0,5 -40 C 0,4 0,3 0,2 0,1 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 21.4.9 BOD, Bandgap and Reset Figure 21-151. BOD Threshold vs. Temperature BODLEVEL is 4.3V 4,42 RISING VCC 4,4 4,38 Threshold (V) 4,36 4,34 FALLING VCC 4,32 4,3 4,28 4,26 4,24 -40 -20 0 20 40 60 80 100 Temperature (C) 258 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-152. BOD Threshold vs. Temperature BODLEVEL is 2.7V 2,82 2,8 RISING VCC 2,78 Threshold (V) 2,76 2,74 FALLING VCC 2,72 2,7 2,68 2,66 -40 -20 0 20 40 60 80 100 Temperature (C) Figure 21-153. Bandgap Voltage vs. Supply Voltage 1,2 1,18 1,16 Bandgap Voltage (V) 1,14 1,12 1,1 1,08 1,06 1,04 1,02 1 1,5 2 2,5 3 3,5 4 4,5 5 5,5 Vcc (V) 259 8183C-AVR-03/11 Figure 21-154. Bandgap Voltage vs. Temperature 1,2 1,18 1,16 Bandgap Voltage (V) 1,14 1,12 1,1 1,08 1,06 1,04 1,02 1 -40 -20 0 20 40 60 80 100 Temperature (C) Figure 21-155. VIH: Input Threshold Voltage vs. VCC Reset Pin, Read as `1' 2,5 Threshold (V) 2 1,5 1 -40 C 25 C 85 C 0,5 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 260 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-156. VIL: Input Threshold Voltage vs. VCC Reset Pin, Read as `0' 2,5 85 C 25 C -40 C Threshold (V) 2 1,5 1 0,5 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 4 4,5 5 5,5 VCC (V) Figure 21-157. VIH-VIL: Input Hysteresis vs. VCC Reset Pin 1 0,9 0,8 Input Hysteresis (V) 0,7 0,6 -40 C 0,5 25 C 0,4 0,3 85 C 0,2 0,1 0 1,5 2 2,5 3 3,5 VCC (V) 261 8183C-AVR-03/11 Figure 21-158. Minimum Reset Pulse Width vs. VCC 2000 1800 1600 Pulsewidth (ns) 1400 1200 1000 800 600 400 85 C 25 C -40 C 200 0 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) 21.4.10 Analog Comparator Offset Figure 21-159. Analog Comparator Offset VCC = 5V 0.004 0.002 0 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 Offset (V) -0.002 -0.004 -0.006 -40 25 -0.008 85 -0.01 -0.012 Vin (V) 262 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A 21.4.11 Internal Oscillator Speed Figure 21-160. Watchdog Oscillator Frequency vs. VCC 120 118 116 FRC (kHz) -40 C 114 25 C 112 110 85 C 108 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) Figure 21-161. Watchdog Oscillator Frequency vs. Temperature 120 118 FRC (kHz) 116 114 112 1.8 V 3.0 V 110 5.5 V 108 106 -40 -20 0 20 40 60 80 100 Temperature (C) 263 8183C-AVR-03/11 Figure 21-162. Calibrated 8 MHz RC Oscillator Frequency vs. VCC 8,4 8,3 85 C 8,2 25 C 8,1 -40 C FRC (MHz) 8 7,9 7,8 7,7 7,6 7,5 7,4 1,5 2 2,5 3 3,5 4 4,5 5 5,5 VCC (V) Figure 21-163. Calibrated 8 MHz RC Oscillator Frequency vs. Temperature 8,4 8,3 8,2 5.0 V 8,1 FRC (MHz) 3.0 V 8 1.8 V 7,9 7,8 7,7 7,6 7,5 -40 -20 0 20 40 60 80 100 Temperature (C) 264 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Figure 21-164. Calibrated 8 MHz RC Oscillator Frequency vs. OSCCAL Value VCC = 3V 16 14 85 C 25 C -40 C 12 FRC (MHz) 10 8 6 4 2 0 0 16 32 48 64 80 96 112 128 144 160 176 192 208 224 240 OSCCAL (X1) 265 8183C-AVR-03/11 22. Register Summary Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Page 0x3F (0x5F) SREG I T H S V N Z C Page 14 - - - - SP9 SP8 Page 13 SP1 SP0 0x3E (0x5E) SPH - - 0x3D (0x5D) SPL SP7 SP6 0x3C (0x5C) OCR0B 0x3B (0x5B) GIMSK - INT0 PCIE1 PCIE0 - - - - Page 50 0x3A (0x5A) GIFR - INTF0 PCIF1 PCIF0 - - - - Page 51 0x39 (0x59) TIMSK0 - - - - - OCIE0B OCIE0A TOIE0 Page 83 0x38 (0x58) TIFR0 - - - - - OCF0B OCF0A TOV0 Page 84 0x37 (0x57) SPMCSR - - RSIG CTPB RFLB PGWRT Timer/Counter0 - Output Compare Register A PGERS SPMEN Page 156 BODS PUD SE SM1 0x36 (0x56) OCR0A 0x35 (0x55) MCUCR SP5 SP4 SP3 SP2 Timer/Counter0 - Output Compare Register B Page 13 Page 83 Page 83 SM0 BODSE ISC01 ISC00 Pages 36, 50, 66 0x34 (0x54) MCUSR - - - - WDRF BORF EXTRF PORF Page 44 0x33 (0x53) TCCR0B FOC0A FOC0B - - WGM02 CS02 CS01 CS00 Page 82 0x32 (0x52) TCNT0 0x31 (0x51) OSCCAL Page 31 Timer/Counter0 CAL7 Page 83 CAL6 CAL5 CAL4 CAL3 CAL2 CAL1 CAL0 0x30 (0x50) TCCR0A COM0A1 COM0A0 COM0B1 COM0B0 - - WGM01 WGM00 Page 79 0x2F (0x4F) TCCR1A COM1A1 COM1A0 COM1B1 COM1B0 - - WGM11 WGM10 Page 106 ICNC1 ICES1 - WGM13 WGM12 CS12 CS11 CS10 Page 108 0x2E (0x4E) TCCR1B 0x2D (0x4D) TCNT1H Timer/Counter1 - Counter Register High Byte Page 110 0x2C (0x4C) TCNT1L Timer/Counter1 - Counter Register Low Byte Page 110 0x2B (0x4B) OCR1AH Timer/Counter1 - Compare Register A High Byte Page 110 0x2A (0x4A) OCR1AL Timer/Counter1 - Compare Register A Low Byte Page 110 0x29 (0x49) OCR1BH Timer/Counter1 - Compare Register B High Byte Page 110 0x28 (0x48) OCR1BL Timer/Counter1 - Compare Register B Low Byte Page 110 0x27 (0x47) DWDR 0x26 (0x46) CLKPR 0x25 (0x45) ICR1H DWDR[7:0] CLKPCE - - - Page 151 CLKPS3 CLKPS2 CLKPS1 CLKPS0 Timer/Counter1 - Input Capture Register High Byte Page 31 Page 111 0x24 (0x44) ICR1L 0x23 (0x43) GTCCR TSM - Timer/Counter1 - Input Capture Register Low Byte - - - - - PSR10 Page 111 Page 114 0x22 (0x42) TCCR1C FOC1A FOC1B - - - - - - Page 109 0x21 (0x41) WDTCSR WDIF WDIE WDP3 WDCE WDE WDP2 WDP1 WDP0 Page 44 0x20 (0x40) PCMSK1 - - - - PCINT11 PCINT10 PCINT9 PCINT8 Page 51 Page 20 0x1F (0x3F) EEARH - - - - - - - EEAR8 0x1E (0x3E) EEARL EEAR7 EEAR6 EEAR5 EEAR4 EEAR3 EEAR2 EEAR1 EEAR0 0x1D (0x3D) EEDR EEPROM Data Register Page 21 Page 21 0x1C (0x3C) EECR - - EEPM1 EEPM0 EERIE EEMPE EEPE EERE Page 23 0x1B (0x3B) PORTA PORTA7 PORTA6 PORTA5 PORTA4 PORTA3 PORTA2 PORTA1 PORTA0 Page 66 0x1A (0x3A) DDRA DDA7 DDA6 DDA5 DDA4 DDA3 DDA2 DDA1 DDA0 Page 66 0x19 (0x39) PINA PINA7 PINA6 PINA5 PINA4 PINA3 PINA2 PINA1 PINA0 Page 67 0x18 (0x38) PORTB - - - - PORTB3 PORTB2 PORTB1 PORTB0 Page 67 0x17 (0x37) DDRB - - - - DDB3 DDB2 DDB1 DDB0 Page 67 0x16 (0x36) PINB - - - - PINB3 PINB2 PINB1 PINB0 0x15 (0x35) GPIOR2 General Purpose I/O Register 2 Page 22 0x14 (0x34) GPIOR1 General Purpose I/O Register 1 Page 23 0x13 (0x33) GPIOR0 General Purpose I/O Register 0 0x12 (0x32) PCMSK0 0x11 (0x31)) Reserved - 0x10 (0x30) USIBR USI Buffer Register Page 127 0x0F (0x2F) USIDR USI Data Register Page 126 PCINT7 PCINT6 PCINT5 PCINT4 PCINT3 Page 67 Page 23 PCINT2 PCINT1 PCINT0 Page 52 0x0E (0x2E) USISR USISIF USIOIF USIPF USIDC USICNT3 USICNT2 USICNT1 USICNT0 Page 125 0x0D (0x2D) USICR USISIE USIOIE USIWM1 USIWM0 USICS1 USICS0 USICLK USITC Page 123 0x0C (0x2C) TIMSK1 - - ICIE1 - - OCIE1B OCIE1A TOIE1 Page 111 0x0B (0x2B) TIFR1 - - ICF1 - - OCF1B OCF1A TOV1 Page 112 0x0A (0x2A) Reserved 0x09 (0x29) Reserved 0x08 (0x28) ACSR ACD ACBG ACO ACI ACIE ACIC ACIS1 ACIS0 Page 129 0x07 (0x27) ADMUX REFS1 REFS0 MUX5 MUX4 MUX3 MUX2 MUX1 MUX0 Page 144 0x06 (0x26) ADCSRA ADEN ADSC ADATE ADIF ADIE ADPS2 ADPS1 ADPS0 0x05 (0x25) ADCH 0x04 (0x24) ADCL 0x03 (0x23) ADCSRB - - ADC Data Register High Byte ADC Data Register Low Byte BIN ACME - ADLAR - Page 146 Page 148 Page 148 ADTS2 ADTS1 ADTS0 Pages 130, 148 - 0x02 (0x22) Reserved 0x01 (0x21) DIDR0 ADC7D ADC6D ADC5D ADC4D ADC3D ADC2D ADC1D ADC0D Pages 131, 149 0x00 (0x20) PRR - - - - PRTIM1 PRTIM0 PRUSI PRADC Page 37 266 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Note: 1. For compatibility with future devices, reserved bits should be written to zero if accessed. Reserved I/O memory addresses should never be written. 2. I/O Registers within the address range 0x00 - 0x1F are directly bit-accessible using the SBI and CBI instructions. In these registers, the value of single bits can be checked by using the SBIS and SBIC instructions. 3. Some of the Status Flags are cleared by writing a logical one to them. Note that, unlike most other AVRs, the CBI and SBI instructions will only operation the specified bit, and can therefore be used on registers containing such Status Flags. The CBI and SBI instructions work with registers 0x00 to 0x1F only. 267 8183C-AVR-03/11 23. Instruction Set Summary Mnemonics Operands Description Operation Flags #Clocks ARITHMETIC AND LOGIC INSTRUCTIONS ADD Rd, Rr Add two Registers Rd Rd + Rr Z,C,N,V,H ADC Rd, Rr Add with Carry two Registers Rd Rd + Rr + C Z,C,N,V,H 1 ADIW Rdl,K Add Immediate to Word Rdh:Rdl Rdh:Rdl + K Z,C,N,V,S 2 1 SUB Rd, Rr Subtract two Registers Rd Rd - Rr Z,C,N,V,H 1 SUBI Rd, K Subtract Constant from Register Rd Rd - K Z,C,N,V,H 1 SBC Rd, Rr Subtract with Carry two Registers Rd Rd - Rr - C Z,C,N,V,H 1 SBCI Rd, K Subtract with Carry Constant from Reg. Rd Rd - K - C Z,C,N,V,H 1 SBIW Rdl,K Subtract Immediate from Word Rdh:Rdl Rdh:Rdl - K Z,C,N,V,S 2 AND Rd, Rr Logical AND Registers Rd Rd * Rr Z,N,V 1 ANDI Rd, K Logical AND Register and Constant Rd Rd * K Z,N,V 1 OR Rd, Rr Logical OR Registers Rd Rd v Rr Z,N,V 1 ORI Rd, K Logical OR Register and Constant Rd Rd v K Z,N,V 1 EOR Rd, Rr Exclusive OR Registers Rd Rd Rr Z,N,V 1 COM Rd One's Complement Rd 0xFF - Rd Z,C,N,V 1 NEG Rd Two's Complement Rd 0x00 - Rd Z,C,N,V,H 1 SBR Rd,K Set Bit(s) in Register Rd Rd v K Z,N,V 1 CBR Rd,K Clear Bit(s) in Register Rd Rd * (0xFF - K) Z,N,V 1 INC Rd Increment Rd Rd + 1 Z,N,V 1 DEC Rd Decrement Rd Rd - 1 Z,N,V 1 TST Rd Test for Zero or Minus Rd Rd * Rd Z,N,V 1 CLR Rd Clear Register Rd Rd Rd Z,N,V 1 SER Rd Set Register Rd 0xFF None 1 2 BRANCH INSTRUCTIONS Relative Jump PC PC + k + 1 None Indirect Jump to (Z) PC Z None 2 Relative Subroutine Call PC PC + k + 1 None 3 ICALL Indirect Call to (Z) PC Z None 3 RET Subroutine Return PC STACK None 4 RETI Interrupt Return PC STACK I 4 RJMP k IJMP RCALL k CPSE Rd,Rr Compare, Skip if Equal if (Rd = Rr) PC PC + 2 or 3 None CP Rd,Rr Compare Rd - Rr Z, N,V,C,H 1 CPC Rd,Rr Compare with Carry Rd - Rr - C Z, N,V,C,H 1 CPI Rd,K Compare Register with Immediate Rd - K Z, N,V,C,H SBRC Rr, b Skip if Bit in Register Cleared if (Rr(b)=0) PC PC + 2 or 3 None 1/2/3 1/2/3 1 SBRS Rr, b Skip if Bit in Register is Set if (Rr(b)=1) PC PC + 2 or 3 None 1/2/3 SBIC P, b Skip if Bit in I/O Register Cleared if (P(b)=0) PC PC + 2 or 3 None 1/2/3 SBIS P, b Skip if Bit in I/O Register is Set if (P(b)=1) PC PC + 2 or 3 None 1/2/3 BRBS s, k Branch if Status Flag Set if (SREG(s) = 1) then PCPC+k + 1 None 1/2 BRBC s, k Branch if Status Flag Cleared if (SREG(s) = 0) then PCPC+k + 1 None 1/2 BREQ k Branch if Equal if (Z = 1) then PC PC + k + 1 None 1/2 BRNE k Branch if Not Equal if (Z = 0) then PC PC + k + 1 None 1/2 BRCS k Branch if Carry Set if (C = 1) then PC PC + k + 1 None 1/2 BRCC k Branch if Carry Cleared if (C = 0) then PC PC + k + 1 None 1/2 BRSH k Branch if Same or Higher if (C = 0) then PC PC + k + 1 None 1/2 BRLO k Branch if Lower if (C = 1) then PC PC + k + 1 None 1/2 BRMI k Branch if Minus if (N = 1) then PC PC + k + 1 None 1/2 BRPL k Branch if Plus if (N = 0) then PC PC + k + 1 None 1/2 BRGE k Branch if Greater or Equal, Signed if (N V= 0) then PC PC + k + 1 None 1/2 BRLT k Branch if Less Than Zero, Signed if (N V= 1) then PC PC + k + 1 None 1/2 BRHS k Branch if Half Carry Flag Set if (H = 1) then PC PC + k + 1 None 1/2 BRHC k Branch if Half Carry Flag Cleared if (H = 0) then PC PC + k + 1 None 1/2 BRTS k Branch if T Flag Set if (T = 1) then PC PC + k + 1 None 1/2 BRTC k Branch if T Flag Cleared if (T = 0) then PC PC + k + 1 None 1/2 BRVS k Branch if Overflow Flag is Set if (V = 1) then PC PC + k + 1 None 1/2 BRVC k Branch if Overflow Flag is Cleared if (V = 0) then PC PC + k + 1 None 1/2 BRIE k Branch if Interrupt Enabled if ( I = 1) then PC PC + k + 1 None 1/2 BRID k Branch if Interrupt Disabled if ( I = 0) then PC PC + k + 1 None 1/2 BIT AND BIT-TEST INSTRUCTIONS SBI P,b Set Bit in I/O Register I/O(P,b) 1 None 2 CBI P,b Clear Bit in I/O Register I/O(P,b) 0 None 2 LSL Rd Logical Shift Left Rd(n+1) Rd(n), Rd(0) 0 Z,C,N,V 1 LSR Rd Logical Shift Right Rd(n) Rd(n+1), Rd(7) 0 Z,C,N,V 1 ROL Rd Rotate Left Through Carry Rd(0)C,Rd(n+1) Rd(n),CRd(7) Z,C,N,V 1 268 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Mnemonics Operands Description Operation Flags #Clocks ROR Rd Rotate Right Through Carry Rd(7)C,Rd(n) Rd(n+1),CRd(0) Z,C,N,V 1 ASR Rd Arithmetic Shift Right Rd(n) Rd(n+1), n=0..6 Z,C,N,V 1 SWAP Rd Swap Nibbles Rd(3..0)Rd(7..4),Rd(7..4)Rd(3..0) None 1 BSET s Flag Set SREG(s) 1 SREG(s) 1 BCLR s Flag Clear SREG(s) 0 SREG(s) 1 BST Rr, b Bit Store from Register to T T Rr(b) T 1 BLD Rd, b 1 Bit load from T to Register Rd(b) T None SEC Set Carry C1 C 1 CLC Clear Carry C0 C 1 SEN Set Negative Flag N1 N 1 CLN Clear Negative Flag N0 N 1 SEZ Set Zero Flag Z1 Z 1 CLZ Clear Zero Flag Z0 Z 1 SEI Global Interrupt Enable I1 I 1 CLI Global Interrupt Disable I0 I 1 SES Set Signed Test Flag S1 S 1 CLS Clear Signed Test Flag S0 S 1 SEV Set Twos Complement Overflow. V1 V 1 CLV Clear Twos Complement Overflow V0 V 1 SET Set T in SREG T1 T 1 CLT Clear T in SREG T0 T 1 SEH CLH Set Half Carry Flag in SREG Clear Half Carry Flag in SREG H1 H0 H H 1 Rd Rr Rd+1:Rd Rr+1:Rr None 1 None 1 1 1 DATA TRANSFER INSTRUCTIONS MOV Rd, Rr Move Between Registers MOVW Rd, Rr Copy Register Word LDI Rd, K Load Immediate Rd K None LD Rd, X Load Indirect Rd (X) None 2 LD Rd, X+ Load Indirect and Post-Inc. Rd (X), X X + 1 None 2 LD Rd, - X Load Indirect and Pre-Dec. X X - 1, Rd (X) None 2 LD Rd, Y Load Indirect Rd (Y) None 2 LD Rd, Y+ Load Indirect and Post-Inc. Rd (Y), Y Y + 1 None 2 LD Rd, - Y Load Indirect and Pre-Dec. Y Y - 1, Rd (Y) None 2 LDD Rd,Y+q Load Indirect with Displacement Rd (Y + q) None 2 LD Rd, Z Load Indirect Rd (Z) None 2 LD Rd, Z+ Load Indirect and Post-Inc. Rd (Z), Z Z+1 None 2 LD Rd, -Z Load Indirect and Pre-Dec. Z Z - 1, Rd (Z) None 2 LDD Rd, Z+q Load Indirect with Displacement Rd (Z + q) None 2 LDS Rd, k Load Direct from SRAM Rd (k) None 2 ST X, Rr Store Indirect (X) Rr None 2 ST X+, Rr Store Indirect and Post-Inc. (X) Rr, X X + 1 None 2 ST - X, Rr Store Indirect and Pre-Dec. X X - 1, (X) Rr None 2 ST Y, Rr Store Indirect (Y) Rr None 2 ST Y+, Rr Store Indirect and Post-Inc. (Y) Rr, Y Y + 1 None 2 ST - Y, Rr Store Indirect and Pre-Dec. Y Y - 1, (Y) Rr None 2 STD Y+q,Rr Store Indirect with Displacement (Y + q) Rr None 2 ST Z, Rr Store Indirect (Z) Rr None 2 ST Z+, Rr Store Indirect and Post-Inc. (Z) Rr, Z Z + 1 None 2 ST -Z, Rr Store Indirect and Pre-Dec. Z Z - 1, (Z) Rr None 2 STD Z+q,Rr Store Indirect with Displacement (Z + q) Rr None 2 STS k, Rr Store Direct to SRAM (k) Rr None 2 Load Program Memory R0 (Z) None 3 LPM LPM Rd, Z Load Program Memory Rd (Z) None 3 LPM Rd, Z+ Load Program Memory and Post-Inc Rd (Z), Z Z+1 None 3 Store Program Memory (z) R1:R0 None IN Rd, P In Port Rd P None OUT P, Rr Out Port P Rr None 1 PUSH Rr Push Register on Stack STACK Rr None 2 POP Rd Pop Register from Stack Rd STACK None 2 None 1 SPM 1 MCU CONTROL INSTRUCTIONS NOP No Operation SLEEP Sleep (see specific descr. for Sleep function) None 1 WDR BREAK Watchdog Reset Break (see specific descr. for WDR/Timer) For On-chip Debug Only None None 1 N/A 269 8183C-AVR-03/11 24. Ordering Information 24.1 ATtiny24A Speed (MHz) Power Supply 20 Notes: 1.8 - 5.5V Ordering Code(1) Package(2) ATtiny24A-SSU ATtiny24A-SSUR ATtiny24A-PU ATtiny24A-CCU ATtiny24A-CCUR ATtiny24A-MU ATtiny24A-MUR ATtiny24A-MMH(3) ATtiny24A-MMHR(3) 14S1 14S1 14P3 15CC1 15CC1 20M1 20M1 20M2 20M2 Industrial (-40C to +85C)(4) ATtiny24A-SSN ATtiny24A-SSNR 14S1 14S1 Industrial (-40C to +105C)(5) ATtiny24A-SSF ATtiny24A-SSFR ATtiny24A-MF ATtiny24A-MFR 14S1 14S1 20M1 20M1 Industrial (-40C to +125C)(6) Operational Range 1. Code indicators: - H: NiPdAu lead finish - F, N, U: matte tin - R: tape & reel 2. All packages are Pb-free, halide-free and fully green and they comply with the European directive for Restriction of Hazardous Substances (RoHS). 3. Topside marking for ATtiny24A: - 1st Line: T24 - 2nd Line: Axx - 3rd Line: manufacturing data 4. These devices can also be supplied in wafer form. Please contact your local Atmel sales office for detailed ordering information and minimum quantities. 5. For typical and Electrical characteristics for this device please consult Appendix A, ATtiny24A/44A Specification at 105C. 6. For typical and Electrical characteristics for this device please consult Appendix B, ATtiny24A/44A Specification at 125C. Package Type 14S1 14-lead, 0.150" Wide Body, Plastic Gull Wing Small Outline Package (SOIC) 14P3 14-lead, 0.300" Wide, Plastic Dual Inline Package (PDIP) 15CC1 15-ball (4 x 4 Array), 0.65 mm Pitch, 3.0 x 3.0 x 0.6 mm, Ultra Thin, Fine-Pitch Ball Grid Array Package (UFBGA) 20M1 20-pad, 4 x 4 x 0.8 mm Body, Quad Flat No Lead / Micro Lead Frame Package (QFN/MLF) 20M2 20-pad, 3 x 3 x 0.85 mm Body, Very Thin Quad Flat No Lead Package (VQFN) 270 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A 24.2 ATtiny44A Speed (MHz) Power Supply 20 Notes: 1.8 - 5.5V Ordering Code(1) Package(2) ATtiny44A-SSU ATtiny44A-SSUR ATtiny44A-PU ATtiny44A-CCU ATtiny44A-CCUR ATtiny44A-MU ATtiny44A-MUR ATtiny44A-MMH(3) ATtiny44A-MMHR(3) 14S1 14S1 14P3 15CC1 15CC1 20M1 20M1 20M2 20M2 Industrial (-40C to +85C)(4) ATtiny44A-SSN ATtiny44A-SSNR 14S1 14S1 Industrial (-40C to +105C)(5) ATtiny44A-SSF ATtiny44A-SSFR ATtiny44A-MF ATtiny44A-MFR 14S1 14S1 20M1 20M1 Industrial (-40C to +125C)(6) Operational Range 1. Code indicators: - H: NiPdAu lead finish - F, N, U: matte tin - R: tape & reel 2. All packages are Pb-free, halide-free and fully green and they comply with the European directive for Restriction of Hazardous Substances (RoHS). 3. Topside marking for ATtiny44A: - 1st Line: T44 - 2nd Line: Axx - 3rd Line: manufacturing data 4. These devices can also be supplied in wafer form. Please contact your local Atmel sales office for detailed ordering information and minimum quantities. 5. For typical and Electrical characteristics for this device please consult Appendix A, ATtiny24A/44A Specification at 105C. 6. For typical and Electrical characteristics for this device please consult Appendix B, ATtiny24A/44A Specification at 125C. Package Type 14S1 14-lead, 0.150" Wide Body, Plastic Gull Wing Small Outline Package (SOIC) 14P3 14-lead, 0.300" Wide, Plastic Dual Inline Package (PDIP) 15CC1 15-ball (4 x 4 Array), 0.65 mm Pitch, 3.0 x 3.0 x 0.6 mm, Ultra Thin, Fine-Pitch Ball Grid Array Package (UFBGA) 20M1 20-pad, 4 x 4 x 0.8 mm Body, Quad Flat No-Lead / Micro Lead Frame Package (QFN/MLF) 20M2 20-pad, 3 x 3 x 0.85 mm Body, Very Thin Quad Flat No Lead Package (VQFN) 271 8183C-AVR-03/11 24.3 ATtiny84A Speed (MHz) Power Supply 20 Notes: 1.8 - 5.5V Ordering Code(1) Package(2) ATtiny84A-SSU ATtiny84A-SSUR ATtiny84A-PU ATtiny84A-CCU ATtiny84A-CCUR ATtiny84A-MU ATtiny84A-MUR ATtiny84A-MMH(3) ATtiny84A-MMHR(3) 14S1 14S1 14P3 15CC1 15CC1 20M1 20M1 20M2 20M2 Operational Range Industrial (-40C to +85C)(4) 1. Code indicators: - H: NiPdAu lead finish - U: matte tin - R: tape & reel 2. All packages are Pb-free, halide-free and fully green and they comply with the European directive for Restriction of Hazardous Substances (RoHS). 3. Topside marking for ATtiny84A: - 1st Line: T84 - 2nd Line: Axx - 3rd Line: manufacturing data 4. These devices can also be supplied in wafer form. Please contact your local Atmel sales office for detailed ordering information and minimum quantities. Package Type 14S1 14-lead, 0.150" Wide Body, Plastic Gull Wing Small Outline Package (SOIC) 14P3 14-lead, 0.300" Wide, Plastic Dual Inline Package (PDIP) 15CC1 15-ball (4 x 4 Array), 0.65 mm Pitch, 3.0 x 3.0 x 0.6 mm, Ultra Thin, Fine-Pitch Ball Grid Array Package (UFBGA) 20M1 20-pad, 4 x 4 x 0.8 mm Body, Quad Flat No-Lead / Micro Lead Frame Package (QFN/MLF) 20M2 20-pad, 3 x 3 x 0.85 mm Body, Very Thin Quad Flat No Lead Package (VQFN) 272 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A 25. Packaging Information 25.1 14S1 1 E H E N L Top View End View e COMMON DIMENSIONS (Unit of Measure = mm/inches) b SYMBOL A1 A D Side View NOM MAX - 1.75/0.0688 NOTE 1.35/0.0532 A1 0.1/.0040 - 0.25/0.0098 b 0.33/0.0130 - 0.5/0.0200 5 D 8.55/0.3367 - 8.74/0.3444 2 E 3.8/0.1497 - 3.99/0.1574 3 H 5.8/0.2284 - 6.19/0.2440 L 0.41/0.0160 - 1.27/0.0500 e Notes: MIN A 4 1.27/0.050 BSC 1. This drawing is for general information only; refer to JEDEC Drawing MS-012, Variation AB for additional information. 2. Dimension D does not include mold Flash, protrusions or gate burrs. Mold Flash, protrusion and gate burrs shall not exceed 0.15 mm (0.006") per side. 3. Dimension E does not include inter-lead Flash or protrusion. Inter-lead flash and protrusions shall not exceed 0.25 mm (0.010") per side. 4. L is the length of the terminal for soldering to a substrate. 5. The lead width B, as measured 0.36 mm (0.014") or greater above the seating plane, shall not exceed a maximum value of 0.61 mm (0.024") per side. 2/5/02 TITLE R 2325 Orchard Parkway San Jose, CA 95131 DRAWING NO. 14S1, 14-lead, 0.150" Wide Body, Plastic Gull Wing Small Outline Package (SOIC) 14S1 REV. A 273 8183C-AVR-03/11 25.2 14P3 D PIN 1 E1 A SEATING PLANE A1 L B B1 e E COMMON DIMENSIONS (Unit of Measure = mm) C eC eB Notes: 1. This package conforms to JEDEC reference MS-001, Variation AA. 2. Dimensions D and E1 do not include mold Flash or Protrusion. Mold Flash or Protrusion shall not exceed 0.25 mm (0.010"). SYMBOL MIN NOM MAX A - - 5.334 A1 0.381 - - D 18.669 - 19.685 E 7.620 - 8.255 E1 6.096 - 7.112 B 0.356 - 0.559 B1 1.143 - 1.778 L 2.921 - 3.810 C 0.203 - 0.356 eB - - 10.922 eC 0.000 - 1.524 e NOTE Note 2 Note 2 2.540 TYP 2010-10-20 R 274 2325 Orchard Parkway San Jose, CA 95131 TITLE 14P3, 14-lead (0.300"/7.62 mm Wide) Plastic Dual Inline Package (PDIP) DRAWING NO. 14P3 REV. B ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A 25.3 15CC1 1 2 3 4 0.08 A Pin#1 ID B SIDE VIEW D C D b1 A1 E A A2 TOP VIEW E1 15-Ob e D e COMMON DIMENSIONS (Unit of Measure = mm) C D1 B SYMBOL A MIN NOM MAX A - - 0.60 A1 0.12 - - b 0.25 0.30 0.35 1 b1 0.25 - - 2 D 2.90 3.00 3.10 0.38 REF A2 A1 BALL CORNER 1 2 3 4 BOTTOM VIEW 1.95 BSC D1 E Note1: Dimension "b" is measured at the maximum ball dia. in a plane parallel E1 e to the seating plane. Note2: Dimension "b1" is the solderable surface defined by the opening of the solder resist layer. TITLE R Package Drawing Contact: packagedrawings@atmel.com 15CC1, 15-ball (4 x 4 Array), 3.0 x 3.0 x 0.6 mm package, ball pitch 0.65 mm, Ultra thin, Fine-Pitch Ball Grid Array Package (UFBGA) NOTE 3.00 2.90 3.10 1.95 BSC 0.65 BSC GPC CBC 07/06/10 DRAWING NO. REV. 15CC1 C 275 8183C-AVR-03/11 25.4 20M1 D 1 Pin 1 ID 2 SIDE VIEW E 3 TOP VIEW A2 D2 A1 A 0.08 1 2 Pin #1 Notch (0.20 R) 3 COMMON DIMENSIONS (Unit of Measure = mm) E2 b L e BOTTOM VIEW SYMBOL MIN A 0.70 0.75 0.80 A1 - 0.01 0.05 A2 b 0.18 D D2 E2 L MAX NOTE 0.23 0.30 4.00 BSC 2.45 2.60 2.75 4.00 BSC 2.45 e Reference JEDEC Standard MO-220, Fig. 1 (SAW Singulation) WGGD-5. NOM 0.20 REF E Note: C 2.60 2.75 0.50 BSC 0.35 0.40 0.55 10/27/04 R 276 2325 Orchard Parkway San Jose, CA 95131 TITLE 20M1, 20-pad, 4 x 4 x 0.8 mm Body, Lead Pitch 0.50 mm, 2.6 mm Exposed Pad, Micro Lead Frame Package (MLF) DRAWING NO. 20M1 REV. A ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A 25.5 20M2 D C y Pin 1 ID E SIDE VIEW TOP VIEW A1 A D2 16 17 18 19 20 COMMON DIMENSIONS (Unit of Measure = mm) C0.18 (8X) 15 Pin #1 Chamfer (C 0.3) 14 2 e E2 13 3 12 4 11 5 MIN NOM MAX A 0.75 0.80 0.85 A1 0.00 0.02 0.05 b 0.17 0.22 0.27 SYMBOL 1 C b 10 9 8 7 6 K L BOTTOM VIEW 0.3 Ref (4x) NOTE 0.152 D 2.90 3.00 3.10 D2 1.40 1.55 1.70 E 2.90 3.00 3.10 E2 1.40 1.55 1.70 e - 0.45 - L 0.35 0.40 0.45 K 0.20 - - y 0.00 - 0.08 10/24/08 Package Drawing Contact: packagedrawings@atmel.com GPC TITLE 20M2, 20-pad, 3 x 3 x 0.85 mm Body, Lead Pitch 0.45 mm, ZFC 1.55 x 1.55 mm Exposed Pad, Thermally Enhanced Plastic Very Thin Quad Flat No Lead Package (VQFN) DRAWING NO. REV. 20M2 B 277 8183C-AVR-03/11 26. Errata The revision letters in this section refer to the revision of the corresponding ATtiny24A/44A/84A device. 26.1 26.1.1 ATtiny24A Rev. H No known errata. 26.1.2 Rev. G Not sampled. 26.1.3 Rev. F Not sampled. 26.2 26.2.1 ATtiny44A Rev. F No known errata. 26.2.2 Rev. E Not sampled. 26.3 26.3.1 ATtiny84A Rev. C No known errata. 278 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A 27. Datasheet Revision History 27.1 Rev. 8183C - 03/11 1. Added: - ATtiny84A, including typical characteristics plots - Section 3.3 "Capacitive Touch Sensing" on page 6 - Table 6-8, "Capacitance of Low-Frequency Crystal Oscillator," on page 28 - Analog Comparator Offset plots for ATtiny24A (Figure 21.2.10 on page 208) and ATtiny44A (Figure 21.3.11 on page 236) - Extended temperature part numbers in Section 24. "Ordering Information" on page 270 2. Updated: - Bit syntax throughout the datasheet, e.g. from CS02:0 to CS0[2:0] - Section 6.4 "Clock Output Buffer" on page 30, changed CLKO to CKOUT - Table 16-4, "Single-Ended Input channel Selections," on page 145, added note for Internal 1.1V Reference - Table 19-16, "High-voltage Serial Programming Instruction Set for ATtiny24A/44A/84A," on page 170, adjusted notes - Table 20-1, "DC Characteristics. TA = -40C to +85C," on page 173, adjusted notes 27.2 Rev. 8183B - 03/10 1. Updated template. 2. Added UFBGA package (15CC1) in: "Features" on page 1, "Pin Configurations" on page 2, Section 24. "Ordering Information" on page 270, and Section 25.3 "15CC1" on page 275. 3. Separated typical characteristic plots, added Section 21.2 "ATtiny24A" on page 183. 4. Updated sections: - Section 14.5.4 "USIBR - USI Buffer Register" on page 127, header updated - Section 24. "Ordering Information" on page 270, added tape & reel and topside marking, updated notes 5. Updated Figures: - Figure 4-1 "Block Diagram of the AVR Architecture" on page 7 - Figure 8-1 "Reset Logic" on page 38 - Figure 14-1 "Universal Serial Interface, Block Diagram" on page 116, USIDB -> USIBR - Figure 19-5 "High-voltage Serial Programming Waveforms" on page 169 6. Updated Tables: - Table 19-11, "Minimum Wait Delay Before Writing the Next Flash or EEPROM Location," on page 164, updated value for tWD_ERASE 279 8183C-AVR-03/11 27.3 Rev. 8183A - 12/08 1. Initial revision. Created from document 8006H. 2. Updated "Ordering Information" on page 278 and page 278. Pb-plated packages are no longer offered and there are no separate ordering codes for commercial operation range, the only available option now is industrial. Also, updated some order codes to reflect changes in leadframe composition and added VQFN package option. 3. Updated data sheet template. 4. Removed all references to 8K device. 5. Updated characteristic plots of section "Typical Characteristics", starting on page 182. 6. Added characteristic plots: - "Bandgap Voltage vs. Supply Voltage" on page 233 - "Bandgap Voltage vs. Temperature" on page 233 7. Updated sections: - "Features" on page 1 - "Power Reduction Register" on page 35 - "Analog Comparator" on page 128 - "Features" on page 132 - "Operation" on page 133 - "Starting a Conversion" on page 134 - "ADC Voltage Reference" on page 139 - "Speed" on page 174 8. Updated Figures: - "Program Memory Map" on page 15 - "Data Memory Map" on page 16 9. Update Tables: - "Device Signature Bytes" on page 161 - "DC Characteristics. TA = -40C to +85C" on page 173 - "Additional Current Consumption for the different I/O modules (absolute values)" on page 182 - "Additional Current Consumption (percentage) in Active and Idle mode" on page 183 280 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A Table of Contents Features ..................................................................................................... 1 1 Pin Configurations ................................................................................... 2 1.1 Pin Descriptions .................................................................................................3 2 Overview ................................................................................................... 4 3 General Information ................................................................................. 6 4 5 6 7 3.1 Resources .........................................................................................................6 3.2 Code Examples .................................................................................................6 3.3 Capacitive Touch Sensing .................................................................................6 3.4 Data Retention ...................................................................................................6 3.5 Disclaimer ..........................................................................................................6 CPU Core .................................................................................................. 7 4.1 Architectural Overview .......................................................................................7 4.2 ALU - Arithmetic Logic Unit ...............................................................................8 4.3 Status Register ..................................................................................................8 4.4 General Purpose Register File ..........................................................................9 4.5 Stack Pointer ...................................................................................................10 4.6 Instruction Execution Timing ...........................................................................10 4.7 Reset and Interrupt Handling ...........................................................................11 4.8 Register Description ........................................................................................13 Memories ................................................................................................ 15 5.1 In-System Re-programmable Flash Program Memory ....................................15 5.2 SRAM Data Memory ........................................................................................15 5.3 EEPROM Data Memory ..................................................................................16 5.4 I/O Memory ......................................................................................................20 5.5 Register Description ........................................................................................20 Clock System ......................................................................................... 24 6.1 Clock Subsystems ...........................................................................................24 6.2 Clock Sources .................................................................................................25 6.3 System Clock Prescaler ..................................................................................30 6.4 Clock Output Buffer .........................................................................................30 6.5 Register Description ........................................................................................31 Power Management and Sleep Modes ................................................. 33 i 8183C-AVR-03/11 8 9 7.1 Sleep Modes ....................................................................................................33 7.2 Software BOD Disable .....................................................................................34 7.3 Power Reduction Register ...............................................................................35 7.4 Minimizing Power Consumption ......................................................................35 7.5 Register Description ........................................................................................36 System Control and Reset .................................................................... 38 8.1 Resetting the AVR ...........................................................................................38 8.2 Reset Sources .................................................................................................39 8.3 Internal Voltage Reference ..............................................................................41 8.4 Watchdog Timer ..............................................................................................41 8.5 Register Description ........................................................................................44 Interrupts ................................................................................................ 47 9.1 Interrupt Vectors ..............................................................................................47 9.2 External Interrupts ...........................................................................................48 9.3 Register Description ........................................................................................50 10 I/O Ports .................................................................................................. 53 10.1 Ports as General Digital I/O .............................................................................54 10.2 Alternate Port Functions ..................................................................................58 10.3 Register Description ........................................................................................66 11 8-bit Timer/Counter0 with PWM ............................................................ 68 11.1 Features ..........................................................................................................68 11.2 Overview ..........................................................................................................68 11.3 Clock Sources .................................................................................................69 11.4 Counter Unit ....................................................................................................69 11.5 Output Compare Unit .......................................................................................70 11.6 Compare Match Output Unit ............................................................................72 11.7 Modes of Operation .........................................................................................73 11.8 Timer/Counter Timing Diagrams .....................................................................77 11.9 Register Description ........................................................................................79 12 16-bit Timer/Counter1 ............................................................................ 85 ii 12.1 Features ..........................................................................................................85 12.2 Overview ..........................................................................................................85 12.3 Timer/Counter Clock Sources .........................................................................87 12.4 Counter Unit ....................................................................................................87 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A 12.5 Input Capture Unit ...........................................................................................88 12.6 Output Compare Units .....................................................................................90 12.7 Compare Match Output Unit ............................................................................92 12.8 Modes of Operation .........................................................................................94 12.9 Timer/Counter Timing Diagrams ...................................................................101 12.10 Accessing 16-bit Registers ............................................................................103 12.11 Register Description ......................................................................................106 13 Timer/Counter Prescaler ..................................................................... 113 13.1 Prescaler Reset .............................................................................................113 13.2 External Clock Source ...................................................................................113 13.3 Register Description ......................................................................................114 14 USI - Universal Serial Interface .......................................................... 116 14.1 Features ........................................................................................................116 14.2 Overview ........................................................................................................116 14.3 Functional Descriptions .................................................................................117 14.4 Alternative USI Usage ...................................................................................123 14.5 Register Descriptions ....................................................................................123 15 Analog Comparator ............................................................................. 128 15.1 Analog Comparator Multiplexed Input ...........................................................128 15.2 Register Description ......................................................................................129 16 Analog to Digital Converter ................................................................ 132 16.1 Features ........................................................................................................132 16.2 Overview ........................................................................................................132 16.3 Operation .......................................................................................................133 16.4 Starting a Conversion ....................................................................................134 16.5 Prescaling and Conversion Timing ................................................................135 16.6 Changing Channel or Reference Selection ...................................................138 16.7 ADC Noise Canceler .....................................................................................139 16.8 Analog Input Circuitry ....................................................................................139 16.9 Noise Canceling Techniques .........................................................................140 16.10 ADC Accuracy Definitions .............................................................................140 16.11 ADC Conversion Result .................................................................................142 16.12 Temperature Measurement ...........................................................................143 16.13 Register Description ......................................................................................144 iii 8183C-AVR-03/11 17 debugWIRE On-chip Debug System .................................................. 150 17.1 Features ........................................................................................................150 17.2 Overview ........................................................................................................150 17.3 Physical Interface ..........................................................................................150 17.4 Software Break Points ...................................................................................151 17.5 Limitations of debugWIRE .............................................................................151 17.6 Register Description ......................................................................................151 18 Self-Programming the Flash ............................................................... 152 18.1 Performing Page Erase by SPM ....................................................................152 18.2 Filling the Temporary Buffer (Page Loading) .................................................152 18.3 Performing a Page Write ...............................................................................153 18.4 Addressing the Flash During Self-Programming ...........................................153 18.5 EEPROM Write Prevents Writing to SPMCSR ..............................................154 18.6 Reading Lock, Fuse and Signature Data from Software ...............................154 18.7 Preventing Flash Corruption ..........................................................................156 18.8 Programming Time for Flash when Using SPM ............................................156 18.9 Register Description ......................................................................................156 19 Memory Programming ......................................................................... 158 19.1 Program And Data Memory Lock Bits ...........................................................158 19.2 Fuse Bytes .....................................................................................................159 19.3 Device Signature Imprint Table .....................................................................160 19.4 Page Size ......................................................................................................161 19.5 Serial Programming .......................................................................................162 19.6 High-voltage Serial Programming ..................................................................166 19.7 High-Voltage Serial Programming Algorithm .................................................166 20 Electrical Characteristics .................................................................... 173 iv 20.1 Absolute Maximum Ratings* .........................................................................173 20.2 DC Characteristics .........................................................................................173 20.3 Speed ............................................................................................................174 20.4 Clock Characteristics .....................................................................................175 20.5 System and Reset Characteristics ................................................................176 20.6 ADC Characteristics ......................................................................................177 20.7 Analog Comparator Characteristics ...............................................................180 20.8 Serial Programming Characteristics ..............................................................180 20.9 High-Voltage Serial Programming Characteristics ........................................181 ATtiny24A/44A/84A 8183C-AVR-03/11 ATtiny24A/44A/84A 21 Typical Characteristics ........................................................................ 182 21.1 Supply Current of I/O Modules ......................................................................182 21.2 ATtiny24A ......................................................................................................183 21.3 ATtiny44A ......................................................................................................211 21.4 ATtiny84A ......................................................................................................239 22 Register Summary ............................................................................... 266 23 Instruction Set Summary .................................................................... 268 24 Ordering Information ........................................................................... 270 24.1 ATtiny24A ......................................................................................................270 24.2 ATtiny44A ......................................................................................................271 24.3 ATtiny84A ......................................................................................................272 25 Packaging Information ........................................................................ 273 25.1 14S1 ..............................................................................................................273 25.2 14P3 ..............................................................................................................274 25.3 15CC1 ...........................................................................................................275 25.4 20M1 ..............................................................................................................276 25.5 20M2 ..............................................................................................................277 26 Errata ..................................................................................................... 278 26.1 ATtiny24A ......................................................................................................278 26.2 ATtiny44A ......................................................................................................278 26.3 ATtiny84A ......................................................................................................278 27 Datasheet Revision History ................................................................ 279 27.1 Rev. 8183C - 03/11 .......................................................................................279 27.2 Rev. 8183B - 03/10 .......................................................................................279 27.3 Rev. 8183A - 12/08 .......................................................................................280 Table of Contents....................................................................................... i v 8183C-AVR-03/11 Headquarters International Atmel Corporation 2325 Orchard Parkway San Jose, CA 95131 USA Tel: (+1)(408) 441-0311 Fax: (+1)(408) 487-2600 Atmel Asia Limited Unit 01-5 & 16, 19F BEA Tower, Millennium City 5 418 Kwun Tong Road Kwun Tong, Kowloon HONG KONG Tel: (+852) 2245-6100 Fax: (+852) 2722-1369 Atmel Munich GmbH Business Campus Parkring 4 D-85748 Garching b. Munich GERMANY Tel: (+49) 89-31970-0 Fax: (+49) 89-3194621 Atmel Japan 9F, Tonetsu Shinkawa Bldg. 1-24-8 Shinkawa Chuo-ku, Tokyo 104-0033 JAPAN Tel: (+81)(3) 3523-3551 Fax: (+81)(3) 3523-7581 Technical Support avr@atmel.com Sales Contact www.atmel.com/contacts Product Contact Web Site www.atmel.com Literature Requests www.atmel.com/literature Disclaimer: The information in this document is provided in connection with Atmel products. No license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection with the sale of Atmel products. EXCEPT AS SET FORTH IN ATMEL'S TERMS AND CONDITIONS OF SALE LOCATED ON ATMEL'S WEB SITE, ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDENTAL DAMAGES (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION, OR LOSS OF INFORMATION) ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Atmel makes no representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specifications and product descriptions at any time without notice. Atmel does not make any commitment to update the information contained herein. Unless specifically provided otherwise, Atmel products are not suitable for, and shall not be used in, automotive applications. Atmel's products are not intended, authorized, or warranted for use as components in applications intended to support or sustain life. (c) 2011 Atmel Corporation. All rights reserved. Atmel(R), logo and combinations thereof, and others are registered trademarks or trademarks of Atmel Corporation or its subsidiaries. Other terms and product names may be trademarks of others. 8183C-AVR-03/11