Burning bootloader on a blank ATmega2560 on a custom PCB

Hello!

I have a custom PCB, which was planned to be used with ATmega2560-16AU, with the picture below showing the schematic of its circuit.

Now problem occurred when I've tried to burn the bootloader via ArduinoISP sketch, using Arduino Uno board and "Arduino as ISP" programmer. I've tried to find a similar problems on the forum prior to opening the topic, but without any result. Below I'm adding the output log of the bootloading process:

"C:\Users\uidk5053\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\uidk5053\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -patmega2560 -cstk500v1 -PCOM6 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xD8:m -Ulfuse:w:0xFF:m

avrdude: Version 6.3-20190619

  •     Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/*
    
  •     Copyright (c) 2007-2014 Joerg Wunsch*
    
  •     System wide configuration file is "C:\Users\********\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"*
    
  •     Using Port                    : COM6*
    
  •     Using Programmer              : stk500v1*
    
  •     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 : 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.02s

avrdude: Device signature = 0x1e9801 (probably m2560)
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 "0xFD"
avrdude: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.02s

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

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

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

Writing | ################################################## | 100% 0.02s

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

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

avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0xFF"
avrdude: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.02s

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

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

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified

avrdude done. Thank you.

"C:\Users*\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users*\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -patmega2560 -cstk500v1 -PCOM6 -b19200 "-Uflash:w:C:\Users******\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6/bootloaders/stk500v2/stk500boot_v2_mega2560.hex:i" -Ulock:w:0x0F:m

avrdude: Version 6.3-20190619

  •     Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/*
    
  •     Copyright (c) 2007-2014 Joerg Wunsch*
    
  •     System wide configuration file is "C:\Users\********\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"*
    
  •     Using Port                    : COM6*
    
  •     Using Programmer              : stk500v1*
    
  •     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 : 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.02s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000 (retrying)

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.

Failed to burn bootloader: uploading error: exit status 1

Now after this attempt, every attempt to burn the bootloader gives back "Device signature = 0x000000", which I don't get why, since wiring is obviously okay because at the beginning device signature was properly read.

I would say the oscillator is not working properly.
The raw chip has set an internal clock by default. Fuse settings is for an external source. This thing changed by the first write.
If you have oscilloscope it's easy to check XTAL1, XTAL2 pins. If you have not, you can use DMM. Since there is 50:50 clock signal, the DMM should show something about VCC/2 on XTAL1, little less. If it works of course.

There is ArduinoISP modified sketch (try to search on the internet), with 8MHz square output on pin 9. Connect it to XTAL1 pin.

BTW: The RESET circuit is missing on the schematics. At least, RESET pin should be connected to VCC via pull-up resistor cca 10kOhm.

1 Like

... and the controller won't start anymore...

The conclusions seem quite logical.

Should we assume the schematic shown is only the MCU and some surrounding components?

Assuming so, I would (do on my boards)

Connect a voltmeter ground to incoming power ground and measure the voltage on each pin of the MCU (including the grounds) verify they are all what you would expect.

You can rescue chips that are "bricked" like this by injecting a clock signal into XTAL1; it may be configured to want a crystal, but it'll be happy as long as some regular clock shows up.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.