Unable to upload programs to an Arduino Mega2560

Thank you for the replies so far, I appreciate it!

As for how I'm programming the 2560, I'm using standard USB to program it (not an actual serial port), sorry for the confusion.

I'll give the firmware re-flash a try tomorrow or wednesday, and see if that helps.

Just an update:

My body decided that last week would be a great time to acquire an infection, so I've been too sick to try messing with my Arduino until today, so I decided to give the re-flash a try.

Unfortunately, I've hit a snag. All the posts in the thread posted earlier (this: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1286088093/30#34) point to another forum post for visual directions on how to put the Arduino into DFU mode to update the firmware.. this link, specifically: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1285962838/10#10

However, whenever I try to open that link for further direction, I just get an error: Error: You are not allowed to access this section.

Is there an alternate location for this information? I've tried searching the net, but every other piece of info I've found on putting the Arduino in DFU mode just links back to that same inaccessible forum post. I also found some info in the README on the Arduino firmware github page: https://github.com/arduino/Arduino/tree/master/hardware/arduino/firmwares/arduino-usbserial/ but it simply says:
4.a. assert and hold the 8U2's RESET line
4.b. assert and hold the 8U2's HWB line
4.c. release the 8U2's RESET line
4.d. release the 8U2's HWB line

I can figure out the reset part just fine, but as for HWB, I'm not as confident. I tried tracing lines from looking at the Mega's schematic: http://arduino.cc/en/uploads/Main/arduino-mega2560-schematic.pdf but I'm still not sure if I'm looking at it right, and I don't wanna accidentally fry my board....

Any further suggestions? thanks!

EDIT:

I just got it working. I found a supposed reproduction of the original image from the error-ing post i mentioned earlier here: Arduino UNO | PDF | Arduino | Computing
and, following some tips from the original thread in this reply: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1286088093/45#56 on how to modify the instructions for the 2560, i was successfully able to re-flash the firmware, and the IDE now works correctly. I was able to upload new sketches immediately, and all appears to be well. Thank you very much stimmer for posting the link to the thread, and thank you wombat42 and baum for your insights!

One final note to anybody stumbling across this in the future: my only fumbling point was that I was not immediately able to determine which capacitor to short to on the 2560 (since the guide was designed with the Uno in mind). To figure it out, just read comment 56 that I linked to immediately above, and keep the 2560 aligned in the same way as the Uno is on the scribd image (i.e. USB port to the left), and it should be obvious. hope that helps!

flyindragon1, if you have a moment could you please download the following image

and draw on it an arrow pointing to the place where the second wire should go. Then upload the image here (there's an attachment box under 'Additional Options' when you make a reply on this new board)
If you do that I can add in the rest of the graphics similar to the other image.

OK - sorry I have no experience with the dfu program or with working with the chips and re-flashing. I can do programming and have been doing that for a couple of years.

So I don't understand the dfu utility. I downloaded it and the hex file as in the instructions. But I don't know how to get the dfu programming software to work!

My Mega 2560 will occasionally upload a sketch, but maybe once every 20 tries. I am guessing it's the re-flash problem. I've read the old posts, but I can't figure out how to get the dfu running so I can give the commands listed on the post.

This is very, very frustrating! I am using an old Mac running 10.4 and the newest IDE 22 and I just uploaded dfu-programmer 0.5.2

Help?

You run the commands in a shell / command prompt / terminal. Unfortunately I have absolutely no experience with Macs so can't be of much more help.

THANKS - I just found a link that steps you through installing the dfu program:
https://alliance.seas.upenn.edu/~medesign/wiki/index.php/Guides/MaEvArM-starting-mac
But it needs a much higher level of OSX than I can run on my old machine!
I am still looking.....

We just put up a tutorial on upgrading the 8U2 firmware: http://arduino.cc/en/Hacking/DFUProgramming8U2

I have an old eMac running 10.5. I successfully got macports to install. In terminal I typed in your command and put in the password for sudo.

But now an error:
Warning: no index(es) found. have you synced your source indexes?
error: Port dfu-programmer not found.

Any words of wisdom?

OOPs - assuming I can get it working, is the 10K resistor necessary for the mega 2560?

Yes, you also need to connect HWB to ground on the Mega 2560. I also added instructions to the tutorial for a non-soldering version of the upgrade procedure.

On the other hand, if you're not having problems, you might want to just stick with the current firmware. It should work okay on the Mac. On Linux, it's much easier to install dfu-programmer.

I am having problems with the Mega 2560. It will sometimes let me upload programs several times, but usually I have to shut down the IDE, disconnect the board, reconnect it, start up the IDE and then get one good upload and do the whole thing all over again...and often I still can't get it to upload even then. I can get one successful upload out of maybe 15 or 20 tries.

Any ideas on the error code from terminal?

Thanks for the tutorial! It is great!!!!!!!!!!!!!!!

I have looked at a lot of posts, but don't see an image or description of where the location of the pin to short to ground is. It looks like the group of 6 pins near the usb port is the same as on the UNO, but I can't figure out where the two pins in the UNO illustration are on the MEGA.

It's the two pads near the 6-pins (for the 8U2) on the back of the Mega 2560.

Thanks - even the Arduino official site says that the solder pads are next to the map of Italy silkscreened on the back of the board. I really appreciate your clear and concise tutorial.

Hi,

I'm totally new to Arduino (received this morning the UNO) and I have very few experience with microcontrollers. Here is my experience with the serial issue discussed in this post, in the end my question.

I have an ubuntu 9.10, Arduino UNO, arduino0022 (32bit even if my pc is 64 bit; I guess a Java compatibility issue without consequences for this post).

After 5 minutes of unpackaging I was able to run the blinking led example so I tried the "AnalogReadSerial" and got my board stacked with the TX led always on.

I (eventually) updated the firmware as described in several posts but the problems was still there.

I solved by connecting the board to a Windows PC and uploading a different sketch. I unlocked the /dev/ATM0 serial port on my Linux PC and then it worked again.

I do not know why but I'm not sure I correctly upgraded the firmware.

Now the question, how can I prompt the board to verify the uploaded firmware?

In case the firmware is not upgraded what is exactly the command to avoid until I upgrade the firmware correctly?

thanks in advance,
g.

Unfortunately dfu-programmer doesn't seem to have a verify mode.

Enter the following in a terminal:

sudo lsusb -v -d 2341: | grep bcdDevice

The old firmware is 0.00, the new one is 0.01. If you get 0.00 you need to update the firmware again.

(This might be wrong though, maybe someone else can confirm it is right)

Hi,

I've never done anything with a terminal before...Trying to update this firmware. I've got to the point of resetting the 8u2, and have the terminal open to the right directory, but when I type in

sudo dfu-programmer at90usb82 erase

to the terminal, it either says

sudo: dfu-programmer: command not found

or asks me for a password. there is no password set on my computer for installing things.

any advice? thanks, i'd appreciate it. it's taken me all night to get to this point.

I had the same problem with UNO, suspecting serial flood communication going from arduino. Solution was push and hold reset button on arduino, click on Upload, wait 1-2 secs and release reset button, sketch was then successfully uploaded without notification about used port.

Techie, I'm in the same boat as you. I get one upload per cold boot. Eagerly awaiting a step by step tutorial because I'm not so great with electronics (yet).

Windows 7
Arduino022
Mega2560

Tried with atmega1280, same result.