JPS5911931B2 - Keyboard control method - Google Patents

Keyboard control method

Info

Publication number
JPS5911931B2
JPS5911931B2 JP54167762A JP16776279A JPS5911931B2 JP S5911931 B2 JPS5911931 B2 JP S5911931B2 JP 54167762 A JP54167762 A JP 54167762A JP 16776279 A JP16776279 A JP 16776279A JP S5911931 B2 JPS5911931 B2 JP S5911931B2
Authority
JP
Japan
Prior art keywords
keyboard matrix
output
key
register
keyboard
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired
Application number
JP54167762A
Other languages
Japanese (ja)
Other versions
JPS5690332A (en
Inventor
治彦 伴野
登央 中野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Tokyo Shibaura Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tokyo Shibaura Electric Co Ltd filed Critical Tokyo Shibaura Electric Co Ltd
Priority to JP54167762A priority Critical patent/JPS5911931B2/en
Publication of JPS5690332A publication Critical patent/JPS5690332A/en
Publication of JPS5911931B2 publication Critical patent/JPS5911931B2/en
Expired legal-status Critical Current

Links

Landscapes

  • Input From Keyboards Or The Like (AREA)

Description

【発明の詳細な説明】 本発明はマトリックススキャン方式のキーボード制御方
式に関する。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a matrix scan type keyboard control system.

従来、キーボードマトリックスのキー操作されている位
置を検出するキーボード制御方式として、リフトウェア
・スキヤンニング方式が知られている。
Conventionally, a liftware scanning method is known as a keyboard control method for detecting the position of a key operated on a keyboard matrix.

これはキーボードマトリックス出力のオアをとつて、そ
れをソフトウェアでポーリングしたり、或はハードウェ
ア的に割込みをかけるものである。この方式のものはキ
ーボードマトリックス出力のオアをとるために少なくと
もICが1個必要となる。このICを削除するため、あ
る時間間隔でキーボードマトリックスをソフトウエアス
キヤンニングすることも考えられるが、それでは処理に
必要とするソフトウェア時間が大きく、ソフトウェアに
かかる負担が大きくなりすぎる問題がある。本発明はこ
のような問題に鑑みてなされたもので、ハードウェアを
減すことができると共にソフトウェアの負担も減らすこ
とができるキーボード制御方式を提供することを目的と
する。以下、本発明の一実施例を図面を参照して説明す
る。
This is done by ORing the keyboard matrix output and polling it using software, or issuing an interrupt using hardware. This method requires at least one IC to OR the keyboard matrix output. In order to remove this IC, it is conceivable to perform software scanning of the keyboard matrix at certain time intervals, but this would require a large amount of software time for processing and would place an excessive burden on the software. The present invention has been made in view of these problems, and an object of the present invention is to provide a keyboard control method that can reduce the amount of hardware and the burden on software. Hereinafter, one embodiment of the present invention will be described with reference to the drawings.

第1図において、100はマイクロプロセッサ(CUP
)である。
In FIG. 1, 100 is a microprocessor (CUP
).

101はアドレスデコーダ(DCDR)、102、10
3はアンドゲート、104はレジスタ(REG)、10
5はドライバ(DRVR)、106はキーボードマトリ
ックス、IOTはマイクロプロセッサ100の内部レジ
スタ(A−REG)である。
101 is an address decoder (DCDR), 102, 10
3 is an AND gate, 104 is a register (REG), 10
5 is a driver (DRVR), 106 is a keyboard matrix, and IOT is an internal register (A-REG) of the microprocessor 100.

キーボードマトリック、ス106は8本の入力線104
−0、104−1〜104−Tと、8本の出力線105
−0、105−1〜105−7からなるものである。レ
ジスタ104はキーボードマトリックス106の入力線
と同一数のビットを有し、その各ビットの・ 出力端を
対応する入力線104−0、104−1〜104−Tに
接続している。ドライバ105はキーボードマトリック
ス106の出力線と同一数の入力端子を有し、その各入
力端子を対応する出力線105−0,105−1、〜1
05−7に接続している。レジスタ104にはアンドゲ
ート103からクロツク信号15が供給された時、内部
レジスタ107の内容がバスライン10を介して書込ま
れる。ドライバ105はアンドゲート102からエネー
ブル信号が供給された時、キーボードマトリツクス10
6の出力をバスライン10を介して内部レジスタ107
に送出する。アンドゲート102はアドレスデコーダ1
01の出力信号12及びマイクロプロセツサ100から
リード(READ)信号17が入力された場合に、エネ
ーブル信号14を出力する。アンドゲート103はアド
レスデコーダ101の出力信号13及びマイクロプロセ
ツサ100からライト(WRITE)信号16が入力さ
れた場合にクロツク信号15を出力する。
The keyboard matrix 106 has eight input lines 104.
-0, 104-1 to 104-T and eight output lines 105
-0, 105-1 to 105-7. The register 104 has the same number of bits as the input lines of the keyboard matrix 106, and the output end of each bit is connected to the corresponding input line 104-0, 104-1 to 104-T. The driver 105 has the same number of input terminals as the output lines of the keyboard matrix 106, and connects each input terminal to a corresponding output line 105-0, 105-1, ~1.
Connected to 05-7. When the register 104 is supplied with the clock signal 15 from the AND gate 103, the contents of the internal register 107 are written via the bus line 10. When the driver 105 receives an enable signal from the AND gate 102, the driver 105 activates the keyboard matrix 10.
6 to the internal register 107 via the bus line 10.
Send to. AND gate 102 is address decoder 1
When the output signal 12 of 01 and the read (READ) signal 17 from the microprocessor 100 are input, the enable signal 14 is output. AND gate 103 outputs clock signal 15 when output signal 13 of address decoder 101 and write (WRITE) signal 16 from microprocessor 100 are input.

アドレスデコーダ101はマイクロプロセツサ100か
らの番地情報11をデコードして出力信号12,13を
選択的に出力する。なお、キーボードマトリツクス10
6の入力線104−0,104−1〜104−7と出力
線105−0,105−1〜105−7の各交点にはそ
れぞれキーが配されており、各交点は通常オフ状態で、
キーを操作、つまり押圧されることによりオン状態にな
る。
Address decoder 101 decodes address information 11 from microprocessor 100 and selectively outputs output signals 12 and 13. In addition, keyboard matrix 10
A key is arranged at each intersection of the input lines 104-0, 104-1 to 104-7 and the output lines 105-0, 105-1 to 105-7 of No. 6, and each intersection is normally in an off state.
It turns on when the key is operated, that is, pressed.

この実施例では出力線105−0,105−1〜105
−7の出力は通常(オフ状態)論理ゞ1″にしておき、
かつレジスタ104の各ビツトの出力を通常(オフ状態
)論理ゞ0Iにしておく。そしてキーを操作すると、そ
の操作されたキーに対応する交点を通る出力線の出力が
論理ゞ0Iとなるようにしている。すなわち、論理ゞ0
′5を有意に設定している。そうして、第2図のフロー
チヤートで示すような動作をマイクロプロセツサ100
で行なわせることによつて操作されたキー、つまりキー
ボードマトリツクス106のキー操作されている位置を
ソフトウエア的にマイクロプロセツサ100が検出する
ようにしている。以下、マイクロプロセツサ100によ
るキー操作されている位置の検出動作について第2図の
フローチヤートを参照して説明する。
In this embodiment, output lines 105-0, 105-1 to 105
-7 output is normally (off state) logic ゜1'',
In addition, the output of each bit of the register 104 is set to the normal (off state) logic 0I. When a key is operated, the output of the output line passing through the intersection corresponding to the operated key becomes logic 0I. In other words, logic ゞ0
'5 is set to be significant. Then, the microprocessor 100 performs the operation shown in the flowchart of FIG.
This causes the microprocessor 100 to detect the operated key, that is, the position of the key operated key on the keyboard matrix 106 using software. Hereinafter, the operation of detecting the position where a key is operated by the microprocessor 100 will be explained with reference to the flowchart of FIG.

まず、キーボードを働かせる前に、マイクロプロセツサ
100は内部レジスタ107の全ビツトに論理ゞO″の
データを書込み(ステツプ200)、その内部レジスタ
107のデータをレジスタ104に書込む(ステツプ2
01)。
First, before operating the keyboard, the microprocessor 100 writes logic O'' data to all bits in the internal register 107 (step 200), and writes the data in the internal register 107 to the register 104 (step 2).
01).

