i know it is trivial to derive (3x4 key matrix), but i do not have resistors around right now.
anyone experience with such a network?

it has become obsolete: i am going to use a PIC with more pins, and will switch components using tri-state transceivers.

PIC have analog inputs, so i could save the transceiver? probably a resistor network will take more space...
Posted on 2005-03-28 04:52:55 by akidd86
  PIC's usually have internal pull-ups which can be programed off or on. I made one with the PIC16F84. I ran column connections to all keys from port A and programmed them high output. Than connected all row side of keys to port B and programmed for input. If you want 8 inputs than you must poll port B. So when a key is closed you will detect a high on one of port B inputs so at that time you will strobe each individual column output to a high state with other port A outputs set low until you identify key.
Posted on 2005-04-19 01:11:23 by mrgone
my question is about connecting a keypad to one of the A/D inputs.
Posted on 2005-08-20 05:02:23 by akidd86
Anything is possible here, but weather its the right way to go is another matter.

In short your looking to generate different voltages depending on which key is pressed.  Your looking for a 3x4 matrix, so you need 12 unique signal voltages with a 13th being no key pressed (0 v).

What your really asking for is a variable resistance device that will generate a unique an incrementalized resistance for each key.  A well chosen resistor in series with the overal matrix will form a voltage divider where the resultant is sensed by your A/D input (Since AD inputs are high resistance, they wont affect the cct resitances):


5V ---> Key  <---,
                |
A/D <-- ----------+
                |
              Rcom
                |
              %%%%%%%
                %%%  GND
                %


Your job is then to design a set of resistances to be added to the circuit for each key that will create a voltage divider effect on the A/D input.  All keys will be in parallel, so the down side is that two keys can result in a resistance that generates an unwanted voltage divided value tell the circuit its a different keyboard character.

That said, I would start by choosing Rcom, say 10k ohms, and then design circuit keys resistances by the following equation:

V(AD) = 5 * Rcom / ( Rkey + RCom )

You want 12 voltages, so Vstep = 5v / 12 = 0.416V

Your first key is then 1 x 0.416V or V(AD) = 0.416V

Rearranging for Rkey:

V(AD) ( RKey + RCom) = 5 * Rcom

V(AD).RKey = 5*RCom - V(AD).RCom = RCom * (5-V(AD))

RKey = (RCom * ( 5 - V(AD) )) / V(AD)

Now using it:

RKey = (10,000 * (5 - 0.416) ) / ( 0.416 ) =~ 110k Ohms (too Big ~ High resistances introduces EMI Noise in the CCT)


So change RCom to say 1K ohm and try again:

RKey = (1,000 * (5-0.416)) / (0.416) =~ 11k Ohms  (Ok!)


Now test the high end keys, key 12 is a short circuit, lets look at key 11:

RKey = (1,000 * (5 - 11*0.416) ) / ( 11 * 0.416 ) = 92 Ohms  (Not bad, it can work with a 100 Ohms)


You get the idea, I hope...  If you find the restances to low you can also divide the 0-5V range into say 24 steps and only use the steps between say 6 -> 18 which will ensure your resistances say withing a numberical range of more practical numbers (not too high and not too low).  The down side is you will probably have to use variable resistors or funny parrallel arangements as your also narrowing the tollerance between resistances, so you're resistor values will need to be more precise.

Enjoy,
:NaN:
Posted on 2005-08-20 12:35:21 by NaN
BTW, I would design using Excel so you can quickly change Rcom and number of steps needed to determin more practical results. 

As well, I can't promise you how the A/D will respond from button 'bouncing' as contacts are made and broken from key presses.  Like i said, i dont think this is the best way to go, but its technically possible...

Regards,
:NaN:
Posted on 2005-08-20 12:40:19 by NaN
again, thanks for the reply.

the trick is to make a 3x4 resistor network, this means 4 rows/3 columns, 7 resistors.

the microchip documentation explains, but without giving numbers.

just asking if someone has previously built up such a network.

the SG-3000 (z80 based computer) utilizes an 8bit binary port, and powers the columns by a 3/8 decoder,
subsequentially. for 12 keys, this requires 3bits and a 2/4 decoder.

however, the A/D ports are there.
Posted on 2005-08-22 08:08:36 by akidd86
Hello,akidd86

a resistor network may be used as a different grade voltage shoulder or a different grade electrical current limitor. about output, we get a different grade voltage or a different grade electrical current via every varying node combination. so we must cal the equivalent resistor of two nodes in the resistor network.

