Arduino Mega Serial Port - USB device attached to the equipment didn't work

Hello everyone,

I have a problem with Serial Port maybe you can give me some advice.

I have one Arduino Mega 2560 that has communication with a C# application. (C# Application runs over Win XP).

The communication is working well, but after some time I recive the error "USB device attached to the equipment didn't work" and I lose the communication. (If I unplag and plug the Arduino USB I get communication again). On the PC I see that the Arduino Mega 2560 is still detected.

I've tried to change the USB cable and the Arduino, but I still have the problem.

Electrically, I have the GND from PC and Arduino connected.

Anyone have some idea to solve it or some test to do?

Thank you and best regards,

It is possible that the ground problem could cause a glitch. If you connect the Mega via the USB to the computer, both GND are connected. Don't use an extra ground wire, that will creaste a ground loop in which the current can run around.

Do you have contact-cleaning spray ? Perhaps the USB connector is dirty. The 5V pin of the Arduino board should not be 4.5V or lower. Can you check that ? If it is too low, perhaps a power supply (wall wart of 9V) to the barrel jack might help.

Could you try it on another computer ? with another operating system. It might be a problem between the C# application and the driver.

If everything is okay, it should keep on working of course. It is not a known problem as far as I know. You do use the newest Arduino IDE software ? And you don't use a cheap clone ? A cheap clone might have bad firmware in the usb-serial chip, or if the serial chip is a CH340G the driver for Windows XP might be too old and not working well.

It is possible that the sketch is wrong ? If you for example have a long delay, and the C# application does not get a reply fast enough, then could such an error message be the result ?

There are many more posibilities that caused this. I hope that the few things that I mentioned will help a little.

Hello Peter_n,

Thank you for your fast answer and your advices.

I uploaded the new software version 1.6.5.r2 and I still have the same problem.

I have this application in 3 other PC's (Total 4) and I have this problem in two of them. On the other two the application is working well, no comunication problems. (Same sketch)

I don't know where to check the USB Serial chip. (CH340G)

I will try to change the PC and see if I have the problem too.

Best regards,

Even if the sketch is working on a computer, that doesn’t mean that the sketch is not the problem. I don’t know what the cause could be, you have to try a few things. If possible check for errors and timeouts in both C# and the Arduino sketch.