これによつて、レジスタ104の全ビツトが論理ゞ0″
となるから、キーボードマトリツクス106上のキーを
選択操作すれば出力線105−0,105−1〜105
−7のいずれかの出力が論理″O″となる。そこで、キ
ーが操作されているか否かを判定するため、マイクロプ
ロセツサ100はドライバ105からバスライン10を
介して内部レジスタ107へキーボードマトリツクス1
06の出力を読込み(ステツプ202)、その読取つた
出力に論理′O″のビツトが含まれているか否、換言す
れば全ビツトが論理′1″か否かを判別する(ステツプ
203)。
This causes all bits of register 104 to become logic 0''.
Therefore, if a key on the keyboard matrix 106 is selected, the output lines 105-0, 105-1 to 105
-7 either output becomes logic "O". Therefore, in order to determine whether or not a key is being operated, the microprocessor 100 sends the keyboard matrix 1 from the driver 105 to the internal register 107 via the bus line 10.
06 is read (step 202), and it is determined whether or not the read output contains logic 'O' bits, in other words, whether all bits are logic '1' (step 203).

全ビツト論理ゞ1″の場合には、つまりキーが操作され
ていない場合には、マイクロプロセツサ100の動作を
ステツプ202に戻る。したがつて、ステツプ202,
203はキーが操作されるまで繰返し行なわれる。ステ
ツプ203でマイクロプロセツサ100は読取つたキー
ボードマトリツクス106の出力に論理ゞ02のビツト
が含まれていることを検出すると、つまりキーが操作さ
れたことを検出すると、どのキーが操作されたかを判別
するため、まず内部レジスタ107に最下位桁のビツト
のみが論理′O″のデータ、つまり「11・・・10」
のデータを書込み(ステツプ204)、そのデータをバ
スライン10を介してレジスタ104に書込む(ステツ
プ205)。
If all bits are logic 1'', that is, if no key is operated, the operation of the microprocessor 100 returns to step 202. Therefore, steps 202,
Step 203 is repeated until a key is operated. In step 203, when the microprocessor 100 detects that the read output of the keyboard matrix 106 contains a logic 02 bit, that is, when it detects that a key has been operated, it determines which key was operated. To make the determination, first, data is stored in the internal register 107 in which only the least significant bit is logic 'O', that is, '11...10'.
(Step 204), and the data is written to the register 104 via the bus line 10 (Step 205).

