ATtiny85 pinout
The ATtiny85 (ATtiny85) pinout: what each pin does, from GPIO, analog inputs and PWM to UART, I2C and SPI, with the notes that catch people out.
The board
- Microcontroller: ATtiny85, 8-bit AVR
- Clock: 8 MHz (internal oscillator)
- Flash: 8 KB
- SRAM / EEPROM: 512 bytes / 512 bytes
- Logic level: 5 V
- I/O pins: 6 (PB0–PB5), 3 with PWM; PB5 is RESET
- Analog inputs: 4 (A0–A3), 10-bit: 0–1023
- Serial: In software: TX on PB0, RX on PB1
- I2C and SPI: Through the USI: SDA PB0, SCL PB2; DI PB0, DO PB1, USCK PB2
- External interrupts: PB2 (INT0); a pin-change interrupt on every pin
- On-board LED: PB1 (LED_BUILTIN)
Pins
| Pin | Functions | Notes |
|---|---|---|
| PB0 | 0, PB0, ~PWM, OC0A, SDA, DI, TX | analogWrite() PWM from Timer0 (OC0A). The USI's data input (DI) for SPI, and SDA for I2C. Serial transmit: the core bit-bangs Serial here, as the chip has no USART. |
| PB1 | 1, PB1, ~PWM, OC1A, DO, RX, LED | analogWrite() PWM from Timer1 (OC1A), about 490 Hz at 8 MHz. The USI's data output (DO): MOSI when the ATtiny is the SPI controller. Serial receive (software). Drives the on-board LED (LED_BUILTIN). |
| PB2 | 2, PB2, A1, INT0, SCL, USCK | Analog input: analogRead(A1). External interrupt INT0: attachInterrupt(0, handler, mode). The USI's clock: SCK for SPI, SCL for I2C. |
| PB3 | 3, PB3, A3 | Analog input: analogRead(A3). |
| PB4 | 4, PB4, A2, ~PWM, OC1B | Analog input: analogRead(A2). analogWrite() PWM from Timer1 (OC1B). |
| PB5 | 5, PB5, A0, RESET | Analog input: analogRead(A0). Also the chip's RESET: it only becomes an I/O pin when the RSTDISBL fuse is set, after which the chip can no longer be programmed over ISP. |
| GND | GND | Ground (0 V). |
| GND | GND | Ground (0 V). |
| VCC | 5V | The 5 V supply. |
| VCC | 5V | The 5 V supply. |
| VIN | VIN | Unregulated supply input, 7–12 V recommended. The on-board regulator makes 5 V from it. |
Good to know
- Pins are numbered by their port bit: digitalWrite(3, HIGH) drives PB3, and PORTB |= (1 << PB3) does the same without digitalWrite().
- There is no USART, SPI or TWI peripheral: Serial is bit-banged on PB0 and PB1, and SPI and I2C libraries for the ATtiny use the USI.
- Timer0 runs millis() and delay(); Timer1 does the PWM on PB1 and PB4.
- Arduino Uno pinout
- Arduino Nano pinout
- Arduino Mega pinout
- ESP32-C3 DevKitM-1 pinout
- ESP32-S3 DevKitC-1 pinout
- ESP32-C5 DevKitC-1 pinout
- ESP32-C6 DevKitC-1 pinout
- ESP32-H2 DevKitM-1 pinout
- ESP32-P4 Function-EV pinout
- Blue Pill (STM32F103C8) pinout
- Nucleo-F030R8 pinout
- Nucleo-G071RB pinout
- Nucleo-F401RE pinout
- Nucleo-F446RE pinout
- Nucleo-F767ZI pinout
- Nucleo-H743ZI2 pinout
- Nucleo-WBA55CG pinout
- Nucleo-L552ZE-Q pinout
- Black Pill (STM32F411CE) pinout
- Raspberry Pi Pico pinout
- Raspberry Pi Pico W pinout
- Raspberry Pi Pico 2 pinout
- Raspberry Pi Pico 2 W pinout