ATTiny2313 vs Older AT90S2313 Question

Electronics Computer Programming Q&A
Post Reply
ringram2077
Posts: 4
Joined: Sat Feb 07, 2009 7:10 am
Contact:

ATTiny2313 vs Older AT90S2313 Question

Post by ringram2077 »

Hi
I am not very familiar with the AVR micros. The Feb 2009 N&V issue has a project for a digital garage lock. It uses the ATTiny2313. I have one of the older AT90S2313 devices and wondered if the code would work on that device. I realize that I would need a crystal since the project uses the internal oscillator on the ATTiny2313. But other than that are the two devices the same as far as the code ?

Thanks
Bigglez
Posts: 1282
Joined: Mon Oct 15, 2007 7:39 pm
Contact:

Re: ATTiny2313 vs Older AT90S2313 Question

Post by Bigglez »

ringram2077 wrote:It uses the ATTiny2313. I have one of the older AT90S2313 devices and wondered if the code would work on that device.
Probably, but tweaks may be needed. The ideal is
good in theory, but in practice one would spend
much time and face much frustration to roll back
to an obsolete product.

The Attiny2313 costs less than $2.50. What is your
time worth?
ringram2077
Posts: 4
Joined: Sat Feb 07, 2009 7:10 am
Contact:

Re: ATTiny2313 vs Older AT90S2313 Question

Post by ringram2077 »

Good point. Probably best just to get the Tiny device and be done with it. One thing that made me wonder about using the older device is that the Bascom code uses 2313def.dat for the device which I think is for the AT90S2313. Also I don't have a programmer that will burn a Tiny2313 but I know that ICSP is fairly simple to do and free programmer software is available. Thanks for the reply.
Bigglez
Posts: 1282
Joined: Mon Oct 15, 2007 7:39 pm
Contact:

Re: ATTiny2313 vs Older AT90S2313 Question

Post by Bigglez »

ringram2077 wrote: One thing that made me wonder about using the older device is that the Bascom code uses 2313def.dat for the device which I think is for the AT90S2313.
What version of BASCOM do you have?
Mine is:
Image
Use your browser to examine the supplied BASCOM files.
Notice that the 2313.dat is 6k and ATtiny23.dat is 23k.
They are not the same, and if the published code has
selected the wrong one you should contact the author
for clarification.

Please post here any news that you discover for the
benefit of others.
ringram2077
Posts: 4
Joined: Sat Feb 07, 2009 7:10 am
Contact:

Re: ATTiny2313 vs Older AT90S2313 Question

Post by ringram2077 »

What version of BASCOM do you have?
Using 1.11.9.1 here.

I found out that my avr programmer is apparently not working anymore so I threw together a parallel port dongle that works with TWinAVR. Just got it working a programmed my AT90S2313 with the hex code from the article in N & V mag. Although not a complete test I hooked up a piezo beeper and the program opens up with beeps which matches what the code shows. I don't know what the deal is with the 2313def.dat that he has in the code. I will need to do more testing to see if the code is really working correctly with this device. The fuses are a lot different in the tiny2313 but maybe he has written the code such that it will run on either device. There is no link the the authors email but I can send something to N & V about this.

Thanks
Bigglez
Posts: 1282
Joined: Mon Oct 15, 2007 7:39 pm
Contact:

Re: ATTiny2313 vs Older AT90S2313 Question

Post by Bigglez »

ringram2077 wrote: Using 1.11.9.1 here.
Looks like I can get an upgrade!
ringram2077 wrote:I found out that my avr programmer is apparently not working anymore so I threw together a parallel port dongle that works with TWinAVR.
What hardware are you using? AVRISP? AVRISPmkII? STK500? Dragon? Other?
ringram2077 wrote:I don't know what the deal is with the 2313def.dat that he has in the code.
The def file can be overwritten with a compiler directive. Either way
the file that matches the target chip is needed.
ringram2077 wrote: I will need to do more testing to see if the code is really working correctly with this device. The fuses are a lot different in the tiny2313 but maybe he has written the code such that it will run on either device.
By coincidence I spent hours yesterday on a similar problem. I'm using
Attiny261 to replace Attiny26L, which I picked last year to replace the old 2313.
Of these three only the Attiny261 is recommended for new designs.
Unfortunately my AVRISPmkII and AVR Studio4 made the target 'T261
non-working. I went through most of a rail of factory fresh chips trying
to solve the problem. With help from AVR freaks I got hints on strapping
the STK500, and was able to HVPP those dead 'T261 chips(!)
All is well now, and I have built a dongle to mod my STK500 for this task
if I need it again.
Image
Image
ringram2077 wrote:There is no link the the authors email but I can send something to N & V about this.
As a reader I'd like to see compulsory author email contact info and membership in the
forum in the print (and on-line) issues. So far my suggestion hasn't gained traction at the
publisher.
ringram2077
Posts: 4
Joined: Sat Feb 07, 2009 7:10 am
Contact:

Re: ATTiny2313 vs Older AT90S2313 Question

Post by ringram2077 »

What hardware are you using? AVRISP? AVRISPmkII? STK500? Dragon? Other?
Here is the programmer I built:

http://www.qsl.net/pa3ckr/bascom%20and% ... hct244.gif

I ripped a 74ls244 off an old board I saved ( I save a lot of old boards and get most parts from them ).
Engineer1138
Posts: 458
Joined: Thu Feb 05, 2004 1:01 am
Location: Minneapolis, MN
Contact:

Re: ATTiny2313 vs Older AT90S2313 Question

Post by Engineer1138 »

It will work just fine. I found myself in a similar situation about 2 years ago.
Atmel has an appnote on converting from the 90S2313 to the Tiny2313. For most applications, the only changes are in the fuse selections: i.e., limited to at most one byte. The startup time and internal/external clock selection fuses are the ones that are most commonly changed IIRC.
Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests