Need help! MEGA 2560 as ISP to Pro Mini

Hi,

I am new to the Arduino world so please bare with me. I have a MEGA 2560 I want to use as an ISP to a Pro Mini. I bought some Pro mini clones and suspected there was no bootloader as I could not upload a sketch through a USB/TTL or the MEGA 2560 (the sketch uploads/works just fine with other boards that have built on USB connection).

Here is how I wired the setup and how I tried to upload the bootloader (running Arduino IDE 1.6.10 on Mac):

MEGA -------> Pro Mini
5v 5v
GND GND
53 RST
51 11
50 12
52 13

1- Select the MEGA board/port, Arduino ISP programmer, upload ArduinoISP example sketch
2- Wire 22uF cap between reset and GND on the MEGA (and have the wiring as shown above to the pro mini)
3- Select the pro mini board/leave the port the same, Arduino as ISP progammer, and burn bootloader

I keep getting this error:

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

Error while burning bootloader.

I've looked around quite a bit on this forum and others and tried every trick/setup suggested with no luck. Any help is much appreciated!!!

It depends on what version of the ArduinoISP sketch you are using, but you need to read the sketch and see what pin you should be using for the reset signal. In recent versions it was changed from the SS pin (53) to pin 10.

Also, if you continue having trouble getting it going, go into the IDE preferences and checkmark show verbose output during upload. That will give more info about what is wrong.

I think it is very unusual for the bootloader to be missing on new boards, even cheap clones, so you may have something else wrong with the boards.

Since you are bootloading them anyway, you might as well select the Uno board from the menu when bootloading so they will become small Uno's (if they are 16MHz Pro Minis). The Uno bootloader is smaller and better, and it also has a nice 3 blink flash on pin 13 at reset, so you can verify the bootloader is there and verify when it is running.

Turn on verbose upload and see what signature it says it's getting.
000000 or FFFFFF indicates wiring error or chip set to use crystal and no crystal present. Sequential numbers usually indicate reset stuck low.

Some Pro Mini clones have 328's instead of 328p's - the '328's signature is 1e9514

Also - try uploading over serial after telling the IDE that the board is an Uno (try nano too). They all use the same chip, but a different bootloader, and it's not uncommon for clones to have the wrong bootloader on them. (Many people here bootload all their '328p based boards as Uno's - the uno bootloader is a little smaller (that's why max sketch size is a little higher for uno) and uploads faster)

Thank you dmjlambert and DrAzzy - I will try what you both suggested:

1- verify the reset pin in my version of the ISP sketch
2- use the verbose output
3- verify my chip is 328p or 328
4- try the Uno bootloader

I'll give it all a go tonight and post the results.

Here is the update:

1- The chip on the pro mini clone is a 328p

2- I enabled the verbose output during upload

3- The ISP sketch said pin 10 was the reset pin to the target microcontroller (helps to read the code comments!). So I moved the reset to pin 10 on the MEGA and got this error:

avrdude: Version 6.3, compiled on Jun 14 2016 at 19:15:19
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "/Users/Mike/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino2/etc/avrdude.conf"
User configuration file is "/Users/Mike/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/cu.usbmodem411
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 = 0x1e950f (probably m328p)
avrdude: erasing chip
avrdude: reading input file "0x3F"
avrdude: writing lock (1 bytes):

Writing | ################################################## | 100% 0.01s

avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x3F:
avrdude: load data lock data from input file 0x3F:
avrdude: input file 0x3F contains 1 bytes
avrdude: reading on-chip lock data:

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

avrdude: verifying ...
avrdude: 1 bytes of lock verified
avrdude: reading input file "0x05"
avrdude: writing efuse (1 bytes):

Error while burning bootloader.
Writing | ***failed;
################################################## | 100% 0.07s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0x05:
avrdude: load data efuse data from input file 0x05:
avrdude: input file 0x05 contains 1 bytes
avrdude: reading on-chip efuse data:

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

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0xfd != 0x05
avrdude: verification error; content mismatch

avrdude done. Thank you.

3a - I left the reset on pin 10 and used the Uno as the board and re-tried to burn the bootloader. I got what I think is the same error.

4- I went back to pin 53 on the MEGA and re-tried to burn the bootloader with the Uno board selected (I had already tried this before with the pro mini board type selected) and got this error:

avrdude: Version 6.3, compiled on Jun 14 2016 at 19:15:19
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "/Users/Mike/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino2/etc/avrdude.conf"
User configuration file is "/Users/Mike/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/cu.usbmodem411
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.02s

avrdude: Device signature = 0x000000 (retrying)

Error while burning bootloader.
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.

5- Reading the sketch again it said to uncomment a #define line to use pins 11, 12, and 13 for MOST, MISO, and SCK on the MEGA. I connected to pins 11, 12, and 13 before uncommenting line and uploading the revised sketch but something interesting happened - when I connected pin 13 the AREF LED on the MEGA turned off. If I remove pin 13 the LED comes right back on. What would cause that?? If leave the code commented I get the same "device signature" error and if I uncomment the line and re-upload to the MEGA I get the "verification error".

