I have an Arduino Duemilanove which I'm really enjoying playing around with but there is something that is bugging me.
Would someone mind explaining to me what advantage the Arduino Bootloader has over ICSP.
I think I understand what the bootloader does and how it does it. Can someone read through my understanding and correct me if I am wrong: -
I believe when the Arduino boots up / is reset a piece of code called a bootloader spends a couple of seconds waiting for a signal that a new sketch is going to be uploaded over the serial TX pins.
If said signal is received it overwrite any existing sketch before running it however if no signal is present it jumps to the existing onboard sketch and runs it.
I have a little experience with PICs and I thought ICSP did pretty much the same thing so what's the advantage?
I keep reading that its quicker to use the bootloader and you don't need an external programmer.
What is special about an external programmer that the Arduino board does not have?
I just though an external programmer was a USB to Serial adapter with level shifting and I thought this was how the Arduino worked anyway to receive the sketch?
I have searched the forums and Google for the past couple of hours to try and get a clear understanding but I can't seem to get a definitive answer.
Any help or advice would be appreciated.
Your description of the bootloader is just about right.
ICSP is a different way of putting code into flash.
It doesn’t rely on any software being on the chip already, but uses dedicated pins to pass data into the MCU to be written.
That’s how the bootloader gets there, among other things.
It is easier to use the bootloader, generally, but it is slower than ICSP, and has the other side-effect that some of the flash is occupied by the bootloader.
The external programmers are not simply USB<->Serial level shifting adapters, although some boards have a connector on them to allow FTDI type cables to work where the board has no USB built in (such as the boarduino).
Does that help?
Looking at the ICSP pin out (6 pin version) I can see a Serial In, Serial Out, Clock, Reset, Power and Ground.
If I wanted to program a blank AVR (no bootloader) on a breadboard, can I just use one of these FTDI cables to program a raw hex file?
I think I am understanding the whole concept a a little better now, it sounds like the Arduino simplifies the who procedure of uploading code without the user having to worry about hex files, fuse settings and programmers etc.
Now I have built and tested my prototype I want to build a working circuit using minimal components hence I will need to use ICSP so I have remove the bootloader and upload new revisions of my code as required.
I was more familiar with the PIC's where I could write my code, compile into a hex and then upload using a USB to ICSP programmer (PICKit2).
the lines on the ISP are connected to the arduino SPI lines, dont think you can just plug it into a level converter and go
but you can use an arduino as a isp programmer, look up megaisp or adruinoisp
If you operate in a mobile environment, out on site, in the rain, down a hole or in the dark with a torch held in between your teeth, then one less piece of kit to carry around makes a lot of sense. Just plugging in a usb cable is perfect.
One thing to be careful of with the ICSP is the loading on the MOSI, MISO
and SCLK lines. If you load these lines too heavily the ICSP programmer
may not have sufficient output drive to change the state.
I usually connect the MOSI, MISO, SCLK lines directly to the ICSP header.
If there is application circuitry that uses these lines I use a 10K series
resistor between each SPI line and the application circuit.
(* jcl *)
I think everyone is overlooking the obvious: with the Arduino/serial bootloader model,
you don't have to [u]buy[/u] the programmer!
This is especially attractive for noobs, broke students (is that redundant?), etc.
Cheers for the input guys.
I use both, serial uploading and ICSP, depending on my needs.
Generaly I think it's more simple to use just USB cable. But when in need of space, it's nesecary to use ICSP. I also wrote an "extra board" in my boards file as described here, so I only change the board, when I want to use ICSP.