Error while burning bootloader to ATmega328

I am stumped. I have read my posts online for solutions and I can not seem to find anything that works. I have reinstalled Arduino and tried to reupload the Arduino ISP sketch and tried the version with and without the 16mhz crystal, used an external power supply. Wires and connections are good. I have actually bought another ATmega328 and same result. Log is below.

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -carduino -PCOM3 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xE2:m

avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

Using Port : COM3
Using Programmer : arduino
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 : Arduino
Description : Arduino
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.01s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x000000 (retrying)

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

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.

All zero response means that connection is not good.
Possible problem could be in used command. Parmeter -carduino says that you must use capacitor 10uF between RESET and GND. Do you have it?
Another solution could be to change -carduino to -cstk500v1.

Try it and post the report.

Nothing. I have tried the 10uf cap you suggested with and without the crystal. Checked connections and they are all good. I tried on both of my atmega328. I am using an arduino mega 2560. You think my arduino is defective? I do have a usb to ttl cp2102 if I could use that instead. Also how would I go about changing the command to burn the bootloader in arduino, as you said to change -carduino to -cstk500v1?

Post some picture with your setup. Something must be wrong. If you have 10uF cap between RESET and GND on Arduino (source/programmer) then -carduino is OK.

I am using an arduino mega 2560.

Mega uses different pins but if you are using ISP connector it is the same. ISP connector is identical.

You think my arduino is defective?

No. The log doesn't point to. Are you able load sketch?...

I do have a usb to ttl cp2102 if I could use that instead.

No, it doesn't help. Uploading via serial is able only with the bootloader.

Also how would I go about changing the command to burn the bootloader in arduino, as you said to change -carduino to -cstk500v1?

You can try to use command from log directly from CMD or edit programmers.txt: "arduinoasisp.protocol=stk500v1"

Budvar10:
Post some picture with your setup. Something must be wrong. If you have 10uF cap between RESET and GND on Arduino (source/programmer) then -carduino is OK.

Mega uses different pins but if you are using ISP connector it is the same. ISP connector is identical.
No. The log doesn't point to. Are you able load sketch?...
No, it doesn't help. Uploading via serial is able only with the bootloader.
You can try to use command from log directly from CMD or edit programmers.txt: "arduinoasisp.protocol=stk500v1"

It looks like I was using the pin out for the nano. I fixed that and tried again and the same thing. I also tried to edit the programmers.txt and the same result. I added attachments of my setup.

Pin 53 to RESET? Check your ArduinoISP sketch whether it is not pin 10. A short time ago here we discussed that old ISP sketch uses 53 (SS on Mega2560), however years ago it was changed to pin 10 for Mega board.
You can add LED with serial resistor cca 1kOhm between RESET and GND on target MCU for indication of reset signal.

Alright I finally got it to work. Found this image to get the right pinout. Weird that there are so many different ones. Maybe they have been changed and others are just not updating the tutorial? Glad I finally got it working. Now I can finish my night light! Also thanks Budvar10 for helping me out.

I think, the change should have to unify the pinout for UNO and Mega. If the ICSP is used then pin 10 leads to RESET and the rest of ICSP pins are just connected 1:1. Same for UNO as for Mega...
I am little bit longer with Arduino so I remember it, even though it's fading.