Home / Learn Chip Programming / AVR Architecture: ATmega328P Inside the Arduino Uno
AVR Architecture: ATmega328P Inside the Arduino Uno
The 8 bit chip behind Arduino Uno and Nano. Learn its memories, registers and pins.
Theory in plain words
What it is
ATmega328P is an 8 bit Harvard RISC MCU: 32 KB flash, 2 KB SRAM, 1 KB EEPROM, 32 general registers, 23 I/O pins, 16 MHz.
Why we use it
It is the best first chip: simple, 5 V tolerant, huge community. Everything you learn transfers to bigger MCUs.
How it works
Harvard means separate program and data buses. Peripherals are mapped into the data space and controlled via registers (DDRx, PORTx, PINx, TCCRx, ADCSRA, UCSR0x).
Where it is used
- Arduino Uno, Nano, Pro Mini
- Learning register level programming
- Simple low cost products
Arduino pin to AVR port map
Arduino pin 13 is PB5. digitalWrite(13, HIGH) becomes PORTB |= (1 << 5), about 50 times faster.
| Resource | ATmega328P | ATtiny85 | ATmega2560 |
|---|---|---|---|
| Flash | 32 KB | 8 KB | 256 KB |
| SRAM | 2 KB | 512 B | 8 KB |
| I/O pins | 23 | 6 | 86 |
| Timers | 3 | 2 | 6 |
| Used in | Uno, Nano | tiny projects | Arduino Mega |
Quick quiz
1. Which register sets pin direction?
Data Direction Register.
2. Arduino pin 13 is...
The on-board LED on PB5.