Just ran into a strange situation with my Arduino Uno (Rev 2 - not smd) forgetting sketches. I tinkered with the standard “blink” sketch to produce a heartbeat type effect and just had it running for an hour or two powered via the USB. I then loaded up the sketch that I have been working on for a while (only partially finished, but wanted to check a few parameters) and it worked as well as I expected. I then unplugged the usb from the pc to power down the board. All fine so far. But…
Coming back to the board, I reconnected the board via USB, and my sketch wasn’t working, but it was running the heartbeat sketch from earlier…huh? I reloaded the development sketch, and it worked fine. Powered down again and then repowered the Arduino and it was back to the heartbeat sketch again. I now find that it will run any sketch I load into it, but as soon as I power down and then power up again, it keeps on forgetting what was loaded and runs the heartbeat sketch instead. What on earth is going on - is it a bootloader problem? Bear in mind that this board and ATMega328 chip have been used for many sketches over the last 4 or 5 months with absolutely no problem. This amnesia only started today.
It can’t be the bootloader as I have just tried the ATMega328 in a different board and all is fine there, sorta infers a problem with the original board :~