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.
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:
Select File > Preferences from the Arduino IDE menus.
Check the checkbox next to "Show verbose output during: upload".
Click the OK button.
Do a "Burn Bootloader" operation in the Arduino IDE, just as you did before.
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.
Open a forum reply here by clicking the Reply button.
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.
Press Ctrl+V. This will paste the compilation output into the code block.
Move the cursor outside of the code block markup before you add any additional text to your reply.
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