Getting different signature bytes for ATmega1284PU

Hi,

I'm running Nick Gammon's board detector program on an ATmega1284PU and while things seem to work in terms of the communication with the MCU, I'm getting different signature bytes every time I run the program. For example, for the same ATmega1284PU chip I got:

1E 97 06
1E 01 06
FF 2F 06
1E FF 06

I've also seen different fuse values. Does anybody have an idea why that's happening? Is it a timing problem? If yes, why? I have the same wiring as in Nick's instructions. I'm using a 16Mhz crystal for the timer and .22 caps from the crystal pins to ground.

Thanks,
Yondav

I'm summarizing the solution for the benefit of people that come across the same issue:

Troubleshooting guidelines

  • Double check the wiring to make sure nothing is loose
  • Try a different section of the breadboard in case the contacts are not good
  • Disconnect the external crystal and try again (i.e., use the internal crystal)

What solved the problem
Bring down the bit rate to less than sixth of the clock speed. In the board detector program I used (by Nick Gammon), that can be done by modifying the following line:

SPI.setClockDivider(SPI_CLOCK_DIV64)

The usual culprit is wiring. Getting some data back indicates a loose wire.

FOr the same chip definitely there must be only one single signature value, so somethings pretty loose there :fearful:

I'm using a 16Mhz crystal for the timer and .22 caps from the crystal pins to ground.

Well look into the datasheet for the crystal you are using they define in the datasheet for the crystal that what capacitance is needed for the aforementioned crystal to work fine.

Thank you for the suggestions. I took out all the connections and put them back in but I still get different signatures. I am attaching a picture of the wiring with labels. What am I doing wrong?

Thanks!
Yondav

Get the crystal and caps right next to the chip, not wired way off to the side.
Add 0.1uF caps to VCC pins.

Do you have the fuses set to Full Swing Crystal?

well the crystal is like a mile away from the chip, get it near first, you give the error rate of a oscillator a high while keeping it so far and then not computing the capacitance according to the distance its kept off the uC's range.

Sometimes the breadboard pins are loose and that results in floating of the pin which can sometimes get connected or disconnect at times, this has happened to me.

Thank you everyone for the responses.

The original wiring I had had the crystal close to the chip. I moved it away just so that I can take a clearer picture of the wiring but didn't realize that that will likely make the situation worse. I have the crystal now back where it was (near the chip) and I also put the chip straight into the breadboard instead of using the socket. The result now is that I get what I believe is the correct signature reading "1E 97 06" about 60% of the time but still get a different signature the rest of the time.

Regarding the 0.1uf caps - I do have those near both sides of the VCC pins, did I connect those incorrectly?

Regarding the question about the fuses (Full Swing Crystal) - I am not sure how to check what I have based on the output from Nick's program. Should I look for the bits under the L (0x62), H(0x99), E(0x00) fuses or under Clock Calibration (0x00) or somewhere else?

Also - Is there anything else I can check in the wiring?

Thanks again!
Yondav

http://www.engbedded.com/fusecalc

Should I look for the bits under the L (0x62), H(0x99), E(0x00) fuses...

Are those your current fuse settings? Assuming I did not make a mistake that is...
Int. RC Osc.; Start-up time: 6 CK + 65 ms; [CKSEL=0010 SUT=10]

In which case it makes no difference where you put the crystal. It is not being used.

Yes, those were the actual values reported by the board detector program. Since I keep on getting different results, I'm not sure I can trust the reported fuse values to be correct.

Man... it has to be some wiring issue it seems from all of that you are experiencing.

Is it a Virgin chip definitely?

yondav:
Yes, those were the actual values reported by the board detector program. Since I keep on getting different results, I'm not sure I can trust the reported fuse values to be correct.

Disconnect the crystal and try again.

I did disconnect the crystal before and it did not change the results. However, NI$HANT got me thinking that it could be the chip itself. The chip I tested was a virgin chip but I had another one. So I connected the second chip and low and behold - everything is working fine!!! I guess it must have been the chip and not the wiring all along.

I thought a bad chip to be really rare thing. Does it make sense that the chip was faulty to begin with? Is there anything I can do to make the bad chip work or should I just throw it away?

Thanks,
Yondav

The usual coarse is to swap the chips again (repeat the experiment). The idea being that the first swap jostled the loose wire. If the "bad" chip still appears to be "bad" then you declare it officially dead and toss it in the trash. At less than $8 it is not worth wasting any more time on it.

I thought a bad chip to be really rare thing.

It is in my experience. But I've always purchased from DigiKey, Mouser, or Avnet (established vendors with good reputations).

Yes, I of course repeated the test with both chips before I came to the conclusion that the first chip was bad. I got mine from Arrow and it was for a really good price compared to DigiKey's and others. Not sure if there was a hidden reason behind that low price as I believe that Arrow is also a reputable distributor.

Were the chips packaged properly? (anti-static bags with conductive foam)

I bought a few of those chips. They came in a long plastic sleeve that was inside a large anti-static bag.

That's the way I typically get them from DigiKey and Mouser.

Guess it's just the one-in-a-million bad chip.

Guess it's just the one-in-a-million bad chip.

Yup! happens but you do not wont be the one who gets that one in a million! :grin:

Try a different section of the breadboard. Maybe one of the contacts is not making good contact with a pin.