This invention relates generally to methods and apparatus for electronic data entry and more particularly to methods and apparatus for matrix keyboard control.
In electronic devices having multiple keys, a matrix switching arrangement can be used to reduce the number of lines required to scan the keys. An exemplary matrix switching arrangement is illustrated in
A matrix switching arrangement becomes advantageous over sensing individual keys if more than five keys are involved. For example, 6-key keyboard 101 would require six lines if each key was sensed individually. However, using an X-Y matrix of two columns (X1, X2) and three rows (Y1, Y2, Y3), the number of lines required is reduced to five. As the number of keys increases, the economies of using a matrix arrangement become even greater. For example, a 36-key keyboard would normally require 36 individual lines. However, as few as twelve lines (e.g., six rows and six columns) can be used if using an X-Y matrix. The row and column lines can be driven and read by a keyboard controller 102. The keyboard controller can be a programmed micro-controller/processor or programmable logic device (CPLD, FPGA, etc.). Alternatively, standard X-Y matrix scanning techniques can also use off-the-shelf keyboard decoder components similar to National Semiconductor's 74C922/923 devices.
Operation of a keyboard like that illustrated in
Using devices that operate as described above, the number of available I/O lines is typically at a premium and devices with greater numbers of I/O are more expensive. Therefore, using a smaller number of I/O lines can facilitate the use of a lower cost device. Therefore, keyboard scanning arrangements using fewer lines than an X-Y matrix are desirable.
There have been various analog techniques proposed to achieve scanning a large number of keys with fewer I/O lines. Such arrangements are described, for example, in the Freescale Semiconductor Application Note entitled, “Multi-Button IR Remote Control Using the MC9RS08KA2” and Microchip “Tips 'n Tricks 8-pin Flash PIC® Microcontrollers Outperform the Compeition,” each of which is incorporated by reference in its entirety. These solutions often suffer from decreased reliability because of variations in key resistance, effects of aging on the key contact, and various other parameters.
Therefore, what is needed in the art are improved devices, methods, and techniques for keyboard scanning that use fewer lines than a standard X-Y matrix but maintain sufficiently high levels of reliability.
In some embodiments, the present invention can relate to a keyboard arrangement. The keyboard arrangement can include a plurality of keys, with each key having a drive contact and a plurality (e.g., two) of sense contacts. The keyboard arrangement can also include a keyboard decoder having at least one output line and a plurality of input lines. The plurlaity of keys can have their drive contacts connected to the output line or lines of the keyboard decoder, and their drive contacts connected to the input lines of the keyboard decoder. More specifically, the sense contacts of the keys can be connected so that each key is connected to a unique combination of input lines.
In some embodiments, the keyboard decoder, which can be a custom circuit, a programmed microprocessor, an FPGA/CPLD, etc., can be adapted to provide a plurality of different drive signals that vary in phase, frequency, waveshape, etc. In some embodiments, the address formed on the input lines by pressing a key can be used to lookup a function of the key in a lookup table stored in a memory, either integral with or separate from but connected to the keyboard decoder. Values in the lookup table that do not correspond to a valid keypress can be indicated as invalid in the lookup table.
In other embodiments, the invention can relate to a method of decoding keyboard input at a keyboard controller. The method can include reading an address from a plurality of input lines of the keyboard controller, where the input lines are connected to keys of a keyboard substantially as described above, i.e., each key is connected to a plurality of (e.g, two) input lines and is connected a unique combination of input lines. The method can also include using the address to look up a key value in a lookup table, and returning the key value stored in the lookup table at the address.
In other embodiments, the method can include determining one or more parameters of a drive signal (e.g., phase, frequency, or waveshape) associated with the address on the plurality of input lines of the keyboard controller. This parameter or parameters can be used to select an appropriate lookup table for looking up a key value.
These and other embodiments may be understood by reference to the following description and drawings.
Disclosed herein is a twin-contact keyboard sensing arrangement, an example of which is schematically depicted in
Unlike typical X-Y matrix switching arrangements that use multiple column lines, the twin contact arrangement can use a single column line. In some embodiments, the single column line can be toggled to produce two separate phases, e.g., one positive and one negative, effectively doubling the number of keys that can be scanned using the same number of lines. Thus, the arrangement illustrated in
An exemplary two-phase column driver circuit is shown in
An additional advantage of a twin-contact decoding arrangement is that decoding for the keys is simplified, as the row lines form an X-bit address for a look-up table (where X is the number of row lines). The lookup table can be stored in a memory separate from or integral with the keyboard decoder, and can be a read-only memory (ROM) or random access memory (RAM), which could allow the keyboard to be reconfigured for various functions. Where complimentary phases of the column drive signal are used, the row lines can form an X-bit address into twin lookup tables, with the state of the column line being used to select the appropriate lookup table.
Using the 42-key keyboard as an example, the seven row lines can form a 7-bit address into twin 128 byte lookup tables with the state of the COL_CLK signal used to select which table is used. Twenty-one of the 128 entries are valid in each lookup table with all other entries set to an “invalid” value used by the processing firmware or logic. Additionally, if there is insufficient pressure on a key, such that only one of the two row contacts is closed, it will decode to an “invalid” value and not be processed. An example look-up table for the sensing arrangement of
The table below illustrates the number of lines required between a traditional X-Y matrix keyboard and one using the twin-contact arrangement.
An exemplary schematic symbol for a key using the twin-contact arrangement is shown in
The foregoing description of preferred and other embodiments is not intended to limit or restrict the scope or applicability of the inventive concepts conceived by Applicant. For example, although twin-contact switching arrangements are illustrated, switching arrangements having greater numbers of sensing contacts are also contemplated. In exchange for disclosing the inventive concepts contained herein, Applicant desires all patent rights afforded by the appended claims. Therefore, it is intended that the appended claims include all modifications and alterations to the full extent that they come within the scope of the following claims or the equivalents thereof.