そして、マイクロプロセツサ100はドライバ105か
ら入力線104−0に位置するキーボードマトリツクス
106の出力を内部レジスタ107に読込み(ステツプ
206)、その読取つたデータ論理ゞ0″のビツトが含
まれているか否か、つまり全ビツトが論理1か否かを判
別する(ステツプ207)。そして、全ビツトが論理ゞ
1″の場合には、マイクロプロセツサ100はレジスタ
104内のデータの論理″′O″のビツト位置を一桁シ
フトしたデータつまり「11・・・101」を内部レジ
スタ107に書込み(ステツプ208)、動作をステツ
プ205へ戻す。そして、マイクロプロセツサ100は
次の入力線104−1に位置するキーボードマトリツク
ス106の出力を読取り、判別を行なう。したがつて、
ステツプ207で論理SO″のビツトを検出するまでは
ステツプ205からステツプ208の動作が繰返し行な
われる。そして、ステツプ207で論理SO″のビツト
を検出したら、マイクロプロセツサ100はそのときに
内部レジスタ107に保持しているデータと、ドライバ
105から読込んだデータとで操作されているキーを識
別し、それを表示すると共にその操作されたキーの指示
を実行し、それが完了後動作をステツプ200へ戻し、
次のキー操作を待機する。以上で明らかなように、本発
明によれば、キーイン要求、つまりキーが操作されたか
否かをステツプ202,203のループで判別する。
Then, the microprocessor 100 reads the output of the keyboard matrix 106 located on the input line 104-0 from the driver 105 into the internal register 107 (step 206), and determines whether the read data contains a logic 0'' bit. In other words, it is determined whether all the bits are logic 1 (step 207).If all the bits are logic 1, the microprocessor 100 sets the data in the register 104 to logic ``O''. The data obtained by shifting the bit position by one digit, ie, "11...101" is written into the internal register 107 (step 208), and the operation returns to step 205. The microprocessor 100 then reads the output of the keyboard matrix 106 located on the next input line 104-1 and makes a determination. Therefore,
The operations from step 205 to step 208 are repeated until the bit of logic SO'' is detected in step 207. When the bit of logic SO'' is detected in step 207, the microprocessor 100 then registers internal register 107. The key being operated is identified based on the data stored in the data stored in the driver 105 and the data read from the driver 105, and the key being operated is displayed and the instruction of the operated key is executed.After this is completed, the operation proceeds to step 200. Return to
Waits for the next keystroke. As is clear from the above, according to the present invention, a key-in request, that is, whether or not a key has been operated is determined in a loop of steps 202 and 203.

