ATtiny85 is an 8-pin AVR for small projects – blinkers, switches, simple sensors. It has 8 kB of flash and six I/O pins, one of which is reset.
It is also known as the heart of the Digispark board, which is programmed directly over USB.
Specifications
- 8-bit AVR up to 20 MHz, 8 MHz internal oscillator (16 MHz with PLL)
- 8 kB flash, 512 B SRAM, 512 B EEPROM
- 6 I/O (PB0–PB5, PB5 is reset), 4 channels of 10-bit ADC
- USI for I2C and SPI, 2 timers, PWM on PB0, PB1 and PB4
- 2.7–5.5 V supply (ATtiny85V from 1.8 V)
In the Arduino IDE you get it running with the ATTinyCore core and upload over ISP (USBasp, ArduinoISP). The Digispark uses the Micronucleus bootloader with USB implemented in software on PB3 and PB4.
Pinout and pin table
Hover over a pin in the diagram or a table row; use the filter to highlight a bus. You can download the pinout as PNG or SVG.
| Pin | Name | Arduino (ATTinyCore) | Direction | I2C | SPI | PWM | ADC | Note |
|---|---|---|---|---|---|---|---|---|
| 1 | PB5 | D5 | input/output | ADC0 | Reset – usable as GPIO only after programming the RSTDISBL fuse, but then ISP programming no longer works | |||
| 2 | PB3 | D3 | input/output | ADC3 | Crystal (XTAL1) – not free with an external crystal | |||
| 3 | PB4 | D4 | input/output | PWM | ADC2 | PWM from timer 1 (OC1B); crystal (XTAL2) | ||
| 4 | GND | – | ||||||
| 5 | PB0 | D0 | input/output | SDA | MOSI | PWM | ISP MOSI; USI DI / I2C SDA; PWM (OC0A); comparator AIN0; AREF | |
| 6 | PB1 | D1 | input/output | MISO | PWM | ISP MISO; USI DO; PWM (OC0B, OC1A); comparator AIN1; LED on the Digispark | ||
| 7 | PB2 | D2 | input/output | SCL | SCK | ADC1 | ISP SCK; USI USCK / I2C SCL; external interrupt INT0 | |
| 8 | VCC | input | Power 2.7–5.5 V (ATtiny85V from 1.8 V) |
What to watch out for
- PB5 is RESET – usable as GPIO only after programming the RSTDISBL fuse, after which the chip can no longer be programmed over ISP (only with a high-voltage programmer).
- On the Digispark, PB3 and PB4 are used by USB (Zener diodes and resistors) – they behave differently as inputs.
- I2C and SPI are handled by the USI, so you need a library (TinyWireM or the Wire from ATTinyCore).
- From the factory the chip runs at 1 MHz – for 8 MHz, set the fuses (in Arduino via “Burn Bootloader”).
More pinouts
See all pinouts on the Pinouts page.