I lost the ability to upload ANY code to my Arduino UNO

I lost my ability to use the serial port for anything on my Arduino, even to upload any code to it. My problem is how to regain the ability to upload code to it.

I was doing an extremely simple project, to test Arduino's facilities to send data to the serial port. For this purpose, I wired a potentiometer (correctly, that is not the problem) to pin A5 of the Arduino, and nothing else.

My code was even simpler, read pin A5 and output the corresponding value through the serial port. Nothing fancy.

I intended to write some Processing code to read the value from the serial port and then output it in a window.

However, I did made one particularly insedious bug in my code, I forgot the corresponding delay() call which would allow me not to overun the serial port.

By the way, I configured it to operate at 57600 bps, not 9600 bps.

As a result, the serial port is overun within seconds of me applying power to the Arduino, even before I can upload even the blink example program to blink the built in LED.

Beleive me, that would be a particularly delicious sight right now.

So, how can I recover control over my UNO?

Thanks.

Boy, now I feel stupid... Don't you hate it when you look for the solution to a problem you are having for a few days and finally post about it, only to instanly see a a post with the answer you where looking for?

I need to upload my bootloader again!

So I need only to get a new Aduino and use it to upload the new bootloader to the old one. That way I will end up with 2 Arduinos, not just one.

Thanks anyway!

Uoy mau not meed to buy another uno, connect the board to your PC, open the arduino software, go to tools>port>"select the correct port"
After that go to tools>boards>"select your board"
then go to tools>burn bootloader
You should have the board working.
Try to upload the Blink sketch after all this.
Cheers,
-Malhar

MalharD:
Uoy mau not meed to buy another uno, connect the board to your PC, open the arduino software, go to tools>port>"select the correct port"
After that go to tools>boards>"select your board"
then go to tools>burn bootloader
You should have the board working.
Try to upload the Blink sketch after all this.
Cheers,
-Malhar

Yea, he already stated that he did that... Not sure why you had to post that.

My point was He don't need to buy another board, He can use the existing board.
Sorry for any typos, I'm using a 20 yrs old keyboard.

Thanks for your replies. Especially thanks to you, @MalharD.

A lot has happened with my Arduino lately.

I did bought a second board. It does behaves similarly, though not identically. I will post about the new board on its own thread.

Comming back to this one, I have tried using @MalharD's solution. It did not work. Problem is that the serial port disappears from the system the moment I try to upload something, anything. Even if it is a slightly modified blink to replace delay times to 250ms (I need to ensure it is my newly uploaded code the one that's running).

The error message I get is this, weather or not the loopback circuit is connected or not:

Binary sketch size: 1,056 bytes (of a 32,256 byte maximum)
processing.app.SerialException: Error opening serial port '/dev/ttyACM0'.
 at processing.app.Serial.<init>(Serial.java:178)
 at processing.app.Serial.<init>(Serial.java:77)
 at processing.app.debug.Uploader.flushSerialBuffer(Uploader.java:77)
 at processing.app.debug.AvrdudeUploader.uploadViaBootloader(AvrdudeUploader.java:175)
 at processing.app.debug.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:67)
 at processing.app.Sketch.upload(Sketch.java:1671)
 at processing.app.Sketch.exportApplet(Sketch.java:1627)
 at processing.app.Sketch.exportApplet(Sketch.java:1599)
 at processing.app.Editor$DefaultExportHandler.run(Editor.java:2380)
 at java.lang.Thread.run(Thread.java:745)
Caused by: gnu.io.UnsupportedCommOperationException: Invalid Parameter
 at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:213)
 at processing.app.Serial.<init>(Serial.java:163)
 ... 9 more
processing.app.debug.RunnerException: Error opening serial port '/dev/ttyACM0'.
 at processing.app.debug.Uploader.flushSerialBuffer(Uploader.java:101)
 at processing.app.debug.AvrdudeUploader.uploadViaBootloader(AvrdudeUploader.java:175)
 at processing.app.debug.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:67)
 at processing.app.Sketch.upload(Sketch.java:1671)
 at processing.app.Sketch.exportApplet(Sketch.java:1627)
 at processing.app.Sketch.exportApplet(Sketch.java:1599)
 at processing.app.Editor$DefaultExportHandler.run(Editor.java:2380)
 at java.lang.Thread.run(Thread.java:745)

I have tried the serial loopback test. The result was an outstanding success(?): TX and RX leds work properly and I get the expected reply--as long as I use an external terminal program. This port worked regardless of my boud rate or its other data communications details (stop bits, parity or number of data bits).

(Indeed, I figured out that the faster you set it to communicate, the faster the TX/RX LEDs will blink. So, If I set the speed to as low as possible (300 bps), 8 data bits, 2 stop bits, and even (or odd) parity I can actually see the LEDs blink brightly every time I hit a key... Thinking about it, at those setting the transmission is 27.27272727... bytes per second, or 37 ms per byte, which is much bigger than the 13 ms minimun time for our brains to distinguish two stimulae appart.)

If I use the Serial Monitor, the Arduino IDE tries to first compile and upload whatever is loaded and then It bombs out. Strange.

By the way, this part of the my new UNO clone is very similar. So I though inmediately that the problem was with my configuration of the Arduino software. I then proceed to purging (not just uninstalling, this way my configuration files are deleted too) the IDE and reinstalling it again. However, this made no difference.

The error exact error is this the same I listed above...

Now, this happens the second I try to upload a new program. I can hook up the serial loopback cirquit and use it for as long as I please, as long as I do not try to upload new code.

My next test is going to be to attempt to upload new code with some other tool. I have heard I can also do it using Elipse and command line tools... I am working on both options... Any other I should try?