Go Down

Topic: Can't open device "\\.\COM2": The system cannot find the file specified. (Read 490 times) previous topic - next topic

KyleBriggs

I recently purchased a second-hand Due board (the mega-sized one) off a friend (it did previously work fine on his machines), and now I am unable to upload anything to it.

I have done nothing to it except plug some wires into it from a breadboard and plug it into the computer to upload code.

I have followed this admittedly simple diagram here:
https://www.arduino.cc/en/Tutorial/Button

and added an LED to pin 3, and tried to upload the code at the bottom of the post with the following settings:
  • Board: Arduino Duemilanove or Diecimila
  • Processor: ATmega328
  • Port: COM2
  • Programmer: AVRISP mkII (I didn't change this one)


And yet I get the following error when I try to upload it:
Code: [Select]
avrdude: ser_open(): can't open device "\\.\COM2": The system cannot find the file specified.

Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.


The code is verified and compiled so that isn't an issue and I am plugged into the inner USB micro port (programming one).

Here is the code:
Code: [Select]
const int buttonPin = 2;
const int ledPin = 3;

int buttonState = 0;

void setup()
{
  pinMode(ledPin, OUTPUT);
  pinMode(buttonPin, INPUT);
}

void loop()
{
  buttonState = digitalRead(buttonPin);

  if(buttonState == HIGH)
  {
    digitalWrite(ledPin, HIGH);
  }
  else
  {
    digitalWrite(ledPin, LOW);
  }
}


Any ideas or obvious signs I have done something wrong?

DrAzzy

A Due and a Duemillanove are totally different boards.

To upload to a Due, you must install the official SAM board package through Tools -> Board Manager. That includes support for the Due, Zero, and other SAM-based boards.
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Go Up