What Are The Pros And Cons Of Not Using The Arduino Bootloader

tigerbomb8:
What Are The Pros And Cons Of Not Using The Arduino Bootloader. i have been searching and cant find out what is better bootloader or no bootloader.

To bootload or to not bootload.... that is the question

Pros for not using the bootloader: Lots.
Cons: None that I can think of (except you need to buy an ISP programmer, obviously)

Well, OK, there's one con: Using an ISP programmer means you can write a sketch so big that other people with bootloaders won't be able to use it.

Unless you buy a more advanced processor, more memory, more eeprom, etc.....

As handy as programming via usb cable and a button on the IDE is, I don't see how one would take the Arduinity out of Arduino. But hey, I'm a (very) lazy software guy after all... :stuck_out_tongue_winking_eye:

tuxduino:
As handy as programming via usb cable and a button on the IDE is, I don't see how one would take the Arduinity out of Arduino. But hey, I'm a (very) lazy software guy after all... :stuck_out_tongue_winking_eye:

I program via a USB cable and a button on the IDE all the time without using the bootloader. You do not have any reset or DTR issues to deal with. You can connect chatty devices to the hardware serial port without confusing the bootloader. Whatever your final design is a programming port is just about mandatory a serial port not so much.

Be picky on what you choose as a programmer, there are a few nice home brew ones that also provide ttl serial and GPIO's (to the USB attached PC). There weakness is no high voltage programming to clear problematic fuses and the like.

In my definition of "handy" I also include the fact that I just need a USB cable and nothing else. But I agree that a good (in your sense) programmer is a one-time purchase, i.e. a one-time "inconvenience".

Thanks for clarifying things a bit for me :slight_smile:

I picked up one of those USB-ASP jobbies off ebay for a couple of dollars, and been using it to program ATMEGA8's. Since I chose to use the chip config which utilizes the internal oscillator instead of a crystal, that also reduces the cost and complexity of the build to the chip plus two caps. Since I am just building color mixing PWM controllers for RGB LED strips with them, the program being used is quite small, so even the 8k of the ATMEGA8 is overkill-- but since all I really need is 3 analog inputs (pots for colors) and 3 digital outputs (PWM) the ATMEGA8, costing $1.20 each shipped, is a great choice and still supports almost all Arduino functionality. If we say that the caps are ten cents a pop, we are still under a dollar and a half FOR THE WHOLE BUILD!

Running from internal clocks there is some speed drift, but if all you are doing is mixing PWM-- who cares? Now, sure I could build a PWM system from 555's, but unlike a 555 based "dumb" fader, my fader has setting memories, patterns, and might actually be cheaper than a "simple" timer based solution. It certainly is less complex to physicially build- a part count of THREE is hard to beat.

If I were to use a bootloader, there would be a boot wait while waiting for a signal on the serial port.. without a bootloader, it runs immediately without any of that delay- another consideration.

So I'd say that you should try it. It allows you more design flexibility by allowing you to choose a processor which fits your needs, removes the boot delay, and also teaches you a new way to talk to the processor. Learning new stuff to mess with is always amusing and leads to new ideas.

Now that the ATMEGA prices are reaching such low points, I'll be building all sorts of nonsense.. and not bothering to make reusable shields when the headers are more expensive than just committing a whole MCU to a build..

focalist:
If I were to use a bootloader, there would be a boot wait while waiting for a signal on the serial port.. without a bootloader, it runs immediately without any of that delay- another consideration.

Well, that isn't entirely true - I've been using a variant of optiboot that only pauses after a reset, on cold boot it starts immediately. It's weird going back to my stock Arduino and re-discovering the cold boot delay. But it is nice flashing my in-circuit ATtiny85 projects just by hitting the upload button and having it start immediately after flashing.

Now that the ATMEGA prices are reaching such low points, I'll be building all sorts of nonsense.. and not bothering to make reusable shields when the headers are more expensive than just committing a whole MCU to a build..

You're telling me - I was recently tempted by an auction of ATmega8's on eBay that was on the close order of a buck a chip delivered. That's cheaper than I'm getting ATtiny85's! More GPIO, same flash and memory, same basic level of avr-gcc support, the only thing that stopped me was my overflowing bin of parts I've accumulated.

In theory, there shouldn't be much difference.

In reality, the "device programmer" needed to program a chip without a bootloader has historically been a major stumbling block standing in the way of users trying to use microcontrollers. Often proprietary and used with complex host-side software, often limited in their support of alternate operating systems, and often (significantly) more expensive than an Arduino itself. And subject to certain target-bricking errors (like setting the fuses wrong) that are not possible to make when using a bootloader.

