Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Matrix Keypad merch with IC MM74C922 problem

Status
Not open for further replies.

Chingbor

New Member
Hi All:
..According to above Tittle, I am building an 4X4 keypad with use of IC MM74C922 base on Motorola 68HC11 microcontroller. from the cct diagram below, Post01.JPG,
and after i have read throught about the truth table, and i wish to merch it with my keypad but i found that my matrix keypad which i brought it about 6 bugs as bottom
27944.jpg
and i hv discoverd that the key array of the keypad i purchas that different design with the datasheet:

X1,Y1 =1 X1,Y2 = 4 X1, Y3 =7 X1,Y4 =*
X2, Y1 =2 X2,Y2 = 5 X2,Y3 =8 X2,Y4 = 0
X3,Y1 =3 X3,Y2 = 6 X3,Y3 = 9 X3,Y4 = #
X4, Y1= A X4,Y2 = B X4,Y3 = C X4,Y4 = D

So, as above problem, should I defind the output bit for the each switch first by program after scan it ??
Or I should do in other way?? Please everyone any Idea ???
 
Can you do this without the decoder?
For example, Xs are connected to the output port of 68HC11, and Ys are connected to the input port of it. First, send a high to X1, and check which Y is high, followed by X2 and so on.
 
Thanks bananasiong your speedy reply...After discuss with you just now, I have understand your concept about to sent bit out and detect any switch hass been press.. and I have went thru the data sheet of this IC which i have asked you early lah, I have found that the above problem occur, just i need to save memory space, so I use encoder to makes the work easier....so can I do as I post above??? and any suggestion???
 
You can do it according to the schematic according to the datasheet right? The picture in your post is only the block diagram of it. You can get some example connection under 'Typical application' in the datasheet.
 
okok I got it..thanks....i m now think about the program...I will.post any problem if i discover it..Thanks Bananasiong
 
hi chingbor,

You have got the X's in the wrong order and the Y's in the wrong order.

If you are looking at the connector of the back of the pad they don't run in sequence.

If you cant work it out let me know.
 
hi chingbor,
I have just compared your pads layout, with 3 other pads of a similar style, your pad is printed as a telephone style layout, which I cannot match with the X/Y matrix.

I would suggest the program reads the 74C922 output and uses the code as an offset to Table address in the program that has the 'character' to suit the pads key printing. [RETLW]
 
ericgibbs said:
hi chingbor,
I have just compared your pads layout, with 3 other pads of a similar style, your pad is printed as a telephone style layout, which I cannot match with the X/Y matrix.

I would suggest the program reads the 74C922 output and uses the code as an offset to Table address in the program that has the 'character' to suit the pads key printing. [RETLW]
Does 68HC11 has this kind of instruction? I haven't learned before for the looked up table for 68HC11, but I'm sure 68k does this. The looked up table for PIC is simpler.
 
hi,
I am not fully conversant with the 68HC11 instruction set, but a quick glance thru shows it has 'Index' registers
that you could consider for table addressing.

If you are just making a one off project and you have a 74C922 available, its a good choice.
The contact bounce problem and pad scan rate are easily fixed with a couple of capacitors.

You can use the 'data avail' signal as an interrupt and the 74C922 can also be set into the tristate mode,
freeing up pins for other jobs.
IMHO the keypad you have chosen has low quality type switches.

By adding diodes/resistors you can extend it to scan a 4*5 keypad.

If you plan to make a number of these keypad systems the software scan of the keypad is more cost effective.

Regards
 
Last edited:
ericgibbs said:
hi chingbor,
I have just compared your pads layout, with 3 other pads of a similar style, your pad is printed as a telephone style layout, which I cannot match with the X/Y matrix.

I would suggest the program reads the 74C922 output and uses the code as an offset to Table address in the program that has the 'character' to suit the pads key printing. [RETLW]


HI ericgibbs;

Thanks for your reply..ok...may i ask that, is it possible if i create 1 library in my ROM with address $B600?? which is
eg. Y1,X1 =1 in my key pad,
so i store this equilvalent in my library... and then if the MCU detect this X1,Y1, according to the the truth table is [A=0, B=0, C=0, D=0].
But i will Identify [A=, B=0, C=0, D=0] is 1??
and how is the concept ???? Please
 
hi,
>> so i store this equilvalent in my library... and then if the MCU detect this X1,Y1, according to the the truth table is [A=0, B=0, C=0, D=0].
But i will Identify [A=, B=0, C=0, D=0] is 1??
and how is the concept ???? Please


The 'data avail' signal indicates a key is pressed, if you get a DA signal and read all 0's, then its the '0' key.
Normally if the pad had a matrix that gave a '0' code when the key named '0' was pressed,
I would 'OR' the key value with 0x30 giving an Ascii '0'. and so on for keys 1 thru '9'.

But, as your key top names dont seem to relate to the keycodes, you will have to use the keycode
as an index offset address to table which stores the codes you want to create.

Hope this is clear.
 
Most keypads are set up with upper left key as KEY #1 which is actually "0". You will get a HIGH on the DA output as long as ANY key is pressed, BUT if the upper left KEY is pushed you will not get any DATA out because it is ZERO. Send the 4 DATA lines to a bank of 74HC175's and send the DA output through a 0.1uF to the CLOCK input of the HC175 with a 100K to from the same CLOCK pin to GND (to create a pulse from the DA signal). Test with, say, #2, which is acually the 3rd KEY over on the TOP ROW.
If you want special characters you'll have to decode them specifically after going through the '175 Latches. Don't forget to add a rest to however many latches you have.
I also used the DA signal through the same C/R combo through a CD4093 Quad NAND Schmitt Trigger IC to a 4017 Sequencer which sequentially Clocks the 74HC175's, It is VERY IMPORTANT TO HAVE CLEAN, FAST RISE TIMES on the 4017 CLK Input which the Schmitt Trigger does nicely (My Best Friend).

That ZERO being KEY #1 Bit me in the A---, color code your wiring using peeled-apart 'rainbow' ribbon cable (cheap).

Mike
==========================================
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top