6- I tried the SPI pins on the MEGA for the heck of it - get the same "device signature" error (both pro mini and Uno boards were tried).

7- I'm about to give up :frowning:

Any help in reviewing the errors would be much appreciated. I'm feeling like this is a wiring/code mismatch.

I think the version of the Arduino IDE you are using is not able to burn the bootloader. I have seen various posts where people have had that complaint. Try 1.6.5, 1.6.6 or 1.6.9. 1.6.5 is the most stable but has the older ArduinoISP sketch.

More info in this other thread
http://forum.arduino.cc/index.php?topic=417772.0

Interesting - thanks. I'm going back to 1.6.9 and try again before trying the suggested fix for 1.6.10 in that thread.

I'll give it a go tonight and post the results.

first of all, the reset pin of the pro mini from MEGA is 53, not 10 as nano or UNO.
the cap is not between reset of MEGA, but for the RESET of pro mini.
i use ICSP from nano to nano, without any capacitors, and work just fine.
check connection of the reset pin on the pro mini.

OK - so I have the setup wired like this now (of course 5v and GNDs connected):

SPI MEGA Mini
SS------53------RST
MOSI---51-------11
MISO---50-------12
SCK----52-------13

I did the following with IDE 1.6.9:

1- Selected MEGA 2560 board/processor/port
2- Used ArduinoISP programmer
3- Upload ArduinoISP example sketch (successful)
4- Wired cap between other RST pin and GND on the pro mini (with wiring as shown above)
5- Selected Pro Mini board/processor/left port the same
6- Used Arduino as ISP programmer
7- Selected burn bootloader

I get the following error:

Arduino: 1.6.9 (Mac OS X), Board: "Arduino Pro or Pro Mini, ATmega328 (5V, 16 MHz)"

avrdude: Version 6.3, compiled on Jun 14 2016 at 19:15:19
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "/Users/Mike/Library/Arduino15/packages/arduino/tools/avrdude/6.3.0-arduino2/etc/avrdude.conf"
User configuration file is "/Users/Mike/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/cu.usbmodem411
Using Programmer : stk500v1
Overriding Baud Rate : 19200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

avrdude done. Thank you.

Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

I noticed this time through for each attempt was very slow (maybe 3-5 seconds for each attempt) and no "serial activity" from the Rx/Tx blinking on the MEGA and pro mini like during my last attempts.

Any help is appreciated!

So I found this on YouTube (I actually speak a bit of Turkish so I could follow):

There were 3 differences I could see from what I was originally doing:

1- The 5v and GND on the mini were using the connections adjacent to one of the RST pins (I don't think that should matter??)
2- He has the cap going to the same ground as the mini - I had mine going to different ground on the MEGA.
3- He used the AVRISP mkII programmer where I was using the ArduinoISP for the ArduinoISP sketch

I followed the video and I think made progress - I could see the mini "status" LED by pin 10 attempt to flash (but very dimly) when being read the serial data from the MEGA when trying to upload the blink sketch. I do still get this error:

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

Something I didn't mention before - when you power on the pro mini it has some form of a blink sketch running. It's not the IDE example sketch - the LED blinks (really flashes) every 1.5 seconds or so. Not sure if that means anything. :o

The wiring you had in post #4 was correct. It is correct for ArduinoISP sketches from ide 1.6.6 or later. Look back at the traces, you could correctly read the device signature, which now does not work anymore. You can just use the ArduinoISP sketch without modification and pin 10 to reset the target, no need at all to use pin 53, neither is there advantage (for your use case) in using the define USE_OLD_STYLE_WIRING to use pin 11,12 and 13.

As dmjlambert indicated, the problem is related to the use of avrdude 6.3, which came withe the combo "ide 1.6.10 / AVR board package 1.6.12". (Yes these numberings are confusing). You downgraded the ide to 1.6.9 but your ide still uses avrdude 6.3 (see your listing in post#9). This is probably is because your AVR Board package is still at 1.6.12 (check with board manager). You could revert to AVR board package 1.6.11, but in mean time you can also upgrade to package 1.6.13 which rolled back avrdude to v6.0.1.

You're almost there.
If you use AVR Board package 1.6.13, it will work, also with ide 1.6.10.

Thanks, PeterVH.

I installed AVR boards package 1.6.13 (and restarted the Arduino IDE program), used IDE 1.6.10, and pin 10 on the MEGA for the reset.

So, I initially got this error:

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x1c
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x1c
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x1c
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x1c
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x1c
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x1c
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x1c
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x1c
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x1c

But, when I watched the Youtube video I noticed instead of using the "upload" button in the sketch he used the "upload using programmer" function under the sketch toolbar - doing that lead to success!!!!!

Thank you all for the help - this was quite the learning experience for me!