Skip to datasheet
The Engineering ProjectsAI Interactive Datasheet

ATmega328P8-bit AVR microcontroller

Program the logic. Connect the physical world.

Manufacturer-referenced

Microchip Technology · ATMEGA328P-PU

SPDIP-28DS40002061B · 2020

ATmega328P is an 8-bit AVR microcontroller with 32 KB of programmable Flash, 2 KB of SRAM and 1 KB of EEPROM. Its CPU executes firmware while timers, serial interfaces and a 10-bit ADC connect that program to external signals. A bare IC needs power, clock configuration and programmed firmware; it is not a complete Arduino board. The selected ATMEGA328P-PU and ATMEGA328P-AU devices use 28-lead SPDIP and 32-lead TQFP packages. Their physical pin numbers differ. TQFP adds ADC6 and ADC7 as analog-only inputs plus extra power contacts; every supply and ground contact must be connected. Operation spans 1.8–5.5 V, with a supply-dependent clock limit: up to 4 MHz at 1.8 V, 10 MHz at 2.7 V and 20 MHz at 4.5 V or above. The selected industrial parts cover −40 to +85°C. Factory clock settings divide the internal 8 MHz RC oscillator by eight.

Real View

ATMEGA328P-PU black package with silver leads and readable markings.
ATMEGA328P-PU · SPDIP-28Package illustration

Pinout

ATMEGA328P-PUSPDIP-28Top view
Select a pin to see its functionSPDIP-28 · 28 pins

PCB Footprint

Loading footprint…
Powered by
Finding SPDIP-28 packageTop view · mm

3D View

Preparing 3D preview…
3D packageDrag to rotate · Scroll to zoom
ResetDigital I/O & peripheralsPower & returnsClock contactsADC & reference
ATMEGA328P-PUSPDIP-28Top view

Click a lead or use the arrow keys. Top view

1
PIN 1 · Reset

PC6 / RESET

Reset / optional GPIO

Function

Active LOW reset; PC6 is GPIO only when the reset-disable fuse is programmed.

How to connect

Use a reset pullup, typically 10 kΩ.

Electrical note

Disabling reset removes normal ISP access; do not change this fuse casually.

At a glance

8-bit AVR microcontroller

A Harvard AVR core fetches instructions from Flash and works with SRAM. Peripheral registers configure the timers, GPIO, ADC and serial interfaces.

32 KBProgram Flash
2 KBSRAM
20 MHz · at 4.5–5.5 VMaximum clock
10 bits · 6 / 8 channelsADC resolution

Operating profile

ATMEGA328P-PU

Selected package
SPDIP-28ATMEGA328P-PU · 28 physical pins
Supply range
1.8–5.5V · clock limit applies
Industrial ambient
−40–85°C

CPU and memory

Key parameters and their test conditions

Architecture
8-bit AVR RISCConditions / notes: 32 general-purpose working registers
Instruction set
131 instructionsConditions / notes: Most execute in a single clock cycle
Program Flash
32 KBConditions / notes: Self-programmable; optional boot section
SRAM
2 KBConditions / notes: Stack, runtime variables and buffers
EEPROM
1 KBConditions / notes: Nonvolatile data
Write endurance
10,000 Flash / 100,000 EEPROM cyclesConditions / notes: Manufacturer endurance specification

Package details

Follows the selected physical package

Manufacturer
Microchip Technology
Part number
ATMEGA328P-PU
Package
SPDIP-28
Connections
28 pins
Mounting
Through-hole
Lead pitch
2.54 mm · 7.62 mm rows
Package code
28P3
Thermal reference
Board and package dependent; see manufacturer data

Connections by function

Select a pin to open its function, electrical notes and wiring guidance.

Reset1 pins

Digital I/O & peripherals14 pins

Power & returns4 pins

Clock contacts2 pins

ADC & reference7 pins

Values apply to the stated grade and conditions. Absolute maximum ratings are stress limits.DS40002061B · 2020

Power and clock

Connect all VCC, AVCC and GND pins, decouple locally and select a clock source compatible with the supply voltage. Clock fuses and CKDIV8 determine the CPU clock.

Program the device

Use ISP through RESET, MOSI, MISO and SCK, or a compatible preinstalled bootloader. A blank chip does not understand Arduino serial uploads on its own.

Configure peripherals

Set DDR and peripheral registers. Timer1 can toggle OC1A in hardware without a software delay loop, while firmware handles other work.

The explorer calculates Timer1 hardware-toggle timing from the actual I/O clock. It does not execute uploaded firmware. In ProTech, the existing Arduino Uno model supplies AVR execution; this page documents the bare ATmega328P.

From clock cycles to a blinking LED.

Explore the Timer1 CTC output on PB1 / OC1A.

Hardware timing calculator

fOUT = fCPU ÷ [2 × prescaler × (OCR1A + 1)]. The output changes state once per compare match.

