[SOLVED] Uploading bootloader to Atmega328pb-u on 3.3V 8Mhz

Hi, I’m building my own board on Atmega328pb-u on 3.3V.

I tried to upload bootloader via Arduino UNO to Atmega328pb with no success.
Selected board: Arduino Pro or Pro Mini - Atmeha328p (3.3V 8Mhz)
Program: ArduinoISP
Programmer: Arduino as ISP
Target board is connected to Arduino via ICSP connection and RESET pin is connected to 4.
Status LEDs connected to programmer show error (red LED) and IDE prints error like this:

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
Double check connections and try again, or use -F to override this check.

I have seen other topics explaining that this might be the cause missing of on-board oscillator but mine has one at 8MHz (schematics in the attachemts).
I also tried to upload Optiboot bootloader but avrdude shows the same error.
Switching Atmega328p signatures to Atmega328pb in avrdude config didn’t worked too.

I think it might be fault of oscillator, here is link to it:

I haven’t used external capacitors because schematic symbol showed them as part of the object. Probably that’s the cause of problem so I tried to upload bootloader with fuses set to internal oscillator (it does not matter for me) but I couldn’t find any information about it.

If somebody knows how to do it or have other clues please comment.

Note! RESET pin on schematic is connected to GND with 0R resistor - in reality this resistor is missing and I use it’s pads to make connection with jumper wire when I want to reset the board.

RustleOfCicada: RESET pin is connected to 4

Unless you changed the definition of RESET in the ArduinoISP sketch, pin 10 on the programmer board should be connected to the reset pin on the target board.

RustleOfCicada: I haven't used external capacitors

That's fine. No need for them since it's a ceramic resonator instead of a crystal.

Changed to 10 and still nothing :(

Target board is connected to Arduino via ICSP connection

Make sure the RST lead is bypassing the C4 capacitor on the target chip when using an ISP programmer.

kprims:
Make sure the RST lead is bypassing the C4 capacitor on the target chip when using an ISP programmer.

I’m not sure what you mean by that, RST is connected through (in series) C4 capacitor as shown on the schematic. Should I connect it directly?

Should I connect it directly

Yes. RST won't work using an ISP programmer connected in series with a capacitor. Use the capacitor for auto reset when uploading sketches using a USB 3.3V 5.5V to TTL Serial Adapter.

kprims: Yes. RST won't work using an ISP programmer connected in series with a capacitor. Use the capacitor for auto reset when uploading sketches using a USB 3.3V 5.5V to TTL Serial Adapter.

Yes! I made bridge connection at C4 and Arduino read correct device signature, now prints some error with fuses but I will try to fix it in a moment.

Good! Check out MiniCore for m328pb chips.

https://github.com/MCUdude/MiniCore

Hmm… strange.

It seems that bootloader has been uploaded but when I try to upload it once again the same error (signature: 0x000000) occurs.
I got warning like this:

avrdude: verifying ...
avrdude: WARNING: invalid value for unused bits in fuse "efuse", should be set to 1 according to datasheet
This behaviour is deprecated and will result in an error in future version
You probably want to use 0xf5 instead of 0xfd (double check with your datasheet first).
avrdude: 1 bytes of efuse verified
avrdude: reading input file "0xDA"

Attachment file contains whole output.

output.txt (8.56 KB)

:confused: still unable to upload program, stk500_getsync() error occurs.

It looks like you burned the fuses for 8MHz external clock and failed to burn the bootloader.

I have seen this before when the crystal is missing or defective. Double check the clock circuit.

Ok, I have probably found it. I don't know what values should be seen but between the pins at oscillator there is about 4 Ohm connection what could mean short circuit to ground. Is it normal for ceramic resonators?

RustleOfCicada: I got warning like this:

avrdude: verifying ...
avrdude: WARNING: invalid value for unused bits in fuse "efuse", should be set to 1 according to datasheet
This behaviour is deprecated and will result in an error in future version
You probably want to use 0xf5 instead of 0xfd (double check with your datasheet first).
avrdude: 1 bytes of efuse verified
avrdude: reading input file "0xDA"

You can ignore that warning. It doesn't indicate a problem and is unrelated to the other issue you're having.

I have solved the problem :) It was the bridge connection under resonator, thank you all for help!

You're welcome. I'm glad to hear it's working now. Enjoy! Per