Go Down

Topic: Question on difference between bootloaders? (Read 6409 times) previous topic - next topic


I have a question on the difference of bootloaders available in the boards menu in the Arduino IDE.

What is the difference between the Lilypad w/328 bootloader choices? and the Arduino Pro/Pro-Mini w/328 bootloaders?

If you were building a custom board..


what bootloader would one choose?..and why?  (what questions or requirements dictate/suggest using one over another?)



8 MHz? internal or external?
16 MHz?
3.3V or 5V?

Really is just fuse settings & the serial port speed that will be used.
5V/16MHz, go with Uno.
3.3V/external 8MHz, go with 3.3V Promini
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


Apr 08, 2013, 10:44 pm Last Edit: Apr 08, 2013, 10:48 pm by xl97 Reason: 1

I suppose it doesnt matter?  (does the LilyPad bootloader mandate any one particular choice? but the more details the better!..sorry!)

Maybe a 'clearer' question (since most other bootloaders describe/state 16/8Mhz  and +5v/+3.v respectively)...  what 'requirements' does the LilyPad bootloader introduce?  Is that internal/external clock?  16 or 8Mhz?  +3.3v/+5v?,..since it doesnt stat in my booards menu in my IDE)

(but was trying to compare Lilypad vs Pro/Pro-mini)

Uno/Duemilanove is 16Mhz/+5v bootloaders..(specifically)

not clear why one would choose Lilypad?

but to answer the question(s), we'll say:    3.3V.  8MHz resonator

I assume Id just pick Pro/Pro-Mini +3.3v @ 8Mhz bootloader option but started to over think/question.



For 328-based Arduinos there are only two bootloader families: Optiboot (as used on the Uno) and ATmegaBOOT (as used on the Duemilanove).  Each must be compiled for the appropriate CPU frequency and desired upload baud-rate, so for each bootloader there are several different binaries made for different board characteristics.

The main difference between the two is size: Optiboot fits into 512 bytes whilst ATmegaBOOT occupies 2k.  Otherwise they do much the same thing.


OK...  thanks

I guess I wasnt using the correct terminology then..  :)

what is the difference between the board profiles (better? Im not sure how else to describe it then?) form the boards menu in the Arduino IDE of Lilypad and Pro/Pro-Mini?.

or more Direct.. why/when choose the Lilypad board profile? What benefits? What specs/requirements do you need to use Lilypad?  (+3.3v?  8Mhz?  Internal? External?)



Apr 08, 2013, 11:20 pm Last Edit: Apr 08, 2013, 11:26 pm by tim7 Reason: 1
Look in the boards.txt file in the hardware/arduino directory of the IDE.  In there you'll find all the relevant characteristics of each board.  Use http://www.engbedded.com/fusecalc to decode the fuse values.  The settings for the Lilypad328 and ProMini 8MHz are identical.  They both require an 8MHz external resonator/crystal, and use the ATmegaBOOT bootloader running at 57600 baud.  The software doesn't care about the voltage, but the 328p chip is specced to run ok at 8MHz at any voltage between 5.5V and 2.4V.


I've posted a summary of all the boards.txt as an excel file. Must have hid it well on my computer, can't find it now.
Will repost if I can.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


Otherwise they do much the same thing.

ATmegaBOOT supports EEPROM.  Optiboot doesn't (and in fact will do bad things if you try to write EEPROM using it.)



no rush!...  it was just one of those questions that popped into my head..

looked at the IDE a bit more.. and over 'thunk' it I guess..

just curious as to when I would ever 'choose' that option (Lilypad)

As far as the ATmegaBoot vs Optiloader..

(thats all a bit over my head)..

while I have loaded bootloaders using the IDE and Arduino as Programmer.. I have also used used the IDE and loaded Optiloader sketch and put Optiboot on some chips before as well

(did I phrase all correctly?)  :)

but to be honest I cant tell any difference or 'why' to use one over the other..

I dont believe I have ever done any 'EEPROM' writes in my code/projects yet.. 

(would that be to, for example, save some bits of data (locally in the chip) for when the power is gone...and to have it when power is restored/rebooted..etc)??

(if so,...I suppose I should go look it up, sounds useful)  :)



but to be honest I cant tell any difference or 'why' to use one over the other..

There are three reasons one might consider using Optiboot over the older bootloader for a 328P based board.

1. It has a smaller memory footprint so a little extra flash memory space for the sketch.
2. It uploads at twice the speed of the older standard bootloader.
3. It fixes a 'bug' in the older bootloader that didn't handle watch dog timer interrupts correctly.

I believe I've converted all my 328P based boards to Optiboot, including a Nano, a 2009, and a older RS-232 serial based 328P based board. So I always have to select the Uno board type before uploading to any of my 328P boards.



