ATmega328P8-bit AVR microcontroller
Program the logic. Connect the physical world.
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.
Click a lead or use the arrow keys. Top view
PC6 / RESET
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.
PD0 / RXD
Function
PD0, RXD and pin-change interrupt PCINT16.
How to connect
Connect to a voltage-compatible UART transmitter.
PD1 / TXD
Function
PD1, TXD and PCINT17.
How to connect
Connect to a compatible UART receiver; not directly to RS-232 voltage levels.
PD2 / INT0
Function
PD2, INT0 and PCINT18.
How to connect
Digital input/output or external interrupt source.
PD3 / OC2B
Function
PD3, OC2B, INT1 and PCINT19.
How to connect
Timer2 compare output or general digital I/O.
PD4 / T0
Function
PD4, USART synchronous clock XCK, Timer0 clock T0 and PCINT20.
How to connect
General I/O or peripheral clock input/output.
VCC
Function
Digital power supply.
How to connect
Connect to the regulated supply and bypass locally with 100 nF.
GND
Function
Digital supply return.
How to connect
Connect to the common ground plane.
PB6 / XTAL1
Function
PB6, XTAL1, TOSC1 and PCINT6.
How to connect
Crystal/resonator input or clock input as selected by fuses.
Electrical note
Available as GPIO only with an appropriate internal clock configuration.
PB7 / XTAL2
Function
PB7, XTAL2, TOSC2 and PCINT7.
How to connect
Crystal/resonator output; load capacitors depend on the selected crystal.
PD5 / OC0B
Function
PD5, OC0B, T1 and PCINT21.
How to connect
Timer0 compare output or general I/O.
PD6 / OC0A
Function
PD6, OC0A, AIN0 and PCINT22.
How to connect
Timer0 compare output or analog comparator positive input.
PD7 / AIN1
Function
PD7, AIN1 and PCINT23.
How to connect
Analog comparator negative input or digital I/O.
PB0 / ICP1
Function
PB0, ICP1, CLKO and PCINT0.
How to connect
Timer1 input capture or clock output when enabled.
PB1 / OC1A
Function
PB1, OC1A and PCINT1.
How to connect
Timer1 compare output; the example drives a resistor and LED here.
PB2 / SS
Function
PB2, SS, OC1B and PCINT2.
How to connect
SPI slave select or Timer1 compare output.
Electrical note
For SPI master mode, configure SS safely so an external LOW cannot unintentionally force slave mode.
PB3 / MOSI
Function
PB3, MOSI, OC2A and PCINT3.
How to connect
SPI data out in master mode; programmer MOSI during ISP.
PB4 / MISO
Function
PB4, MISO and PCINT4.
How to connect
SPI data in in master mode; programmer MISO during ISP.
PB5 / SCK
Function
PB5, SCK and PCINT5.
How to connect
SPI clock; programmer SCK during ISP.
AVCC
Function
Powers the ADC and specified Port C circuitry.
How to connect
Connect to VCC even when ADC is unused; filter and bypass for analog measurements.
AREF
Function
External reference input or decoupling node for a selected internal reference.
How to connect
A typical AVCC-reference circuit uses 100 nF from AREF to GND.
Electrical note
Do not drive AREF externally while an internal reference is selected.
GND
Function
Analog-side supply return.
How to connect
Join to common ground, with short quiet analog return paths.
PC0 / ADC0
Function
PC0, ADC0, PCINT8.
How to connect
Analog channel or general digital I/O.
Electrical note
Observe the selected ADC reference and pin-voltage limits.
PC1 / ADC1
Function
PC1, ADC1, PCINT9.
How to connect
Analog channel or general digital I/O.
Electrical note
Observe the selected ADC reference and pin-voltage limits.
PC2 / ADC2
Function
PC2, ADC2, PCINT10.
How to connect
Analog channel or general digital I/O.
Electrical note
Observe the selected ADC reference and pin-voltage limits.
PC3 / ADC3
Function
PC3, ADC3, PCINT11.
How to connect
Analog channel or general digital I/O.
Electrical note
Observe the selected ADC reference and pin-voltage limits.
PC4 / ADC4 / SDA
Function
PC4, ADC4, PCINT12 and TWI SDA.
How to connect
Analog/digital I/O or TWI bus with suitable external pullups.
Electrical note
Observe the selected ADC reference and pin-voltage limits.
PC5 / ADC5 / SCL
Function
PC5, ADC5, PCINT13 and TWI SCL.
How to connect
Analog/digital I/O or TWI bus with suitable external pullups.
Electrical note
Observe the selected ADC reference and pin-voltage limits.
GND
Function
Additional TQFP ground contact.
How to connect
Connect to the common ground.
VCC
Function
Additional TQFP supply contact.
How to connect
Connect and bypass alongside the other supply pins.
ADC6
Function
Additional ADC channel in the 32-lead package.
How to connect
Analog input within the reference and supply limits.
Electrical note
No digital output driver, pullup or GPIO function.
ADC7
Function
Additional ADC channel in the 32-lead package.
How to connect
Analog input within the reference and supply limits.
Electrical note
No digital output driver, pullup or GPIO function.
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.
Operating profile
ATMEGA328P-PU
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
Digital I/O & peripherals14 pins
Power & returns6 pins
Clock contacts2 pins
ADC & reference9 pins
Reset1 pins
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.
fOUT = fCPU ÷ [2 × prescaler × (OCR1A + 1)]. The output changes state once per compare match.
—OCR1A · unsigned 16-bit valueOutput: 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.
Pin reference
Select a pin to explore its function and connection.
| Pin | Signal | Type | Function |
|---|---|---|---|
| PC6 / RESET | Reset / optional GPIO | Active LOW reset; PC6 is GPIO only when the reset-disable fuse is programmed. | |
| PD0 / RXD | GPIO / USART receive | PD0, RXD and pin-change interrupt PCINT16. | |
| PD1 / TXD | GPIO / USART transmit | PD1, TXD and PCINT17. | |
| PD2 / INT0 | GPIO / interrupt | PD2, INT0 and PCINT18. | |
| PD3 / OC2B | GPIO / timer / interrupt | PD3, OC2B, INT1 and PCINT19. | |
| PD4 / T0 | GPIO / clock | PD4, USART synchronous clock XCK, Timer0 clock T0 and PCINT20. | |
| VCC | Supply | Digital power supply. | |
| GND | Ground | Digital supply return. | |
| PB6 / XTAL1 | GPIO / oscillator input | PB6, XTAL1, TOSC1 and PCINT6. | |
| PB7 / XTAL2 | GPIO / oscillator output | PB7, XTAL2, TOSC2 and PCINT7. | |
| PD5 / OC0B | GPIO / timer | PD5, OC0B, T1 and PCINT21. | |
| PD6 / OC0A | GPIO / comparator | PD6, OC0A, AIN0 and PCINT22. | |
| PD7 / AIN1 | GPIO / comparator | PD7, AIN1 and PCINT23. | |
| PB0 / ICP1 | GPIO / capture | PB0, ICP1, CLKO and PCINT0. | |
| PB1 / OC1A | GPIO / timer output | PB1, OC1A and PCINT1. | |
| PB2 / SS | GPIO / SPI select | PB2, SS, OC1B and PCINT2. | |
| PB3 / MOSI | GPIO / SPI / programming | PB3, MOSI, OC2A and PCINT3. | |
| PB4 / MISO | GPIO / SPI / programming | PB4, MISO and PCINT4. | |
| PB5 / SCK | GPIO / SPI / programming | PB5, SCK and PCINT5. | |
| AVCC | Analog supply | Powers the ADC and specified Port C circuitry. | |
| AREF | ADC reference | External reference input or decoupling node for a selected internal reference. | |
| GND | Ground | Analog-side supply return. | |
| PC0 / ADC0 | GPIO / ADC | PC0, ADC0, PCINT8. | |
| PC1 / ADC1 | GPIO / ADC | PC1, ADC1, PCINT9. | |
| PC2 / ADC2 | GPIO / ADC | PC2, ADC2, PCINT10. | |
| PC3 / ADC3 | GPIO / ADC | PC3, ADC3, PCINT11. | |
| PC4 / ADC4 / SDA | GPIO / ADC / TWI | PC4, ADC4, PCINT12 and TWI SDA. | |
| PC5 / ADC5 / SCL | GPIO / ADC / TWI | PC5, ADC5, PCINT13 and TWI SCL. | |
| GND | Ground | Additional TQFP ground contact. | |
| VCC | Supply | Additional TQFP supply contact. | |
| ADC6 | Analog input only | Additional ADC channel in the 32-lead package. | |
| ADC7 | Analog input only | Additional ADC channel in the 32-lead package. |
No pins match. Try a signal name or choose All pins.
CPU and memory
ATmega328P-specific capacities
| Parameter | Value | Conditions / notes |
|---|---|---|
| Architecture | 8-bit AVR RISC | 32 general-purpose working registers |
| Instruction set | 131 instructions | Most execute in a single clock cycle |
| Program Flash | 32 KB | Self-programmable; optional boot section |
| SRAM | 2 KB | Stack, runtime variables and buffers |
| EEPROM | 1 KB | Nonvolatile data |
| Write endurance | 10,000 Flash / 100,000 EEPROM cycles | Manufacturer endurance specification |
| Retention | 20 years at 85°C / 100 years at 25°C | Qualified reliability results |
| Multiplier | 8 × 8 hardware | Two-cycle operation |
No specifications match. Try a parameter name or a unit.
Other members named on the shared datasheet have different memory capacities.
Clock, power and temperature
Selected PU and AU industrial orderables
| Parameter | Value | Conditions / notes |
|---|---|---|
| Operating supply | 1.8–5.5 V | VCC and AVCC requirements apply |
| Clock at 1.8 V | Up to 4 MHz | See maximum-frequency curve |
| Clock at 2.7 V | Up to 10 MHz | Frequency limit rises with supply |
| Clock at 4.5–5.5 V | Up to 20 MHz | 16 MHz example uses 5 V |
| Factory clock | 8 MHz internal RC / 8 = 1 MHz | CKDIV8 programmed by default |
| Industrial temperature | −40 to +85°C | Selected ATMEGA328P-PU / AU |
| Active current example | 5.2 mA typical; 9 mA maximum | 8 MHz, 5 V; datasheet measurement conditions |
| Power-down example | 0.1 µA typical; 2 µA maximum | 3 V, watchdog disabled; datasheet conditions |
No specifications match. Try a parameter name or a unit.
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
| Parameter | Value | Conditions / notes |
|---|---|---|
| Timer0 / Timer2 | Two 8-bit timers | Prescalers and compare/PWM outputs |
| Timer1 | One 16-bit timer | Compare outputs and input capture |
| PWM outputs | Six | OC0A/B, OC1A/B, OC2A/B |
| Serial interfaces | USART, SPI, two-wire interface | TWI is compatible with I²C |
| ADC | 10 bits; 6 or 8 external channels | Six in SPDIP; eight in TQFP |
| Analog comparator | One | AIN0/AIN1 or selected multiplexed input |
| General-purpose I/O | Up to 23 | Reset and oscillator choices reduce available pins |
| Sleep modes | Six | Idle, ADC Noise Reduction, Power-down, Power-save, Standby, Extended Standby |
| Supervision | Watchdog and brown-out detection | Configured by registers and fuses |
No specifications match. Try a parameter name or a unit.
SPI, PWM and other alternate functions are multiplexed with GPIO; they do not add separate pins.
ADC and analog connections
10-bit successive approximation
| Parameter | Value | Conditions / notes |
|---|---|---|
| Nominal code range | 0–1023 | Ideal step = VREF / 1024 |
| ADC clock for full resolution | 50–200 kHz | Selected by a clock prescaler |
| Normal conversion | 13 ADC clock cycles | First conversion after enabling takes 25 cycles |
| Reference choices | AREF, AVCC, internal nominal 1.1 V | Select with REFS bits; allow settling |
| AVCC connection | Required even if ADC is unused | Use filtering when analog accuracy matters |
| AREF bypass | Typically 100 nF to GND | Do not short an active internal reference to an external source |
| TQFP ADC6 / ADC7 | Analog-only inputs | No digital driver or internal pullup |
No specifications match. Try a parameter name or a unit.
Reference tolerance, source impedance and noise affect absolute measurement accuracy.
I/O design and stress limits
Do not design to absolute maximum ratings
| Parameter | Value | Conditions / notes |
|---|---|---|
| Input LOW / HIGH, general pins | ≤ 0.3 × VCC / ≥ 0.6 × VCC | Reset and oscillator contacts have separate specifications |
| Internal pullup | 20–50 kΩ | General GPIO, when enabled |
| Pin current absolute maximum | 40 mA | Stress limit; not a recommended load |
| Supply/ground current absolute maximum | 200 mA | Observe port-group current restrictions too |
| Output-voltage test at 5 V | 20 mA load | Guaranteed voltage under specified test conditions |
| Output-voltage test at 3 V | 10 mA load | Use the detailed DC table for margin |
| Typical LED example | 1 kΩ series resistor at 5 V | A few mA; never connect an LED directly |
| Pin voltage stress range | −0.5 V to VCC + 0.5 V | RESET has a separate high-voltage programming limit |
No specifications match. Try a parameter name or a unit.
External loads must satisfy per-pin, port-group, total-current and voltage requirements.
Timer1 hardware toggle
CTC mode 4 · OCR1A is TOP
| Parameter | Value | Conditions / notes |
|---|---|---|
| Output frequency | fCPU / (2 × N × (1 + OCR1A)) | OC1A toggles at each compare match |
| Prescaler N | 1, 8, 64, 256 or 1024 | Internal timer clock options |
| OCR1A range | 0–65535 | Sixteen-bit unsigned compare value |
| Example clock | 16 MHz | 5 V supply; suitable external clock configured |
| Example divider / TOP | 256 / 31249 | One output cycle per second |
| Output pin | PB1 / OC1A | SPDIP15; TQFP13 |
| Required configuration | DDR for PB1, COM1A0, WGM12, CS12 | Mode4, toggle output, divide256 example |
| Live TOP changes | CTC TOP is not double buffered | Changing TOP below the running count can delay the next match |
No specifications match. Try a parameter name or a unit.
The calculator gives steady-state hardware timing; it does not emulate register-write transients.
Bring-up and programming
Standalone circuit checklist
| Parameter | Value | Conditions / notes |
|---|---|---|
| ISP signals | RESET, MOSI, MISO, SCK, VCC reference, GND | Programmer target voltage must match the chip |
| Clock requirement | A valid selected clock must be present | Changing clock fuses can require an external clock for later ISP |
| Bootloader | Must be programmed separately if required | A bare IC is not automatically Arduino-ready |
| Fuse polarity | Programmed = 0; unprogrammed = 1 | Read the specific fuse table before changing bits |
| Reset pulse | 2.5 µs minimum | Electrical specification |
| Bypass capacitors | 100 nF close to each supply group | Short connections to common ground |
| Crystal capacitors | Choose for crystal load and board capacitance | 22 pF is illustrative, not universal |
No specifications match. Try a parameter name or a unit.
Keep the reset function available unless you have a deliberate alternate programming and recovery plan.
Embedded controllers
Read inputs, manage outputs and schedule control work using firmware and hardware timers.
Manufacturer application guideSensor instruments
Combine the ADC with digital sensors on SPI or TWI and communicate over USART.
Manufacturer application guideCompact programmed products
Move a validated design from a development board to a standalone, correctly powered MCU.
Manufacturer application guideTake 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
