Device Signature - ATmega328P-PU

Hi All,

I am trying to bootload an ATmega 328p-pu for a minimum configuration (without external clock) with an an Arduino Duemilanove according to the instructions under "From Arduino to a Microcontroller on a Breadboard"

I am getting an Invalid device signature error message when I try to burn the bootloader. I read in the forum that "non-P" 328s need to change the signature in the avrdude file and that this will then work for both P and non-P series. Although my 328 is a P series and should work, I thought it was worth a try. However, this did not solve my problem and still gave me the same error.

Has anyone had this problem or know of a solution? any suggestions are much appreciated.

Thanks in advance.

Huh, weird, can you paste the whole avrdude command & error?

spirilis:
Huh, weird, can you paste the whole avrdude command & error?

At the moment I am on the go so I will have to post the error message later, but here is the passage in the avrdude:

#------------------------------------------------------------
# ATmega328
#------------------------------------------------------------

part
    id              = "m328p";
    desc            = "ATMEGA328P";
     has_debugwire = yes;
     flash_instr   = 0xB6, 0x01, 0x11;
     eeprom_instr  = 0xBD, 0xF2, 0xBD, 0xE1, 0xBB, 0xCF, 0xB4, 0x00,
	             0xBE, 0x01, 0xB6, 0x01, 0xBC, 0x00, 0xBB, 0xBF,
	             0x99, 0xF9, 0xBB, 0xAF;
    stk500_devcode  = 0x86;
    # avr910_devcode = 0x;
    signature       = 0x1e 0x95 0x14; 

# Signature for nonP series = 0x1e 0x95 0x14 
# Signature for 328"P" series = 0x1e 0x95 0x0F

Make sure you have no unprintable illegal characters in there. If I'm not mistaken, the TAB is an illegal character.

everything is original avrdude, aside from the comments I only changed the "0F" with "14" in the signature line.

Then we'd need to see the error text and a full run-down of the situation that produced the error. i.e. is it a "P" or non-"P" mcu, is there more than one copy of of avrdude.conf on your system (do a search), where your sketchbook is pointing to, where your preferences.txt is pointing to, have any changes been made to preferences.txt, etc...

as mentioned above and in the thread title this is a P version, ATMEGA328P-PU to be exact... which means the signature should have worked.

these are the steps I have taken:

  • Uploaded Arduino ISP to the Arduino board
  • Connected the 328 chip to the Arduino as per instructions in my first post (Connection Layout)
  • attempting to burn bootloader to chip brings the error below after about 5 seconds

This is the error I get when the avrdude is with the original signature.

Error while buring bootloader.

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

Everything looks okay.

Did this 328P ever have a bootloader on it before, or is a fresh and completely blank chip?

I have only done this with chips that already had bootloaders on them and I have had to connect the crystal and caps to get the minimum configuration bootloader on there. Once that bootloader is loaded up and the fuses are set correctly, it will run without the crystal.

I'm not sure how the fuses are set for a brand new chip and whether or not it expects an external clock, but if you have a 16mHz crystal and a couple of 22pf caps around, it might be worth a try.

Hi Billo,
I bought the chips (5) new without a bootloader on them, however, I got a bootloader on them as you mentioned with a 16MHz crystal. In the end I want to control a TLC5940 with it, I believe I hooked it up and tried to upload a sketch to it without a crystal and it did not work... I don't remember exactly where I encountered problems, I assumed it was because I burned the bootloader with an external clock that it would have to be burned without a crystal if I wanted to use it that way.
I will give it at try again and post the results.

Ok I just tried to upload a sketch to a breadboard mounted 328P. Here are the steps that I took:

  • Removed power and removed the Arduino 328 from its cradle on the Arduino board
  • Hooked up the connections according to the instructions in my first post (have a connection pic up in the next post)
  • Choose "ATmega328 on a breadboard" from the board list (Arduino Software 22)
  • Attempted to upload the "basic use" sketch under "File>Examples>tlc5940"
  • Rx/Tx blink faintly once or twice and after about a minute I get the following error:

Problem uploading to board. See troubleshooting guide...

Avrdude: stk500_getsync() : not in sync: resp=0x00
avrdude: stk500_disable() : protocol error, expect=0x14, resp=0x51

Okay, I'm going to see if I can remember what I did, do it, then I'll document it here.

Update:

All this done under V.0022

Okay, here's what I did.

  1. I got two 328Ps and burnt fresh Duemilanove BLs onto to both using an OMS AVR Prog-S ICSP programmer.

  2. One I put into my Duemilanove, the other I put on a breadboard (with crystal) and verified both were working.

  3. I loaded the Arduino ISP sketch onto the Duemilanove

  4. I connected the Duemilanove to the breadboard like this:

  • SCK to SCK
  • MISO to MISO
  • MOSI to MOSI
  • Pin 10 to Reset (pin 1)
  • 5V to VCC
  • GND to GND
  1. Selected board "Atmega328 on breadboard (8 MHz internal clock)"

  2. Selected "Burn Bootloader --> W/ Arduino as ISP"

