Bukit Mertajam, Penang

Using ISP to Burn Bootloader into Arduino

If you are building your own Arduino, or need to replace the IC, you will need to load a bootloader program into the Atmega328 (on UNO and BBFuino). There are also cases where you have put your board into a weird setting and you cannot upload code into it, reinstalling the bootloader will be the easiest and quickest way to fix it.

What is a bootloader? 

A bootloader is basically a .hex file that runs when we turn on the Arduino board and allows us to program Arduino board over the serial port. It is very similar to the BIOS that runs on our PC. Without the bootloader, we will need a special programmer, i.e. AVR USBASP Programmer, to program the Atmel AVR. Due to the effort of Arduino, now we just need a USB cable (on Arduino UNO) or USB to serial converter (On BBFuino) to program our Arduino board.

This tutorial will hopefully show you how to burn the bootloader into an Arduino board, and there is 3 sessions in this tutorial: 

  • Session 1: Burn Bootloader into CT-UNO
  • Session 2: Burn Bootloader into BBFuino
  • Session 3: Burn Bootloader into standalone Arduino


Session 1: Burn Bootloader into CT-UNO

Basically there are two steps involved in burn bootloader:

  • Step 1: Prepare ISP Programmer
  • Step 2: Burn Bootloader

An ISP (In-system programming) programmer is needed to burn bootloader. In this tutorial, we will use a CT-UNO as an ISP programmer. To prepare CT-UNO as ISP programmer, firstly we select “ArduinoISP” from the File > Examples menu. 


 And upload it into CT-UNO. 


After done uploading, we select “Arduino as ISP” from the Tools > Programmer menu.


Now the CT-UNO is working as an ISP programmer.

The next step is to do some wiring between ISP programmer and target Arduino, the connection is shown in table below: 

ISP Programmer (CT-UNO)Target Arduino Board
Pin 13Pin 13
Pin 12Pin 12
Pin 11Pin 11
Pin 10Reset

Or, you can refer figure below: 



After wiring up, go to Tools > Board and choose “Arduino Uno” as the board of the target Arduino.


After that, click on “Burn Bootloader” from the Tools menu, the ISP programmer will start to burn the bootloader into the target Arduino. It usually takes few minute to complete burning bootloader.


Burn bootloader is in progress. 



Arduino IDE will display “Done burning bootloader” when it is done. 


After complete burn bootloader, your target Arduino is able to accept code from your Arduino IDE. Just unplug the ISP programmer and plug the target Arduino to PC via USB cable, and you can upload your sketch to the target Arduino as usual. Remember to change the Tools > Programmer from “Arduino as ISP” to “AVR mkII” before you upload sketch to the target Arduino.


Session 2: Burn Bootloader into BBFuino

BBFuino, or Breadboard Friendly Arduino, is the first Cytron version of Arduino compatible board. It is designed to fit breadboard for prototyping and learning purpose. An USB to UART converter, i.e. UC00A or UC00B, is required to upload Arduino sketch into BBFuino. If you get the BBFuino from Cytron, it is preloaded with bootloader :). So the following steps are only applicable if you replace fresh new IC on BBFuino, or in some cases, you corrupt the bootloader.

BBFuino is using ATmega328 IC instead of ATmega328P IC (at the time this tutorial is written). ATmega328 and ATmega328P are almost similar. The difference between these ICs is ATmega328P has the Atmel picoPower technology while ATmega328 does not have. With picoPower technology, ATmega328P are suitable to be used in low power application. Besides, only the ATmega328P is recognized by Arduino whereas the ATmega328 is not. Hence, it may cause an issue that we cannot burn bootloader into ATmega328 using the method we discussed in session 1. When we try to burn the bootloader into ATmega328, you will obtain the error as shown in figure below: 



This is due to ATmega328-PU and ATmega328P-PU have the different identification signature: ATmega328 has signature of 0x1E 0x95 0x14 while ATmega328P has the signature of 0x1E 0x95 0x0F

Can we still burn the bootloader into ATmega328? The answer is YES! There are two methods can be used to burn the bootloader into ATmega328: 

  1. Burn the Optiloader into ATmega328. 
  2. Modify the configuration of Arduino IDE. 

The first method is burn the Optiloader into ATmega328. Optiloader is a sketch designed for bulk upgrading of Arduino board bootloaders using another Arduino as an ISP programmer. It is suitable for microcontroller ATmega8, ATmega168, ATmega328 and ATmega328P. To burn the Optiloader, just follow the procedure below: 

  1. Download the Optiloader in Github. Click on “Download ZIP” to start the download.
  2. After done downloading, extract it using any unzip software. 
  3. There is 3 files in the OptiLoader – master directory, open the optiLoader.pde file using Arduino IDE.
    After a couple second, a window will pop out and prompts you whether you wanna create a sketch folder named “optiLoader” and move the optiLoader.pde inside that folder. Click on “OK”.
    ScreenShot011optiLoader.pde is opened:
  4. OptiLoader.pde requires its library file to be included in the sketch file. Else, this sketch file cannot be compiled. To include the library file, first click on “Add File…” from the Sketch menu
    Choose the “optiLoader.h” library file from the Optiloader – master directory and then click “Open”.
    After you click “Open”, you will notice that there is a “optiLoader.h” tab beside “optiLoader” in the Arduino IDE:
  5. Connect the CT-UNO and BBFuino as figure below:
    CT-UNO - BBFuino_bb
  6. Upload the sketch. It will takes up to 2 minutes. Be patient!
  7. The upload sketch process is completed when Arduino IDE displays “Done uploading”, at the same time, the BBFuino is completed burnt with optiLoader too!

Now the BBFuino is ready with bootloader firmware and can be use with UC00A to accept code from Arduino IDE. 

