Unable to burn the bootloader into an atmega328pb

Hello, I was trying to burn the bootloader into an atmega328pb. I follwed @ptillisch instructions here. I'm able to upload the arduinoisp sketch on my arduino UNO but when i connect it to my atmega328pb I get the following error:
"
avrdude ser_open() error: cannot open port \.\COM5: Accesso negato.

avrdude main() error: unable to open programmer stk500v1 on port COM5

avrdude done. Thank you.

Failed chip erase: uploading error: exit status 1
"
I guess it can't recognise the board, but I don't know what port to put.
This are the settings I put under tools. For port I just left the one I had just used for flashing the arduinoISP program.

Screenshot 2024-10-01 011625

My connections are (i'll report them as named on my atmega328pb footprint as this is all on a PCB so I know that the reported connections are the ones I actually have)

Arduino UNO-> atmega328pb
  1. VCC->VCC
  2. GND->GND
  3. PD10-> RESET/PC6
  4. PD11->PB3
  5. PD12->PB4
  6. PD13->PB5

Also check (Windows) Device Manager "USB & Ports"

  • Try this.




  • Or try this.

Your screen shot shows you have selected ATmega328. This is not the correct board. The ATmega328pb is a totally different processor, and you must select the correct board.

Where did you buy it from?

Was it from here?
Pololu

Or is it some knock off clone?
Pololu have some getting started guides on their web site if you want to search for them.

Both Arduino Uno and atmega328pb are original. Under variants I tried both the atmega328pb and atmega328p/pa. I get the same result in both cases. I bought the atmega 328pb on TME @Grumpy_Mike

I tried this but the connection are the same as the ones I had already put. The only difference is that the ones you showed me have some LEDs for visual feedback. Heartbeat is pulsing the whole time and the other 2 lights don't turn on as Arduino ide says it can't even recognise the board/port

This suggests the application did not get access to the serial port from the operating system. Check if you have any Serial monitor application running or something else that may be using/blocking the serial port. It may help to close the serial monitor in the Arduino IDE as well in case you have that open.

Hardly a link to where you bought it from? I have no idea what TME is.

Once again the atmega 328pb is not an official Arduino. It is however a board made by MicroChip, but that does not make it an official Arduino board.

Did you read that link I posted?

A reputable distributor of (mostly) electronic components. They're pretty big on mainland Europe.

As said in #7, the problem is likely not on the side of the microcontroller board, but on the computer/OS used to program it, as evidenced by the error OP posted. I'd look into that first before trying to 'solve' hardware problems that may not even exist.

Thanks.

I say again this is not an official Arduino board

It will not work in the Arduino environment without the correct drivers. It will work with the MicroChip development system, but that is a whole different ball game.

You have to disable the auto reset on the Programming board, by either cutting the link to it, I replaced the cut link with a sub miniature slide switch, or by putting a socking big capacitor on it. Well 10uF might do.

Well, it may work with the right drivers and provided that the circuit the ATMega is part of is suitable for it.
@pietrofarag please post a schematic of your board/setup. Some photos and a PCB layout if you're using a custom-made PCB would also help.

There is no PD10,11,12,13 on the Uno or 328PB
So how do you actually have it connected?

The port is for the programmer (the UNO), so select that the way you did to upload the ArduinoISP sketch.

MCDdude's MiniCore has support for the atmega328pb.

1 Like

Hello everyone, I managed to solve the bootloader and program the atmega328pb. I didn't really understand what the problem was as I didn't change anything, I just rebooted the computer and disconnected/reconnected the Arduino board to my computer