Arduino Mega 2560 Programmer communication error

On Septemeber 12, I bought an Arduino Mega 2560, some H-bridges, and a power adapter for the Arduino. When I got the Arduino, I uploaded to the Arduino twice, using the Serial library, to test the communication to the computer with nothing plugged into the Arduino but the USB cable. The third program I tried to upload was “Blink” using an LED and 220-ohm resistor. When I went to upload the sketch I got the following error.

Sketch uses 1,462 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: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
An error occurred while uploading the sketch

I then removed the LED and resistor and uploaded a blank sketch and still got the error. After some research, I checked all the settings on the Arduino IDE, added a 1A, 9V power supply that I purchased with the Arduino, and used a different computer. This still produced the same error. I also tried using an Arduino Uno R3 as an ISP, using the “ArduinoasISP” example sketch, to burn the bootloader, but I still got the same error.

I am lost and not sure what to do now. Do I need a new Arduino?


Please take a look at this forum post and this.
Here is some few points to verify :

]Verify that you have chosen the correct COM port in your Arduino IDE./:m]
]Verify that the board set is " Arduino Mega or Mega 2560"/:m]
]Try to upload the code with another USB cable. Sometimes a bad quality USB cable can be the cause of the issue./:m]
]Remove “!!!” if you have it in your code. If you have “!!!” three or more exclamation points, the bootload will enter a special mode and will no longer respond to bootload commands./:m]Hope this helps.

Yes, I have done all that and the board is still not working. Is there anything else I can do?

I use Arduinos, 2 of them, in my build and often get inexplicable errors that are the result of choosing the wrong port, INITIALLY, and then changing ports while the board is still attached to the USB.

You may want to try disconnecting the board, reconnecting the USB cable, and only then choosing the port / board combination under Tools in the IDE.

…if that doesn’t work, then you may want to include your code in a follow-up post.



I only have one Arduino plugged in at a time and always check the port, programmer, board, and processor before uploading. (“Com 4(Arduino/Geniuno Mega or Mega 2560)”, “AVRISP mkII”, “Arduino/Geniuno Mega or Mega 2560”, and “ATmega2560 (Mega 2560)”.) I’ve tried uploading “Blink” and this sketch and continue to get the same error.

[code]void setup() {
// put your setup code here, to run once:


void loop() {
// put your main code here, to run repeatedly:


Well, it’s definitely not your code as it’s blank :slight_smile:

It has to be your connection I think. Do you have another USB port you can use?

When you go to upload, do you see any blink/flash on the on-board LEDs?



I have tried different USB cords and ports, both on my Windows 8.1 and Ubuntu 16.04. The RX and TX lights don’t blink at all, and the pin 13 LED blinks once on a code upload or when I click the reset button.

The fact that the 13 LED blinks when you attempt an upload means that it is recognizing… I’m at a loss. Hopefully some else can jump in with another suggestion for you. Sorry I can’t be of more help!


I couldn’t figure out what was wrong with the Arduino Mega, but it was still under its 90 day return period. I sent it back and got a new Mega which is working great at the moment. Thanks for your help.

Oh my God! Mr. bdaouas, has right!!! Using !!! in a stupid comment in the code and the hell came for me…Thank You Mr. bdaouas, you save my day!