従来はステツプ205〜208のループでそれを行つて
いるが、このループでは前述のキーボードマトリツクス
106を一通りスキヤンするだけでも前記ループを8回
実行しなければならない。従つて単純に考えた場合、本
発明によればキーイン要求の判別を短いステツプ数のル
ープで、しかも1/8程度の少い頻度でポーリングすれ
ばよいので、ソフトウエアの負担が小さく、その分他の
処理を実行する時間を大きくすることができるものであ
る。
Conventionally, this has been done in a loop of steps 205 to 208, but in this loop, the loop must be executed eight times just to scan the keyboard matrix 106 mentioned above. Therefore, when considered simply, according to the present invention, key-in requests can be determined in a loop with a short number of steps, and polling can be performed at a frequency as low as 1/8, which reduces the burden on the software. This allows more time to execute other processes.

【図面の簡単な説明】[Brief explanation of drawings]

第1図は本発明の一実施例を説明するためのプロツク線
図、第2図は同実施例の動作を説明するためのフローチ
ヤートである。 100・・・・・・マイクロプロセツサ、101・・・
・・・デコーダ、102,103・・・・・・アンドゲ
ート、104・・・・・・レジスタ、105・・・・・
・ドライバ、106・・・・・・キーボードマトリツク
ス、107・・・・・・内部レジスタ。
FIG. 1 is a block diagram for explaining an embodiment of the present invention, and FIG. 2 is a flowchart for explaining the operation of the embodiment. 100...Microprocessor, 101...
...Decoder, 102, 103...And gate, 104...Register, 105...
- Driver, 106...Keyboard matrix, 107...Internal register.

Claims (1)

