Burning bootloader on 328p failed, now seems bricked

Hello!
I am clueless on problem so asking community. What happend: Uploaded sketch to blank 328p using USBasp successfully but it was running on internal oscillator (checked by reading fuses using avrdude), but I wanted to use an external crystal. In order to avoid messing with fuses manually I decide to just burn bootloader (which is supposed to set proper fuses for use of 328p in arduino board aka bootloader size and external oscillator setting), simply using "Burn bootloader" option in Arduino IDE. It failed due to not able talk to 328p and end it. But now chip seems dead. Previously uploaded program do not run at all (have "hearthbeat led" that do not blink now at all) and avrdude can not dettect chip, can not read fuses or access chip in any way. And yes I do have 16MHz crystal with two 22nF capacitors on xtal1 and xtal2.

So what went wrong? It feels more or less bricked up now, but how is it possible when bootloader sequence failed to even start. Sidenote, in the past I did run into same issue with tiny44 and tiny85 chips as well. But since pattern of failure repeats it coulnd not be coincidence.

Any tips and advices on issue?
Many thanks

Please provide more details. They might end up being important for the helpers here.

The "Burn Bootloader" operation erases the memory, so this is normal and expected.

I'm going to ask you to provide the full verbose output in case it might contain some information that could help us to identify the problem.

Please do this:

  1. Select File > Preferences from the Arduino IDE menus.
  2. Check the checkbox next to "Show verbose output during: upload".
  3. Click the OK button.
  4. Do a "Burn Bootloader" operation in the Arduino IDE, just as you did before.
  5. 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.
  6. Open a forum reply here by clicking the Reply button.
  7. Click the </> icon on the post composer toolbar. This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
    Code block
  8. Press Ctrl+V. This will paste the compilation output into the code block.
  9. Move the cursor outside of the code block markup before you add any additional text to your reply.
  10. Click the Reply button to post the output.

Here it goes! These advanced logs don't tell me much, hopefuly they can tell you something. Ty!

C:\Users\Michelle\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude -CC:\Users\Michelle\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf -v -patmega328p -cusbasp -Pusb -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDE: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\Michelle\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/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: warning: cannot set sck period. please check for usbasp firmware update.
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.

Error while burning bootloader.

There is (or should be) a jumper on your USB-ASP device that forces it into slow mode, allowing it to sync to the 328P's clock regardless of how it's configured. Sometimes this jumper is not populated; i.e. the pins aren't soldered onto it, but the pads & holes are there. It's NOT the 3.3V-5V jumper, but the other one with 2 pins. Shorting those pins will force USB-ASP into slow speed mode. You can then try again setting the fuses and/or burning the boot loader.

Okay guys, crisis averted. I did figure it out. I guess.
Fidling around I did try old trick of giving "dead" chip extrenal clock signal on xtal1 pin, feeding it 1MHz from my scope. It worked facepalm Avrdude now can talk to it again. So why it did not work with crystal? Well I dum dum not read Atmel's datasheet carefuly enought and used 22nF insted of 22pF. 99% chance why it isn't working. Oh silly me. And why it failed when burning bootloader? My guess is that it erease flash as menationed above, then set fuses, then try program bootloader. And since fuses were set for external clock but external clock was missing due to hardware problem it failed.
Wau, what an amateur mistake. Well I guess I have to order some capacitors now :smiley:

3 Likes

Yes, that sounds like a very good analysis indeed! I bet the 22pF caps will solve the issue.

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