

The ATtiny85 20PU is a small, low-power 8-bit microcontroller from the AVR family, designed for compact and efficient embedded applications. It features 8 KB of flash memory, 512 bytes of SRAM, and 6 general-purpose I/O pins. Despite its small size, the ATtiny85 is highly versatile and capable of handling a variety of tasks, making it ideal for simple control systems, IoT devices, wearable electronics, and other space-constrained projects.








The ATtiny85 20PU is a DIP-8 (Dual Inline Package) 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 |
| Maximum Clock Speed | 20 MHz |
| I/O Pins | 6 |
| ADC Channels | 4 (10-bit resolution) |
| PWM Channels | 2 |
| Power Consumption | Low-power (active and sleep modes) |
| Package Type | DIP-8 |
The ATtiny85 20PU has 8 pins, with the following configuration:
| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | PB5 (RESET) | Reset pin (active low) or general-purpose I/O |
| 2 | PB3 (ADC3) | Digital I/O, ADC channel 3, or external interrupt |
| 3 | PB4 (ADC2) | Digital I/O, ADC channel 2, or external interrupt |
| 4 | GND | Ground |
| 5 | PB0 (ADC0) | Digital I/O, ADC channel 0, or PWM output |
| 6 | PB1 (ADC1) | Digital I/O, ADC channel 1, or PWM output |
| 7 | PB2 (SCK) | Digital I/O, SPI clock, or external interrupt |
| 8 | VCC | Power supply (2.7V - 5.5V) |
Below is an example of how to blink an LED connected to PB0 using the Arduino IDE:
// Include the necessary library for ATtiny85
// Ensure you have installed the ATtiny board package in Arduino IDE
void setup() {
pinMode(0, OUTPUT); // Set PB0 (pin 5) as an output pin
}
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
}
Steps to Upload Code:
Problem: The ATtiny85 is not responding or programming fails.
Problem: The LED does not blink as expected.
Problem: Excessive power consumption in battery-powered applications.
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 reset the ATtiny85 fuse settings?
A: Use an ISP programmer to reprogram the fuses. Be cautious when setting the clock source to avoid locking the chip.
Q: Can I use the ATtiny85 for I2C communication?
A: Yes, the ATtiny85 supports I2C communication using software libraries like TinyWire.
By following this documentation, you can effectively integrate the ATtiny85 20PU into your projects and troubleshoot common issues.