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.
Once you have built this circuit, you are ready to burn a bootloader or burn a sketch to an Atmega328PU or P.
Burning a bootloader to Atmega328.
- Open Arduino IDE
- Click on Tools => Board => Arduino Nano w/ Atmega328
- Now click on Tools => Programmer => Arduino as ISP
- Connect the Circuit to the Computer using USB cable.
- Click on Tools => click Burn Bootloader
Burning a sketch to Atmega328.
- Open Arduino IDE
- Click on Tools => Board => Arduino Nano w/ Atmega328. (i.e. Confirm Correct board is selected.)
- Now click on Tools => Programmer => Arduino as ISP. (i.e. Confirm Arduino as ISP is selected.)
- 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*DocumentsArduino 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.
- Once you have written/copy pasted or selected the sketch click on Sketch => Verify/Compile.
- 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!