I am attempting to reprogram my Arduino with the MegaJoy software (Google Code Archive - Long-term storage for Google Code Project Hosting.) using FLIP. I have attached my (unmodified and untouched) Arduino to my pc, installed the correct driver, and checked using the 'blink' example script that Arduino would connect to it.
I then proceeded to put the Arduino into DFU mode, as specified here: http://fredgolden.com/Recipe_for_a_cheap_joystick_encoder.pdf
When I connect the required sets of pins, my pc makes the expected de-dunk and du-dink noises. But when I look in device management, the Arduino is still showing up as 'Arduino Mega 2560 (COM 3)', not 'Arduino Mega 2560 DFU' as I expected. Then, when I try and set the driver to the one include with FLIP, it does not accept it and tells me 'you already have the correct driver installed', presumably because the Arduino is not in DFU mode.
Does anyone know how I can get the Arduino into DFU mode? I have read various articles which didn't make much sense to me but seemed to be saying I needed to change the firmware manually with another Arduino, however I only have one! Thanks.
Is your Arduino MEGA 2560 an official Arduino board (about $50) or a clone (less expensive). It is possible that a clone might have the version of the firmware without DFU support. You can get a ISP device for under $5 via eBay and use that to burn a sketch on the 8U2.
Ah ok that may well be what I have got. I will try getting an ISP device then. Thanks!
As I am new to all this, I am a little unsure of what exactly I need, and I don't want to buy something which will not work. Will this one be likely to work for me?
http://www.ebay.co.uk/itm/USBASP-USBISP-ISP-Programmer-Cable-Adapter-KK2-0-KK2-1-Atmel-AVR-ATMega-ARDUINO-/131241223483?var=&hash=item1e8e96253b:m:my5ajIyIlNHKV-vZffc0xBg
Thanks
That should work. Do be aware that if you have another arduino, it could be used instead of a programmer.
UnusualTrainFan:
Will this one be likely to work for me?
http://www.ebay.co.uk/itm/USBASP-USBISP-ISP-Programmer-Cable-Adapter-KK2-0-KK2-1-Atmel-AVR-ATMega-ARDUINO-/131241223483?var=&hash=item1e8e96253b:m:my5ajIyIlNHKV-vZffc0xBg
Yes. The USBasp is the model I use. In many cases the 10-pin to 6-pin adapter is not included and you have to order it separately but in your case it comes included. I recommend it to everyone working with an Arduino because it is so darn cheap! You can currently get the USBasp via eBay.com for $1.82 and the 6-pin adapter for another $1.70. You can get one with a plastic case for $3.19. The cheapest I can see that includes both the USBasp and the 6-pin adapter is $5.25.
johnwasser:
Is your Arduino MEGA 2560 an official Arduino board (about $50) or a clone (less expensive). It is possible that a clone might have the version of the firmware without DFU support. You can get a ISP device for under $5 via eBay and use that to burn a sketch on the 8U2.
I have now received the USBasp and set it up. Is there any possibility you could send a link to the aforementioned sketch please?
Thanks.
The Arduino website has a page on it here. Also, if you want to apply any USB customizations (such as MIDI, mouse, & keyboard) now is the time.
How do I burn the sketch? The page linked doesn't mention anything about the USBASP programmer, and trying the method on the page using flip returns the 'could not open usb device' error....
This article shows how to use a USBasp to install firmware on the 16u2 of the MEGA. This can be used to restore the firmware that includes DFU or it can be used to upload the MEGAjoy firmware in place of using FLIP.
Thanks that should be perfect!
Sorry I am back again.... Apologies for being completely new to this and rather incompetent.
II have been following the tutorial linked above, and I have got as far as downloading AVRDUDE (by installing WinAVR). Then it says:
"Once you have the USBASP connected all you have to do is use AVRDUDE (the program that you use to program the Arduino's main micro-controller) to flash the contents of the hex file: MEGA-dfu_and_usbserial_combined.hex to the USB micro-controller"
The example given is on a mac, and I have a pc. How do I use AVRDUDE to flash the USBASP? I can't seem to find any program called AVRDUDE which I can launch - am I missing anything?
Once again, thanks for all the help...
avrdude comes in the Arduino package so you don't really need to install it separately. For uploading the firmware you need a command like this:
[PATH]/hardware/tools/avr/bin/avrdude -P usb -p m16u2 -b 1200 -c usbasp flash:w:[PATH]/hardware/arduino/avr/firmwares/atmegaxxu2/Arduino-COMBINED-dfu-usbserial-atmega16u2-Mega2560-Rev3.hex -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m -U lock:w:0x0F:m
I don't use Windows so I don't know the path to your Arduino installation. Change the two [PATH] parts to put in the file path to your hardware directory.
To upload a sketch to the 16u2 you would use the same command but put in the full path to your sketch instead of the path to the firmware.
Where do I put the command?
UnusualTrainFan:
Where do I put the command?
In a command window. I don't know what OS you are using so you may have to use Google. The first result I got for 'windows command window' was this: Windows help & learning
Ok thanks for that. I am using Windows 10 for reference. I tried what you suggested however I got this error:

The path contains spaces. You need to put double quotes around the path to avrdude. Use your first attempt. Just a note: to open the command prompt quickly, press the Windows key
and r
together, type cmd
, then press enter.
Thanks for the reply,
A slight improvement - a different error message this time, but a more promising one.
avrdude: can't open config file "": Invalid argument
avrdude: error reloading system wide configuration file ""
Could you copy and paste the whole message by right clicking, pressing mark
, click & drag all of the text, press enter
, and paste it here.