DE6417 Microcontrollers 2 · Week 14
Everything on the board around the ATmega328P exists to make programming convenient. Real products ship the chip, not the board.
| Approach | Hardware needed |
|---|---|
| Arduino as ISP (today) | A second Arduino Uno running a sketch |
| Dedicated ISP programmer | USBasp, AVRISP mkII, Atmel-ICE |
| Bootloader + USB-serial adapter | FTDI adapter — but a bootloader must be burned first |
| Component | Value / Type | Qty |
|---|---|---|
| Arduino Uno (the programmer) | Any revision | 1 |
| ATmega328P-PU (the target) | DIP-28 | 1 |
| Crystal | 16 MHz | 1 |
| Ceramic capacitor | 22 pF | 2 |
| Electrolytic capacitor | 10 µF | 1 |
| LED + resistor | 220 Ω | 1 each |
| Breadboard + jumper wires | Male-to-male | 10+ |
Explain how ISP differs from the normal bootloader upload.
Flash ArduinoISP to a Uno and set up the IDE correctly.
Connect the 6 ISP lines and the crystal to the target chip.
Upload a sketch to the standalone chip and see it run.
Explain what Burn Bootloader sets and why the chip needs a clock.
| Signal | Uno pin | Target DIP pin | Job |
|---|---|---|---|
| MOSI | D11 | 17 (PB3) | Program data → chip |
| MISO | D12 | 18 (PB4) | Verify data ← chip |
| SCK | D13 | 19 (PB5) | Clock for every bit |
| RESET | D10 | 1 (PC6) | Held LOW = "stop and listen" |
D10 is just a spare pin the programmer uses to hold the target's RESET low. Newer docs call MOSI/MISO COPI/CIPO — same wires.
Only MISO points back to the programmer — it's how the programmer checks what was written.
You flash it to the Uno once. From then on the Uno translates the PC's serial commands into SPI for the target chip.
| # | Menu path | What to select |
|---|---|---|
| 1 | Tools → Board | Arduino Uno — describes the target (ATmega328P at 16 MHz) |
| 2 | Tools → Port | The COM/tty port of the programmer Uno |
| 3 | Tools → Programmer | Arduino as ISP |
| 4 | Upload method | Sketch → Upload Using Programmer |
| Operation | What it does | When to use |
|---|---|---|
| Upload Using Programmer Sketch menu |
Erases the whole chip (bootloader included), then writes your sketch | Every normal upload today |
| Burn Bootloader Tools menu |
Erases the chip, sets the fuses (incl. the clock source), writes the Optiboot bootloader | Fresh chip, mis-set chip, or to make USB uploads work again |
Goal: a bare ATmega328P blinks an LED from code you put there — no Uno board underneath it
Use the Uno as a programmer to put Blink on the bare ATmega328P, then burn a bootloader and see what the clock setting does.
| Time | Task |
|---|---|
| 0:00 – 0:20 | Steps 1–2: flash ArduinoISP + wire |
| 0:20 – 0:50 | Step 3: upload Blink, troubleshoot |
| 0:50 – 1:10 | Steps 4–5: Burn Bootloader + clock comparison |
| 1:10 – 1:15 | Exit question |
Also available: D8 = error, D7 = programming.
| # | Uno | Target DIP pin | Signal |
|---|---|---|---|
| 1 | GND | 8 + 22 | GND first — always |
| 2 | 5V | 7 + 20 | VCC + AVCC |
| 3 | D10 | 1 | RESET |
| 4 | D13 | 19 | SCK |
| 5 | D11 | 17 | MOSI |
| 6 | D12 | 18 | MISO |
The diagram also shows optional 100 nF decoupling caps. The crystal is added on the next slide.
Keep leads short, right next to the chip.
Pin 19 is also SCK, so this LED flickers during uploads. That's normal.
| LED on pin 19 | It means |
|---|---|
| 1 s on / 1 s off | Chip was bootloaded — already running on the 16 MHz crystal ✓ |
| ~16 s on / ~16 s off | Chip was blank — running at 1 MHz. Not an error! Step 4 fixes it. |
Sketch → Upload Using Programmer — same Blink, no code changes. Compare with what you wrote down in Step 3.
| Blank chip (Step 3) | After Burn Bootloader | |
|---|---|---|
| Clock | Internal 8 MHz ÷ 8 = 1 MHz | 16 MHz crystal |
| Blink | ~16 s on / 16 s off | 1 s on / 1 s off ✓ |
| Why? | The code expects 16 MHz but runs 16× slower, so every delay() is 16× too long | The clock matches the Board setting |
Bootloaded chip? Your Step 3 and Step 5 look the same — compare with a group that had a blank chip.
Name one thing the Arduino board was doing for you that the standalone chip cannot do by itself.
Good answers: USB communication, the auto-reset circuit, the 5V regulator, the 16 MHz clock, the bootloader.