You need to know this before going to buy an AVR microcontroller like ATMEGA328 IC. The reality you can’t use directly this IC for doing any electronics projects or replacing the new IC on Arduino. In this both conditions the project code in not get installed unless you burn bootloader on your new ATMEGA328 IC.
So here I will show how to burn bootloader code to new ATMEGA328, ATMEGA328p, and ATMEGA328-AU IC. After burning bootloader you can use IC as standalone a custom electronics project or PCB. Simply burn bootloader first then install your project code.
Introduction
The Arduino board is built with ATMEGA328 IC. When you are uploading any Arduino project code to your board will store it in memory. After the code upload, it works based on the uploaded code. But the Arduino board is costly, Arduino UNO or Arduino nano board can run a single code at a time or a single project at a time.
Buying more Arduino boards is too much cost. During this time we go through buying Arduino IC and uploading code on it. But this is not simple, to upload project code to a new IC you need to do some steps on them. This is called bootloader burning to ATMEGA328 IC.
What is ATMEGA328 Bootloader?
Bootloader is a small piece of code to run the uploading code. Bootloader in arduino is allow to program over the serial pot of arduino IC.
The job of boootloader is accepting the code and saving in its microcontroller memory.
Why Bootloader is Needed in ATMEGA328?
Bootloader is a simple program that allow to load programs via USB cable. At the beginning bootloader checks the uploaded code and initializing it. If their is no upload available itโs ready to receive new code through USB upload.
So bootloader is allow microcontroller to save uploaded code on its memory efficiently. Also execute at the required time. The bootloader is very important in new AVR Microcontroller programming.
Burning Bootloader on ATMEGA328
Here is the easy steps are given to burn bootloader on ATMEGA328 IC. The major extract of burning bootloader is pointed below. To burn the bootloader , follow those steps:
- Plug arduino UNO board to your laptop or pc. Open arduino IDE software and upload Arduino ISP sketch from Files.
- Wire the circuit using new ATMEGA328 IC ( The circuit diagram is given below ).
- Check the number of the IC carefully, if it is ATMEGA328 u select Atmega328 in the software.
- Select Arduino as ISP from tool > Programmer
- Then click Burn bootloader.
Burning Bootloader Step by Step
The comple step by step guide for burning bootloader to Atmega328 IC. Follow the seps to successfully upload bootloader on microcontroller.
Installing Mini Core
The mini core is a hardware package which adds different type of Arduino IC programming setups. So you need to install it first. To install Minicore on Arduino IDE software follow the steps.
- Open Arduino IDE software > Files > preferences
- At the bottom of the pop up window an additional board manager url is their.
- Past this code in the box, ( without โโ )the url is โhttps://mcudude.github.io/MiniCore/package_MCUdude_MiniCore_index.jsonโ
- Navigate to board manager Tools > Board > Board manager
- Search Mini core and click Install
Upload Arduino ISP
- Connect arduino Uno using usb cable and connect it into your PC.
- Then go to files > Examples > ArduinoISP
- An ArduinoISP code will pop up in new arduino IDE task then click to upload the code.
Atmega328 Bootloader Circuit
To burn bootloader on new ATMEGA328 IC. Connect the IC as per the circuit diagram.
ATMEGA328 IC Bootloader Connection
Arduino Uno Board | ATMEGA328 IC PIN |
Pin 13 ( PB5 ) | Pin 19 |
Pin 12 ( PB4 ) | Pin 18 |
Pin 11 (PB3 ) | Pin 17 |
Pin 10 (PB2 ) | Pin 1 ( Reset pin ) |
5v | 5v |
Gnd | Gnd |
Select Device, Crystal and Programmer to Burn bootloader
- After successful connection plug USB to arduino and re connect it to your PC.
- Select New IC number, Crystal and Programmer. From the tool menu
- After proper selection Click Burn bootloader.
Now the new ATMEGA328 IC bootloader burning finished. Now remove the IC from breadboard and replace the original IC with new IC to Upload your project code to run. Thats it, you are done. If you have any doubts check the youtube video Tutorial.
YouTube Video Tutorial
Also Check : Arduino Uno Electronics Projects