Question on difference between bootloaders?

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.

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.)

thanks!

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?) :slight_smile:

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) :slight_smile:

thanks

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.

Lefty

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.

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 ...

chip comparison.xls (56 KB)

Thanks everyone! (I'll check out attachment as well!) :slight_smile:

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: One Square Inch of Goodness | The Custom Geek)

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
GND >>> GND

(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?

thanks!

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.

westfw:
ATmegaBOOT supports EEPROM.

Cool. I didn't know that.

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

Yes.

Thanks for the reply.

Im not sure I understand 100%.. so let me try to regurgitate it back to you and see what Im missing here.. :slight_smile:

1.) because I successfully flashed Optiboot (using the Otiloader sketch.. that auto detects chip signature) in a jig/circuit that was set-up with 16MHz external crystal,..... I can just take that chip out.. and pop it into the 'final' circuit that is set-up to use an 8MHz external resonator.. and have ZERO problems? side effects?......nothing??

2.) There is no 'pre-existing' entry in the boards menu in the Arduino IDE for ANYTHING Optiboot related? 16Mhz or 8Mhz??
(kinda lost on that one I guess?)

I think there is actually 2 piece of info there that are useful (even if not usable currently) from the rest of you post:

A.)

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.

I would do/follow the above process if:
i.) I had an 8Mhz set-up (including crystal/resonator).. and wanted to flash Optiboot bootloader to a blank chip that is intended to run @ +3.3v & 8Mhz clock....yes?

(because Optiboot doesnt by default have a 8Mhz entry to use/burn)... correct?

B.)

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.

now this seems like an answer to addresses my current situation/problem...(correct?)

I would do/follow the above process if: (like my current situation)
i.) I have a 16Mhz set-up for FLASHING the BOOTLOADER to the chip.. but in the end the FINAL circuit the chip will go into is a 8Mhz set-up?

So if I was to follow the above..

I would be making 2 NEW bootloader entries:

1.) 8Mhz >> 8Mhz Optiboot

and a

2.) 16Mhz >> 8Mhz Optiboot

entry.......yes?

and in theory.. (taking this another step)..

if my flashing/bootloader 'jig' was ONLY set-up as a 8Mhz set-up.... but the target chip was eventually going to go into a 16Mhz set-up..

I could make another (3rd) entry..

3.) 8Mhz >> 16Mhz Optiboot..

(or can you NOT be compatible that way? 8Mhz to 16Mhz?)

am I following you correctly so far?

And all this is done by duplicating the UNO (Optiboot) entry and renaming, and changing the upload rate?

and again.. no side-effects/problems flashing in one environment and using in another?

so giving it a try:.

here are my two new BOARDS.txt entries..

1 x straight 8Mhz (flashed in 8MHz circuit and used in final 8MHz circuit)
1 x 16Mhz to 8Mhz (flashed in 16MHz circuit and used in final 8MHz circuit)

optiboot_8MHz.name=Optiboot @ 8MHz
optiboot_8MHz.upload.protocol=arduino
optiboot_8MHz.upload.maximum_size=32256
optiboot_8MHz.upload.speed=57600
optiboot_8MHz.bootloader.low_fuses=0xff
optiboot_8MHz.bootloader.high_fuses=0xde
optiboot_8MHz.bootloader.extended_fuses=0x05
optiboot_8MHz.bootloader.path=optiboot
optiboot_8MHz.bootloader.file=optiboot_atmega328.hex
optiboot_8MHz.bootloader.unlock_bits=0x3F
optiboot_8MHz.bootloader.lock_bits=0x0F
optiboot_8MHz.build.mcu=atmega328p
optiboot_8MHz.build.f_cpu=8000000L
optiboot_8MHz.build.core=arduino
optiboot_8MHz.build.variant=standard

optiboot_16-8MHz.name=Optiboot 16MHz >> 8MHz
optiboot_16-8MHz.upload.protocol=arduino
optiboot_16-8MHz.upload.maximum_size=32256
optiboot_16-8MHz.upload.speed=115200
optiboot_16-8MHz.bootloader.low_fuses=0xff
optiboot_16-8MHz.bootloader.high_fuses=0xde
optiboot_16-8MHz.bootloader.extended_fuses=0x05
optiboot_16-8MHz.bootloader.path=optiboot
optiboot_16-8MHz.bootloader.file=optiboot_atmega328.hex
optiboot_16-8MHz.bootloader.unlock_bits=0x3F
optiboot_16-8MHz.bootloader.lock_bits=0x0F
optiboot_16-8MHz.build.mcu=atmega328p
optiboot_16-8MHz.build.f_cpu=8000000L
optiboot_16-8MHz.build.core=arduino
optiboot_16-8MHz.build.variant=standard

