- Learn Linux
- Learn Electronics
- Raspberry Pi
- LPI certification
- News & Reviews
In my earlier projects I've created custom Arduino Circuits, KiCAD Arduino PCB design and Model railway automation signals. These have all being based around custom Arduino like circuits based around the ATmega328p microcontroller. In those I recommended buying a ATmega328p with the bootloader pre-installed. This is useful for beginners as it means you can concentrate on the custom circuit, but in this I will go through details of how you can install a bootloader if you buy a basic IC with no bootloader.
The video below gives an introduction to this.
This can be created on a breadboard, but I have also designed a custom PCB shield that can be used as a dedicated programming.
The Arduino Bootloader is a piece of code responsible for running the user code and/or installing new user code. This runs whenever the ATmega microcontroller is powered-on or reset. Essential it looks to see if the IDE is trying to send new code to the Arduino and if so then it saves that new code to the application area of flash memory. If not then it jumps to the code already in flash memory and starts the microcontroller running. This is an oversimplification, but gives you an idea of how it works.
Without the bootloader then the microcontroller will not be able to do anything unless it is programmed directly using an in-system programmier or similar.
You can get a dedicated AVR-ISP which is an In-system programmer designed specifically for microcontroller chips based around the AVR architecture (which includes the ATMel ATmega series chips). Alternatively you can install code to an Arduino so that it can act as an In-System Programmer. This is known as an Arduino as an ISP, which is what this guide covers.
The below diagram shows the basic setup of how you can program the bootloader using an simple Arduino like circuit created on a breadboard.
The initial Arduino shield (shown at the top of this page) is based around the same circuit as the breadboard version, but made into a custom PCB. Whilst this circuit works correctly based on experience with the programmer it would be better with a ZIF socket and to have status LEDs. I have therefore created an updated circuit, although not yet had an opportunity to try it.
The following steps should be followed to install the bootloader.
After installing the bootloader you can move the chip into your project and program from there, alternatively:
I'll be adding new projects based around my own custom circuits in future.
I also plan to design my own custom circuit based around the ATMel ATMega328P which I'll be creating on a custom designed printed circuit board (PCB).
To be notified about future videos
Subscribe to the PenguinTutor YouTube Channel
Please view the copyright information regarding use of the circuits.