Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

how to connect 32 push buttons to atemga328p?

Status
Not open for further replies.

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
 

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:

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:

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
 

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
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top