Introduction: Program ATmega 328 Using Arduino (Arduino As ISP)
Arduino is nowadays an easy tool for e-hobbyists .As an open platform and a "ready to use" circuit, everyone follows various arduino boards for realization of embedded designs. But sometimes it is difficult and unaesthetic to use such large board as the basic circuit of our project or product, such as making a home automation system using an arduino board'll not be professional . Any arduino board consists of two basic blocks namely the programmer and the microcontroller . The microcontroller is nothing but a standalone microcontroller (Atmega328 in arduino uno) and the programmer is the programming circuit which do the programming of our microcontroller.
When we are making an application level electronic product, we don't need the entire arduino in the design. Only we need the microcontroller programmed as per our application and we don't need the programming circuit of the arduino board. So, in this instructable we gonna program a 328 microcontroller for led flashing and using the microcontroller alone on a breadboard.
Step 1: Bill of Materials
1. Arduino Uno.
2. Breadboard.
3. USB A to B cable.
4. ATmega328 microcontroller.
5. LEDs.
6. 22 pF capacitors.
7. 16 Mhz crystal.
8. 9V battery.
9. Jumper wires.
Step 2: Bootloading the Microcontroller
In non technical words, bootloading is nothing but making a bridge of communication between the arduino board and the microcontroller. The microcontroller 328 that we buy in market may or may not be bootloaded. I it is already bootloaded, then we can directly use it with the arduino otherwise we have to bootload it first. Bootloading can be done with the same arduino uno.
1. Fix the 328 on a breadboard.
2. Connect the crystal to the 9th and 10th pins of the 328.
3. Connect two 22 pF capacitors to each of the two legs of crystal and ground them.
4. Connect pin no: 7 and 20 to a 5V pin of arduino.
5. Connect pin no: 8 and 22 to ground of arduino.
6.Connect pin no:10 of arduino to the pin no:1 (reset) of 328.
7. Connect pin no:11 of arduino to the pin no:17 of 328.
8. Connect pin no:12 of arduino to the pin no:18 of 328.
9. Connect pin no:13 of arduino to the pin no:19 of 328.
Now connect the arduino board to the computer
The arduino in powered up also the 328 on breadboard is powered up.
The circuit is ready and we have to bootload , open the arduino IDE for that.
From MENU select Tools>Programmer>arduino as ISP
Then select Tools>Burn bootloader
After a few seconds, the 328'll be bootloaded and we can easily program it with the arduino board.
Step 3: Programming
Remove all the connections from arduino board to the breadboard we've done for bootloading.
We need some new and a few connections for programming 328.
The new connection steps are as below,
1. Connect Vcc and Gnd from the arduino board to the breadboard microcontroller.
2. Connect the RESET pin of arduino board to the pin number 1 of ATmega 328.
3. Connect the Rx pin of arduino to the pin number 2 of 328.
3. Connect the Tx pin of arduino to the pin number 3 of 328.
Now we've to make some changes in the IDE also , as follows,
1. From MENU , select Tools >Board > "Arduino Duemilanove or Diecimila"
2. now select ,Tools > Processor > ATmega328
Now the entire programming setup is ready
write the program as usual, click "upload"
The program'll be uploaded to the microcontroller.
Remove all the arduino connections, provide a separate 5 VDC power supply to the breadboard and we've an independent 328 microcontroller in action.
Step 4: An Important Pitfall
In the arduino IDE , pin number 5 means the fifth pin of the arduino board not the fifth pin of 328 microcontroller.
It is actually 11th pin of the 328.
Since we are coding for a standalone 328, we've to put keen attention in accessing the I/O pins.
So, access 11th pin of the 328, we've to write in the code "5" instead of 11.
All the 18 I/O pins of 328 can be accessed like this.
So I'm attaching a table which describes everything about coding the I/O pins.
Step 5: Demo Video of Blinking Led on Breadboard
Have Funnnnnn........<3

Participated in the
Arduino Contest 2016
14 Comments
Question 2 years ago
I dont have an option for "atmega328 on breadboard" any advice?
Answer 2 years ago
I cant undersatand! Can you make it clear?
Reply 2 years ago
i bought some chips with the bootloader in them. I followed your directions to program the standalone 328p. under tools board type i dont have an option for atmega 328 on breadboard.
When i wire up the board to your specs for programming and attempt to upload the program, it wont take. What programmer am i using, and do i upload or upload using programmer
3 years ago
The bootloader I'd a bridge of communication between the MCU and the Arduino.
That must be the best and most simple explanation of a bootloader I've ever heard!
Question 3 years ago on Introduction
I recently got a arduino Uno board. But the pin 6 of atmega328 Ic is not connected to board. But when I did blinking led experiment with digital pin 4 it was working fine. I'm pretty sure that pin 6 is not connected with board. And on internet it was written that pin 6 of atmega328 is digital pin 4 of Arduino Uno board. Then how is it working? Should I replace the board or just work with it only?
3 years ago
So i did everything but i keep getting uploaded error i have metro 328 and mega 328 please help
5 years ago
Hi, What about the IC in the board. Do u need to remove it when programming? If so what to do with the new board which they have put a surface mount ic
Reply 5 years ago
We cannot do this with the SMD version of the Arduino. Because we need to remove the IC from the board.
6 years ago
Hi, what about the AtMega 16 A ? Can i program it like that ? Thanks
Reply 6 years ago
Of course you can . I think this link may help you:
http://hardwarefun.com/tutorials/use-arduino-as-an...
6 years ago
Hello !
Thanks a lot for this brilliant howto !
I have questions, though.
1. Other howtos advise the use of an ATmega328-PU microcontroller. What variation of the ATmega328 do you advise ? Why ?
2. In the following video <https://www.youtube.com/watch?v=30rPt802n1k> "How-To: Shrinkify Your Arduino Projects", an Arduino is used as an ISP to program an ATtiny85. No bootloader install is mentioned. Is it really necessary to burn a bootloader to do the same with an ATmega328 ? Why ?
3. My board is a Genuino Uno R3. I would like my standalone microcontroller to be as close to my Uno R3 as possible. Your step 3 advises to choose "Arduino Duemilanove or Diecimila" board. Should I switch to "Arduino/Genuino Uno", or stick to your howto ? Why ?
Again, thanks a lot !
Cobus.
Reply 6 years ago
1. The ATmega 328, P and PU only differ in their package and power consumption. The PU type is a low power consuming one which you can use in some portable applications .
2. You should burn the bootloader for programming the 328 with arduino. But in the case of ATtiny microcontrollers, what only you need is installing the ATtiny support files with the arduino IDE and you can directly program the ATtiny.
3. For programming 328 using arduino Uno board, one should select Duemilanove or Diecimila instead of Genuino uno even though the board is Uno .
Sorry for the late reply....... :)
Reply 6 years ago
Hello,
Thank you for your answers.
Concerning my question #2, I found an interesting website.
<http://www.notesandvolts.com/2013/01/fun-with-arduino-arduino-as-isp.html> wrote :
It also wrote that burning a bootloader (and then erasing it) was an easy way to set the fusebits correctly.
Reply 6 years ago
Thank you #Cobus089 for sharing the knowledge :)