Error Burning Bootloader to Atmega2560 with USBASP

Hey Guys.

I made a custom hardware with an Atmega2560-16AU Microcontroller and I'm not able to burn the bootloader to it.

My Hardware is quite simple, the MCU is powered with 5V, there are 5 100nF Capacitors next to each VCC Pin (10, 31, 61, 80, 100). Reset is pulled up with a 10k Resistor and a 100nF Decoupling capacitor. And there's a 16Mhz Crystal Oscillator with 2 22pF Capacitors and a 1M Resistor between Pin 33 and 34. And of course the ISP Header.

By now nothing else is connected.

I'm using the USBASP Programmer (this one: USBASP

When I try to burn the bootloader, since the MCU is brandnew, I get this Error Message:

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\Keller\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : usbasp
         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 : 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
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

Chip-Löschung fehlgeschlagen: Hochladefehler: exit status 1

My USBASP is working correctly because I tested it on a custom Atmega8 Board and there it works without a problem.

Hope someone can help

ENW033_Nexus-Mainboard_00-00-MCU.pdf (550.4 KB)

Hi @s-fr. One of the potential causes of this error is the cable between the USBasp and the target board not being correctly connected. You should double check the connections.

Make sure the orientation of the connector on the ICSP header of the target board is correct (as opposed to being rotated 180°. Pin 1 on the connector is indicated by a small triangle embossed on the plastic housing. Pin 1 on the Arduino board's ICSP header is indicated by a white dot on the PCB's silkscreen.

Make sure all the pins on the ICSP header are inserted into the connector. It is possible to plug the connector shifted over by one row of pins so that only one half of the pins are inserted into the connector.

If you find any problems with the connections, fix it and then try the operation again. Hopefully this time it will be successful.

If there aren't any problems with the connections, or if the operation still fails even after you correct the connections, add a reply here on this forum thread to let us know. If the error message is no longer "initialization failed, rc=-1" then make sure to include the full and exact text of the new error message in your reply.

The connections are definitly not the problem. I do not measure a crystal frequency but I'm not sure if I should as the chip is brandnew

I found a solution that works for me, it's strange and I can't explain, I used an old Arduino Uno as an ISP Programmer and it worked without a problem though the USBASP also works on other MCUs

1 Like

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