arduino MEGA2560

Is there a suitable driver for a MEGA2560?

Also, this is an error code that popped up. can anyone help?


Is there a suitable driver for a MEGA2560?

What do you mean by a driver? None should be needed.

Also, this is an error code that popped up. can anyone help?

That error message screen capture is useless because it doesn’t show the whole error. See that button that says “Copy error messages”? Click that button and then paste it here using code tags(the </> button).

Hi pert.

I had heard something about a driver being needed for the board to work, but I am very new to arduino, so I don't know much.

here is the error message you asked for, I hope it clears things up.

Arduino: 1.6.4 (Windows 8.1), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

Build options changed, rebuilding all

Sketch uses 1,518 bytes (0%) of program storage space. Maximum is 253,952 bytes.

Global variables use 9 bytes (0%) of dynamic memory, leaving 8,183 bytes for local variables. Maximum is 8,192 bytes.

avrdude: ser_open(): can't open device "\\.\COM1": The system cannot find the file specified.

avrdude: ser_drain(): read error: The handle is invalid.

Problem uploading to board.  See for suggestions.

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.

The board should automatically install when you plug it in.

Before you can upload a sketch to the board you need to select which port it's attached on in the Tools > Port menu. With the board plugged in it should say something like COM5 Arduino Mega 2560. Another way to determine the correct port if there are multiple ports listed and none say the name of the board is to check the Tools > Port menu with the Mega not plugged in and then plug it in and, after waiting a bit for it to connect, close and reopen the Tools > Port menu and the new port that was not on the list before is the one that the Mega is connected to. After doing that try uploading again and let us know what happened.

Hi pert

For some reason the tools/port menu won't open. it is just gray, like when the option isn't available.

That means there are no ports open. Does that happen even when you have your Mega board plugged in with the USB cable?

absolutely. I also have another board with an ATMEGA8A chip, and the same thing happens to it as well.

Have a read of It has some information on checking the driver and other things you can try.

Please check following;

Does a COM port get created when you plug in the board? If not, please go about to get the right drivers. Specially if you have a non-original Mega, there might be some issue getting a decent driver for this.

Just look in the 'device manager' (assume you have Windows) and fix it there. There's lot's of tutorials for this.

thx, /steven

Hi Bitflogger

No, a COM port doesn’t open when I plug in the board. I have a duinotech mega 2560 from Jaycar electronics, as well as a gray market ATmega8A which I got at the summer camp where I first used arduino, and it worked without a hitch, which leads me to think that the problem must be with the download.

I downloaded arduino 1.6.4 to a Win7 laptop, where I encountered the problems I listed before. I moved the download to my current Win8 computer, and encountered the same problems.
Neither board works on both computers
thanks for your help.


Welcome back, sorry to hear your Arduinos are still not working after 6 months, ouch! Since you say the Arduino doesn't show up on the Tools > Port menu in the Arduino IDE this indicates that you might not have the driver installed for your Arduino. If you open Device Manager and plug in your Mega 2560 you should see a new device appear on the list. Double click on that device and then do: Update Driver... > Browse my computer for driver software > Browse > select the drivers subfolder of your Arduino IDE installation folder > OK > Next Hopefully after that your Arduino will install correctly.

Now try the same process for the ATmega8A, that one may not be supported by the drivers included with the Arduino. If not, let me know and I'll see if I can help you get that one going also.

Hi Pert Nice to hear from you too.

I just read your post, and opened arduino to try out your suggestions. Surprisingly, the mega2560 was recognised at once. I opened a previous blink sketch, and tried to compile it. Compilation worked on the second try, but when I tried to upload the sketch, there was an error.

Here is the error code, and sketch.

thanks for your help.


