logo elektroda
logo elektroda
X
logo elektroda

Counterfeit ATtiny/ATmega microcontrollers in DIP housings

RomanWorkshop 4500 23
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
📢 Listen (AI):
  • Counterfeit ATmega88PA-PU microcontroller with sanded and reapplied labels.
    While shopping on AliExpress, I noticed that a certain shop also has ATmega88PA-PU microcontrollers in DIP28 cases, so I ordered 2 pieces (price under 6 zł. per piece). After 8 days of dispatch, the package arrived. The writing on the microcontrollers looked quite good, but the signature read in the programmer no longer. One piece had two pins internally damaged and the signature could not be read at all - to be thrown away. The other one was used - it had the signature 0x1E930A correct for ATmega88(A/V), some program was uploaded and the fuse bits changed. Evidently a fake with the top of the case sanded down and new lettering applied, which had worn off when exposed to acetone. The original lettering is laser-engraved, so it is impossible to remove with acetone or any other solvent. Both pieces had identical dates ("1910" = week 10 of 2019) suggesting they came from a single production batch. .
    .
    ATmega88PA-PU microcontroller with visible markings on the casing.

    Counterfeit top lettering with false
    model and date of manufacture of the system.

    Photo of ATmega88PA-PU microcontroller in DIP28 package with fake markings.

    Upper inscriptions rubbed off under the influence of
    acetone (grinding marks visible).

    ATmega microcontroller with visible markings.

    Non-counterfeit lower-case lettering with a true-
    version/revision lettering and date of manufacture of the
    layout.
    .
    This also turned out to be a hoax after looking at the lettering on the bottom of the case, which was not forged (perhaps it needs too much work). The ATtiny/ATmega microcontrollers in the DIP cases, have a second production date (green box) and a letter on there to indicate the version/revision of the chip (red box). In the pieces ordered, these dates were different: "0936" (36th week of 2009) and "0808" (8th week of 2008).

    At this point I knew that I had 1 working piece of the ATmega88/88A/88V. Now I wanted to find out which specific model I had. The ATmega88V model can be identified by the fact that it should not operate at clock frequencies above 10 MHz (e.g. with a 20 MHz quartz at supply voltage Vcc = 4.5-5.5V). If the microcontroller is operating at this frequency, two possibilities remain: ATmega88 or ATmega88A. The ATmega88A model can be recognised by the fact that it should operate at a clock frequency of 4 MHz and a supply voltage of Vcc = 1.8V (a normal ATmega88 should only operate from 2.7V). The second feature of the ATmega88A model is its lower current consumption, which, at 8 MHz and Vcc = 5.0V, is: about 5mA for the ATmega88 and about 4mA for the ATmega88A (the measurement conditions are described in the datasheet note, but in practice they are difficult to obtain and measure the current with such accuracy).

    In summary, after testing, all indications are that I have the "D" version of the ATmega88A (it works at 4 MHz/1.8V - it flashes the LED, while, for example, the ATmega48-20PU does not work under such conditions). I have set up a dispute for a refund (I have attached pictures of the microcontroller, screenshots of the programmer and a description of the inconsistencies in the markings), which were received several hours later. I did not have to return the received chips. Despite the scam, I am still ahead by one "paint job", although it is not entirely clear whether it is fully operational.

    Useful links:
    http://romanworkshop.blutu.pl/avr/tips.htm - page with information about AVR microcontrollers (designations, parameters, signatures).
    http://romanworkshop.blutu.pl/proj/avrdb.htm - program with basic information (parameters, signatures, default fuse bit values).

    Cool? Ranking DIY
    About Author
    RomanWorkshop
    Level 14  
    Offline 
    RomanWorkshop wrote 214 posts with rating 403, helped 2 times. Been with us since 2013 year.
  • ADVERTISEMENT
  • #2 21161543
    Sam Sung
    Level 33  
    Well, interesting. And can anything be said about my ATtiny13A for less than a dollar?
    ATtiny13A microcontroller with marking 2309SKY Image of an ATtiny13A microcontroller with markings on the top surface.
    Inscription from above: ATTINY13A 2309SKY
    Inscription from below: C 87
    The signature agrees with the catalogue note (1E,90,07).
    Another issue:
    2 bits of address are defined for the Read Signature Byte command, and 1 bit of address is defined for the Read Calibration Byte command. However, reading a further area returns some data. They are repeated every 16 bytes. Is it perhaps known what these further bytes mean? What is mapped there?
    Signature: 1E 90 07 FF FF FF FF 55 30 48 30 08 8E 16 1E (from 8-11 in ASCII: "U0H0")
    Calibration: 5E 65 FF FF FF FF FF FF 34 39 2E 30 85 A2 06 15 (from 8-11 in ASCII: "49.0")
    And on an old ATtiny2313-20PU with decent, clear captions and I think the date 0623 looks like this:
    Signature: 1E 91 0A FF ED FF FF 46 30 31 FF 17 17 12 13 FF
    Calibration: 5B 57 FF FF FF FF FF 36 37 31 02 3D FF FF FF FF FF
    Can this somehow be used to detect fakes?
  • ADVERTISEMENT
  • #3 21161583
    RomanWorkshop
    Level 14  
    The signature for the ATtiny13/13V/13A microcontrollers is identical, so no specific model can be determined from it. A test with acetone would clarify whether the inscriptions are original, as they look suspicious: production date "2309" = week 9 of 2023 with Atmel's logo when it was acquired by Microchip in 2016 and on such new chips, rather the latter's logo should be placed. You would need to do a performance test at 20 MHz/5V to rule out the ATtiny13V version. Then a performance test at 4 MHz/1.8V to confirm the ATtiny13A version (ATtiny13 only works from 2.7V).

    As for reading data outside the described area, I haven't researched the subject, but there is unlikely to be anything useful there (random bytes).
  • ADVERTISEMENT
  • #4 21161592
    gregor124
    Level 27  
    RomanWorkshop wrote:
    2309" = week 9 of 2023 with the Atmel logo when it was acquired by Microchip in 2016 and on such new chips, it should rather have the latter's logo
    .
    Not quite, I have new chips purchased directly from Microchip with a production date of 2021 with the Atmel logo.
  • ADVERTISEMENT
  • #5 21161600
    RomanWorkshop
    Level 14  
    >>21161592 .

    Of course this may be the case, Atmel's trademarks belong to them, so they use them on their 'new' chips. This way it's even easier to distinguish AVR microcontrollers from PICs, and users also have more confidence in a well-known logo.
  • #6 21161619
    TechEkspert
    Editor
    Interesting investigation, and it's quite a mine you can get into if you buy a larger series from such a source....
  • #7 21162079
    zgierzman
    Level 31  
    Respect to the Author for the meticulous investigation.

    Chinese repainting is a known problem, especially with hard to find and expensive parts. Repaint a transistor for 10 cents and sell it for $90 to some audiophile equipment repairman.... There's a profit to be made, then a month later the shop name is changed and it drags on indefinitely. Bonanza.
    But here I don't understand the point of this business. We're dealing with an original ATmega, the model seems to match too, just the date repainted.... WTF?
    If they sold for the price they are selling for (half the price from Mouser), with the original markings, adding the annotation "programmed" in the description, customers would probably not be lost.
    It is well known - they will prepare a million watch or RLC component tester kits, and 800,000 will be sold. A heap of components remains, which also need to be liquidated. If they did it honestly, maybe they would have a better turnover than on these scams. Because now they only prey on the thrifty, who would rather buy for 6 PLN from a Chinese than for 12 PLN at Mouser.... And it's a one-off until the guy gets burnt, like Roman. If they approached the matter honestly, various less-affluent hobbyists and small-batch tinkerers might even arrive as regular customers...?

    Screenshot of Microchip ATMEGA88PA-PU listing on Mouser Electronics website. .
  • #8 21163408
    szeryf3
    Level 29  
    @RomanWorkshop I thought the Chinese had stopped this practice already.
    But they still dispose of electro-waste.
    How much does it cost them to do an hour's work if they are still repainting the circuits as ordered by the customer?
  • #9 21163641
    elektryku5
    Level 39  
    As if to give anyone pause for thought, how is an Arduino from China cheaper than the Atmega itself used in it.

    Likewise, by the way, with 32F103s sitting in various modules....
  • #10 21163739
    Sam Sung
    Level 33  
    I have read on avrfreaks that the signature and calibration area is actually an extra page of flash.
    How to look at the ISP commands:
    0010 H000 0aaa aaaa bbbb bbbb - Read Program Memory
    0011 0000 000x xxxx xxxx xxbb - Read Signature Byte
    0011 1000 000x xxxx 0000 000b - Read Calibration Byte
    
    it can be seen that accessing the signature and calibration is similar to reading Program Memory (only 0011 instead of 0010), with the signature being in the less significant word bytes of that extra flash page (H=0) and the calibration in the more (H=1).
    If I rearrange the bytes read from the ATtiny2313 as signature and calibration (given in the previous post), it comes out
    5B 1E 57 91 FF 0A FF FF ED FF FF FF 36 46 37 30 31 31 02 FF 3D 17 FF 17 FF 12 FF 13 FF FF FF
    The bytes underneath offsets 14-19 give in ASCII the string 6F7011 , which is written on the underside of the microcontroller on the first line:
    Black DIP microprocessor with alphanumeric markings on the top surface. .

    And on the eevblog it is stated that with the undocumented command AC C0 (differing only by one bit from Chip Erase = AC 80) this extra flash page can be erased and then we have FFs instead of signature and calibration data.

    Presumably there is also an undocumented command to save this flash page, so it may turn out that this data was also swapped during the "refurbishment", i.e. relying on the signature to detect fakes may be illusory....
  • #11 21163988
    RomanWorkshop
    Level 14  
    >>21163739 .

    An interesting topic, requiring further investigation on various microcontroller models. I was particularly intrigued by the serial number from the case, stored in a "hidden" area of FLASH memory, which in my opinion should be read-only (as is the signature). Even if the counterfeiters know a way to change the signature, they don't use it, because in the case of my chips the signatures don't match the model on the case. They don't even change the bottom lettering on the case (which, after all, could be done by machine), let alone take the time to (rather manually) reprogram each chip (if this is even possible). This would not be cost-effective at such low prices per unit.
  • #12 21164069
    gregor124
    Level 27  
    These extra bytes after the 3 signature bytes and the calibration byte are Serial Number bytes otherwise (unique device ID).
    They can be read when reading the signature or, for example, from the program level by reading the I/O addresses 0xF0 - 0xF8 (SNOBRx).
  • #13 21164091
    RomanWorkshop
    Level 14  
    >>21164069 .

    It's just that these concepts were only introduced in the documentation of the ATmega48/88/168/328PB microcontrollers, which are completely new chips (they have additional features), although compatible with previous models. Before that, nobody knew that a whole separate page of FLASH memory, contains some additional information (including the serial number from the case).
  • #14 21164146
    gregor124
    Level 27  
    @RomanWorkshop
    It's not as if a given layout is created once and for all. Errors happen not only in the editing of instructions, but also in the designed layouts. And this is why, for example, Silicon Errata and Data Sheet are created.
    Sometimes the errata include suggestions on how to get around the error. E.g. STM32F103 CRC counting circuit error - errata suggests not to use CRC counting circuit ;) . But maybe someday they will correct this, although at today's rate of introducing new chips I doubt it ;) .
    This, among other reasons, is why serious applications still use 8-bit chips ;) .

    Sometimes certain solutions appear in the circuits earlier than in the datasheet. And there are also times when, for example, information appears in the datasheet that relates to circuit revisions that for some reason never make it into production.
    You just have to keep track of the different revisions, and sometimes you can look for these solutions in earlier chips and you may find that something was implemented in some versions of the chip, but e.g. in earlier ones it was not there, and e.g. in the manual it appeared later.
    However, this does not mean that if, for example, we have 2 chips with a commercial name, e.g. Atmega88, and in one after reading the ID we have some additional data, and in the other there is none, that the second one is a fake. It could be e.g. a different silicon version.

    I have checked new chips bought directly from Microchip and signed Atmel, there is no printing on the bottom on any of the last years I have.
  • #15 21164180
    RomanWorkshop
    Level 14  
    >>21164146 .

    The information about the additional data in the "hidden" FLASH memory, has been completely concealed by the manufacturer. I suppose that the serial number from the case is also stored in the memory of every newer model (e.g. ATtiny13, ATmega8). This can be checked, but to a rather limited extent (it is hard to get the first copies of a given microcontroller).

    gregor124 wrote:
    I have checked new chips purchased directly from Microchip and signed Atmel, there is no printing on the bottom on any of the last years I own.


    I have one copy from 2020 and it too has no markings on the bottom of the case (it just has a 5-digit number with the version letter at the top). Apparently they have stopped putting these markings on for some year now (maybe due to cost saving).
  • #16 21164667
    RomanWorkshop
    Level 14  
    However, the signature, calibration data and other 'hidden' information, are stored in ordinary FLASH memory, which can be erased even accidentally during serial programming. In this topic someone found a mention of such a possibility in the catalogue note (errata) of the ATmega8(L) microcontroller.

    Quote:
    3. Signature may be Erased in Serial Programming Mode .
    If the signature bytes are read before a chiperase command is completed, the signature may be erased causing the device ID and calibration bytes to disappear. This is critical, especially, if the part is running on internal RC oscillator.

    Problem Fix / Workaround: .
    Ensure that the chiperase command has exceeded before applying the next command.
    .

    This mention no longer appears in any other catalogue note. The instruction to erase the "hidden" FLASH memory is known, only the instruction to program this area is still missing and the signatures, calibration data and serial numbers of the AVR microcontrollers can be changed at will.
  • #17 21164988
    gregor124
    Level 27  
    RomanWorkshop wrote:
    This change no longer appears in any other catalogue note. The instructions for erasing the "hidden" FLASH memory are known, only the instructions for programming this area are still missing and the signatures, calibration data and serial numbers of the AVR microcontrollers can be changed at will.
    .

    How does it not appear?
    After all, it is in this document:
    https://ww1.microchip.com/downloads/aemDocume...mega8A-SilConErrataClarif_DS80000853A.pdf.pdf
    to which the link is in the ERRATA section, which can be found here (latest data sheet released):
    https://ww1.microchip.com/downloads/aemDocume...ataSheets/ATmega8A-Data-Sheet-DS40001974B.pdf

    As further errors are detected, the document with the description of the corrections will be updated and a link to it will be included in the updated data sheet.
  • #18 21169245
    RomanWorkshop
    Level 14  
    I have looked through the AVR microcontroller catalogue notes I have and find that the manufacturer has not always completely suppressed information about the 'hidden' side in FLASH memory, which contains, among other things, the signature and calibration bytes. In most notices the only mention of this area of memory is:

    "The three bytes reside in a separate address space." - this refers to the 3 signature bytes residing in a separate address space.

    "This byte resides in the high byte of address 0x000 in the signature address space." or "These bytes resides in the signature row high byte...". - refers to the calibration byte(s), located in the signature address space.

    Much more information can be found in the ATtiny24/44/84, 25/45/85, 441/841, 828, 1634, 2313A/4313 microcontroller notes under "Device Signature Imprint Table". There, a table is shown which contains the addresses and descriptions of the various parts of the "hidden" memory area. Apart from the signature and calibration bytes, the remaining data in this area is described as "Reserved for internal use" - reserved for internal use.

    Table from the ATtiny24/44/84 microcontroller note:

    Device Signature Imprint Table showing addresses and data for microcontroller memory. .

    Only in the ATtiny441/841 microcontroller note, the table contains additional descriptions: The 6-digit production lot number ("Lot number xxx character"), the silicon wafer number ("Wafer number") and the XY-coordinate on the wafer ("X/Y-coordinate") from which the microcontroller core is derived:

    Device Signature Imprint Table showing memory addresses and descriptions for a microcontroller, including calibration data and serial numbers. .

    The 6-digit serial/production lot number, probably found at the same address in all microcontrollers that have it stored in "hidden" memory (e.g. ATtiny85, ATtiny441/841, ATtiny2313, ATmega328).
  • #19 21170551
    RomanWorkshop
    Level 14  
    I read the 'hidden' memory of the counterfeit microcontroller from the first post and found that the serial number from the bottom of the case ('8J6671') matched the one stored in its memory:

    921EFF93FF0AFFFF0CEEF7FFFFFF384A
    3636373107FF0724061719121913FFFF
    FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
    FFFFFFFFFFFFFFFFFFFFFFFFFFFF2590
    .
    This allows us to assume that the signature has not been forged either.

    I have read the "hidden" areas from almost all the microcontrollers I own and found one whose serial number from the bottom of the case ("A9B98A") does not match the one stored in memory ("7U5533"). This is an ATmega328P-PU definitely bought in a Polish shop, but I don't remember in which one and when. The production date on the top of the case, agrees with the date on the bottom of the case. Could it be a mistake during production?

    891EFF95D60F26000BFF17FFFFFF3755
    3535333319FF2608021708120813FFFF
    FFFFFFFFFFFFFFFF69FFFFFFFFFFFFFF
    FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
    FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
    FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
    FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
    FFFFFFFFFFFFFFFFFFFFFFFFFFFF0F34
    .
    Close-up of ATmega328P-PU microcontroller with manufacturer's markings. Microcontroller with markings A9B98A, 35473D, 1-P1727 e3 on the casing.
  • #20 21170620
    zgierzman
    Level 31  
    RomanWorkshop wrote:
    I read the "hidden" memory of the fake microcontroller from the first post and found that the serial number from the bottom of the case ("8J6671") matches the one stored in its memory


    Could it be, however, that this is no "fake" atmega, but a full-fledged prcesor from which the factory markings have been removed for some reason?
    For example, it was prepared to be sold in some device or kit, and, as you know, manufacturers of such toys like to grind down/flame the names of ICs. But the product didn't sell, and to sell the processors in bulk, you have to print the inscriptions again.
    And I still stand by the opinion from my previous post, that they would win more by writing honestly what and how, but this is just my opinion.
  • #21 21171602
    RomanWorkshop
    Level 14  
    zgierzman wrote:
    Is this, however, not a "fake" atmega, but a fully-fledged prcesor from which for some reason the factory markings have been removed?


    Counterfeit due to the fact that the markings on the microcontroller's casing do not match, either with its signature or with the production date on the bottom of the casing (I bought a 2019 ATmega88PA model from appearance, while inside it is probably a 2009 ATmega88A). The reason for removing its markings, on the other hand, is another matter - it was certainly done on purpose.
  • #22 21174495
    gregor124
    Level 27  
    @RomanWorkshop
    The idea is probably to sell unmarketable chips. Nowadays it would be hard to sell an ATmega88A, so someone e.g. bought a big batch from a distributor for nothing, polished it up and is trying to upsell it. And because it has an 'attractive' price, the dealers got tempted and now there is a lot of it. But it could also be that they have actually counterfeited the ATmega88A and, in addition, not enough that it is counterfeit.
    This one has the TAIWAN stamp and the others?
    Some chips have altered structures and it is possible, for example, to write a procedure to check exactly which version of silicon you are dealing with. But I see that only two versions of the 88A were sold and both with the same errors. Apparently they could not be easily eliminated or were not cost-effective. The situation is different with the 328P, for example.
    Perhaps the bugs were only noticed when the 328P was on the top and corrected in the last version.
  • #23 21187371
    RomanWorkshop
    Level 14  
    >>21169245 .

    There are even official articles on serial numbers, stored in microcontrollers: Link , Link .

    Quote:
    Question
    What are the MCUs with non-erasable unique ID in AVR 8 bit family?

    Answer
    Most classic AVR mega and Tiny devices do not have unique serial number except ATmega328PB/48PB/88PB/168PB. And all Xmega, megaAVR0 and ATtiny0/1 families have unique serial number which can be used to identify a specific device in the field.
    .

    Quote:
    Question
    How to read serial number in AVR - Mega/Tiny devices and what are the details of the serial number?

    Answer
    For the Mega and Tiny devices that provides Serial number, they have similar signature addresses for Lot Number, Wafer Number and X, Y coordinates. So, the following format may be used to read the Serial number for the Mega and Tiny devices. The details of the serial number are:

    Byte Address --------- Description

    0x0E --------- Lot Number 2nd Char
    0x0F --------- Lot Number 1st Char
    0x10 --------- Lot Number 4th Char
    0x11 --------- Lot Number 3rd Char
    0x12 --------- Lot Number 6th Char
    0x13 --------- Lot Number 5th Char
    0x14 --------- Reserved
    0x15 --------- Wafer Number
    0x16 --------- Y-coordinate
    0x17 --------- X-coordinate
  • #24 21188001
    oscil1
    Level 21  
    RomanWorkshop wrote:
    Counterfeit due to the fact that the markings on the microcontroller case do not match, nor its signature
    .
    Buy from official distributors and they will be good. You'll even know from which roll + all its information (this is by request, as it's more likely to be for production only, and there if any quality standards are applied then you don't often buy cut)
📢 Listen (AI):

Topic summary

The discussion centers around the issue of counterfeit ATtiny and ATmega microcontrollers, particularly those in DIP housings purchased from AliExpress. A user reported receiving ATmega88PA-PU chips that appeared to be fakes, with one chip damaged and the other showing signs of tampering, such as altered markings that wore off when exposed to acetone. Other participants shared experiences with similar counterfeit products, including ATtiny13A microcontrollers, and discussed the implications of such counterfeits in the market. They noted that counterfeiters often sand down original markings and reapply new ones, leading to discrepancies in signatures and production dates. The conversation also touched on the potential for hidden serial numbers in the microcontrollers' memory, which could help identify genuine parts. Participants emphasized the importance of purchasing from official distributors to avoid counterfeit components.
Summary generated by the language model.
ADVERTISEMENT