connecting 2 keypads on rsp

Hi to all. Because of the amount of the system users ( cca 500 of them ) i need to setup some 4x5 or 4x6 keypad. To do so am planning to use some standard

4x4 + one 2x4 keypad over i2c. Should this be problem to construct in the way that the second keypad is recognized as extension of the first one ? So 1-16 --- 17-24

GM

Reply to
gm
Loading thread data ...

That would depend on the characteristics of your keypad encoder/switch (matrix) interface.

Do the 4x4 and 2x4 keypads already have I2C interfaces? Or, are you just playing with 4x4 and 2x4 switch matrices and pondering how to interface them (in concert) to an I2C encoder?

Reply to
Don Y

Or, are you just playing with 4x4 and 2x4 switch matrices and pondering how to interface them (in concert) to an I2C encoder?

*** Yep. I could also dismantle one 4x4 keypad and pull out 2 rows :-). I can connect those rows to existing 4x4 keypad. Maybe this would be the simplest solution. Then i can go directly with 4x6 on i2c ?

GM

Reply to
gm

You can fabricate the key matrix in many different ways.

But, what are you expecting to use to get those switch closures (i.e., "scan the key matrix") onto the I2C bus? Have you selected a "keypad matrix interface chip" for that purpose?

Traditionally, you would drive the (4) rows of such an array with some O.C. buffers and *read* the (6) columns at the same time. A bit of software lets you determine which key is pressed (if any) as well as multiple concurrent key closures. A delay lets the software debounce such closures and pass a "key code" to the rest of the software.

[I have no idea if this can be automated with a COTS I2C device as it's always been a relatively "free" hardware interface. Ages ago, you could purchase "keyBOARD decoder chips" that handled large key matrices -- 80-100 -- and did the debouncing and N-key rollover, prsenting a "key code" on a set of parallel outputs]
Reply to
Don Y

A keypad is just a bunch of switches. The encoder is what the computer interfaces to. You can use as many encoders as you want, so two encoders is no problem. How those key presses are treated is entirely up to the software.

So you can use a 4x4 pad with one encoder and a 4x2 pad with an encoder, both on the same I2C port. Or you can connect both keypads to one encoder if it has the capacity. Or... you can do your own key pad scanning by the rPi if you use the programmed I/O pins. 4x6 uses 10 pins. Two of them scanned together would use 14 I/Os. You can control

8 outputs on 3 I/Os with a single TTL chip so that you only need 9 I/Os total.
--

Rick C
Reply to
rickman

Thank you all for reply.

*** That's the answer that i need. Thnx !

Im planning to save the rsp pins and thats the main "issue", because i can not connect them directly to RSP.

Reply to
gm

How about USB? Your RSP can deal with USB directly, or even with hub. You can have 2 or more USB keyboards on one RSP.

We used to build USB keyboards with AVRs (ATmegaUSB...).

Now, we are looking into emulating USB printers. Basically, we want to receive something from the PC, but print out something else on the printer.

Reply to
edward.ming.lee

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.