Method and apparatus for capacitive keyboard scanning
TECHNICAL FIELD 
     The invention relates to the scanning of keys of a capacitive keypad for detecting and verifying their switching states. 
     BACKGROUND OF THE INVENTION 
     Keyboards are essential in user interface equipment of various types, including calculators, typewriters, computer terminals, and the like. An electronic keyboard in its most elemental form is simply an array of switches which may be operated by the user to convert physical motion to electrical signals. The switches may take various forms. Make-or-break mechanical contact switches become degraded by mechanical wear and contamination and, additionally, have a tendency toward &#34;contact bounce.&#34; Attempts to avoid these problems have led to the development of capacitive switches. These involve a capacitance having one plate which is movable by depression of the key. The resulting change in the capacitance value is sensed to verify the key depression. A common way of sensing the capacitance value is to charge the capacitor by a current source to a reference voltage. The required time for the charging can be used to determine whether the capacitance value is high or low by comparing it to some reference value. For example, the reference value may be a reference capacitor charged by a similar current. The number of individual leads to the keys of a capacitive keyboard can be reduced by the use of key scanning techniques. These involve locating key closures by sensing the capacitance values of entire rows and columns of keys to identify closed keys at their common intersections. Examples of some capacitive keyboards and scanning techniques for them are described in the following: 
     U.S. Pat. No. 4,211,915, issued July 8, 1980 to D. E. Miller et al. 
     U.S. Pat. No. 4,305,135, issued Dec. 8, 1981 to J. P. Dahl et al. 
     U.S. Pat. No. 4,405,917, issued Sept. 20, 1983 to T. Y. Chai 
     U.S. Pat. No. 4,414,538, issued Nov. 8, 1983 to Schnizlein 
     &#34;Matrix Scanning Logic for a Capacitive Switching Keyboard,&#34; by John W. Volpe, in Computer Design (USA) vol. 12, No. 1 84-88, Jan. 1973 
     &#34;Capacitive Keyboard FET Sense Circuit,&#34; by E. G. Crabtree et al., in IBM Technical Disclosure Bulletin, Vol. 24, No. 5, Oct. 1981 
     One type of capacitive keyboard which is of particular interest commercially is the film, or membrane keypad, which is a laminated structure of two membranes. Each carries a printed circuit pattern separated by an insulating membrane containing a perforation associated with each key area. The circuit patterns of the membranes include mutually opposed capacitance plates registered with the perforations. The pressing of one of the circuit pattern membranes into a perforation results in an increased capacitance for the opposed plates. 
     A troubling aspect of the manufacture of membrane keypads is that variations in the thickness dimensions of the perforated insulating membrane or in the thickness of other insulating layers which might be present between the opposed capacitance plates result in significant changes in the values of the capacitances from one keypad to the next. As a result, it is necessary to adjust separately for each keypad the reference value to be used for verifying key closures. This adds considerably to the manufacturing cost of the product. 
     SUMMARY OF THE INVENTION 
     In accordance with the novel method and apparatus of the present invention, a capacitive keyboard is scanned in a manner in which the capacitance of a given key is compared to the capacitance of one or more other keys of the same kayboard. Verification of a key closure is determined by the relative capacitance values, rather than being dependent upon a reference value. The relative capacitance values remain substantially the same from keyboard to keyboard despite manufacturing variations, such as in the thickness of insulating layers for membrane keypads. In this way, the adjustment of a reference value for individual keyboards is made unnecessary for any variations in capacitances from one keyboard to the next. 
    
    
     BRIEF DESCRIPTION OF THE DRAWING 
     FIG. 1 is a schematic circuit diagram of a greatly simplified capacitive keypad arrangement in accordance with an embodiment of the present invention having only two keys. 
     FIG. 2 is a simplified schematic circuit diagram of a capacitive keypad arrangement in accordance with another embodiment of the invention having several rows and columns of cross-point connected keys and showing the circuitry associated therewith for the closure verification process. 
    
    
     DETAILED DESCRIPTION 
     The circuit of the keypad 10 of FIG. 1 illustrates the nature of the key closure process in accordance with the invention. Only two keys are present in the keypad 10. They are identified by their capacitances C1 and C2. The key C1 is connected between the inverting input port 12 of an operational amplifier 14 and a scanning pulse generator 16, which has its other side connected to ground potential. The key C2 is connected in parallel with a zeroing switch S 0  between the inverting input port 12 and the output port 22 of the amplifier 14. A voltage reference source 18 is connected between ground potential and the noninverting input port 20 of the amplifier 14. As the keypad 10 is configured, the key C1 is scanned by a pulse from the pulse generator 16. The output pulse which will result at the output port 22 of the amplifier 14 will have a magnitude of the inverse of the pulse from the pulse generator 16 times the ratio C1/C2. Thus it is seen that the magnitude of the reference voltage from the source 18 is not a significant factor in this value. The magnitude of the scanning pulse from the generator 16 can be readily made independent of ordinarily expected variations in power. The output of the amplifier 14, therefore, gives a capacitance ratio for the keys which can be compared to a reference value to determine whether the key C1 is closed. The reference value for the comparison can be the same for keypads with different values for their capacitances. So long as both the capacitances C1 and C2 are changed to the same degree, the ratio C1/C2 does not change. If it is now desired to scan the key C2, the keypad 10 must be reconfigured to effectively interchange the connections of C1 and C2, so that the capacitance of C2 is compared to that of C1. Such reconfiguration is readily accomplished by the provision of appropriate switches and controls. 
     The circuit of the keypad 24 of FIG. 2 illustrates in more detail the scanning process of a keypad in accordance with the invention. The keys of the keypad 24 are identified by their associated capacitances. These are designated by &#34;C&#34; followed by a two digit number. The first digit indicates the row, and the second the column in which the key is located. A first side of all the capacitors in a particular column can be selectively connected to the source of an interrogation pulse of magnitude V ref  1 or, alternatively, to the noninverting input 26 of a comparator 28 by the action of a corresponding one of a set of toggle switches S C1  -S C4  associated with the respective columns. A second side of all the capacitors in a particular row can be selectively connected to the inverting input port 30 of an operational amplifier 32 or, alternatively, to a positive supply voltage V DD  by the action of a corresponding one of a set of toggle switches S R1  -S R4  associated with the respective rows. The noninverting input port 34 of the amplifier 32 is connected to a second reference voltage V ref  2. The output port 36 of the amplifier 32 is connected to the noninverting input port 26 of the comparator 28. The inverting input port 38 of the comparator 38 is connected to a third reference voltage V ref  3. A zeroing switch S O  is connected between the inverting input port 30 and the output port 36 of the amplifier 32. 
     The switches S C1  -S C4 , S R1  -S R4 , and S 0  are operated by a controller 40. They may take whatever form is most appropriate for the particular circuit implementation in question. For example, for an MOS circuit the switches are advantageously in the form of transmission gates. Controllers for operating the switches in whatever manner is suitable for their function are known to those in the art. 
     In the operation of the keypad 24, one capacitor of each row is compared with all the remaining capacitors of that same row. As the keypad 24 of FIG. 2 is configured, the value of C41 is being compared to the sum of the capacitors C42,C43,C44. The zeroing switch S 0  is initially closed to bring the inverting input port 30 of the amplifier 32 to the same voltage as the output port 36. Then the zeroing switch S 0  is opened and a pulse of magnitude V ref  1 below the reference voltage V DD  is applied to the first sides of all the capacitors of the first column. At this time the first sides of the capacitors of the remaining columns are connected to the noninverting input port 26 of the comparator 28. Also at this time, the other sides of the capacitors of the fourth row are connected to the inverting input port 30 of the amplifier 32, while the other sides of the capacitors of all the other rows are connected to the positive supply voltage V DD . It is reasonable to assume the loop gain of the amplifier 32 to be sufficiently high to prevent the sum of the capacitances from the other sides of the capacitors of all the other rows from adversely affecting its output. The output of the amplifier is a pulse of magnitude V x  above V ref  2, which can be expressed as V ref  2 -V ref  1*C41/(C42+C43+C44). The output V x  is then compared to a key closure threshold reference voltage V ref  3 by the comparator 28 to result in an output HL at the output port 42 of the comparator 28. 
     If the next key to be scanned is C42, then the switches S C1  and S C2  are changed to their alternate positions and the pulsing process is repeated. In this manner the entire keypad 24 can be scanned, and the condition of each key can be determined and verified by the reference voltage V ref  3 comparison with accuracy, regardless of mass variations in the values of the capacitances of the keys, since the variable parameter for determining closure is independent of a reference voltage level. 
     While in the keypad 24 the key C41 of interest is compared to the other remaining keys in its row, it could also be compared to any one or more other keys on the keypad and still be within the scope of the invention if the comparison is accomplished by only a single scanning pulse for each key. However, comparison to the other keys of the row is advantageous in that it requires a minimum amount of switching for the scanning process. 
     A particularly advantageous logic sequence for scanning the keypad 24 is to continue to scan a key which has been detected as being in the closed position until it is detected as being open once again. The effects of errors resulting from noise or key bounce can be reduced by requiring multiple successive detections of either the closed or open position of the key to be made before verification of that condition is considered established. 
     The above scanning procedure for the keypad 24 is for detecting individual key closures, and does not detect multiple key closures. For detecting multiple key closures, the basic operation is similar to that described above, except that each key is compared to the additional row, then column keys. A detection in either comparison results in the continual scanning of the key until 3 successive scans verify the key closure. Once the key being interrogated is verified as being either open or closed, the keypad scan is resumed. At the time of validation, the row-column information is compared to a second stage of information and this comparison is used to enable the generation of key closures independently. The keypad information is then transferred to the second stage for further comparisons. 
     Although the present invention is particularly advantageous for membrane keypads, it is applicable to any capacitive keyboard in which there are variations in the values of the key capacitances from one keyboard to the next.