BACKGROUND OF THE INVENTION
Field of the Invention:
[0001] The present invention relates generally to a keyboard interface circuit with a bi-directional
bus connectable to a separate central processing unit (CPU) and, more particularly,
the present invention is directed to a keyboard which multiplexes a key code to a
CPU and light codes from the CPU over the same bi-directional bus to provide feedback
to a keyboard operator concerning key selection.
Description of the Related Art:
[0002] In many applications, particularly in the field of nuclear power plant control, it
is necessary to backlight keys which have been selected and which correspond to particular
dedicated displays. The keys are backlit to provide feedback to the operator to indicate
that the proper display is turned on.
[0003] Prior art keyboards as described above are of one of two types where each type has
a set of "read-lines" for the separate CPU to read key selections and a set of "write-lines"
for the separate CPU to light the corresponding light.
[0004] The first type has the same number of read lines as keys and the same number or write
lines as lights. That is, if the keyboard has 64 keys and 64 lights, the interface
bus includes 128 lines. Many computers, particularly computers connected to other
devices besides the keyboard, do not have sufficient input/output lines to dedicate
a line for each key and a corresponding line for each light.
[0005] In an attempt to reduce the number of lines, many keyboard manufacturers are installing
dedicated keyboard computers in the keyboard connected to the keys and lights and
to the separate CPU. The keyboard computer transfers key codes over a 'read-bus' to
the separate CPU and the separate CPU transfers the corresponding light codes back
to the keyboard CPU over a 'write bus'. If the keyboard includes 64 keys and 64 lights
a read bus with at least 6 lines and a write bus with at least 6 lines is necessary.
This configuration reduces the number of read and write lines from 128 to 12, however,
the complexity and cost of the keyboard rises due to the addition of the keyboard
computer and the necessary software for controlling same.
SUMMARY OF THE INVENTION
[0006] It is an object of the present invention to provide a keyboard with a reduced number
of interface lines connected to a separate CPU.
[0007] The present invention provides a keyboard that does not require a keyboard computer
yet has a reduced number of bus lines. The present invention also provides a bi-directional
interface bus between the keyboard and the separate CPU, at the same time providing
feedback to the operator as to which key has been depressed, providing the capability
of lighting more than one light for each key depressed, and providing a low-cost keyboard
which is simple in construction.
[0008] The invention in its broad form resides in a keyboard and bi-directional interface
circuit connectable to a computer, said circuit comprising: a keyboard having keys
and lights corresponding to the keys; encoder and detection means for detecting key
selection and producing a key code corresponding to a selected key; characterized
by a bi-directional interface bus for transferring said key code to the computer
and transferring a light selection code corresponding to the key code from the computer;
isolation means for isolating said encoder and detection means from said bi-directional
bus; and decoder means for decoding the light code and activating the light corresponding
to the selected key.
[0009] A preferred embodiment of the invention described herein features a keyboard encoder
isolated from a bi-directional bus by an isolation circuit. When a selected key is
encoded a key code is made available for reading by a separate CPU. The separate CPU
acknowledges receipt of the key code by sending a light code to the keyboard over
the bi-directional interface bus after a function specified by the key code has been
started. The isolation circuit prevents the key code and the light code from becoming
intermixed on the bi-directional bus. The light code is used to select a bank of light
code decoders which activate a light corresponding to the light code. The activated
light remains lit until another key is selected.
[0010] A more detailed understanding of the invention can be had from the following description
of a preferred embodiment, given by way of example and to be read in conjunction with
the accompanying drawing wherein:
BRIEF DESCRIPTION OF THE DRAWINGS
[0011]
Figure 1 illustrates an embodiment of the present invention;
Figure 2 illustrates the key encoding portion of the keyboard according to the present
invention;
Figure 3 illustrates part of the light selection portion of the present invention;
Figure 4 illustrates the details of a light code decoder and light drive circuit in
accordance with the present invention;
Figure 5 illustrates the light code decoder and light drive circuit of the present
invention with an over protection circuit connected thereto;
Figure 6 illustrates a flowchart of a program executed by a CPU separate from the
keyboard;
Figure 7 illustrates the details of a portion of the flowchart in Figure 6; and
Figure 8 provides an example of a key code to light code conversion table.
DESCRIPTION OF THE PREFERRED EMBODIMENT
[0012] A separate central processing unit (CPU) 100, such as an Intel 86/05 is connected
to a keyboard 200, according to the present invention over a bi-directional bus 210
as illustrated in Figure 1, using a bi-directional digital input/output port in the
CPU. When a key 220 on the keyboard 200 is depressed, a keyboard encoder and key depression
detector 230 produce a key code which is applied to a keyboard isolation circuit 240.
When the CPU 100 scans the keyboard 200, the keyboard isolation circuit 240 transfers
the key code to the CPU 100 over the bi-directional bus 210. The CPU 100, after starting
the function associated with the key code, activates the keyboard isolation circuit
240 to remove the key code from the bi-directional bus 210 and then transfers a light
code, including a bank selection code, over the bi-directional bus 210. A bank select
circuit 250 transfers the light code to one of the bank decoders 260 and 270 in dependence
on the bank selection code. The selected bank decoder 260 or 270 decodes the light
code and activates a light behind the key 220 which was depressed. In this manner,
the operator sees a lit key 220 corresponding to the key depressed after the CPU 100
has started the function associates with the depressed key 220. As a result, the operator
receives a feedback indicating that the CPU 100 has received the proper key code and
started the selected function.
[0013] In nuclear power plant control rooms, the function produces a power plant display
associated with the key and reproduced on a viewing device such as a plasma display
panel. In many such applications, the display may be one of a series of subdisplays
indexed from a master display. In this situation, it is desirable to light the key
associated with the master display as well as the subdisplay. The provision of at
least two bank decoders allows the backlighting of both a master key and a subkey
when a subkey is selected thereby providing additional feedback information to the
operator concerning which power plant display is active and the relationship of the
active display to other inactive displays.
[0014] When the key 220 is depressed, one of the 8 to 4 encoders 300-330, illustrated in
Figure 2, produces a 4-bit key code associated with the selected key 220. Each of
the encoders 300-330 can be a 74LS348 encoder from Texas Instruments. The three low
order bits from each of the inputs of the encoders 300-330 are provided to the same
D flip-flop circuit 340 which can be a 74LS273 also from Texas Instruments. The high
order bit in the encoder corresponding to the selected key is high whenever a key
associated with the encoder is selected. Each of the high order bit from the encoders
300-330 is provided to separate inputs of the flip-flop circuit 340 resulting in a
6-bit key code being applied to the flip-flop circuit 340. The separately provided
bits allow, the light the encoder as well as the bank producing the 4-bit key code
to be identified. The high order bits of all of the encoders 300-330, which indicate
which encoder is active, are also applied to a NAND gate circuit 350 such as a 74LS22
from Texas Instruments. When the key selection pulse from one of the encoders 300-330
is provided to the NAND gate 350, it produces a key pulse which is delayed by a delay
circuit 360 (which can plural inverters such as 74S05-inverters from Texas Instruments).
The use of a NAND gate 350 ensures that when two keys are selected simultaneously,
the error is ignored. The delayed signal, which is delayed for about 29 nanoseconds,
acts as a key depression detection pulse and is applied to the clock input of the
D flip-flop circuit 340. As a result, the 6-bit key code is transferred (latched)
to the output of the flip-flop circuit 340. When the CPU 100 transfers a "read enable
code" over the bi-directional bus 210 (see Figure 3), a line driver receiver 370,
such as a 74LS244 from Texas Instruments, transfers the 6-bit key code to the CPU
100 over the bi-directional 210. Later, when the CPU disables the line driver receiver
370 by toggling the enable line low and, as a result, places the outputs of the receiver
370 in a high impedance state, a clear pulse is also applied to D-flip-flop circuit
340 (Figure 2) through inverter 380 which can be a 74S05 from Texas Instruments. The
clear pulse clears the output of the D-flip-flop circuit 340 so that if the line driver
receiver 370 is accidentally enabled no key code gets placed on the bi-directional
bus 210.
[0015] Before the CPU 100 transfers the light code over the bi-directional bus, the line
driver receiver 370 is disabled thereby activating the keyboard isolation circuit
240 of Figure 3. In addition, the CPU 100 loads a zero onto the bi-directional bus
210 to ensure that the bus 210 is in a neutral state. When the light code is transferred
over the bi-directional bus 210, a bank selection code is transferred therewith. The
light code is applied to the D-flip-flop circuits 400 and 410 (Figure 3) which can
be 74SL378 circuits from Texas Instruments. The one bit of the two bit bank select
code is applied to NOR gates 420 and 430, respectively, over bank select lines 440
and 450. When a strobe signal is transmitted over the bi-directional bus 210 and applied
to the NOR gates 420 and 430 via a strobe line 460, a clock signal is applied to a
clock input of the flip-flop circuit 400 or 410 associated with the selected bank.
As a result, the selected D flip-flop 400 or 410 transfers the light code to the appropriate
bank decoder 260 or 270. An alternative bank select circuit can be provided which
uses only one bank select line if an inverter is connected to the input of one of
the NOR gates 420 or 430 (Figure 3).
[0016] Each bank decoder 260/270 can be a 74154 circuit from Texas Instruments. The bank
decoder drives a power transistor 500 which activates a key light 510, as illustrated
in Figure 4. The power transistor 500 can be obtained from National Semiconductor
and should be capable of handling 177 milliamps.
[0017] An alternative version of the bank decoder and light circuit which provides overcurrent
protection is illustrated in Figure 5. If a short circuit occurs in the light circuit,
the short is sensed by overcurrent protection circuit 520 which disables the power
transistor 500 through a NOR gate 530, such as a 74LS33 from Texas Instruments.
[0018] As discussed above, the separate CPU 100 enables a read, performs a key code read,
converts the key code to a bank and light select code, clears the bus 210, and transfers
the bank and light select code over the bus 210 to light the appropriate light.
[0019] Figure 6 illustrates the program executed by CPU 100 which reads the key code and
produces the bank and light selection code. First, the CPU enables 600 a read by setting
the input/output port of the CPU to an input mode and transferring a read enable code
over the bus 210 to activate the line driver receiver 370 which, as discussed before,
transfers the key code onto the bi-directional bus 210. The key code is then input
610 after which the CPU determines which function should be started corresponding
to the key code and starts same 620. Once the function has been started, the key code
is converted 630 into the light and bank selection code. Once the light and bank select
code is produced, the CPU disables the read 640, thereby clearing the key code from
the flip-flop 340 and removing the key code from the bi-directional bus 210. At the
same time the input/output port of the CPU is set to an output mode (Enable Write)
allowing the bank and light selection code to be transferred 650 over the bus 210.
Once the light and bank selection codes are transferred, after a settling delay, the
CPU transfers a strobe pulse 660 over the bi-directional bus which causes NOR gates
420 and 430 to clock one of the flip-flop circuits 400 and 410. As a result, the light
code is decoded and the appropriate light is activated. It is possible at this point
to transfer another bank and light selection code over the bi-directional bus 210
followed by a strobe pulse to activate more than one light for the selected key. Once
the light is lit, the key code and bus are cleared 670, so that any intervening key
depressions are disabled thus ensuring that the light associated with the function
selected is indeed activated.
[0020] Figure 7 illustrates in greater detail the sequence of events which transfers the
bank and light selection code and activates the correct light. After the key code
is converted 700 into the bank and light selection code, the strobe light is set 700
low. A settling delay 720 is then provided before the read is disabled 730. Following
the disable of the read by activating the isolation circuit, a delay 740 occurs to
allow the isolation circuit to function before the bank and light selection code is
output 750. Following the output of the code and before the strobe line is set high
at 770, a settling delay 760 is also provided. After the strobe line is set high,
the corresponding light should be activated and once again the read is disabled 780
to ensure no intermixing of the codes and to clear the key code from the flip-flop
circuit 340. A count which is used to help determine whether the bi-directional bus
210 has been cleared is set 790 to 0 followed by a setting delay 800. Next, the count
is incremented 810 by 1 and the content of the bi-directional bus 210 is read 810
to determine if the bus 210 is in a neutral state. The CPU then outputs 830 a clear
light code to ensure that the bus is neutral, sets the strobe line low 840 and disables
the read 850 to clear the flip-flop 860. If the input from the keyboard is not equal
to a certain value indicating a clear or neutral state bi-directional bus 210 and
the count (the number of times an attempt to clear the bus has been made) is less
than 100, the sequence of events which attempt to clear the bus are tried again 870.
When the bus is clear, the program returns to the beginning of the scan program 600,
as illustrated in Figure 6.
[0021] Figure 8 illustrates an example of a key code to bank and light selection code conversion
table 900 maintained in CPU 100. The key code is used to access the table 900 to
retrieve the associated bank and light selection code. The first digit of both the
key and bank and light selection code indicates the bank and the second digit indicates
the key or the light to be activated.
[0022] The present invention requires that the separate CPU 100 actually scan the keyboard
at periodic intervals of at least one second to obtain the key code. It is possible,
however, to arrange the keyboard so that it provides an interrupt signal to the CPU
100. Such an interrupt signal can be provided by connecting a 1-shot monostable gate
circuit, between the NAND gate 350 (Figure 2), and the clock input of the D flip-flop
circuit 340 and making the output of the additional 1-shot circuit part of the bi-directional
bus 210. This 1-shot circuit, which could be a 74LS221 from Texas Instruments, would
provide the necessary delayed interrupt signal over the bi-directional bus 210. It
is also possible to provide a single bank of lights and keys thus eliminating the
need for the bank select circuit 250. It is further possible to have more than two
banks of lights and keys and to have plural lights activated in association with each
key depressed as long as the lights associated with the depressed key are activated
in different banks. It is possible to activate the light associated with the key whenever
a key is depressed without requiring feedback from the CPU 100 by connecting the enable
input of the line driver receiver 370 to the NOR gates 420 and 430 and the bank select
circuit thereby causing the key code on the bi-directional bus 210 to be decoded immediately
as the bank and light selection code to activate the associated light. This modification,
however, removes the feedback necessary in an operation such as a nuclear power plant
control room and thus would not be suitable for situations where feedback is necessary.
[0023] The many features and advantages of the invention are apparent from the detailed
specification and, thus, it is intended by the appended claims to cover all such features
and avantages of the circuit which fall within the true spirit and scope of the invention.
Further, since numerous modifications and changes will readily occur to those skilled
in the art, it is not desired to limit the invention to the exact construction and
operation illustrated and described, and accordingly, all suitable modifications
and equivalents may be resorted to within the scope of the invention.
1. A keyboard and bi-directional interface circuit connectable to a computer, said
circuit comprising:
a keyboard having keys and lights corresponding to the keys;
encoder and detection means for detecting key selection and producing a key code corresponding
to a selected key; characterized by
a bi-directional interface bus for transferring said key code to the computer and
transferring a light selection code corresponding to the key code from the computer;
isolation means for isolating said encoder and detection means from said bi-directional
bus;
and decoder means for decoding the light code and activating the light corresponding
to the selected key.
2. A circuit as recited in claim 1, wherein the light code includes a bank selection
code, and wherein the lights are arranged in banks and said circuit further comprises
bank selection means for selecting a bank in which said decoder means activates the
corresponding light.
3. A circuit as recited in claim 2, wherein another light selection code is transferred
over said bi-directional interface bus to said decoder means to light another light
associated with the selected key.
4. A circuit as recited in claim 2, wherein said encoder and detection means comprises:
an encoder operatively connected to the keys and said isolation means, and producing
the key code; and
a NAND gate connected to the encoder and said isolation means, and producing a key
depression signal from a portion of the key code.
5. A circuit as recited in claim 2, wherein said isolation means comprises:
a flip-flop circuit operatively connected to said encoder and detection means; and
a line driver receiver operatively connected between said flip-flop circuit and said
bi-directional interface bus.
6. A circuit as recited in claim 2, wherein said bank selection means comprises:
a NOR gate operatively connected to said bi-directional interface bus; and
a flip-flop circuit operatively connected to said bi-directional interface bus said
NOR gate and said decoder means.
7. A circuit as recited in claim 2, wherein said decoder means comprises:
a decoder operatively connected to said bank selection means; and
a power transistor operatively connected between said decoder and the light associated
with the selected key.