"Messed" up a working nano and unable to build bootloader with mega

Hey guys,

I'm messing things up here. I have two nanos and a Mega 1260.

Nano A : The one that never worked
Nano B : Used to work, burnt the Arduino as ISP on it, which worked. Tried to use it to burn the bootloader on Nano A. It failed. Inadvertantly choose AVR Mkr II and burn bootloader, messed up this one.

Now I have two Nanos without bootloader.

I have a Mega 1260. Tried to burn bootloader on the nanos. I double checked, triple checked my wiring and I'm not able to burnback the bootloaders.

What am I doing wrong??

Here's the output from the IDE.

E:\outils\arduino-1.8.7-windows\arduino-1.8.7\hardware\tools\avr/bin/avrdude -CE:\outils\arduino-1.8.7-windows\arduino-1.8.7\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM5 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m 

avrdude: Version 6.3-20171130
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "E:\outils\arduino-1.8.7-windows\arduino-1.8.7\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM5
         Using Programmer              : arduino
         Overriding Baud Rate          : 19200
         AVR Part                      : ATmega328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : Arduino
         Description     : Arduino
         Hardware Version: 2
         Firmware Version: 1.18
         Topcard         : Unknown
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

Error while burning bootloader.

I've tried two wiring methods this one and the through the ICSP.

el_pablo:
Inadvertantly choose AVR Mkr II and burn bootloader, messed up this one.

There's no way that could mess up anything. The Burn Bootloader process will fail because you selected the wrong programmer, but it won't have any effect on either of the Arduino boards.

I do not remember exactly how I messed up the bootloader on my nano, but it was not responding anymore to any programming.

Anyhow, I found out how to burn my bootloaders!! Hurray!

All the tutorial are using the SPI pins to program from the Mega and the ArduinoISP sketch has been changed sinced, because now the sketch suggest to use the ICSP headers instead.

So here is what I’ve done.

Connect the ICSP headers using 1-to-1 wiring, which is MISO->MISO, MOSI->MOSI, etc. EXCEPT the reset pin.

The pin 10 on the programmer is connected to the reset pin on the target.

I’ve also added a 10µF cap on the reset pin on the programmer to its ground.

HTH someone else

el_pablo:
All the tutorial are using the SPI pins to program from the Mega and the ArduinoISP sketch has been changed sinced, because now the sketch suggest to use the ICSP headers instead.

So here is what I've done.

Connect the ICSP headers using 1-to-1 wiring, which is MISO->MISO, MOSI->MOSI, etc. EXCEPT the reset pin.

The ICSP header is the SPI pins. You can use pins 50-52 on the Mega or the ICSP header pins and it makes no difference because they're both connected to the same pins on the microcontroller on the programmer board. It makes sense to recommend people use the ICSP header from a documentation standpoint because SPI pins are different depending on which board type you have (e.g. Uno, Leonardo, Mega).

el_pablo:
I've also added a 10µF cap on the reset pin on the programmer to its ground.

That is definitely a good idea. It used to be that you could often get away without that capacitor but a recent change has made it more likely to be needed.