ATMEGA328P-PN - 8-bit AVR MCU 20MHz 32KB Flash PDIP-28 | Microchip
MPN: ATMEGA328P-PN ✓ Active| Qty | Unit Price | Extended |
|---|---|---|
| 1 | $2.75 | $2.75 |
| 10 | $2.48 | $24.80 |
| 100 | $2.2 | $220.00 |
| 500 | $1.98 | $990.00 |
| 1,000 | $1.75 | $1,750.00 |
ATMEGA328P-PN Overview
An 8-bit microcontroller is a single-chip computer whose CPU processes data in 8-bit words, integrating processor core, program memory, data memory, timers, communication peripherals, and analog converters into one package. Within the power-management-free MCU hierarchy, the AVR family from Atmel (now Microchip Technology) popularized single-cycle RISC execution, making the ATmega line a mainstay of embedded control, education, and the Arduino ecosystem.
Key features include 23 programmable general-purpose I/O lines, 6-channel 10-bit ADC, two 8-bit timers, one 16-bit timer, USART, SPI, and TWI (I2C) serial interfaces, plus a watchdog timer, analog comparator, and six sleep modes down to 0.1 uA in power-save mode. The picoPower (p) technology and wide 2.5V to 5.5V supply range support battery-powered designs.
Architecturally, the AVR core uses Harvard memory organization with 131 single-cycle RISC instructions and on-chip debug via debugWIRE, while the flash is segmented for boot-loader self-programming. The 662-page family datasheet documents the complete register set, and the ATmega328P is famously the microcontroller of the Arduino Uno.
Typical applications include Arduino-compatible boards, home appliances, HVAC and motor control, industrial sensing nodes, and hobbyist embedded projects. The through-hole PDIP-28 package makes it ideal for prototyping, socketed production boards, and educational kits.
Design tip: program in-system via ISP header or debugWIRE on the reset pin; keep decoupling capacitors close to VCC and AVCC, and always return AREF to GND through a capacitor if the ADC is used.
This page synthesizes distributor pricing, drop-in alternatives, and practical design notes not found in the manufacturer datasheet.
Drop-in alternatives for ATMEGA328P-PN — same package, pin-to-pin compatible. Different-package parts requiring PCB rework are excluded.
Variants in this series
Same-series models that are drop-in compatible with ATMEGA328P-PN (same form factor and footprint) — differing in Package, Operating Temperature, RoHS Status, Mounting Type, EEPROM.
Quick Comparison Tool — Select alternative parts for side-by-side comparison:
ATMEGA328P-PU
✅ Drop-In ⚠️ 参数待验证✓ In Stock
Contact for price
View Datasheet →ATMEGA328-PI
✅ Drop-In ⚠️ 参数待验证📋 Reference alternative (not in catalog)
ATMEGA323-8PI
✅ Drop-In✓ In Stock
$4.48 / Unit
View Datasheet →ATMEGA168V-10PI
✅ Drop-In ⚠️ 参数待验证✓ In Stock
$1.26 / Unit
View Datasheet →LGT8F328P
✅ Drop-In📋 Reference alternative (not in catalog)
ATMEGA328P-PN Maximum Ratings & Electrical Characteristics
| Core Architecture | AVR 8-bit RISC |
| Max CPU Frequency | 20 MHz |
| Flash Memory | 32 KB (16K x 16) |
| SRAM | 2 KB |
| EEPROM | 1 KB |
| Supply Voltage Range | 2.5 V to 5.5 V |
| GPIO Count | 23 |
| ADC Resolution | 10-bit, 6 channels |
| Timers | 2 x 8-bit, 1 x 16-bit |
| Communication Interfaces | USART, SPI, TWI (I2C) |
| Operating Temperature | -40C to +105C |
| Package | 28-PDIP |
| Mounting Type | Through-Hole |
| Programming Interfaces | ISP, debugWIRE |
| Low Power Mode Current | 0.1 uA (power-save) |
| RoHS Status | Green (RoHS compliant) |
| Data Sheets Page Count | 662 pages |
ATMEGA328P-PN Pin Configuration
| Pin 1 | PC6 / RESET — Reset input or port C bit 6 |
| Pin 2 | PD0 / RXD — USART receive / port D bit 0 |
| Pin 3 | PD1 / TXD — USART transmit / port D bit 1 |
| Pin 4 | PD2 / INT0 — External interrupt 0 / port D bit 2 |
| Pin 5 | PD3 / INT1 / OC2B — Interrupt 1, Timer2 PWM / port D bit 3 |
| Pin 6 | PD4 / T0 / XCK — Timer0 clock, USART XCK / port D bit 4 |
| Pin 7 | VCC — Digital supply voltage |
| Pin 8 | GND — Ground |
| Pin 9 | PB6 / XTAL1 / TOSC1 — Crystal oscillator input / port B bit 6 |
| Pin 10 | PB7 / XTAL2 / TOSC2 — Crystal oscillator output / port B bit 7 |
| Pin 11 | PD5 / T1 / OC0B — Timer1 clock, Timer0 PWM / port D bit 5 |
| Pin 12 | PD6 / AIN0 / OC0A — Comparator positive input, PWM / port D bit 6 |
| Pin 13 | PD7 / AIN1 — Comparator negative input / port D bit 7 |
| Pin 14 | PB0 / ICP1 / CLK0 — Timer1 input capture, clock output / port B bit 0 |
| Pin 15 | PB1 / OC1A — Timer1 PWM output A / port B bit 1 |
| Pin 16 | PB2 / SS / OC1B — SPI slave select, Timer1 PWM B / port B bit 2 |
| Pin 17 | PB3 / MOSI / OC2A — SPI master out, Timer2 PWM / port B bit 3 |
| Pin 18 | PB4 / MISO — SPI master in / port B bit 4 |
| Pin 19 | PB5 / SCK — SPI serial clock / port B bit 5 |
| Pin 20 | AVCC — ADC supply voltage |
| Pin 21 | AREF — ADC analog reference |
| Pin 22 | GND — Ground |
| Pin 23 | PC0 / ADC0 — ADC input 0 / port C bit 0 |
| Pin 24 | PC1 / ADC1 — ADC input 1 / port C bit 1 |
| Pin 25 | PC2 / ADC2 — ADC input 2 / port C bit 2 |
| Pin 26 | PC3 / ADC3 — ADC input 3 / port C bit 3 |
| Pin 27 | PC4 / ADC4 / SDA — ADC 4, TWI data / port C bit 4 |
| Pin 28 | PC5 / ADC5 / SCL — ADC 5, TWI clock / port C bit 5 |
Typical Applications
ATMEGA328P-PN is suitable for 6 applications: Arduino-Compatible Development Boards, Industrial Sensing and Control Nodes, Home Appliances and White Goods, Battery-Powered IoT and Remote Sensor Terminals, Repair, Retrofit, and Legacy Board Maintenance, Robotics and Hobbyist Embedded Projects.
Arduino-Compatible Development Boards
The ATMEGA328P-PN is the core MCU of the Arduino Uno R3 architecture, and its through-hole PDIP-28 package is socketed on countless clones, shields, and educational kits. Its 32KB flash holds the Arduino bootloader with roughly 2KB still free for user sketches on a standard Uno build, while 2KB SRAM supports typical Processing-style sketches. Loaded with the Uno bootloader and clocked at 16 MHz from a resonator, it programs directly from the Arduino IDE over serial. The +105C rating tolerates enclosures and warm bench conditions that commercial-grade parts cannot, and the socketed DIP allows beginners to hot-swap chips without rework equipment, making it the definitive learning microcontroller.
Recommended
Industrial Sensing and Control Nodes
The -40C to +105C industrial temperature rating of the ATMEGA328P-PN makes it suitable for sensor nodes mounted in HVAC plenums, motor cabinets, and outdoor enclosures. The 6-channel 10-bit ADC reads thermistors, potentiometers, and 0-5V industrial transmitters, while the USART bridges to RS-485 transceivers for Modbus RTU slaves and the TWI port reads I2C pressure or humidity sensors. Its 0.1 uA power-save sleep current supports battery-backed monitoring points that wake on interrupt. WDT-based recovery ensures autonomous restart after supply transients common in factory power, and EEPROM calibration data survives years of field operation within the rated 100,000 write cycles.
Recommended
Home Appliances and White Goods
Appliance control boards such as fan speed, washing cycles, and heater sequencing benefit from the ATMEGA328P-PN's combination of industrial temperature tolerance, wide 2.5V to 5.5V supply, and brown-out-safe operation. The three timers with PWM channels drive triac triggering or brushless motor drivers, and the analog comparator provides zero-cross detection for AC load control. The 1KB EEPROM stores cycle counters and user settings through power interruptions. Through-hole PDIP construction resists solder-joint fatigue on boards subject to vibration, and the well-documented register set shortens firmware development for appliance OEMs maintaining long product lifecycles and spare-parts inventories.
Recommended
Battery-Powered IoT and Remote Sensor Terminals
With power-save sleep current of 0.1 uA and a wide 2.5V supply floor, the ATMEGA328P-PN runs years from lithium primary cells in remote logging nodes. A typical duty cycle wakes the core from power-save on watchdog or pin-change interrupt, samples the 10-bit ADC, transmits over USART to a LoRa or RF module, and returns to sleep in under 100 ms, keeping average current in the tens of microamps. The internal 8 MHz RC oscillator removes crystal cost for timing-tolerant applications. EEPROM wear-leveled storage preserves logging indexes, and the 105C rating covers solar-heated enclosures where battery compartments exceed standard commercial limits.
Recommended
Repair, Retrofit, and Legacy Board Maintenance
Service technicians frequently socket-replace ATmega328P family chips in industrial controllers, 3D printer boards, and test fixtures. Because the ATMEGA328P-PN shares the PDIP-28 footprint with ATMEGA328-PI, ATMEGA323-8PI, and ATMEGA168V-10PI parts, an authentic 32KB picoPower replacement restores function without PCB changes. Reflashing the firmware via the ISP header (MOSI/MISO/SCK/RESET on pins 17-19 and 1) takes minutes with a USBasp, and the debugWIRE interface aids fault-finding on boards without test points. Availability across roughly 12 distributors per Octopart reduces downtime when original commercial-temperature stock is exhausted.
Recommended
Robotics and Hobbyist Embedded Projects
Hobby robots, RC telemetry, and maker projects leverage the ATMEGA328P-PN's 20 MIPS throughput, six PWM channels, and interrupt-driven input capture for encoder reading. At 5V, its GPIO sources up to 20 mA per pin, directly driving LEDs and small relays via transistors, while the SPI port streams data to IMU breakouts. The 32KB flash accommodates the Servo, SensorFusion, and communication libraries typical of Arduino robotics sketches. The PDIP package's field-replaceability suits iterative prototyping: corrupted bootloader from miswiring is fixed by swapping a $3 chip rather than desoldering a QFN. Community debugging resources for this exact die are unmatched.
Recommended
Recommended Products Summary
Engineering reference data for ATMEGA328P-PN — comparison, design guidance, and compliance information.
Selection Guide
Comparison with Alternatives
| Parameter | This Product | ATMEGA328P-PU | ATMEGA328-PI | ATMEGA323-8PI | ATMEGA168V-10PI | LGT8F328P |
|---|---|---|---|---|---|---|
| Package | 28-PDIP | 28-PDIP - same | 28-PDIP - same | 28-PDIP - same | 28-PDIP - same | 28-PDIP - same |
| Brand | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Microchip Technology | Will Semiconductor |
| Flash Memory | 32 KB | 32 KB | 32 KB | 16 KB | 16 KB | 32 KB |
| SRAM | 2 KB | 2 KB | 2 KB | 1 KB | 1 KB | 2 KB |
| EEPROM | 1 KB | 1 KB | 1 KB | 1 KB | 0.5 KB | 1 KB |
| Max Frequency | 20 MHz | 20 MHz | 20 MHz | 8 MHz | 10 MHz | 32 MHz |
| picoPower Technology | Yes | Yes | No | No | No (V = low voltage) | No |
Key Differentiators
- Industrial +105C temperature rating (vs ATMEGA328P-PU)
- picoPower low-current design (vs ATMEGA328-PI)
- Full 32KB flash at up to 20 MHz (vs ATMEGA323-8PI)
Design Notes
Connect VCC (pin 7) and AVCC (pin 20) to the same supply rail, each with a 100 nF ceramic decoupling capacitor placed within 5 mm of the pin. AVCC must never be left floating even when the ADC is unused, and the ADC accuracy degrades if AVCC carries digital switching noise; an LC filter (10 uH inductor plus 10 uF capacitor) on AVCC restores full 10-bit performance in mixed-signal boards.
Tie AREF (pin 21) to GND through a 100 nF capacitor when using the internal reference or VCC as the ADC reference; never connect an external reference directly without removing the internal reference source. Use a crystal with two 18-22 pF load capacitors on XTAL1/XTAL2 (pins 9-10) for full 20 MHz operation, keeping trace lengths under 10 mm. Reset (pin 1) needs a 10 kOhm pull-up for reliable ISP and brown-out-free startup.
Do not exceed 20 MHz at supply voltages below 4.5V - the datasheet frequency-voltage derating curve limits 3.3V operation to roughly 13.3 MHz. Avoid burning the RSTDISBL fuse unless external reset is never required, as it permanently disables ISP and can brick socketed parts. When using debugWIRE, remember the DWEN fuse requires high-voltage parallel programming to clear; budget for a programming header in every production board.
Compliance Information
DigiKey and FindIC listings describe the ATMEGA328P-PN as a Green, 105C-rated RoHS part. REACH, halogen-free, and conflict-minerals status not stated in provided data - consult Microchip product compliance portal.