thanks!

@pito-

thanks for reply too! :slight_smile:

optiboot_16-8MHz.upload.speed=115200

You cannot run 115k2 upload with 8MHz clock reliably. The max recommended is 57k6..

xl97:
1.) because I successfully flashed Optiboot (using the Otiloader sketch.. that auto detects chip signature) in a jig/circuit that was set-up with 16MHz external crystal,..... I can just take that chip out.. and pop it into the 'final' circuit that is set-up to use an 8MHz external resonator.. and have ZERO problems? side effects?......nothing??

That's right. The only extra thing you'll have to do is add an extra entry in boards.txt. You have installed an Optiboot binary which is made for running at 16MHz. It will still run at 8MHz, but at half the speed. The only change you have to make is ensure that the communications coming from your PC are also running at half the normal speed.

2.) There is no 'pre-existing' entry in the boards menu in the Arduino IDE for ANYTHING Optiboot related? 16Mhz or 8Mhz??

No, that's not right. The Uno, the Arduino Mini, and the Arduino Ethernet all use Optiboot at 16MHz.

now this seems like an answer to addresses my current situation/problem...(correct?)

I'm not quite sure that your current problem is. If you've got Optiboot running, isn't that enough?

pito:

optiboot_16-8MHz.upload.speed=115200

You cannot run 115k2 upload with 8MHz clock reliably. The max recommended is 57k6..

thanks.

so then what wold be the difference between the two?? (none?)

  1. if you flash an "optiboot for 8MHz and 57k6" and run the chip @16MHz the upload baudrate will be 115k2 - ok
  2. if you flash an "optiboot for 16MHz and 115k2" and run the chip @8MHz the upload baudrate will be 57k6 - ok

tim7:

xl97:
1.) because I successfully flashed Optiboot (using the Otiloader sketch.. that auto detects chip signature) in a jig/circuit that was set-up with 16MHz external crystal,..... I can just take that chip out.. and pop it into the 'final' circuit that is set-up to use an 8MHz external resonator.. and have ZERO problems? side effects?......nothing??

That's right. The only extra thing you'll have to do is add an extra entry in boards.txt. You have installed an Optiboot binary which is made for running at 16MHz. It will still run at 8MHz, but at half the speed. The only change you have to make is ensure that the communications coming from your PC are also running at half the normal speed.

2.) There is no 'pre-existing' entry in the boards menu in the Arduino IDE for ANYTHING Optiboot related? 16Mhz or 8Mhz??

No, that's not right. The Uno, the Arduino Mini, and the Arduino Ethernet all use Optiboot at 16MHz.

now this seems like an answer to addresses my current situation/problem...(correct?)

I'm not quite sure that your current problem is. If you've got Optiboot running, isn't that enough?

sorry..

I suppose I wasnt clear enough..

I understand that the UNO uses the Optiboot bootloader..

I guess meant it more as there are no entries that are labeled as Optiboot.. in ANY flavor.. (they are named Uno, ..etc)

As far as the current problem..

  • I have blank ATmega328P-AU (smd) chips I need to flash

  • the END/FINAL pcb they will be going into is an 8Mhz external resonator circuit..

  • the END/FINAL pcb has NO ICSP headers/pins broken out to flash AFTER being assembled.

  • I have a 'TEST JIG' that I can use to flash bootloaders onto these BLANK ATmega 328P-AU chips BEFORE they get assembled into the (final/target) 8MHz external resonator pcb

  • The FLASHING 'TEST JIG' I have is that 1ISoG board I linked to above.. it is set-up with a 16MHz external crystal.

thats the current situation/problem that prompted this.

I have what I believe to be a FLASHED chip with Optiboot on it. Since it 'auto detects' the chip signature.. and there is no 8Mhz version.. (and you cant choose anyways.. Optiloader just 'goes'..and runs when a chip is detected)... this chip is set-up to use 16Mhz.

which Im assuming will NOT work in the final/target board that is set up with an 8MHz external resonator..

So no.. I dont believe just because Optiboot is running that is enough.

I need tp ensure that even though Im using a 16MHZ based circuit to FLASH the bootloader with.. there will be NO side effects with that chip being used in the final 8MHZ circuit.

So I created those two 'new' entries.. (& apparently one is wrong) LOL...

and at this point.. Im still confused??

thanks

"Flashing a chip" and "running a bootloader" are two different instances. You may flash a chip with "any recommended crystal value" connected to it, afaik (provided you are using a standard programming method).

