Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Attiny electronic score keeper. WAS: What is a good step up from the attiny2313?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Attiny electronic score keeper. WAS: What is a good step up from the attiny2313?

by mkanoap on Tue Sep 16, 2008 6:05 pm

I have a project that I'm contemplating that was originally going to use an attiny2313, but I'm starting to realize I won't have enough I/O pins. What would everyone recommend as the "next step up" in the AVR family?

Specifically, I'm working on a score keeper for board/card games. I envision a display with two digits for each player (up to four), a button to increment the score, a button to de-increment the score and a button to pass play to the next player.

I was going to drive Four dual seven segment Displays (i.e. 8 LED arrays) with 3 input buttons. My plan was:

PORTA0,1,2 would have been buttons
PORTB0-7 would have been the seven segments (and the decimal point)
PORTD0-6 would control which LED array is lit up by sinking the cathode for that array.

Right away I realized that I could only drive 7 of the 8 displays and decided that the 4th player would just have have 1 digit, because I already have some attiny2313s and wanted to use them. But now I realize that in order to use PA2 I will have to give up the ability to reprogram the chip, so I can't have my three buttons.

So, now I'm in the market for a chip in that family that would have the I/O I need (16 outputs and 3 inputs). Anyone have any favorites?
Last edited by mkanoap on Thu Sep 29, 2011 3:32 pm, edited 1 time in total.

mkanoap
 
Posts: 19
Joined: Tue Sep 16, 2008 4:01 pm
Location: Cincinnati

by The_Don125 on Tue Sep 16, 2008 6:50 pm

The_Don125
 
Posts: 373
Joined: Tue Mar 06, 2007 11:51 pm
Location: Illinois

by macegr on Tue Sep 16, 2008 7:03 pm

Or check out a chip like the SAA1064T which can drive 4 7+1 displays from an I2C bus, and has address pins so you could put four of them on a single bus for up to 16 digits. Now you can use a chip even smaller than the 2313, like the tiny24 or something.
macegr
 
Posts: 292
Joined: Fri Apr 04, 2008 4:46 pm

by mtbf0 on Tue Sep 16, 2008 9:11 pm

why use the decimal point?

what game were you intending to play that's scored in real numbers sith only two digits precision? gymnastics?

if the decimal point is to indicate whose turn it is, why not just blink that player's score.

or just use a shift register. they're cheap and pretty easy to find and could be used either for the led segments or to select the display. a shift register will require three or four pins: clock, data, clear and maybe latch. you don't really need clear if you shift out eight bits every time.

it would also free up more pins for buttons. if you had six pins free for buttons you could multiplex them in a 3x3 array for a total of nine, so you could give your players each a button.
"i want to lead a dissipate existence, play scratchy records and enjoy my decline" - iggy pop, i need more
User avatar
mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am
Location: oakland ca

by The_Don125 on Tue Sep 16, 2008 9:20 pm

mtbf0 wrote:why use the decimal point?

Even with the decimal point omitted, thats still 18 I/O pins required. If he has only an ISP programmer, mkanoap will have to disable the reset fuse, so there would only be one chance of getting the code right.

or just use a shift register. they're cheap and pretty easy to find and could be used either for the led segments or to select the display.

At Digikey:
ATTiny2313 - $2.26
ATMega48 - $2.56
The_Don125
 
Posts: 373
Joined: Tue Mar 06, 2007 11:51 pm
Location: Illinois

by mkanoap on Tue Sep 16, 2008 11:20 pm

Thanks everyone, these are all interesting suggestions!

macegr wrote:Or check out a chip like the SAA1064T which can drive 4 7+1 displays from an I2C bus, and has address pins so you could put four of them on a single bus for up to 16 digits.

I kind of want to keep this to a single IC, as one of the goals of this project is to gain experience with programming the microcontroller, and I already have all the the other parts plus a schematic that I figure will require minimal changes to drop in a bigger chip. But I can imagine later wanting to make a larger version, at which time I would have to look into something like this since my current design would not scale well. Very intriguing!

mtbf0 wrote:why use the decimal point?

