Atmega328pb-mu bootloader invalid signature 000000

Hi, I'm building my own pcb with atmega328pb-mu. When I try to bootload my processor using Arduino as ISP there is ERROR: Unknown signature 000000. I checked connections and everything is okay. I made connections basing on this: (I don't use UART, so I didn't connected these pads).

To what pin on your Arduino do you connect pin5 (RST) of the ISP header on your own pcb?

I use Arduino Uno as ISP and connections are: 13-sck, 12-miso, 11-mosi and 10-reset. 5v - 5v and GND - GND.

That looks ok. And you have no problem connecting your Arduino as ISP to another Arduino?
And no other (passive) parts are connected to the pins used for ISP on your PCB?

I recently built a few 328PB boards and it worked just like you have it wired up.

Post the log, as a text of course.

BTW, decoupling cap should be one for each power pin, also AREF 100nF to GND if not used.
I am recommending to read the datasheet before anyone start working on the new design. It is good to consider the schematics of the original Arduino. It is well tuned.

Yes, when I connect to another Arduino with Atmega328P it's working.

No there is no other parts.

I made another PCB only with connections for ISP and Quartz and there is still this error.

2024-02-06 09:51:07 2024-02-06T08:51:07.904Z monitor-service INFO stopped monitor to COM5 using serial
2024-02-06 09:51:07 2024-02-06T08:51:07.905Z daemon INFO time="2024-02-06T09:51:07+01:00" level=info msg="sending command" command=CLOSE monitor=serial-monitor
2024-02-06 09:51:07 2024-02-06T08:51:07.906Z daemon INFO time="2024-02-06T09:51:07+01:00" level=info msg="received message" error=false event_type=close message=OK monitor=serial-monitor
2024-02-06 09:51:07 2024-02-06T08:51:07.907Z daemon INFO time="2024-02-06T09:51:07+01:00" level=info msg="sending command" command=QUIT monitor=serial-monitor
2024-02-06 09:51:07 2024-02-06T08:51:07.907Z daemon INFO time="2024-02-06T09:51:07+01:00" level=info msg="received message" error=false event_type=quit message=OK monitor=serial-monitor
2024-02-06 09:51:07 2024-02-06T08:51:07.908Z daemon INFO time="2024-02-06T09:51:07+01:00" level=info msg="Killing monitor process" monitor=serial-monitor
2024-02-06 09:51:07 2024-02-06T08:51:07.908Z daemon INFO time="2024-02-06T09:51:07+01:00" level=error msg="Sent kill signal" error="TerminateProcess: Odmowa dostępu." monitor=serial-monitor
2024-02-06 09:51:07 2024-02-06T08:51:07.909Z daemon INFO time="2024-02-06T09:51:07+01:00" level=error msg="stopped decode loop: EOF" monitor=serial-monitor
2024-02-06 09:51:07 2024-02-06T08:51:07.924Z daemon INFO time="2024-02-06T09:51:07+01:00" level=info msg="Monitor process killed" monitor=serial-monitor
2024-02-06 09:51:07 2024-02-06T08:51:07.925Z monitor-service INFO monitor to COM5 using serial closed by server
2024-02-06 09:51:07 2024-02-06T08:51:07.925Z monitor-service INFO monitor to COM5 using serial closed by client
2024-02-06 09:51:10 2024-02-06T08:51:10.191Z daemon INFO time="2024-02-06T09:51:10+01:00" level=error msg="Upload port detection failed, watcher closed" task=port_detection
2024-02-06 09:51:10 2024-02-06T08:51:10.224Z monitor-service INFO starting monitor
2024-02-06 09:51:10 2024-02-06T08:51:10.245Z daemon INFO time="2024-02-06T09:51:10+01:00" level=info msg="Starting monitor process" monitor=serial-monitor
2024-02-06 09:51:10 2024-02-06T08:51:10.254Z daemon INFO time="2024-02-06T09:51:10+01:00" level=info msg="Monitor process started successfully!" monitor=serial-monitor
time="2024-02-06T09:51:10+01:00" level=info msg="sending command" command="HELLO 1 \"arduino-cli 0.34.0\"" monitor=serial-monitor
2024-02-06 09:51:10 2024-02-06T08:51:10.274Z daemon INFO time="2024-02-06T09:51:10+01:00" level=info msg="received message" error=false event_type=hello message=OK monitor=serial-monitor
time="2024-02-06T09:51:10+01:00" level=info msg="sending command" command=DESCRIBE monitor=serial-monitor
2024-02-06 09:51:10 2024-02-06T08:51:10.275Z daemon INFO time="2024-02-06T09:51:10+01:00" level=info msg="received message" error=false event_type=describe message=OK monitor=serial-monitor
time="2024-02-06T09:51:10+01:00" level=info msg="sending command" command=QUIT monitor=serial-monitor
2024-02-06 09:51:10 2024-02-06T08:51:10.275Z daemon INFO time="2024-02-06T09:51:10+01:00" level=info msg="received message" error=false event_type=quit message=OK monitor=serial-monitor
2024-02-06 09:51:10 2024-02-06T08:51:10.276Z daemon INFO time="2024-02-06T09:51:10+01:00" level=info msg="Killing monitor process" monitor=serial-monitor
2024-02-06 09:51:10 2024-02-06T08:51:10.276Z daemon INFO time="2024-02-06T09:51:10+01:00" level=error msg="Sent kill signal" error="TerminateProcess: Odmowa dostępu." monitor=serial-monitor
2024-02-06 09:51:10 2024-02-06T08:51:10.277Z daemon INFO time="2024-02-06T09:51:10+01:00" level=error msg="stopped decode loop: EOF" monitor=serial-monitor
2024-02-06 09:51:10 2024-02-06T08:51:10.298Z daemon INFO time="2024-02-06T09:51:10+01:00" level=info msg="Monitor process killed" monitor=serial-monitor
2024-02-06 09:51:10 2024-02-06T08:51:10.325Z daemon INFO time="2024-02-06T09:51:10+01:00" level=info msg="Starting monitor process" monitor=serial-monitor
2024-02-06 09:51:10 2024-02-06T08:51:10.330Z daemon INFO time="2024-02-06T09:51:10+01:00" level=info msg="Monitor process started successfully!" monitor=serial-monitor
2024-02-06 09:51:10 2024-02-06T08:51:10.330Z daemon INFO time="2024-02-06T09:51:10+01:00" level=info msg="sending command" command="HELLO 1 \"arduino-cli 0.34.0\"" monitor=serial-monitor
2024-02-06 09:51:10 2024-02-06T08:51:10.356Z daemon INFO time="2024-02-06T09:51:10+01:00" level=info msg="received message" error=false event_type=hello message=OK monitor=serial-monitor
2024-02-06 09:51:10 2024-02-06T08:51:10.357Z daemon INFO time="2024-02-06T09:51:10+01:00" level=info msg="sending command" command=DESCRIBE monitor=serial-monitor
2024-02-06 09:51:10 2024-02-06T08:51:10.358Z daemon INFO time="2024-02-06T09:51:10+01:00" level=info msg="received message" error=false event_type=describe message=OK monitor=serial-monitor
time="2024-02-06T09:51:10+01:00" level=info msg="sending command" command="CONFIGURE dtr on" monitor=serial-monitor
time="2024-02-06T09:51:10+01:00" level=info msg="received message" error=false event_type=configure message=OK monitor=serial-monitor
time="2024-02-06T09:51:10+01:00" level=info msg="sending command" command="CONFIGURE parity none" monitor=serial-monitor
time="2024-02-06T09:51:10+01:00" level=info msg="received message" error=false event_type=configure message=OK monitor=serial-monitor
2024-02-06 09:51:10 2024-02-06T08:51:10.358Z daemon INFO time="2024-02-06T09:51:10+01:00" level=info msg="sending command" command="CONFIGURE rts on" monitor=serial-monitor
time="2024-02-06T09:51:10+01:00" level=info msg="received message" error=false event_type=configure message=OK monitor=serial-monitor
time="2024-02-06T09:51:10+01:00" level=info msg="sending command" command="CONFIGURE stop_bits 1" monitor=serial-monitor
time="2024-02-06T09:51:10+01:00" level=info msg="received message" error=false event_type=configure message=OK monitor=serial-monitor
time="2024-02-06T09:51:10+01:00" level=info msg="sending command" command="CONFIGURE baudrate 19200" monitor=serial-monitor
2024-02-06 09:51:10 2024-02-06T08:51:10.359Z daemon INFO time="2024-02-06T09:51:10+01:00" level=info msg="received message" error=false event_type=configure message=OK monitor=serial-monitor
time="2024-02-06T09:51:10+01:00" level=info msg="sending command" command="CONFIGURE bits 8" monitor=serial-monitor
time="2024-02-06T09:51:10+01:00" level=info msg="received message" error=false event_type=configure message=OK monitor=serial-monitor
2024-02-06 09:51:10 2024-02-06T08:51:10.359Z daemon INFO time="2024-02-06T09:51:10+01:00" level=info msg="sending command" command="OPEN 127.0.0.1:56405 COM5" monitor=serial-monitor
2024-02-06 09:51:10 2024-02-06T08:51:10.362Z daemon INFO time="2024-02-06T09:51:10+01:00" level=info msg="received message" error=false event_type=open message=OK monitor=serial-monitor
2024-02-06 09:51:10 2024-02-06T08:51:10.362Z monitor-service INFO Using port configuration for serial:COM5: {"settingsList":[{"settingId":"dtr","value":"on"},{"settingId":"parity","value":"none"},{"settingId":"rts","value":"on"},{"settingId":"stop_bits","value":"1"},{"settingId":"baudrate","value":"19200"},{"settingId":"bits","value":"8"}]}
2024-02-06 09:51:10 2024-02-06T08:51:10.362Z monitor-service INFO started monitor to COM5 using serial
2024-02-06 09:51:10 2024-02-06T08:51:10.363Z daemon INFO time="2024-02-06T09:51:10+01:00" level=info msg="Port COM5 successfully opened"
2024-02-06 09:51:10 2024-02-06T08:51:10.366Z monitor-service INFO No port configuration changes have been detected. No need to send configure commands to the running monitor serial:COM5.
2024-02-06 09:51:12 2024-02-06T08:51:12.349Z root WARN Widget was activated, but did not accept focus after 2000ms: serial-monitor

