ATmega328P-PU chip: specs and pinout
8-bit AVR microcontroller in a 28-pin PDIP package: 32 KB flash, 2 KB SRAM, 1 KB EEPROM, 23 I/O lines. Sold as a bare chip, not a board.
Specs
| Spec | Value | Source |
|---|---|---|
| Operating voltage | 1.8 V to 5.5 V | source Features, Operating Voltage |
| Speed grade | 0-4 MHz at 1.8-5.5 V; 0-10 MHz at 2.7-5.5 V; 0-20 MHz at 4.5-5.5 V | source Features, Speed Grade; Section 29.3 Figure 29-1 |
| Operating temperature | -40 C to 85 C | source Features, Temperature Range |
| Flash / SRAM / EEPROM | 32 KB / 2 KB / 1 KB | source Section 2 Overview, memory table (ATmega328P row); Features |
| Programmable I/O lines | 23 | source Features, I/O and Packages |
| ADC | 6-channel 10-bit in PDIP package | source Features, Peripheral Features |
| Serial interfaces | USART, SPI, 2-wire serial interface (I2C compatible) | source Features, Peripheral Features |
| Active current | 0.2 mA at 1 MHz, 1.8 V, 25 C | source Features, Power Consumption |
| Power-down current | 0.1 uA at 1.8 V, 25 C | source Features, Power Consumption |
| Factory-calibrated internal oscillator | 8.0 MHz, +/-1% at 3 V, -40 C to 85 C | source Section 29.4.1 Table 29-9 |
Power
| Value | Source | |
|---|---|---|
| Supply | 1.8 V to 5.5 V | source Features, Operating Voltage and Power Consumption |
| Current | 0.2 mA active at 1 MHz, 1.8 V, 25 C; 0.1 uA power-down | source Features, Operating Voltage and Power Consumption |
Pinout
Bare chip, no module board. The pin table is the 28-pin PDIP figure from the chip data sheet (pin names written as in the sheet). The Arduino bootloader on this chip is not described in any maker document. The sheet covers the ATmega48A/PA/88A/PA/168A/PA/328/P family; the ATmega328P rows are used.
| Pin | Function | Voltage | Notes | Source |
|---|---|---|---|---|
| 1 | PC6 (PCINT14/RESET) | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions | ||
| 2 | PD0 (PCINT16/RXD) | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions | ||
| 3 | PD1 (PCINT17/TXD) | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions | ||
| 4 | PD2 (PCINT18/INT0) | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions | ||
| 5 | PD3 (PCINT19/OC2B/INT1) | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions | ||
| 6 | PD4 (PCINT20/XCK/T0) | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions | ||
| 7 | VCC | Digital supply voltage (Section 1.1.1) | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions | |
| 8 | GND | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions | ||
| 9 | PB6 (PCINT6/XTAL1/TOSC1) | Clock input depending on fuse settings (Section 1.1.3) | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions | |
| 10 | PB7 (PCINT7/XTAL2/TOSC2) | Oscillator output depending on fuse settings (Section 1.1.3) | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions | |
| 11 | PD5 (PCINT21/OC0B/T1) | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions | ||
| 12 | PD6 (PCINT22/OC0A/AIN0) | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions | ||
| 13 | PD7 (PCINT23/AIN1) | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions | ||
| 14 | PB0 (PCINT0/CLKO/ICP1) | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions | ||
| 15 | PB1 (OC1A/PCINT1) | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions | ||
| 16 | PB2 (SS/OC1B/PCINT2) | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions | ||
| 17 | PB3 (MOSI/OC2A/PCINT3) | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions | ||
| 18 | PB4 (MISO/PCINT4) | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions | ||
| 19 | PB5 (SCK/PCINT5) | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions | ||
| 20 | AVCC | Must not differ more than 0.3 V from VCC (ADC chapter) | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions | |
| 21 | AREF | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions | ||
| 22 | GND | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions | ||
| 23 | PC0 (ADC0/PCINT8) | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions | ||
| 24 | PC1 (ADC1/PCINT9) | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions | ||
| 25 | PC2 (ADC2/PCINT10) | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions | ||
| 26 | PC3 (ADC3/PCINT11) | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions | ||
| 27 | PC4 (ADC4/SDA/PCINT12) | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions | ||
| 28 | PC5 (ADC5/SCL/PCINT13) | source Section 1 Figure 1-1, 28 PDIP; Section 1.1 Pin Descriptions |
Build with it
Project ideas for the ATmega328P-PU chip. Each link opens Soldr with the prompt filled in; Soldr assigns the pins, checks power and shows how to wire every part.
- LED chaser on a breadboard: The chip runs from 1.8 V to 5.5 V and has an on-chip calibrated oscillator, so it can run on a breadboard with a 5 V supply module. A learning project for moving a sketch from a board to a bare chip.
- Stopwatch with a 4-digit display: Port D and port B pins are plain digital I/O, and 5 V logic matches the chip's 4.5-5.5 V range. The Uno is only used to program the chip.
- Dry-soil LED indicator: PC0 to PC5 are the six 10-bit ADC inputs in the DIP package. Wire AVCC to VCC. A learning project; check the module's output stays below the 5 V supply.
- Temperature readout on a 16x2 LCD: Pin 27 (PC4) is SDA and pin 28 (PC5) is SCL for the chip's two-wire interface, so the I2C LCD connects directly at 5 V.
Common mistakes
- Running at 16 MHz from a 3.3 V supply: the speed grade is 0-10 MHz at 2.7-5.5 V and 0-20 MHz only at 4.5-5.5 V (source: link, Features, Speed Grade; Section 29.3)
- AVCC left unconnected or at a different voltage: AVCC (pin 20) must not differ more than 0.3 V from VCC, even if the ADC is not used (source: link, ADC chapter)
- Expecting PC6 (pin 1) to be a normal I/O pin: with the RSTDISBL fuse unprogrammed PC6 is the reset input, so a low level resets the chip (source: link, Section 1.1.5)
Not covered by the official source
- Datasheet is the industrial-grade DS40002061A family sheet (28-pin PDIP is the PU package); PU-specific ordering details are not covered.
- The Arduino bootloader (clock speed it expects, programming method) is not in any maker document, so ideas avoid depending on it and say the Uno programs the chip.
- Typical operating current at 16 MHz and 5 V is not given here (current tables in the sheet are per family member).
Sources
- link (Microchip DS40002061A, ATmega48A/PA/88A/PA/168A/PA/328/P megaAVR Data Sheet Complete, 2018)