SparkFun Forums 

Where electronics enthusiasts find answers.

For the discussion of Arduino related topics.
By westfw
#117930
I've written a short sketch that will help you load a fixed bootloader unto you Uno systems, assuming that you have a second arduino of some kind to do the fixing.

This is based on the arduinoISP programming sketch, except it includes an internal copy of a (fixed) optiboot bootloader, so there are no communications issues. You just connect up an Arduino containing the sketch to an Uno with the iffy bootloader (as per instructions here: http://arduino.cc/en/Tutorial/ArduinoISP ), hit reset, and it will drop in a new bootloader. (Status is displayed to the Serial port at 19200bps, but you don't really need to watch it.)

This is actually a subset of a more ambitious effort to load optiboot into all sorts of old Arduinos, but that's waiting on more complete documentation. meanwhile, doing Uno only is pretty simple and is getting increasingly urgent as more optiboot bugs show up.

the fixed optiboot included in the sketch has:
1) PWM timer initialization fixed (this was also fixed in the core.)
2) 30k upload limit fixed.
3) zero register initialization (Sketch amnesia) fixed.

optifix.zip

(hmm. Over here, I ought to comment that this will reprogram the bootloaders in any m328 board, broadly resetting the AVR to be expecting a 16MHz external crystal or resonator, and using a bootloader built to run at 16Mhz. You'd need to modify is somewhat significantly for the 8MHz 3.3V AVR boards, if you had wanted to reprogram them as well.)