ATTINY461V-10SU Atmel, ATTINY461V-10SU Datasheet

IC MCU AVR 4K FLASH 10MHZ 20SOIC

ATTINY461V-10SU

Manufacturer Part Number
ATTINY461V-10SU
Description
IC MCU AVR 4K FLASH 10MHZ 20SOIC
Manufacturer
Atmel
Series
AVR® ATtinyr
Datasheets

Specifications of ATTINY461V-10SU

Core Processor
AVR
Core Size
8-Bit
Speed
10MHz
Connectivity
USI
Peripherals
Brown-out Detect/Reset, POR, PWM, WDT
Number Of I /o
16
Program Memory Size
4KB (2K x 16)
Program Memory Type
FLASH
Eeprom Size
256 x 8
Ram Size
256 x 8
Voltage - Supply (vcc/vdd)
1.8 V ~ 5.5 V
Data Converters
A/D 11x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Package / Case
20-SOIC (7.5mm Width)
Processor Series
ATTINY4x
Core
AVR8
Data Bus Width
8 bit
Data Ram Size
256 B
Interface Type
2-Wire, SPI, USI
Maximum Clock Frequency
10 MHz
Number Of Programmable I/os
16
Number Of Timers
2
Operating Supply Voltage
2.7 V to 5.5 V
Maximum Operating Temperature
+ 85 C
Mounting Style
SMD/SMT
Minimum Operating Temperature
- 40 C
On-chip Adc
10 bit
Package
20SOIC W
Device Core
AVR
Family Name
ATtiny
Maximum Speed
10 MHz
For Use With
ATSTK600 - DEV KIT FOR AVR/AVR32ATAVRBC100 - REF DESIGN KIT BATTERY CHARGER770-1007 - ISP 4PORT ATMEL AVR MCU SPI/JTAG770-1004 - ISP 4PORT FOR ATMEL AVR MCU SPI
Lead Free Status / RoHS Status
Lead free / RoHS Compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
ATTINY461V-10SU
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
ATTINY461V-10SUR
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Features
High Performance, Low Power AVR
Advanced RISC Architecture
Non-volatile Program and Data Memories
Peripheral Features
Special Microcontroller Features
I/O and Packages
Operating Voltage:
Speed Grade:
Industrial Temperature Range
Low Power Consumption
– 123 Powerful Instructions – Most Single Clock Cycle Execution
– 32 x 8 General Purpose Working Registers
– Fully Static Operation
– 2/4/8K Byte of In-System Programmable Program Memory Flash
– 128/256/512 Bytes In-System Programmable EEPROM
– 128/256/512 Bytes Internal SRAM
– Data retention: 20 years at 85°C / 100 years at 25°C
– Programming Lock for Self-Programming Flash Program & EEPROM Data Security
– 8/16-bit Timer/Counter with Prescaler
– 8/10-bit High Speed Timer/Counter with Separate Prescaler
– 10-bit ADC
– On-chip Analog Comparator
– Programmable Watchdog Timer with Separate On-chip Oscillator
– Universal Serial Interface with Start Condition Detector
– debugWIRE On-chip Debug System
– In-System Programmable via SPI Port
– External and Internal Interrupt Sources
– Low Power Idle, ADC Noise Reduction, Standby and Power-Down Modes
– Enhanced Power-on Reset Circuit
– Programmable Brown-out Detection Circuit
– Internal Calibrated Oscillator
– On-chip Temperature Sensor
– 16 Programmable I/O Lines
– Available in 20-pin PDIP, 20-pin SOIC and 32-pad MLF
– 1.8 – 5.5V for ATtiny261V/461V/861V
– 2.7 – 5.5V for ATtiny261/461/861
– ATtiny261V/461V/861V: 0 – 4 MHz @ 1.8 – 5.5V, 0 – 10 MHz @ 2.7 – 5.5V
– ATtiny261/461/861: 0 – 10 MHz @ 2.7 – 5.5V, 0 – 20 MHz @ 4.5 – 5.5V
– Active Mode (1 MHz System Clock): 300 µA @ 1.8V
– Power-Down Mode: 0.1 µA at 1.8V
• Endurance: 10,000 Write/Erase Cycles
• Endurance: 100,000 Write/Erase Cycles
• 3 High Frequency PWM Outputs with Separate Output Compare Registers
• Programmable Dead Time Generator
• 11 Single-Ended Channels
• 16 Differential ADC Channel Pairs
• 15 Differential ADC Channel Pairs with Programmable Gain (1x, 8x, 20x, 32x)
®
8-Bit Microcontroller
8-bit
Microcontroller
with 2/4/8K
Bytes In-System
Programmable
Flash
ATtiny261/V
ATtiny461/V
ATtiny861/V
2588E–AVR–08/10

Related parts for ATTINY461V-10SU

ATTINY461V-10SU Summary of contents

Page 1

Features • High Performance, Low Power AVR • Advanced RISC Architecture – 123 Powerful Instructions – Most Single Clock Cycle Execution – General Purpose Working Registers – Fully Static Operation • Non-volatile Program and Data Memories – ...

Page 2

Pin Configurations Figure 1-1. Pinout ATtiny261/461/861 and ATtiny261V/461V/861V (MOSI/DI/SDA/OC1A/PCINT8) PB0 (MISO/DO/OC1A/PCINT9) PB1 (SCK/USCK/SCL/OC1B/PCINT10) PB2 (ADC7/OC1D/CLKI/XTAL1/PCINT12) PB4 (ADC8/OC1D/CLKO/XTAL2/PCINT13) PB5 (ADC9/INT0/T0/PCINT14) PB6 (ADC10/RESET/PCINT15) PB7 (OC1B/PCINT11) PB3 (ADC7/OC1D/CLKI/XTAL1/PCINT12) PB4 (ADC8/OC1D/CLKO/XTAL2/PCINT13) PB5 Note: To ensure mechanical stability the center pad underneath the QFN/MLF ...

Page 3

Pin Descriptions 1.1.1 VCC Supply voltage. 1.1.2 GND Ground. 1.1.3 AVCC Analog supply voltage. This is the supply voltage pin for the Analog-to-digital Converter (ADC), the analog comparator, the Brown-Out Detector (BOD), the internal voltage reference and Port A. ...

Page 4

Overview ATtiny261/461/861 are low-power CMOS 8-bit microcontrollers based on the AVR enhanced RISC architecture. By executing powerful instructions in a single clock cycle, the ATtiny261/461/861 achieves throughputs approaching 1 MIPS per MHz allowing the system designer to optimize power ...

Page 5

... The device is manufactured using Atmel’s high density non-volatile memory technology. The On-chip ISP Flash allows the Program memory to be re-programmed In-System through an SPI serial interface conventional non-volatile memory programmer On-chip boot code running on the AVR core ...

