I need 100 buttons
PLJack
Posts: 398
Yep, not a typo, I need about 90 buttons.
Actually in the IC world I would say we are talking about 92 buttons.
From what I have researched so far I think I should go with four IC2 chips.
Anyone agree? Is there a less expensive approach.
Goals:
Keep the project down to one SX28.
Cost per part will influence design.
Save at least half the IO pins (after buttons) for the rest of the project.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jack
Actually in the IC world I would say we are talking about 92 buttons.
From what I have researched so far I think I should go with four IC2 chips.
Anyone agree? Is there a less expensive approach.
Goals:
Keep the project down to one SX28.
Cost per part will influence design.
Save at least half the IO pins (after buttons) for the rest of the project.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jack
Comments
in my book, I have described an application for scanning 64 buttons. By adding another multiplexer, it is possible to scan 128 buttons. The only problem is that 12 I/O pins are required in this case, i.e. more than half of the 20 pins. I have attached the schematic for the 64-button matrix.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Byte walks into a bar and orders a pint. Bartender asks him "What's wrong?"
Byte says "Parity error." Bartender nods and says "Yeah, I thought you looked a bit off."
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
I agree with Jon - shift registers are a good alternative when I/O pin count matters. I don't think it is necessary to use I²C components here as you would have the additional overhead in the software to handle start/stop conditions, sending the device addresses, checking for acknowledges, etc. Many years ago (i.e. at pre-SX times), I designed a keyboard using shift registers with a good old Z80, and it worked fine.
You might also consider to change the size of the button matrix. In the schematic I had posted, there are eight rows, each connected to an SX input pin, i.e. to scan 128 buttons, you need 8 input rows, and 16 output columns connected to two 74?138 multiplexers, and 4 output pins for the column address, i.e. a total of 12 pins.
When you only use 4 rows in the matrix, you would need 24 columns for 96 buttons, i.e. three 74?138 multiplexers, and 5 output lines for the column address, IOW 9 I/O pins would be required for the buttons, leaving you with 11 SX 28 pins for other purposes. Other matrix designs would also be possible, like 5 * 20 for 100 buttons (three 74?138 multiplexers, 5 row inputs, and 5 outputs for the column address).
BTW: You may have noticed the diodes in series with each button. According to Murphy's Law: "If there are two or more buttons on a device - users WILL press at least two buttons at the same time", the diodes are there to avoid shorts when the users press two or more buttons located in the same row.
When you use shift registers to scan the buttons, such diodes are not needed because each button is connected to a separate input. You might still need to handle the n-button roll-over problem by software, and de-bouncing as well.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
Günther
I posted that question to try and save me some time and grief.
Mission accomplished. Thank you all.
Just for your information, speed is not an issue. It's not a data entry device, just one or two buttons every now and again.
As for pin count the real solution is to reduce the number of buttons. I'll have to stew on that one.
After reading all your suggestions shift registers seem like the proper solution.
Especially since I can drop the diodes. that is a big plus and should offset the cost of the shift registers.
Shift registers here I come.
Thanks again.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jack
Post Edited (PLJack) : 5/31/2005 11:17:40 PM GMT