The forums are full of people who have been unable to get device programming to work, even to the extent necessary to burn the bootloader into new AVR devices. Non-arduino forums have people complaining about having to switch firmware in their (official Atmel) programmers depending on the version of AVRStudio they're running, or if they're using linux instead of Windows. And complaints of sketchy but cheap programmers from eBay that may or may not work. And weird behavior when trying to program chips with large flash (mega2560.)

I mean... it's not THAT difficult to skip the bootloader and use an external programmer. But it's a lot harder than just using the bootloader.

(that said, the state of AVR programming using alternate tools is "pretty good." There are inexpensive programmers that are known to work well that are specifically aimed at the hobbyist community, and there is a lot of support.)

The forums are full of people...

I think most of that is exaggerated and can be said about arduino and any other systems too.

Arduino's value-add is that it has significantly lowered the threshold to get into mcu programming and flattened the learning curve substantially. You don't need to read a datasheet to get a major function working, etc. So buying an arduino and striping it the arduino stuff doesn't make a lot of sense to me.

I would also point out the downside of that value-add: people don't read the datasheet and rely too heavily on the arduino library.

people don't read the datasheet and rely too heavily on the arduino library.

And then come here asking questions about the things that are in the datasheets* :stuck_out_tongue:

Seriously, though, the beauty of Arduino is it doesn't prevent you from diving into direct port and register manipulation, but it doesn't force you to learn that stuff unless you feel you need it or want to learn it.

  • I might be one of those :stuck_out_tongue:

the beauty of Arduino is...

Absolutely. that optionality is quite valuable and that's why you pay more for an arduino than a bare chip.

Well, yeah. It depends on how much you know and how much you're willing to figure out.
If you've been using AVRStudio for years and are only looking at Arduino because it's a cheap and easy-to-get eval board, then there's no particular advantage to using the bootloader.
If you're expecting to get your external programmer working with no bootloader by reading the one-sentence description of "use shift-upload to upload your sketch using an external programmer", then perhaps you should reconsider using the bootloader after all.

The number of people who have tried to bootloader programmer to work with long wires leading to their protoboard avr with only half its power pins connected and no bypass caps and no clock circuitry and no tools has been a bit ... impressive. You want to say things like "you can probably connect an external clock signal and reprogram the fuses to unbrick your chip", and you realize that that's just not going to help any without step-by-step pictures or video or something. And that's OK, because this is the target audience for Arduino, and some of those people go on to create project of jaw-droppingly clever beauty.

But to say that "there are no cons to not using the bootloader" is just ... wrong.

"you can probably connect an external clock signal and reprogram the fuses to unbrick your chip"

I would have said "put your fingers on the oscillator pins ...", :slight_smile:

Agree with you. There are two sides to any coin.

And the finger on the oscillator pins trick does work.

And the finger on the oscillator pins trick does work.

Really? Regardless of the SPI frequency of the programmer?

thanks for the information guys/gals. it looks like i will stick with the bootloader.
i already have a shield for programing attinys so i can add a spot for the atmega328 and burn the bootloader my self. that will save me a couple of $$

focalist:
I picked up one of those USB-ASP jobbies off ebay for a couple of dollars, and been using it to program ATMEGA8's. Since I chose to use the chip config which utilizes the internal oscillator instead of a crystal, that also reduces the cost and complexity of the build to the chip plus two caps.

Me too. I just got a TLC5940 hooked up to an ATtiny85. No problem.

PS: Two caps? What's the other one for? I heard a pull-up resistor on the reset was a good idea, although they have one built in so I'm a bit confused.

pfriedel:
You're telling me - I was recently tempted by an auction of ATmega8's on eBay that was on the close order of a buck a chip delivered. That's cheaper than I'm getting ATtiny85's! More GPIO, same flash and memory, same basic level of avr-gcc support, the only thing that stopped me was my overflowing bin of parts I've accumulated.

I was looking on Farnell last week and ATtiny84s are 94 Eurocents each in quantities of ten.

tigerbomb8:
To bootload or to not bootload.... that is the question

The bootloader is great when you are developing on a real Arduino. You can use the same USB cable for loading the program and for the serial monitor.

However, when I take a design I have prototyped on the Arduino and build it on a dedicated board, I always include a 6-pin ICSP header on the board so that I can program it directly, and I don't program a bootloader into the mcu.

I heard a pull-up resistor on the reset was a good idea, although they have one built in so I'm a bit confused.

See pages 4 & 5

AtmelAVR042 AVR Design Considerations.pdf (236 KB)