Program ATMEAGA328 Microcontroller IC using Arduino Board

 


There are lots of way to Program ATMEGA328pu Microcontroller in internet today in order to use breadboard or puff-board and the programmer is the programming circuit board which use for do programming of any microcontroller and some connection and soldering. This IC also known as Arduino Board brain because this is the main part of Arduino can also called as Arduino Microcontroller or Chip. This IC is very simple and easy to use in any projects. Sometimes in any small or industrial projects, Arduino Uno or Nano is too much big but this microcontroller has cheap in price and small and we can use as standalone IC, which can be programmed in Arduino IDE, AVRDudes software and etc.

So in this tutorial, we will learn how to program, use Atmega328 IC, programming for LED Blinking and components which contains as:

>>Complete Components

>>Programming using Arduino Uno or Nano

>>Arduino Connection (Arduino as ISP)

>>Proper Standalone Board Connection

Components or Parts Required:

Arduino Nano or Uno:

USB Cable:

(For Arduino Uno or Nano)

ATMEGA328 IC:

LEDs:

22pf Capacitor:

16 MHz crystal:

10uf capacitor:

LM7805 Voltage Regulator:

10K Resistor:

1K Resistor:

Jumper Wires:

Breadboard:

Puff Board:

Battery (7V-12V):

There have some components are optional in this list just you need to choose any of one Nano or Uno board as you required and you need battery which voltage 7V to 12V you can use 2 3.7V Li-ion cell to make 7.4V rechargeable battery or you can use normal use and throw 9V battery.

Arduino Connection:



Atmega328: This is the main part in this project, First place middle side of the breadboard properly and very carefully because its pins can be break if you do forcefully.

16 MHz Crystal: 16 MHz crystal oscillator is connect in IC Pin 9 to Pin 10.

22pf Capacitor: Connect the 2 capacitor to IC,

First capacitor 1st pin to IC’s pin 9 and first capacitor 2nd pin GND!

Second capacitor 1st pin to IC’s pin 10 and second capacitor 2nd pin GND!

Push Button: Connect this push button to first pin VCC 5V with 10K Resistor and second connect with GND Pin.

LED: Connect LED ‘+’ to IC’s 13 Pin and Led ‘-‘to GND.

Connect this wire between Arduino to ATMEGA328 IC

Arduino PIN     ||      ATMEGA328 IC

Pin 13(SCK)       ||     Pin 19

Pin 12(MISO)   ||     Pin 18

Pin 11(MOSI)   ||     Pin 17

Pin RST(Reset) ||     Pin 1

Pin 5V(VCC)      ||     Pin 7

Pin GND(GND)  ||    Pin 8   

Now Complete Wiring is ready.

1. Programing Using Arduino Nano or Uno

First we need to open Arduino IDE if you don’t have this software or complete beginner than download from here and install.

Now click on the Tool Menu on the upper side and select Board to Arduino Nano and if using Uno than click Arduino Uno Now select your Port in Port Section and now go to the programmer and click “Arduino as ISP”, the connection between Arduino and your PC is complete.



Now click on the File menu and then example section, click on “11.ArduinoISP” program, just Upload it to your Arduino board after then successfully uploaded go to the Tool menu and click on the “Burn Bootloader” . Now your ATMEGA328 Successfully programed or if not may be lose of connection and not properly connected then check it and do this step again.

How to upload any other Arduino Program to ATMEGA328 using Arduino Board

After this Complete Setup you want to program some another code in ATMEGA328 IC because after Burn Bootloader process, there has only Blink sketch is uploaded by default.

 Here some step to upload Another Program in ATMEGA328:-

·        Open Arduino IDE in your PC
·        Write or Paste the code as you want to program in ATMEGA328 IC
·        After complete compilation, In the Menu click on the Sketch Menu and here click on the “Export Compiled Binary”.
(Note: Now this time we create a Hex file of this code using this menu)


 And then click on the “Upload Using Programmer” and its take some second to upload code in IC and its complete.
So there are some easy step to program ATMEGA328 IC. If you have any problem than check the connection of Breadboard or Arduino board.

Comments