Atmega328P-PU identifies itself as 328-PU

Hi

I've bought some Atmega328P-PU's for a project, these are for a low power battery operated project. The plan is to add an 8MHz boot loader and crystal so it can run from 2xAAs and use the sleep modes to reduce power consumption.

Given I was going to add a bootloader (using a Arduino Uno as programmer) I bought chips with no bootloader.

I then had problems getting the bootloader on there, as the chip identifies itself as a 328-PU rather than 328P-PU, the signature should be 1E 95 0F but comes out as 1E 95 14.

So I'm baffled why it is wrong, the chips clearly have 328P-PU printed on them as the part number, matching exactly the printing on my Uno supplied chip, except for batch numbers. Are these fakes? Would someone go to the trouble of remarking them 328P when they are really just 328's?

My thoughts are perhaps the supplier only had chips with a bootloader on, so used a programmer to flash the bootloader off but used an incorrect configuration, setting them as 328 and not as 328P. Is this possible? If yes can I correct this myself?

Currently with a bit of research I've got a modified boards.txt file and have got on a bootloader which is now using the internal clock at 8Mhz, but things would be easier if the chips were identified correctly. I really want the Pico version so I can disable brown out detection during sleep.

Any suggestions gratefully received.

Regards

Phil

Where did these chips come from?

Hi

They came from an electronics seller on Ebay and were not particularly cheap (seller has high rating and lots of sales). My first thoughts were perhaps they've been reprinted and are really 328's and not the Pico version they claim to be, however would someone go to that much trouble, there isn't a vast difference in price between them? The printing is perfect if someone has done it, no signs it has been tampered with.

I searched the internet and the only story of fake Atmegas are where the chip doesn't work at all, and is either just all plastic or in one case was a completely different bit of silicon inside. These chips marked as 328P but telling the outside world they are 328, are working absolutely fine, so I wondered if a mis-programming (perhaps to remove a bootloader because all they had were programmed) could have resulted in their IDs (fuses) set incorrectly.

It might be these were wrong at the factory and should have been scrapped of course.

I'm going to order a few more from a well known UK electronics seller, the irony is they are the same price anyway.

Regards

Phil

This sounds like another example of why I avoid eBay. I know what you mean though, I also wonder why someone would go through the trouble. Not sure what the going price is in the UK, but if I buy 10 from Mouser, they're under $3 each. Buy 25 and they're just over $2. I've never heard of mis-programming changing the signature bytes, I assume they are truly read-only (datasheet says they're in a separate address space). If somehow they can be written, then why not just change them back to what they're supposed to be. I would not assume that just because they run fine that they are fine. The only way to truly know would be to test them at and beyond the stated limits for temperature, supply voltage and clock frequency. In order to interpret the results of such tests, one would need information that probably only Atmel has. To the contrary, given that these chips have two strikes against them (suspicious origin, unexplained signature byte deviation), I would assume that they are not OK. I would not want one controlling some critical system in my car or in my F-22 :wink:

Hi

Yes Ebay can be hit or miss, although some of the direct from China stuff can be really good value for money, and for hobby type things it is fine.

But yes beginning to think something is wrong with these chips, I did Google about changing Ids and couldn't see anything about changing the chip identifiers. If they are fake they've done it well changing the printed text on the chips, I suppose if buying and selling thousands then making a bit extra by re-labeling the slightly cheaper non pico version might make someone some extra money (although from the UK supplier I've ordered from the non Pico is more expensive!), but even then there is the time and cost of reprinting them, still these things happen as we know. I'm more inclined to think these should have been scrapped as wrong from the factory but some enterprising person thought they could make some money so they never got melted down.

I've now ordered a dozen at 1.80 each from a very well known big UK electronics supplier, so around $3 as well, I don't need that many at the moment but I always find other projects.

I've emailed the seller to see what they say.

Regards

Phil

Hi

Just an update, received some new virgin ATMegas from different supplier. These identify themselves correctly as 328P and were in a virgin state, i.e. no bootloader and set for internal 8MHz clock / 8.

Bootloader went on straight away no problems.

Regards

Phil

Did you ever hear from the seller on the first batch?

Hi

Yes, they said they checked their stock and they were all reporting the same (incorrect) IDs. I've scrutinised their chips with the new ones that are reporting the correct ID and they are identical in printing and design. I think the supplier is only guilty of buying up some cheap stock, and that the IDs were either a mistake by Atmel and the chips should have been scrapped or they were set this way for a specific order where they didn't have enough of the 328 inventory, then lots were left over or the customer went bust and these have find their way into bankrupt stock.

I could send them back for a refund but as they are working and it was only 3 I purchased I can use them for prototyping. I did find some reference on the net to the IDs being held in an area of flash memory so with the right tools they could be changed.

Live and learn.

Regards

Phil

"28.3 Signature Bytes
All Atmel microcontrollers have a three-byte signature code which identifies the device. This code can be read in both serial and parallel mode, also when the device is locked. The three bytes reside in a separate address space."

"28.6 Parallel Programming Parameters, Pin Mapping, and Commands
This section describes how to parallel program and verify Flash Program memory, EEPROM Data memory, Memory Lock bits, and Fuse bits in the ATmega48A/PA/88A/PA/168A/PA/328/P. Pulses are assumed to be at least 250 ns unless otherwise noted."

"28.7.13 Reading the Signature Bytes
The algorithm for reading the Signature bytes is as follows (refer to ”Programming the Flash” on page 293 for details on Command and Address loading):"

"28.8.3 Serial Programming Instruction set
Table 28-19 on page 301 and Figure 28-8 on page 302 describes the Instruction set.

Write Instructions(6)
Write Program Memory
Write EEPROM Memory
Write EEPROM Memory Page
Write Lock bits
Write Fuse bits
Write Fuse High bits
Write Extended Fuse Bits"

And still no mention of writing Signature bytes. They are not changeable.

There were some messages on avr freaks to the effect that the whole signature row COULD be written using undocumented programming commands...

westfw:
There were some messages on avr freaks to the effect that the whole signature row COULD be written using undocumented programming commands...

I thought that was hard coded, I mean like ROM.