Burning bootloader into Arduino Nano with Atmega a328pb

Hi, I have an arduino Nano which has an Atmega a328pb micro-controller. After using it for some projects, it stopped working because I did some mistake while programming and corrupted its bootloader. After some research I found out that the a328pb is a newer version of the a328p which originally comes with the nano. I have searched about how to burn bootloader into an a328pb, and have not found any solutions. While trying to burn the bootloader into the "pb" using an uno as isp this is the error I get.

Arduino: 1.8.19 (Windows 10), Board: "ATmega328, Yes (UART1 328PB only), EEPROM retained, 328PB, BOD 2.7V, LTO disabled, Internal 8 MHz"

C:\Users\srive\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino18/bin/avrdude -CC:\Users\srive\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.1.3/avrdude.conf -v -patmega328pb -cstk500v1 -PCOM7 -b19200 -e -Ulock:w:0x3f:m -Uefuse:w:0b11110101:m -Uhfuse:w:0b11010110:m -Ulfuse:w:0xe2:m

avrdude: Version 6.3-20201216

     Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

     Copyright (c) 2007-2014 Joerg Wunsch



     System wide configuration file is "C:\Users\srive\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.1.3/avrdude.conf"



     Using Port                    : COM7

     Using Programmer              : stk500v1

     Overriding Baud Rate          : 19200

     AVR Part                      : ATmega328PB

     Chip Erase delay              : 9000 us

     PAGEL                         : PD7

     BS2                           : PC2

     RESET disposition             : dedicated

     RETRY pulse                   : SCK

     serial program mode           : yes

     parallel program mode         : yes

     Timeout                       : 200

     StabDelay                     : 100

     CmdexeDelay                   : 25

     SyncLoops                     : 32

     ByteDelay                     : 0

     PollIndex                     : 3

     PollValue                     : 0x53

     Memory Detail                 :



                              Block Poll               Page                       Polled

       Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack

       ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------

       eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff

       flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff

       lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00

       hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00

       lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00

       calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

       signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

       efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00



     Programmer Type : STK500

     Description     : Atmel STK500 Version 1.x firmware

     Hardware Version: 2

     Firmware Version: 1.18

     Topcard         : Unknown

     Vtarget         : 0.0 V

     Varef           : 0.0 V

     Oscillator      : Off

     SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000 (retrying)

Error while burning bootloader.

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000

avrdude: Yikes! Invalid device signature.

     Double check connections and try again, or use -F to override

     this check.

avrdude done. Thank you.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Please help me solve this issue.

How do you know ?

A 'faulty' program should not 'corrupt' the bootloader, maybe you just damadged the processor ?

'Device signature = 0x000000' usually means the programmer cannot find a processor, either because its faulty or there is a wiring issue.

1 Like

Well, it could be that I might have damaged the processor. But I just want to see whether burning a new bootloader, can solve the issue. The problem is that, the arduino is not getting recognized by the computer. I have had a nano where it wouldn't get recognized and all that was needed to get it fixed was burning the bootloader. So I am just exploring all the possible solutions.

'Device signature = 0x000000' usually means the programmer cannot find a processor, either because its faulty or there is a wiring issue. Hmm, ok. I have searched about this error and there was one forum, which talked about fuse bits, improper fuse bits might cause such an error to happen. Tbh I have no idea about what I am talking, but is there any possibility that I might have changed the fuse bits by mistake ?

This is either a wiring problem or a defective processor.

Check the connection. Most likely something in the wiring is wrong.
https://support.arduino.cc/hc/en-us/articles/360012048100-How-to-burn-the-bootloader-in-an-Arduino-Nano-using-an-Arduino-UNO

Maybe try using the standard "Arduino AVR Boards" core instead of MiniCore?

This issue is more likely caused by the USB-Serial chip used, not the 328 itself.

That doesn't support the 328PB!!

2 Likes

Only If you were trying to change them in the first place.

will definitely look into the wiring.

"Maybe try using the standard "Arduino AVR Boards" core instead of MiniCore?", I did try using that. The very first time I tried to burn the bootloader, I got a different error talking about incorrect device signatures. And the way to go around this error was to change the device signature in the avr config file. It never worked for me though. After 3-4 tries, I started getting this error 'Device signature = 0x000000'

And 'recognised' means what ?

What error is reported ?

'Only If you were trying to change them in the first place.' I don't know what they are, so I dont think I changed them.

3 possible reasons that I can think of:

  1. The TTL-to-USB converter (FTDI in original Nanos, CH340 in most clones) does not function properly; it has nothing to do with the 328PB.
  2. A bad USB cable.
  3. PC problem.

The fact that you also can't program via ICSP (assuming that you don't have a wiring mistake on that) would indicate in my opinion that it's good for the dustbin.

So you didn't get a signature that was all zeros that first time? That's more hopeful than what you have now. Still, if it changed just like that, it sounds mostly like a wiring issue.

"And 'recognised' means what ?

What error is reported ?"
Ok, so normally when we plug in any arduino we have to get a windows sound and the device should be displayed in the device manager whereas in this case, neither do I get a sound, nor is the device shown in device manager when connected. And the error shown, is when I connected the nano to uno via the icsp pins and try to burn the bootloader, and the wiring diagram is according to the one given in the official arduino website about burning bootloaders.

"So you didn't get a signature that was all zeros that first time?", nope, the first error I got looked something like this,
"avrdude: Expected signature for ATMEGA328P is 1E 95 0F Double check chip, or use -F to override this check."

Could be a mustake that broke the config file. Try to restore it
(update/downgrade the core)

Just a wild guess - some part on the board burned and is shorting an important trace, thus preventing both the USB-Serial chip and the MCU from working.
Is there heating anywhere on the board?

"Could be a mustake that broke the config file. Try to restore it
(update/downgrade the core)" Could you tell me how to do it? I tried to reinstall the ide, but all the boards remained intact, it didn't restore anything back to default.

"Just a wild guess - some part on the board burned and is shorting an important trace, thus preventing both the USB-Serial chip and the MCU from working.
Is there heating anywhere on the board?". No heating on the board whatsoever. According to me it is a software problem because, as far as I know, the board hasn't sustained any physical damage.

It's of little help at this point, but I'd recommend getting a dedicated ASP programmer. They're not expensive and remove some uncertainties compared to the 'Arduino as ISP' approach.

If I were to take a guess I'd say there's a problem with the reset circuit. You could try manually resetting the target 328PB as AVRDude starts. But timing that properly is a bit tricky.

"I'd recommend getting a dedicated ASP programmer.", like a usbASP? if yes, then I already have one, the only problem is that I dont have an adapter to convert the 10 pin icsp down to the 6pin icsp .