CrossRoads:
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 ...

Good chart, lots of info and takes a bit to digest.
Flash is there, needs a column for Ram and EEprom.

xl97:
I have what I believe to be a FLASHED chip with Optiboot on it. Since it 'auto detects' the chip signature.. and there is no 8Mhz version.. (and you cant choose anyways.. Optiloader just 'goes'..and runs when a chip is detected)... this chip is set-up to use 16Mhz.

which Im assuming will NOT work in the final/target board that is set up with an 8MHz external resonator..

It will work. Trust me. The bootloader will run at half the normal speed, but that's just fine. Once the bootloader has finished running it passes control to your sketch, which will run at the speed you expect just the same as on any other 8MHz board.

You could recompile Optiboot for an 8MHz processor. You will find (I've tried it) that at 8MHz the "normal" baud rate of 115200 is unreliable, so you'll need to slow it down to 57600. But now the 8MHz version of Optiboot is (aside from some very minor cosmetic issues) exactly the same as the 16MHz version. The instructions to communicate at 115200 baud, if carried out at half speed, correspond precisely to 57600 baud.

The only problem you have is that there is no standard Arduino which uses Optiboot at 8MHz, and that means that you cannot use one of the existing definitions in boards.txt. But that's very easily overcome, as described above. If you really really do not want to alter boards.txt, then you'll need to start over (although the 16MHz jig will still be ok).

pito:

  1. if you flash an "optiboot for 8MHz and 57k6" and run the chip @16MHz the upload baudrate will be 115k2 - ok
  2. if you flash an "optiboot for 16MHz and 115k2" and run the chip @8MHz the upload baudrate will be 57k6 - ok

ok.. (Im trying here.. bear with me) :slight_smile:

I want to use an 8MHz Optiboot bootloader ON an 8MHz board.. (but I only have a 16MHz board that I can FLASH the chip with)

So if I use 16MHz board JUST TO FLASH THE BLANK CHIP.... that is intended to be used with a FINAL 8MHz pcb/board..

I would create this entry:

optiboot_8MHz.name=Optiboot @ 8MHz
optiboot_8MHz.upload.protocol=arduino
optiboot_8MHz.upload.maximum_size=32256
optiboot_8MHz.upload.speed=57600
optiboot_8MHz.bootloader.low_fuses=0xff
optiboot_8MHz.bootloader.high_fuses=0xde
optiboot_8MHz.bootloader.extended_fuses=0x05
optiboot_8MHz.bootloader.path=optiboot
optiboot_8MHz.bootloader.file=optiboot_atmega328.hex
optiboot_8MHz.bootloader.unlock_bits=0x3F
optiboot_8MHz.bootloader.lock_bits=0x0F
optiboot_8MHz.build.mcu=atmega328p
optiboot_8MHz.build.f_cpu=8000000L
optiboot_8MHz.build.core=arduino
optiboot_8MHz.build.variant=standard

correct?

Im still not clear on the different BOARD entries I would make then to fill these needs (out of curiosity)

ALL OF THE BELOW WOULD BE A 8MHz based Optiboot bootloader

8MHz board to FLASH with >>> 8MHz final circuit // same as above posted? no difference?
16MHz board to FLASH with >>> 8MHz final circuit // same as above posted? no difference?

As mentioned in a prior post here..

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.

if I wanted to take my 8MHz bootloader.. take my 16MHz hardware.. and flash it to a blank chip..

if I wanted to 'test' that chip.. Id need to also do something different?

Im open to whatever.. (with-in reason!) :slight_smile:

I made two board entries for review.. I would have added them if 'signed-off' on as being OK. :slight_smile:

Im trying to grasp it all!..

and get a true understanding (as well as?) instead of just following blindly.

(maybe I shouldnt even be asking this..LOL)..

but lets take OPTIBOOT out of the equation (even though its a better bootloader that many prefer)..

and go back to the plain old Ardiuno IDE.. and using Arduino as programmer option for a second..

I have my Arduino Duemilanove wired up to the 1ISoG board.. (!ISoG = the 16MHz jig, hardware/board)..

I flash Duemilanove with the Arduino as ISP sketch.. ...wire up board..

make sure com port is right... choose - Arduino Pro/Pro-Mini @+3.3v & 8MHz entry from BOARDS menu..

and then choose BURN BOOTLOADER..

results?

Pito made reference to what may be my problem/hang-up on understanding..

flashing the bootloader to a chip != running a bootloader at specific clock speed?

If the external clock/resonator on the board used ONLY to flash the bootloader with ISNT a concern/issue..

then maybe excluding Optiboot (for now) is better, more clear?