problems with ebay ATtiny2313's

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
ADGM
 
Posts: 4
Joined: Thu Nov 09, 2017 3:39 pm

problems with ebay ATtiny2313's

Post by ADGM »

I have a handful of ATtiny2313's from ebay that I can't get anything to program. I've looked around and only found vague suggestion that maybe the clock settings are not default. On the assumption that it's abnormally slow, I tried a slower SCK rate with no success:

Trying to use my usbtiny programmer with avrdude:

Code: Select all

$ sudo avrdude -p t2313 -c usbtiny -v -B 32

avrdude: Version 6.0.1, compiled on Oct 21 2013 at 15:55:32
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/etc/avrdude.conf"
         User configuration file is "/home/adgm/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : usbtiny
         Setting bit clk period        : 32.0
avrdude: usbdev_open(): Found USBtinyISP, bus:device: 003:012
         AVR Part                      : ATtiny2313
         Chip Erase delay              : 9000 us
         PAGEL                         : PD4
         BS2                           : PD6
         RESET disposition             : possible i/o
         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     6     4    0 no        128    4      0  4000  4500 0xff 0xff
           flash         65     6    32    0 yes      2048   32     64  4500  4500 0xff 0xff
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          2    0      0     0     0 0x00 0x00

         Programmer Type : USBtiny
         Description     : USBtiny simple USB programmer, http://www.ladyada.net/make/usbtinyisp/
avrdude: programmer operation not supported

avrdude: Setting SCK period to 32 usec
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.
Using an UNO set up as an ISP programmer, I get slightly different results:

Code: Select all

$ sudo avrdude -P /dev/ttyACM0 -p t2313 -b 19200 -c avrisp -v -B 32

avrdude: Version 6.0.1, compiled on Oct 21 2013 at 15:55:32
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/etc/avrdude.conf"
         User configuration file is "/home/adgm/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM0
         Using Programmer              : avrisp
         Overriding Baud Rate          : 19200
         Setting bit clk period        : 32.0
         AVR Part                      : ATtiny2313
         Chip Erase delay              : 9000 us
         PAGEL                         : PD4
         BS2                           : PD6
         RESET disposition             : possible i/o
         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     6     4    0 no        128    4      0  4000  4500 0xff 0xff
           flash         65     6    32    0 yes      2048   32     64  4500  4500 0xff 0xff
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          2    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel AVR ISP
         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

Reading | ################################################## | 100% 0.05s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.05s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.05s

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


avrdude done.  Thank you.
I even tried to apply a clock to the 2313 on the assumption that maybe they were configured for external clock, all without any change.
These are all being programmed at 5v, and I have used both of the above avrdude commands with known good 2313's.

So the question is whether there are any other known issues that may be associated with ebay parts (e.g. other non-default fuse settings, etc). Any other ideas i could try? I'm willing to accept the possibility that these are entirely non-functioning parts -- if I have a way to verify that.

User avatar
danhalbert
 
Posts: 4649
Joined: Tue Aug 08, 2017 12:37 pm

Re: problems with ebay ATtiny2313's

Post by danhalbert »

Buying cheap parts on eBay is a complete gamble. Atmel chips have been counterfeited before. Sometimes the packages contain something else entirely that has just been relabeled to appear to be an Atmel chip. Try doing a websearch for "atmel counterfeit" or "attiny counterfeit" -- you'll find a lot of examples.

It would probably be best just to give up on these. They could be weird ATTiny's, defective ATTiny's, marginal, or relabeled junk. It's probably not worth your time to figure it out.

User avatar
russell 27
 
Posts: 242
Joined: Thu Sep 12, 2013 3:59 pm

Re: problems with ebay ATtiny2313's

Post by russell 27 »

Is there a reason you are using the sudo command before the avrdude string. I've never tried it or seen it in any code or make file I used.

If you use this statement to print out fuse values to text, does it work.

Code: Select all

