Removing & replacing bootloader

I've just got my TinyISP programmer - before I potentially destroy my limited supply of 168s/328s I just wanted to doublecheck my understanding....

  1. If I upload may application .hex file to the chip with the programmer via the ICSP connector & AvrDude, this will overwrite the bootloader.

  2. I can re-upload the bootloader via the prgrammer using the Arduino sw "Burn Bootloader" option and everything will be back to square one - clean but bootloaded chip?

Is that correct?
Cheers

Yes, that should work - I upload (burn) hex files using the ISP pins lots of time and yes, it does overwrite the bootloader.

Yes, you "should" be able to burn the bootloader using "Burn Bootloader" option in the IDE, but doesn't work for me - the IDE just doesn't seem to work with my programmer. BUT you can burn the bootloader back to the chip using your TinyISP and Avrdude. Just burn it the same as any program and it's there.

The bootloader hex file in located in subfolder of the hardware folder of your Arduino folder.... I'm at work so can't give an exact path, but I think you can find it easy, just drill down from the hardware folder.

I do that same precedure you are thinking lots of time -

good luck, Ken H>

Awesome - thanks Ken!

Thanks!!! I had the same question.

  1. If I upload may application .hex file to the chip with the programmer via the ICSP connector & AvrDude, this will overwrite the bootloader.

I could be forgetful, it's been a while sense I've done anything other then just burn the bootloader into a chip, but I don't think #1 statement is correct.

The bootloader lives in high flash memory and is protected from being erased by the fuse settings in the chip. I believe you can just burn your .hex file via USBtiny ICSP and not disturb the bootloader. But either way It does sound like you can do what you want even if it takes a second step later to erase the chip and reburn the bootloader.

Lefty