Pages: [1] 2   Go Down
Author Topic: Why do a lot of people want to burn bootloaders into chips?  (Read 1825 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 50
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As a 2 month newbie, I've bought a Uno, made a little project and transfered it (with a LOT of help from you all smiley ) to standalone hardware (just an ATMega328P with xtal,7805 regulator and the few capacitors needed plus the bits needed for my project)

My standalone doesn't (appears not to anyway) need the bootloader to run my sketch.  I can upload my sketch using my original Uno or via a £5 USB programmer.

So, why do lots of other people want/need a bootloader for their projects?

regards

Simon
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 517
Posts: 26282
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Makes test/troubleshoot easier.
Keep serial port connected for test messages. Find an error, fix it, download, all while keeping everything plugged in place.
When all done, pull the chip & plug it into the standaloe project.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 50
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Find an error, fix it, download, all while keeping everything plugged in place.
Now, if you were plugged into the final hardware then this makes a lot of sense for testing and debugging

Quote
When all done, pull the chip & plug it into the standalone project.
But your not are you smiley

So why not just upload your final sketches to the standalone (non-bootloaded chip) project when its working smiley
(I'm sure that your method is good for some things but I'm wondering if people are spending time loading bootloaders when all they really need is to set the fuses to get their clock speeds right smiley )

Simon
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 223
Posts: 6593
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

So why not just upload your final sketches to the standalone (non-bootloaded chip) project when its working smiley
(I'm sure that your method is good for some things but I'm wondering if people are spending time loading bootloaders when all they really need is to set the fuses to get their clock speeds right smiley )

That's exactly what I do, see http://miscsolutions.wordpress.com/2011/08/09/prototyping-small-embedded-projects-with-arduino/. Having a bootloader installed on the final system increases startup time, and if you are using the internal clock then it probably won't work anyway because the baud rate will not be accurate enough. However, if your hardware need a serial port anyway, then you could argue that including the bootloader makes reprogramming it easier.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17259
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Different strokes for different folks. The main thing is that there are several ways to migrate from using a arduino board as a prototyping/testing platform and then transferring the development effort over to a standalone project.

 That is I feel the the biggest advantage of the Arduino 'system' has over any other development system I have seen or read about, easy transferal to the minimum circuitry required for any given project. That and the fact that the avr chips are still avalible in DIP packages makes it a very hobby friendly effort compared to most other 'platforms'.

Lefty
Logged

Dallas, Texas
Offline Offline
God Member
*****
Karma: 0
Posts: 861
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm repurposing a weather station that has an ATmega8 chip. I wanted to program the boot loader into it so that I can develop the new software directly on the hardware it will run on. When I get done, I'll flash the chip through ISP and lose the boot loader. I realize I could use ISP during that whole process but I prefer working in the Arduino IDE instead of in the gcc command line environment. Like retrolefty says, different strokes.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 597
Posts: 33292
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
o why not just upload your final sketches to the standalone (non-bootloaded chip) project when its working
Because sometimes you have surrounded your stand alone system with all sorts of hardware. You don't know if it is right unless you have this hardware. You have built this properly and it is not that easy to connect that hardware into a standard arduino. In fact most of my projects go straight to standalone and never see a "conventional" arduino board.
Logged

Humboldt, CA
Offline Offline
Full Member
***
Karma: 2
Posts: 223
Arduino BBB
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I sometimes skip the bootloader entirely, I have the FTDI hooked up for serial debugging and program via USBtinyISP.  It's great, no automatic closure of the serial monitor window and no reseting the Arduino when I open said window!
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 50
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I wanted to program the boot loader into it so that I can develop the new software directly on the hardware it will run on.

I can see if your developing like that and need to access the serial port for debugging info via FTDI connections then that's a very good reason.

Quote
but I prefer working in the Arduino IDE instead of in the gcc command line environment.

Who doesn't! ... but the only time a command line is needed is to set the fuses - after that its IDE all the way smiley  I'm thinking that what's needed is an option in the IDE to just set the fuses to the same settings as they would be if you'd burned the bootloader for your device.
But then, there would just be lots of posts asking how to burn the fuses so no real gain smiley
So I've probably got the answer to the question smiley

Simon






Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 124
Posts: 6634
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
or via a £5 USB programmer.
The quick answer is that USB programmers are traditionally more expensive than that, and significantly more difficult to use.  An Arduino is essentially  a $10 microcontroller with a $10 USB interface that service double purpose: communications AND program loading.  Adding a $10 programmer is a 33% cost increase... (those are sorta "wholesale" costs...)

It might have been an interesting idea on Uno-class boards (with a programmable USB controller) to have the USB controller double as an actual programmer, but that's not what happened...
Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 63
Posts: 2636
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
or via a £5 USB programmer.
The quick answer is that USB programmers are traditionally more expensive than that, and significantly more difficult to use.  An Arduino is essentially  a $10 microcontroller with a $10 USB interface that service double purpose: communications AND program loading.  Adding a $10 programmer is a 33% cost increase... (those are sorta "wholesale" costs...)

Recently, the cost of USB programmers has really dropped,
these days, you can find USBASP programmers on EBAY for under $5 USD all day long.
In fact it has reached such a commodity level that you can now even get USBASP programmers in fancy "pretty"/"cool" colored
cases for about $10 USD.
http://www.ebay.com/itm/USBASP-ISP-Download-Programmer-Adapter-51-AVR-MCU-/150657060031?pt=LH_DefaultDomain_0&hash=item2313dc4cbf

These low cost programmers can work with the Arduino IDE with a few modifications
to a couple of control files so ease of use is the same once the control files have been updated.

What is somewhat ironic is that these days the USB to serial interface/cable costs more than a low cost  USB ISP programmer.

But as far as overall cost goes, if you use "arduino"
boards that don't have the USB to serial interface on them because USB communication/data connectivity
is not needed for final operation, the cost of a USB to serial
device/cable (for debugging) and a USB programmer for programming can be divided across all your boards to give
a lower overall cost per board/project with savings starting after about the 2nd board/project vs something
like the UNO board.
So in some situations using a USB programmer can be cheaper
than using a USB to serial interface for uploading via bootloader.

One area where I think a bootloader makes the most sense is on the AT90/32U4 series AVRs
like the Teensy boards.
In that case, by having a USB based bootloader, you can completely eliminate the cost of both
the USB to serial device/cable and the USB programmer since it has USB support built right in to the AVR.


---bill

Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17259
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
What is somewhat ironic is that these days the USB to serial interface/cable costs more than a low cost  USB ISP programmer.

As long as you are allowing for using E-bay as a market place, I'm not so sure your statement hold true.


http://www.ebay.com/itm/370532286388?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649

Lefty
Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 63
Posts: 2636
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You absolutely correct about the costs of the standalone USB to serial devices available now.
I overstated things a bit. (I am a bit surprised that the standard FTDI cables still go for about $20 though)
I was mainly comparing the costs of using a USB based ISP programmer without
using a bootloader to using an "UNO" type board or one with with the USB to serial built in
which makes using a separate programmer more expensive than using a bootloader.

There are some great low cost USB to Serial boards out there. I've actually looked
at that one. While usable, it is unfortunate that they didn't use the FTDI pinout -
it would have made it a direct drop in for the Arduino crowd.

--- bill
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17259
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
There are some great low cost USB to Serial boards out there. I've actually looked
at that one. While usable, it is unfortunate that they didn't use the FTDI pinout -
it would have made it a direct drop in for the Arduino crowd.

Yes a different pin order would have been sweet. I bought it (actually 3 now) because it's so easy to mod for the arduino auto-reset function. Just solder a .1 cap from the DTR hole pad to the base of the RST connector pin, turn the board over and cut the trace that was going to the RST pin, and you gain arduino auto-reset.

I bought a USBtiny programmer kit for $19 about two years ago, works great with the arduino IDE or standalone with AVRDUDE, so I know about 'bootloaderless' arduino possibilities. It's great having the flexibility and choices that the arduino platform allows. It's a real testament to it's open source roots.


Lefty
« Last Edit: September 09, 2011, 07:53:12 pm by retrolefty » Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 517
Posts: 26282
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The pinout is easy to change with an adapter cable - and some even ship with 5 single female-female terminated wires to do that.

I think having  some of these handy is very worthwhile  - especially for putting together a permanent adapter to plug onto something, the ICSP header for example:

http://www.pololu.com/catalog/category/70
http://www.pololu.com/catalog/category/72
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1] 2   Go Up
Jump to: