AmoghDesai.com

Bootloading and programming a Atmega328P/PU using arduino Nano or Uno as ISP

I recently bought a few Atmega328PU chips to use in some project. Its better to use these bare ICs in the circuits instead of putting the whole Arduino Uno  or Nano board, as their cost is higher. But the problem with bare Atmega328 ICs is that usually there is no bootloader installed in them and you need a saperate programmer to program them before you put them in your circuits.

Arduino’s official website shows this easy way of using Arduino Uno as a programmer for the Atmega328 IC, but what if I have an Arduino Nano?You need to modify this circuit a little to work with a Nano.

Here’s the circuit for Arduino Nano as programmer:

Circuit Diagram for Arduino Nano As ISP Programmer and Bootloader

PDF File for the Circuit Diagram can be found here

Once you have built this circuit, you are ready to burn a bootloader or burn a sketch to an Atmega328PU or P.

First install a stable version of latest Arduino IDE from here.

Burning a bootloader to Atmega328.

  1. Open Arduino IDE
  2. Click on Tools => Board => Arduino Nano w/ Atmega328
  3. Now click on Tools => Programmer => Arduino as ISP
  4. Connect the Circuit to the Computer using USB cable.
  5. Click on Tools => click Burn Bootloader

 

Burning a sketch to Atmega328. 

  1. Open Arduino IDE
  2. Click on Tools => Board => Arduino Nano w/ Atmega328. (i.e. Confirm Correct board is selected.)
  3. Now click on Tools => Programmer => Arduino as ISP. (i.e. Confirm Arduino as ISP is selected.)
  4. Now copy paste or write the sketch in the programming window.  You can also copy a downloaded sketch to the sketch directory.  On windows its located at C:\Users\*username*\Documents\Arduino Make sure you put each sketch in a specific directory.  This way in Arduino IDE you can directly go to File =>Sketchbook => Select the sketch you want to burn.
  5. Once you have written/copy pasted or selected the sketch click on Sketch => Verify/Compile.
  6. Now select File => Upload using Programmer

Once the Sketch is burnt to your IC, you are all set to use this chip in your circuits.  Let me know if you get any issues or there are any suggestions you want to make to improve this post.  You can leave your comments below!