OC1A OUTPUT FREQUENCY—
——
TIME BETWEEN TOGGLES—One HIGH or LOW interval
SUPPLY-DEPENDENT CLOCK LIMIT—Manufacturer maximum-frequency curve
COMPARE REGISTER—OCR1A · unsigned 16-bit value

Output: PB1 / OC1A, physical pin 15. Set its DDR bit, CTC mode 4 and toggle-on-compare. Steady-state Timer1 CTC output calculation. The selected clock must already include CKDIV8 and the system prescaler. Firmware, fuse changes, startup delay and oscillator error are not emulated.

Compact black microcontroller cutaway with AVR CPU, Flash, SRAM, EEPROM, timers, ADC, serial interfaces, GPIO and reset/clock blocks.
Functional block diagram, not a transistor-level die schematic.
Physical ATmega328P SPDIP28 with 5V on VCC7 AVCC20, grounds8and22, AREF21 bypass, RESET1 pullup, crystal between9and10 with load capacitors, LED and1k resistor fromPB1pin15, and ISP contacts.
Program firmware and configure the clock before expecting the LED to blink. Pin numbers are for SPDIP-28.

Pin reference

Select a pin to explore its function and connection.

28 pins
PinSignalTypeFunction
PC6 / RESETReset / optional GPIOActive LOW reset; PC6 is GPIO only when the reset-disable fuse is programmed.
PD0 / RXDGPIO / USART receivePD0, RXD and pin-change interrupt PCINT16.
PD1 / TXDGPIO / USART transmitPD1, TXD and PCINT17.
PD2 / INT0GPIO / interruptPD2, INT0 and PCINT18.
PD3 / OC2BGPIO / timer / interruptPD3, OC2B, INT1 and PCINT19.
PD4 / T0GPIO / clockPD4, USART synchronous clock XCK, Timer0 clock T0 and PCINT20.
VCCSupplyDigital power supply.
GNDGroundDigital supply return.
PB6 / XTAL1GPIO / oscillator inputPB6, XTAL1, TOSC1 and PCINT6.
PB7 / XTAL2GPIO / oscillator outputPB7, XTAL2, TOSC2 and PCINT7.
PD5 / OC0BGPIO / timerPD5, OC0B, T1 and PCINT21.
PD6 / OC0AGPIO / comparatorPD6, OC0A, AIN0 and PCINT22.
PD7 / AIN1GPIO / comparatorPD7, AIN1 and PCINT23.
PB0 / ICP1GPIO / capturePB0, ICP1, CLKO and PCINT0.
PB1 / OC1AGPIO / timer outputPB1, OC1A and PCINT1.
PB2 / SSGPIO / SPI selectPB2, SS, OC1B and PCINT2.
PB3 / MOSIGPIO / SPI / programmingPB3, MOSI, OC2A and PCINT3.
PB4 / MISOGPIO / SPI / programmingPB4, MISO and PCINT4.
PB5 / SCKGPIO / SPI / programmingPB5, SCK and PCINT5.
AVCCAnalog supplyPowers the ADC and specified Port C circuitry.
AREFADC referenceExternal reference input or decoupling node for a selected internal reference.
GNDGroundAnalog-side supply return.
PC0 / ADC0GPIO / ADCPC0, ADC0, PCINT8.
PC1 / ADC1GPIO / ADCPC1, ADC1, PCINT9.
PC2 / ADC2GPIO / ADCPC2, ADC2, PCINT10.
PC3 / ADC3GPIO / ADCPC3, ADC3, PCINT11.
PC4 / ADC4 / SDAGPIO / ADC / TWIPC4, ADC4, PCINT12 and TWI SDA.
PC5 / ADC5 / SCLGPIO / ADC / TWIPC5, ADC5, PCINT13 and TWI SCL.
SPDIP-28 · Top view · Select a pin number to inspect its connection.

CPU and memory

ATmega328P-specific capacities

ParameterValueConditions / notes
Architecture8-bit AVR RISC32 general-purpose working registers
Instruction set131 instructionsMost execute in a single clock cycle
Program Flash32 KBSelf-programmable; optional boot section
SRAM2 KBStack, runtime variables and buffers
EEPROM1 KBNonvolatile data
Write endurance10,000 Flash / 100,000 EEPROM cyclesManufacturer endurance specification
Retention20 years at 85°C / 100 years at 25°CQualified reliability results
Multiplier8 × 8 hardwareTwo-cycle operation

Other members named on the shared datasheet have different memory capacities.

Clock, power and temperature

Selected PU and AU industrial orderables

