Unable to burn bootloader avrdude: initialization failed, rc=-1

Hi all,
I am trying to burn the bootloader to a ATMEGA328P chip soldered on my project board (it's a surface mount chip straight from Digikey) using 6 pin ISP. I am using usbtinyisp and arduino ide configured as board "arduino pro or pro mini" and cpu as "atmega328p 3.3V 8MHz". When I click burn bootloader I get error

Error while burning bootloader.
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

This seems to be a very common issue and I tried to check everything mentioned in various posts. I checked that every of the 6 pins is connected to same pin on the tinyisp using multimeter, I see the vcc shows up as 5V, I double checked that all pins for gnd and vcc and avcc are connected. There is currently not much else on the board populated so no pins are loaded. There's a 10k resistor from reset to vcc, bypass capacitors on power pins and crystal with its capacitors populated as well.

The only thing I was suspecting is that the crystal does not seem to be oscillating. It is an 8MHz crystal and most guides give 16 but it is still supposed to work. I tried to replace it with 16 and I also replaced load capacitors from 18 to 33pF and then back, no change. I am at the end of my wits - is it not possible to program SMD version of ATMEGA328P and only the DIP version (since that's all I see in all tutorials)? I see from datasheet that the default fuse is for 8MHz internal resonator so I would suspect that is why crystal is not oscillating but then is it even needed? Does anyone have any ideas? Thanks.

Please do this:

  • (In the Arduino IDE) File > Preferences
  • Check the checkbox next to “Show verbose output during: upload”.
  • Click the “OK” button.
  • Try to burn the bootloader.
  • After the Burn Bootloader process fails, you’ll see a button on the right side of the orange bar: “Copy error messages”. Click that button.
  • In a forum reply here, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum’s code tags markup to your reply.
  • Press “Ctrl + V”. This will paste the Burn Bootloader output between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.
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:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : usb
         Using Programmer              : usbtiny
avrdude: usbdev_open(): Found USBtinyISP, bus:device: bus-0:\\.\libusb0-0001--0x1781-0x0c9f
         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 : USBtiny
         Description     : USBtiny simple USB programmer, https://learn.adafruit.com/usbtinyisp
avrdude: programmer operation not supported

avrdude: Using SCK period of 10 usec
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

Error while burning bootloader.

I just hooked up Arduino Uno as ISP and tried that - getting different error but still not working.

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x03

I am going to check if the ISP pins are actually connected to the ATMEGA pins in case I botched the soldering job. Or it could be that the microcontroller itself is dead (too much heat during soldering maybe)?

OK, thanks. Unfortunately I don't have much experience with troubleshooting the USBtinyISP programmer. Hopefully someone else here will have an idea. I'll try to answer some of your questions though:

aos007:
is it not possible to program SMD version of ATMEGA328P and only the DIP version (since that's all I see in all tutorials)?

It is possible to program the SMD version. There is no difference between DIP and SMD in this regard. You will most often see the DIP package used in the breadboard Arduino type of tutorials simply because the DIP package is breadboard friendly and also easy to solder so it's more popular. But there are thousands of people programming SMD ATmega328P chips on the SMD Uno, Nano, and Pro Mini boards.

aos007:
the default fuse is for 8MHz internal resonator so I would suspect that is why crystal is not oscillating but then is it even needed?

No, it's not needed with the settings the ATmega328P comes from the factory with. As you noted, these are configured to use the internal resonator. It's only when you have changed the fuses (or buy one of the ATmega328P that are marketed to Arduino users with a pre-flashed bootloader so they can be plugged right into an Uno) that an external clock source is mandatory in order to program the chip.

aos007:
I just hooked up Arduino Uno as ISP and tried that - getting different error but still not working.

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x03

OK, now I'm in more familiar territory. Did you upload the File > Examples > 11.ArduinoISP > ArduinoISP sketch to the Uno?

I did not. Let me try that. I didn't realize I need to upload the sketch to the Uno first.

Ok, I hope I did this right, I uploaded sketch to Uno and used "burn bootloader" with programmer "arduino as ISP". I am getting this error now:

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:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM7
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
         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 : 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)

Error while burning bootloader.
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.

Carefully check that the wiring between the programmer and target matches with the Arduino as ISP tutorial:

Yes, that is the link I used to wire Uno to my board's ISP. I checked that the pins connect to correct pins on the chip itself with multimeter as well. I used pro mini as a base for the microcontroller part of my board so there's a LED on the SCK (pin 17) and it flickers when attempting to program as I'd expect. At this point I can only suspect that the chip is dead.

Sadly, even after replacing the chip I still can't burn bootloader.

Actually, after retouching the chip with the soldering iron I was able to burn the bootloader using the Arduino. So the original chip must have died. Thanks for your help!

I'm glad to hear it's working now. Thank you for taking the time to post an update. Enjoy!
Per

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