The second method is modify the configuration of Arduino IDE. As we mentioned earlier, the difference between ATmega328 and ATmega328P are the picoPower technology and their identification signature. Other than that, ATmega328 and ATmega328P are the same every sense architecturally. Hence, we can modify the configuration of Arduino IDE so that Arduino IDE can treat ATmega328 as ATmega328P. 

There are 3 steps for this method. 

The first step is preparing an ISP programmer. Refer to session 1 to turn CT-UNO into an ISP programmer. 

The second step is modifying the configuration of Arduino IDE, just follow the procedure below: 

  1. Close the Arduino IDE. 
  2. Locate your Arduino directory. In my case, my Arduino directory is C:\Users\user\Desktop\arduino-1.0.5
    Then, locate the directory hardware\tools\avr\etc. You will notice there is a file named “avrdude.conf” inside that directory. ScreenShot017
  3. Make a copy of file “avrdude.conf” for backup purpose. 
  4. Open the file “avrdude.conf” using WordPad. 
  5. Search for “m328p”. 
  6. Look for “signature”. It should be few lines under “m328p”. 
    Change 0x1e 0x95 0x0f to 0x1e 0x95 0x14
  7. Click “Save” to save the edited configuration file and close it. Now you done modified the configuration of Arduino IDE. 

The third step is burn the bootloader. First, connect the ISP programmer to the BBFuino: 

CT-UNO - BBFuino_bb

Next, select “Arduino Uno” from the Tools > Board menu. 


Click on “Burn Bootloader” from the Tools menu and wait for few minutes for burning bootloader process. 


After the burn bootloader process is done,  the BBFuino is ready with bootloader firmware and can be use with UC00A to accept code from Arduino IDE. 

For this method, if you plan to burn the bootloader or load the program into ATmega328P device, i.e. CT-UNO, be sure you modify the configuration of Arduino IDE before you burn the bootloader or load the program. This is because after modify the configuration, ATmega328 is recognized by Arduino IDE but ATmega328P is not. Repeat the modifying the configuration of Arduino IDE procedure and change the signature from 0x1e 0x95 0x14 to 0x1e 0x95 0x0f

Session 3: Burn Bootloader into standalone Arduino

Standalone Arduino is the ATmega basic circuit, it is the simplest form of Arduino. Sometime it is called as Arduino on breadboard too. 

The hardware required are:

For your information, the ATmega328P ICs carried by Cytron are pre-loaded with Optiboat bootloader. You do not have to burn the bootloader into it before using it. 

Construct the standalone Arduino circuit as shown in figure below: 

 ATmega basic circuit_bb

If you refer the datasheet of ATmega328P, you will find that there are Port A, Port B, Port C and Port D in the pinout diagram of ATmega328P. Where is the digital pins and analog pins those label on the Arduino board? Don’t worry, figure below can help you to find out the pin location of Arduino digital pins and analog pins. Figure below is the ATmega168/328-Arduino pin mapping diagram.

Source: Arduino.cc

Similar with session 1, there are two steps in burning bootloader into standalone Arduino.

The first step is preparing the ISP programmer. Referring to session 1 to turn CT-UNO into ISP programmer.

Next, connect the ISP programmer to the standalone Arduino:

 CT-UNO - ATmega_bb

Select “Arduino Uno” from the Tools > Board menu:


Click “Burn Bootloader” on the Tools menu and wait for few minute for burning bootloader process.


After the burn bootloader process is done, the standalone Arduino is ready to accept code from your Arduino IDE. To program it, you can use the CT-UNO as ISP programmer to upload code into the standalone Arduino.

Great! I am done sharing the possible method to load bootloader into Arduino main controller, hopefully it is helpful and if you have any inquiry, please do discuss in our technical forum as we seldom check the comment section in tutorial site. Do bear in mind, once the bootloader is successfully loaded into Atmega, you can utilize bootloader to load new program via normal method from Arduino IDE.



Related Posts

Comments (4)

Not everyone who uses VPN screievs are doing so for privacy reasons.I currently live in China and I rely on the US servers so I can still access my pandora and hulu accounts I have back in America.These are two screievs I really enjoy using (and I pay to use) but I can’t use them while I’m living in China without being on a US server.I’m afraid this may be the straw the broke the camels back for me. After some situations where I was never responded to when I contacted customer support, then some situations where the servers I enjoyed using were down, and now this situation it seems it’s time to move onto a VPN provider who can provide me with the service that I’m paying for.Overall I’ve enjoyed using vpntunnel and I wish their company the best of luck in the future. Time for me to find a new vpn provider though.

[…] to load the program into the chips; bootloader method will not work. Just like tutorials “Using ISP Programmer to Burn Bootloader into Arduino” and “Burning Arduino Bootloader with AVR USBasp“, we used ISP to burn the bootloader […]

Hi all,

I have project about obtaining a PCB board including ATMEGA microprocessor, but I have a difficulties in bootloading the ATMEGA. In shortly, I have bootloaded a ATMEGA328P-PU by using Arduino as ISP mode. ATMEGA328P-PU works with 16MHz crystal and the necessary capacitor and resistor etc. Everything is OK. However, I have a ATMEGA328P-U, and I have performed the same steps for bootloading. The bootloading process is done, successfully. In this point, I have a problem is that the ATMEGA328P-U works a different frequency I think, but also it may be depending on different cause. It can be explained what I say as follows;

For example, you know a Blink example code in Arduino (LED blinks connected in D13 with 1 sec). Here, ATMEGA328P-PU is OK meaning that the application program (LED Blink) runs, well. But, the ATMEGA328P-U works with different speed meaning that LED blinks with 10 sec, even though I used 16MHz crystal and same circuit components. Why this problem come out and how can I correct/handle this case? Please help.

Leave a comment