

The ATTiny85 is a small, low-power microcontroller from Atmel's AVR family, designed for embedded systems and DIY electronics projects. It features an 8-bit architecture, 8 KB of flash memory, 512 bytes of SRAM, and 6 I/O pins. Its compact size and ease of programming make it a popular choice for applications where space and power efficiency are critical.








The ATTiny85 is a versatile microcontroller with the following key specifications:
| Parameter | Value |
|---|---|
| Architecture | 8-bit AVR |
| Flash Memory | 8 KB |
| SRAM | 512 bytes |
| EEPROM | 512 bytes |
| Operating Voltage | 2.7V - 5.5V |
| Clock Speed | Up to 20 MHz (with external clock) |
| I/O Pins | 6 |
| ADC Channels | 4 (10-bit resolution) |
| PWM Channels | 2 |
| Communication Interfaces | SPI, I²C (TWI), and UART (via USI) |
| Power Consumption | Low-power modes available |
| Package Types | DIP-8, SOIC-8, QFN-8 |
The ATTiny85 has 8 pins, with the following configuration:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | PB5 (RESET) | Reset pin (active low) or GPIO |
| 2 | PB3 (ADC3) | GPIO, ADC input channel 3, or external interrupt |
| 3 | PB4 (ADC2) | GPIO, ADC input channel 2, or external interrupt |
| 4 | GND | Ground |
| 5 | PB0 (ADC0) | GPIO, ADC input channel 0, or PWM output |
| 6 | PB1 (ADC1) | GPIO, ADC input channel 1, or PWM output |
| 7 | PB2 (SCK) | GPIO, SPI clock, or external interrupt |
| 8 | VCC | Power supply (2.7V - 5.5V) |
The following example demonstrates how to blink an LED connected to PB0 using the Arduino IDE:
// Blink an LED connected to PB0 (Pin 5) of the ATTiny85
void setup() {
pinMode(0, OUTPUT); // Set PB0 (digital pin 0) as an output
}
void loop() {
digitalWrite(0, HIGH); // Turn the LED on
delay(1000); // Wait for 1 second
digitalWrite(0, LOW); // Turn the LED off
delay(1000); // Wait for 1 second
}
Problem: The ATTiny85 is not detected by the programmer.
Problem: The LED does not blink.
Problem: The ATTiny85 is not running at the expected clock speed.
Problem: Excessive power consumption in low-power applications.
Q: Can the ATTiny85 be reprogrammed multiple times?
A: Yes, the ATTiny85 supports up to 10,000 write/erase cycles for its flash memory.
Q: Can I use the ATTiny85 without an external clock?
A: Yes, the ATTiny85 has an internal 8 MHz oscillator, which is sufficient for most applications.
Q: How do I use the EEPROM on the ATTiny85?
A: The EEPROM can be accessed using the EEPROM library in the Arduino IDE for storing non-volatile data.
Q: What is the maximum current the ATTiny85 can source or sink?
A: Each pin can handle up to 40 mA, with a total maximum of 200 mA for the entire chip.