The short version: www.arduino.cc is out-of-date, Mega 2560 Rev 3 info is spread across creation, RESET does not blink LED "L", Blink won't upload, and I'm stuck.
The TL;DR version:
I'm writing this out of frustration with hope that it might save others some time, and that someone (hint, hint) will review and update the "official" web pages that are supposed to "help."
Here's what I have:- Windows 8 OS (yucch)- GIGABYTE GA-B75M-D3H motherboard (8 USB 2.0 and 4 USB 3.0)- Arduino Mega 2560 rev 3
Before plugging anything in, I went to the Official Getting Started page. Read the whole thing top-to-bottom. I noticed that Step 4, Installing Drivers does not mention Mega. Hmmm. And it does not mention Windows 8. Double Hmmm.
Here's what I recall to the best of my frazzled ability:
-
Follow steps 1, 2 and 3. After I plugged the board in, green LED comes on... good. It's labelled ON, not PWR, but I can cope with that. What's this yellow LED by the ATmega16u2 chip, though? Labelled "L". Schematic isn't much help: PWM 13 is low? Thanks for that info. (see step 11)
-
Reading Step 4, I expected a driver installation process to begin, and a port to appear called "Arduino UNO (COMxx)". Ok, maybe it would say "Arduino Mega (COMxx)" instead. Nada. No dialogs, no nothin'.
A peek at Device Manager shows "ATMega16U2 DFU" in "Other Devices", with yellow exclamation. Properties shows no device drivers. Okay...
-
I tried to load the 2560 drivers in the 1.0.3 distribution, from the "drivers" subdirectory. (right click -> Update Drivers -> Specific Location -> Have Disk -> Browse). Oh, the driver isn't signed. Read this.
-
Booted with "Install unsigned drivers" allowed, and the wizard reports the driver "Could not start (Code 10)". Really? Now there's an entry in Ports for "Arduino Mega 2560 R3" with a yellow exclamation mark.
-
google, google, google, google... read Troubleshooting guide. Could be cable? Swapped. Uninstall, reinstall, No change.
-
Could it be the FTDI drivers? Step 4 said "not the 'FTDI USB Drivers' sub-directory", but I think that meant don't use them for the main processor. They're for the FTDI USB interface. Ooo, the VCP drivers from FTDI (CDM 2.08.24 WHQL Certified) are nice and signed. They install successfully, and Device manager shows a new entry "ATmega16U2" under a new class "Atmel USB Devices". No yellow exclamation mark, and its properties look good. (I think... it may have had "DFU" in the name. Also, that entry in Device Manager disappeared when I successfully installed the 2560 driver in step 11 below.)
-
Tried installing the 2560 driver again. No joy. The 2560 entry has the same yellow exclamation mark, and no COM assignment. google, read, google, read...
8 ) Here's an excerpt from the Programming section from the Official 2560 Description:
The ATmega16U2 (or 8U2 in the rev1 and rev2 boards) firmware source code is available in the Arduino repository. The ATmega16U2/8U2 is loaded with a DFU bootloader, which can be activated by:- On Rev1 boards: connecting the solder jumper on the back of the board (near the map of Italy) and then resetting the 8U2.- On Rev2 or later boards: there is a resistor that pulling the 8U2/16U2 HWB line to ground, making it easier to put into DFU mode. You can then use Atmel's FLIP software (Windows) or the DFU programmer (Mac OS X and Linux) to load a new firmware. Or you can use the ISP header with an external programmer (overwriting the DFU bootloader). See this user-contributed tutorial for more information.
I wonder if the ATmega16u2 chip is in DFU mode? Why would a new board be in DFU mode? Whatev. I'll reload it with FLIP as suggested. What exactly should I reload into the ATmega16u2 chip? google, read, read... Obviously the firmwares from the dist down in the firmwares subdirectory. According to the README, I should load MEGA-dfu_and_usbserial_combined.hex, although Arduino-COMBINED-dfu-usbserial-atmega16u2-Mega2560-Rev3.hex is notable.
9 ) In FLIP 3.4.7, I choose ATmega16u2 from the Select Device, choose USB from Communications, then load MEGA...hex. I seem to recall having some "invalid address" errors pop up. I tried to Read the device and got all FFs. After that, I think I was able load the hex file.
-
In FLIP, I press Run and it performs the Erase, but fails to Program. (I forget the error.) I decide to try the steps manually: Erase, OK. Run again (maybe Erase unchecked). It works. Whaaaat? After that, I think the entry in Device Manager changed slightly, maybe to add the COM3 port assignment. I seem to remember a "Device protect is on." error at some point. Sorry.
-
Back in Device Manager, I try to load the 2560 again, and it works! In Device Manager, there is a new Port entry called "Arduino Mega 2560 R3 (COM4)". Finally! However, I had forgotton to delete the bad 2560 device, so I do it now. I also notice that the Device Manager entry for "ATmega16u2" has disappeared!
-
Back to the "Getting Started" guide, I perform step 5, Launch the Arduino app. Under Tools, I select COM4 and 2560 board. Under File, I load Examples -> 01.Basics -> Blink. The infamous Blink. From the code, I see a comment that "Pin 13 has an LED connected on most Arduino boards". So... I guess that would be the yellow LED labelled "L" attached to PWM13. Gotcha. (Do I hear a collective "duh" in the force? As if a thousand facepalms happened at once?)
-
I press Upload, and it compiles and says
Binary sketch size: 1,632 bytes (of a 258,048 byte maximum)
Then it begins to upload. I notice the "RX" light blinks ON for 5 or 6 times, then the Arduino app status box says:
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
If I hold the SHIFT key down when I press Upload, I only get one error message:
avrdude: usbdev_open(): did not find any USB device "usb"
Hmph. I expected more from a verbose mode. google, read, google, read...
- Perhaps the auto-reset isn't working for my board. I'll try connecting pins 5 & 6 on the ICSP connector to do a reset. As the Troubleshooting Guide says, "[press the reset button at] different intervals of time between the two, up to 10 seconds or more."
With an interval of 4 seconds (too late?) I got this message:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
I notice that I can't upload again, because there is no COM4 port any more. Resetting the board removed the 2560 COM port from Device Manager?!? Oh, the "ATmega16U2" reappeared in Device Manager under "Atmel USB Devices". Unplugging the USB and plugging it back removes the 16U2 and restores the 2560 COM4 entries in Device Manager. What?
- The Troubleshooting Guide says
"Make sure there's a bootloader burned on your Arduino board. To check, reset the board. The built-in L LED (which is connected to pin 13) should blink. If it doesn't, there may not be a bootloader on your board."
When I connect pins 5 & 6, LED "L" does not blink. I guess I don't have a bootloader, but danged if I know why not.
Final Questions:
Q1: In the menus for Arduino.exe, I see there's a choice for programmer. Mine is currently set to "avrisp mkii". Is that correct?
Q2: I wonder if I need to force the HWB line to ground before going back to step 8 and re-loading MEGA...hex? Incidentally, this is what my RESET-EN trace looks like:
Is the trace under the mask? It doesn't look like it has been cut, but I'm not sure it was there to begin with.
(14) I'll connect those two during an upload... Oh well, no difference.
(15) This seems to suggest that an old avrdude may be the solution... However, the old avrdude complains about programmer id "wiring".
Perhaps I'm stuck (like many others) at the "timeout" issue. I just got to experience all the problems in one sitting. =( I'm most suspicious of its reset behavior: "L" doesn't blink and the entries change in Device Manager.
Thanks in advance for any clarifications or suggestions,
/dev