Can't bootload ATMEGA328P-PU

I cannot seem to resolve what the issue is as I try to bootload a standalone ATMEGA328P-PU using the Arduino IDE.

I have a 10MHz Crystal and use an FTDI board to power the microcontroller to 3.3V. The AVRISP MKII is used for programming.

On the Arduino IDE I selected "Arduino Uno" for the board and "AVRISP MKII" as the programmer

I get the following message when I try to bootload:

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

I have attached a pic of the setup (hope it works, can't seem to preview it).

Can anyone point me in the right direction? I know the AVRISP MKII is functioning as I can program other projects with it and I am getting 3.3V for the rail.

setup.jpg

The FTDI breakout board is supplying the power? MKii only monitors the power rail.

Couple things look funny:
ATmega328 0x1E 0x95 0x14 << so your avrdude.conf seems set wrong
ATmega328P 0x1E 0x95 0x0F

If you're getting 0x0000ff then the chip is not responding.

Is one of those yellow wires connected to AREF?

CrossRoads:
The FTDI breakout board is supplying the power? MKii only monitors the power rail.

Couple things look funny:
ATmega328 0x1E 0x95 0x14 << so your avrdude.conf seems set wrong
ATmega328P 0x1E 0x95 0x0F

If you're getting 0x0000ff then the chip is not responding.

Yes the FTDI breakout board is supplying the power and the MKII is only monitoring it.

When I change the avrdude.conf to 0x1E 0x95 0x0F I get

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

Yes it is

I also find that if I modify the clock frequency in the "boards.txt" file to

uno.build.f_cpu=1000000

I get inconsistent device signatures:

trial 1:

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

trial 2:

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

memotick:

[quote author=Coding Badly link=topic=236594.msg1700888#msg1700888 date=1398749442]
Is one of those yellow wires connected to AREF?

Yes it is
[/quote]

Remove it.

What markings are on the capacitors?

Are the north sides connected to ground?

The capacitors are 20pF 100V ceramic discs

The north sides are connected to ground.

Post the verbose output.

@Coding Badly let me know if this gives enough info...

/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -cstk500v2 -Pusb -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xde:m -Ulfuse:w:0xff:m 

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.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/SNE/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : stk500v2
avrdude: usbdev_open(): Found AVRISP mkII, serno: 000200135113
avrdude: usbdev_open(): using read endpoint 0x82
avrdude: Sent: . [01] 
avrdude: Recv: . [01] . [00] . [0a] A [41] V [56] R [52] I [49] S [53] P [50] _ [5f] M [4d] K [4b] 2 [32] 
avrdude: stk500v2_getsync(): found AVRISP mkII programmer
         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
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500V2
         Description     : Atmel STK500 Version 2.x firmware
         Programmer Model: AVRISP mkII
avrdude: Sent: . [03] . [90] 
avrdude: Recv: . [03] . [00] . [01] 
avrdude: Sent: . [03] . [91] 
avrdude: Recv: . [03] . [00] . [01] 
avrdude: Sent: . [03] . [92] 
avrdude: Recv: . [03] . [00] . [17] 
         Hardware Version: 1
         Firmware Version Master : 1.23
avrdude: Sent: . [03] . [94] 
avrdude: Recv: . [03] . [00] " [22] 
         Vtarget         : 3.4 V
avrdude: Sent: . [03] . [98] 
avrdude: Recv: . [03] . [00] . [02] 
         SCK period      : 0.50 us

avrdude: Sent: . [10] . [c8] d [64] . [19]   [20] . [00] S [53] . [03] . [ac] S [53] . [00] . [00] 
avrdude: Recv: . [10] . [00] 
avrdude: AVR device initialized and ready to accept instructions

Reading | avrdude: Sent: . [1d] . [04] . [04] . [00] 0 [30] . [00] . [00] . [00] 
avrdude: Recv: . [1d] . [00] . [00] . [00] . [00] . [00] . [00] 
avrdude: Sent: . [1d] . [04] . [04] . [00] 0 [30] . [00] . [01] . [00] 
avrdude: Recv: . [1d] . [00] . [00] . [00] . [00] . [00] . [00] 
################avrdude: Sent: . [1d] . [04] . [04] . [00] 0 [30] . [00] . [02] . [00] 
avrdude: Recv: . [1d] . [00] . [00] . [00] . [00] . [00] . [00] 
################################## | 100% 0.01s

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

avrdude: Sent: . [11] . [01] . [01] 
avrdude: Recv: . [11] . [00] 

avrdude done.  Thank you.

Assuming you removed the connection from AREF there is just one obvious wiring deficiency. You really should have two 0.1 µF capacitors connected from VCC to GND as close as possible to the target. I've programmed targets without bypass capacitors so that is probably not the problem.

Given what you've posted there are just three possibilities left...

  1. Broken or loose wire.
  2. Clocking problem.
  3. Programmer's bitrate.

Only you can do anything about #1.

#2 seems unlikely. The capacitors are in range (12 to 22 picofarads). Everything appears to be connect correctly. There are two clocking options in boards.txt (internal oscillator and external crystal / resonator) so it is unlikely the fuses have been set to something "odd".

Which leaves #3. Your programmer has to be configured for a bitrate of 125K or slower. The avrdude command-line you posted does not include the option to set the bitrate which means it could be anything. I assume your AVRISP MKII has a way to set the default bitrate. I suggest ensuring it is set to a reasonable value.

Remove it.

[/quote]

will do, thanks

@Coding Badly thank you for spending so much time on this.

I removed the Aref connection per your earlier post and it didn't solve the problem... but I left it unconnected
I added supply bypass caps close to the micro which also didn't solve it, but I left them in as they should have been there in the first place.

I doubted it was point #1 above as I completely rewired the system on a different breadboard with new wires.

Your point #3 gave me an idea. I hooked up the AVRISP MKII to AtmelStudio. Its clock was set to 2MHz (less than 1/4 of the 10MHz). I tried reading the part and it didn't work. I tried reducing the clock to 1MHz and it still didn't read the device. However, I set the clock to 125kHz and it DID read the device. I'll see if I can program the part now.....

Setting the AVRISP MKII clock to 125kHz worked!!! Thanks @Coding Badly, I wouldn't have solved that on my own 8)

You are welcome. I'm glad you have it working.

Have you had any experience prior at getting the MKII programmer with uploading the bootloader? I have been failing all week at it (some great people have tried to help with no avail on another thread) and I was curious if you had worked with this before you started using the MKII. Also, I am considering buying the MKII and wanted to know if there was a specific way you changed the speed of it? Thanks, this thread was very informative.