AREF is in use on my project

Do you mean there should be 100nF capacitors between vcc and gnd on 4-5 pin and 18-21? If right I made this on the begining and it didn't help.

I meant the avrdude output, include the command.
Where is the "ERROR: Unknown signature 000000" in this output you sent.

It is not obvious from the schematics.

Yes. This is not about actual problem. It is just correct and recommended way, how to connect the chip to the power. Your schematics does not have it. It should work without it for bootloading purpose. On the other side there is this LED on SCK for some reason which is not needed for bootload process and it can be potential problem. Get rid of it.

This shows on the other app, because on the other forum I found to try use AVRDUDESS app from github. GitHub - ZakKemble/AVRDUDESS: A GUI for AVRDUDE On this app when I select my processor and click "Detect" it's responding with this error.

On Arduino IDE when I try to bootload it gives back:

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

Error while burning bootloader.

You're right, sorry for not mentioning that. I also don't use LED on SCK line. My second PCB build only for ISP schematic looks like this:

This, exactly! But what is before "Yikes!". There should be also the command for avrdude call. It is also interesting for the problem solving and everything after this command.
Remember we do not see your setup. There are only 6 wires for ISP bootloading. It supposed to be very simple but frequently asked problem anyway.
"Double check connections" usually means you have to check Arduino in use as ISP, sketch if it is uploaded, these 6 ISP wires, target schematics basics and also it helps to observe the behavior of LEDs during the bootloading process.

