Arduino Uno inconsistent serial port issues on Windows PC

Hi,
I have an Arduino Uno R2 for some time now, so far with no issues.
Today I started running into an inconsistent issue with interacting with the board from Windows 7 PC (x64).
The Arduino is recognized by Windows (shown in Device Manager on COM5) when connected with a USB cable,
but I can’t upload programs to it.

I’m saying the issue is inconsistent because sometimes “COM5” is listed under Tools → Serial Port, and sometimes it’s not.
When it is listed, and I try to upload a program (an empty sketch, an example, or a program I’m working on that used to work fine in the past) - I get a “COM5 already in use by another program” (which doesn’t make sense, as I’m doing it as the first thing after a system reboot) (also, I could not find any process using the any serial port using process explorer).
When it’s not listed, it’s like the COM5 port doesn’t exist (loopback test fails with no such port “COM5”), and I have no clue how to make it come back (it might reappear randomly later).
If the COM5 port appears, the loopback test passes.

I went over the troubleshooting process.
Reinstalled the drivers and IDE (also tried with Enhanced Release 1.0.5).
Nothing worked so far.

The last sketch I was able to upload successfully is this:

int i = 0;
int samples[1000];

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  if (i < 1000)
  {
    samples[i] = analogRead(0);
    ++i;
  }
  if (i == 1000)
  {
    for (i=0; i < 1000; ++i)
    {
      Serial.print(samples[i], DEC);
      Serial.print(", ");
    }
    ++i;
  }
}

I guess this sketch is still loaded. I have no way to know for sure, as I can’t read from the serial port.

Also, when the board is not held in reset, the “L” LED is repeatedly blinking (1 long blink, 3 short blinks, ~1sec off, repeat).
Don’t know if it means anything, but thought it’s worth mentioning just in case.

I also tried using several USB cables, running into same issues.

Any help would be much appreciated!

int samples[1000];

2000 of your 2048 bytes of RAM?
That's not going to go well.

AWOL:

int samples[1000];

2000 of your 2048 bytes of RAM?
That's not going to go well.

I can see how it will not go well as far as the sketch goes,
but can it be related to the issues I' describing?
If so, do you have an idea for a solution?

Try 'forcing' a new sketch (blink would be fine) to be loaded by pressing and holding down the reset button. Then release the reset button only when the IDE is done compiling blink sketch and starting to upload.

It seems the problem is with my laptop.
When trying with other computers (Windows and Linux) the board works fine, and I'm able to communicate with the board and upload programs.

Thanks,
and sorry for your trouble.

AWOL:

int samples[1000];

2000 of your 2048 bytes of RAM?
That's not going to go well.

He says he tried my modded version, but I think not :cold_sweat: