Microcontroller with real firmwareATmega328P-PUatmega328p
ATmega328P (AVR, Firmware)
ATmega328P on its own (as in the Arduino Uno), 16 MHz: runs Arduino sketches or AVR firmware (HEX/ELF).
Key data
- Category
- ICs
- Simulation model
- Microcontroller with real firmware
- Manufacturer part number
- ATmega328P-PU
- Reference prefix
- U
- Pins
- 26
- Land pattern
- DIP-28_W7.62mm
Notes
The firmware runs on an emulated CPU core, instruction by instruction. Peripherals that the model implements (GPIO, timers, UART, SPI, I²C, ADC and others, see the description) act on the pins of the circuit, so the analog parts around the chip see the same voltages and timing as on a real board.
- The bare chip needs VCC, GND and decoupling capacitors on the board.
- Right-click the part and choose "Open in code editor" to write and compile its code; "Serial monitor" shows its UART output.
- In the inspector you can load a demo firmware or your own ELF / Intel HEX / BIN file instead.
- GPIO pins are real circuit pins: an LED on an output needs a series resistor, an input needs a defined level (pull-up or pull-down).
- The debugger in the code view stops at breakpoints and shows registers, variables and the call stack.
Simulation model
An emulated CPU core runs the firmware binary instruction by instruction. The GPIO pins are pins of the analog circuit: outputs drive through a driver resistance, inputs read the voltage with thresholds.
- Device
- atmega328p
- CPU core
- AVR 8-bit
- Emulator
- AVR emulator
- Firmware
- Arduino sketch compiled in the code view (arduino-cli, arduino:avr), or your own ELF / Intel HEX / BIN file
- Flash / RAM for firmware
- 32 KB / 2 KB
- Supply pins
- VCC / GND
- Mapped GPIO pins
- 21
Pins 26
simulatedreal chip onlyPin functions from the emulator and the datasheet.
| Pin | Name | Functions | Use |
|---|---|---|---|
| VCC | VCCSupply pin | Supply 1.8–5.5 V (5 V for 16 MHz): 100 nF next to VCC and AVCC | |
| GND | GNDGround pin | Ground | |
| PD0 | PD0I/O pin | USART0_RXD | Serial data in: from the TX pin of the other device |
| PD1 | PD1I/O pin | USART0_TXD | Serial data out: to the RX pin of the other device (console, GPS, modules) |
| PD2 | PD2I/O pin | INT0 | General-purpose I/O: LEDs (with series resistor), buttons (with pull-up) |
| PD3 | PD3I/O pin | INT1OC2B | PWM output: LED dimming, servos, motor drivers |
| PD4 | PD4I/O pin | T0XCK | General-purpose I/O: LEDs (with series resistor), buttons (with pull-up) |
| PD5 | PD5I/O pin | OC0BT1 | PWM output: LED dimming, servos, motor drivers |
| PD6 | PD6I/O pin | OC0AAIN0 | PWM output: LED dimming, servos, motor drivers |
| PD7 | PD7I/O pin | AIN1 | General-purpose I/O: LEDs (with series resistor), buttons (with pull-up) |
| PB0 | PB0I/O pin | ICP1CLKO | General-purpose I/O: LEDs (with series resistor), buttons (with pull-up) |
| PB1 | PB1I/O pin | OC1A | PWM output: LED dimming, servos, motor drivers |
| PB2 | PB2I/O pin | OC1BSPI_SS | SPI chip select (SS): keep it an output while the SPI runs as master |
| PB3 | PB3I/O pin | SPI_MOSIOC2A | SPI data out (MOSI): to DIN / SDA / SDI of the device |
| PB4 | PB4I/O pin | SPI_MISO | SPI data in (MISO): from DOUT / SDO of the device |
| PB5 | PB5I/O pin | SPI_SCK | SPI clock: displays, flash, SD cards |
| PC0 | PC0I/O pin | ADC0 | Analog input: potentiometer, sensor voltage (0 V … supply) |
| PC1 | PC1I/O pin | ADC1 | Analog input: potentiometer, sensor voltage (0 V … supply) |
| PC2 | PC2I/O pin | ADC2 | Analog input: potentiometer, sensor voltage (0 V … supply) |
| PC3 | PC3I/O pin | ADC3 | Analog input: potentiometer, sensor voltage (0 V … supply) |
| PC4 | PC4I/O pin | ADC4TWI_SDA | I²C data: pull-up (about 4.7 kΩ) to the supply |
| PC5 | PC5I/O pin | ADC5TWI_SCL | I²C clock: sensors, displays; pull-up (about 4.7 kΩ) to the supply |
| RESET | RESETInput pin | RESET | Reset, active low: 10 kΩ pull-up, 100 nF to GND, optional button to GND |
| XTAL1 | XTAL1Analog pin | XTAL1 | 16 MHz crystal with 22 pF to GND (or external clock in) |
| XTAL2 | XTAL2Analog pin | XTAL2 | 16 MHz crystal with 22 pF to GND |
| AREF | AREFAnalog pin | AREF | ADC reference: 100 nF to GND; only connect a voltage here with the external reference selected |
Parameters 1
Package
packageDefaultDIP28
DIP28TQFP32
PCB
Verified land pattern
DIP-28_W7.62mm| Package | Land pattern | Status | Source |
|---|---|---|---|
| DIP28 · ATMEGA328P-PU | DIP-28_W7.62mm | Verified land pattern | KiCad 10.0.7: symbol ATmega328P-P, footprint Package_DIP:DIP-28_W7.62mm |
| |||
| TQFP32 · ATMEGA328P-AU | TQFP-32_7x7mm_P0.8mm | Verified land pattern | KiCad 10.0.7: symbol ATmega328P-A, footprint Package_QFP:TQFP-32_7x7mm_P0.8mm |
| |||