【特許請求の範囲】[Claims] 1 プロセッサと、キーボードマトリックスと、このキ
ーボードマトリックスの各入力線に各ビッドを対応接続
して設けたレジスタと、前記キーボードマトリツクスの
各出力線に接続して設けたドライバとを具備し、前記レ
ジスタの全ビットに前記プロセッサから有意のデータを
書込んでおき、キーイン状態を前記プロセッサが所定の
間隔で前記キーボードマトリックスの出力を前記ドライ
バを介して読取ることにより検出し、その読取つた出力
中に有意のビットを検出したら、前記プロセッサは前記
レジスタに1ビットのみ有意にしたデータを、順次その
有意なビット位置を異ならせて書込み、その書込みの都
度、前記レジスタによつて指定された入力線に位置する
前記キーボードマトリックスの出力を前記ドライバを介
して読取り、その読取つた出力中に有意のビットを検出
した時、前記レジスタの書込みに用いられたデータおよ
び読取りデータから前記キーポードマトリックスのキー
操作されている位置を織別することを特徴とするキーボ
ード制御方式。
1 comprising a processor, a keyboard matrix, a register provided by connecting each bit to each input line of the keyboard matrix, and a driver provided connected to each output line of the keyboard matrix, Significant data is written from the processor to all bits of the keyboard matrix, and the processor detects the key-in state by reading the output of the keyboard matrix at predetermined intervals via the driver, and detects the key-in state by reading the output of the keyboard matrix at predetermined intervals. When the processor detects the bit, the processor writes data in which only one bit is made significant to the register, sequentially changing the significant bit position, and each time writes data to the input line specified by the register. The output of the keyboard matrix is read through the driver, and when a significant bit is detected in the read output, the keys of the keyboard matrix are operated based on the data used to write the register and the read data. A keyboard control method characterized by differentiating positions.
JP54167762A 1979-12-24 1979-12-24 Keyboard control method Expired JPS5911931B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP54167762A JPS5911931B2 (en) 1979-12-24 1979-12-24 Keyboard control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP54167762A JPS5911931B2 (en) 1979-12-24 1979-12-24 Keyboard control method

Publications (2)

Publication Number Publication Date
JPS5690332A JPS5690332A (en) 1981-07-22
JPS5911931B2 true JPS5911931B2 (en) 1984-03-19

Family

ID=15855617

Family Applications (1)

Application Number Title Priority Date Filing Date
JP54167762A Expired JPS5911931B2 (en) 1979-12-24 1979-12-24 Keyboard control method

Country Status (1)

Country Link
JP (1) JPS5911931B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61167731A (en) * 1985-01-21 1986-07-29 Showa Mfg Co Ltd Gas charging structure of hydraulic damper
JPS61139328U (en) * 1985-02-19 1986-08-29

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61167731A (en) * 1985-01-21 1986-07-29 Showa Mfg Co Ltd Gas charging structure of hydraulic damper
JPS61139328U (en) * 1985-02-19 1986-08-29

Also Published As

Publication number Publication date
JPS5690332A (en) 1981-07-22

Similar Documents

Publication Publication Date Title
CA1121068A (en) Microcontroller for disk files
KR900015008A (en) Data processor
US4047245A (en) Indirect memory addressing
JPS59210486A (en) Display controller
JPS5911931B2 (en) Keyboard control method
WO2001024007A3 (en) Method and apparatus for processing errors in a computer system
CA1252573A (en) Dual bus system
JP2553200B2 (en) Information processing device
JP2665836B2 (en) Liquid crystal display controller
JP2574821B2 (en) Direct memory access controller
JP2560312B2 (en) Information processing system
JPS5955546A (en) Firmware processor
JP2987281B2 (en) Processor
JP2520173B2 (en) Programmable controller bit processor
JPS6362065A (en) Data transfer control system
KR0162763B1 (en) Apparatus and method for implementing the configuration space of a pci device using mux
JPH0217552A (en) Performance data measuring system
JP3293144B2 (en) Peripheral control device
SU1246140A1 (en) Storage with program correction
KR920004406B1 (en) Dual-port ram accessing control circuit
KR900003621Y1 (en) Data exchange apparatus among different processors
JP2990099B2 (en) Trace buffer control method
JP2968636B2 (en) Microcomputer
JPH04241622A (en) Microprocessor
JPS6251475B2 (en)