More on the continuing drama of the 2560 bootloader.
I just move a lot of my code up to IDE 1.0.3 and decided to check and see if they had updated the bootloader in this. Well, they haven't. I just used it to program 2560 and the bootloader supplied with the release failed on both the !!! and the watchdog timer problems.
But, I went searching to see if there was some schedule and ran across another bootloader that works. This one is smaller because the author removed the code that samples for the !!! to jump into a rom monitor. So, there is no problem with !!! because it doesn't look for it, and the watchdog timer works. Plus, we get a little code space back (not that it matters on a 2560). I tested it with several things and successfully loaded code that exceeds 60K (biggest I currently have) to the board. The hex file is at:
http://code.google.com/p/optiboot/issues/attachmentText?id=50&aid=500005000&name=stk500boot_v2_mega2560.hex&token=wYbxgcUg2eOVF841vNLu2xsd2Kg%3A1360548051878If you want to get it and try it. I used an AVRISP mk 2 to replace the bootloader, I haven't tried anything else.
Here is the code I used to test the two problems:
#include <avr/wdt.h>
void setup(){
wdt_reset(); // First thing, turn it off
wdt_disable();
Serial.begin(57600);
Serial.println("Hello, in setup!!!");
}
int firstTime = true;
void loop() {
if (firstTime){
firstTime = false;
Serial.println("In loop waiting for Watchdog");
wdt_enable(WDTO_8S); // eight seconds from now the device will reboot
}
// now just do nothing
}
It's annoying that they haven't updated the IDE with a version that works. But, there are a couple of solutions that work now.
Oh, for the person that is looking for the 1280, look for an optiboot version. I ran across several references to a new optiboot bootloader that fixes that board.