Communication/bootloader problem with clone Nano ATmega328P

Hi all, I've been here a few times, but I've stopped lurking because I've got a problem. :slight_smile: :confused:

Background: I bought two Nano ATmega328P clones, I needed to(and expected to) install drivers, due to them having ch340 chips for usb communication.
I think I got that right, both boards show up under "device manager" as ch340 devices, is that correct?

I did not expect the next problem.
I tried to upload a sketch, but that failed. It also turned out that out of the four leds on each board(PWR, RX, TX and PIN13), only the PWR led was working. The reset button, when pressed, also did not seem to do anything(such as blinking the PIN13 led).
After some internet searching, the cause that fit the symptoms turned out to be a corrupted/non-existent bootloader.

I took out my Mega 2560 clone and after a bit of thinking, started following the necessary tutorials for burning a bootloader via arduino-as-programmer. I ran into more problems, and could not burn a new bootloader.

I ran into the dreaded 0x00000/0x0ff000 nonsense signature error type of stuff, but the curious thing was that I got the same error, even when the nano clone was not wired up to the mega2560(acting-as-programmer).

So what could my problem be? Is there a chance that the ATmega328p chips on my nano boards are fine after all? Could there be a problem with the mega2560 clone preventing it from doing its job?
I don't think that I touched the fuses on the nano boards, unless pressing -F on my keyboard can do that(without changing any IDE settings)? :-[

If I am missing any out any info that could help solve the problem, just tell me and I'll post it. Its a bit late at night at the moment.

Many thanks! :slight_smile:
Foss.

Ch340 sounds right to me, do they also show a COM number?

No flashing LED is a bit weird indeed. But now the million dollar question you left out, how exactly did you connect both boards? And what did you select / pressed? :wink:

Yes, COM5.

See attached picture for my wiring, I also attached a link to my Nano pinout reference picture.

I followed this instructable: Instructables-How-to-use-Arduino-Mega-2560-as-Arduino-isp
Arduino nano pinout: [spoiler][/spoiler]

Code is the ArduinoISP sketch in "Examples". Arduino IDE is 1.6.9.

(When trying to burn bootloader)
Board: Nano, chip set as ATmega328p.
Com port selected belonged to the Mega2560(COM4)
Error contents:

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM4
         Using Programmer              : stk500v1
         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 : STK500
         Description     : Atmel STK500 Version 1.x firmware
         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.03s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.03s

avrdude: Device signature = 0x000000 (retrying)

Error while burning bootloader.
Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0xff0000
avrdude: Expected signature for ATmega328P is 1E 95 0F
         Double check chip, or use -F to override this check.

avrdude done.  Thank you.

(happens even when nano is not connected to mega2560)

(Will upload wiring pic later, need to resize it. For now, look at the pic in intructables link)

Easiest thing about a Mega and a Nano is that they both have a programming header... So just connect all pins 1 to 1 from Nano to Mega except the reset of the Nano. Nano reset needs to go to Mega pin 53.

Or, if you don't want to use the header,
Nano 11 to Mega 51
Nano 12 to Mega 50
Nano 13 to Mega 52
Nano 5V to Mega 5V
Nano GND to Mega GND
Nano RST to Mega 53

Maybe it's obvious but don't connect the Nano to USB....

And after uploading the ArduinoISP sketch, did you do what the tutorial says (but is missing in the image) in big fat letters? (But I would say 100n is a bit tiny, arduino.cc calls for at least 10uF.)

And as far as COM ports, it's useless to scream COM5! If you can upload the ArduinoISP sketch you selected the right one.

And before trying to burn the bootloader, don't forget to change the board. And if you want to even upgrade your Nano's, select the Uno instead of the Nano. The Uno and Nano have the same microcontroller but the Uno bootloader is wayyyyy better. You only have to remember to select Uno when you want to program the Nano later :wink:

The problem is that pighixxx screwed up that pinout diagram(it's gotten many other people). The MISO and MOSI pins are switched with each other. The correct diagram is at http://www.pighixxx.com/test/portfolio-items/nano/?portfolioID=314:

To clarify:
I used the pin to pin method that bypassed the ICSP headers, as you listed above.

I used a 100nf Cap

The usb was connected to the mega, not nano. :wink:

So, per septillion's suggestions:

I changed the wiring, ICSP to ICSP(with nano ICSP reset to mega pin 53, mega ICSP reset left unwired)

Cap size to 10uf.

Board in menu selection changed to Uno, not nano.

Error with Nano ICSP not wired to mega, left unconnected:

((Left rest of code out, as it is identical to everything before the "avrdude: AVR device initialized and ready to accept instructions" line in my previous post above))

Error while burning bootloader.
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.03s

avrdude: Device signature = 0x00ffc3
avrdude: Expected signature for ATmega328P is 1E 95 0F
         Double check chip, or use -F to override this check.

avrdude done.  Thank you.

Error with Nano ICSP wired to mega, connected:

((Left rest of code out, as explained))


avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.03s

avrdude: Device signature = 0x00ff00
avrdude: Expected signature for ATmega328P is 1E 95 0F
         Double check chip, or use -F to override this check.

avrdude done.  Thank you.

Wrong microcontroller found.  Did you select the right board from the Tools > Board menu?

Thanks pert, but I'm getting the same types of errors with the correct wiring. :frowning:

(Checked the orientation of the ICSP by looking for the '1' marker and working from there)