ATmega 168 bootloader issue

Hello!

I have a problem trying to burn a bootloader onto an ATMega 168 microcontroller. I am stuck and need help. here is the situation:

Sorry if this question has been asked and answered. I have seen some people having the same kind of problem on these, but none of the proposed solutions have helped me.

In my university course I need to build an temperature sensing device. I am not allowed to use an Arduino and instead they want us to use an microcontroller on its own eg. ATMega 168.

To this end I have been following the following instructions from the Arduino site:
https://docs.arduino.cc/built-in-examples/arduino-isp/ArduinoToBreadboard/

From my university I have obtained an Elgoo UNO R3 Arduino "copycat" with an ATMega 328 microcontroller. I am trying to load the bootloader onto an ATMega 168 microcontroller. I have a 16 MHz crystal (at least that is what it was labeled as at my uni) and two 22 pF capacitors and also a 1 kΩ resistor going from the ATMegas pin 1 to +5 V.

As in the instructions I uploaded the "ArduinoISP" sketch onto the board without issues. Then I selected the board Arduino Duemilanove with the processor ATmega 168 and the programmer Arduino as ISP and tried to "burn bootloader". This is where the problem lies.

Here is the "verbose" output for uploading:

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\(user)\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

         Using Port                    : COM3
         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

Reading | ################################################## | 100% 0.03s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.02s

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.

Failed chip erase: uploading error: exit status 1

I have checked and rechecked the connections and I am sure they are as in the instructions I linked, I've rebuilt the circuit many times, and I have also tried connecting the Arduinos reset pin via a 100 Ω resistor to the 5 V supply but that did not help. I have tried to use the Arduinos own crystal incase the 16 MHz crystal is broken. I have tried atleast one other ATMega 168 but that did not work. I've followed multiple different tutorials and even pried the microcontroller from the Elgoo and put the ATMega 168 in its place to no success. I am also sure that the Elgoo itself is working since any code uploaded on it executes just fine.

I fear I am missing something extremely obvious but I am at my wits end. If anybody could provide some info as to what could be going wrong that would be much appreciated!

Here is a picture of the circuit, I know it's messy but I hope that you might be able to glean something from it :slight_smile:

-AJP