Sometimes you need to burn Bootloader into your ATMEGA Integrated Chip. You can also purchse a chip that comes with preloaded Bootloader or ISP programmer like USBASP, actually any working Arduino can be used also.
This tutorial I’m going to demonstrate to you here how to use the Arduino as Bootloader into your brand new ATMEGA168 or ATMEGA328 Chip. The new ATMEGA chip does not have the Arduino Bootloader inside of the chip you have to program the chip before you can use it using external programmer.
Now if you have an Arduino UNO you need to use the USBTINY Bootloading method.
Arduino IDE has a demonstration program called ARDUINOISP locate at | File | > Example >ArduinoISP.
The Arduino ISP can make you Arduino board as an ISP(In System Programmer)Capable to program other ATMEGA MCU Chip. The Arduino board can be as a source or a server and a other ATMEGA chip which is connected to the breadboard or other Arduino Board as client. see below the diagram and circuit layout.
Step One > Wiring the ATMEGA168P / ATMEGA328P to Host
First you need to do is to setup ATMEGA MCU on the breadboard and we need to make a minimal circuit on the breadboard since we take the power directly to the Arduino Board we don’t need to use the voltage regulator like L78XX etc to supply a voltage to the client.
Electronic Parts Required
1x ATmega328P-PU MCU
1x 100Ω
1x 10kΩ
2x 22µF or 22pf Capacitors
1x high precision 16MHz crystal oscillator
Step Two > Programming the Client MCU
Connect the Arduino Board to your PC via USB then we going to lunch the Arduino IDE from IDE, Select FILE | >Examples >|ArduinoISP. In this demonstration where going to use the Arduino UNO at | Tools > Board >| Arduno UNO with ATMEGA328, Next is select the proper Serial Port from the | Tools >| Serial Port.
Press the UPLOAD BUTTON.
Finally we have uploaded our ArduinoISP to the fresh ATMEGA328 MCU as became another ArduinoISP.
This procedure is the same when you going to burn bootloader from ATMEGA328 to ATMEGA168.
Download the ATMEGA328/168 pin out here | Download