Result: I was presented with the classic Not in sync error. I re-checked my wiring, verified signals with a scope, tried again and still got the sync error.

I then took the Duemilanove off and using the OMS AVR Prog-S, went back and did steps 4, 5 and 6 (selecting the right programmer).

Result: Success!

I repeated step 1 again, and this time using a USBtinyISP repeated steps 4,5 and 6 (selecting the right programmer).

Result: Success!

With the final freshly burned 328P, I got an OMS Omega-328 (Duemilanove compatible) and using it went back and did steps 3, 4, 5 and 6.

Result: I was presented with the classic Not in sync error.

Conclusion: The Arduino ISP sketch cannot deal with the "Atmega328 on breadboard (8 MHz internal clock)" BL using a chip that has already had a BL on it.

I'm guessing you don't have access to an ICSP programmer otherwise you would not be trying to use your Duemilanove.

Honestly, I don't think it will work. Not the greatest news, but I don't know what else to try. Maybe a a totally fresh chip without a crystal, but if you don't have an ICSP I'm not sure how you can erase the chip and put it back to default configuration.

You might want to consider getting an ICSP programmer. They are truly a required tool for this sport and cheap too. We sell ours for under $10. I've seen many others even cheaper, although I cannot vouch for their avrdude compatibility, I can't see someone going to the trouble of designing one that was not avrdue compatible. Even still, there are dozens out there with a proven track record. I know it does not get you out of your current predicament, but an ICSP programmer will be a very good investment in your hobby.

Thanks BillO,
I will doublecheck the steps but I am assuming that you are right and it just is not meant to be. That being the case , I will have to find an ICSP programmer. I would like to get something that I know will work, you mentioned you sell them as well. Do you have a web site where I can order them? If it is not allowed to post that information in this forum feel free to PM me with the information.

Thanks for your troubleshooting assistance.

Jason

If you click on the little blue ball in the upper left under where my name appears, it will take you to my website. I'll PM you with the details of how to find the ICSP programmer

  1. I connected the Duemilanove to the breadboard like this:

SCK to SCK
MISO to MISO
MOSI to MOSI
5V to VCC
GND to GND

What about reset? Usually, pin 10 on Uno to reset of chip to be bootloaded.

Yes, sorry or the omission. Reset was, of course, connected to Reset. I'll update my previous post.

Good catch, thanks.

BillO:
Yes, sorry or the omission. Reset was, of course, connected to Reset. I'll update my previous post.

Good catch, thanks.

Using the Duemilanove or Uno as ISP you connect pin 10 of Duemilanove or Uno to reset of chip being programmed. I will list the connections with the single change you need to make.
Duemilanove Pin 10 is used to reset your breadboard chip at just the right time before the bootload is started.

  1. I connected the Duemilanove to the breadboard like this:

Duemilanove---chip being bootloaded
SCK to SCK
MISO to MISO
MOSI to MOSI
Pin 10 to Reset (pin 1)
5V to VCC
GND to GND

Yes, you are right again. I don't know why I said reset. Too many things going on I guess, but pin 10 was used by me, and according to his picture, by the OP as well. Still doesn't work, and I think it is because there is has been a change in the fuses beyond what the Arduino ISP sketch is expecting because a bootloader was already put on the chip. When I get time, I will either get a brand new chip, or program one back to original settings and try again. None of this helps the OP though as he can't get his chips back to original and the Arduino ISP sketch appears to be too specific.

Invalid device signature

Getting an invalid device signature message is one of the symptoms of needing to disable auto-reset. The host software ends up talking to the bootloader on the duemilanove (which cpu does it have?) instead of to the ArduinoISP sketch. Duemilanove wasn't supposed to have autoreset issues with ArduinoISP, but I've never really understood why it COULDN'T. Any board that has any form of autoreset is somewhat suspect, as far as I can see. Try the 10uF cap from reset to GND (after loadering ArduinoISP.)

That might be worth a try.

After the family retired I took a brief look at the Duemilanove schematic and saw there was absolutely no reason not to just tie reset to Vcc in this case (just don't push the rest button!). I did, and everything worked fine.

You were 100% right westfw! Thanks for the pointer.

So, in analysis, when avrdude opens the com port, the TTL DTR output of the FTDI chip changes state from high to low causing a reset of the Duemilanove through that little 0.1 uF cap, invoking the bootloader and tripping up the entire process. Doh! How did they ever get this to work in the first place?

Anyway.... Give it a try Jason. Either use the 10uF cap from reset to Vcc on the Duemilanove, or just tie Reset to Vcc (but DO NOT press the reset button if you tie Reset to Vcc!!!)