Overview

The ATtiny13A is an ultra-compact, ultra-low-cost 8-bit AVR RISC microcontroller manufactured by Microchip Technology (originally Atmel). Housed in an 8-pin through-hole DIP-8 and surface-mount SOIC-8 package, it provides the most minimalist bare-bones AVR processing platform available.

Operating from 1.8V1.8\text{V} to 5.5V5.5\text{V} DC with picoPower technology (<0.1 μA< 0.1\ \mu\text{A} sleep current), the ATtiny13A integrates 1 KB1\text{ KB} Flash (1024 Bytes1024\text{ Bytes}), 64 Bytes64\text{ Bytes} SRAM, 64 Bytes64\text{ Bytes} EEPROM, 6 programmable GPIOs, a 4-channel 10-bit ADC, and 2 hardware PWM outputs from its internal 8-bit timer. With dedicated Arduino core support via MicroCore, it is celebrated across DIY electronics communities for powering tactical LED flashlight firmware (Biscotti / Guppydrv / ToyKeeper AMC7135 drivers), simple servo decoders, RGB LED mood candles, and tiny smart battery monitors.

Quick reference

CPU Core8-bit AVR RISC Architecture
Package8-pin DIP (DIP-8) / 8-pin SOIC / 10-pin QFN
Internal Oscillators9.6 MHz9.6\text{ MHz} / 4.8 MHz4.8\text{ MHz} / 128 kHz128\text{ kHz} calibrated RC
Flash Memory1024 Bytes1024\text{ Bytes} (1 KB1\text{ KB}) non-volatile storage
SRAM64 Bytes64\text{ Bytes} internal RAM
EEPROM64 Bytes64\text{ Bytes} non-volatile data EEPROM
Supply Voltage Range1.8 V1.8\text{ V} to 5.5 V5.5\text{ V} DC (4.5V5.5V4.5\text{V} \dots 5.5\text{V} for 20MHz20\text{MHz})
Deep Sleep Current<0.1 μA< 0.1\ \mu\text{A} at 1.8V1.8\text{V} (Power-Down Mode)
GPIO Count6 Programmable I/O lines (PB0 through PB5)
Analog Peripherals4-channel 10-bit ADC (15 ksps) + Analog Comparator
Timer / PWM1x 8-bit Timer/Counter with 2 PWM channels (OC0A, OC0B)
Programming InterfaceIn-System Programming (ISP via SPI: MOSI, MISO, SCK, RESET)

Pinout (DIP-8 Package)

text
                            ┌───┴───┐
      (Active-Low/ADC0) PB5 1│ 1   8 │ VCC (+1.8V to +5.5V)
       (ADC3/CLKI/PCINT3) PB3 2│ATtiny│ 7 PB2 (SCK/ADC1/PCINT2)
       (ADC2/CLKO/PCINT4) PB4 3│ 13A  │ 6 PB1 (MISO/OC0B/PCINT1)
                          GND 4│DIP-8 │ 5 PB0 (MOSI/OC0A/PCINT0)
                            └───────┘
PinNameTypeDescription
1PB5GPIO / ResetActive-LOW Reset / ADC0 / PCINT5 / dW (debugWIRE)
2PB3GPIO / AnalogADC3 / External Clock Input (CLKI) / PCINT3
3PB4GPIO / AnalogADC2 / Clock Output (CLKO) / PCINT4
4GNDPowerCommon Ground reference (0 V0\text{ V})
5PB0GPIO / DigitalMOSI (ISP) / OC0A (PWM Output 0) / AIN0 / PCINT0
6PB1GPIO / DigitalMISO (ISP) / OC0B (PWM Output 1) / AIN1 / PCINT1
7PB2GPIO / DigitalSCK (ISP) / ADC1 / T0 (Timer Clock) / PCINT2
8VCCPowerSupply Voltage (+1.8 V+1.8\text{ V} to +5.5 V+5.5\text{ V} DC)

Minimal Circuit & ISP Flashing Hookup

text
   Arduino as ISP / USBasp Programmer
   ┌────────────────────────────────┐
   │ 5V / 3.3V ─────────────────────┼─────────┬──────────────► [Pin 8: VCC]
   │                                │         │                     ATtiny13A
   │                                │   [ 100nF Cap ]               DIP-8
   │                                │         │
   │ GND ───────────────────────────┼─────────┼──────────────► [Pin 4: GND]
   │ RESET (Pin 10 on Arduino) ─────┼─────────┼──────────────► [Pin 1: PB5 / RESET]
   │ MOSI (Pin 11 on Arduino) ──────┼─────────┼──────────────► [Pin 5: PB0 / MOSI]
   │ MISO (Pin 12 on Arduino) ──────┼─────────┼──────────────► [Pin 6: PB1 / MISO]
   │ SCK  (Pin 13 on Arduino) ──────┼─────────┼──────────────► [Pin 7: PB2 / SCK]
   └────────────────────────────────┘

Comparison: ATtiny13A vs ATtiny85

ParameterATtiny13AATtiny85
PinoutIdentical 8-pin DIP / SOICIdentical 8-pin DIP / SOIC
Flash Memory1024 Bytes1024\text{ Bytes} (1 KB1\text{ KB})8192 Bytes8192\text{ Bytes} (8 KB8\text{ KB})
SRAM64 Bytes64\text{ Bytes}512 Bytes512\text{ Bytes}
EEPROM64 Bytes64\text{ Bytes}512 Bytes512\text{ Bytes}
Timers1x 8-bit Timer (2 PWM)2x Timers (1x 8-bit, 1x High-Speed 64MHz 8-bit)
Price\approx \0.30 - $0.50$\approx \1.10 - $1.50$

Common mistakes

  • RAM exhaustion with standard C libraries: With only 64 Bytes64\text{ Bytes} of RAM, avoid using sprintf, heavy string manipulations, or large global arrays. Keep local variables minimal.
  • Flashing with stock Arduino core instead of MicroCore: Standard Arduino core overhead will exceed the 1024 Byte1024\text{ Byte} Flash limit instantly. Install MicroCore by MCUdude, which strips runtime bloat and allows full digitalWrite(), analogRead(), and delay() within a few hundred bytes.
  • Disabling the RESET pin (RSTDISBL fuse): Disabling Reset to gain Pin 1 as PB5 prevents future SPI programming. High-Voltage Serial Programming (HVSP with 12V on Reset) will be required to erase and restore the chip.

Notes

  • Arduino Core: Supported via the open-source MicroCore board package.

Assets & downloads