Page 6

... About 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 ...

Page 7

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 ...

Page 8

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 typ- ical ALU operation, two operands are output from the Register ...

Page 9

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.3.1 SREG – AVR Status Register Bit 0x3F (0x5F) Read/Write Initial Value • Bit 7 ...

Page 10

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 ...

Page 11

Y-register Z-register In different addressing modes these address registers function as 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 ...

Page 12

Figure 4-4. 1st Instruction Fetch 1st Instruction Execute 2nd Instruction Fetch 2nd Instruction Execute 3rd Instruction Fetch 3rd Instruction Execute 4th Instruction Fetch Figure 4-5 operation using two register operands is executed, and the result is stored back to the ...

Page 13

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 ...

Page 14

C Code Example _SEI(); _SLEEP(); Note: 4.7.1 Interrupt Response Time The interrupt execution response for all the enabled AVR interrupts is four clock cycles mini- mum. After four clock cycles the Program Vector address for the actual interrupt handling routine ...

Page 15

Memories This section describes the different memories in the ATtiny261/461/861. The AVR architecture has two main memory spaces, the Data memory and the Program memory space. In addition, the ATtiny261/461/861 features an EEPROM Memory for data storage. All three ...

Page 16

When using register indirect addressing modes with automatic pre-decrement and post-incre- ment, the address registers X, Y, and Z are decremented or incremented. The 32 general purpose working registers, 64 I/O Registers, and the 128/256/512 bytes of inter- nal data ...

Page 17

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 tion, however, lets the user software detect when the next byte can be written. If the ...

Page 18

The calibrated Oscillator is used to time the EEPROM accesses. Make sure the Oscillator fre- quency is within the requirements described in page 32. 5.3.6 Program Examples The following code examples show one assembly and one C function for erase, ...

Page 19

The next code examples show assembly and C functions for reading the EEPROM. The exam- ples assume that interrupts are controlled so that no interrupts will occur during execution of these functions. Assembly Code Example EEPROM_read: C Code Example unsigned ...

Page 20

If a reset occurs while a write operation is in progress, the write operation will be com- pleted provided that the power supply voltage is sufficient. 5.4 I/O Memory The I/O space definition of the ATtiny261/461/861 is shown ...

Page 21

EEARL – EEPROM Address Register Bit 0x1E (0x3E) Read/Write Initial Value • Bit 7 – EEAR7: EEPROM Address This is the most significant EEPROM address bit of ATtiny461. In devices with less EEPROM, i.e. ATtiny261, this bit is reserved ...

Page 22

Erase and Write operations in two different operations. The Programming times for the different modes are shown in Table 5-1. EEPM1 When EEPE is set, ...

Page 23

GPIOR1 – General Purpose I/O Register 1 Bit 0x0B (0x2B) Read/Write Initial Value 5.5.7 GPIOR0 – General Purpose I/O Register 0 Bit 0x0A (0x2A) Read/Write Initial Value 2588E–AVR–08/ MSB R/W R/W R/W R ...

Page 24

Clock System Figure 6-1 the clocks need not be active at a given time. In order to reduce power consumption, the clocks to modules not being used can be halted by using different sleep modes, as described in Management ...

Page 25

Flash Clock – clk FLASH The Flash clock controls operation of the Flash interface. The Flash clock is usually active simul- taneously with the CPU clock. 6.1.4 ADC Clock – clk ADC The ADC is provided with a dedicated ...

Page 26

The watchdog oscillator is used for timing this real-time part of the start-up time. The number of WD oscillator cycles used for each time-out is shown in Table 6-2. 6.2.1 External Clock To drive the device from ...

Page 27

The fast peripheral clock, clk prescaled version of the PLL output, clk a detailed illustration on the PLL clock system. Figure 6-3. XTAL1 XTAL2 The internal PLL is enabled when CKSEL fuse bits are programmed to ‘0001’and the PLLE bit ...

Page 28

When the PLL output is selected as clock source, the start-up times are determined by SUT fuse bits as shown in Table 6-5. SUT1 6.2.3 Calibrated Internal 8 MHz Oscillator By default, the Internal Oscillator provides ...

Page 29

It is possible to reach a higher accuracy than factory calibration by changing the OSCCAL regis- ter from software. See this calibration is shown as User calibration in When this oscillator is used as device clock, the Watchdog Oscillator will ...

Page 30

Crystal Oscillator / Ceramic Resonator XTAL1 and XTAL2 are input and output, respectively inverting amplifier which can be con- figured for use as an On-chip Oscillator, as shown in ceramic resonator may be used. Figure 6-4. C1 ...

Page 31

Table 6-12. CKSEL0 Notes: 6.2.7 Default Clock Source The device is shipped with CKSEL = “0010”, SUT = “10”, and CKDIV8 programmed. The default clock source setting is therefore the Internal Oscillator running at 8 ...

Page 32

From the time the CLKPS values are written, it takes between and T1 + 2*T2 before the new clock frequency is active. In this interval, two active clock edges are produced. Here the previous clock ...

Page 33

CLKPS bits are written. Rewriting the CLKPCE bit within this time-out period does neither extend the time-out period, nor clear the CLKPCE bit. 2588E–AVR–08/10 33 ...

Page 34

Bits 6:4 – Res: Reserved Bits These bits are reserved and will always read as zero. • Bits 3:0 – CLKPS3:0: Clock Prescaler Select Bits These bits define the division factor between the selected clock source ...

Page 35

Table 6-13. CLKPS3 2588E–AVR–08/10 Clock Prescaler Select (Continued) CLKPS2 CLKPS1 CLKPS0 Clock Division Factor 1 Reserved 0 Reserved 1 Reserved 35 ...

Page 36

Power Management and Sleep Modes The high performance and industry leading code efficiency makes the AVR microcontrollers an ideal choise for low power applications. In addition, sleep modes enable the application to shut down unused modules in the MCU, ...

Page 37

Idle mode enables the MCU to wake up from external triggered interrupts as well as internal ones like the Timer Overflow. If wake-up from the Analog Comparator interrupt is not required, the Analog Comparator can be powered down by setting ...

Page 38

Analog Comparator When entering Idle mode, the Analog Comparator should be disabled if not used. When entering ADC Noise Reduction mode, the Analog Comparator should be disabled. In the other sleep modes, the Analog Comparator is automatically disabled. However, ...

Page 39

Refer to able Register 1” on page 162 7.4 Register Description 7.4.1 MCUCR – MCU Control Register The MCU Control Register contains control bits for power management. Bit 0x35 (0x55) Read/Write Initial Value • Bit 5 – SE: Sleep Enable ...

Page 40

