Summary of Burning the Bootloader on ATMega328 using Arduino UNO as ISP
The author built a custom Arduino using an ATMega328-PU microcontroller to save costs, avoiding the need for pre-programmed chips. The article details how to use an existing Arduino UNO as an In-System Programmer (ISP) to burn a bootloader onto the cheaper chip, enabling it to function like a standard Arduino. This process involves uploading the ArduinoISP sketch and connecting components on a breadboard according to a specific circuit diagram.
Parts used in Custom Arduino with Bootloader:
- USB cable
- Arduino UNO (R1)
- ATMega328-PU microcontroller
- Small breadboard
- 16Mhz Crystal
- 2 22pF Ceramic Capacitors
- Jumper wires
To put the Arduino bootloader on a blank ATmega328 or ATmega328P, upload the ArduinoISP sketch to an Arduino Uno, wire the Uno’s pins 10, 11, 12 and 13 to the target chip’s RESET, MOSI, MISO and SCK pins, give the target power plus a 16 MHz crystal with two 22 pF capacitors, then choose Tools, Programmer, Arduino as ISP and Tools, Burn Bootloader. A chip without the “P” in its name needs one extra step, because its signature bytes are different. This page gives the wiring, the exact fuse values the Uno uses and what each one means, and the fixes for the errors you are likely to see.
Datasheet verified by us. The signature bytes, the SPI programming pins, the fuse bytes and their default values, the boot section size and the brown-out levels were checked against the ATmega328P datasheet (DS40002061B), with page numbers quoted where each figure is used. The Uno’s fuse and bootloader settings were read from the Arduino AVR core (version 1.8.8) and decoded bit by bit against the datasheet. The ArduinoISP sketch compiled for the Uno with arduino-cli 1.6.0 (4,354 bytes), and the avrdude commands on this page were checked against avrdude 8.0.0 for correct syntax and part names. The datasheet is linked in the resources box below.
- An ATmega328P-PU sold “with Optiboot” is ready to use. A blank 328P or a plain 328 needs the bootloader burned first.
- Uno pin 10 goes to RESET (pin 1), pin 11 to MOSI (pin 17), pin 12 to MISO (pin 18) and pin 13 to SCK (pin 19) on the 28-pin DIP chip.
- The Uno uses fuses 0xFF (low), 0xDE (high) and 0xFD (extended), which select the crystal, the bootloader reset vector and a 2.7 V brown-out level.
- The “P” chip and the plain chip have different signature bytes (1E 95 0F and 1E 95 14), so avrdude must be told which one you have.

