Spark Logic

ATmega328 / ATmega328P / ATmega168 / ATmega8 pinout

Package pin assignments for ATmega328, ATmega328P, ATmega168, ATmega8, with peripheral signals, clock grades and a serial programming guide.

PackageContactsDetails
TQFP-32 32 32 numbered contacts. See the individual package drawings for footprint dimensions.
QFN-28 29 28 numbered contacts. The underside pad appears below the contact map. See the individual package drawings for footprint dimensions.
QFN-32 33 32 numbered contacts. The underside pad appears below the contact map. See the individual package drawings for footprint dimensions.
PDIP-28 28 28 numbered contacts. See the individual package drawings for footprint dimensions.

Microchip Technology

Device variants · TQFP-32

DeviceFlashSRAMEEPROMSupplyMax clockTemperature
ATmega328 32 KiB 2 KiB 1 KiB — — —
ATmega328-AU 32 KiB 2 KiB 1 KiB 1.8–5.5 V 20 MHz -40 to +85 °C
ATmega328-AUR 32 KiB 2 KiB 1 KiB 1.8–5.5 V 20 MHz -40 to +85 °C
ATmega328P 32 KiB 2 KiB 1 KiB — — —
ATmega328P-AU 32 KiB 2 KiB 1 KiB 1.8–5.5 V 20 MHz -40 to +85 °C
ATmega328P-AUR 32 KiB 2 KiB 1 KiB 1.8–5.5 V 20 MHz -40 to +85 °C
ATmega328P-AN 32 KiB 2 KiB 1 KiB 1.8–5.5 V 20 MHz -40 to +105 °C
ATmega328P-ANR 32 KiB 2 KiB 1 KiB 1.8–5.5 V 20 MHz -40 to +105 °C
ATmega168 16 KiB 1 KiB 512 B — — —
ATmega168V-10AU 16 KiB 1 KiB 512 B 1.8–5.5 V 10 MHz -40 to +85 °C
ATmega168V-10AUR 16 KiB 1 KiB 512 B 1.8–5.5 V 10 MHz -40 to +85 °C
ATmega168-20AU 16 KiB 1 KiB 512 B 2.7–5.5 V 20 MHz -40 to +85 °C
ATmega168-20AUR 16 KiB 1 KiB 512 B 2.7–5.5 V 20 MHz -40 to +85 °C
ATmega8 8 KiB 1 KiB 512 B — — —
ATmega8L-8AU 8 KiB 1 KiB 512 B 2.7–5.5 V 8 MHz -40 to +85 °C
ATmega8L-8AUR 8 KiB 1 KiB 512 B 2.7–5.5 V 8 MHz -40 to +85 °C
ATmega8-16AU 8 KiB 1 KiB 512 B 4.5–5.5 V 16 MHz -40 to +85 °C
ATmega8-16AUR 8 KiB 1 KiB 512 B 4.5–5.5 V 16 MHz -40 to +85 °C
ATmega8L-8AN 8 KiB 1 KiB 512 B 2.7–5.5 V 8 MHz -40 to +105 °C
ATmega8L-8ANR 8 KiB 1 KiB 512 B 2.7–5.5 V 8 MHz -40 to +105 °C
ATmega8-16AN 8 KiB 1 KiB 512 B 4.5–5.5 V 16 MHz -40 to +105 °C
ATmega8-16ANR 8 KiB 1 KiB 512 B 4.5–5.5 V 16 MHz -40 to +105 °C

TQFP-32 pinout

TQFP-32

1 · PD3 · Left side, contact 1 from the top

Marking side · Pin 1 at the upper left
Selected pin details

1 · PD3

Bidirectional · GPIO

General-purpose digital I/O. Alternate assignments: INT1 (EXINT).

After reset · GPIO driver is high impedance during reset. Clock, debug, and alternate-function use depend on fuse and peripheral configuration.

2486AA · Pinout and peripheral signal descriptions

Electrical limits · Link to this pin

Power and reset

  • Target rail
    • Bench supply positive
  • Ground
    • Bench supply return
  • Reset
100 nF per supply pair between Target rail and GroundTarget rail100 nF per supply pairGround
10 kΩ between Target rail and ResetTarget rail10 kΩReset

Connection guide

All 32 pins

