ATMEGA328P-PU and Arduino Nano as Programmer

Hi, for the last 20 minutes I've been scrolling through the threads here, and have still not found an answer that works for me, so if one of you guys could help me, I would really appreciate it! :slight_smile:

I've bought a few ATMEGA328P-PU's, and I've been trying to install a bootloader onto them for the last many hours with no luck. I've been using my arduino nano, and have both tried uploading via arduino uno and breadboard to no avail. I have watched countless of videos and read countless of threads, and from what I've gathered, it should be possible to burn a bootloader onto a 328P-PU with just a nano, but everytime i try i get an error. I've mostly been getting the "Expected signature for ATmega328P is 1E 95 0F" error, and yes, I have tried changing the value in avrdude.conf.

What I really wanted to know, is if you guys know a method that works as of today, as most the methods I've been trying are 5-10 years old, and are now outdated. Is it even possible with the ATMEGA328P-PU's anymore? I also have a few that says "ATMEGA328P U" but I'm not sure of the difference. Nevertheless, they both give me the same errors, which are mostly the signature error.

Any help or answers are appreciated.
Thanks in advance!

Sure it is possible.

Hi, for the last 20 minutes I've been scrolling through the threads here, and have still not found an answer that works for me, so if one of you guys could help me, I would really appreciate it! :slight_smile:

Did you try Arduino as ISP tutorial (it's here on the web)?

..."Expected signature for ATmega328P is 1E 95 0F"...error

Notoriously known but what is in the rest of this error? Could you post whole error log?

Depending on the version of the IDE you are using, the 10uF capacitor between RESET and GND on your Nano could help. However, it is just blind shot.

I have tried changing the value in avrdude.conf

...and the reason is? How?

ATmega328P mark is important. The "-PU" or whatever is package type but the chip is the same.

R..

...and welcome to the forum.

Thanks for your reply! :slight_smile:

Yes, I have tried the Arduino as ISP. I've been using my nano to try and burn a bootloader onto a 328PPU Chip, and as I mentioned, I've tried both plugging the chip into my Uno and a breadboard.
I'm in school right now, so I'll just copy the exact error somewhere from the internet.

Here is the exact error:

avrdude: Expected signature for ATMEGA328P is 1E 95 0F
Double check chip, or use -F to override this check.

Sometimes it'll also say something along the lines of "Something went wrong!" on the first line. But I don't think that's relevant.

My settings are set to Arduino as ISP, board is: Arduino Nano and the processor is set to ATMEGA328.

The settings that I tried altering in avrdude.conf is changing the 1E 95 0F to 1E 95 14, as someone recommended, but I find that it just changes my error message from;

avrdude: Expected signature for ATMEGA328P is 1E 95 0F
Double check chip, or use -F to override this check.

to;

avrdude: Expected signature for ATMEGA328P is 1E 95 14
Double check chip, or use -F to override this check.

So thats no help. I'll try your capacitator trick, and I'm using the newest version of the IDE.

Thanks!

Again, ATmega328P is important. The 328 differs from 328P or 328PB... Signature have to fit, 328P - 1E 95 0F (this is default Arduino chip), 328 - 1E 95 14 (from MCU's datasheet).

avrdude: Expected signature for ATMEGA328P is 1E 95 0F
Double check chip, or use -F to override this check.

Not a lot. Go to 'Preferences' and switch on detailed log. Post it. We need to know used command, the values in the response etc.
Because we know what expected signature is (according exact part name) but what was received if anything.
BTW, do not use -F, it is not good advice.

Capacitor probably does not help if you have the newest version.

Post the picture of your connection. It might help. Double check your wiring. There are just 6 wires but you would be surprised how often this is the root cause.

Minimal circuit for ATmega must be. With the breadboard it is important but if you are using UNO board it is fulfilled. Oscillator, reset circuit, power - all power pins connected and decoupling. Decoupling is missing in tutorial but many times was proven that it can be important. So, add 0.1uF to close to each power pin, connected between power pin and GND of course.

Finally, it might look silly, but anyway. Do you have the ISP sketch loaded?

I do have the ISP sketch loaded, yeah.

I'll take some pictures and used the detailed log as soon as I'm home, thank you for your reply!

Hi! So I just connected everything, and I have attached my circuit and the error console on the bottom of the post. Unfortunately I'm still getting the error. My Arduino IDE is version 1.8.10 btw.

All the red and black wires on my circuit are of course VCC and GND, but the rest of my colors are just random.

Minimal circuit for ATmega must be. With the breadboard it is important but if you are using UNO board it is fulfilled. Oscillator, reset circuit, power - all power pins connected and decoupling. Decoupling is missing in tutorial but many times was proven that it can be important. So, add 0.1uF to close to each power pin, connected between power pin and GND of course.

Also, I didn't try this as I didn't really understand what you meant by it. Could you explain or send a link to someone who does? Thanks!

This is the exact tutorial I followed: Arduino Nano as an ISP Programmer – Martyn Currey. Though, I am a bit worried that it's outdated... (I didn't follow the part where he edited the boards file, as I was told not to by someone else)
If you don't wanna look through his tutorial, this is the sketch i followed:

I DID remember to upload the Arduino as ISP sketch first, so that's not the problem. I also know that the ATMEGA328PPU works, because the green indicator lights up for a tiny bit when trying to burn bootloader.

Extra Info about IDE settings when I'm trying to burn the bootloader:
Board: Arduino Nano
Processor: ATmega328P
Port: COM8 (Which is definately the correct port)
Programmer: Arduino as ISP

Thanks! :slight_smile:

C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega328p -cstk500v1 -PCOM8 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m

avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

Using Port : COM8
Using Programmer : stk500v1
Overriding Baud Rate : 19200
AVR Part : ATmega328P
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
efuse 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

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

Error while burning bootloader.
Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x0000ff
avrdude: Expected signature for ATmega328P is 1E 95 0F
Double check chip, or use -F to override this check.

avrdude done. Thank you.

Try this tutorial: Gammon Forum : Electronics : Microprocessors : How to make an Arduino-compatible minimal board
Note that unlike the drawing you posted, it has "0.1uF bypass capacitors" mounted near the target cpu.
Those are pretty important, and it's sad that many tutorials don't include them :frowning:

Hi, I just deleted my post where I stated that I didn't have any 0.1uf capacitors, go ahead and ignore that. I found some. So I connected everything as described, unfortunately though, it doesn't work...

This is the error I get:

Atmega chip detector.
Written by Nick Gammon.
Version 1.20
Compiled on Nov 16 2019 at 13:40:26 with Arduino IDE 10810.
Attempting to enter ICSP programming mode ......................................................
Failed to enter programming mode. Double-check wiring!
Programming mode off.

I'm gonna try purchasing another Arduino Uno and see if that helps to use, instead of a nano.
I have attached a pic of my circuit, if you wanna have a look at what it looks like.

Anyway, thanks for your reply.

Edit:
I thought I just wanted to let you know that my settings are:
Board: Arduino Nano
Processor: ATmega328P
Port: COM8
Programmer: AVRISP mkll

Command looks good and as I supposed, you need not 10uF cap on the Nano, Anyway, you are missing reset circuit, 10kOhm pull-up resistor on RESET pin must be. Plus, it is good to have isolation capacitor 0.1uF on reset wire (yellow) which will shorten the reset pulse and, in this case, the diode in parallel with resistor in backward direction to the Vcc to cut off undershot from reset pulse. See the Arduino schematics for reset circuit.

Response with 0 and FF points to problem with some shortage or floating wire but first, you care the RESET pin and we will see.

Update!

I think I made it work, thanks to you! :smiley:

I can now burn the bootloader, and it gives me a long successful message.
Now I'm also able to upload sketches via the programmer!
Just one issue. When I upload the blink sketch, everything works good on the breadboard and the LED connected to pin 19 works, but when I plug it into my Arduino Uno, the sketch doesn't work and the BUILTIN led doesn't light up at all, and the reset button doesn't work. Do you know why that is?

Quick edit: Unfortunately, when I plug my recently burned ATmega328PPU chip into my Arduino Uno (elegoo), I'm unable to upload anything to the chip. This is the log when I try:

avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

Using Port : COM6
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x7c
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x7c
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x7c
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x7c
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x7c
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x7c
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x7c
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x7c
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x7c
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x7c

avrdude done. Thank you.

Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

But what was wrong?

When I upload the blink sketch, everything works good on the breadboard...

Via ISP?

The error looks similar like problem with serial speed. Are you sure the bootloader is for UNO.

Via ISP?

Yes, I have it set to Arduino as ISP, if that's what you're asking. I then select the blink sketch, and press upload using programmer, and it seems to work.

The error looks similar like problem with serial speed. Are you sure the bootloader is for UNO.

What do you mean by this? Is there any way to get the right bootloader to make it compatible with the UNO? I thought the Nano and the UNO used the same bootloader. Sorry I'm not very educated on that front :confused:

Yes, I have it set to Arduino as ISP, if that's what you're asking. I then select the blink sketch, and press upload using programmer, and it seems to work.

Once you have uploaded a sketch via ISP the bootloader has gone. Do you know? In such case, you have to upload the bootloader again.

Oh I didn't know, thanks! Thats no problem I guess :slight_smile:

Good day to you, and thanks a lot for your help.

Budvar10:
Once you have uploaded a sketch via ISP the bootloader has gone. Do you know? In such case, you have to upload the bootloader again.

Actually, I do have one question. Does that mean I can't burn the bootloader on a breadboard, and then put it in a UNO and upload something from the UNO? Cause that doesn't seem to be working for me.

No. You can burn the bootloader on the breadboard and it will work in UNO. You can burn the bootloader to ATmega directly in UNO. There is ISP header.
I am writing just about situation when a sketch is written via ISP. Previously written programs are erased include the bootloader. In other situation, if the sketch is uploaded via USB/serial the bootloader is needed for it and it stay untouched because the boot region (a part of memory for bootloader) in flash is write protect.

LlamaLele:
Is there any way to get the right bootloader to make it compatible with the UNO?

The best way to do that is to select Tools > Board > Arduino/Genuino Uno before you do the Burn Bootloader. This is a little bit confusing because you have to have the Nano selected from the Tools > Board menu to upload the ArduinoISP sketch to the Nano, but then when you are doing the Burn Bootloader step you should select the board associated with the bootloader you want to burn to the target chip.

LlamaLele:
I thought the Nano and the UNO used the same bootloader.

It's a bit complicated. The official Nanos made pre-2018 and the Nano derivatives made even today use a different bootloader. The official Nanos from 2018 and newer do use the same bootloader as the Uno, but they still have a different boot section size so they still aren't interchangeable. For this reason, when you are using a modern versions of Arduino AVR Boards you will find a Tools > Processor > ATmega328P option (which is for the new official Nanos) and a Tools > Processor > ATmega328P (old bootloader) option (which is for the old official Nanos and the Nano derivatives). If you're using an old version of Arduino AVR Boards then you will not have a Tools > Processor > ATmega328P (old bootloader) option and the Tools > Processor > ATmega328P option will be the equivalent of the old bootloader option. The simple answer is to just use the Tools > Board > Arduino/Genuino Uno option, which will free up 1.5 kB of precious flash memory. If you do insist on using the Nano board option when burning the bootloader then make sure you also use that same selection when you're uploading to the chip.

The best way to do that is to select Tools > Board > Arduino/Genuino Uno before you do the Burn Bootloader. This is a little bit confusing because you have to have the Nano selected from the Tools > Board menu to upload the ArduinoISP sketch to the Nano, but then when you are doing the Burn Bootloader step you should select the board associated with the bootloader you want to burn to the target chip.

Hey, thanks for the response. Could you help?

Edit: I mean, I burn the bootloader from my nano onto a 328PPU on the breadboard, then remove the 328PPU chip, and insert it into my uno, and then it gives me the following error:

avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

Using Port : COM6
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x2e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x2e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x2e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x2e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x2e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x2e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x2e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x2e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x2e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x2e

avrdude done. Thank you.

Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

Make sure you have the same Tools > Board menu selection (and Tools > Processor as well, if your board selection was the Nano) as you had selected when you did the Burn Bootloader process when you are doing the Upload.

Unfortunately, this does not work... I've tried burning the bootloader as Uno and as Nano, but everytime i plug it into one of my Unos, the sketch uploaded won't work. Even if it's just the plain bootloader, and no sketch, it gives me the error i posted above.
The thing is, it works perfect in a breadboard. So I don't know what could be causing this error. It's like my Uno doesn't even recognize it.

I did as you described, unless I have to use the same port as well? I'm guessing that doesn't matter at all. I use a different programmer as well, of course, as I can't use "Arduino as ISP" when uploading a sketch on my Uno...