I also bootload all chips as Uno. Easy to remember that way. I've only used 3.3V/8MHz one time for remote control, the rest are all 16 MHz crystal based.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


Apr 09, 2013, 02:28 am Last Edit: Apr 09, 2013, 02:34 am by CrossRoads Reason: 1
Found the summary I was doing.

You can see I was toying with a new board type:
the existing 328 types with 20 IO
the existing 1284 types with 32 IO
a new 1281 type with 54 IO, "milliduino"
the existing 250 types with 86 IO

I should make one up & try it ...
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.


Apr 09, 2013, 04:55 pm Last Edit: Apr 09, 2013, 06:46 pm by xl97 Reason: 1
Thanks everyone!  (I'll check out attachment as well!) :)

couple questions...

1 technical and the other...opinion I guess..

Technical Question:

1.) I am trying to get the Arduino Pro/Pro-Mini bootloader (+3.3v @ 8Mhz external) w/ATmega328 on a blank ATMega329P-AU (TQFP SMD version of the chip)

(actually Im attempting this to help a buddy with his project...... his final PCB's -DID/DO NOT- have any ICSP header/pads broken out so Im attempting to try and put a bootloader on 'pre-assembly')

I need(ed) some sort of jig, so........

I have an item called: "the 1 inch square of goodness" board..  (ie: http://thecustomgeek.com/2012/07/09/one-square-inch-of-goodness/)

w/o the TQFP 328P-AU chip on it... so I can use it as a 'jig' of sorts.. to flash the bootloader to the chip(s)..and then start to soldering things together/re-flow..etc..

However...I noticed that this 1 inch square of goodness board has a 16Mhz crystal on-board...  (and I wanna flash/use the Pro/Pro-Mini 8Mhz bootloader)

Is there any solution to this?  (the end board the flashed chip is going into will have a 8Mhz resonator on-board/external)

Any other ideas on a 'jig' (or solution) to flash blank/standalone TQFP (32-pin) ATmega328P-AU chips?

What I did so far (just to ensure that this 1 inch square of goodness board was in working order, as it was sent to me with this other project stuff to help flash the chips) was to hook it all up...

Loaded Optiloader sketch to my Duemilanove..

then wired things up as so...

Arduino Duemilanove  >>>  1ISoG board

D13 >>> D13
D12 >>> D12
D11 >>> D11
D10 >>> RESET   (note the 1ISoG board does NOT have the reset pin broken out.. only DTR you have to shot the CAP or use the via next to it)
+5v >>> +5v

(120 Ohm resistor on Arduino Duemilanove board between RESET and +5v)

put blank chip on 1ISoG board...  and RESET board.. (running Optiloader sketch)..

found chip.. did its 'magic'.. and set-fuses..  all done.

started to blink PIN 13 led.. so I believe it all worked..

(however being that Optiloader is more of a 'auto' detect...right?  (Im not sure how once goes about 'setting' it for different clock speeds?).. Im assuming it just found a chip signature.. 'knew'??? it was set-up with a 16Mhz external crystal.... and then loaded the correct bootloader (fuse settings)??

hypothetical situation.. To use Optiloader to load a +3.3 / 8MHz bootloader (fuse settings).. Id need to have the blank chip set up in that simulated environment? (ie: the circuit would need to be laid out using an 8Mhz crystal or resonator....yes?)

Opinion Question:

I have mainly done +5v @ 16MHz boards..... and only done 1 x +3.3v / 8Mhz (internal) in my life... (and that was just recently)

this current project is just helping out friend......

that being said.. 'is' moving toward +3.3v based boards the trend? (future?)..  I see the Due...(and others).. as well as a slew of components and sensors that are mostly +3.3v compliant..

Is that something a noob like myself should be focusing on?..  (I have no background on the Due really...but would like to think the DAC will be used for audio output..and change things up a bit when they become more common)?  

Or is +5v stuff 'here to stay' (so to speak)..and this is just another 'branch' to fill a need?



If you have Optiboot running properly at 16MHz then you can run it at 8MHz with no modifications.  There is no pre-existing definition in the Arduino IDE for a board with Optiboot at 8MHz, but it's easy to add one:  Find the boards.txt file and duplicate the uno definition (the first block of text).  Change the uno prefix in the duplicated text to something else, change upload.speed to 57600, change f_cpu to 8000000L, and change name to something else.

Likewise you can burn a bootloader binary made for an 8MHz board onto a chip running at 16MHz.  To test it with the 16MHz crystal you just need to upload at twice the normal baud, and to do that you make a new entry in boards.txt as described above.

ATmegaBOOT supports EEPROM.

Cool.  I didn't know that.


that being said.. 'is' moving toward +3.3v based boards the trend? (future?)..


Go Up