Programming Arduino Mega 2560 through USB ISP doesn't work

Hello everyone :slight_smile:

Just had my Arduino Mega 2560. After a while playing it, the USB can't get recognized but the ATMEGA2560 is still working. Then I bought myself USB Tiny programmer just to know that it is incompatible since USB Tiny can only support < 64K Flash. :0

Then I bought this USB ISP which can read the device ID of my ATMEGA2560 :slight_smile: It can write and read successfully from the flash. The thing is when I tried to upload a software which is compiled in Arduino IDE into the device, it doesn't work. :~

I set the fuse bits correctly according to boards.txt (0xFF low fuse, 0xD8 high fuse, 0xFD extended fuse). I can read the fuse bits and it is correct :~

I tried even the blink sample for Arduino and set the board to Arduino Mega in the IDE, get the hex, upload. Nothing happened.

Does anyone have any idea what is troubling me? Can anyone just upload a blink sample of .hex that can work when programmed using ISP?

Thanks a lot for your attention.


I was having similar problems uploading programs.
I am using Arduino IDE 1.0.3, Windows Vista 32 sp2 on a Dell Latitude and Windows XP sp3 on a Dell Dimension, Arduino Hardware = SainSmart Mega 2560 + 1602 LCD+Keypad.
Hurdles overcome:

  1. make sure usb drivers are installed properly, use device manager on the PC to monitor plugging/unplugging of device. I eventually manually installed the device drivers. Renumber the Com port assigned to the device to something away from the low numbers and avoiding any com port number for any other device you plug into your PC.
  2. if you are new to arduino, start with small programs and grow from there.
  3. incrementally make changes to your program, save, compile and upload.
  4. I have found that even though the program/sketch has successfully compiled there are some things that the bootloader or the processor doesn't like, that is when the upload fails. I have found the following steps work for recovering from an uploaded sketch that the Arduino doesn't like:
    A. unplug the Arduino Mega 2560 from the usb, eventhough the IDE is still trying to upload the sketch.
    B. wait for the IDE to message the comm failure.
    C. plug the arduino back in
    D. upload a known good sketch to the arduino.

These are a couple things I have found that the compiler passes, but the device doesn't like:

  1. if ( var = value) { --- the correct syntax should be: if (var == value) {
  2. wstring = "some amount of text with 3 !!! in it"; some discussions say this is no longer an issue, or an old issue. Looks like maybe something on the device side sees that as some special escape sequence, or special value.

I hope this helps someone save a days worth of trial and error.

I was having similar problems uploading programs.

Your post has nothing to do with the original question. The original poster is asking about using an external programmer. Nothing you posted is remotely similar to such a situation.