Does your chip need this?
A new ATmega328 from a parts supplier is blank: it has no bootloader, so the Arduino IDE cannot upload to it over a USB-serial adapter. Some suppliers sell the 328P already loaded with the Arduino bootloader (Optiboot). Those plug straight into an Arduino-style circuit. The rest need the steps on this page.
| Chip | Bootloader | What to do |
|---|---|---|
| ATmega328P-PU “with Optiboot” | Already on the chip | Nothing to burn. Use it in an Uno-style circuit. |
| ATmega328P-PU, blank | None | Follow this page. |
| ATmega328-PU (no “P”), blank | None | Follow this page, and tell avrdude the part is m328 (see the signature section). |
The “P” stands for picoPower, a low-power version of the same chip. The Uno uses the picoPower chip. The two parts have the same memory sizes, but their signature bytes differ, as the next section shows.
The signature: why a plain 328 needs one extra step
Every AVR chip carries three signature bytes that identify the model. The programmer reads them first and refuses to continue if they do not match the part you selected. For these two chips the datasheet gives (datasheet p. 293):
| Chip | Signature byte 0 | Byte 1 | Byte 2 | avrdude part name |
|---|---|---|---|---|
| ATmega328 | 0x1E | 0x95 | 0x14 | m328 |
| ATmega328P | 0x1E | 0x95 | 0x0F | m328p |
The Arduino IDE burns the bootloader for the Uno with the part set to atmega328p. A plain ATmega328 reports a different third byte, so avrdude stops with an invalid-signature message. You can either run avrdude yourself with -p m328 (shown below), or add a board entry whose build.mcu is atmega328 in a custom boards.txt. The bootloader file is the same.
What you need
ATmega328 or ATmega328P, 28-pin DIP
Small breadboard
16 MHz crystal
Two 22 pF ceramic capacitors
10 µF electrolytic capacitor
Jumper wires
The two 22 pF capacitors go from each crystal leg to ground. 22 pF is the common value for a 16 MHz crystal, as on the Uno; if the datasheet of your crystal asks for a different load, follow it. The 10 µF capacitor is used on the programmer Uno only, as explained in step 1.
Step 1: Turn the Uno into a programmer
With nothing connected except the USB cable, open the Arduino IDE and load File, Examples, 11.ArduinoISP, ArduinoISP (the sketch is also on GitHub). Select Tools, Board, Arduino Uno, pick the serial port and upload. The sketch makes the Uno talk the programming protocol to the PC at 19200 baud, and it uses pin 10 to reset the target and the SPI pins 11, 12 and 13 to talk to it. Three optional LEDs on pins 9, 8 and 7 show a heartbeat, an error and activity.
Step 2: Wire the target
Pin numbers below are for the 28-pin DIP package, counted from the notch (datasheet p. 12).
| Uno pin | ATmega328 DIP pin | Function |
|---|---|---|
| D10 | 1 (RESET) | Reset line used by the programmer |
| D11 | 17 (PB3, MOSI) | Data from programmer to chip |
| D12 | 18 (PB4, MISO) | Data from chip to programmer |
| D13 | 19 (PB5, SCK) | Clock |
| 5V | 7 (VCC) and 20 (AVCC) | Power |
| GND | 8 and 22 (GND) | Ground |
| Not on the Uno | 9 and 10 (XTAL1, XTAL2) | 16 MHz crystal, each leg to GND through 22 pF |
The datasheet names the serial programming pins as MOSI on PB3, MISO on PB4 and SCK on PB5 (datasheet p. 304). On an Uno, MOSI is D11 and MISO is D12. Some older diagrams label D11 as MISO and D12 as MOSI, but the wires are the same: D11 goes to chip pin 17 and D12 goes to chip pin 18. If you wire by pin number as in the table, the labels do not matter.
Step 3: Burn the bootloader
Plug the programmer Uno into the PC. In the IDE choose Tools, Board, Arduino Uno (the target is set up like an Uno at 16 MHz), Tools, Programmer, Arduino as ISP and then Tools, Burn Bootloader. Choose “Arduino as ISP”, not the similarly named “ArduinoISP” entry, which is for a different programmer. The IDE sets the fuses, writes optiboot_atmega328.hex into the last part of the flash, and locks the boot area. These are the values it uses for the Uno, taken from the board file of the Arduino AVR core 1.8.8:
| Setting | Factory default | Uno bootloader value | What changes |
|---|---|---|---|
| Low fuse | 0x62 | 0xFF | Clock from the external crystal, and the divide-by-8 is switched off. The default is the internal 8 MHz oscillator divided by 8, which is 1 MHz. |
| High fuse | 0xD9 | 0xDE | The reset vector moves to the bootloader (BOOTRST programmed). The boot section size is set to 256 words, which is 512 bytes. |
| Extended fuse | 0xFF | 0xFD | Brown-out detection on at about 2.7 V (default: off). |
| Lock byte | 0xFF | 0x0F | Arduino writes 0x3F first to unlock, then 0x0F after the bootloader is in place. |
Where the datasheet says so: the fuse bytes are in the tables on pages 290 to 292, the clock source options on page 37, the boot size options on page 286 and the brown-out levels on page 314 (datasheet p. 292). The default low fuse 0x62 means CKDIV8 programmed, which divides the internal oscillator by eight; 0xFF leaves it undivided and selects the crystal. The default high fuse 0xD9 has BOOTRST unprogrammed, so the chip starts at address 0 and ignores the bootloader. With 0xDE, BOOTRST is programmed and a reset starts the code at the beginning of the boot section.
The Optiboot file for the 328 contains 502 bytes of code, starting at address 0x7E00. That is the last 512 bytes of the 32 KB flash, which matches the 512-byte boot section the high fuse sets up. The remaining 32,256 bytes are what the Arduino IDE reports as the space available for your sketch.
Using avrdude directly
The IDE runs avrdude for you. To do the same by hand, for a plain ATmega328 or to read what is on a chip, use the avrdude that comes with the IDE. Replace COM3 with your programmer’s port. Read the signature and fuses of a 328P:
avrdude -c stk500v1 -P COM3 -b 19200 -p m328p -U lfuse:r:-:h -U hfuse:r:-:h -U efuse:r:-:h
Burn the bootloader on a plain ATmega328 (use -p m328p for a 328P):
avrdude -c stk500v1 -P COM3 -b 19200 -p m328 -U lfuse:w:0xFF:m -U hfuse:w:0xDE:m -U efuse:w:0xFD:m
avrdude -c stk500v1 -P COM3 -b 19200 -p m328 -U flash:w:optiboot_atmega328.hex:i -U lock:w:0x0F:m
The optiboot_atmega328.hex file is in the bootloaders folder of the Arduino AVR core, and you will usually need to give its full path. The stk500v1 programmer at 19200 baud is what the IDE’s “Arduino as ISP” entry uses.
After the burn
The chip now behaves like the one on an Uno. To use it, move it to a circuit with the crystal, the 22 pF capacitors, power and a USB-serial adapter (or into the socket of a DIP-style Uno), select Arduino Uno as the board, and upload a sketch such as Blink over serial. You can also keep the programmer and upload sketches through it with Sketch, Upload Using Programmer, which erases the chip, bootloader included, before it writes your sketch.
If it does not work
| What you see | Likely cause | What to do |
|---|---|---|
| “not in sync: resp=0x00” or a signature of 0x000000 | A wiring fault, no power on the target, or the programmer Uno is resetting | Check pins 1, 17, 18 and 19 against the table, check pins 7, 8, 20 and 22, and add the 10 µF capacitor |
| “Invalid device signature” | The chip is not the part avrdude was told to expect | A plain 328 needs -p m328; a 328P needs -p m328p |
| It worked once, now the chip does not answer | The low fuse now selects the crystal and the crystal is missing or wrong | Connect the 16 MHz crystal and both 22 pF capacitors |
| Uploading ArduinoISP fails | The 10 µF capacitor is still fitted | Remove it for the upload, then fit it again |
| Sketch uploads later run too slowly or at the wrong speed | The low fuse was never changed, so the chip is running at 1 MHz | Burn the bootloader again with the Uno board selected |
Project variants: burning a bootloader with an Arduino as ISP
- Master the Art of Bootloader Burning with Arduino as ISP: A Comprehensive Guide: a comprehensive guide to the same job
- Using Arduino as an ISP: Burning Bootloaders onto AVR Microcontrollers: using an Arduino as an ISP for AVR chips
- Burn Arduino Bootloader on Atmega-328 TQFP and DIP chips on Breadboard: burning the bootloader on TQFP and DIP chips on a breadboard
- Arduino ISP (In System Programming) and stand-alone circuits: Arduino ISP and stand-alone circuits
Related projects: stand-alone Arduino circuits
- Standalone Arduino chip on breadboard: a stand-alone Arduino chip on a breadboard
- Breadboard Arduino: a breadboard Arduino
- ArduinoISP Bootloader/Programmer Combination Shield: an ArduinoISP bootloader and programmer shield
- Minimal Arduino with ATmega8: a minimal Arduino with an ATmega8
Quick answers
Check your own build
Before pressing Burn Bootloader, check four things: the ArduinoISP sketch is on the programmer, the 10 µF capacitor is fitted with the positive leg on RESET, the five signal and power connections match the table, and “Arduino as ISP” is the selected programmer. After a successful burn, the IDE reports “Done burning bootloader”.
Project resources and downloads
Datasheets and documents for the parts in this build. Page numbers quoted on this page refer to these files.
- 📄 ATmega328P datasheet (Microchip DS40002061B)
PDF, 653 pages, about 33 MB. Signature bytes (page 293), fuse bytes (pages 290 to 292), clock options (page 37), boot size (page 286), serial programming pins (page 304), brown-out levels (page 314). - 📦 ArduinoISP sketch source
GitHub, one file. The programmer sketch used in step 1. - 📚 Arduino documentation: ArduinoISP
Web page. Official description of the programmer sketch and its wiring. - 📚 AVRDUDE documentation
Web page. The programming tool behind Burn Bootloader.
Quick Solutions to Questions related to Custom Arduino with Bootloader:
- Why did the author buy the cheaper ATMega328-PU?
The author bought the cheaper version to save money compared to the $5.50 option with Optiboot. - What is missing from the cheaper ATMega328-PU that requires burning?
The cheaper chips are missing a bootloader, which allows code upload without additional hardware. - How do you turn an Arduino UNO into an ISP programmer?
You must open the ArduinoIDE, navigate to Examples > ArduinoISP, select the correct board and port, and upload the sketch. - What does the P in ATMega328P-PU stand for?
The P stands for picopower, a technology allowing the microcontroller to run with less power. - Can you make the normal ATMega328-PU work without a bootloader?
No, you must burn a bootloader onto those chips before doing anything with them. - What software version was used in this tutorial?
The tutorial uses version 1.0.1 of the Arduino Software (IDE). - What capacitance value did the author's crystal have?
The author's 16Mhz crystal had 20pF of capacitance.
