Introduction: Standalone ATmega328p (using Internal 8 MHz Clock)
The ATmega328p is a single-chip microcontroller created by Atmel in the megaAVR family (later Microchip Technology acquired Atmel in 2016). It has a modified Harvard architecture 8-bit RISCprocessor core.This microcontroller is the brains of Arduino development board as well as many other development boards. Using this Instructable you can minimise the size of your projects and make them a lot cheaper. This is done by reducing the number of components of the development board such as onboard LEDs, external Crystal oscillators, external Capacitors and many other redundant components built into the development boards.
Step 1: Tools Needed
List of Parts needed
1. 10K ohm resistors
2. ATmega328P-PU IC
3. Jumper Wires
4. LM7805 Voltage Regulator
5. Breadboard
6. Arduino Uno Development Board
We also need Arduino IDE to Burn Bootloader and upload sketches to ATmega328P. You can download it from here.
You also need to download Arduino on a Breadboard library. You can download it from here according to your IDE version.
Step 2: Burning Bootloader to Atmega328p
The ATmega328P IC does not come preloaded with a Bootloader. The Bootloader is a set of code that allows the IC to interpret code that we upload using Arduino IDE.
Steps to upload Bootloader to ATmega328P
1. Connect Arduino to ATmega328P as shown in the image.
Connections are listed as follows:-
ATmega328P pin 7 => Vcc
ATmega328P pin 8 => Gnd
ATmega328P pin 20 => Vcc
ATmega328P pin 22 => Gnd
ATmega328P pin 1 => pin D10 of Arduino
ATmega328P pin 17 => pin D11 of Arduino
ATmega328P pin 18 => pin D12 of Arduino
ATmega328P pin 19 => pin D13 of Arduino
pull up resistor across pin 1 of ATmega328P
2. Add board to your IDE:
> Make a folder named Hardware(if it is not present already) in your sketch folder and extract and copy the downloaded library to that folder.
> Restart the IDE and search for a new Board in menu of Tools > Board, you should see a new board named "ATmega328 on a breadboard (8MHz Internal Clock)". If you see this board everything is fine so far.
3. Select Serial port.
4. Select programmer to "Arduino as ISP".
5. Burn Bootloader by going to Menu Tools > Burn Bootloader.
Step 3: Sketch Uploader Circuit
You can upload sketches to ATmega328P using your Arduino board.
Steps to upload sketches to ATmega328P
1. Remove IC from Arduino.
2. Connect Arduino to ATmega328P as shown in the image, Connections are listed as follows:
>ATmega328P pin 7 => Vcc
>ATmega328P pin 8 => Gnd
>ATmega328P pin 20 => Vcc
>ATmega328P pin 22 => Gnd
>ATmega328P pin 1 => Reset pin of Arduino
>ATmega328P pin 2 => pin 1 or RX pin of Arduino
>ATmega328P pin 3 => pin 2 or TX pin of Arduino
pull up resistor across pin 1 of ATmega328P
3. Upload Sketch to Atmega328P using Arduino IDE.
4. Connect pins to ATmega328P according to pin mapping diagram.