void setup() {
 pinMode(13, OUTPUT);

void loop() {
 digitalWrite(13, HIGH);
 digitalWrite(13, LOW);

Error code

Arduino: 1.6.4 (Windows 8.1), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

C:\Users\kadin the hacker\Desktop\arduino-1.6.4\hardware\tools\avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10604 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -IC:\Users\kadin the hacker\Desktop\arduino-1.6.4\hardware\arduino\avr\cores\arduino -IC:\Users\kadin the hacker\Desktop\arduino-1.6.4\hardware\arduino\avr\variants\mega C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\sketch_jan05a.cpp -o C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\sketch_jan05a.cpp.o 

Using previously compiled file: C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\hooks.c.o

Using previously compiled file: C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\WInterrupts.c.o

Using previously compiled file: C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\wiring.c.o

Using previously compiled file: C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\wiring_analog.c.o

Using previously compiled file: C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\wiring_digital.c.o

Using previously compiled file: C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\wiring_pulse.c.o

Using previously compiled file: C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\wiring_shift.c.o

Using previously compiled file: C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\abi.cpp.o

Using previously compiled file: C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\CDC.cpp.o

Using previously compiled file: C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\HardwareSerial.cpp.o

Using previously compiled file: C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\HardwareSerial0.cpp.o

Using previously compiled file: C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\HardwareSerial1.cpp.o

Using previously compiled file: C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\HardwareSerial2.cpp.o

Using previously compiled file: C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\HardwareSerial3.cpp.o

Using previously compiled file: C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\HID.cpp.o

Using previously compiled file: C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\IPAddress.cpp.o

Using previously compiled file: C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\main.cpp.o

Using previously compiled file: C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\new.cpp.o

Using previously compiled file: C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\Print.cpp.o

Using previously compiled file: C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\Stream.cpp.o

Using previously compiled file: C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\Tone.cpp.o

Using previously compiled file: C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\USBCore.cpp.o

Using previously compiled file: C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\WMath.cpp.o

Using previously compiled file: C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\WString.cpp.o

Using previously compiled file: C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\core.a

C:\Users\kadin the hacker\Desktop\arduino-1.6.4\hardware\tools\avr/bin/avr-gcc -w -Os -Wl,--gc-sections,--relax -mmcu=atmega2560 -o C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp/sketch_jan05a.cpp.elf C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp\sketch_jan05a.cpp.o C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp/core.a -LC:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp -lm 

C:\Users\kadin the hacker\Desktop\arduino-1.6.4\hardware\tools\avr/bin/avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp/sketch_jan05a.cpp.elf C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp/sketch_jan05a.cpp.eep 

C:\Users\kadin the hacker\Desktop\arduino-1.6.4\hardware\tools\avr/bin/avr-objcopy -O ihex -R .eeprom C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp/sketch_jan05a.cpp.elf C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp/sketch_jan05a.cpp.hex 

Sketch uses 1,518 bytes (0%) of program storage space. Maximum is 253,952 bytes.

Global variables use 9 bytes (0%) of dynamic memory, leaving 8,183 bytes for local variables. Maximum is 8,192 bytes.

C:\Users\kadin the hacker\Desktop\arduino-1.6.4\hardware\tools\avr/bin/avrdude -CC:\Users\kadin the hacker\Desktop\arduino-1.6.4\hardware\tools\avr/etc/avrdude.conf -v -patmega2560 -cwiring -PCOM3 -b115200 -D -Uflash:w:C:\Users\KADINT~1\AppData\Local\Temp\build7041543697571774703.tmp/sketch_jan05a.cpp.hex:i 

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58

        Copyright (c) 2000-2005 Brian Dean,

        Copyright (c) 2007-2009 Joerg Wunsch

        System wide configuration file is "C:\Users\kadin the hacker\Desktop\arduino-1.6.4\hardware\tools\avr/etc/avrdude.conf"

        Using Port                    : COM3

        Using Programmer              : wiring

        Overriding Baud Rate          : 115200

avrdude: ser_open(): can't open device "\\.\COM3": The system cannot find the file specified.

Problem uploading to board.  See for suggestions.

avrdude: ser_drain(): read error: The handle is invalid.

Try this:

  • With the Arduino board unplugged from the USB open the Tools > Port menu and note the listed ports. If the Port menu is gray and disabled then that means there are no ports available.
  • Close the Tools > Port menu.
  • Plug in the USB cable on the Arduino board
  • Wait a little while for the Arduino board to connect
  • Open Tools > Port, the new port on the list is your Arduino board. In some cases it will have the name of the board next to the port name but this doesn't happen with all boards. If the Port menu is gray and disabled then that means your Arduino board didn't install correctly. You may need to install a driver.
  • Select your Arduino's port from the menu.
  • Try uploading again.

Hi pert

I’d like to thank you for all your help and support in assisting me as I worked out all the bugs with my arduino boards. I recently bought a new computer, and downloading the arduino software as administrator worked like a charm. My arduino worketh!!

So thanks again for your help.
all best