I need to read a 3x4 matrix keypad from a GP32  A/D port pin

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

I need to read a 3x4 matrix keypad from a GP32  A/D port pin

9,227件の閲覧回数
ganimides
Contributor I
Hi fellows!.
 
I just need some drawing to read a 3x4 (3 columns x 4 rows) matrix keypad from a AD port GP32 pin.I made some circuit but some keys do not work jus like cero,* and #.
 
Have I got to use two AD port pin to read this kind of keypad?.
 
Please someone who help me.
 
Thank you a lot!!
 
Have a nice day!.
 
 
 
Ganimides  
ラベル(1)
0 件の賞賛
返信
9 返答(返信)

1,925件の閲覧回数
ganimides
Contributor I

Hi guys again!.

 

I was thinking of using of GP32 KBI port pins.

How have I got to connect the matrix keypad to be able to read from?.Are there some appnotes of this?

I `m not familiarized with this method.

Could you recommend me some drwaing of it?

 

 

Thank you guys and have a nice week!.

 

 

 

Ganimides

 

 

 

0 件の賞賛
返信

1,925件の閲覧回数
peg
Senior Contributor IV

Hi Ganimides,

Document M68HC05AG/AD shows you exactly how to implement a 4x4 matrix keypad. As it is for the old 05C8 it is just polled but it will give you the basic concepts.

The divider chain analogue method gets trickier and less reliable the more keys you use. I had a car that used this method for remote control of the radio with buttons on the steering wheel. It was always pot luck what actually happened when you pressed a button.

Regards David

 

0 件の賞賛
返信

1,925件の閲覧回数
bigmac
Specialist III

Hello,

The analog voltage divider method will certainly reduce I/O pin requirements, assuming A/D channels are available.  However, for the 4 x 3 matrix keypad case, I cannot see how to reduce the number of channels below three, one for each column.  An example of this arrangement is shown in the attached file.  Since only five different voltage levels are required (including zero for no key pressed) the reliability should be OK.

With the analog method, there could be ambiguity if more than one key is simultaneously pressed (with the usual digital scanning approach this can be readily detected).  For the analog example shown, detection is straightforward if the multiple keys are in different columns of the keypad.  If the multiple keys are in the same column, the voltage level would actually correspond to the key with the highest voltage level, so results would remain predictable.

Regards,
Mac

 

0 件の賞賛
返信

1,925件の閲覧回数
ganimides
Contributor I

Yes BIgmac,you are right..this must be my error.I`m using just one AD input and this would explain why when I press some keys these don`t measure nothing.

I`m going to revert this situation and I tell you later what happened.

Have a nice weekend!.

 

Ganimides

0 件の賞賛
返信

1,925件の閲覧回数
ganimides
Contributor I
Thank you so much Peg!.
 
You know,I think the matrix keypad method is quite cool if you take minimal precautions with circuitry.
 
It`s quite strange what you mean about you are saying about your radio AD keypad method because it`s a lot of noise inside the car and theorically it wouldn`t be the right method to implement to.
 
I payed attention on you and I went to search the appnote you mentioned on the net and I guess I found it.I`ll take a look around....
 
Have a very nice weekend !!
 
From Argentina I give you a big hug!
 
Ganimides
 
 
0 件の賞賛
返信

1,925件の閲覧回数
ganimides
Contributor I
Hi guys!.
 
Thank you all for your attention.
 
I have my circuit working out properly.The problem I have is that just when I press some keys just like cero,* and #  no value appears on my LCD screen therefore I wanted to know why is it.
 
I have used 1% resistors and I said before my circuit works well but there are some keys that have not measures,therefore I need to know what am I doing wrong so that it can be happening.
 
It`s true there are some drwaings over there explaining how to connect some keys but it does not match to my expectations.
 
 
THank you again.
 
 
Ganimides
 
 
 
 
 
0 件の賞賛
返信

1,925件の閲覧回数
eckhard
Contributor V

Hello,

 

have a look at AN1775 Expanding digital inputs with an AD converter.

Hope this helps.

 

 

Eckhard

0 件の賞賛
返信

1,925件の閲覧回数
glork
Contributor I
Hello Ganimides.
If I understand your post you want to implement a 3 (rows) X 4 (columns) switch matrix.
This is pretty straight-forward but it takes at least 7 port pins rather than 1. Also it is very un-desirable to try to use an A/D pin for this (even for the inputs); just alocate 7 pins of one of the digital I/O ports.
It is up to you whether you implement them as 3 outputs and 4 inputs or 4 outputs and 3 inputs. In any case the generic algorithm is to have the outputs rest hi and take 1 output low, read the inputs to see if 1 of them is lo (they must have pull-ups), then return that output high and take the next output low, read the inputs... and so on just rotating thru the outputs endlessly.

When you detect a low on one of the inputs it means that a switch is closed (pressed). Of course you still have to de-bounce the switch closure (always necessary).

I hope this is helpful. If I knew more about your circuit I could perhaps be more specific.
ron
0 件の賞賛
返信

1,925件の閲覧回数
rocco
Senior Contributor II
Hi, Ganimides:

I assume you are trying to implement a keypad that uses resistors as voltage dividers, so as to decode the key based on an ADC value.

I have seen this done with three to eight keys, but never as many as twelve. I have never seen it done as a matrix either.

But I don't see any reason why it wouldn't work. I suspect that the resistors will have to be 1% tolerance, as 5% resistors will risk keys overlapping. But I'm basing this assumption on a string of twelve keys, and not on a matrix, so I could be full of excrement.

As you can probably tell, I'm just thinking out loud . . .

Can you post a schematic of the matrix? You have made me curious now.
0 件の賞賛
返信