Problems with uploading to atmega168

I’m having problems uploading to atmega168, using arduino as isp, pin 10 to atmega reset pin, 11 to mosi, 12 to miso and 13 to sck, selected arduino nano atmega168 and get and error when trying to flash the bootloader

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 "/home/---/apps/arduino-1.8.13/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/home/---/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyUSB0
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
         AVR Part                      : ATmega168
         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        512    4      0  3600  3600 0xff 0xff
           flash         65     6   128    0 yes     16384  128    128  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

Error while burning bootloader.
Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x008000
avrdude: Expected signature for ATmega168 is 1E 94 06
         Double check chip, or use -F to override this check.

avrdude done.  Thank you.

this is the schematic

any idea what might be the problem?, the only thing i can think of that the uc is damaged, will try replacing it if anything else doesn’t work out, the connections are 100% correct, checked them multiple times also less then 10 mohm resistance between them

This won’t stop programming, but AREF should not connect to 5V, it should only have a 0.1F cap to Gnd.

avrdude: Device signature = 0x008000
indicates the chip is not talking.
The design looks good to me otherwise.
I’ve never used the Arduino as ISP. I’d recommend a Programmer that you can just have as a tool, ready to go whenever needed.
This one is $7.77 with free shipping in the US.

Yeah i shoud’ve connected the aref through 100nf cap, made a mistake, ok so i replaced the uc and now it works, i uploaded the bootloader for atmega168 pa from minicore with success, but now there is one more problem, if i try to upload it using uart (micro usb) arduino ide doesn’t detect any device, i think it’s a hardware problem because i changed the connections on the pcb, i made a mistake in the design, connected dtr pin through a 100nf cap to +5v instead of the reset pin, so i cut the traces on the pcb and connected dtr to reset, the weird thing is that before the “fix” arduino ide detected usb device, but now it doesn’t, it should work with the fix right?
picture what i changed on the pcb and upload settings on arduino ide
upload_settings

I can’t tell, is the 10K Reset pullup resistor still in the circuit? The 0.1uF cap and the 10K are what turn DTR from a low level into a low pulse.

Yes the 10 k pullup resistor is still in the circuit, the schematic is like this

and the dtr pin is connected through a 100nf cap to dtr pin of the ch340

There is no short across the cap where the wire was added? That would let DTR being low keep the chip in reset. Could maybe buzz across the cap with a meter, or watch reset line with a scope during an upload attempt and see if a brief low pulse is being generated.

there shouldn't be, gonna check the solder joints again tommorow, when is the reset pulse generated?, during uplaod?, but the ide doesn't even detect the device so there won't be any low pulse on the reset pin right?, also uploaded some test code through spi and it worked so the uc works, if nothing else works i'll try replacing ch340

If you open File:Preference and turn on Verbose Output During Upload,
then expand the bottom of the lower IDE window, then start an upload,
you would see (if there were LEDs installed) 3 quick blips of the RX LED and then a longer burst as this was being display in the IDE screen:

        Programmer Type : Arduino
         Description     : Arduino
         Hardware Version: 3
         Firmware Version: 4.4
         Vtarget         : 0.3 V
         Varef           : 0.3 V
         Oscillator      : 28.800 kHz
         SCK period      : 3.3 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: reading input file "C:\Users\CROSSR~1.CRO\AppData\Local\Temp\arduino_build_79545/sketch_may10a.ino.hex"
avrdude: writing flash (444 bytes):

Writing | ################################################## | 100% 0.08s

avrdude: 444 bytes of flash written
avrdude: verifying flash memory against C:\Users\CROSSR~1.CRO\AppData\Local\Temp\arduino_build_79545/sketch_may10a.ino.hex:
avrdude: load data flash data from input file C:\Users\CROSSR~1.CRO\AppData\Local\Temp\arduino_build_79545/sketch_may10a.ino.hex:
avrdude: input file C:\Users\CROSSR~1.CRO\AppData\Local\Temp\arduino_build_79545/sketch_may10a.ino.hex contains 444 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.06s

avrdude: verifying ...
avrdude: 444 bytes of flash verified

avrdude done.  Thank you.

Can't tell 100% sure where in there with a short sketch, but sometime after the first block of lines.