PDA

View Full Version : How to hook up a 4x4 keypad to BS2sx



tripjack
11-21-2006, 06:49 AM
Hi,

I have a 4x4 keypad which I would like to interface to the BS2sx

The keypad has 8 terminals for soldering wires.

I have seen a "pullup" circuit diagram that looks like this:

·
See attachment



My question is: how do the actual resistors & wires get connected ?
I know where my input pins are on the BS2SX activity board - but where do the resistors go.
WHere does +5V attach? WHere does ground attach?

The keypad does not have a "ground" - only 8 signal terminals, which should be connected to resistors, right?

David

tripjack
11-21-2006, 07:32 AM
Sorry that picture was too small, here is a bigger one...

tripjack
11-21-2006, 07:38 AM
Here is the "pullup" circuit diagram ...

Guido
11-21-2006, 07:57 AM
Tripjack.

I think this is what you are asking.

5 volt goes to·the individual·end of the 47K like shown

All commons on Push Buttons are connected together and brought to -5VDC

Guido
11-21-2006, 07:59 AM
oops

The JUnctiob of the 1K and 47K goes to the Push Button and then the !K goes to the individual Satmo Input pins 5-12 respectiviey

Tracy Allen
11-21-2006, 08:25 AM
You probably have a 4x4 matrix keypad, with 4 connections to the rows and 4 to the columns. You need to connect all 8 of them to stamp pins through 1kohm resistors. You may have to do some experimenting to determine which keypad connections are rows and which are columns. Connect the 49kohm resistors from the row inputs to +5 volts. I'll try the ascii art, but if it doesn't come out, there is a better picture at www.emesys.com/BS2fsm.htm#keypad (http://www.emesys.com/BS2fsm.htm#keypad). There are lots of examples of matrix keypad circuits and coding around, even some schemes that require fewer pins on the Stamp.



O = open keyswitch
X = closed keyswitch

49kohm x4 for pulliup
O----O----O----O-------------------;---/\/\--o--- +5v
| | | | | |
O----X----O----O--------------;--------/\/\--|
| | | | | | |
O----O----O----O---------;-------------/\/\--|
| | | | | | | |
O----O----O----O----;------------------/\/\--|
| | | | | | | |
\ \ \ \ \ \ \ \
/ / / / / / / /
\ \ \ \ \ \ \ \
| | | | | | | |
P8 P9 P10 P11 P12 P13 P14 P15
1k resistors x 8 for protection




In this picture, p12 to p15 on the stamp will be configured as inputs and will read high when no pushbutton is pressed. To code for this, your program scans by bringing one column low at a time. In the picture, the closed switch (X) will show up as a low on row p14 when column p9 is low.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com (http://www.emesystems.com)

Post Edited (Tracy Allen) : 11/21/2006 12:33:49 AM GMT

tripjack
11-21-2006, 11:51 AM
Tracy,

Thanks so much this is exactly what I was after. Now I won't have to worry so much about blowing up my chips!http://forums.parallax.com/images/smilies/jumpin.gif

David