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


1-40 of 48Next »

Excellent! I guess I made the same mistake as you in buying without the p! This instructable is just what I needed! I assume that when you move the newly burned micro to its final resting place you need to bring the crystal and capacitors with it, right?

Hello

I need to burn bootloader to the P89v51rd2 (8051) microcontroller i have hex file and arduino if i use arduino board and same configuration as in this circuit as MOSI, MISO, SCK to the 8051 but what should be the crystal frequency ?
please reply me

kaledawit10 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

did u get any solution..??

mario87052 months ago

Thank you! Now i've two Arduino!

adityapvarma3 months ago

Thank you!!

Worked Perfectly..!!!

adityapvarma3 months ago
adityapvarma3 months ago
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 .

EvrttGrn1 year 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 EvrttGrn5 months ago

Thanks EvrttGrn ;-)

Arpan21036 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.

Phimo6 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

arduino956 months ago
Where can I find the two files which are attached (avrdude.config and boards.txt) ?
I can't find them.
semihmasat7 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 ndshah886 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.

ndshah887 months ago

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

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

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

mrdragon3338 months ago
I get this error : avrdude: stk500_getsync(): not in sync: resp=0x00
any idea what could be wrong ?
manu08 (author)  mrdragon3338 months ago
If using the arduino version 1.0.5 try removing the capacitor.
johnybody8 months ago
I had to switch MOSI to MISO and MISO to MOSI to get it working...
gadgets_guy8 months ago
Can you tell me if this would work with ATMEGA328-PN and ATMEGA168-20PU chips?
dineshb98811 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
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?
Amlor1 year 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)  jab21 year ago
No, I don't think so. Sorry pal.
sdcharle1 year ago
Nice, but doesn't work with Arduino UNO on a Mac, the directories are all different.
manu08 (author)  sdcharle1 year 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
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.
ITMuncie1 year 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
1-40 of 48Next »