Burn bootloader to atmega328 without pc

Hi,
Is it possible to burn the "regular" bootloader (Arduino ISP) to an atmega328 (smd) without the use of a computer ? I have built a pcb that acts as a slave when you place the atmega328 on it and I am wondering if I can burn the bootloader on it directly from the arduino uno without a pc. Maybe with a button in the uno?

Thanks in advance,
Alex

Yes, you can use an Uno as a standalone ISP programmer.
See, Overview | Standalone AVR Chip Programmer | Adafruit Learning System

You can modify it to bring out an 6-pin ISP cable so you don't need to have the IC socket.

Thanks alot for the link ! I appreciate it ! But I was talking about something without shields and more diy. Is there no way in which I can program Arduino to burn the bootloader with the press of a button and without shields ?

You can use the Adaloader (GitHub - adafruit/Standalone-Arduino-AVR-ISP-programmer: A standalone programmer for mass-programming AVR chips) sketch without the shield. You just need to make an ISP cable and connect a button to A1. You will need to insert your own bootloader to the image.cpp file.

If you want to use the latest Optiboot v6.2 bootloader then you can use this image.cpp file.

#include "optiLoader.h"

image_t PROGMEM image_328 = {
    {"optiboot_atmega328.hex"},
    {"atmega328P"},
    0x950F,				/* Signature bytes for 328P */
    {0x3F, 0xFF, 0xDE, 0x05},            // pre program fuses (prot/lock, low, high, ext)
    {0x0F, 0x0, 0x0, 0x0},            // post program fuses
    {0x3F, 0xFF, 0xFF, 0x07},           // fuse mask
    32768,     // size of chip flash in bytes
    128,   // size in bytes of flash page
    {
":107E0000112494B714BE892F8D7011F0892FDED004\n"
":107E100085E08093810082E08093C00088E18093B8\n"
":107E2000C10086E08093C20080E18093C4008EE0B0\n"
":107E3000B7D0259A86E020E33CEF91E030938500AF\n"
":107E40002093840096BBB09BFECF1D9AA8958150CD\n"
":107E5000A9F7EE24FF24B3E0AB2EBB24B394A5E036\n"
":107E6000DA2EF1E1CF2E90D0813471F48DD0082F2D\n"
":107E70009DD0023811F482E005C0013811F486E08B\n"
":107E800001C083E079D075C0823411F484E103C06D\n"
":107E9000853419F485E092D06CC0853579F474D0BE\n"
":107EA000E82EFF2471D0082F10E0102F00270E2994\n"
":107EB0001F29000F111F7AD078015BC0863521F48D\n"
":107EC00084E07CD080E0DECF843609F035C05CD021\n"
":107ED0005BD0182F59D0082FC0E0D1E055D089933E\n"
":107EE0001C17E1F763D0053409F4FFCFF701A7BEF3\n"
":107EF000E89507B600FCFDCFA701A0E0B1E02C910A\n"
":107F000030E011968C91119790E0982F8827822B62\n"
":107F1000932B1296FA010C01B7BEE89511244E5F1F\n"
":107F20005F4F1A1761F7F701D7BEE89507B600FC57\n"
":107F3000FDCFC7BEE8951DC0843769F425D024D095\n"
":107F4000082F22D033D0E701FE018591EF0114D034\n"
":107F50000150D1F70EC0853739F428D08EE10CD00E\n"
":107F600085E90AD08FE08ECF813511F488E018D0F2\n"
":107F70001DD080E101D077CF982F8091C00085FF80\n"
":107F8000FCCF9093C60008958091C00087FFFCCF7E\n"
":107F90008091C00084FD01C0A8958091C60008951D\n"
":107FA000E0E6F0E098E1908380830895EDDF803291\n"
":107FB00019F088E0F5DFFFCF84E1DECF1F93182FA3\n"
":107FC000E3DF1150E9F7F2DF1F910895282E80E0DA\n"
":0A7FD000E7DFEE27FF270994020601\n"
":00000001FF\n"

    }
};


/*
 * Table of defined images
 */
image_t *images[] = {
  &image_328,
};

uint8_t NUMIMAGES = sizeof(images)/sizeof(images[0]);

images.cpp (1.99 KB)

My optiloader was first: GitHub - WestfW/OptiLoader: Arduino sketch for burning new bootloaders
OptiLoader - YouTube

Adafruit extended the capabilities with their version: GitHub - adafruit/Standalone-Arduino-AVR-ISP-programmer: A standalone programmer for mass-programming AVR chips
(Note while adafruit describes a shield with ZIF socket for rapid programming of bare chips, you don't NEED that shield; you just need the ~6 wire ISP connection.)

Nick Gammon has something that is also similar: Gammon Forum : Electronics : Microprocessors : Atmega bootloader programmer

I recommend one of the newer versions; I haven't been keeping optiloader updated...

Thank you both for your help! I 'll try them out. But is there no way that I can do this with the original arduino bootloader (Arduino ISP.ino) ?

No, ArduinoISP requires you to hookup from the PC to run. It is not standalone. The adaLoader is designed to be standalone and uses a button to trigger it.

You can think of it this way:
If you have a completely blank m328, you need to copy a bootloader onto it before you can upload sketches.
You can't copy directly from a PC to the bare chip, because the PC doesn't understand how, and doesn't have the right hardware.
ArduinoISP is a sketch that allows you do this copy from a PC to the new chip, using an arduino in between.
OptiLoader (and similar) is a sketch that does the copy from code stored inside the arduino sketch to the new chip, without using the PC.