Build Your Own Arduino & Bootload an ATmega Microcontroller – part 1

There are many reasons to build your own Arduino circuit on a protoboard or a custom-designed printed circuit board. At the heart of the Arduino platform is an AVR microcontroller, in usual way you need a special hardware programmer and suitable hex files to program the Atmel AVR chip. Fortunately, Arduino is a beginner-friendly platform because a bootloader is included in the AVR chip which allows you to program the board over the serial port without any dedicated AVR programmer.

The bootloader is basically a small hex file that runs when you turn on the Arduino board. At first looks around to see if the computer (at the serial port) is trying to program it. If so, it absorbs the program code from the computer and transfers it into the AVR chip, in a specific location so as not to overwrite the bootloader. If the computer isn’t trying to upload any code, it instructs the microcontroller to run the code that’s already stored inside.

Arduino uno r3 schematic

Original Circuit Diagram: Arduino UNO R3

Now, have a look at our favorite Arduino UNO to find out the AVR chip inside. It is ATMega328P-PU, a low-power version of the traditional ATMega328-PU. The P indicates pico for pico-power which is a technology ATMEL has developed that allows the microcontroller to run with less power. This ATMega328 chip holds a pre-burned bootloader, allows you to upload code without using any additional hardware. So if you are in a plan to make your own open source microcontroller platform – Arduino, no doubt, you need an AVR chip with pre-charged bootloader!

This part of AVR tutorial will teach you how to make your own Arduino chip, ie Atmega328P with Arduino Bootloader. First we need one blank Atmega328P-PU microcontroller with a few supproting components:

  • Atmega328-PU/ Atmega328P-PU – 1
  • 16Mhz Xstal – 1
  • 22pF Ceramic Capacitor – 2
  • Small Breadboard / Protoboard & 28-Pin (PDIP) IC socket – 1
  • Your Arduino UNO board (here used as a programmer)

If you go through the Arduino IDE you can see an example sketch called “Arduino as ISP”. If you upload this code to your Arduino, it will basically act as an AVR programmer. Next, set-up your Arduino as an ISP. Here is the procedure:

  • Plug in your Arduino UNO (through USB) to your computer
  • Open the Arduino IDE
  • Open → Examples → ArduinoISP
  • Select → Arduino UNOfrom Tools Board →
  • Select your Serial Portfrom Tools Board →
  • Upload the Sketch (When finished, close the IDE and disconnect your Arduino)

Arduino software interface

It is probably easier to just install the bootloader from the Arduino IDE. Arduino takes care of all the messy details for you when you burn bootloaders through it. Finally, prepare the hardware by following the wiring diagram shown here. Keep an eye on the pins MISO, MOSI, SCK, Power, Ground, and Reset. These are the pins you’ll need to flash the firmware on your chip.

Atmega328p programmable pins

As stated, the easy way to upload the bootloader involves using the Arduino IDE. Open your IDE select the board you want to program. Then select the programmer (since you are using the Arduino as ISP you will also need to select the COM port that the Arduino as ISP is connected to). Then select Burn Bootloader. This will take the board you selected and look up the associated bootloader in the board.txt file. Next, it will find the bootloader in the bootloader folder and install it.

P21  4

Yes,now you have an Arduino Chip! You can use this for your next standalone Arduino Project, or to make your own little Arduino board. However, keep it in mind that this is not the one and only proven method for making an independent Arduino chip. You can find numerous ideas, tips and tricks everywhere in internet. Next is the complete schematic diagram of a little Arduino board for your everyday projects. Use the Atmega328P chip, with Arduino bootloader loaded by you, as the brain of this economical circuit.

Diy arduino schematic

There are many circuit diagrams available online for building an Arduino on a protoboard, but after an extensive research and after some little tweaks, I’ve come up with this tried and tested circuit. I hope this will help those who want to play in the Arduino world but can’t afford a full fledged, luxurious Arduino Uno board.

Where is the USB?

Yes, you are right! The USB port for interfacing Arduino with your PC is missed here. In Arduino Uno boards, there is an smd chip (IC) which works as a USB to serial converter, allows us to program the Arduino using our computer (Uno R3 uses an ATmega 16U2). Fortunately, this is not a serious problem for you because you can buy a ready-made USB to Serial Converter Module as a powerful and economical alternative resolution!

Part 22: Bootload an ATmega Microcontroller & Build Your Own Arduino – 2
← Part 20: Working With Bootloaders & Build Your Own Bootloader – 2

Sorry, comments are closed!