0

I'm try to connect my Arduino Mega 2560 to PC, but I think it's not easy as I imagine. I spent a lot's of time to install USB driver. Here is a screenshot:

Device manager

When I try to upload blink example, Arduino IDE throw this error:

Sketch uses 656 bytes (0%) of program storage space. Maximum is 253952 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 8183 bytes for local variables. Maximum is 8192 bytes.
avrdude: ser_open(): can't set com-state for "\\.\COM10"
avrdude: ser_drain(): read error: The handle is invalid."

Screenshot of error

Please help to run one simple example.

I think this screen may help to understand my problem:

COM port selection

Greenonline
3,1527 gold badges36 silver badges48 bronze badges
asked Oct 20, 2017 at 11:09
1
  • Did you reboot your PC after installing drivers? Commented Oct 20, 2017 at 11:34

3 Answers 3

2

I install driver for this site and everything is working well. driver download: wch.cn/download/CH341SER_EXE.html

I'm recommend to unplug arduino first and install driver, after that plug and enjoy.

Here is a video: https://www.youtube.com/watch?v=FhmG5J-AHrg

answered Oct 20, 2017 at 12:44
2
  • 1
    So - you don't have a genuine Arduino then... Some cheap far-east inferior quality clone... Commented Oct 20, 2017 at 12:47
  • Tried everything but in the end these Chinese drivers works. Yes its not a genuine arduino. but its open source and anybody can make and manufacture it. Commented May 13, 2021 at 5:23
0

What you can try is:

  • Use another USB port
  • Reopen IDE
  • Reinsert the USB cable
  • Use a different USB cable
  • Prevent using a USB 'box' in between
  • Try a different 2560 (if you have)
  • Restart computer
  • Check if it can be found in the system drivers
  • Reinstall IDE (after deinstall it).

However, as the author already mentioned the real solution is needed for some non-genuine Arduinos:

  • Install the CH driver e.g. at wch.cn/download/CH341SER_EXE.html
answered Oct 20, 2017 at 11:17
8
  • I do everything(but not change other arduino) but does not meter, I think USB driver is not install correctly. Commented Oct 20, 2017 at 11:44
  • In that case the last option should fix it (maybe deinstall IDE first just for certainty) Commented Oct 20, 2017 at 11:46
  • ok, I'll try it one more time. but, I think best way to fix this issue is throw arduino into trash Commented Oct 20, 2017 at 11:52
  • nothing change, IDE can not connect to device. Commented Oct 20, 2017 at 12:03
  • 1
    I'm installing this : wch.cn/download/CH341SER_EXE.html and left only this problem: "Sketch uses 1462 bytes (0%) of program storage space. Maximum is 253952 bytes. Global variables use 9 bytes (0%) of dynamic memory, leaving 8183 bytes for local variables. Maximum is 8192 bytes." Commented Oct 20, 2017 at 12:27
0

I also got the same error. Then I un-plugged my connections and pressed the reset button. Then I uploaded the default blink example to my board. Then it's working fine. Then again I made a connection to the board and it shows the same error again. Now, I un-plugged the GND pin; it's working again. So, in my case there was some thing wrong with my connections.

Glorfindel
5781 gold badge7 silver badges18 bronze badges
answered Jun 22, 2019 at 11:21

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.