Avrdude: Device signature = 0x000000 (Any help is appreciated)

Hi everyone!!
So I tried to burn a bootloader on an ATmega328p and everytime that it could read and write it would end answering "avrdude verification error first mismatch at byte 0x0000 0x00 = 0x0C", the command I was using was:

avrdude -p ATMEGA328P -c usbasp -P COM1 -u -U flash:w:Contador_Pulso_Modbus_Slave.ino.with_bootloader.hex -U lfuse:w:0xFF:m -U hfuse:w:0xDA:m -U efuse:w:0x05:m

and after some trials and continous errors it started to give the following msg, and I was "locked" outside.

   Arduino: 1.8.15 (Windows 10), Placa:"ATmega328, Yes (UART0), EEPROM retained, 328P / 328PA, BOD 2.7V, LTO disabled, External 16 MHz"



    avrdude: Version 6.3-20201216

     Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

     Copyright (c) 2007-2014 Joerg Wunsch



     System wide configuration file is "C:\Users\Yuri\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.1.3/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.

Erro ao gravar o bootloader.

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.

I've checked the wires at least 5 times, and now everytime I try anything it responds:

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.

Could I have bricked my atmega328p??

Well I gave up on the usbasp and used an nano as isp, also changed the mega328p that apparently really was bricked, and it worked.. Not really sure if I was using the usbasp wrong or if itself was the problem considering that it bricked about 3 mega328p. No ideia of why it really didnt work though.

If the ATmega328P was brand new, it makes sense. USBasp has to be set to slow SCK. Raw ATmegas have the clock set to 1MHz from internal oscillator and the problem is due this low frequency. USBasp should have a jumper JP2 (according original Fischl design) for it. Chinese clones usually have just pads on the board and can be marked diferently. There is newer FW for USBasp which deals with this problem. Try to search the forum if you interest. Another solution should be to use the avrdude with -B option. I think -B5 for virgin ATmega with 1MHz clock.

I was using a 16MHZ crystal at the xtal1 and xtal2, and I also tried the -B for many different frequencies. It also had jumper JP2, dont know if it was a clone though.