Spark Logic

ATmega328 / ATmega328P / ATmega168 / ATmega8 connection guide

ATmega328 / ATmega328P / ATmega168 / ATmega8 (PDIP-28) connection guide. Power and reset. Program and read the signature over ISP.

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 · PDIP-28

DeviceFlashSRAMEEPROMSupplyMax clockTemperature
ATmega328 32 KiB 2 KiB 1 KiB — — —
ATmega328-PU 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-PU 32 KiB 2 KiB 1 KiB 1.8–5.5 V 20 MHz -40 to +85 °C
ATmega328P-PN 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-10PU 16 KiB 1 KiB 512 B 1.8–5.5 V 10 MHz -40 to +85 °C
ATmega168-20PU 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-8PU 8 KiB 1 KiB 512 B 2.7–5.5 V 8 MHz -40 to +85 °C
ATmega8-16PU 8 KiB 1 KiB 512 B 4.5–5.5 V 16 MHz -40 to +85 °C
ATmega8L-8PN 8 KiB 1 KiB 512 B 2.7–5.5 V 8 MHz -40 to +105 °C
ATmega8-16PN 8 KiB 1 KiB 512 B 4.5–5.5 V 16 MHz -40 to +105 °C

Power and reset

Required

Use a current-limited supply at a voltage permitted by the order code and system clock. Tie the listed supply pins to that rail. Fit one 100 nF ceramic capacitor close to each supply-and-ground pair. Use a 10 kΩ reset pull-up for this bench circuit.

  • 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

Bench checks

  • With power off, check for a short across the supply. Power on and measure voltage at every supply pin and at reset.
  • This bench circuit powers AVCC directly from VCC with the ADC idle. For ADC conversions, feed AVCC from VCC through a low-pass filter.
  • Check the clock source configured by CKSEL. If a used part expects an external clock, provide it before attempting serial programming.

AN2519 §§2–3 and 2545W · Pin descriptions and clock source

Connection scenarios

Connect an SPI peripheral in master mode

This example uses PB2 as the peripheral chip-select output. Use compatible signal voltages and share ground with the peripheral.

  • Chip select
    • →
    • Peripheral CS
  • Master data out
    • →
    • Peripheral MOSI
  • Master data in
    • Peripheral MISO
    • →
  • Serial clock
    • →
    • Peripheral SCK
  • Common ground
    • Peripheral GND

Bench checks

  • Hold PB2/SS HIGH. A LOW clears MSTR in SPCR, switches the SPI to slave mode, and makes MOSI and SCK inputs.
  • PB2 can drive a peripheral’s chip select. Its output level has no effect on MSTR.

2545W · §23.3.2

PDIP-28 wiring map

External wiring example · Connect an SPI peripheral in master mode

Highlighted contacts are used in the required step or selected circuit. Select a contact to highlight its wiring nets.

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

1 · PC6

Input / I/O · Reset / preset

Active-low reset input by default. Use as GPIO only where the reset-disable fuse is supported and configured. Alternate assignments: PCINT14 (EXINT).

2545W · Pinout and peripheral signal descriptions

Connected nets

Electrical limits · Pin in the reference

  • Reset
    • Via 10 kΩ to Target rail · Bench supply positive, VCC (7), AVCC (20)

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.