Instructables
loading
loading

Burning the Bootloader on ATMega328 using Arduino UNO as ISP

Featured
Picture of Burning the Bootloader on ATMega328 using Arduino UNO as ISP
DSC_0007.jpg
ChipPU.png
UPDATE: This tutorial will work on Arduino IDE 1.0.1, the recent 1.0.5 makes some changes on the ISP sketch so I'm not sure if it will work (I just bought 2 ATMega328 and burned both on 1.0.1).

Please use 1.0.1 to eliminate any problems. Click Here


I had one remote controlled project that needed an Arduino running 24/7 but I didn’t want to leave my $32 Arduino UNO, so I decided to buy some pieces and created my own Arduino. The most important part was buying the microcontroller. These were my options:

ATMega328P-PU with Optiboot ~ $5.50 (Sparkfun) / $5.19 (Digikey)
ATMega328P-PU ~ $3.16 (Digikey)
ATMega328-PU ~ $2.88 (Digikey)

Obviously I bought the cheaper one, huge mistake. After some research I found that my first option was the straight one. Just plug it as a normal Arduino, the last two needed something else.

The last two options were missing something called a bootloader. A bootloader is “a small program that has been loaded on to the microcontroller. It allows you to upload code without using any additional hardware.”

So first if you were to do anything on those microcontrollers you need a bootloader burned on those chips. As you may have notice, the difference between the second and the third is just a mere P after the 328. This P means pico for picopower which is a technology ATMEL has developed that allows the microcontroller to run with less power.

Well if you see the microcontroller on your Arduino UNO you will find out that it is using the picopower micro, not the normal one. I bought 3 normal ones. OMG then I’m totally screw. Well no, you just have to make a pair of changes on your Arduino files to make it work. 

This tutorial will teach you how. 


 
Remove these adsRemove these ads by Signing Up

Step 1: Materials

Picture of Materials
DSC_0018.jpg
We will need the following materials:

1 USB cable to connect PC-Arduino
1 Arduino UNO (I’m using R1)
1 ATMega328-PU 
1 Small breadboard
1 16Mhz Crystal (mine had 20pF of capacitance)
2 22pFCeramic Capacitors

... And some jumper wires


1-40 of 97Next »
RobinB11 month ago

Thanks A bunch !

I followed the tutorial word-for-word and it worked.

Thanks Again

prageen5 months ago

i followed all the steps...n finally when I try to upload the bootloader I get the following error::

Error while burning bootloader: missing 'bootloader.tool' configuration parameter

pls help me..

invenTHOR prageen2 months ago

I guess you have used a newer version of the Arduino IDE. Make sure to use version 1.0.X !

ManirI3 months ago

Other methods
did not work. The following one did.

  1. Google search “How to
    burn bootloader”
  2. Goto: http://3g1l.com/blog-burn-bootloader-blank-atmega328atmega328p-arduino-uno
    read the document and comments. Follow the link or directly open the next
    step.
  3. Do the wiring as shown
    at: http://arduino.cc/en/Tutorial/ArduinoToBreadboard
  4. Create a directory
    named “optiLoader” preferably where your other Arduino or Processing sketches
    are
  5. Goto: https://github.com/WestfW/OptiLoader
  6. Open “optiLoader.h”,
    select all, paste in Notepad and save as “optiLoader.h” in the optiLoader directory
    created in the previous step
  7. Open “optiLoader.pde”,
    select all, paste in Notepad and save as “optiLoader.pde” in the optiLoader
    directory created in the previous step. Instead of “pde” you may give
    extension “ino”, it doesn’t make any difference
  8. Open Arduino IDE, form
    the IDE open “optiLoader.pde”. If you gave “ino” extension, you may
    doubleclick the icon, it will open in Arduino IDE
  9. Select the proper
    board, COM port and upload the sketch
  10. Open the Serial Port
    Monitor. Set the baud rate to 19200. If the 328Pee Poo is good,
    connections are good, you should see the success message as described in
    the optiLoader.txt file
  11. If you need more 328P
    PU to program, insert next one press “G” in the serial port, monitor
    window, press enter.

Note:

i) You NEED the oscillator and the capacitors.

ii) Copy, paste and save the “optiLoader.txt” just for reference.
It is not necessary though.

iii) If you download optiLoader-master.zip, you will get all three
files.

iv) If the baud rate is not set to 19200, garbled message is
received.

aggelou.vakis5 months ago

When I try to upload the bootloader I get the following error:

avrdude: Expected signature for ATMEGA328 is 1E 95 14

Double check chip, or use -F to override this check.

I use an ATmega328P-PU. What I do wrong?

I have the same problem. It was solved by adding external power supply to my UNO

BryanS65 months ago

avrdude: Yikes! Invalid device signature.

Double check connections and try again, or use -F to override

this check.

IsaiasD5 months ago

Hi,

I followed all the steps and instructions posted here and I couldn't burn the Atmega328, I got this "MCU 'atmega328' supported for assembler only- unknown MCU 'atmega328' specified". I'm using arduino IDE version 1.0.1 and arduino board R3. What can it be the problem?

3lwamakram1005 months ago

i did that with atmega328p-pu

but it didn't work on it there was an error althought the wiring diagram was right !!!

JohnN36 months ago

How do you download the files in the article? Sorry for my ignorance but I can open the text and copy paste, (will that work)? how do I get the rar down?

