Attiny85 Pin Configuration
The Attiny85 comes in an 8-pin PDIP (Plastic Dual Inline Package) or SOIC (Small Outline Integrated Circuit) package. Let’s take a closer look at each pin and its functions:
Pin | Name | Description |
---|---|---|
1 | PB5 | GPIO, PCINT5, RESET, ADC0, dW |
2 | PB3 | GPIO, PCINT3, XTAL1, CLKI, ADC3 |
3 | PB4 | GPIO, PCINT4, XTAL2, CLKO, ADC2 |
4 | GND | Ground |
5 | PB0 | GPIO, PCINT0, MOSI, AIN0, OC0A, SDA |
6 | PB1 | GPIO, PCINT1, MISO, AIN1, OC0B, SCL |
7 | PB2 | GPIO, PCINT2, SCK, ADC1, T0, INT0 |
8 | VCC | Supply Voltage (1.8V – 5.5V) |
GPIO Functionality
All six programmable pins (PB0 to PB5) can be used as general-purpose input/output (GPIO) pins. These pins can be configured as either inputs or outputs using software, allowing you to interface with various sensors, actuators, and other external components.
Interrupt Capability (PCINTx)
Each programmable pin can serve as an external interrupt source using the Pin Change Interrupt (PCINT) feature. This allows the Attiny85 to detect and respond to changes in the state of the pins, making it ideal for applications that require real-time response to external events.
Analog-to-Digital Converter (ADC)
The Attiny85 features a 10-bit Analog-to-Digital Converter (ADC) that can be used to measure analog voltages on pins PB0 to PB4. This is particularly useful for reading sensor data, such as temperature, light intensity, or potentiometer position.
Timer/Counter and PWM
The Attiny85 has a built-in 8-bit Timer/Counter (Timer0) that can be used for timing events, generating interrupts, or producing Pulse Width Modulation (PWM) signals. PWM is commonly used for controlling the brightness of LEDs, the speed of motors, or creating analog-like outputs.
TWI (I2C) and SPI Communication
The Attiny85 supports Two-Wire Interface (TWI), also known as I2C, and Serial Peripheral Interface (SPI) communication protocols. These protocols allow the Attiny85 to communicate with other devices, such as sensors, displays, or external memory chips.
Attiny85 Features and Capabilities
Low Power Consumption
One of the key features of the Attiny85 is its low power consumption. With proper configuration, the microcontroller can operate in various sleep modes, reducing its power usage to just a few microamps. This makes it an excellent choice for battery-powered applications or projects that require long-term operation without frequent battery replacements.
In-System Programming (ISP)
The Attiny85 supports In-System Programming (ISP), which allows you to program the microcontroller without removing it from the circuit. This feature makes it convenient to update the firmware or modify the program while the Attiny85 is already soldered onto the PCB.
Watchdog Timer
The built-in Watchdog Timer (WDT) is a safety feature that helps prevent the Attiny85 from getting stuck in an unresponsive state. The WDT can be configured to reset the microcontroller if it fails to receive a periodic reset signal from the software, ensuring that the system remains operational even in the presence of software bugs or external disturbances.
High-Speed Operation
Despite its small size, the Attiny85 can operate at clock speeds up to 20 MHz, allowing it to execute complex algorithms and handle high-speed tasks. The microcontroller also supports various clock sources, including an internal calibrated oscillator, an external crystal, or a resonator.
Analog Comparator
The Attiny85 includes an analog comparator that can be used to compare the voltages on two pins (PB0 and PB1) and generate an interrupt or trigger an event based on the comparison result. This feature is useful for implementing simple threshold detection or creating hysteresis-based control systems.
Attiny85 Applications
The Attiny85’s versatile features and low power consumption make it suitable for a wide range of applications, such as:
- Internet of Things (IoT) devices
- Wearable electronics
- Sensor networks
- Automotive electronics
- Home automation systems
- Robotics and mechatronics
- Embedded systems
- Educational projects and prototyping

Frequently Asked Questions (FAQ)
1. What is the maximum operating voltage of the Attiny85?
The Attiny85 can operate with a supply voltage ranging from 1.8V to 5.5V. However, the maximum operating frequency depends on the supply voltage. At 1.8V, the maximum frequency is 4 MHz, while at 5.5V, it can operate up to 20 MHz.
2. Can the Attiny85 be programmed using the Arduino IDE?
Yes, the Attiny85 can be programmed using the Arduino IDE with the help of an additional library called “ATTinyCore”. This library provides support for various Attiny microcontrollers, including the Attiny85, and allows you to use the familiar Arduino programming environment and functions.
3. How much Flash memory and SRAM does the Attiny85 have?
The Attiny85 has 8 KB of Flash memory for storing the program code and 512 bytes of SRAM for storing variables and data during runtime. It also features 512 bytes of EEPROM for non-volatile data storage.
4. Can the Attiny85 be used as a standalone microcontroller without additional components?
Yes, the Attiny85 can be used as a standalone microcontroller in many applications. However, depending on the specific requirements of your project, you may need to add external components such as a power supply, crystal oscillator, or pull-up resistors for unused pins.
5. What is the difference between the Attiny85 and other Attiny microcontrollers?
The Attiny family includes various microcontrollers with different pin counts, memory sizes, and features. The Attiny85 is one of the most popular models due to its balance between size, functionality, and cost. Other Attiny microcontrollers, such as the Attiny45 or Attiny84, offer different pin configurations and memory sizes to suit specific application requirements.
Conclusion
The Attiny85 is a powerful and versatile microcontroller that offers a wide range of features in a compact package. By understanding its pin configuration and capabilities, you can harness its potential to create innovative projects and embedded systems. With its low power consumption, high-speed operation, and support for various communication protocols, the Attiny85 is an excellent choice for both beginners and experienced developers alike.