avrdude -c usbtiny -p attiny2313 -U lfuse:r:lfuse.txt:i -U hfuse:r:hfuse.txt:i -U efuse:r:efuse.txt:i
Bad chips are possible, might be lucky, but I've not had any issues with chips purchased on ebay.

User avatar
ADGM
 
Posts: 4
Joined: Thu Nov 09, 2017 3:39 pm

Re: problems with ebay ATtiny2313's

Post by ADGM »

Russell 27 wrote:Is there a reason you are using the sudo command before the avrdude string. I've never tried it or seen it in any code or make file I used.

If you use this statement to print out fuse values to text, does it work.

Code: Select all

avrdude -c usbtiny -p attiny2313 -U lfuse:r:lfuse.txt:i -U hfuse:r:hfuse.txt:i -U efuse:r:efuse.txt:i
Bad chips are possible, might be lucky, but I've not had any issues with chips purchased on ebay.
I'm using sudo because i never bothered to fix permissions on the devices; it shouldn't be an issue, and the fact that the above commands work with a known good part from mouser support that claim.

No, issuing any read command will produce the exact same errors. It can't read registers if it can't initialize the device.

Like I said, I know the bar for expectations is low in cases like this, but I've never had anything other than trivial issues with counterfeit mcu's (e.g. attiny85, atmega328p) from ebay. I've not run across others that seemed so unrecoverable.

User avatar
ADGM
 
Posts: 4
Joined: Thu Nov 09, 2017 3:39 pm

Re: problems with ebay ATtiny2313's

Post by ADGM »

danhalbert wrote:Buying cheap parts on eBay is a complete gamble. Atmel chips have been counterfeited before. Sometimes the packages contain something else entirely that has just been relabeled to appear to be an Atmel chip. Try doing a websearch for "atmel counterfeit" or "attiny counterfeit" -- you'll find a lot of examples.

It would probably be best just to give up on these. They could be weird ATTiny's, defective ATTiny's, marginal, or relabeled junk. It's probably not worth your time to figure it out.
I know counterfeits exist, and I knew when I ordered them that they were almost 100% going to be counterfeit. There's a realm of possible issues that one accepts when they understand what they're buying, but in my experience, fake parts are typically at least functional regardless of whether they fully meet their ostensible specifications. I've bought other mcu's on ebay, and the only issue I recall ever having was regarding the microcontroller not being in factory default state (might have intentionally had a fakeduino bootloader on it for all i know). Like I said, when I google for other people's experiences, I see similar results. So the only reason I try to recover them is because the bulk of this information suggests that the devices are misconfigured rather than being entirely nonfunctional.

I probably will end up tossing them if I can't come up with something else to try.

User avatar
russell 27
 
Posts: 242
Joined: Thu Sep 12, 2013 3:59 pm

Re: problems with ebay ATtiny2313's

Post by russell 27 »

Permissions can cause problems sometimes. You started initialization on one of your connections, just couldn't find device signature. A high voltage programmer might do the trick if any one you know has one. There is a DIY device called atmega fuse bit doctor, could easily be built on proto board. This can reset chip to default fuses, or used with uart in terminal to manually communicate. Might be worth a try, regardless a very useful device to have on hand.

User avatar
ADGM
 
Posts: 4
Joined: Thu Nov 09, 2017 3:39 pm

Re: problems with ebay ATtiny2313's

Post by ADGM »

Russell 27 wrote:Permissions can cause problems sometimes. You started initialization on one of your connections, just couldn't find device signature. A high voltage programmer might do the trick if any one you know has one. There is a DIY device called atmega fuse bit doctor, could easily be built on proto board. This can reset chip to default fuses, or used with uart in terminal to manually communicate. Might be worth a try, regardless a very useful device to have on hand.
Actually, that might be a good route. I've been meaning to put together something that can do high-voltage programming, and that looks like a fairly complete project. I might just try it for the sake of having it around. I went ahead and just threw these parts in my "notable bad components" drawer. If I put together a hv programmer, i'll have something to play with; until then, I just replaced them from mouser. The 4313 is actually cheaper anyway (at least the dip package ones).

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”