Issues while uploading code to standalone Atmega328P

I am having problems with uploading a sketch to a standalone Atmega328P with an Arduino Nano as a USB to TTL adapter (I disconnected the Atmega from the Nano beforehand). I burned the bootloader for Atmega328 on a breadboard (8mhz internal clock) over SPI with another Nano that I used as an ISP to burn the bootloader. I want to know what method to program my Atmega328 with, but I only have Nanos available to use, and I don't want to spend hundreds of euros on a special programmer. This is all of the red text I got while 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\(insert username here)\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

         Using Port                    : COM8
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x68
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x68
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x68
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x68
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x68
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x68
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x68
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x68
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x68
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x68

avrdude done.  Thank you.

Failed uploading: uploading error: exit status 1

The response byte is different every time I hit upload. I tried it on Arduino IDE version 2.3.4, and on version 2.3.2 .
Tell me if I missed anything important (other than a crystal, which I left out).

HI there, and welcome to the forum!

You can take the same route to upload sketches as you did with the bootloader.

So that means I can use my Arduino as ISP to program my Atmega328 over SPI?

Yep.

How can I use my Arduino to program my Atmega over SPI?

Same way you did with the bootloader, except instead of picking "Burn bootloader" Go to Sketch and pick "Upload using Programmer"

https://docs.arduino.cc/built-in-examples/arduino-isp/ArduinoISP/

I will try this

Thank you very much! This helped me a lot.

I'm happy to hear that! If your Nano is expendable, keep it as a programmer, otherwise buy a programmer or even make one yourself.

By the way, do I have to alter the naming from Arduino pin names to hardware pin names? (example: PB1)

Not really, you just have to keep in mind to map them accordingly.

Courtesy MCUdude (link in the pic)

Thanks for saving me from wasting even more time trying to fix my issues.

Come back anytime and tell us about your projects progress if you like to. :loudspeaker:

I will just make another topic whenever I run into problems.