Skip to content
A project ofgwark.dev

Microchip (Atmel) · Microcontroller

ATmega328P (PDIP-28)

The chip inside the Uno and Nano, on its own in a 28-pin DIP. Useful when you want the Arduino toolchain on a bare board. The mapping between port pins and Arduino numbers is the part nobody remembers.

Cheat sheet (SVG)
Logic level
1.8-5.5 V
Package
PDIP-28 / TQFP-32 / MLF-32

1.Pinout diagram

Highlight a signalhover to preview, click to keep

Pins 1-14

ATMEGA328P

Pins 15-28

Pin detail

Hover a pin for its mappings and gotchas. Click to keep it here.

Logic level
1.8-5.5 V
Package
PDIP-28 / TQFP-32 / MLF-32

Fig. 1. ATmega328P (PDIP-28), PDIP-28. Hover or tap a signal to light up every pin that carries it.

2.Watch out

3.Minimum circuit to run

What has to go around the chip before it will run.

VCCGNDATmega328P100 nF between VCC (7) and GND100 nF100 nF between AVCC (20) and GND100 nFWire link between AVCC (20) and VCCWire link10 kOhm between PC6 (1) and VCC10 kOhm22 pF between PB6 (9) and GND22 pF22 pF between PB7 (10) and GND22 pF100 nF between AREF (21) and GND100 nFVCC (7) to VCCGND (8) to GNDGND (22) to GND16 MHz crystal between PB6 (9) and PB7 (10)16 MHz crystalPC6 1VCC 7VCC 7GND 8PB6 9PB6 9PB7 10PB7 10AVCC 20AVCC 20AREF 21GND 22
Fig. 2. Minimum circuit to run, drawn from Table 1. Dashed parts are optional. Crossing wires are not connected.
Table 1. External parts, and why each one is there.
PartBetween
100 nFVCC (7) to GND
100 nFAVCC (20) to GND
Wire linkAVCC (20) to VCC
10 kOhmPC6 (1) to VCC
16 MHz crystaloptionalPB6 (9) to PB7 (10)
22 pFoptionalPB6 (9) to GND
22 pFoptionalPB7 (10) to GND
100 nFoptionalAREF (21) to GND

A factory chip runs on the internal 8 MHz RC with CKDIV8 set, so it ticks at 1 MHz until you change the fuses. Fitting the crystal is not enough on its own; the fuses have to select it.

4.Register configuration

Turning a pin on the diagram into a configured pin.

5.Full pin reference

Every pin, alias and mapping. This is the table that prints.

Table 2. Pin assignments.

Complete pin reference for ATmega328P (PDIP-28)
PinNameFunctions

Found a wrong pin? The whole board is one file, data/boards/atmega328p-pdip.json.

Edit this file on GitHubReport it instead