Instructables

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


rohinrohin1 year ago
Hey! First of all, Brilliant Tut! :D Llove it..
So, does this work on the ATmega328p-pu also?
i just need to follow the same steps? as i had bought thep-pu and didn't know to burn it!
any help would be appreciated! :D
Thank you!

Yes it works on ATmega328p-pu also but you have to choose arduino uno as board. I tried and confirmed.

Thanks, that was quick lol xD

hahaha,, after 1 year at last!!! well very nice instructions .

EvrttGrn8 months ago
Andrut1291 - If you're still trying to figure it out, I used this tutorial using my uno r3 and Atmega328p-pu. "http://arduino.cc/en/Tutorial/ArduinoToBreadboard"

Manu08 - Thank you for posting this even though it didn't work for me.
KalkiV EvrttGrn1 month ago

Thanks EvrttGrn ;-)

Arpan21032 months ago

it is not working..

it shows an error..

avrdude: Yikes! Invalid device signature.

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

this check.

Phimo2 months ago

I have been playing with Atmega328s as well and I have put together a web page on how to use an Arduino Uno as an ISP with a modified ArduinoISP sketch.

It's still in its infancy but I welcome comment and if it helps, thanks are always appreciated :o)

www.lydiard.plus.com/arduinoisp.htm

arduino952 months ago
Where can I find the two files which are attached (avrdude.config and boards.txt) ?
I can't find them.
semihmasat3 months ago
Ok, thank for the instructions.

But lets say we did that. After this steps how can we upload our sketches to our new cheapy-arduino ?

I am also trying to do the same! Please help

ender323 ndshah882 months ago

Just to make sure you get a notification, I've answered this above.

There is a way to do that with an Arduino, but the easiest and cheapest way is to use an FTDI breakout board. I got one on Sparkfun for $15. Just plug it in (DTR to RST, VCC to +5V, GND to GND, TX to RX, and RX to TX) and if the bootloader is installed properly it will allow you to upload sketches over the USB port on the breakout board.

ndshah883 months ago

I am also trying to load my sketch on to this Arduino328. Can you suggest how to go about that?

Tlaltecutli3 months ago
Could you tell me where to find the two files you share to replace in the arduino folder??
steinie443 months ago

Why not remove the chip from the Uno and replace it with the new one. Then burn it.

mrdragon3333 months ago
I get this error : avrdude: stk500_getsync(): not in sync: resp=0x00
any idea what could be wrong ?
manu08 (author)  mrdragon3333 months ago
If using the arduino version 1.0.5 try removing the capacitor.
johnybody4 months ago
I had to switch MOSI to MISO and MISO to MOSI to get it working...
gadgets_guy4 months ago
Can you tell me if this would work with ATMEGA328-PN and ATMEGA168-20PU chips?
kaledawit6 months 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
dineshb9887 months ago
Hello....
I'm using arduino 1.0.5.
So which one is use from board???
can i use Arduino BT w/ ATmega 328?
Thank you
jcduplessis9 months ago
Searched myself crazy on the internet looking for an "all in one" answer to doing this. Got a lot of info but with no clear "do this, then this" type guide.Your instructable is EXACTLY what I was looking for! Thank you very much!
hi there, nice tut, but not quiet what ive been looking for :(

any idea on how I can take the micro chip(atmega328p-pu used in arduino and use it on my project?
or if I buy a atmega 328p-pu program it by mounting it on my arduino, then after wards what all do I need (components) to use it with my project?
Amlor11 months ago
I can confirm that this circuit works to program the Atmel ATMEGA328P-PU but you don't have to replace the files. Load the sample sketch Arduino ISP. Just use the Arduino Uno as the board, proper com port for your board, Arduino as ISP for the programmer and hit Burn Bootloader. I burned 5 bootloaders today with no errors.
jab21 year ago
can i use a 14.7 MHz crystal instead :) ?
manu08 (author)  jab211 months ago
No, I don't think so. Sorry pal.
sdcharle11 months ago
Nice, but doesn't work with Arduino UNO on a Mac, the directories are all different.
manu08 (author)  sdcharle11 months ago
I recently bought one, maybe if there is some time, I will update
ramasree11 year 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
ITMuncie ramasree111 months ago
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.
ITMuncie11 months ago
I am getting a "invalid device signature" error. Any advice?
humxa1 year ago
will this work with ANY atmega chip? I might use atmega 8L-8PU
songmuyi1 year ago
useful
Andrut12911 year ago
I have Atmega328P-PU and im also struggling with the bootloader. Im using Arduino Uno R3. Could u tell me pls how this tutorial differs while im using Atmega328P-PU. I mean mostly boards.txt file.
If you had the ATmega328P-PU would you still need to change the files or could you use the burn bootloader option already on the IDE?

Great instructable by the way. Burning bootloaders is something that would be very useful for me as I do a lot of projects needing a seperate ATmega chip, and I could save a lot of money by being able to buy the chips without the bootloaders.
Im curious if this wil work for the 328p-p as well as i have some i bought on ebay and they claimed they burned it with version1.01 but I cannot use board with an y IDE above V.023 so v1.00 and v1.01 when i upload a sketch nothing happens, Ive tried changing different settings as in boards. but he claimed it is 100 % version 1.01, but unless i use V.023 nothing will upload, ive tried, some of the pressing reset just b4 uploading etc,but nothing works on either chip he sent if i try to use V1.0 or newer?
that seems odd as I have an old 328 so it contains an old version boatloader (for a nano), but it has no problems with the IDE of any version.
It should not have I guess whatever the IDE does internally, in th eend it just sends a program over the serial port whereas the function of the bootloader is to receive that and store in memory. You may have another problem on your hand than an old bootloader
yes its very odd, i cannot seem to find any other info about this issue, I had to replace the chip as i hooked up some wrong leads and felt the chip get very hot and smelled the electronics burning smell, so i ordered a new chip, and it work perfectly fine with .o23, but using anything like 1.0 or above does not take any uploads, so im thinking it wasn't properly flashed, that is why im curious if this tutorial will work with a 328p-p I have since bought a new uno they were on sale locally for 17.99 real arduino at micro center, it was actually cheaper then the spark fun clone! thanks for the reply and anyone else with any ideas or confirmation if this tutorial works with the 328p-p or a link to another one would be appreciated. just to note before i burnt-out as in fried my old chip it did work with V1.0 not sure if i had tried V1.01 or not yet on it as many of my library's were older.
I presume this tutorial would work with a 328 because it more or less describes how I usually do it.
yet, I have had some strange issues as well. I have burned the chip that will work in one (DIY)board and not in the other (DIY) board. Not a problem with the board because another chip will work in both. Also, I have burned chips with Version 0.23 and with 1.01 but I recall one time that I could not burn a chip with 0.23 whereas it could burn it fine with 1.01.

!7.99 is a steal for a real arduino though DX.com will sell clones even cheaper
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!