Shop OBEX P1 Docs P2 Docs Learn Events
MM74c922 without BS2 is useless?? — Parallax Forums

MM74c922 without BS2 is useless??

BronsonBronson Posts: 44
edited 2007-01-19 14:49 in BASIC Stamp
Hi guys,

I have built a lot of projects using BS2 and matrix keypad + keypad-encoder (MM74c922).
I don't know if my topic is appropriate in this forum or no, but I am so curious for the solution.

So I built a test project to encode my 4x4 matrix keypad to 4-bit binary value (range: 0000 = 0 upto 1111 = 15).
I use MM74c922 to do the encoding task.
The bottleneck is the order of keypad buttons are not compatible with binary value after encoded.
Here is my keypad buttons order:

1 | 2 | 3 | A
4 | 5 | 6 | B
7 | 8 | 9 | C
* | 0 | # | D

If I press button '1' (coordinate 1,1), MM74c922 will output binary 0000 or decimal 0, not decimal 1
If I press button '2' (coordinate 1,2), MM74c922 will output binary 0001 or decimal 1, not decimal 2
and so on..........
and if button '0' (coordinate 4,2) is pressed, it will produce binary 1101 decimal 13, not decimal 0.

MM74c922 is working according to the datasheet, but it just doesn't compatible with the button's order of my keypad (general model in market today). It only work with:

0 | 1 | 2 | 3
4 | 5 | 6 | 7
8 | 9 | A | B
C | D | E | F

which can't be found in any stores.

Of course I can use BS2 or other microcontroller to 'cheat' the output value, but doesn't it mean that MM74c922 is useless without microcontroller?

Let's say if I want to attach a keypad to 7-segment LED (using HCF4511) to display the numeric value according to pressed button (button '1' displays '1', button '2' displays '2', and so on...), do I have to use microcontroller for such simple task?

Pls help me to cure my curiousity.

Regards,
Bronson Alex

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-01-19 01:39
    They made it to work with a 4x4 keypad, not a/some particular 4x4 keypad.· The keys may not necessarily have the numeric labels at all --·they could be SAVE, ENTER, ON, OFF, CHANNEL, VOL, OPEN, CLOSE, etc.· With an SX, you could practically make your own (<$4 ea.)·with·any output values you want.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-01-19 05:58
    Hello,

    ·· Please see the attached code for an example of how to convert the incoming values from the keypad decoder into the values you want. This example is written for the EDE1144 but the concepts are the same. The LOOKUP command is what you need. I hope this helps. Take care.
    KeyScan2:
      LOOKUP inKey, [noparse][[/noparse]49, 50, 51, 65, 52, 53, 54, 66, 55, 56, 57, 67, 42, 48, 35, 68], outKey
      RETURN
    
    

    Specifically the routine above takes the value returned from the keypad decoder, in this case inKey, and finds the corresponding element number.· This keypad decoder returns a number from 0 through 15, so you have 16 elements.· The element in the list is placed into outKey.· So a keypad such as the one laid out below works with the table above.· You simply substitute the return values you want.

    ' This LOOKUP command translates to the ASCII values for the following
    ' keypad layout.  You can change these to match your keypad, or to return
    ' different values for the same keys.
    '
    ' 1  2  3  A
    ' 4  5  6  B
    ' 7  8  9  C
    ' *  0  #  D
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support


    Post Edited (Chris Savage (Parallax)) : 1/19/2007 6:04:29 AM GMT
  • BronsonBronson Posts: 44
    edited 2007-01-19 07:48
    Hi,

    Thx for the input, guys. So are you saying that if I want to attach a keypad to 7-segment LED to display the numeric value according to pressed button, I have to use microcontroller (BS2 or SX or others)?
  • GadgetmanGadgetman Posts: 2,436
    edited 2007-01-19 09:19
    No...

    You could do it by using a small EPROM.
    Just burn the correct codes into the lowest 16 locations, and hook the outputs of the MM74c922 to the lowest address inputs on the EPROM.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't visit my new website...
  • Desy2820Desy2820 Posts: 138
    edited 2007-01-19 14:49
    It's been a really long time since I've messed with digital logic, but I think you can use an "adder" to simply add a binary one to your keypad's output, before the display.· This chip is obsolete, but is an example of what I'm thinking of.· With some searching, you should be able to find something equavalent.· You'll probably need to breadboard and expirement a little, it's been too long for to remember how to use the chip.

    http://focus.ti.com/lit/ds/symlink/sn74283.pdf

    The only two pitfalls I can see is the last key on you keypad, you'd like it to be 15, but using this method it would be 16 in binary.· You'll need to decide how to handle this one.· IE, you press "D" on your keypad, expecting "15"(binary %1111), but because everything is off by one, it's binary %10000, notice that this is 5 binary digits.· You just crossed from a nibble to a byte.· I'm not sure what the adder chip's output would be in this case, I think it would be all zeros, with the carry output set.· If you only use the zero thru 9 keys, this shouldn't be a problem anyway.

    The other problem is the zero key.· I'm don't know how to fix that.··

    Stupid question, but can you simply re-label your keypad to correspond with the keypad encoder's output?

    I hope this helps!





    Post Edited (Desy2820) : 1/19/2007 3:05:27 PM GMT
Sign In or Register to comment.