Unable to burn bootloader on ATmega2560 using ArduinoISP

Hi there! I'm having some trouble with burning the bootloader onto an ATmega2560 chip on a custom PCB. I am using an Arduino Uno as the programmer and have a custom PCB with the ATmega2560 soldered.

I've tried Nick Gammon's bootloader programmer as well as ArduinoISP in the Arduino IDE.

The PCB just has the MCU, 5 decoupling capacitor to the VCC/AVCC pins, a 10k pull-up on the RESET line as well as a 16MHz crystal connected to XTAL with a 22pF capacitor connected to each lead of the crystal. The ICSP pins are being fed directly into a 2x3 header which I have connected with the programming Arduino. I have soldered together two identical boards and tested on both to eliminate any potential issues with the components or board.

I have used an oscilloscope to check all the pins on the board being programmed. MOSI, SCK, Reset all changes while MISO is consistently at 0V. I have checked the TDI, TMS and TCK pins on the MCU and they are all high.

Nick Gammon's board detecting script was able to detect the MCU on one of the boards during one upload but could not detect the MCU after running the bootloader programmer script. On the other board, I was able to set the fuse bits on the other board using avrdude in the command line but ran into invalid device signature after trying to flash the bootloader.

I'm understanding that there is a variety of different sources for the problem, from avrdude writing at too high of a frequency to ArduinoISP not being able to handle the additional memory on the 2560. Apologies for the long post, I just wanted to list all the testing I've conducted to arrive at my current point. I'm looking for any sort of solution/clarification on the state of my ATmega2560 chips. Are they bricked? Is it a PCB design issue? Is it a fuse bit or programming setting that I failed to setup properly?

(deleted)

Please do this:

  • File > Preferences > Show verbose output during: > compilation (uncheck) > upload (check) > OK
  • Tools > Burn Bootloader
  • After the process fails you’ll see a button on the right side of the orange bar “Copy error messages”. Click that button.
  • Paste the error messages in a reply here USING CODE TAGS (</> button on the forum toolbar).

My bad, here’s the error message after trying to burn the bootloader using ArduinoISP:

Arduino: 1.8.8 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

C:\Users\andre\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14/bin/avrdude -CC:\Users\andre\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14/etc/avrdude.conf -v -patmega2560 -carduino -PCOM5 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xD8:m -Ulfuse:w:0xFF:m 

avrdude: Version 6.3-20171130
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Users\andre\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14/etc/avrdude.conf"

         Using Port                    : COM5
         Using Programmer              : arduino
         Overriding Baud Rate          : 19200
         AVR Part                      : ATmega2560
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         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    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
           flash         65    10   256    0 yes    262144  256   1024  4500  4500 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 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 : Arduino
         Description     : Arduino
         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.00s

avrdude: Device signature = 0x000000 (retrying)

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

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 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 done.  Thank you.

Error while burning bootloader.

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

I’ve attached the KiCAD files as well as a pdf of the schematic. The board layout would’ve been too messy to read in pdf format with the copper pours.

I’m aware that the ICSP headers on my board are in different order than that of an Arduino, I’ve triple checked the connection.

Thanks in advance for your help! Doesn’t have to be a solution, it’d be just as great if I can start eliminating potential failure points,

Custom ATmega PCB.zip (266 KB)

Schematic.pdf (263 KB)

Have you checked the continuity on the MISO line? Sometimes jumper wires are defective, or get damaged with use so that they no longer conduct electricity.

I've tripled checked the jumper wires, they're fine. I've also checked the header and traces on my PCB with an oscilloscope, there is no data being transmitted on the MISO line.