Arduino Forum

Using Arduino => Microcontrollers => Topic started by: alkopop79 on Nov 20, 2012, 09:11 pm

Title: Arduino Mega 1280 bootlader reinstall with an other Arduino
Post by: alkopop79 on Nov 20, 2012, 09:11 pm
I have a Mega 1280 compatible Freeduino Epic. Since I cannot upload any sketches to it I need to reinstall the bootloader. I haven't found much info how to do that. Most Mega related articles describe how to use the Mega as a programmer, not as a target. I want to use a Duemilanove as a programmer. Any ideas would be appreciated!
Title: Re: Arduino Mega 1280 bootlader reinstall with an other Arduino
Post by: alkopop79 on Nov 20, 2012, 09:39 pm
I followed the wiring described here Wiring for Mega2560 and similar (http://Wiring for Mega2560 and similar) but the IDE gives me this error:

avrdude: Version 5.11, compiled on Sep  2 2011 at 18:52:52
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/Applications/Arduino 2.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/alkopop79/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : stk500v2
avrdude: usbdev_open(): did not find any USB device "usb"


Needless to say, the Duemilanove has the 'Arduino ISP' sketch uploaded and then the board set to Mega 1280 in the IDE's menu. Any ideas?
Title: Re: Arduino Mega 1280 bootlader reinstall with an other Arduino
Post by: alkopop79 on Nov 20, 2012, 09:42 pm
Silly me, I haven't set the Programmer to 'Arduino as ISP'. I set it then I got this error message:


avrdude: Version 5.11, compiled on Sep  2 2011 at 18:52:52
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/Applications/Arduino 2.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/alkopop79/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/tty.usbserial-A9007KZM
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Recv: . [15]
avrdude: stk500_getsync(): not in sync: resp=0x15

avrdude done.  Thank you.


What am I doing wrong?
Title: Re: Arduino Mega 1280 bootlader reinstall with an other Arduino
Post by: CrossRoads on Nov 20, 2012, 10:25 pm
Try NickGammon's code/approach
http://www.gammon.com.au/forum/?id=11635
1280 is same as 2560, 1/2 the memory.
Title: Re: Arduino Mega 1280 bootlader reinstall with an other Arduino
Post by: alkopop79 on Nov 20, 2012, 11:37 pm
Tried, still get error:

avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
(http://avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding)


Title: Re: Arduino Mega 1280 bootlader reinstall with an other Arduino
Post by: alkopop79 on Nov 20, 2012, 11:40 pm
Success, thank you!
Title: Re: Arduino Mega 1280 bootlader reinstall with an other Arduino
Post by: CrossRoads on Nov 21, 2012, 02:49 am
Whatd' you do different? Learn & share here.
Title: Re: Arduino Mega 1280 bootlader reinstall with an other Arduino
Post by: alkopop79 on Nov 21, 2012, 03:06 am
Read the whole post... embarrassing. But basically this is the solution:

- wire the programmer and the Mega (or in this case the Freeduino Epic) like this:

Programmer       Mega
D10 (SS)            Reset
D11 (MOSI)          D51
D12 (MISO)          D50
D13 (SCK)           D52
Gnd                   Gnd
+5V                   +5V


- download the sketch from here: http://gammon.com.au/Arduino/Atmega_Board_Programmer.zip (http://gammon.com.au/Arduino/Atmega_Board_Programmer.zip) and upload it to the programmer Arduino

- set the Tools/Boards the target to Mega (1280 in my case)

- open the serial monitor, type 'g' and hit Enter

Taraaaaa! That's it! Special thanks to Nick Gammon for the excellent post and the sketch!
Title: Re: Arduino Mega 1280 bootlader reinstall with an other Arduino
Post by: retrolefty on Nov 21, 2012, 03:38 am

Read the whole post... embarrassing. But basically this is the solution:

- wire the programmer and the Mega (or in this case the Freeduino Epic) like this:

Programmer       Mega
D10 (SS)            Reset
D11 (MOSI)          D51
D12 (MISO)          D50
D13 (SCK)           D52
Gnd                   Gnd
+5V                   +5V


- download the sketch from here: http://gammon.com.au/Arduino/Atmega_Board_Programmer.zip (http://gammon.com.au/Arduino/Atmega_Board_Programmer.zip) and upload it to the programmer Arduino

- set the Tools/Boards the target to Mega (1280 in my case)

I don't understand the above step, I though that nicks sketch running on the programmer figures out what kind of board it's wired to via reading signature bytes from the target board? , what does the IDE have to do with the burning process at this time that would require the target board type to be selected in the IDE?  Lefty

- open the serial monitor, type 'g' and hit Enter

Taraaaaa! That's it! Special thanks to Nick Gammon for the excellent post and the sketch!