Retronics

Restoring, remodeling and creating electronic devices


DIY: ATMEGA328P-AU bootloader burner

The ATMEGA328P is well known from basic Arduino boards like Uno, Nano and Pro Mini. When buying one of these boards, you can step directly into programming the microcontrollers from Arduino IDE. If you have bought the same microcontrollers separately, you need to install a Bootloader before you can upload code via the serial interface.

If you are using an ATMEGA328P-PU (in a DIP-package), just connect a basic circuit on a breadboard, and use an other Arduino board as a programmer, by following this guide: https://docs.arduino.cc/built-in-examples/arduino-isp/ArduinoToBreadboard


When using the surface mount version ATMEGA328P-AU on a custom designed PCB, it may be possible to burn the bootloader after soldering it to the PCB, along with some capacitors and a crystal, but this presupposes that you have connectivity to the GND, Reset and SPI pins, and that other circuitry doesn’t interfere with communication on these pins.

A better way is to burn the bootloader before soldering the ATMEGA to your PCB. Access to the needed pins can be achieved by using a TQFP32 “clamshell” socket. Search for e.g. “TQFP32 Socket SA663” on eBay, and you will find it.

To avoid having to connect the same circuitry each time I shall burn a bootloader, I made a PCB with all needed hardware:

  1. An Arduino Nano, which works as a programmer, and provides USB interface.
  2. Pin headers for the TQFP32 socket.
  3. Crystal, load capacitors, and a few other components.
Bootloader Burner schematic (click for high res image).
PCB Design in KiCad. If you want to make one yourself, leave a comment below, and I’ll share the Gerber files for PCB manufacturing.
The finished board, populated with an Arduino Nano clone, pin sockets for the TQFP32 adapter, and other components.
With TQFP32 adapter installed. Notice the orientation.

Before first use of the Bootloader Burner, you need to upload the sketch “ArduinoISP” to the Nano board. This can be found in the Examples menu.

Now the Bootloader Burner is ready for use. Put an ATMEGA328P-AU in the clamshell adapter. Make sure that the orientation is correct. A label “1” marks where pin 1 shall be. On the ATMEGA, pin 1 is marked with a round recess.

Select Tools->Programmer, and notice what was previously selected as programmer. Then change programmer to Arduino as ISP, and click Burn Bootloader.
The process only takes a few seconds. Now the ATMEGA is ready to be soldered on to your custom PCB.
If you’re not going to burn more bootloaders this time, change Programmer back to whatever it was before. You did notice, didn’t you 😉


4 responses to “DIY: ATMEGA328P-AU bootloader burner”

  1. Hello, could you please share the PCB so I can assemble it.
    Thanks.

    Like

  2. Love this
    This is a very informative post on burning bootloader using a PCB with an Arduino Nano clone. The step-by-step guide is helpful for beginners who want to customize their boards with microcontrollers.
    Eamon O’Keeffe
    Great DIY Ideas

    Liked by 1 person

  3. Johnny Stamboel avatar
    Johnny Stamboel

    Awesome!! I’d love to have this.

    Johnny

    Liked by 1 person

Leave a comment