PinSignalDirectionFunction
1PD3 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: INT1 (EXINT).
2PD4 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: T (TC0), XCK (USART).
3GND ReturnReturn Supply return. Connect every ground pin.
4VCC SupplySupply Digital supply. Connect every VCC pin and place a local 100 nF ceramic bypass close to each VCC-to-ground pair.
5GND ReturnReturn Supply return. Connect every ground pin.
6VCC SupplySupply Digital supply. Connect every VCC pin and place a local 100 nF ceramic bypass close to each VCC-to-ground pair.
7PB6 BidirectionalBidirectional General-purpose digital I/O.
8PB7 BidirectionalBidirectional General-purpose digital I/O.
9PD5 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: T (TC1).
10PD6 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: AIN0 (AC).
11PD7 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: AIN1 (AC).
12PB0 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: ICP (TC1).
13PB1 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: OCA (TC1).
14PB2 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: SS (SPI), OCB (TC1).
15PB3 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: MOSI (SPI), OC (TC2).
16PB4 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: MISO (SPI).
17PB5 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: SCK (SPI).
18AVCC SupplySupply Analog supply. Connect it to the supply even if analog conversion is unused. Follow the data sheet’s filtering guidance for precision conversion.
19ADC6 Analog inputAnalog input Dedicated analog input to ADC channel 6. Alternate assignments: ADC6 (ADC).
20AREF Analog referenceAnalog reference ADC voltage reference terminal. Check the reference selection before driving this pin from an external voltage.
21GND ReturnReturn Supply return. Connect every ground pin.
22ADC7 Analog inputAnalog input Dedicated analog input to ADC channel 7. Alternate assignments: ADC7 (ADC).
23PC0 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: ADC0 (ADC).
24PC1 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: ADC1 (ADC).
25PC2 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: ADC2 (ADC).
26PC3 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: ADC3 (ADC).
27PC4 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: SDA (TWI), ADC4 (ADC).
28PC5 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: SCL (TWI), ADC5 (ADC).
29PC6 Input / I/OInput / I/O Active-low reset input by default. Use as GPIO only where the reset-disable fuse is supported and configured.
30PD0 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: RXD (USART).
31PD1 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: TXD (USART).
32PD2 BidirectionalBidirectional General-purpose digital I/O. Alternate assignments: INT0 (EXINT).

Signal assignments

Analog comparator

Review each signal assignment and the peripheral enable conditions in the data sheet. AIN1 → PD7 · AIN0 → PD6

SPI peripheral

Use SCK, MOSI, MISO and a chip-select line. Firmware selects direction and clock phase. Check the separate ISP mapping when programming. SCK → PB5 · MISO → PB4 · MOSI → PB3 · SS → PB2

External interrupts

Review each signal assignment and the peripheral enable conditions in the data sheet. INT1 → PD3 · INT0 → PD2

Timer/Counter 0

Review each signal assignment and the peripheral enable conditions in the data sheet. T → PD4

Timer/Counter 1

Review each signal assignment and the peripheral enable conditions in the data sheet. OCB → PB2 · OCA → PB1 · ICP → PB0 · T → PD5

Timer/Counter 2

Review each signal assignment and the peripheral enable conditions in the data sheet. OC → PB3

USART · Serial

Use TXD and RXD for asynchronous serial. XCK is for synchronous mode. The signal levels follow the microcontroller supply domain. XCK → PD4 · TXD → PD1 · RXD → PD0

TWI / I²C

Connect SDA and SCL to the bus with pull-ups to a voltage supported by all devices. Verify the pull-up value for the bus capacitance and rate. SCL → PC5 · SDA → PC4

Analog-to-digital converter

Select the analog channel and reference in firmware. The reference choice and supply constrain the input range. ADC5 → PC5 · ADC4 → PC4 · ADC3 → PC3 · ADC2 → PC2 · ADC1 → PC1 · ADC0 → PC0 · ADC6 → ADC6 · ADC7 → ADC7

Electrical limits

ParameterLimitConditions and source
Program flash8 KiB8 KiB Nonvolatile program memory. 2486AA · Memory
SRAM1 KiB1 KiB Volatile data and stack storage. 2486AA · Memory
EEPROM512 B512 B Nonvolatile data storage. 2486AA · Memory
Clock and supplyOrder-code dependentOrder-code dependent Use the grade table and the device’s speed-versus-voltage curve. 2486AA · Electrical Characteristics

Manufacturer documents

Each package lists the documented order codes and variants covered by this map. Select the marked model to see its peripheral assignments and memory. Check the exact order code and datasheet revision before laying out a PCB.