ATMEGA328P-PN - 8-bit AVR MCU 20MHz 32KB Flash PDIP-28 | Microchip
MPN: ATMEGA328P-PN ✓ چالاکATMEGA328P-PN گشتی
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.
جێگرەوەکانی جێگۆڕکێ بۆ ATMEGA328P-PN — هەمان پاکەت، پین بە پین گونجاو. ئەو بەشانەی پاکەتی جیاوازیان هەیە و پێویستیان بە چاککردنەوەی PCB هەیە لابراون.
جۆرەکان لەم زنجیرەیەدا
مۆدێلەکانی هەمان زنجیرە کە بە شێوەی ڕاستەوخۆ گونجاون لەگەڵ ATMEGA328P-PN (هەمان شێوە و پێکهاتەی شوێن) — جیاوازە لە Package, Operating Temperature, ADC, RoHS Status, Serial Interfaces.
ATMEGA328P-PU
✅ جێگرەوەی ڕاستەوخۆ ⚠️ تایبەتمەندییەکان پشتڕاست نەکراونەتەوەپەیوەندی بۆ نرخ
بینینی داتاشیت →ATMEGA328-PI
✅ جێگرەوەی ڕاستەوخۆ ⚠️ تایبەتمەندییەکان پشتڕاست نەکراونەتەوە📋 جێگرەوەی سەرچاوە (لە کاتالۆگدا نییە)
ATMEGA323-8PI
✅ جێگرەوەی ڕاستەوخۆپەیوەندی بۆ نرخ
بینینی داتاشیت →ATMEGA168V-10PI
✅ جێگرەوەی ڕاستەوخۆ ⚠️ تایبەتمەندییەکان پشتڕاست نەکراونەتەوەپەیوەندی بۆ نرخ
بینینی داتاشیت →LGT8F328P
✅ جێگرەوەی ڕاستەوخۆ📋 جێگرەوەی سەرچاوە (لە کاتالۆگدا نییە)
ATMEGA328P-PN زۆرترین ڕێژە و تایبەتمەندییە کارەباییەکان
| 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) |
| پلەی گەرمیی کارکردن | -40C to +105C |
| پاکێج | 28-PDIP |
| جۆری دامەزراندن | Through-Hole |
| Programming Interfaces | ISP, debugWIRE |
| ئێستای دۆخی وزەی کەم | 0.1 uA (power-save) |
| دۆخی RoHS | Green (RoHS compliant) |
| Data Sheets Page Count | 662 pages |
ڕێکخستنی پینی ATMEGA328P-PN
| پین 1 | PC6 / RESET — Reset input or port C bit 6 |
| پین 2 | PD0 / RXD — USART receive / port D bit 0 |
| پین 3 | PD1 / TXD — USART transmit / port D bit 1 |
| پین 4 | PD2 / INT0 — External interrupt 0 / port D bit 2 |
| پین 5 | PD3 / INT1 / OC2B — Interrupt 1, Timer2 PWM / port D bit 3 |
| پین 6 | PD4 / T0 / XCK — Timer0 clock, USART XCK / port D bit 4 |
| پین 7 | VCC — Digital supply voltage |
| پین 8 | GND — Ground |
| پین 9 | PB6 / XTAL1 / TOSC1 — Crystal oscillator input / port B bit 6 |
| پین 10 | PB7 / XTAL2 / TOSC2 — Crystal oscillator output / port B bit 7 |
| پین 11 | PD5 / T1 / OC0B — Timer1 clock, Timer0 PWM / port D bit 5 |
| پین 12 | PD6 / AIN0 / OC0A — Comparator positive input, PWM / port D bit 6 |
| پین 13 | PD7 / AIN1 — Comparator negative input / port D bit 7 |
| پین 14 | PB0 / ICP1 / CLK0 — Timer1 input capture, clock output / port B bit 0 |
| پین 15 | PB1 / OC1A — Timer1 PWM output A / port B bit 1 |
| پین 16 | PB2 / SS / OC1B — SPI slave select, Timer1 PWM B / port B bit 2 |
| پین 17 | PB3 / MOSI / OC2A — SPI master out, Timer2 PWM / port B bit 3 |
| پین 18 | PB4 / MISO — SPI master in / port B bit 4 |
| پین 19 | PB5 / SCK — SPI serial clock / port B bit 5 |
| پین 20 | AVCC — ADC supply voltage |
| پین 21 | AREF — ADC analog reference |
| پین 22 | GND — Ground |
| پین 23 | PC0 / ADC0 — ADC input 0 / port C bit 0 |
| پین 24 | PC1 / ADC1 — ADC input 1 / port C bit 1 |
| پین 25 | PC2 / ADC2 — ADC input 2 / port C bit 2 |
| پین 26 | PC3 / ADC3 — ADC input 3 / port C bit 3 |
| پین 27 | PC4 / ADC4 / SDA — ADC 4, TWI data / port C bit 4 |
| پین 28 | PC5 / ADC5 / SCL — ADC 5, TWI clock / port C bit 5 |
بەکارهێنانە باوەکان
ATMEGA328P-PN گونجاوە بۆ 6 بەکارھێنانs: 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.
پێشنیارکراو
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.
پێشنیارکراو
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.
پێشنیارکراو
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.
پێشنیارکراو
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.
پێشنیارکراو
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.
پێشنیارکراو
کورتەی بەرهەمە پێشنیارکراوەکان
داتای سەرچاوەی ئەندازیاری بۆ ATMEGA328P-PN — بەراوردکردن، ڕێنمایی دیزاین و زانیاری پابەندبوون.
ڕێنمایی هەڵبژاردن
بەراوردکردن لەگەڵ جێگرەوەکان
| پارامەتر | ئەم بەرهەمە | 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 |
جیاکەرەوە سەرەکییەکان
- Industrial +105C temperature rating (بەراورد بەATMEGA328P-PU)
- picoPower low-current design (بەراورد بەATMEGA328-PI)
- Full 32KB flash at up to 20 MHz (بەراورد بەATMEGA323-8PI)
تێبینییەکانی دیزاین
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.
زانیاری پابەندبوون
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.