I use winrar but even still you should be able to download it and right click and extract the files. For the boards file I just opened the original selected all and pasted over everything from the Web page itself.
Thanks for that, I did get it down by changing browsers from IE to Chrome. Usually right clicking on component would give a menu with option of downloading but in this case not. Chrome simply downloaded it. I am however seeing conflicting statements in articles regarding the process of installing the bootloader, One article on the Arduino.cc website says that it works with the Duemilanove, and won't work using the Uno. I wanted to use the method using the chips internal clock since I'm still waiting for the necessary capacitors to add the external. but now I'm not sure it will work....any insight would be appreciated.

Sorry for the broken up/late reply to your question, but about the capacitors i'm going to take a shot in the dark. try using different value caps but as close as possible to the 22pF's. the crystal should be looking at them as in a series so i want to say by that each side is utilizing roughly 11pF (give or take) but keep in mind the probability of any stray capacitance (we'll just say around 9pF), I'm assuming the 22pF value was selected to take all that into account so it wouldn't be overwhemling nor being stingy with what it actually needs.

abel.maktub7 months ago

Where can I find the two files which are attached (avrdude.config and boards.txt) ?

I can't find them.

They're under the steps 1 - 9 on this page.

http://www.instructables.com/id/Burning-the-Bootloader-on-ATMega328-using-Arduino-/step4/Preparing-the-software/

How do you get them down clean if I click on them they open. The rar being compressed is well compressed lol.

kaledawit1 year ago
Hello
I need to burn the Atmega328p-pu with arduino uno r3, and arduino 1.0.5 IDE or 1.0.1 When i try to upload the Arduino ISP sketch, Error happen this is

avrdude: stk500_getsync(): not in sync: resp=0x00
please help me I follow the instruction in the above and other fourm

my email kaledawitesmelealembd(at)gmail,com

I'm sure by now you have already figured something out but I'll post a reply any ways....

Make sure you selected "Arduino as ISP"

Make sure the files he provided overwrites the originals and try selecting board type as "Arduino UNO" (not 328).

Worked for me flawlessly using the R3 board and the same chip you mentioned.

My 328p-pu probably came with the bootloader, but on uploading sketch it says yikes! invalid device signature and double check connections.Even on burning bootloader it gives same error. plz help me sir. It's urgent.

Do You know if you ordered it pre-loaded or not? Are you able to upload a sketch to it if you put the chip on the actual arduino board itself?

It is written on the product description on amazon that it has a bootloader on it. Is it possible that it has a bootloader of some different board configuration like duemilanove or decimilia. Also, I have not put the chip on actual board itself. I am afraid the real arduino uno chip's pins might get damaged if I take it out. If that happens I will be left with nothing. But still, do you recommend taking the chip out and trying my bought one on the uno?

I don't see how it would hurt to try. It would also verify if they actually shipped it to you already loaded. If all else fails and you're still attempting to load it. Go here and skip down to step 6 and see what results you yield.
http://m.instructables.com/id/Bootload-an-ATmega328/all/

I'll try and get online on an actual PC soon and have a look around a bit more when I get a chance.

maybe you connect wrong the voltage or your chip broken

did u get any solution..??

siimraud6 months ago

Does it run on OS X?
I'm getting

avrdude: parallel port access not available in this configuration

avrdude: error at /Applications/ArduinoBurn.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:727: programmer type not specified

John PaulS6 months ago

Can i use Arduino Revision 3?Thats my only arduino.........

Yes, just be sure to download the older version of the IDE and select board type as "Arduino UNO" (not Arduino 328) assuming you're using a ATMEGA328P-PU (not sure if it matters)

I3L4ck5h33p made it!6 months ago

Awesome instructable ! Let the prototyping commence.........

(excuse the horrid breadboard, at least it works)

20141108_034918.jpg

im using arduino 1.0.5 (i know u said its better to use 1.0.1)and im getting the error:"use -F to override this check" .... what does it mean and how to solve it ?

Rename your "Arduino" folder so that nothing is overwritten/merged with the old version. Download version 1.0.1 and follow the instructable. It worked fine for me when I chose Board "Arduino UNO", not "Arduino 328" using chip ATMEGA328P-PU.

jannetta made it!7 months ago

Mine worked perfectly!

20141002_115157.jpg
lizcue jannetta7 months ago

Where did you find the attachments??

They're under the steps 1 - 9 on this page.

http://www.instructables.com/id/Burning-the-Bootloader-on-ATMega328-using-Arduino-/step4/Preparing-the-software/

ramasree12 years ago
sir i didn't find the arduino328 as you have given instructions (step 5) from tools>board ...
can u help me, am using the latest version of arduino 1.0.1
I had the same problem then I happened to go through the process again without the Arduino connected to the computer and arduino328 was at the top of the list. I am still getting the "invalid device signature" error when I try to burn. It says I can over ride this check using -F but I do not understand how to do this.
mbose2 ITMuncie6 months ago

I cant find 328 from boards menu as it doesn't open. I know you had this problem over a year ago, but can you walk me through the process, like when do you disconnect the arduino and 328 comes on list. It's urgent Sir..

alishah7306 months ago

I have done every thing but it shows invalid device signature. screenshot is attached. plz help me to burn atmega328p using the UNO board.

bootloader.jpg
alishah7306 months ago

I have done every thing but it shows invalid device signature. screenshot is attached. plz help me to burn atmega328p using the UNO board.

bootloader.jpg
alishah7306 months ago

I have done every thing but it shows invalid device signature. screenshot is attached. plz help me to burn atmega328p using the UNO board.

bootloader.jpg
alishah7306 months ago

I have done every thing but it shows invalid device signature. screenshot is attached. plz help me to burn atmega328p using the UNO board.

bootloader.jpg
1-40 of 97Next »