Tuesday, March 26, 2013

Burn Bootloader to Arduino Mega 2560 rev3

This is quite a bit easier than updating the firmware on the ATmega16U2. Here's what I did.

Stuff you will need:

  • Your Arduino Mega
  • An USBtinyISP (mine says USBtinyISP v3.0)
  • Various software that I will mention
Step 1. Download the latest version of the Arduino IDE.

Step 2. Download and install the USBtinyISP driver found HERE.

Step 3. Download and install WinAVR, found HERE. Detailed instructions found HERE.

Step 4. Open the Arduino IDE. Select your board and the USBtinyISP programmer (do not select a COM port).

Step 5. Plug your USBtinyISP into the ICSP headers on your Arduino (the 6 male headers near the reset button). The red wire goes toward the pin 1 indicator mark. If like me, you had neither a red wire nor an indicator mark, see the *** section. 

Step 6. Plug the USB cable into the USBtinyISP. I left the jumper on it in place so the Arduino got power through the USBtinyISP. 

Step 7. Click Burn Bootloader and wait. It will take a few minutes.

***My USBtinyISP cable did not have a red wire so I had to do some snooping. First I got THIS diagram from HERE. Next I broke out the multi-meter and tested for continuity between the Arduino ground and 5V pins and the ICSP pins. Eventually I found them and worked out which way the cable plugged in. I then made an indicator mark on the Arduino and the cable in sharpie. The cable will only plug into the USBtinyISP one way on mine, but you could check that side with a volt meter too if you're worried about it. For me, the side of the connector that faced the USB socket on the USBtinyISP faced the USB socket on the Arduino.

As I mentioned previously, when I did this I got the error below, but the bootloader appeared to be burned anyway. If someone knows what happened feel free to fill me in. Hopefully it will work for you.

avrdude: verification error, first mismatch at byte 0x3e000
         0x0d != 0xff
avrdude: verification error; content mismatch

I'm not sure what I will write about next, but its sure to be exciting. Stay tuned.

Until Later,

No comments:

Post a Comment