ParameterValueConditions / notes
Operating supply1.8–5.5 VVCC and AVCC requirements apply
Clock at 1.8 VUp to 4 MHzSee maximum-frequency curve
Clock at 2.7 VUp to 10 MHzFrequency limit rises with supply
Clock at 4.5–5.5 VUp to 20 MHz16 MHz example uses 5 V
Factory clock8 MHz internal RC / 8 = 1 MHzCKDIV8 programmed by default
Industrial temperature−40 to +85°CSelected ATMEGA328P-PU / AU
Active current example5.2 mA typical; 9 mA maximum8 MHz, 5 V; datasheet measurement conditions
Power-down example0.1 µA typical; 2 µA maximum3 V, watchdog disabled; datasheet conditions

Current changes with clock, peripherals, loading and temperature. The clock explorer applies the datasheet maximum-frequency curve.

Timers and interfaces

Functions share physical GPIO contacts

ParameterValueConditions / notes
Timer0 / Timer2Two 8-bit timersPrescalers and compare/PWM outputs
Timer1One 16-bit timerCompare outputs and input capture
PWM outputsSixOC0A/B, OC1A/B, OC2A/B
Serial interfacesUSART, SPI, two-wire interfaceTWI is compatible with I²C
ADC10 bits; 6 or 8 external channelsSix in SPDIP; eight in TQFP
Analog comparatorOneAIN0/AIN1 or selected multiplexed input
General-purpose I/OUp to 23Reset and oscillator choices reduce available pins
Sleep modesSixIdle, ADC Noise Reduction, Power-down, Power-save, Standby, Extended Standby
SupervisionWatchdog and brown-out detectionConfigured by registers and fuses

SPI, PWM and other alternate functions are multiplexed with GPIO; they do not add separate pins.

ADC and analog connections

10-bit successive approximation

ParameterValueConditions / notes
Nominal code range0–1023Ideal step = VREF / 1024
ADC clock for full resolution50–200 kHzSelected by a clock prescaler
Normal conversion13 ADC clock cyclesFirst conversion after enabling takes 25 cycles
Reference choicesAREF, AVCC, internal nominal 1.1 VSelect with REFS bits; allow settling
AVCC connectionRequired even if ADC is unusedUse filtering when analog accuracy matters
AREF bypassTypically 100 nF to GNDDo not short an active internal reference to an external source
TQFP ADC6 / ADC7Analog-only inputsNo digital driver or internal pullup

Reference tolerance, source impedance and noise affect absolute measurement accuracy.

I/O design and stress limits

Do not design to absolute maximum ratings

ParameterValueConditions / notes
Input LOW / HIGH, general pins≤ 0.3 × VCC / ≥ 0.6 × VCCReset and oscillator contacts have separate specifications
Internal pullup20–50 kΩGeneral GPIO, when enabled
Pin current absolute maximum40 mAStress limit; not a recommended load
Supply/ground current absolute maximum200 mAObserve port-group current restrictions too
Output-voltage test at 5 V20 mA loadGuaranteed voltage under specified test conditions
Output-voltage test at 3 V10 mA loadUse the detailed DC table for margin
Typical LED example1 kΩ series resistor at 5 VA few mA; never connect an LED directly
Pin voltage stress range−0.5 V to VCC + 0.5 VRESET has a separate high-voltage programming limit

External loads must satisfy per-pin, port-group, total-current and voltage requirements.

Timer1 hardware toggle

CTC mode 4 · OCR1A is TOP

ParameterValueConditions / notes
Output frequencyfCPU / (2 × N × (1 + OCR1A))OC1A toggles at each compare match
Prescaler N1, 8, 64, 256 or 1024Internal timer clock options
OCR1A range0–65535Sixteen-bit unsigned compare value
Example clock16 MHz5 V supply; suitable external clock configured
Example divider / TOP256 / 31249One output cycle per second
Output pinPB1 / OC1ASPDIP15; TQFP13
Required configurationDDR for PB1, COM1A0, WGM12, CS12Mode4, toggle output, divide256 example
Live TOP changesCTC TOP is not double bufferedChanging TOP below the running count can delay the next match

The calculator gives steady-state hardware timing; it does not emulate register-write transients.

Bring-up and programming

Standalone circuit checklist

ParameterValueConditions / notes
ISP signalsRESET, MOSI, MISO, SCK, VCC reference, GNDProgrammer target voltage must match the chip
Clock requirementA valid selected clock must be presentChanging clock fuses can require an external clock for later ISP
BootloaderMust be programmed separately if requiredA bare IC is not automatically Arduino-ready
Fuse polarityProgrammed = 0; unprogrammed = 1Read the specific fuse table before changing bits
Reset pulse2.5 µs minimumElectrical specification
Bypass capacitors100 nF close to each supply groupShort connections to common ground
Crystal capacitorsChoose for crystal load and board capacitance22 pF is illustrative, not universal

Keep the reset function available unless you have a deliberate alternate programming and recovery plan.

Take it into ProTech

Find ATmega328P in the Components Library to place its schematic symbol and connect its pins.

Reference page · circuit simulation model not yet availableOpen ProTech

Component view