Program ATmega 328 Using Arduino (Arduino As ISP)




About: Maker, Electronics enthusiast. Studied Electronics and Communication Engineering. Studies Robotics And Intelligent systems.

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.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

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

Arduino Contest 2016

Participated in the
Arduino Contest 2016

Be the First to Share


    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    8 Discussions

    Yasith Silva

    1 year 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

    1 reply

    We cannot do this with the SMD version of the Arduino. Because we need to remove the IC from the board.


    2 years ago

    Hi, what about the AtMega 16 A ? Can i program it like that ? Thanks

    1 reply

    2 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 <> "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 !


    3 replies

    Reply 2 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....... :)