{"datasheetId":"ds_1f65a0ecd69948b21b13","chunkCount":548,"revision":"2026-11-09T20:29:11.422Z","source":"index","nextCursor":"49","chunks":[{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0001","chunkIndex":0,"heading":"Atmel","headingPath":["Atmel"],"preview":"Atmel Atmel 8 bit AVR Microcontroller with 2/4/8K Bytes In System Programmable Flash ATtiny25/V / ATtiny45/V / ATtiny85/V Features • High Performance, Low Power AVR® 8 Bit Microcontroller • Advanced RISC Architecture – 120 Powerful Instruct","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0001"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0002","chunkIndex":1,"heading":"• Peripheral Features","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","• Peripheral Features"],"preview":"• Peripheral Features – 8 bit Timer/Counter with Prescaler and Two PWM Channels – 8 bit High Speed Timer/Counter with Separate Prescaler • 2 High Frequency PWM Outputs with Separate Output Compare Registers • Programmable Dead Time Generato","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0002"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0003","chunkIndex":2,"heading":"• Special Microcontroller Features","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","• Special Microcontroller Features"],"preview":"• Special Microcontroller Features – debugWIRE On chip Debug System – In System Programmable via SPI Port – External and Internal Interrupt Sources – Low Power Idle, ADC Noise Reduction, and Power down Modes – Enhanced Power on Reset Circui","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0003"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0004","chunkIndex":3,"heading":"• Operating Voltage","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","• Operating Voltage"],"preview":"• Operating Voltage – 1.8 5.5V for ATtiny25V/45V/85V – 2.7 5.5V for ATtiny25/45/85 • Speed Grade – ATtiny25V/45V/85V: 0 – 4 MHz @ 1.8 5.5V, 0 10 MHz @ 2.7 5.5V – ATtiny25/45/85: 0 – 10 MHz @ 2.7 5.5V, 0 20 MHz @ 4.5 5.5V • Industrial Temper","images":[{"path":"images/part_01_7c21b5f1f12f7c1b40be42293a0cd70d8fff396ceb125dc57366648c72689c94.jpg","name":"part_01_7c21b5f1f12f7c1b40be42293a0cd70d8fff396ceb125dc57366648c72689c94.jpg","mimeType":"image/jpeg","semanticKind":"unknown","semanticCaption":"Extracted datasheet image part_01_7c21b5f1f12f7c1b40be42293a0cd70d8fff396ceb125dc57366648c72689c94.jpg.","viewUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/asset?path=images%2Fpart_01_7c21b5f1f12f7c1b40be42293a0cd70d8fff396ceb125dc57366648c72689c94.jpg"},{"path":"images/part_01_4f40ac1ef639bd156357b58b07d6e1183ea44dc75da5898883e9498d08e47b67.jpg","name":"part_01_4f40ac1ef639bd156357b58b07d6e1183ea44dc75da5898883e9498d08e47b67.jpg","mimeType":"image/jpeg","semanticKind":"pinout","semanticCaption":"QFN/MLF package pinout","viewUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/asset?path=images%2Fpart_01_4f40ac1ef639bd156357b58b07d6e1183ea44dc75da5898883e9498d08e47b67.jpg"}],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0004"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0005","chunkIndex":4,"heading":"1.1 Pin Descriptions","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","1.1 Pin Descriptions"],"preview":"1.1 Pin Descriptions 1.1.1 VCC Supply voltage. 1.1.2 GND Ground. 1.1.3 Port B (PB5:PB0) Port B is a 6 bit bi directional I/O port with internal pull up resistors (selected for each bit). The Port B output buffers have symmetrical drive char","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0005"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0006","chunkIndex":5,"heading":"1.1.4 RESET","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","1.1.4 RESET"],"preview":"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 2","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0006"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0007","chunkIndex":6,"heading":"2.1 Block Diagram","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","2.1 Block Diagram"],"preview":"2.1 Block Diagram Figure 2 1. Block Diagram 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 registe","images":[{"path":"images/part_01_574e0ddc8c7dcd4184133ab91e1747b49cf35c722ab6f852d5bf21b2873b0f57.jpg","name":"part_01_574e0ddc8c7dcd4184133ab91e1747b49cf35c722ab6f852d5bf21b2873b0f57.jpg","mimeType":"image/jpeg","semanticKind":"block_diagram","semanticCaption":"Microcontroller internal architecture and peripherals","viewUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/asset?path=images%2Fpart_01_574e0ddc8c7dcd4184133ab91e1747b49cf35c722ab6f852d5bf21b2873b0f57.jpg"}],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0007"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0008","chunkIndex":7,"heading":"2.1 Block Diagram","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","2.1 Block Diagram"],"preview":"The ATtiny25/45/85 provides the following features: 2/4/8K bytes of In System Programmable Flash, 128/256/512 bytes EEPROM, 128/256/256 bytes SRAM, 6 general purpose I/O lines, 32 general purpose working registers, one 8 bit Timer/Counter w","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0008"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0009","chunkIndex":8,"heading":"2.1 Block Diagram","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","2.1 Block Diagram"],"preview":"The ATtiny25/45/85 AVR is supported with a full suite of program and system development tools including: C Com pilers, Macro Assemblers, Program Debugger/Simulators and Evaluation kits. 3. About 3.1 Resources A comprehensive set of developm","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0009"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0010","chunkIndex":9,"heading":"3.3 Capacitive Touch Sensing","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","3.3 Capacitive Touch Sensing"],"preview":"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","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0010"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0011","chunkIndex":10,"heading":"3.4 Data Retention","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","3.4 Data Retention"],"preview":"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 85°C or 100 years at 25°C. 4. AVR CPU Core 4.1 Introduction This section discusses the AVR cor","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0011"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0012","chunkIndex":11,"heading":"4.2 Architectural Overview","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","4.2 Architectural Overview"],"preview":"4.2 Architectural Overview Figure 4 1. Block Diagram of the AVR Architecture 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","images":[{"path":"images/part_01_f945bf8ddae9000b5d0f3d207c1ef2d30e19585cb7211aecc8920aa5a552458b.jpg","name":"part_01_f945bf8ddae9000b5d0f3d207c1ef2d30e19585cb7211aecc8920aa5a552458b.jpg","mimeType":"image/jpeg","semanticKind":"block_diagram","semanticCaption":"Microcontroller architecture block diagram","viewUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/asset?path=images%2Fpart_01_f945bf8ddae9000b5d0f3d207c1ef2d30e19585cb7211aecc8920aa5a552458b.jpg"}],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0012"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0013","chunkIndex":12,"heading":"4.2 Architectural Overview","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","4.2 Architectural Overview"],"preview":"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","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0013"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0014","chunkIndex":13,"heading":"4.2 Architectural Overview","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","4.2 Architectural Overview"],"preview":"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","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0014"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0015","chunkIndex":14,"heading":"4.2 Architectural Overview","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","4.2 Architectural Overview"],"preview":"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 0","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0015"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0016","chunkIndex":15,"heading":"4.4 Status Register","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","4.4 Status Register"],"preview":"4.4 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","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0016"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0017","chunkIndex":16,"heading":"4.4.1 SREG – AVR Status Register","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","4.4.1 SREG – AVR Status Register"],"preview":"4.4.1 SREG – AVR Status Register The AVR Status Register – SREG – is defined as:","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0017"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0018","chunkIndex":17,"heading":"• Bit 7 – I: Global Interrupt Enable","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","• Bit 7 – I: Global Interrupt Enable"],"preview":"• Bit 7 – I: Global Interrupt Enable The Global Interrupt Enable bit must be set for the interrupts to be enabled. The individual interrupt enable control is then performed in separate control registers. If the Global Interrupt Enable Regis","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0018"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0019","chunkIndex":18,"heading":"• Bit 6 – T: Bit Copy Storage","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","• Bit 6 – T: Bit Copy Storage"],"preview":"• Bit 6 – T: Bit Copy Storage The Bit Copy instructions BLD (Bit LoaD) and BST (Bit STore) use the T bit as source or destination for the operated bit. A bit from a register in the Register File can be copied into T by the BST instruction,","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0019"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0020","chunkIndex":19,"heading":"• Bit 4 – S: Sign Bit, S = N ⊕ V","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","• Bit 4 – S: Sign Bit, S = N ⊕ V"],"preview":"• Bit 4 – S: Sign Bit, S = N ⊕ V The S bit is always an exclusive or between the Negative Flag N and the Two’s Complement Overflow Flag V. See the “Instruction Set Description” for detailed information. • Bit 3 – V: Two’s Complement Overflo","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0020"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0021","chunkIndex":20,"heading":"• Bit 1 – Z: Zero Flag","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","• Bit 1 – Z: Zero Flag"],"preview":"• Bit 1 – Z: Zero Flag The Zero Flag Z indicates a zero result in an arithmetic or logic operation. See the “Instruction Set Description” for detailed information. • Bit 0 – C: Carry Flag The Carry Flag C indicates a carry in an arithmetic","images":[{"path":"images/part_01_3c53c70fd8653f7485b8e13bb367442121ac423e00672e0098e19ae7794f7fd8.jpg","name":"part_01_3c53c70fd8653f7485b8e13bb367442121ac423e00672e0098e19ae7794f7fd8.jpg","mimeType":"image/jpeg","semanticKind":null,"semanticCaption":null,"viewUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/asset?path=images%2Fpart_01_3c53c70fd8653f7485b8e13bb367442121ac423e00672e0098e19ae7794f7fd8.jpg"}],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0021"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0022","chunkIndex":21,"heading":"4.5 General Purpose Register File","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","4.5 General Purpose Register File"],"preview":"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 pr","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0022"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0023","chunkIndex":22,"heading":"4.5.1 The X-register, Y-register, and Z-register","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","4.5.1 The X-register, Y-register, and Z-register"],"preview":"","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0023"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0024","chunkIndex":23,"heading":"4.6 Stack Pointer","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","4.6 Stack Pointer"],"preview":"4.6 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. Not","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0024"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0025","chunkIndex":24,"heading":"4.6 Stack Pointer","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","4.6 Stack Pointer"],"preview":"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 smal that only SPL is","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0025"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0026","chunkIndex":25,"heading":"4.6 Stack Pointer","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","4.6 Stack Pointer"],"preview":"4.7 Instruction Execution Timing This section describes the general access timing concepts for instruction execution. The AVR CPU is driven by the CPU clock ${ \\mathsf { c l k } } { \\mathsf { C P U } } ,$ directly generated from the selecte","images":[{"path":"images/part_01_a2beec45a1859f5f378ae6299239c2318c1a128c675588d4a14234ba8483b18a.jpg","name":"part_01_a2beec45a1859f5f378ae6299239c2318c1a128c675588d4a14234ba8483b18a.jpg","mimeType":"image/jpeg","semanticKind":null,"semanticCaption":null,"viewUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/asset?path=images%2Fpart_01_a2beec45a1859f5f378ae6299239c2318c1a128c675588d4a14234ba8483b18a.jpg"},{"path":"images/part_01_0e06e00c493bd48835110b7501033cea4ce3b5a906e26d3a95cda27d12b97b2a.jpg","name":"part_01_0e06e00c493bd48835110b7501033cea4ce3b5a906e26d3a95cda27d12b97b2a.jpg","mimeType":"image/jpeg","semanticKind":null,"semanticCaption":null,"viewUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/asset?path=images%2Fpart_01_0e06e00c493bd48835110b7501033cea4ce3b5a906e26d3a95cda27d12b97b2a.jpg"}],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0026"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0027","chunkIndex":26,"heading":"4.8 Reset and Interrupt Handling","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","4.8 Reset and Interrupt Handling"],"preview":"4.8 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 en","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0027"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0028","chunkIndex":27,"heading":"4.8 Reset and Interrupt Handling","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","4.8 Reset and Interrupt Handling"],"preview":"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 handli","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0028"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0029","chunkIndex":28,"heading":"4.8 Reset and Interrupt Handling","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","4.8 Reset and Interrupt Handling"],"preview":"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 ro","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0029"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0030","chunkIndex":29,"heading":"4.8 Reset and Interrupt Handling","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","4.8 Reset and Interrupt Handling"],"preview":"When using the SEI instruction to enable interrupts, the instruction following SEI will be executed before any pending interrupts, as shown in this example. txt Assembly Code Example sei ; set Global Interrupt Enable sleep; enter sleep, wai","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0030"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0031","chunkIndex":30,"heading":"4.8.1 Interrupt Response Time","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","4.8.1 Interrupt Response Time"],"preview":"4.8.1 Interrupt Response Time The interrupt execution response for all the enabled AVR interrupts is four clock cycles minimum. After four clock cycles the Program Vector address for the actual interrupt handling routine is executed. During","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0031"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0032","chunkIndex":31,"heading":"5. AVR Memories","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","5. AVR Memories"],"preview":"5. AVR Memories This section describes the different memories in the ATtiny25/45/85. The AVR architecture has two main memory spaces, the Data memory and the Program memory space. In addition, the ATtiny25/45/85 features an EEPROM Memory fo","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0032"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0033","chunkIndex":32,"heading":"5.1 In-System Re-programmable Flash Program Memory","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","5.1 In-System Re-programmable Flash Program Memory"],"preview":"5.2 SRAM Data Memory Figure 5 2 shows how the ATtiny25/45/85 SRAM Memory is organized. The lower 224/352/607 Data memory locations address both the Register File, the I/O memory and the internal data SRAM. The first 32 locations address the","images":[{"path":"images/part_01_12e4ed3719e4c2a29b9952a2ae2ed575fbbeb73b5d520c780733f1efbee17424.jpg","name":"part_01_12e4ed3719e4c2a29b9952a2ae2ed575fbbeb73b5d520c780733f1efbee17424.jpg","mimeType":"image/jpeg","semanticKind":null,"semanticCaption":null,"viewUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/asset?path=images%2Fpart_01_12e4ed3719e4c2a29b9952a2ae2ed575fbbeb73b5d520c780733f1efbee17424.jpg"}],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0033"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0034","chunkIndex":33,"heading":"5.2 SRAM Data Memory","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","5.2 SRAM Data Memory"],"preview":"The 32 general purpose working registers, 64 I/O Registers, and the 128/256/512 bytes of internal data SRAM in the ATtiny25/45/85 are all accessible through all these addressing modes. The Register File is described in “Gen eral Purpose Reg","images":[{"path":"images/part_01_94e3faa1eff87015506733286545bfac6010dbd6559007707a2104f73bd31bc0.jpg","name":"part_01_94e3faa1eff87015506733286545bfac6010dbd6559007707a2104f73bd31bc0.jpg","mimeType":"image/jpeg","semanticKind":"block_diagram","semanticCaption":"Data memory address map","viewUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/asset?path=images%2Fpart_01_94e3faa1eff87015506733286545bfac6010dbd6559007707a2104f73bd31bc0.jpg"},{"path":"images/part_01_cdb458daa8ec76949171580b9f3f04a52f600962f87b5f6fcbea63cb6f0e673c.jpg","name":"part_01_cdb458daa8ec76949171580b9f3f04a52f600962f87b5f6fcbea63cb6f0e673c.jpg","mimeType":"image/jpeg","semanticKind":null,"semanticCaption":null,"viewUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/asset?path=images%2Fpart_01_cdb458daa8ec76949171580b9f3f04a52f600962f87b5f6fcbea63cb6f0e673c.jpg"}],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0034"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0035","chunkIndex":34,"heading":"5.3 EEPROM Data Memory","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","5.3 EEPROM Data Memory"],"preview":"5.3 EEPROM Data Memory The ATtiny25/45/85 contains 128/256/512 bytes of data EEPROM memory. It is organized as a separate data space, in which single bytes can be read and written. The EEPROM has an endurance of at least 100,000 write/erase","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0035"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0036","chunkIndex":35,"heading":"5.3.1 EEPROM Read/Write Access","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","5.3.1 EEPROM Read/Write Access"],"preview":"5.3.1 EEPROM Read/Write Access The EEPROM Access Registers are accessible in the I/O space. The write access times for the EEPROM are given in Table 5 1 on page 21. A self timing function, however, lets the user software detect when the nex","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0036"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0037","chunkIndex":36,"heading":"5.3.2 Atomic Byte Programming","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","5.3.2 Atomic Byte Programming"],"preview":"5.3.2 Atomic Byte Programming Using Atomic Byte Programming is the simplest mode. When writing a byte to the EEPROM, the user must write the address into the EEAR Register and data into EEDR Register. If the EEPMn bits are zero, writing EEP","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0037"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0038","chunkIndex":37,"heading":"5.3.3 Split Byte Programming","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","5.3.3 Split Byte Programming"],"preview":"5.3.3 Split Byte Programming It is possible to split the erase and write cycle in two different operations. This may be useful if the system requires short access time for some limited period of time (typically if the power supply voltage f","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0038"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0039","chunkIndex":38,"heading":"5.3.4 Erase","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","5.3.4 Erase"],"preview":"5.3.4 Erase To erase a byte, the address must be written to EEAR. If the EEPMn bits are 0b01, writing the EEPE (within four cycles after EEMPE is written) will trigger the erase operation only (programming time is given in Table 5 1 on page","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0039"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0040","chunkIndex":39,"heading":"5.3.5 Write","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","5.3.5 Write"],"preview":"The following code examples show one assembly and one C function for erase, write, or atomic write of the EEPROM. The examples assume that interrupts are controlled (e.g., by disabling interrupts globally) so that no interrupts will occur d","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0040"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0041","chunkIndex":40,"heading":"5.3.5 Write","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","5.3.5 Write"],"preview":"} The next code examples show assembly and C functions for reading the EEPROM. The examples assume that interrupts are controlled so that no interrupts will occur during execution of these functions. c Assembly Code Example EEPROM read: ; W","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0041"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0042","chunkIndex":41,"heading":"5.3.6 Preventing EEPROM Corruption","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","5.3.6 Preventing EEPROM Corruption"],"preview":"5.3.6 Preventing EEPROM Corruption During periods of low $\\mathsf { V } { \\mathsf { C C } } .$ , the EEPROM data can be corrupted because the supply voltage is too low for the CPU and the EEPROM to operate properly. These issues are the sam","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0042"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0043","chunkIndex":42,"heading":"5.4 I/O Memory","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","5.4 I/O Memory"],"preview":"5.4 I/O Memory The I/O space definition of the ATtiny25/45/85 is shown in “Register Summary” on page 200. All ATtiny25/45/85 I/Os and peripherals are placed in the I/O space. All I/O locations may be accessed by the LD/LDS/LDD and ST/STS/ST","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0043"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0044","chunkIndex":43,"heading":"5.4 I/O Memory","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","5.4 I/O Memory"],"preview":"Some of the Status Flags are cleared by writing a logical one to them. Note that the CBI and SBI instructions will only operate on the specified bit, and can therefore be used on registers containing such Status Flags. The CBI and SBI instr","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0044"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0045","chunkIndex":44,"heading":"• Bits 0 – EEAR8: EEPROM Address","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","• Bits 0 – EEAR8: EEPROM Address"],"preview":"• Bits 0 – EEAR8: EEPROM Address This is the most significant EEPROM address bit of ATtiny85. In devices with less EEPROM, i.e. ATtiny25/ATtiny45, this bit is reserved and will always read zero. The initial value of the EEPROM Address Regis","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0045"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0046","chunkIndex":45,"heading":"• Bit 7 – EEAR7: EEPROM Address","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","• Bit 7 – EEAR7: EEPROM Address"],"preview":"• Bit 7 – EEAR7: EEPROM Address This is the most significant EEPROM address bit of ATtiny45. In devices with less EEPROM, i.e. ATtiny25, this bit is reserved and will always read zero. The initial value of the EEPROM Address Register (EEAR)","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0046"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0047","chunkIndex":46,"heading":"5.5.3 EEDR – EEPROM Data Register","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","5.5.3 EEDR – EEPROM Data Register"],"preview":"5.5.3 EEDR – EEPROM Data Register","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0047"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0048","chunkIndex":47,"heading":"• Bits 7:0 – EEDR[7:0]: EEPROM Data","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","• Bits 7:0 – EEDR[7:0]: EEPROM Data"],"preview":"• Bits 7:0 – EEDR[7:0]: EEPROM Data For the EEPROM write operation the EEDR Register contains the data to be written to the EEPROM in the address given by the EEAR Register. For the EEPROM read operation, the EEDR contains the data read out","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0048"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0049","chunkIndex":48,"heading":"• Bit 7 – Res: Reserved Bit","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","• Bit 7 – Res: Reserved Bit"],"preview":"• Bit 7 – Res: Reserved Bit This bit is reserved for future use and will always read as 0 in ATtiny25/45/85. For compatibility with future AVR devices, always write this bit to zero. After reading, mask out this bit. • Bit 6 – Res: Reserved","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0049"},{"chunkId":"ds_1f65a0ecd69948b21b13-chunk-0050","chunkIndex":49,"heading":"• Bits 5:4 – EEPM[1:0]: EEPROM Programming Mode Bits","headingPath":["Atmel 8-bit AVR Microcontroller with 2/4/8K Bytes In-System Programmable Flash","• Bits 5:4 – EEPM[1:0]: EEPROM Programming Mode Bits"],"preview":"","images":[],"readUrl":"https://www.embedr.app/api/datasheets/ds_1f65a0ecd69948b21b13/chunks/ds_1f65a0ecd69948b21b13-chunk-0050"}]}