cannot load bootloader

Hi,
I have a Mega328p on a selfmade board and want to load the bootloader to it.
The necessary connections on the board are all ok. I checked them for several times against the schematic, see attachment. In the schematic a 1 MOhm resistor parallel to the crystal is missing. But on the board it is inserted.

I tried two methods:

  1. With an Arduino Uno as an ISP
    The Arduino ISP sketch is loaded.
    In the Tools menue Arduino ISP is selected as programmer.
    After clicking “Burn bootloader” the following error comes up:
Arduino: 1.6.12 (Windows 7), Board: "Arduino/Genuino Uno"

C:\ZusProgs\Arduino\arduino-1.6.12\portable\packages\arduino\tools\avrdude\6.3.0-arduino8/bin/avrdude -CC:\ZusProgs\Arduino\arduino-1.6.12\portable\packages\arduino\tools\avrdude\6.3.0-arduino8/etc/avrdude.conf -v -patmega328p -carduinoisp -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m 

Error while burning bootloader.
avrdude: Version 6.3, compiled on Dec 16 2016 at 13:33:19
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\ZusProgs\Arduino\arduino-1.6.12\portable\packages\arduino\tools\avrdude\6.3.0-arduino8/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : arduinoisp
avrdude: Error: Could not find USBtiny device (0x2341/0x49)

avrdude done.  Thank you.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

I don’t understand why the programmer is looking for “USBtiny device”.

  1. With an USBASP
    In the Tools menue Arduino Uno is selected (Mega328p) as board and USBasp as programmer.
    After clicking “Burn bootloader” the following error comes up:
Arduino: 1.6.12 (Windows 7), Board: "Arduino/Genuino Uno"

C:\ZusProgs\Arduino\arduino-1.6.12\portable\packages\arduino\tools\avrdude\6.3.0-arduino8/bin/avrdude -CC:\ZusProgs\Arduino\arduino-1.6.12\portable\packages\arduino\tools\avrdude\6.3.0-arduino8/etc/avrdude.conf -v -patmega328p -cusbasp -Pusb -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDE:m -Ulfuse:w:0xFF:m 

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

         System wide configuration file is "C:\ZusProgs\Arduino\arduino-1.6.12\portable\packages\arduino\tools\avrdude\6.3.0-arduino8/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : usbasp
         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 : usbasp
         Description     : USBasp, http://www.fischl.de/usbasp/

avrdude: auto set sck period (because given equals null)
avrdude: error: program enable: target doesn't answer. 1 
avrdude: initialization failed, rc=-1
Error while burning bootloader.
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

It seems that both programmers cannot find the target Mega328p.
Here I have to explain that on the board I used 10pF for the two capacitors at the crystal instead of 12pF because I have no 12pF capacitors available.
Could this be the reason?

SupArdu

Hi again,

my problem with loading the bootloader is solved for method 1) and not solved for method 2).

First, I made a mistake in method 1. I set "Arduino ISP" as a programmer in the Tools menue instead of "Arduino as ISP". So I can continue with my project.

But method 2 does not work. The USBasp seems to be a widely used programmer. My USBasp contains the latest firmware, and programming a Mega2560 was successfull.

Is there a difference in programming a Mega328p or a Mega2560 (of course the correct target chip has to be selected in the Tools menue)?