Bit 2 – PRTIM0: Power Reduction Timer/Counter0 Writing a logic one to this bit shuts down the Timer/Counter0 module. When the Timer/Counter0 is enabled, operation will continue like before the shutdown. • Bit 1 – PRUSI: Power Reduction USI ...

Page 41

System Control and Reset 8.0.1 Resetting the AVR During reset, all I/O Registers are set to their initial values, and the program starts execution from the Reset Vector. The instruction placed at the Reset Vector must be a RJMP ...

Page 42

Reset Sources The ATtiny261/461/861 has four sources of reset: • Power-on Reset. The MCU is reset when the supply voltage is below the Power-on Reset threshold (V • External Reset. The MCU is reset when a low level is ...

Page 43

External Reset An External Reset is generated by a low level on the RESET pin if enabled. Reset pulses longer than the minimum pulse width (see ate a reset, even if the clock is not running. Shorter pulses are ...

Page 44

Watchdog Reset When the Watchdog times out, it will generate a short reset pulse of one CK cycle duration. On the falling edge of this pulse, the delay timer starts counting the Time-out period t “Watchdog Timer” on page ...

Page 45

The Wathdog Timer can also be configured to generate an interrupt instead of a reset. This can be very helpful when using the Watchdog to wake-up from Power-down. To prevent unintentional disabling of the Watchdog or unintentional change of time-out ...

Page 46

In the same operation, write a logical one to WDCE and WDE. Even though the WDE always is set, the WDE must be written to one to start the timed sequence. 2. Within the next four clock cycles, in ...

Page 47

Register Description 8.4.1 MCUSR – MCU Status Register The MCU Status Register provides information on which reset source caused an MCU Reset. Bit 0x34 (0x54) Read/Write Initial Value • Bits 7:4 – Res: Reserved Bits These bits are reserved ...

Page 48

To avoid the Watchdog Reset, WDIE must be set after each interrupt. Table 8-2. WDE • Bit 4 – WDCE: Watchdog Change Enable This bit must be set when ...

Page 49

Bits 5, 2:0 – WDP3:0: Watchdog Timer Prescaler and 0 The WDP3:0 bits determine the Watchdog Timer prescaling when the Watchdog Timer is enabled. The different prescaling values and their corresponding Timeout Periods are shown in ...

Page 50

Interrupts This section describes the specifics of the interrupt handling as performed in ATtiny261/461/861. For a general explanation of the AVR interrupt handling, refer to on page 9.1 Interrupt Vectors Interrupt vectors of ATtiny261/461/861 are described in Table 9-1. ...

Page 51

External Interrupts The External Interrupts are triggered by the INT0 or INT1 pin or any of ...

Page 52

The start-up time is defined by the SUT and CKSEL Fuses as described in “Clock System” on page If the low level on the interrupt pin is removed before the device has woken up then program ...

Page 53

Control Register (MCUCR) define whether the external interrupt is activated on rising and/or fall- ing 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. ...

Page 54

PCMSK0 – Pin Change Mask Register A Bit 0x23 (0x43) Read/Write Initial Value • Bits 7:0 – PCINT7:0: Pin Change Enable Mask 7:0 Each PCINT7:0 bit selects whether pin change interrupt is enabled on the corresponding I/O pin. If ...

Page 55

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 ...

Page 56

Ports as General Digital I/O The ports are bi-directional I/O ports with optional internal pull-ups. tional description of one I/O-port pin, here generically called Pxn. Figure 10-2. General Digital I/O Pxn Note: 10.1.1 Configuring the Pin Each port pin ...

Page 57

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 ...

Page 58

Figure 10-3. Synchronization when Reading an Externally Applied Pin value SYSTEM CLK INSTRUCTIONS SYNC LATCH 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 ...

Page 59

Digital Input Enable and Sleep Modes As shown in schmitt-trigger. The signal denoted SLEEP in the figure, is set by the MCU Sleep Controller in Power-down mode, Power-save mode, and Standby mode to avoid high power consumption if some ...

Page 60

C Code Example unsigned char i; ... /* Define pull-ups and set outputs high */ /* Define directions for port pins */ PORTB = (1<<PB4)|(1<<PB1)|(1<<PB0); DDRB = (1<<DDB3)|(1<<DDB2)|(1<<DDB1)|(1<<DDB0); /* Insert nop for synchronization*/ _NOP(); /* Read port pins */ i ...

Page 61

Figure 10-5. Alternate Port Functions Pxn PUOExn: PUOVxn: DDOExn: DDOVxn: PVOExn: PVOVxn: DIEOExn: Pxn DIGITAL INPUT-ENABLE OVERRIDE ENABLE DIEOVxn: Pxn DIGITAL INPUT-ENABLE OVERRIDE VALUE SLEEP: PTOExn: Note: 2588E–AVR–08/10 (1) PUOExn PUOVxn 1 0 DDOExn DDOVxn 1 0 PVOExn PVOVxn 1 ...

Page 62

Table 10-2 ure 10-5 in the modules having the alternate function. Table 10-2. Signal Name PUOE PUOV DDOE DDOV PVOE PVOV PTOE DIEOE DIEOV DI AIO The following subsections shortly describe the alternate functions for each port, and relate the ...

Page 63

Alternate Functions of Port A The Port A pins with alternate function are shown in Table 10-3. • Port A, Bit 7 – ADC6/AIN0/PCINT7 • ADC6: Analog to Digital Converter, Channel 6 • AIN0: Analog Comparator Input. Configure the ...

Page 64

Port A, Bit 5 – ADC4/AIN2/PCINT5 • ADC4: Analog to Digital Converter, Channel 4. • AIN2: Analog Comparator Input. Configure the port pin as input with the internal pull-up switched off to avoid the digital port function from interfering ...

Page 65

Table 10-4 shown in Table 10-4. Signal Name PUOE PUOV DDOE DDOV PVOE PVOV PTOE DIEOE DIEOV DI AIO Table 10-5. Signal Name PUOE PUOV DDOE DDOV PVOE PVOV PTOE DIEOE DIEOV DI AIO 2588E–AVR–08/10 and Table 10-5 relate the ...

Page 66

Alternate Functions of Port B The Port B pins with alternate function are shown in Table 10-6. • Port B, Bit 7 – RESET/ dW/ ADC10/ PCINT15 • RESET, Reset pin: When the RSTDISBL Fuse is programmed, this pin ...

Page 67

ADC10: ADC input Channel 10. Note that ADC input channel 10 uses analog power. • PCINT15: Pin Change Interrupt source 15. • Port B, Bit 6 – ADC9/ T0/ INT0/ PCINT14 • ADC9: ADC input Channel 9. Note that ...

Page 68

Port B, Bit 1 – MISO/ DO/ OC1A/ PCINT9 • DO: Three-wire mode Universal Serial Interface Data output. Three-wire mode Data output overrides PORTB1 value and it is driven to the port when data direction bit DDB1 is set ...

Page 69

Table 10-8. Signal Name PUOE PUOV DDOE DDOV PVOE PVOV PTOE DIEOE DIEOV DI AIO Note: 10.3 Register Description 10.3.1 MCUCR – MCU Control Register Bit 0x35 (0x55) Read/Write Initial Value • Bit 6 – PUD: Pull-up Disable When this ...

Page 70

PINA – Port A Input Pins Address Bit 0x19 (0x39) Read/Write Initial Value 10.3.5 PORTB – Port B Data Register Bit 0x18 (0x38) Read/Write Initial Value 10.3.6 DDRB – Port B Data Direction Register Bit 0x17 (0x37) Read/Write Initial ...

Page 71

Timer/Counter0 11.1 Features • Clear Timer on Compare Match (Auto Reload) • One Input Capture unit • Four Independent Interrupt Sources (TOV0, OCF0A, OCF0B, ICF0) • 8-bit Mode with Two Independent Output Compare Units • 16-bit Mode with One ...

Page 72

Timer Interrupt Flag Register (TIFR). All interrupts are individually masked with the Timer Interrupt Mask Register (TIMSK). TIFR and TIMSK are not shown in the figure. In 16-bit mode one more 8-bit register is available, the Timer/Counter0 ...

Page 73

Figure 11-2. Prescaler for Timer/Counter0 clk I/O PSR0 T0 Note: The prescaled clock has a frequency of f Table 11-4 on page 85 11.3.1.1 Prescaler Reset The prescaler is free running, i.e. it operates independently of the Clock Select logic ...

Page 74

Figure 11-3. T0 Pin Sampling Tn clk I/O The synchronization and edge detector logic introduces a delay of 2.5 to 3.5 system clock cycles from an edge has been applied to the T0 pin to the counter is updated. Enabling ...

Page 75

Clock Select bits (CS02:0). When no clock source is selected (CS02 the timer is stopped. However, the TCNT0 value can be accessed by the CPU, regardless of whether clk counter clear or ...

Page 76

TCNT0 value is copied into Input Capture Register. If enabled (TICIE0=1), the Input Capture Flag generates an Input Capture interrupt. The ICF0 flag is auto- matically cleared when the interrupt is executed. Alternatively the ...

Page 77

OCF0B, but in 16-bit mode the match can set only the Output Compare Flag OCF0A as there is only one Output Compare Unit. If the corresponding interrupt is enabled, the Output Compare Flag generates an Output Compare interrupt. The Output ...

Page 78

Normal, 8-bit Mode In Normal 8-bit mode (see when it passes its maximum 8-bit value (MAX = 0xFF) and then restarts from the bottom (0x00). The Overflow Flag (TOV0) is set in the same timer clock cycle as when ...

Page 79

Normal mode, a new counter value can be written anytime. The Output Compare Unit can be used to generate interrupts at some given time. 11.7.4 8-bit Input Capture Mode The Timer/Counter0 can also be used ...

Page 80

Figure 11-9. Timer/Counter Timing Diagram, Setting of OCF0x, with Prescaler (f clk I/O clk Tn (clk /8) I/O TCNTn OCRnx OCFnx Figure 11-10 Figure 11-10. Timer/Counter Timing Diagram, CTC mode, with Prescaler (f clk PCK clk Tn (clk /8) PCK ...

Page 81

The following code examples show how to access the 16-bit timer registers assuming that no interrupts updates the temporary register. The same principle can be used directly for accessing the OCR0A/B registers. Assembly Code Example C Code Example unsigned int ...

Page 82

The following code examples show how atomic read of the TCNT0 register contents. Reading any of the OCR0 register can be done by using the same principle. Assembly Code Example TIM0_ReadTCNT0: ; Save global interrupt flag in ...

Page 83

The following code examples show how atomic write of the TCNT0H/L register con- tents. Writing any of the OCR0A/B registers can be done by using the same principle. Assembly Code Example TIM0_WriteTCNT0: C Code Example void TIM0_WriteTCNT0( ...

Page 84

Register Description 11.10.1 TCCR0A – Timer/Counter0 Control Register A Bit 0x15 (0x35) Read/Write Initial Value • Bit 7 – TCW0: Timer/Counter0 Width When this bit is written to one 16-bit mode is selected as described Timer/Counter0 width is set ...

Page 85

TCCR0B – Timer/Counter0 Control Register B Bit 0x33 (0x53) Read/Write Initial Value • Bit 4 – TSM: Timer/Counter Synchronization Mode Writing the TSM bit to one activates the Timer/Counter Synchronization mode. In this mode, the value that is written ...

Page 86

TCNT0H – Timer/Counter0 Register High Byte Bit 0x14 (0x34) Read/Write Initial Value When 16-bit mode is selected (the TCW0 bit is set to one) the Timer/Counter Register TCNT0H combined to the Timer/Counter Register TCNT0L gives direct access, both for ...

Page 87

Compare Match in Timer/Counter0 occurs, i.e., when the OCF0A bit is set in the Timer/Counter 0 Interrupt Flag Register – TIFR0. • Bit 3 – OCIE0B: Timer/Counter Output Compare Match B Interrupt Enable When the OCIE0B bit is ...

Page 88

Bit 1 – TOV0: Timer/Counter0 Overflow Flag The bit TOV0 is set when an overflow occurs in Timer/Counter0. TOV0 is cleared by hardware when executing the corresponding interrupt handling vector. Alternatively, TOV0 is cleared by writing a logic one ...

Page 89

Timer/Counter1 12.1 Features • 8/10-Bit Accuracy • Three Independent Output Compare Units • Clear Timer on Compare Match (Auto Reload) • Glitch Free, Phase and Frequency Correct Pulse Width Modulator (PWM) • Variable PWM Period • High Speed Asynchronous ...

Page 90

ATtiny261V/461V/861V” on ...

Page 91

TCCR1A, TCCR1B, TCCR1C, TCCR1D, OCR1A, OCR1B, OCR1C and OCR1D can be read back right after writing the register. The read back values are delayed for the Timer/Counter1 (TCNT1) register, Timer/Counter1 High Byte Register (TC1H) and flags (OCF1A, OCF1B, OCF1D and ...

Page 92

The definitions in document. Table 12-1. Constant BOTTOM MAX TOP 12.3 Clock Sources The Timer/Counter is clocked internally, either from CK or PCK. See bits CSxx in page 116 12.3.1 Prescaler Figure 12-3 nous clocking ...

Page 93

Prescaler Reset Setting the PSR1 bit in TCCR1B register resets the prescaler possible to use the Prescaler Reset for synchronizing the Timer/Counter to program execution. 12.3.1.2 Prescaler Initialization for Asynchronous Mode To change Timer/Counter1 to the asynchronous ...

Page 94

Counter Initialization for Asynchronous Mode To set Timer/Counter1 to asynchronous mode follow the procedure below: 1. Enable PLL. 2. Wait 100 µs for PLL to stabilize. 3. Poll the PLOCK bit until it is set. 4. Set the PCKE ...

Page 95

PWM pulses, thereby making the output glitch-free. See During the time between the write and the update operation, a read from OCR1A, OCR1B, OCR1C or OCR1D will read the contents of the temporary location. This means that the most ...

Page 96

Dead Time Generator The Dead Time Generator is provided for the Timer/Counter1 PWM output pairs to allow driving external power control switches safely. The Dead Time Generator is a separate block that can be used to insert dead times ...

Page 97

The outputs OC1x and OC1x are inverted, if the PWM Inversion Mode bit PWM1X is set. This will also cause both outputs to be high during the dead time. The length of the counting period is user adjustable by ...

Page 98

Figure 12-10. Compare Match Output Unit, Schematic clk I/O The general I/O port function is overridden by the Output Compare (OC1x / OC1x) from the Dead Time Generator if either of the COM1x1:0 bits are set. However, the OC1x pin ...

Page 99

The design of the Output Compare Pin Configuration logic allows initialization of the OC1x state before the output is enabled. Note that some COM1x1:0 bit settings are reserved for certain modes of operation. For Output Compare Pin Configurations refer to ...

Page 100

The counter value (TCNT1) that is shown as a histogram in counter value matches the TOP value. The counter is then cleared at the following clock cycle The diagram includes the Waveform Output (OCW1x) in toggle Compare Mode. The small ...

Page 101

DAC applications. High frequency allows physically small sized external components (coils, capacitors), and therefore reduces total system cost. The timing diagram for the fast PWM mode is shown in mented until the counter value matches the TOP value. The counter ...

Page 102

COM1x1:0 bits.) A frequency (with 50% duty cycle) waveform output in fast PWM mode can be achieved by set- ting the Waveform Output ...

Page 103

Figure 12-13. Phase and Frequency Correct PWM Mode, Timing Diagram TCNTn OCWnx (COMnx = 2) OCWnx (COMnx = 3) Period The Timer/Counter Overflow Flag (TOV1) is set each time the counter reaches BOTTOM. The Interrupt Flag can be used to ...

Page 104

The configurations of the Output Compare Pins are described in Table 12-4. COM1x1 12.8.4 PWM6 Mode The PWM6 Mode (PWM1A = 1, WGM11:10 ...

Page 105

Figure 12-14. PWM6 Mode, Single-slope Operation, Timing Diagram TCNT1 OCW1A OC1OE0 OC1A Pin OC1OE1 OC1A Pin OC1OE2 OC1B Pin OC1OE3 OC1B Pin OC1OE4 OC1D Pin OC1OE5 OC1D Pin The general I/O port function is overridden by the Output Compare value ...

Page 106

Table 12-7. COM1D1 12.9 Timer/Counter Timing Diagrams The Timer/Counter is a synchronous design and the timer clock (clk clock enable signal in the following figures. The figures include information on when Interrupt Flags are set. Figure ...

Page 107

Figure 12-17. Timer/Counter Timing Diagram, Setting of OCF1x, with Prescaler (f clk PCK clk Tn (clk /8) PCK TCNTn OCRnx OCFnx Figure 12-18 Figure 12-18. Timer/Counter Timing Diagram, with Prescaler (f clk PCK clk Tn (clk /8) PCK TCNTn TOVn ...

Page 108

The Fault Protection Enable (FPEN1) is automatically cleared at the same system clock as the COM1nx bits are cleared. If the Fault Protection Interrupt Enable bit (FPIE1) is set, a Fault Protection interrupt is generated and the FPEN1 bit ...

Page 109

Code Examples The following code examples show how to access the 10-bit timer registers assuming that no interrupts updates the TC1H register. The same principle can be used directly for accessing the OCR1A/B/C/D registers. Assembly Code Example C Code ...

Page 110

The following code examples show how atomic read of the TCNT1 register contents. Reading any of the OCR1A/B/C/D registers can be done by using the same principle. Assembly Code Example TIM1_ReadTCNT1: ; Save global interrupt flag in ...

Page 111

The following code examples show how atomic write of the TCNT1 register contents. Writing any of the OCR1A/B/C/D registers can be done by using the same principle. Assembly Code Example TIM1_WriteTCNT1: C Code Example void TIM1_WriteTCNT1( unsigned ...

Page 112

Register Description 12.12.1 TCCR1A – Timer/Counter1 Control Register A Bit 0x30 (0x50) Read/Write Initial value • Bits 7,6 – COM1A1, COM1A0: Comparator A Output Mode, Bits 1 and 0 These bits control the behaviour of the Waveform Output (OCW1A) ...

Page 113

Table 12-10 are set to Phase and Frequency Correct PWM Mode. Table 12-10. Compare Output Mode, Phase and Frequency Correct PWM Mode COM1A1 Table 12-11 are set to single-slope PWM6 Mode. In the PWM6 Mode the ...

Page 114

Bits 5,4 – COM1B1, COM1B0: Comparator B Output Mode, Bits 1 and 0 These bits control the behaviour of the Waveform Output (OCW1B) and the connection of the Output Compare pin (OC1B). If one or both of the COM1B1:0 ...

Page 115

COM1B1S and COM1B0S in TCCR1C will show here. See Register C” on page • Bit 3 – FOC1A: Force Output Compare Match 1A The FOC1A bit is only active when the PWM1A bit specify a non-PWM mode. Writing a logical ...

Page 116

The dedicated Dead Time prescaler in front of the Dead Time Generator can divide the Timer/Counter1 clock (PCK or CK providing a large range of dead times that can be generated. The Dead Time ...

Page 117

TCCR1C – Timer/Counter1 Control Register C Bit 0x27 (0x47) Read/Write Initial value • Bits 7,6 – COM1A1S, COM1A0S: Comparator A Output Mode, Shadow Bits 1 and 0 These are shadow bits of COM1A1 and COM1A0 in TCCR1A. Writing to ...

Page 118

Table 12-20 set to Phase and Frequency Correct PWM Mode. Table 12-20. Compare Output Mode, Phase and Frequency Correct PWM Mode COM1D1 • Bit 1 – FOC1D: Force Output Compare Match 1D The FOC1D bit is ...

Page 119

Bit 3 – FPAC1: Fault Protection Analog Comparator Enable When written logic one, this bit enables the Fault Protection function in Timer/Counter1 to be triggered by the Analog Comparator. The comparator output is in this case directly connected to ...

Page 120

Output Compare Override Enable Bit is cleared. Override Enable Bits and their corresponding Output Compare pins. Table 12-22. Output Compare Override Enable Bits vs. Output Compare Pins Output CompareOverride Enable Bit OC1OE0 OC1OE1 OC1OE2 OC1OE3 OC1OE4 OC1OE5 12.12.6 PLLCSR ...

Page 121

TCNT1 – Timer/Counter1 Bit 0x2E (0x4E) Read/Write Initial value This 8-bit register contains the value of Timer/Counter1. The Timer/Counter1 is realized as a 10-bit up/down counter with read and write access. Due to synchronization of the CPU, Timer/Counter1 data ...

Page 122

OCR1B – Timer/Counter1 Output Compare Register B Bit 0x2C (0x4C) Read/Write Initial value The output compare register 8-bit read/write register. The Timer/Counter Output Compare Register B contains data to be continuously compared with Timer/Counter1. Actions on ...

Page 123

Note that, if 10-bit accuracy is used special procedures must be followed when accessing the internal 10-bit Output Compare Registers via the 8-bit AVR data bus. These procedures are described in section 12.12.13 TIMSK – Timer/Counter1 Interrupt Mask Register Bit ...

Page 124

Alternatively, OCF1A is cleared, after synchroniza- tion clock cycle, by writing a logic one to the flag. When the I-bit in SREG, OCIE1A, and OCF1A are set (one), the Timer/Counter1 A compare match interrupt is ...

Page 125

USI – Universal Serial Interface 13.1 Features • Two-wire Synchronous Data Transfer (Master or Slave) • Three-wire Synchronous Data Transfer (Master or Slave) • Data Received Interrupt • Wakeup from Idle Mode • In Two-wire Mode: Wake-up from All ...

Page 126

The 4-bit counter can be both read and written via the data bus, and it can generate an overflow interrupt. The data register and the counter are clocked simultaneously by the same clock source, allowing the counter to count the ...

Page 127

Figure 13-3. Three-wire Mode, Timing Diagram CYCLE USCK USCK DO DI The Three-wire mode timing is shown in Figure 13-3. At the top of the figure is a USCK cycle ref- erence. One bit is shifted into the USI Data ...

Page 128

SPITransfer_loop: 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 ...

Page 129

SPI Slave Operation Example The following code demonstrates how to use the USI module as a SPI Slave: init: ... SlaveSPITransfer: SlaveSPITransfer_loop: The code is size optimized using only eight instructions (+ ret). The code example assumes that the ...

Page 130

Figure 13-4. Two-wire Mode Operation, Simplified Diagram The data direction is not given by the physical layer. A protocol, like the one used by the TWI- bus, must be implemented to control the data flow. Figure 13-5. Two-wire Mode, Typical ...

Page 131

The master set the first bit to be transferred and releases the SCL line (C). The slave samples the data and shifts it into the USI Data Register at the positive edge of the SCL clock. 4. After eight ...

Page 132

Alternative USI Usage The flexible design of the USI allows used for other tasks when serial communication is not needed. Below are some examples. 13.4.1 Half-Duplex Asynchronous Data Transfer Using the USI Data Register in three-wire ...

Page 133

USIBR – USI Buffer Register Bit 0x10 (0x30) Read/Write Initial Value The content of the Serial Register is loaded to the USI Buffer Register when the trasfer is com- pleted, and instead of accessing the USI Data Register (the ...

Page 134

The 4-bit counter increments by one for each clock generated either by the external clock edge detector Timer/Counter0 Compare Match software using USICLK or USITC strobe bits. The clock source depends of the setting of the ...

Page 135

Table 13-1. USIWM1 1 1 Note: • Bits 3:2 – USICS1:0: Clock Source Select These bits set the clock source for the USI Data Registerr and counter. The data output latch ensures that the output is changed at the opposite ...

Page 136

Table 13-2. USICS1 • Bit 1 – USICLK: Clock Strobe Writing a one to this bit location strobes the USI Data Register to shift one step and the counter to increment by one, provided that the USICS1:0 ...

Page 137

AC – Analog Comparator The analog comparator compares the input values on the selectable positive pin (AIN0, AIN1 or AIN2) and selectable negative pin (AIN0, AIN1 or AIN2). When the voltage on the positive pin is higher than the ...

Page 138

Table 14-1. ACME ATtiny261/461/861 ...

Page 139

Register Description 14.2.1 ACSRA – Analog Comparator Control and Status Register A Bit 0x08 (0x28) Read/Write Initial Value • Bit 7 – ACD: Analog Comparator Disable When this bit is written logic one, the power to the analog comparator ...

Page 140

Bits 1, 0 – ACIS1, ACIS0: Analog Comparator Interrupt Mode Select These bits determine which comparator events that trigger the Analog Comparator interrupt. The different settings are shown in Table 14-2. ACIS1 When changing the ...

Page 141

AREF pin and the digital input from this pin is not needed, this bit should be written logic one to reduce power consumption in the digital input buffer. 14.2.4 DIDR1 – Digital Input Disable Register 1 Bit ...

Page 142

ADC – Analog to Digital Converter 15.1 Features • 10-bit Resolution • 1.0 LSB Integral Non-linearity • ± 2 LSB Absolute Accuracy • 13µs Conversion Time • 15 kSPS at Maximum Resolution • 11 Multiplexed Single Ended Input Channels ...

Page 143

Figure 15-1. Analog to Digital Converter Block Schematic 8-BIT DATA BUS VCC AREF INTERNAL 2.56/1.1V AGND ADC10 ADC9 ADC8 ADC7 ADC6 ADC5 ADC4 ADC3 ADC2 ADC1 ADC0 15.3 Operation The ADC converts an analog input voltage to a 10-bit digital ...

Page 144

AREF pin to improve noise immunity. The analog input channel and differential gain are selected by writing to the MUX5:0 bits in ADMUX. Any of the 11 ADC input pins ...

Page 145

If another positive edge occurs on the trigger signal during con- version, the edge will be ignored. Note that an Interrupt Flag will be set even if the specific interrupt is disabled or the Global ...

Page 146

Figure 15-3. ADC Prescaler When initiating a single ended conversion by setting the ADSC bit in ADCSRA, the conversion starts at the following rising edge of the ADC clock cycle. A normal conversion takes 13 ADC clock cycles. The first ...

Page 147

Figure 15-5. ADC Timing Diagram, Single Conversion Cycle Number ADC Clock ADSC ADIF ADCH ADCL When Auto Triggering is used, the prescaler is reset when the trigger event occurs. See 15-6. This assures a fixed delay from the trigger event ...

Page 148

Figure 15-7. ADC Timing Diagram, Free Running Conversion For a summary of conversion times, see Table 15-1. Condition First conversion Normal conversions Auto Triggered conversions 15.6 Changing Channel or Reference Selection The MUX5:0 and REFS2:0 bits in the ADCSRB and ...

Page 149

When ADATE or ADEN is cleared. • During conversion, minimum one ADC clock cycle after the trigger event. • After a conversion, before the Interrupt Flag used as trigger source is cleared. When updating ADMUX in one of these ...

Page 150

Analog Input Circuitry The analog input circuitry for single ended channels is illustrated in source applied to ADCn is subjected to the pin capacitance and input leakage of that pin, regard- less of whether that channel is selected as ...

Page 151

ADC Noise Reduction Mode 15.10 ADC Accuracy Definitions An n-bit single-ended ADC converts a voltage linearly between GND and V (LSBs). The lowest code is read as 0, and the ...

Page 152

Gain Error: After adjusting for offset, the Gain Error is found as the deviation of the last transition (0x3FE to 0x3FF) compared to the ideal transition (at 1.5 LSB below maximum). Ideal value: 0 LSB Figure 15-10. Gain Error ...

Page 153

Differential Non-linearity (DNL): The maximum deviation of the actual code width (the interval between two adjacent transitions) from the ideal code width (1 LSB). Ideal value: 0 LSB. Figure 15-12. Differential Non-linearity (DNL) • Quantization Error: Due to the ...

Page 154

LSB. The result is presented in one- sided form, from 0x3FF to 0x000. 15.11.2 Unipolar Differential Conversion If differential channels and an unipolar input mode are used, the result is where V ...

Page 155

Better accuracies are achieved by using two temperature points for calibration. Table 15-2. Temperature ADC The values described in temperature sensor output voltage varies from one chip to another capable of achieving more ...

Page 156

Special care should be taken when changing differential channels. Once a differential channel has been selected the input stage may take a while to stabilize therefore recommended to force the ADC to perform a long conversion when changing ...

Page 157

Selecting the single-ended channel ADC11 enables the temperature sensor. Refer to Table 15-4. MUX5:0 000000 000001 000010 000011 000100 000101 000110 000111 001000 001001 001010 001011 001100 001101 001110 001111 010000 010001 010010 010011 010100 ...

Page 158

Table 15-4. MUX5:0 100000 100001 100010 100011 100100 100101 100110 100111 101000 101001 101010 101011 101100 101101 101110 101111 110000 110001 110010 110011 110100 110101 110110 110111 111000 111001 111010 111011 111100 111101 111110 111111 Note: ATtiny261/461/861 158 Input Channel ...

Page 159

If these bits are changed during a conversion, the change will not go into effect until this conver- sion is complete (ADIF in ADCSRA is set). 15.13.2 ADCSRA – ADC Control and Status Register A Bit 0x06 (0x26) Read/Write Initial ...

Page 160

Table 15-5. ADPS2 15.13.3 ADCL and ADCH – The ADC Data Register 15.13.3.1 ADLAR = 0 Bit 0x05 (0x25) 0x04 (0x24) Read/Write Initial Value 15.13.3.2 ADLAR = 1 Bit 0x05 (0x25) 0x04 (0x24) Read/Write Initial Value When an ADC conversion ...

Page 161

ADCSRB – ADC Control and Status Register B Bit 0x03 (0x23) Read/Write Initial Value • Bit 7 – BIN: Bipolar Input Mode The gain stage is working in the unipolar mode as default, but the bipolar mode can be ...

Page 162

Table 15-6. ADTS2 15.13.5 DIDR0 – Digital Input Disable Register 0 Bit 0x01 (0x21) Read/Write Initial Value • Bits 7:4,2:0 – ADC6D:ADC0D: ADC6:0 Digital Input Disable When this bit is written logic one, the digital input buffer on the corresponding ...

Page 163

On-chip Debug System 16.1 Features • Complete Program Flow Control • Emulates All On-chip Functions, Both Digital and Analog , except RESET Pin • Real-time Operation • Symbolic Debugging Support (Both at C and Assembler Source Level, or ...

Page 164

When designing a system where debugWIRE will be used, the following must be observed: • Pull-Up resistor on the dW/(RESET) line must be in the range of 10k to 20 kΩ. However, the pull-up resistor is optional. • Connecting the ...

Page 165

Self-Programming the Flash The device provides a Self-Programming mechanism for downloading and uploading program code by the MCU itself. The Self-Programming can use any available data interface and associ- ated protocol to read code and write (program) that code ...

Page 166

If the EEPROM is written in the middle of an SPM Page Load operation, all data loaded will be lost. 17.3 Performing a Page Write To execute Page Write, set up the address in the Z-pointer, write “00000101” to SPMCSR ...

Page 167

EEPROM Write Prevents Writing to SPMCSR Note that an EEPROM write operation will block all software programming to Flash. Reading the Fuses and Lock bits from software will also be prevented during the EEPROM write operation recommended ...

Page 168

To read the Fuse High Byte (FHB), simply replace the address in the Z-pointer with 0x0003 and repeat the procedure above. If successful, the contents of the destination register are as follows. Bit Rd Refer to To read the Fuse ...

Page 169

Register Description 17.9.1 SPMCSR – Store Program Memory Control and Status Register The Store Program Memory Control and Status Register contains the control bits needed to con- trol the Program memory operations. Bit 0x37 (0x57) Read/Write Initial Value • ...

Page 170

Memory Programming This section describes the different methods for programming ATtiny261/461/861 memories. 18.1 Program And Data Memory Lock Bits The ATtiny261/461/861 provides two lock bits which can be left unprogrammed (“1”) or can be programmed (“0”) to obtain the ...

Page 171

Fuse Bytes The ATtiny261/461/861 have three fuse bytes. briefly the functionality of all the fuses and how they are mapped into the fuse bytes. Note that the fuses are read as logical zero, “0”, if they are programmed. Table ...

Page 172

... Fuse which will take effect once it is programmed. Fuses are also latched on power-up. 18.3 Signature Bytes All Atmel microcontrollers have a three-byte signature code which identifies the device. This code can be read in both serial and High-voltage Programming mode, also when the device is locked. The three bytes reside in a separate address space. The ATtiny261/461/861signature bytes are given in Table 18-6 ...

Page 173

Calibration Byte Signature area of the ATtiny261/461/861 has one byte of calibration data for the internal RC Oscillator. This byte resides in the high byte of address 0x000. During reset, this byte is auto- matically written into the OSCCAL ...

Page 174

After RESET is set low, the Programming Enable instruction needs to be executed first before program/erase operations can be executed. Table 18-9. Note: When programming the EEPROM, an auto-erase cycle is built into the self-timed programming operation (in the Serial ...

Page 175

Flash write operation completes can result in incorrect programming 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 ...

Page 176

... 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. ATtiny261/461/861 ...

Page 177

Figure 18-2. Serial Programming Instruction example Load Program Memory Page (High/Low Byte)/ Load EEPROM Memory Page (page access) Byte 1 Byte 2 Adr Adr MSB Bit the LSB in RDY/BSY ...

Page 178

Figure 18-3. Parallel Programming. Table 18-12. Pin Name Mapping Signal Name in Programming Mode XA1/BS2 PAGEL/BS1 RDY/BSY DATA I/O ATtiny261/461/861 178 WR PB0 XA0 PB1 XA1/BS2 PB2 PAGEL/BS1 PB3 XTAL1/PB4 OE PB5 RDY/BSY PB6 +12 V RESET GND Pin Name ...

Page 179

Table 18-13. Pin Values Used to Enter Programming Mode The XA1/XA0 pins determine the action executed when the XTAL1 pin is given a positive pulse. The bit coding is shown in Table 18-14. XA1 and XA0 Coding XA1 0 0 ...

Page 180

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. ...

Page 181

Load Data Low Byte: a. Set XA1, XA0 to “01”. This enables data loading. b. Set DATA = Data low byte (0x00 - 0xFF). c. Give XTAL1 a positive pulse. This loads the data byte. 4. Load Data High ...

Page 182

Figure 18-4. Addressing the Flash Which is Organized in Pages PROGRAM MEMORY Note: In the figure below, “XX” means don’t care. The numbers in the figure refer to the programming description above. WR Figure 18-5. Flash Programming Waveforms STEP DATA ...

Page 183

The programming algorithm for the EEPROM data memory is as follows (refer to Data loading Load Command “0001 0001” Load Address High Byte (0x00 - 0xFF Load Address Low Byte (0x00 - ...

Page 184

Reading the EEPROM The algorithm for reading the EEPROM memory is as follows (refer to on page 180 1. A: Load Command “0000 0011” Load Address High Byte (0x00 - 0xFF Load Address Low Byte ...

Page 185

Figure 18-7. Programming the FUSES Waveforms DATA XA1/BS2 XA0 PAGEL/BS1 XTAL1 WR RDY/BSY RESET +12V OE 18.7.12 Programming the Lock Bits The algorithm for programming the Lock bits is as follows (refer to page 180 1. A: Load Command “0010 ...

Page 186

Figure 18-8. Mapping Between BS1, BS2 and the Fuse and Lock Bits During Read Fuse Low Byte Extended Fuse Byte Fuse High Byte 18.7.14 Reading the Signature Bytes The algorithm for reading the Signature bytes is as follows (refer to ...

Page 187

Electrical Characteristics 19.1 Absolute Maximum Ratings* Operating Temperature.................................. -55°C to +125°C Storage Temperature ..................................... -65°C to +150°C Voltage on any Pin except RESET with respect to Ground ................................-0. Voltage on RESET with respect to Ground......-0.5V to +13.0V ...

Page 188

Table 19-1. DC Characteristics. T Symbol Parameter (7) Power Supply Current I CC (8) Power-down mode Notes: 1. Typical values at +25°C. 2. “Min” means the lowest value where the pin is guaranteed to be read as high. 3. “Max” ...

Page 189

Figure 19-2. Maximum Frequency vs. V 19.4 Clock Characteristics 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 ...

Page 190

Table 19-3. External Clock Drive Characteristics Symbol Parameter 1/t Clock Frequency CLCL t Clock Period CLCL t High Time CHCX t Low Time CLCX t Rise Time CLCH t Fall Time CHCL Δ t Change in period from one clock ...

Page 191

Brown-Out Detection Table 19-6. Note: 2588E–AVR–08/10 (1) BODLEVEL Fuse Coding BODLEVEL[2:0] Fuses Min V 111 110 101 100 0XX 1. V may be below nominal minimum operating voltage for some devices. For devices where BOT this is the case, ...

Page 192

ADC Characteristics Table 19-7. ADC Characteristics, Single Ended Channels -40°C to +85°C Symbol Parameter Resolution Absolute accuracy (Including INL, DNL, and Quantization, Gain and Offset Errors) Integral Non-Linearity (INL) (Accuracy after Offset and Gain Calibration) Differential Non-linearity ...

Page 193

Serial Programming Characteristics Figure 19-4. Serial Programming Waveforms SERIAL DATA INPUT SERIAL DATA OUTPUT SERIAL CLOCK INPUT Figure 19-5. Serial Programming Timing Table 19-8. Symbol 1/t CLCL t CLCL 1/t CLCL t CLCL t SHSL t SLSH t OVSH ...

Page 194

Parallel Programming Characteristics Figure 19-6. Parallel Programming Timing, Including some General Timing Requirements XTAL1 Data & Contol (DATA, XA0, XA1/BS2, PAGEL/BS1) WR RDY/BSY Figure 19-7. Parallel Programming Timing, Loading Sequence with Timing Requirements LOAD ADDRESS (LOW BYTE) XTAL1 PAGEL/BS1 ...

Page 195

Figure 19-8. Parallel Programming Timing, Reading Sequence (within the Same Page) with Timing Requirements LOAD ADDRESS (LOW BYTE) XTAL1 PAGEL/BS1 OE DATA ADDR0 (Low Byte) XA0 XA1/BS2 Note: The timing requirements shown in Table 19-9. Symbol ...

Page 196

Table 19-9. Symbol t BVDV t OLDV t OHDZ Notes: ATtiny261/461/861 196 Parallel Programming Characteristics, V Parameter BS1 Valid to DATA valid OE Low to DATA Valid OE High to DATA Tri-stated valid for the Write Flash, ...

Page 197

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 indica- tions of how the part will ...

Page 198

Table 20-2. PRR bit PRTIM1 PRTIM0 PRUSI PRADC It is possible to calculate the typical current consumption based on the numbers from for other V 20.1.0.1 Example Calculate the expected current consumption in idle mode with TIMER0, ADC, and USI ...

Page 199

Figure 20-2. Active Supply Current vs. Frequency ( MHz) Figure 20-3. Active Supply Current vs. V 2588E–AVR–08/10 ACTIVE SUPPLY CURRENT vs. FREQUENCY 1 ...

Page 200

Figure 20-4. Active Supply Current vs. V 1,6 1,4 1,2 0,8 0,6 0,4 0,2 Figure 20-5. Active Supply Current vs. V 0,3 0,25 0,2 0,15 0,1 0,05 ATtiny261/461/861 200 CC ACTIVE SUPPLY CURRENT vs. V INTERNAL RC OSCILLATOR, 1 MHz ...

Related keywords