regards
Posted on 2005-08-22 10:19:52 by dcskm4200
Keep in mind you still have to find a voltage divider point in the matrix so you can sense the unique key combinations.  The sensing point must 'float' amist resistances or you'll only be sensing 5V or 0V.  I really can't see in my minds eye how you can achieve somthing like this, in a matrix, with only 7 resistors....

Regards,
:NaN:
Posted on 2005-08-23 17:38:26 by NaN
Hi,
I have done a project which has 8 key input through one ADC channel to Cygnal C8051FXXX.So as a reference I give the advantage and disadvantage of the ADC KEY /Normal Key Matrix:
Advantage:
1)hardware
ADC Key saves the IO cost ,normally only need a ADC IO , Normal Key Matrix usually cost much IO,a 16 Key Matrix will cost at least 8 general port if do not use outer LOGIC BUFFER CHIP(74xx273,74HC574,etc)
so ADC KEY COST Less than Normal Key Matrix if your chip has built in ADC port.
   
      Another consideration is: Its better for ADC Key Convertion input voltage to be equally reduced. for example: 0v,0.2v,0.4v,0.6v,0.8v,1.0v,...,2.2v(12kinds) is my project's ADC input ;so design such a resistor divider and choose  actual popular resistors on market is not an easy work.
2) Firmware
on the other hand,Write ADC KEY routine will cost much more time and instructions(programming)than Normal Key Matrix,You need to deals with AD conversation with Interrupt Service Routine with much more complicated instructions and more trivals. On my project I cost nearly one month to debug the ADC key and nearly 1K code of Key Routine.While Normal Key routine almost could be done in one hour with less than one hundred lines of codes.
3)Performce
response time--ADC Key limited by the ADC convertion time,while the normal Key almost realtime.
stablility --for the reason to check Key Debounce, Every Key Input you check it twice for the same value region, ADC Key may be not work while the on the ISR ,U could miss or even get a wrong Key Input sometime.

So, The ADC Key Input solution should be used only the condition that you need reduce the pcb Board space or save the hardware cost($ :-_-).
    If your design production less than 100 ,use the Normal Key;
    If your design will have more 1K copies(Such custom electronic products.) use the ADC Key.

          My personal option, referenced .

-- Luckrock
Dec,29th,2005
Posted on 2005-10-28 20:38:23 by Luckrock
well i have considered the following:

3x4 keyboard, 8bit port (PORTB) available.

the 4 rows are connected to a bus buffer register.
the 3 columns are routed back to the same port through a bus tranceiver.

this makes 2 additional TTL chips. it does not matter, because the design already includes
a few other TTL chips.
Posted on 2005-11-02 07:54:36 by akidd86
BTW: what's the final result ? Do you realize it?
Posted on 2005-12-16 04:58:24 by Luckrock
?  ? Yeah I like key board matrix the best. I got some designs using PICs if your interrested. As far as building a simple Ato D converter with resistor network, I got some designs like that too. What you do is take a device like a counter, we will use a 74hc191 or is it a '190. A hex four bit counter. On the outputs you will use different values of resistors. For example QA=1k Qb=2.2K Qc=4.7K Qd=10K. These should be close but you will have to work out the voltages for even steps. You may have to strap some parallel resistor to one or two of them for even steps. Now tie all four resistors together at the other end away from counter. Now if you clock the counter you will notice different voltages coming out of the tied end of the resistor network. Don't forget to put a load on them. This is an D to A converter.
?  ? Now for the A to D portion. What you need to do is continuously clock the counter so that the output of the R network sweeps up & down in voltage. To determine the voltage you need to make a voltage level detector which is easily done with a 741 OP AMP. When the output of your resistor network reaches the voltage you are looking for than you read the count of the counter Q outputs. That's your digital equivilent of that particular analog voltage level.
Posted on 2006-07-16 10:35:28 by mrgone
akidd86,

好bsp; 好bsp; 好bsp;For what you are doing, I suggest look at some resistor network chips as shown in this link http://jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&catalogId=10001&productId=268040 .好bsp; I am not saying that you should purchase from this dealer or use those networks offered.好bsp; But you should research what is available.好bsp; I believe it will be more efficient to use networks instead of discretes.好bsp; Ratch
Posted on 2006-07-16 11:04:55 by Ratch