I have had several Nano for a couple years and they have always performed well.
Recently, one has demonstrated odd behavior. When flashed with a blink (or modified/double blink) sketch, it acts as it should. I can unplug it and come back the following day, and it still acts properly.
If I flash it with one of the below sketches, it will perform as it should, but when left unplugged over night and plugged back in later the sketch doesn't run and i get a quadruple blink on the on board LED.
Sometimes the LCD demo sketch will still run (if it was the most recent sketch uploaded) after being left unplugged overnight, but only after a minute or so of quadruple blinking and also not smoothly.
But then I can reflash whatever sketch, and it will work perfectly until left unplugged for some period of time again (overnight?).
Years ago there was a bug in the bootloader that would cause the 328p to not execute the stored code on power-on. It would appear the board had "forgot" its sketch.
Since you mentioned "a couple of years", perhaps the board has the older bootloader on it.
I tried to reflash the bootloader on a nano.
My setup was 2 clone Nano's with ch340 chips.
I flashed the first one with the isp sketch, uncommented #define USE_OLD_STYLE_WIRING,
Uploaded the sketch, and unplugged it.
LED and reistor on pin 9, cap between rst and gnd, and 10>reset 11>11 12>12 13>13 5v>5v
Plugged it back in, and the heartbeat was good.
I set the programmer as "arduino as isp" and selected "burn bootloader". I recieved an error of
"You probably want to use 0xfd instead of 0x05 (double check with your datasheet first)"
I found the boards.txt file (%appdata%) and changed 0x05 to 0xfd.
Burned the bootloader, and the heartbeat was good afterwards.
I now tried to flash the nano (that now has the fresh bootloader) with blink sketch and got
I uninstalled and reinstalled the IDE and got the same error.
I don't normally set anything (a n y t h i n g) to automatic update, and had forgot to do so with the IDE last time I installed it.
So, I rolled back the boards driver to 1.16, and now it uploaded the blink sketch. We'll see if it "holds" overnight, and I'll report back tomorrow
When I plugged in the arduino to see if the blink sketch was still working, it was.
Then I opened the IDE, and the arduino started the odd flashing on pin13/led. All i did was launch IDE on my computer, not a sketch and no other operations.
When I open serial monitor, i the blink sketch begins to run correctly.
When i close serial monitor, the random blinking begins again...
I'm running win7 with no service pack, on a toughbook cf30, core 2 duo 1.6ghz, 4gb 5300 ram. I do have a gps on com3 and disabled serial mouse search on boot in registry (to stop windows from "finding" a mouse on bootup because of gps stream)
interestingfellow:
When I open serial monitor, i the blink sketch begins to run correctly.
When i close serial monitor, the random blinking begins again...
Opening and closing the serial monitor causes the board to reset.
ALSO: pressing the reset button interrupts the crazy blinks only while the button is held down and resumes immidiately after releasing the reset button. When not crazy blinking and I press the reset button the led respond as expected from a reset and then the intended sketch blinking resumes.
Looks like the board is getting reset periodically.
I'm going to guess you don't have a scope, do you? Would be interesting to watch the RESET line and see what it is doing.
The difference in rates might be attributed to the IDE scanning the serial ports, but that's just a guess. While the IDE is open, if you change to another process--like Notepad or Excel--does it rate change?
Why? Two thoughts: The nano doesn't have a polyfuse, but uses a diode for "protection." Maybe something is up with the diode. Second thought, something else on the PC is opening/closing serial ports. Only two ways I can think to verify that are use a USB power brick or another computer.
On my Toughbook usb port or on a wall wart, the nano is fine. The crazy flashing only happens when it's plugged in my TBook and I fire up the IDE...
I'm inclined to think there is something trying to access the com port; sometimes, when I try to upload more than once in a row, IDE gives me an error that the port is busy...
boot win7
plug in arduino, blink sketch runs correctly
launch IDE, and I get a crazy blink
launch notepad and/or excel, switching windows around, I still get crazy blink
switch to IDE, launch serial monitor, blink sketch runs correctly
close monitor and crazy blink returns
close out the IDE and sketch runs correctly.
Switch to a different nano (arduino ISP with heartbeat on pin9).
Plug it in, and it heartbeats as expected.
Launch IDE, heartbeat stops and pin13/led crazy blinks.
Serial monitor stops the crazy blinks and the heartbeat comes back.
Close the monitor, and the heartbeat stops on pin9 and crazy blinks on pin13 start again.
Close IDE, and the crazy blinks stop and the heartbeat returns.
I'm going to post over in my toughbook forum and see if anyone else has had a similar issue (or some idea of what's causing mine)