Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

how to connect 32 push buttons to atemga328p?

mot1639

Member level 1
Joined
Jul 10, 2011
Messages
32
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,513
Dear all ,

hope you are doing fine ,
I have keyboard with ribbon cable , which it has 32 pins to atemga328p and read multi input in same time , i read about CD74HC4067 mux/demux , but the issue with this chip i only read one single input at time , i mean if the pin1 and pin13 rise up , i can read one of them not both .. what the best solution to connect the keyboard ribbon cable with my atemga using extrernal chip .
the link show some connect this ribbon cable with Tennsy wich have enough pins to detect the change on the pins ...
thank you in advance and any suggestion will be appreciated

regards
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
18,933
Helped
4,212
Reputation
8,427
Reaction score
4,159
Trophy points
113
Activity points
124,467
Hi,

You say 32 push buttons and a ribbon cable with 32 pins.
How are they connected?
For 32 individually routed push buttons you need 32+1=33 pins...

There are keyboard controller ICs ... with several interfaces.
There are I2C and SPI bus extender ICs.

Klaus
 
Last edited:

danadakk

Advanced Member level 3
Joined
Mar 26, 2018
Messages
743
Helped
143
Reputation
285
Reaction score
147
Trophy points
43
Activity points
3,565
You can connect in a matrix, say 6 x 6, 5 x 7.....

Or using less pins use A/D and a V divider approach -

1611497050523.png

You can do more than 4 per pin, just do error analysis. Shown is just an
example. Note if you use A/D in ratiometric mode that eliminates some errors.

Note DelSig A/D shown is just for example, that could be the Atmega ADC.


Regards, Dana.
 
Last edited:

BradtheRad

Super Moderator
Staff member
Joined
Apr 1, 2011
Messages
13,889
Helped
2,755
Reputation
5,508
Reaction score
2,664
Trophy points
1,393
Location
Minneapolis, Minnesota, USA
Activity points
103,629
if the pin1 and pin13 rise up
I imagine somewhere in the path is something which converts the keypress to an ASCII value? An IC? Circuit? Calculation? Then you have an ASCII value (7 or 8 bits).
After that it's carried on one data wire as a series of bits.

Suppose you multiply incoming pins each by a different power of 2, then sum them? Binary weighted resistors? Etc.

Do keypresses convey through a grid like below? Maybe 8x8 (making a total of 256 ASCII values)?
Scan rows & columns rapidly (50 times per second).
When you detect a keypress, calculate the ASCII value.
Then send it as a series of bits to your device's input pin.

4x4-Matrix-Keypad.png
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
18,933
Helped
4,212
Reputation
8,427
Reaction score
4,159
Trophy points
113
Activity points
124,467
Hi,

If you want to detect multiple keys pressed at the same time (this is how I understand your post)
then neither Dana's circuit nor Brad's circuit work (without modifications).

Modifications on Dana's circuit: it needs individual resistors in series to each switch...
Modificatiins on Brad's circuit: it needs diodes in series with each switch.

Klaus
 

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top