Mostly because it was there, so I wouldn't have to add any other indicator. I was going to light up both of them so it would be clear that it wasn't actually a decimal point.

mtbf0 wrote:what game were you intending to play that's scored in real numbers sith only two digits precision? gymnastics?

Any number of cheapass games will use piles of stones or other counters to keep score, as do games like "Magic:The gathering". But I was specifically inspired by the instructions for Munchkins which says "You will need 10 tokens (coins, poker chips, whatever - or any gadget that counts to 10 for each player." Of course, for that game I only need one digit to count to 10, but I though being able to go to 100 would make it more useful for other games.

mtbf0 wrote:if the decimal point is to indicate whose turn it is, why not just blink that player's score.

I considered that, but thought that might be distracting. But now that you have reminded me of the possibility, I now think I might blink the "decimal points" instead of just lighting them.

mtbf0 wrote:...
it would also free up more pins for buttons. if you had six pins free for buttons you could multiplex them in a 3x3 array for a total of nine, so you could give your players each a button.

Another intriguing ideal I think I will save for a possible scaled up version. I have these groovey buttons I salvaged from the front panel display of an old mini-computer that I want to use, and I only have the three. But I'll definately want to do that for a larger model.

The_Don125 wrote:I'd say check out the Mega48

That looks pretty much like what I had in mind, thanks!

mkanoap
 
Posts: 19
Joined: Tue Sep 16, 2008 4:01 pm
Location: Cincinnati

Re: What is a good step up from the attiny2313?

by mkanoap on Mon Aug 17, 2009 6:39 pm

Wow, it's been almost a year since I first posed this question, and it occurs to me that I never came back to update on the outcome of the project (which finally was finished a few months ago).

In the end, I ended up using a attiny 2313 and a Max7219 to handle all the digits. This worked out very well, allowing me to completely ignore having to worry about whether I could drive all 64 LEDs. I used the batchPCB service from sparkfun to print the main board and the four daughterboards that hold the displays. This also worked out well, but took 5 weeks.

But as soon as I finished I kind of wished I had gone with a larger chip I had originally asked about. I kept thinking of new features and found I didn't have enough program space for them. Also, the max7219 is a bit pricey. So if I ever make a second version, I might attempt again to do it all using one of the mega chips.

Thanks again for the advice, a video of the finished project is at http://mkanoap.livejournal.com/60475.html

mkanoap
 
Posts: 19
Joined: Tue Sep 16, 2008 4:01 pm
Location: Cincinnati

Attiny electronic score keeper. Was: Re: What is a good step up from the attiny2313?

by mkanoap on Thu Sep 29, 2011 3:27 pm

Two years later, I have finally gotten around to documenting how it was made and entered it in the epilog laser challenge at instructables.com.

http://www.instructables.com/id/Build-a ... orage-box/

I was inspired to do this project and start playing around with micro-controllers after putting together the minipov kit. I was excited by the possibilities after seeing how much this platform could be transformed by the the brain machine hack.

This forum helped me greatly as I fumbled around trying to figure this stuff out, so I thought I should finish up by resurrecting this three year old thread with an update. :)

mkanoap
 
Posts: 19
Joined: Tue Sep 16, 2008 4:01 pm
Location: Cincinnati

Re: What is a good step up from the attiny2313?

by brucef on Thu Sep 29, 2011 7:00 pm

mkanoap wrote:But as soon as I finished I kind of wished I had gone with a larger chip I had originally asked about. I kept thinking of new features and found I didn't have enough program space for them.

Are you aware that there is now a pin-compatible 4K flash ATtiny4313 chip out there? It might give your existing board a bit of breathing room for new ideas.
- Bruce

brucef
 
Posts: 215
Joined: Tue May 03, 2011 4:51 pm

Re: Attiny electronic score keeper. WAS: What is a good step up from the attiny2313?

by mkanoap on Thu Sep 29, 2011 7:46 pm

I was not, thanks!

mkanoap
 
Posts: 19
Joined: Tue Sep 16, 2008 4:01 pm
Location: Cincinnati

Please be positive and constructive with your questions and comments.