Failing to burn bootloader on ATmega328P-PU using Arduino Mega 2560

Hello, ahoi, hi.

I recently bought an Atmel ATmega328P-PU chip for an outdoor project, so there would be no risk of damaging my precious Arduino when It's raining,

But after several days of desperate browsing through the internet, I have found only a few tutorials (because about 95% of tutorials out there use Arduino Uno) that I can use with my Mega. Although each and every one of them has failed horribly.

I am using my chip with a 16 MHz crystal. Everything's hooked up according to the "ArduinoISP" sketch (pins 50, 51, 52, 53).

But still, I can't quite wrap my head around some stuff...

  • People say you are supposed to put a capacitor (or are you?) between the RESET pin and ... ... well, here comes the problem. Some people say, you have to put ir between RESET and +5V pins, others tell to put it between RESET and GROUND. Wheres the truth???
  • When burning bootloader, I am constanly getting this error:
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.

I know that ATmega328 and ATmega328P have different signatures. But that doesn't seem to be the case. After tinkering around with the avrdude.config file, error still keeps appearing.

  • Somebody mentioned, that changing "heartbeat" delay from 20 to 40 would fix the error. Nope. Not this time.
  • I have also tried using Adafruit's "ArduinoISP2" sketch, unfortunately, with no results.
  • Occasionaly, console says something like:
avrdude: ser_send(): write error: sorry no info avail

No idea what that means, though.

  • Third type of error:
    avrdude: ser_open(): can't set com-state for "\\.\COM8"
    Got this once, don't know what happened.
    So here I am. Sitting at my PC with a bunch of jumper wires, breadboard and chip that can't be used. Burning up my brain with huge confusion.

What's terrible, is that people commenting all those tutorials, are really satisfied. Everything's working fine for them. That keeps me thinking - Have I blown something up? And is there any way to test that?

Thank You.

Disabling Auto-Reset:
Capacitor (1 to 10 microfarad) between RESET (+) and Ground (-)
Some people prefer a low-value resistor (120 ohms?) between RESET and +5V.

Note that the SPI pins of the Arduino Mega are NOT pins 11-13 like on the Arduino UNO. Pin 10 is still used for RESET on both. The pins going to Pins RESET, 11, 12, and 13 on the target come from MEGA Pins 10, 51, 50, and 52 respectively.

I moved the RESET connection from pin 53 to pin 10. Got another error. This time it's different.

avrdude: stk500_program_enable(): protocol error, expect=0x14, resp=0x50
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

It might be time to invest $4 in a USBasp programer from eBay.

Maybe I will. But still, I ain't gonna give up so easily. :slight_smile:

Don’t give up. It really works without problems. Many people use this and me also. The only problem is in wiring so check it twice (error between table and chair). The message “Yikes…” points to bad wiring probably.
Reset has to be pulled up to +5V via 10k resistor, that is all you need with R3 version.

This is my new life's motto: "Never give up." I double and triple-checked all the connections and eventualy got it. Everything works smooth as butter. :slight_smile:

The thing is, that there are four places you need to connect GND and VCC pins. I had connected only half of them.
Thanks for help :smiley: :smiley: :smiley: