Burn bootloader to atmega328 PU

hello,

so i am trying to burn bootloader to my new atmega 328 pu chip, but it fails, becouse the programmer expect there to be atmega 328 P

i am using 2 boards to burn bootloader.

somewhere someone suggested to use minicore addon, but there is no support for "PU" chip. but someone added this
"After that you can select Tools > Board > ATmega328 and then Tools > Variant > 328 / 328A."

so i did, bootloader seemingly uploaded succesfully, but this orange LED keeps blinking 3 times, 1 sec pause, 3 blinks and so on.

cant upload sketch, error from arduino IDE:

avrdude: ser_open(): can't open device "\.\COM5": The system cannot find the file specified.

dont know what to do now anymore. there is simply no tutoriel on internet on how to burn bootloader to "PU" version. (or google just didnt show me them.)

The PU is the same as a 328P, so go with that option. You can use minicore to select fuse types etc such as BOD. Or you can upload, say a Nano or Pro Mini bootloader, by selecting that in the Boards dropdown menu.

I take it you're using the 28 pin dip IC?

I'm assuming this is what you're using, hear is the data sheet
https://www.mouser.co.uk/ProductDetail/Microchip-Technology-Atmel/ATMEGA328P-PU?qs=K8BHR703ZXguOQv3sKbWcg==

Don't try and upload the '328' bootloader as it will not like that.

Are you using an external crystal with caps and a pull up resistor? Are you supplying power to ALL of the relevant pins?

i have this

i tryed nano or pro mini, even other boards, but i always get same error

avrdude: Expected signature for ATmega328P is 1E 95 0F
Double check chip, or use -F to override this check.
Wrong microcontroller found. Did you select the right board from the Tools > Board menu?

i have no idea what BOD is.

i am using 2 arduino boards, so i assume that board have ext. crystal with cap and everything. ONE board have SMD chip, the other is replaceable THT chip.

Ah okay, I see the issue. The error is that you're using a '328' IC and the Nano and Pro Mini use a '328P' IC, so neither will work. No worries though, use the Minicore GitHub to upload a bootloader;

Make sure you set the IC as a 328, then you can set various clock settings, such as a 8/MHz external crystal, such as the Nano and Pro Mini.

BOD is the brown out detection, so when the IC see's a set limit, the IC will shut down. Have a read up and see what option you'd like. If you're going to be using batteries, then this is extremely beneficial. By selecting a BOD voltage level, this is what is meant by selecting the fuses. The data sheet elaborates more on this.

i know that nano use "P", i only tryed it becouse i couldnt lose anything, so why not.

my crystal is 16mhz, why would i want to set clock to 8mhz? anyway, i tryed it.. nothing changed.

As a last resort, i set board - 328, variant - 328/328A, bootloader - no bootloader, burning bootloader was seemingly succesful, LED stopped blinking. But cant upload sketch or anything.

ok so i will just buy proper chip, and throw away this "pu" garbage..

anyway, thanks for helping me

It looks to me like you basically had everything right, until at the last moment, when you tried to upload the sketch after burning bootloader (the triple-blink pattern shows that the bootloader was successfully burned), you did not have the correct port selected, or you wanted to upload using the ISP programmer, rather than a serial port like one normally does, but jut did a normal upload. Select the correct port from the Tools -> port menu, and I'd expect it to work, in that case. You do have an external serial adapter connected and all right?

The port number for the serial adapter you want to upload using, and the port that your ISP programmer was on (if applicable) shoud be different, so you would have to change that selection...

If you do want to upload using the ISP programmer instead, rather than using a serial adapter + the bootloader, there's a Tools submenu in minicore where you can tell it not to use a bootloader; choose that, "burn bootloader" again (this will remove the bootloader, and set the fuses to not try to use it - you always need to "burn bootloader" on a new chip, or when you want to change clock speed, BOD voltages, or whether to use a bootloader) - in this case, you could get away with using your current settings, not burning bootloader again, and just doing sketch -> upload using programmer with the ISP programmer conneted and all... but this would sort of be setting a trap for your future self.

Noobiq:
As a last resort, i set board - 328, variant

I'm confused, why a last resort? You already said that you have a '328' IC, so that is the bootloader which you should have uploaded.

ok so it looks like i managed to burn bootloader, and then sketch.

somewhere someone wrote that after burning bootloader, i can upload sketch like on normal arduino uno. So i selected board - arduino uno and it didnt work. This time, i kept board - atmega328, variant 328/328a (becouse i forgot to change it) and it worked.
the only downside is, newer arduino IDE cant upload my sketch becouse of some error, and older IDE doesnt support this minicore.

i dont have serial adapter, im using only USB cable.
there was no problem with port, becouse the avrdude warned me, when there was wrong port selected.

Thanks.

Do you mean that you’re using the Uno to upload a sketch to your chip or that you’re telling the ide that your chip is an Uno?

I prefer to use a FTDI board, as I find it the easiest way to upload sketches to chips but that’s just me.

i was telling IDE that my chip is uno

Ah okay. Yes, that won’t work.

Did you manage to upload a sketch?

yes, i did, and it works just fine.