There is nothing before.

I also tried to run this using AVRISP mkII and it can't see MCU. It was connected properly and I tested this on Arduino UNO and it's working.

>>>: avrdude.exe -c avrispmkII -P usb -b 19200 -p m8 
WARNING: Unable to detect MCU

avrdude error: command failed
avrdude error: bad AVRISPmkII connection status: Target not detected
avrdude error: initialization failed, rc=-1
        - double check the connections and try again
        - use -B to set lower the bit clock frequency, e.g. -B 125kHz
        - use -F to override this check

avrdude done.  Thank you.

And here is my main project's schematic, please check is there something wrong with this and I will try to make another pcb and use a new processor, because on the beginning I made a few mistakes and maybe problem is there.

No. Do not do this. It does not help. There is Arduino as ISP for this. Now make sure the ISP sketch is in the programmer Arduino.

avrdude.exe -c avrispmkII -P usb -b 19200 -p m8

This m8 means ATmega8 but you have 328PB. Make sure that all your settings is correct.

EDIT: I did not check everything, but I hope you know your ISP connector is with nonstandard pinout.

Yes it is. At first I select Arduino UNO in board manager. Then I upload ISP sketch on UNO. When it's done I switch in board manager from UNO to Atmega328PB Crystal and set quartz frequency to 16MHz as on PCB. As programmer I select Arduino as ISP and click Burn bootloader. (I downloaded board package from board manager for ATmega328PB - I will update tomorrow link to GitHub with this package.)
EDIT: GitHub - watterott/ATmega328PB-Testing: Atmel/Microchip ATmega328PB support for Arduino IDE

This shows in the other app for AVRISP, because before using this on 328pb I tested it on other PCB with ATmega8. (It's actually looking for any processor and automatically sets on what's available so because it couldn't find ATmega328pb it stayed on ATmega8.) But as you said, from now I will only use Arduino as ISP.

Yes I know and thanks for checking. I made custom pinout setup because it was much easier to make connections on PCB. Also every time I connect ISP I check connections with schematic.

After few months I have solution... I made an order of ready PCB with all elements soldered and there was still this problem. Then I found this YT video https://www.youtube.com/watch?v=jiuxnuq_AS0&ab_channel=RCTractorGuy
My problem was that I used smd quartz which include capacitors, but I didn't saw that in datasheet and thanks to this video I realized this. So solution was removing these capacitors. In this video is also shown a board manager to ATMEGA328PB which I'm using and is working good.
Thanks for trying to help to Budvar10 :smiley:

2 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.