With the old 002x IDE, I always used an FTDI cable to upload code to an Arduino clone. I'd first burn the bootloader through Arduino ISP (using an Uno) and then proceed to upload sketches via FTDI (different com port). However with 1.0.1, there's the option to 'Upload using Programmer' (holding shift key down) and it sends the code to the clone (via ArduinoISP). However, I noticed a difference:
When I upload via FTDI, the clone takes a few seconds after a reset to start the sketch.
When I upload using programmer mode, the sketch starts immediately after a reset (which I liketh a lot.)
KirAsh4:
With the old 002x IDE, I always used an FTDI cable to upload code to an Arduino clone. I'd first burn the bootloader through Arduino ISP (using an Uno) and then proceed to upload sketches via FTDI (different com port). However with 1.0.1, there's the option to 'Upload using Programmer' (holding shift key down) and it sends the code to the clone (via ArduinoISP). However, I noticed a difference:
When I upload via FTDI, the clone takes a few seconds after a reset to start the sketch.
When I upload using programmer mode, the sketch starts immediately after a reset (which I liketh a lot.)
Why's that?
It's because the bootloader waits a while to see if the IDE is trying to upload a new sketch or not. After the time out the bootloader jumps to the users sketch assuming there is one to run from a prior upload. When using ICSP the bootloader gets erased and only the sketch gets loaded into the flash memory which then runs as soon as the chip is powered up or a reset is issued.
Now that the IDE supports upload using programmer option that is a very viable method to use for the reason you stated and getting back the small amount of flash space that the bootloader takes. Either way having a choice is great.
Soooo that means if after I upload a sketch using the programmer option, I want to switch to FTDI, that would require re-burning of the bootloader, correct?
Hmm ... this poses an interesting challenge. The code I just discovered which would work great for me, requires those few seconds to listen for serial data. If I blow away the bootloader, "I be skrewed!"
KirAsh4:
Soooo that means if after I upload a sketch using the programmer option, I want to switch to FTDI, that would require re-burning of the bootloader, correct?
Correct bootloader is gone. But the FTDI is still functional for performing serial comm to the IDE serial monitor or a PC app.
Hmm ... this poses an interesting challenge. The code I just discovered which would work great for me, requires those few seconds to listen for serial data. If I blow away the bootloader, "I be skrewed!"
Are you sure, what code are you speaking of?
Lefty
retrolefty:
Correct bootloader is gone. But the FTDI is still functional for performing serial comm to the IDE serial monitor or a PC app.
Not on the clones I'm making. They're minimalist 328p with a few pins broken out.
retrolefty:
Are you sure, what code are you speaking of?
Lefty
It's a self replicating sketch. Upload it to one Arduino (clone), connect that clone to another and trigger a copy. The first one will reset the second one and start blasting a copy of itself over serial to the other. You can see it in action here:
If that second one doesn't have a bootloader (that will monitor the serial line after a reset), the replication process wouldn't work ... I don't think.