Verified by our editorial teamDatasheet verified

Burning the Bootloader on ATMega328 using Arduino UNO as ISP

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 […]

Avatar of Ibrar Ayyub
By Ibrar Ayyub
Published March 27, 2013
At a glance
CategoryInterfacing(USB – RS232 – I2c -ISP) Projects
DifficultyIntermediate
IncludesCode, Diagrams, Datasheets
UpdatedNovember 24, 2026
Reading timeabout 10 min
On this page

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
11 min read

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.

HOW THIS PAGE WAS CHECKED

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.

IN SHORT
  • 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.
4 wires
pins 10 to 13, plus power
19200 baud
programmer link
512 bytes
boot section
3 fuse bytes
low, high, extended
An Arduino Uno wired to an ATmega328 on a small breadboard to burn the bootloader
An Uno used as the programmer, wired to a bare ATmega328 on a breadboard. Photo: Instructables.

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

Arduino Uno (the programmer) and USB cable
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.

Add the 10 µF capacitor after the upload. When the IDE opens the serial port, the Uno resets itself. That reset would also confuse the burn. After the ArduinoISP upload, put the 10 µF capacitor between the programmer’s RESET and GND pins, with the positive (long) leg on RESET. Remove it again before you upload a normal sketch to that Uno, or the upload will fail. Some boards do not need the capacitor; the Mega 2560 Rev3 is one.

Step 2: Wire the target

Pin numbers below are for the 28-pin DIP package, counted from the notch (datasheet p. 12).

Arduino Uno (programmer) D10D11 (MOSI)D12 (MISO)D13 (SCK)5VGND ATmega328 (28-pin DIP) Pin 1 RESETPin 17 PB3 (MOSI)Pin 18 PB4 (MISO)Pin 19 PB5 (SCK)Pins 7 and 20: VCC, AVCCPins 8 and 22: GNDPins 9 and 10: crystal 16 MHz crystal between pins 9 and 10, each crystal leg to GND through a 22 pF capacitor

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.

Check power before you connect the USB cable. Pins 7 and 20 are positive and pins 8 and 22 are ground. Reversed power can destroy the chip. A blank chip has a factory clock, so it can be programmed before the crystal is connected, but the crystal must be in place once the fuses select it, as described below.

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

Related projects: stand-alone Arduino circuits

Quick answers

Do I need a bootloader at all?
Only if you want to upload sketches over a USB-serial adapter. With a programmer connected you can upload sketches directly without a bootloader.
Can I use the same wiring for an ATmega328P?
Yes. The pins are the same. Only the part name given to avrdude changes (m328p instead of m328).
What is the 16 MHz crystal for?
The Uno runs from an external crystal. The low fuse 0xFF selects it. Once that fuse is set, the chip has no clock without the crystal, so keep it connected.
Why 5 V power?
The chip is run at 5 V and 16 MHz as on an Uno. The datasheet lists 0 to 20 MHz for 4.5 to 5.5 V and 0 to 10 MHz for 2.7 to 5.5 V (datasheet p. 2).
Which pins did the old diagrams swap?
Some labelled D11 as MISO and D12 as MOSI. On the Uno, D11 is MOSI and D12 is MISO. The wires still go to chip pins 17 and 18.

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.

Share this project
X
LinkedIn
Reddit
WhatsApp

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.
© 2026 Use Arduino for Projects Home
Scroll to Top