Patent Publication Number: US-4222038-A

Title: Microcomputer keyboard input circuitry

Description:
RELATED APPLICATIONS 
     This application is related to the instant assignees co-pending U.S. Application, Ser. No. 837,255, entitled &#34;Mobile Data Terminal&#34;, by James A. Lamb, et al and filed on Sept. 27, 1977. 
     BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     This invention relates to keyboard input circuitry, and more particularly, to improved keyboard circuitry for use in data processing systems. 
     2. Description of the Prior Art 
     Keyboards having a matrix of keys are particularly well suited for use in data processing systems. The keys of such keyboards provide continuity between corresponding column and row conductors when depressed. Output signals from the data processing system are coupled to each column conductor for sequentially scanning the keyboard for depressed keys. A depressed key is sensed when the output signal from the column conductor is present on the corresponding row conductor. Thus, for a matrix of keys having K columns and J rows, the data processing system must provide K output signals for the K columns and monitor the J row conductors. As a result, a relatively large number of signals (K+J) are required to interface the data processing system to the keyboard. 
     In order to reduce the number of interconnecting signals, additional circuitry may be utilized for scanning the matrix of keys and providing a digitally coded signal when a particular key is depressed. The digitally coded signal uniquely identifies the depressed key. However, the stored program control of the data processing system must be programmed to decode the digitally coded signals in order to recognize the depressed key, and the additional circuitry increases the cost of the data processing system. 
     For the foregoing and other shortcomings and problems, there has been a long felt need for an improved keyboard input circuitry for use for the data processing system. 
     SUMMARY OF THE INVENTION 
     Accordingly, it is a general object of the present invention to provide an improved and inexpensive keyboard input circuitry for use in a data processing system. 
     It is a further object of the present invention to provide an improved keyboard input circuitry that minimizes the interconnections between the keyboard circuitry and the data processing system. 
     It is a still further object of the present invention to provide a keyboard input circuitry that may be efficiently scanned by the data processing system under stored program control. 
     Accordingly, keyboard input circuitry for a data processing system is provided that comprises keyboard circuitry including a keyboard and counting circuitry and data processing circuitry including interface circuitry, a register and processing circuitry. The keyboard includes a matrix of keys organized into K columns and J rows, where J and K are integer numbers greater than one. Each key has a contact coupled to a Kth column conductor and a contact coupled to a Jth row conductor. When a key is depressed, continuity is provided between the corresponding Kth column conductor and Jth row conductor. 
     The counting circuitry is coupled to the keyboard and is adapted to provide in response to a clock signal K output signals for sequentially enabling the K column conductors of the keyboard. The counting circuitry is further responsive to a reset signal for providing a predetermined one of its K output signals. 
     The data processing circuitry includes a register, processing circuitry and interface circuitry for interfacing the keyboard circuitry to the processing circuitry. The interface circuitry couples to clock signal and the reset signal to the counting circuitry, and also is coupled to the J row conductors of the keyboard for sensing the states thereon. The states of the row conductors are indicative of the depressed and nondepressed keys of the respective enabled column of keyboard, where a sensed predetermined first state may indicate depressed keys and a sensed predetermined second state may indicate nondepressed keys. For example, depressed keys may be indicated by a logical one state and nondepressed keys by a logical zero state. 
     The register is adapted to sequentially provide in response to the clock signal N output signals, which correspond to the K output signals of the counting circuitry. The register is further responsive to the rest signal for providing a predetermined one of its N output signals for synchronizing the register and the counting circuitry to the same initial output signal. Thus, the register and the counting circuitry are synchronized to one another such that they are both providing the same output signal at all times. As a result, N and K have the same value at all times. 
     The processing circuitry is coupled to the interface means and register means for providing both the reset signal to synchronize the output signals of the register and the counting circuitry and the clock signal to synchronously sequence the output signals of the register and the counting circuitry. The processing circuitry is further responsive to the sensed states of the keys from the respective enabled column of keys for identifying a depressed key by the sensed predetermined state of the Jth row conductor and the Kth output signal of the register. Thus, each depressed key may be uniquely identified without coupling the output signals of the counting circuitry to the processing circuitry since the output signals of the register are synchronized to the output signals of the counting circuitry. 
     Additional features, objects and advantages of the keyboard input circuitry in accordance with the present invention will be more clearly apprehended from the following detailed description together with the accompanying drawings. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIGS. 1 and 2 when arranged in accordance with FIG. 4 illustrate a functional block diagram of the data processing system and keyboard input circuitry in accordance with the present invention. 
     FIG. 3 is a flow chart of the stored program control for the keyboard input circuitry. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT 
     Referring to the functional block diagram of FIGS. 1 and 2 when arranged in accordance with FIG. 4, a microcomputer system with a keyboard input circuitry in accordance with the present invention is shown. The microcomputer includes a microprocessor 100, a read only memory 101 and a random access memory 103. The keyboard input circuitry includes a peripheral interface adaptor circuit 102, a counter/decoder 104, buffer circuits 200, and a matrix of keys 260 together with diodes 210, resistors 220 and 230 and transmission circuits 240 and 250. 
     The microcomputer 100 can be any of a number of commercially available microcomputers such as the Motorola M6800 system. For example, the microprocessor 100 may be a Motorola MC6800, the read only memory 101 may be a Motorola MCM6830 and the random access memory 103 may be a Motorola MCM6810. Operation of the Motorola M6800 microcomputer system is described in &#34;M6800 Microcomputer System Design Data&#34;, by Motorola, Inc., 1976 and in U.S. Pat. No. 4,030,079 entitled &#34;Processor Including Incrementor and Program Register Structure&#34; by Thomas H. Bennett et al, issued on June 14, 1977 and assigned to the instant assignee. 
     The peripheral interface adapter circuit 102 interfaces the keyboard input circuitry to the microcomputer system. The peripheral interface adapter circuit 102 may be a Motorola MC6820 which is described in U.S. Pat. No. 3,979,730 entitled &#34;Interface Adapter Having Control Register&#34;, by Thomas H. Bennett et al, issued on Sept. 7, 1976 and assigned to the instant assignee. 
     The peripheral interface adapter circuit 102 controls the counter/decoder 104 by means of a reset signal 105 and a clock signal 106. At the beginning of each scan of the keyboard, the reset signal 105 is toggled to reset the counter/decoder 104 to its initial state. Then, transitions of the clock signal 106 advance the counter/decoder 104 from state to state for scanning the successive columns of the keyboard. 
     The states of the counter/decoder 104 are decoded to provide 10 output signals which are coupled to buffer gates 200. The output of the buffer gates 200 are coupled to diodes 210 for application to the column conductors of the keyboard. Each column conductor is coupled to one contact of the keys 260 in its respective column. The other contact of the keys 260 is coupled to a corresponding row conductor which is terminated by a resistor 220 to ground and coupled through resistors 230 to corresponding transmission circuits 240 and 250. When a key 260 is depressed, continuity is provided between the corresponding column conductor and row conductor. In the preferred embodiment of the present invention the keyboard is a matrix having 10 columns and 8 rows and providing for up to 80 keys 260. 
     The transmission circuits 240 and 250 each include four individual transmission gates 241 and 251. The outputs of the transmission gates 241 and 251 are coupled together and multiplexed by the clock signal 106 and the select signal 107. Thus the eight row conductors are multiplexed by the transmission circuits 240 and 250 onto four lines coupled to the peripheral interface adapter circuit 102. During a scan of the keyboard, a particular column signal is applied, and the first four and last four row conductors are examined by first enabling transmission circuit 240 and then enabling transmission circuit 250. 
     The scanning of the keyboard can be more clearly understood by referring to the flow chart of FIG. 3. The stored program of the microcomputer system utilizes an internal register of the microprocessor 100 that is synchronized to the counter/decoder 104 in order to determine the particular column that is being scanned. By using an internal register, the microprocessor 100 need not provide the ten output signals to scan the column conductors of the keyboard. 
     The flow chart begins at START block 300 and proceeds to block 301 where the internal register is reset; resulting in N=0. Next at block 302, the PIA output, the reset signal 105, is toggled to reset the counter/decoder 104; resulting in K=0. 
     Proceeding to block 303, the PIA inputs for the keys in the first four rows of the Kth column are tested to detect depressed keys. Next, at block 304 the PIA output, the select signal 107, is set to multiplex the keys in the last four rows of the Kth column to the PIA. These keys are likewise tested to detect depressed keys. Next, at block 305 the depressed keys are processed. The particular key is identified by using N from the internal register and the particular bit from the PIA indicating a depressed key. For example, a depressed key may be identified by a logical one state of the particular bit from the PIA. 
     Proceeding to block 306, the PIA output, the clock signal 106, is toggled to increment the counter/decoder 104, resulting in K=K+1, in order to scan the next row of the keyboard. Next, at block 307 the internal register is incremented, resulting in N=N+1, in order to maintain correspondence between N and K of the counter/decoder 104. 
     Proceeding to decision block 308, the state of N is tested to see if the ten columns have been scanned. If N=10, YES branch 310 is taken to DONE block 311. Otherwise, NO branch 309 is taken to return to block 303 to sample the keys in the next column. 
     The flowchart of FIG. 3 may be readily programmed by one skilled in the art for use in the microcomputer system. Programming techniques for the M6800 microcomputer system are described in &#34;M6800 Programming Reference Manual&#34; by Motorola, Inc., 1976. The use of the relatively simple flowchart of FIG. 3 enables one to eliminate a highly complex and expensive keyboard input circuitry that would otherwise be required. Also the keyboard may be organized to have any suitable number of columns and rows for the particular application. 
     The foregoing embodiments have been intended as illustrations of the principles of the present invention. Accordingly, other modifications, uses and embodiments can be devised by those skilled in the art without departing from the spirit and scope of the principles of the present invention.