Time-shared scanning keyboard interface

Abstract: A time shared scanning keyboard interface comprises a timing generator 11 which generates a detecting signal for an interface circuit 12, and a control signal for a register 13 and an encoder 14. The interface circuit 12 is connected to an external keyboard, and receives a detecting signal from a timing generator which it uses to scan keyboard interface parts. The detected status of the interface ports is transmitted then to the register 13. The register 13 transmits the status of the ports to an encoder 14.

Description: This invention relates to a time-shared scanning keyboard interface and to a method of controlling interface ports which form part of a keyboard interface. In discussing keyboard scanning by keyboard interfaces, Reference is made in this specification to "output ports" and "input ports". Output ports will be understood to be those through which the state of a key will actually be sensed (e.g. by transmitting a signal related to the state of a key). Each input port will typically be connected to a plurality of keys (e.g. each in a different column) and a scan signal transmitted by the output nodes will select one of them by selecting, e.g., the column being scanned and, therefore, the particular key corresponding to each input node for that column. The keyboard interface in a telephone system is conventionally arrayed in a key matrix comprising a column group and a row group. Each key is mapped to an intersection between one column and one row. Generally, the various known scanning methods can be classified into two different types. In a first type of keyboard interface, the keyboard interface ports are divided into two groups, a column group and a row group. If the column group of the keyboard interface ports are always assigned as input ports and the row group are always assigned as output ports, when the row group (output ports) transmits a scanning signal, the column group (input ports) will be scanned and detected by the scanning signal coming from row group (output ports) and the status of keyboard will be recorded accordingly. In a second type of keyboard interface, the column group and the row group of the keyboard interface are interchanged as input ports and output ports, respectively. This means that when the column group transmits the scanning signal (the column group are assigned as output ports at this moment), the row group will automatically become input ports which will be scanned by the signal coming from output ports, and the status of input ports is therefore detected. If the row group are assigned as output ports which transmit the scanning signal, the column group will become input ports to take charge of the detecting task. Such interaction completes the keyboard detecting operation. Assuming that there are N keyboard interface ports in above mentioned two types of scanning keyboard interfaces, the maximum number of keys that can be arranged on the keyboard is only N 2 /4 (if N is an odd number) or (N 2 -1)/4 (if N is an even number). Therefore, the relatively small number of keys that can be detected is a disadvantage of the conventional keyboard interface. Theoretically, for a keyboard interface with N interface ports, the maximum number of detected keys formed on a keyboard will be equal to the number of combinations of N objects taken two at a time, C(N,2) i.e. N(N-1)/2). The extended time-shared scanning technique of the present invention achieves this objective. EP-A-94130 discloses a time-shared keyboard interface which includes a plurality of single input / output ports to replace separate input and output ports. The interface also includes interface elements, register means, and encoding means, the encoding and register means being responsive respectively to first and second control signals. In one aspect, the invention provides a time-shared scanning keyboard interface for a keyboard comprising: timing generator means for sequentially generating a plurality of detecting signals, a first control signal, and a second control signal during a scanning cycle; keyboard interface means containing N interface ports, each port being coupled to one of a plurality of keyboard interface elements, said interface elements being responsive to keyboard signals from said keyboard and also responsive to said detecting signals; register means for registering the status of said interface ports; encoding means responsive to said first control signal for encoding said keyboard signals registered in said register means; wherein said interface ports respond sequentially to said detecting signals such that when one of said interface ports receives one of said detecting signals, said one of said interface ports will operate as an output port and the others of said interface ports that have not received said detecting signal will operate as input ports; further wherein once said detecting signals have been generated during a scanning cycle, said timing generator means generates said first control signal such that said encoding means encodes said keyboard signals registered in said register means; and then generates said second control signal to reset said register means; characterised in that said register means comprises N NORgates coupled to N flip-flops. In another aspect, the invention provides a method of controlling interface ports which form part of a keyboard interface, the keyboard interface comprising keyboard interface means containing N interface ports, each interface port being coupled to one of a plurality of keyboard interface element, said interface elements being responsive to keyboard signals from said keyboard and also responsive to said detecting signals, and each interface port being controllable to operate (i) as an input port to sense the state of a key, and (ii) as an output port which can be activated to transmit a signal to enable other ports to operate as input ports, the method comprising: (a) activating each interface port in turn to act as an output port; and (b) operating all but one interface ports as input ports while the said one port operates as an output port; characterised by registering the status of said interface ports using register means having N NORgates coupled to N flip flops. Instead of assigning keyboard interface ports with the fixed duty of input ports and output ports for the column group and row group, respectively (as in the first type keyboard interface described previously), or interchanging input ports and output ports for the column group and row group (as in the second type keyboard interface described previously), the present invention provides a time-shared scanning technique in which the interface ports are made absolutely independent of one other, and they play the role of both input ports or output ports alternatively. By means of the time-shared scanning keyboard interface, the detecting signal is applied to scan each interface port sequentially in the process of scanning, making that port an output port. Each port is associated with a particular group (e.g. column) of keys as an output port. No matter which port is the output port, the rest of the ports (N-1 interface ports) will automatically become input ports, and each will be associated with one of the particular group of keys. Each input ports then permits sensing and recording the status of the corresponding key. These scanning and detecting operations repeat in consecutive phases, with each port becoming an output port in turn and a corresponding, different group of keys being sensed by the remaining ports. The architecture of the present invention, the improved keyboard interface combining the time-shared scanning technique and keyboard detecting concepts, maximises the number of keys detected and results in efficient performance and cost reduction. Preferably, the signal generating means includes a scanning keyboard interface circuit as claimed in claim 1, in which the signal generating means includes means for feeing the detecting signal sequentially to one keyboard interface port at a time, the keyboard interface transmitting N scanning signals in sequence through the interface ports to the N corresponding keyboard ports. Embodiments of the present invention will now be described, by way of example, with reference to the accompanying drawings, in which: Figure 1 is a block diagram of a keyboard scanning and detecting device embodying the invention, Figure 2 is a state diagram of the extended time-sharing scanning keyboard interface of this invention, Figure 3 is a circuit schematic diagram showing six interface ports implemented by the present extended time-shared scanning keyboard interface, and Figure 4 is a timing diagram of the circuit of Figure 3. Referring to the drawings, Figure 1 shows general use keyboard scanning and detecting interface generally comprises four parts (see Fig. 1): 1. A timing generator 11, which generates the detecting signal for a keyboard interface circuit 12 and the control signal for a register 13 and an encoder 14; 2. A keyboard interface circuit 12, which is connected to the external keyboard, receives, from the timing generator 11, the detecting signal used to scan keyboard interface ports, and then transmits the status detected to the register 13; 3. A register 13, which records the status from the keyboard interface circuit 12 and transmits it to the encoder 14; and 4. The encoder 14, which encodes the status from the register 13 and then transmits it to the internal circuit. The invention will now be described in more detail with reference to Figure 2. Assuming that a keyboard interface has N interface ports, P i represents one of these ports, state 21 represents the initial state, and the ensuing operation starts from port 1. When P i transmits a scanning signal (state 22), P i then becomes an output port, and the rest of the ports P j (j ≠ i) then become input ports in response to detection of the status of interface ports (state 23). If one or more of interface ports P j are active, this result will be recorded by register 13 (state 24). If no activation is detected, the register will record nothing. The next scanning signal will be consecutively transmitted through the next port, which acts as P i , following the predescribed route (state 26), until all the interface ports have transmitted a scanning signal (state 25). Next, the register transmits the status received to the encoder 14 for encoding, and operation is reset to the initial state (state 28). The whole cycle of the detecting and scanning operation is thereby completed. The circuit in Figure 3 which comprises six interface ports is implemented to illustrate the above-mentioned concept. The timing generator 11 which is composed of three flip-flops and eight 3-input NOR gates (refer to Figures. 1 and 3) forms eight timing signals named as CK1, CK2, CK3, CK4, CK5, CK6, CK7 and CK8 (refer to Figure. 4). The clock signals of CK1, CK2, CK3, CK4, CK5, CK6 are applied to the keyboard interface 12 for scanning the six interface ports. The clock signal CK7 is employed to control the encoder 14, and the clock signal CK8 resets the register 13. The keyboard interface 12 has six ports, and each port contains a pulled-high series NMOS device with this source connected to ground. The gate node of each NMOS receives, respectively, the one of the clock signals CK1, CK2, CK3, CK4, CK5, CK6 generated by timing generator 11, and port 1, port 2, port 3, port 4, port 5 and port 6 appear at the respective drain nodes. A key K12....K56 is arranged between each pair of ports, so a total of fifteen keys are on the keyboard. Register 13 mainly comprises six flip-flop latch cells. All the D inputs of the latches are connected to the positive power supply Vcc. When a latch cell is latched, its output node Q will therefore be pulled to a high level. When the latch cell will be latched is controlled, respectively, by the 3-input NOR gates 41-46, the output of each of which is applied as a clocking input to a different latch. The signal CK8 is applied to the latches so as to produce a simultaneous reset of all the latches. Encoder 14 is under the control of the clock signal CK7. The outputs D1 to D4 of Encoder 14 are latched to the previous code unless the signal CK7 is active. The case of key K13 (arranged between port 1 and port 3) being depressed is taken as an example to illustrate the scanning and detecting principles. When key K13 is depressed, the following events occur. When the clock signal CK1 is high (i.e. port 1 transmits the scanning signal), line 31 will be pulled low (because its NMOS is turned on) and at that moment, port 1 becomes an output port and the rest of the ports become input ports to receive the status of the scanned keyboard. If the key K13 is depressed, only line 33 will be low, but lines 32, 34, 35, 36 are still high. Therefore, under the condition of the signal CKN being low, the output of gate 43 is high and the other outputs of gates (gate 41, 42, 44, 45, 46) are low. Consequently, line KL3 will be set to the high level (i.e. line KL3 = 1), the lines KL1 through KL6 then represent the "001000" state. When the clock signal CK2 goes high (i.e. port 2 transmits the scanning signal), line 32 is pulled low. However, the key K13 is not affected by port 2 now. Therefore, after scanning, line 31, 33, 34, 35, and 36 are still high, and the outputs of gates 41, 42, 43, 44, 45, and 46 are all low. No latching action is found and lines KL1-KL6 result in the "101000" state. When the clock signal CK3 goes high (i.e., port 3) transmit the scanning signal), the procedure will be same as the clock signal CK1 being high, but the state of the result of lines KL1 - KL6 comes out as the "101000" state. The situation of clock signals CK4, CK5, and CK6 being high will be the same as clock signal CK2, but the lines KL1 - KL6 result in the "101000" state. After the scanning operation of clock signals CK1, CK2, CK3, CK4, CK5 and CK6 is finished, the state of KL1 - KL6 shown as the "101000" state represents the status of the depressed key K13 on the keyboard. After this, the encoder 14 will encode the state "101000" when the clock signal CK7 goes high. The register 13 will be reset (i.e. the state of lines KL1 - KL6 becomes the "000000" state) when the clock signal CK8 goes high. Now, the whole cycle of scanning and detecting operation has been completed. The condition that no key is depressed or an incorrect key depression (for instance, that two keys are depressed simultaneously) will also be detected by the time-shared scanning keyboard interface. If the state of the lines KL1 - KL6 in register 13 shows as "000000", it means that no key is depress, or if the state of KL1 - KL6 shows as "111000" or "101011" (more than three 1's appear) it indicates that multiple keys were depressed simultaneously. Under such situations, encoder 14 will encode nothing. From the previous description, it should be understood that the objective of achieving the maximum number of keys detected can be accomplished by the utilization of the time-shared scanning and detecting technique.

Claims: A time-shared scanning keyboard interface for a keyboard comprising: timing generator means (11) for sequentially generating a plurality of detecting signals, a first control signal, and a second control signal during a scanning cycle; keyboard interface means (12) containing N interface ports, each port being coupled to one of a plurality of keyboard interface elements, said interface elements being responsive to keyboard signals from said keyboard and also responsive to said detecting signals; register means (13) for registering the status of said interface ports; encoding means (14) responsive to said first control signal for encoding said keyboard signals registered in said register means; wherein said interface ports respond sequentially to said detecting signals such that when one of said interface ports receives one of said detecting signals, said one of said interface ports will operate as an output port and the others of said interface ports that have not received said detecting signal will operate as input ports; further wherein once said detecting signals have been generated during a scanning cycle, said timing generator means (11) generates said first control signal such that said encoding means (14) encodes said keyboard signals registered im said register means (13); and then generates said second control signal to reset said register means (13); characterised in that said register means (13) comprises N NORgates coupled to N flip-flops. A scanning keyboard interface as claimed in claim 1, in which each of the keyboard interface elements comprises a pulled-high NMOS series device with its source connected to ground, the gate receiving one of the detecting signals and the drain being one of the interface ports. A scanning keyboard interface as claimed in claim 2, in which each of the NOR gates comprises (a) a first input node for inputting the keyboard signal, (b) a second input node for inputting the detecting signal, and (c) a third input node for inputting a timing clock signal. A scanning keyboard interface as claimed in claim 1, in which the register means (13) stores the status of every keyboard interface port except the port which works as an output port. A method of controlling interface ports which form part of a keyboard interface, the keyboard interface comprising keyboard interface means (12) containing N interface ports, each interface port being coupled to one of a plurality of keyboard interface element, said interface elements being responsive to keyboard signals from said keyboard and also responsive to detecting signals, and each interface port being controllable to operate (i) as an input port to sense the state of a key, and (ii) as an output port which can be activated to transmit a signal to enable other ports to operate as input ports, the method comprising: (a) activating each interface port in turn to act as an output port; and (b) operating all but one interface ports as input ports while the said one port operates as an output port; characterised by registering the status of said interface ports using register means (13) having N NORgates coupled to N flip flops. A method as claimed in claim 5, which includes the step of recording the output of each interface port when it is operated as an input port, so that the state of each of the keys of the keyboard is recorded after each interface port has acted as an output port while each remaining port is operated as an input port.

Inventors: CHEN YANG-CHERN, YANG HUEI-MING, CHEN, YANG-CHERN, YANG, HUEI-MING
Applicants: IND TECH RES INST, INDUSTRIAL TECHNOLOGY RESEARCH INSTITUTE
Application year: 1991
Main classification: H03M11
IPC codes: H03M11, G06F3