Bootloader Options

Hey all,

    I have been working on a custom CCA that utilizes the ATMEGA328P as the microcontroller and up to this point have been purchasing it with the bootloader already installed from Adafruit which apparently uses their ADAboot version of the bootloader,

    My problem is they are low on stock and thus I'm wondering what the impacts would be if I try to use other vendors' preprogrammed ATMEGA328Ps with either the Opti bootloader or the "Arduino 16MHz" bootloader. 

   Some details of my design: 

   Use an external resonator to run the chip at 2MHz, I also run the part at 3.3VDC.  I program through a small header on my board using a FTDI cable.  I spent a significant amount of time adjusting the code and boards.txt file to make my custom design work and at the end of the day I just want to be able to program the chip in the same manner I do today and I'm not sure that is affected by the different bootloader.


Something isn’t making sense.

Either the Adafruit chips are running on the internal 8 MHz clock or your not using a 2 MHz resonator. Why? Because if the clock was running at 2 MHz, the bootloader would be running at 7200 baud which means you could never download a sketch to a chip.

Have you every run a Blink sketch to verify or checked the clock speed somehow?

I mean I measured it with my oscilloscope.

I know I had to adjust those baud settings as well as the fuse settings but I can’t remember off hand what they’re at. Do you think it’s not possible to run this chip at 2mhz while using arduino or is there something specific about my setup.

bootloader version shouldn’t affect anything. The product page just says that ADABoot just a minor modification of the normal bootloader. If it works with ADABoot it should work with Optiboot.

Why are operating at 2 MHz anyway though? The chip can operate at 4 MHz all the way down to its minimum supply voltage (1.8V). I can think of why you would purposefully go lower.

My application is current limited, needed to pull as little power as possible. Did some testing that showed 2MHz was my sweet spot.

You could bootloading with Minicore.

It allows you to set the fuses for a wide range of settings.

Minicore only supports 2 MHz with the internal r/c clock.

Really? The link says it works at 2MHz with an external crystal.

The page says 8/4/2/1 MHz clocks are Internal oscillator. It’s in the big table of “Supported clock frequencies”

To answer your original question, since you have a modified boards file and you’re using dip package parts, buy yourself an Uno (if you don’t have one) and one of the programming shields on eBay, they’re under $10 with shipping.

Get your ATmega328 chips from DigiKey or Mouser. Pop the programmer on the Uno, blank, new chips go in the zif socket. You program the bootloader into the blank chip with the “Arduino as ISP” setting in the IDE.

Now your chip has a bootloader. Pop it into your custom board and download your sketch using your custom boards.txt file that has the adjusted baud rate.

Or, you can just burn your program into the chip directly and skip the bootloader altogether, unless your customer will be downloading a different program in the But, I doubt that will happen due to the clock speed.

eBay link: AVR ISP Shield Burning Burn Bootloader Programmer for Arduino UNO R3 | eBay