JPH0444112A - Key input processing circuit - Google Patents
Key input processing circuitInfo
- Publication number
- JPH0444112A JPH0444112A JP2153533A JP15353390A JPH0444112A JP H0444112 A JPH0444112 A JP H0444112A JP 2153533 A JP2153533 A JP 2153533A JP 15353390 A JP15353390 A JP 15353390A JP H0444112 A JPH0444112 A JP H0444112A
- Authority
- JP
- Japan
- Prior art keywords
- data
- register
- key input
- microcomputer
- key
- 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.)
- Pending
Links
Landscapes
- Input From Keyboards Or The Like (AREA)
Abstract
(57)【要約】本公報は電子出願前の出願データであるた
め要約のデータは記録されません。(57) [Summary] This bulletin contains application data before electronic filing, so abstract data is not recorded.
Description
【発明の詳細な説明】
〈産業上の利用分野〉
本発明は、キー入力データをマイクロコンピュータ−に
より読み取るためのキー入力処理回路に関する。DETAILED DESCRIPTION OF THE INVENTION <Industrial Application Field> The present invention relates to a key input processing circuit for reading key input data by a microcomputer.
〈従来の技術〉
マトリックス状に配置されたキーボードにおいて、押下
されたキーに対応するデータをマイクロコンピュータ−
により読み取り処理する場合、キーの押下に伴うチャタ
リングの除去と、押下されたキーに対応するデータを正
しく得ることとが必要である。<Prior art> In a keyboard arranged in a matrix, data corresponding to pressed keys is sent to a microcomputer.
When performing reading processing using , it is necessary to eliminate chattering that accompanies key presses and to correctly obtain data corresponding to the pressed keys.
従来、これらの要求は、ソフトウェアとハードウェアと
の組み合わせにより実現されており、コストの低域には
ソフトウェアを主体とし、高速化およびソフトウェアの
負荷軽減には、ハードウェアを主体とする対策が採られ
ている。Traditionally, these requirements have been achieved through a combination of software and hardware, with software being the main focus for low cost measures, and hardware-based measures for increasing speed and reducing the software load. It is being
このような状況下にあって、ソフトウェアの負荷を極力
軽減しつつチャタリング除去と、キー状態の変化検出と
を実現するハードウェア主体の主入力処理回路は、例え
ば特開昭62−31416号公報に開示されている。Under these circumstances, a hardware-based main input processing circuit that eliminates chattering and detects changes in key states while reducing the software load as much as possible is disclosed in, for example, Japanese Patent Laid-Open No. 62-31416. Disclosed.
〈発明が解決しようとする課題〉
ここに開示されたキー入力処理回路は、ラッチ手段にキ
ーボードの全キーの状態がラッチされる構成であるため
に、ラッチ手段の容量が多く必要である上に、押下さた
キーに対応するデータを得るためにはキーボードにおけ
る行線の数だけマイクロコンピュータ−の読み取りが必
要となり、ソフトウェアの負荷が充分に軽減されている
とは言い難い。<Problems to be Solved by the Invention> Since the key input processing circuit disclosed herein has a configuration in which the states of all keys on the keyboard are latched in the latch means, the latch means requires a large capacity and also has a large capacity. In order to obtain data corresponding to a pressed key, the microcomputer must read as many lines as there are rows on the keyboard, and it cannot be said that the software load is sufficiently reduced.
本発明はかかる事情に鑑みて創案されたものであって、
小容量のラッチ手段でチャタリングが除去でき、しかも
、マイクロコンピュータ−による僅かの回数の読み取り
で、押下されたキーに対応するデータを正確に得ること
ができるキー入力処理回路を提供することを目的とする
。The present invention was created in view of such circumstances, and
It is an object of the present invention to provide a key input processing circuit that can eliminate chattering using a small-capacity latch means, and that can accurately obtain data corresponding to a pressed key with a small number of readings by a microcomputer. do.
〈課題を解決するための手段〉
本発明にかかるキー入力処理回路は、マトリックス状に
配置されたキーボードから、押下されたキーに対応する
データを検知する手段と、検知されたデータを、チャタ
リング発生時間より長い時間経過した後に2段にラッチ
する手段と、2段にラッチされたデータを比較する手段
と、比較されたデータが一致したときにそのデータをラ
ッチすると共に、そのデータをマイクロコンピュータ−
により読み取るべく、該マイクロコンピュータ−に割り
込み信号を出力する手段とを具備することを特徴として
いる。<Means for Solving the Problems> The key input processing circuit according to the present invention includes a means for detecting data corresponding to a pressed key from a keyboard arranged in a matrix, and a means for detecting data corresponding to a pressed key from a keyboard arranged in a matrix. means for latching the data in two stages after a time longer than the time has elapsed, means for comparing the data latched in the two stages, and means for latching the data when the compared data match, and transmitting the data to the microcomputer
It is characterized by comprising means for outputting an interrupt signal to the microcomputer so as to be read by the microcomputer.
〈作用〉
検知されたデータを、チャタリング発生時間より長い時
間経過した後にラッチするので、チャタリングが除去さ
れる。データのラッチを2段に行い、両データが一致し
たときにそのデータがマイクロコンピュータ−により読
み取られるので、押下されたキーに対応するデータを正
確に得ることができる。押下されたキーに対応するデー
タのみをラッチするので、ラッチ手段の容量を小さくで
きる。マイクロコンピュータ−に割り込みがかかったと
きにラッチデータの読み取りが行われるので、ソフトウ
ェアの負荷が軽減される。<Operation> Since the detected data is latched after a time longer than the chattering occurrence time has elapsed, chattering is eliminated. Data is latched in two stages, and when both data match, the data is read by the microcomputer, so it is possible to accurately obtain data corresponding to the pressed key. Since only the data corresponding to the pressed key is latched, the capacity of the latching means can be reduced. Since the latch data is read when the microcomputer is interrupted, the software load is reduced.
〈実施例〉
以下、図面を参照して本発明の詳細な説明する。第1図
は本発明の一実施例を示すキー入力処理回路のブロック
図、第2図はその動作を説明するためのタイミングチャ
ートである。<Example> Hereinafter, the present invention will be described in detail with reference to the drawings. FIG. 1 is a block diagram of a key input processing circuit showing one embodiment of the present invention, and FIG. 2 is a timing chart for explaining its operation.
マトリックス状に配置されたキーボード1からの入力信
号を処理するこのキー入力処理回路は、二種類のクロッ
クを発信するクロック発生部2を有する。クロック発生
部2が発信する第1のクロックは、チャタリング発生時
間より充分に長い周期を持つクロックで、カウンタ3に
送出され、第2のクロックは、チャタリング発生時間よ
り短い周期を持つクロックで、シフトレジスタ9に送出
される。This key input processing circuit that processes input signals from a keyboard 1 arranged in a matrix has a clock generator 2 that generates two types of clocks. The first clock generated by the clock generator 2 has a cycle sufficiently longer than the chattering occurrence time, and is sent to the counter 3, and the second clock has a cycle shorter than the chattering occurrence time, and is sent to the counter 3. Sent to register 9.
カウンタ3は、クロック発生部2から入力される第1の
クロックにより、ゼロから決められた値までカウントア
ツプするのを繰り返す。決められた値とは、キーボード
1の行数により決まる値で、4行までなら1.8行まで
なら2.16行までなら3となる。カウンタ3の出力は
、トランスペアレントラッチ4を通ってデコーダ5と、
レジスタ10.11とに送出される。The counter 3 repeatedly counts up from zero to a predetermined value in response to the first clock input from the clock generator 2. The determined value is a value determined by the number of lines on the keyboard 1, and is 1 for up to 4 lines, 2 for up to 8 lines, and 3 for up to 16 lines. The output of the counter 3 passes through a transparent latch 4 to a decoder 5.
The data is sent to registers 10 and 11.
トランスペアレントラッチ4は、後述するキー入力検知
回路8の出力がローレベルのときはカウンタ3からのデ
ータを通過させ、ハイレベルのときはカウンタ3のデー
タを保持するように機能する。デコーダ5は、トランス
ペアレントラッチ4の出力を入力としてデコードし、キ
ーボード1の各行を時分割的にローレベルにすることに
より、キーボード10行線スキャンを行う。デコーダ5
の大きさもキーボード■の行数により決まり、例えば8
行なら3t08のものが必要になる。The transparent latch 4 functions to pass data from the counter 3 when the output of a key input detection circuit 8, which will be described later, is at a low level, and to hold the data from the counter 3 when the output is at a high level. The decoder 5 inputs and decodes the output of the transparent latch 4, and sets each row of the keyboard 1 to a low level in a time-division manner, thereby scanning the 10 rows of the keyboard. Decoder 5
The size of is also determined by the number of lines on the keyboard, for example 8
For rows, 3t08 is required.
キーボード1の各列からの信号は、入力バッファ6を通
ってエンコーダ7とキー入力検知回路8とに入力される
。キーボード1のキーが押下されていない場合は、キー
入力検知回路8への1入力が全てハイレベルになる。キ
ー入力検知回路8は、このときに出力Cがローレベルに
なってシフトレジスタ9をクリア状態にすると共に、ト
ランスペアレントラッチ4がカウンタ3のデータを透過
的に通過させる状態にする。キーが押下された場合は、
キー入力検知回路8は、出力Cがハイレベルとなり、シ
フトレジスタ9のクリア状態を解除すると共に、トラン
スペアレントラッチ4を保持動作にし、その行線スキャ
ン動作を停止させる。Signals from each column of the keyboard 1 pass through an input buffer 6 and are input to an encoder 7 and a key input detection circuit 8. When no key on the keyboard 1 is pressed, all inputs to the key input detection circuit 8 become high level. At this time, the output C of the key input detection circuit 8 becomes low level, clearing the shift register 9, and setting the transparent latch 4 to transparently pass the data of the counter 3. If a key is pressed,
The output C of the key input detection circuit 8 becomes high level, and the clear state of the shift register 9 is released, and the transparent latch 4 is put into a holding operation, and its row line scanning operation is stopped.
入力ハッファ6を通ってエンコーダ7に入力されるキー
ボード1の各列からの信号は、レジスタ10.11に送
出される。The signals from each column of the keyboard 1, which are input to the encoder 7 through the input huffer 6, are sent to a register 10.11.
シフトレジスタ9は、クリア状態が解除されることによ
り、クロック発生部2が発信する第2のクロックのカウ
ントを開始し、一定数のクロックをカウントすると、第
1の出力dがローレベルからハイレベルに変化してエン
コーダ7内のデータをレジスタ10にラッチさせる。こ
のときのカウント時間(第2図のTl)は、チャタリン
グの発生時間より長くされている。シフトレジスタ9が
さらに一定数のクロックをカウントすると(カウント時
間は第2図のT2)、シフトレジスタ9は、第2の出力
eがローレベルからハイレベルに変化してエンコーダ7
内のデータをレジスタ11にラッチさせる。When the clear state is released, the shift register 9 starts counting the second clock transmitted by the clock generator 2, and when a certain number of clocks are counted, the first output d changes from a low level to a high level. The data in the encoder 7 is latched into the register 10. The count time (Tl in FIG. 2) at this time is set longer than the chattering occurrence time. When the shift register 9 further counts a certain number of clocks (count time is T2 in FIG. 2), the second output e of the shift register 9 changes from low level to high level and outputs the second output e to the encoder 7.
The data in the register 11 is latched.
レジスタ10内のデータfはコンパレータ12と3段目
のレジスタ13とに送出され、レジスタ11内のデータ
gはコンパレータ12のみに送出される。Data f in register 10 is sent to comparator 12 and third stage register 13, and data g in register 11 is sent only to comparator 12.
コンパレータ12はレジスタ10.11にラッチされた
データf、gを比較し、データf、gが一致したときに
出力りがローレベルからハイレベルに変化する。ハイレ
ベルに変化したコンパレータI2の出力りは、3段目の
レジスタ13のラッチ信号になってレジスタ10内のデ
ータを3段目のレジスタ13にラッチさせると共に、フ
リップフロップ(FF)14のクロック入力となり、フ
リップフロップ(FF)14の出力jをローレベルから
ハイレベルに変化させる。The comparator 12 compares the data f and g latched in the registers 10 and 11, and when the data f and g match, the output changes from low level to high level. The output of the comparator I2 that has changed to a high level becomes a latch signal for the third stage register 13, causing the data in the register 10 to be latched into the third stage register 13, and also serves as a clock input to the flip-flop (FF) 14. Therefore, the output j of the flip-flop (FF) 14 is changed from low level to high level.
ハイレベルに変化したフリップフロップ(FF)14の
出力jは、マイクロコンピュータ−への割り込み信号I
NTになる。マイクロコンピュータ−は、キー入力があ
ったこ七を、割り込み信号INTを受けることで知り、
レジスタ13のセレクト信号!により、キー入力データ
を得るためにレジスタ13に割り当てられた番地を読む
。このとき、マイクロコンピュータ−からのリードスト
ローブ信号kがローレベルになり、レジスタ13内のデ
ータjがマイクロコンピュータ−のデータバスに出力さ
れることにより、マイクロコンピュータ−はキー入力に
対応したデータを得る。同時に、リートストローブ信号
には、フリップフロップ(FF)14をリセッ1〜し、
割り込み信号INTを解除すると共に、レジスタ11の
内容をクリアしてその出力gをゼロとする。The output j of the flip-flop (FF) 14 that has changed to high level is an interrupt signal I to the microcomputer.
Become an NT. The microcomputer knows when a key has been input by receiving the interrupt signal INT.
Select signal for register 13! The address assigned to register 13 is read in order to obtain key input data. At this time, the read strobe signal k from the microcomputer becomes low level, and the data j in the register 13 is output to the data bus of the microcomputer, so that the microcomputer obtains data corresponding to the key input. . At the same time, in response to the REIT strobe signal, the flip-flop (FF) 14 is reset to 1.
At the same time as canceling the interrupt signal INT, the contents of the register 11 are cleared and its output g is set to zero.
キーボード1におけるキーが押下されていない場合、キ
ー入力検知回路8への入力は全てハイレベルになり、そ
の出力Cはローレベルになる。従って、トランスペアレ
ントラッチ4は、カウンタ3からのデータを透過的に通
過させる状態にあり、シフトレジスタ9はクリア状態に
ある。トランスペアレントラッチ4がカウンタ3からの
データを透過的に通過させることにより、デコーダ5が
キーボード1の各行を時分割的にローレベルにし、キー
ボード1の行線スキャンを行う。When no key on the keyboard 1 is pressed, all inputs to the key input detection circuit 8 are at high level, and its output C is at low level. Therefore, the transparent latch 4 is in a state of transparently passing data from the counter 3, and the shift register 9 is in a clear state. By transparently passing the data from the counter 3 through the transparent latch 4, the decoder 5 sets each row of the keyboard 1 to a low level in a time-divisional manner, and scans the rows of the keyboard 1.
今、デコーダ5によりローレベルにされた行線a上のキ
ーが押下されると、押下されたキーに対応する列線の信
号すがチャタリングを含んだ状態で、入力ハッファ6を
通ってエンコーダ7とキー入力検知回路8とに入力され
る。信号すがキー入力検知回路8に入力されることによ
り、キー入力検知回路8の出力Cがハイレベルとなり、
シフトレジスタ9のクリア状態が解除されると共に、ト
ランスペアレントラッチ4が保持動作に入り、デコーダ
5による行線スキャンが停止する。Now, when the key on the row line a that has been set to low level by the decoder 5 is pressed, the signal on the column line corresponding to the pressed key passes through the input buffer 6 and is sent to the encoder 7 with chattering. and is input to the key input detection circuit 8. By inputting the signal to the key input detection circuit 8, the output C of the key input detection circuit 8 becomes high level.
At the same time that the clear state of the shift register 9 is released, the transparent latch 4 enters the holding operation, and the row line scan by the decoder 5 is stopped.
シフトレジスタ9のクリア状態が解除されることにより
、クロック発生部2からの第2クロツクによりシフI・
レジスタ9が動作を始め、シフトレジスタ9に一定数の
クロックが入力されると(時間として第2図のTI)、
シフトレジスタ9の第1の出力dがローレベルからハイ
レベルに変化する。この出力dの立ち上がりエツジによ
り、トランスペアレントラ・ンチ4に保持されているカ
ウンタ3の出力データと、エンコーダ7にエンコードさ
れた列線の信号すとがレジスタ10にラッチされる。列
線の信号すがキー入力検知回路8に入力されてから、そ
れがレジスタ10に入力されるまでの間に、信号す内の
チャタリングが消滅するので、レジスタ10にラッチさ
れる列線の信号すにチャタリングは含まれていない。When the clear state of the shift register 9 is released, the second clock from the clock generator 2 causes the shift I.
When the register 9 starts operating and a certain number of clocks are input to the shift register 9 (TI in FIG. 2 as time),
The first output d of the shift register 9 changes from low level to high level. By this rising edge of the output d, the output data of the counter 3 held in the transparent transistor 4 and the column line signal encoded by the encoder 7 are latched into the register 10. Since the chattering in the column line signal disappears between the time the column line signal is input to the key input detection circuit 8 and the time it is input to the register 10, the column line signal latched by the register 10 Does not include chattering.
シフトレジスタ9へさらに一定数のクロックが入力され
ると(時間として第2図のT2)、シフトレジスタ9の
第2の出力eがローレベルからハイレベルに変化する。When a fixed number of clocks are further input to the shift register 9 (time T2 in FIG. 2), the second output e of the shift register 9 changes from low level to high level.
この出力eの立ち上がりエツジにより、トランスペアレ
ントラッチ4に保持されているカウンタ3の出力データ
と、エンコーダ7にエンコードされた列線の信号すとが
レジスタ11にラッチされる。レジスタ11にラッチさ
れる列線の信号すにもチャタリングは含まれていない。By this rising edge of the output e, the output data of the counter 3 held in the transparent latch 4 and the column line signal encoded by the encoder 7 are latched into the register 11. The column line signals latched in the register 11 also do not contain chattering.
レジスタ10にラッチされたデータfとレジスタ11に
ラッチされたデータgとが一致すると、コンパレータ1
2の出力りがローレベルからハイレベルに変化する。コ
ンパレータ12の出力りがハイレベルに変化することに
より、3段目のレジスタ13にレジスタ10内のデータ
がラッチされると共に、フリップフロップ(FF)14
の出力jがローレベルからハイレベルに変化する。When data f latched in register 10 and data g latched in register 11 match, comparator 1
The output of 2 changes from low level to high level. As the output of the comparator 12 changes to high level, the data in the register 10 is latched into the third stage register 13, and the flip-flop (FF) 14
The output j changes from low level to high level.
フリップフロップ(FF)14の出力jがハイレベルに
変化することにより、マイクロコンピュータ−へ割り込
み信号INTが入り、これにより、マイクロコンピュー
タ−は、キー入力データを得るためにレジスタ13に割
り当てられた番地を読む。When the output j of the flip-flop (FF) 14 changes to high level, an interrupt signal INT is input to the microcomputer, which causes the microcomputer to read the address assigned to the register 13 to obtain key input data. I Read.
このとき、マイクロコンピュータ−からのリードス1−
ローブ信号kがローレベルになり、レジスタ13内のデ
ータiがマイクロコンピュータ−のデータバスに出力さ
れることにより、マイクロコンピュータ−はキー入力に
対応したデータを得る。同時に、フリップフロップ(F
F)14がリセットされ、割り込み信号INTが解除さ
れると共に、レジスタ11の内容がクリアされる。At this time, lead source 1 from the microcomputer
When the lobe signal k becomes low level and the data i in the register 13 is output to the data bus of the microcomputer, the microcomputer obtains data corresponding to the key input. At the same time, flip-flop (F
F) 14 is reset, the interrupt signal INT is released, and the contents of the register 11 are cleared.
レジスタ11の内容がクリアされることで、次9回のキ
ー入力値が今回の値と同じであっても、正しい処理が可
能になる。By clearing the contents of the register 11, correct processing is possible even if the next nine key input values are the same as the current value.
レジスタ10にラッチされたデータfとレジスタ11に
ラッチされたデータgとが一致しない場合は、コンパレ
ータ12の出力りがローレベルのままとなり、3段目の
レジスタ13にレジスタ10内のデータはラッチされな
い。また、フリップフロップ(FF)14の出力jがロ
ーレベルのままに維持されるので、マイクロコンピュー
タ−へ割り込み信号INTは入らず、マイクロコンピュ
ータ−によるキー入力の読み取りは行われない。If the data f latched in the register 10 and the data g latched in the register 11 do not match, the output of the comparator 12 remains at a low level, and the data in the register 10 is latched into the third stage register 13. Not done. Furthermore, since the output j of the flip-flop (FF) 14 is maintained at a low level, no interrupt signal INT is input to the microcomputer, and no key input is read by the microcomputer.
キーの押下が解除されると、キー入力検知回路8の出力
Cがローレベルに戻り、シフトレジスタ9はクリア状態
になる。同一時に、トランスペアレントラッチ4は透過
状態になる。これにより、デコーダ5による行線スキャ
ンが再開され、キー入力の可能な状態になる。When the key press is released, the output C of the key input detection circuit 8 returns to a low level, and the shift register 9 becomes a clear state. At the same time, the transparent latch 4 becomes transparent. As a result, the row line scan by the decoder 5 is restarted, and the state becomes ready for key input.
マイクロコンピュータ−のデータバスに出力されるレジ
スタ13内のデータiにチャタリングは含まれておらず
、またキー入力信号がレジスタ10.11に2段にラッ
チされ、その二つのデータが一致したときにのみそのデ
ータがレジスタ13にラッチされるので、押下されたキ
ーに対応するデータがマイクロコンピュータ−により正
確に読み取られる。しかも、正確な読み取りの行われる
構成でありながら、押下されたキーに対応するデータの
みをラッチするので、レジスタの容量が小さくなり、さ
らには、マイクロコンピュータ−に割り込みがかかった
ときにレジスタを読むだけでデータが得られるために、
ソフトウェアの負荷も軽減される。The data i in the register 13 that is output to the data bus of the microcomputer does not contain any chattering, and the key input signal is latched in two stages in the registers 10 and 11, and when the two data match, Since the data is latched in the register 13, the data corresponding to the pressed key can be accurately read by the microcomputer. Furthermore, although the configuration allows for accurate reading, only the data corresponding to the pressed key is latched, so the capacity of the register is reduced, and furthermore, it is possible to read the register when the microcomputer receives an interrupt. Because data can be obtained only by
The software load is also reduced.
第3図は本発明の別の実施例を示すキー入力処理回路の
ブロック図、第4図はその動作を説明するためのタイミ
ングチャートである。FIG. 3 is a block diagram of a key input processing circuit showing another embodiment of the present invention, and FIG. 4 is a timing chart for explaining its operation.
このキー入力処理回路は、第1図および第2図に示した
キー入力処理回路のレジスタ13およびフリップフロッ
プ(FF)14をファーストインファーストアウトレジ
スタ(FIFOレジスタ)15に置き変えた構成になっ
ている。This key input processing circuit has a configuration in which the register 13 and flip-flop (FF) 14 of the key input processing circuit shown in FIGS. 1 and 2 are replaced with a first-in-first-out register (FIFO register) 15. There is.
FIFOレジスタ15は、コンパレータ12の出力りを
ラッチ信号として入力する構成で、レジスタ10.11
にラッチされたデータf、gが一致してコンパレータ1
2の出力りがローレベルからハイレベルに変化したとき
に、レジスタ10内のデータをラッチする。レジスタ1
0内のデータがFIFOレジスタ15にラッチされると
、FIFOレジスタ15の出力(データがラッチされて
いることを示す信号)mがローレベルからハイレベルに
変化し、これかマイクロコンピュータ−に対する割り込
み信号INTとなる。The FIFO register 15 has a configuration in which the output of the comparator 12 is input as a latch signal, and
When data f and g latched in match, comparator 1
When the output of the register 2 changes from low level to high level, the data in the register 10 is latched. register 1
When the data in 0 is latched into the FIFO register 15, the output m of the FIFO register 15 (signal indicating that data is latched) changes from low level to high level, which causes an interrupt signal to the microcomputer. It becomes INT.
マイクロコンピュータ−は、キー入力があったことを、
割り込の信号INTを受けることで知り、セレク1へ信
号lにより、キー入力データを得るためにFIFOレジ
スタ15に割り当てられた番地を読む。このとき、マイ
クロコンピュータ−からのり一トストローブ信号kかロ
ーレベルになり、FIFOレジスタ15内のデータiが
マイクロコンピュータ−のデータバスに出力されること
により、マイクロコンピュータ−はキー入力に対応した
ブタを得る。The microcomputer recognizes that there has been a key input.
It is known by receiving the interrupt signal INT, and the address assigned to the FIFO register 15 is read in order to obtain key input data by the signal 1 to select 1. At this time, the strobe signal k from the microcomputer becomes low level, and the data i in the FIFO register 15 is output to the data bus of the microcomputer. get.
FIFOレジスタ15からマイクロコンピュータ−へ送
られる割り込め信号INTは、マイクロコンピュータ−
がFIFOレジスタ15内のデータを読んでいるときと
、FIFOレジスタ15にラッチされているデータがな
くなったときに解除される(FIFOレジスタ15の出
力mがローレベルになる)。ただし、マイクロコンピュ
ーターがFIFOレジスタ15内のデータを読んだあと
に、FTP0レジスタ15にデータがラッチされている
ときは、この信号は再びハイレヘルになる。The interrupt signal INT sent from the FIFO register 15 to the microcomputer is
is released when reading the data in the FIFO register 15 and when there is no more data latched in the FIFO register 15 (the output m of the FIFO register 15 becomes low level). However, if the data is latched in the FTP0 register 15 after the microcomputer reads the data in the FIFO register 15, this signal becomes high level again.
キーボート1におけるキー押下が一回の場合は、第1図
および第2図のキー入力処理回路と同様に、レジスタ1
0内のデータがFIFOレジスタ15にラッチされ、マ
イクロコンピュータ−によるキー入力の読み取りが行わ
れる。このとき、FIFOレジスタ15にラッチされる
レジスタ10内のデータにチャタリングは含まれておら
ず、またキー入力信号がレジスタ10.11に2段にラ
ッチされ、その二つのデータが一致したときにのみその
データがFIFOレジスタ15にラッチされるので、押
下されたキーに対応するデータがマイクロコンピュータ
−により正確に読み取られる。また、レジスタの容量が
小さく、ソフトウェアの負担が軽減されることも第1図
および第2図のキー入力処理回路と同様である。When a key on the keyboard 1 is pressed once, the register 1
The data in 0 is latched into the FIFO register 15, and the key input is read by the microcomputer. At this time, the data in the register 10 latched in the FIFO register 15 does not contain chattering, and the key input signal is latched in two stages in the registers 10 and 11, and only when the two data match. Since the data is latched in the FIFO register 15, the data corresponding to the pressed key can be accurately read by the microcomputer. Further, the capacity of the register is small and the burden on the software is reduced, which is similar to the key input processing circuit of FIGS. 1 and 2.
1回目のキー押下によりマイクロコンピュータ−に割り
込みがかけられたときに、マイクロコンピュータ−がこ
の割り込みよりも優先度の高いブ0グラムを実行してい
て、すくにキー入力データを読み込めない状態で、2回
目、3回目のキー押下があった場合、第1図および第2
図のキー入力処理回路では、2回目、3回目のキー入力
データが欠落してしまうが、第3図および第4図のキー
入力処理回路では、そのような問題を生じることもない
。When the first key press causes an interrupt to the microcomputer, the microcomputer is executing a program with a higher priority than this interrupt and cannot read the key input data immediately. If the key is pressed for the second or third time, Figures 1 and 2 will be displayed.
In the key input processing circuit shown in the figure, the second and third key input data are lost, but in the key input processing circuits shown in FIGS. 3 and 4, such a problem does not occur.
即ら、1回目のキー入力データがFIFOレジスタ15
の1段目にラッチされ、2回目、3回目の;)−一人カ
データはFIF○レジスタ15の2段目、3段目にそれ
ぞれにラッチされる。マイクロコンピュータ−がキー入
力データを処理できる状態になり、FTFOレジスタ1
5に割り当てられた番地が読まれると、1段目のキー入
力データが得られる。これに伴って、FIFOレジスタ
15の2段目のデータが1段目に、3段目のデータが2
段目にそれぞれ順送りされ、読み込み時にローレベルに
なったFIFOレジスタ15の出力mが再びハイレヘル
になる。That is, the first key input data is stored in the FIFO register 15.
The second and third ;)-one card data are latched in the first stage of the FIF○ register 15, respectively. The microcomputer is now ready to process key input data, and the FTFO register 1
When the address assigned to 5 is read, the key input data for the first row is obtained. Along with this, the data in the second stage of the FIFO register 15 becomes the first stage, and the data in the third stage becomes the second stage.
The output m of the FIFO register 15, which has become low level during reading, becomes high level again.
これにより、マイクロコンピュータ−に再び割り込みが
かかり、FIFOレジスタ15から2回目のキー入力デ
ータがマイクロコンピュータ−に読まれる。FIFOレ
ジスタ15は2段目のデータを1段目に順送りし、マイ
クロコンピュータ−に再び割り込み信号INTを送る。As a result, the microcomputer is interrupted again, and the second key input data is read from the FIFO register 15 by the microcomputer. The FIFO register 15 sequentially sends the data in the second stage to the first stage, and sends the interrupt signal INT to the microcomputer again.
マイクロコンピュタ−は再びFIFOレジスタ15内の
データを読むことで、3回目のキー入力データを得る。The microcomputer reads the data in the FIFO register 15 again to obtain the third key input data.
3回目のキー入力データが得られると、FIF○レジス
タ15にはラッチデータが存在しなくなるので、FIF
Oレジスタ15の出力mがローレベルの状態に維持され
、次にキーに押下されるまでマイクロコンピュータ−に
割り込み信号INTが送られることはない。When the third key input data is obtained, there is no latch data in the FIF○ register 15, so the FIF
The output m of the O register 15 is maintained at a low level, and no interrupt signal INT is sent to the microcomputer until the next key is pressed.
このように第3図および第4図のキー入力処理回路は、
小容量のラッチ手段でチャタリングが除去でき、かつ、
マイクロコンピュータ−による僅かの回数の読の取りで
、押下されたキーに対応するデータを正確に得ることが
できることに加え、優先度が高く処理時間の長いプログ
ラムがマイクロコンピュータ−で実行されているときに
キー入力か複数回あっても、各データが順に保持され、
押下された順序どお/)りこ正しいデータがマイクロコ
ンピュータ−により読み取られるので、キー入力処理回
路におりるソフトウェアの負荷が軽減される。In this way, the key input processing circuits in FIGS. 3 and 4 are
Chattering can be eliminated by a small capacity latch means, and
In addition to being able to accurately obtain the data corresponding to the pressed key with only a few readings by the microcomputer, it is also useful when a program with a high priority and a long processing time is being executed on the microcomputer. Even if there are multiple keystrokes, each data is retained in sequence,
Since the correct data is read by the microcomputer in the order in which the keys were pressed, the software load on the key input processing circuit is reduced.
〈発明の効果〉
以上、本発明にかかるキー入力処理回路による場合には
、押下されたキーに対応するデータのみがラッチされる
ので、ラッチ手段の容量が小さくなり、回路の簡略化お
よびコストの低減が可能になる。マイクロコンピュータ
−に割り込みがかかったときにラッチデータの読み取り
が行われるので、ソフトウェアの負荷が軽減され、リア
ルタイム性も向上する。また、キー入力に対して、チャ
タリング発生時間より長い時間経過した後にラッチが行
われるので、チャタリングが除去される。<Effects of the Invention> As described above, in the case of the key input processing circuit according to the present invention, only the data corresponding to the pressed key is latched, so the capacity of the latching means is reduced, simplifying the circuit and reducing costs. reduction is possible. Since the latch data is read when the microcomputer is interrupted, the software load is reduced and real-time performance is improved. Furthermore, since latching is performed after a time longer than the chattering occurrence time has elapsed in response to a key input, chattering is eliminated.
データのラッチを2段に行い、両データが一致したとき
にそのデータがマイクロコンピュータ−により読み取ら
れるので、押下されたキーに対応するデータを正確に得
ることができる。Data is latched in two stages, and when both data match, the data is read by the microcomputer, so it is possible to accurately obtain data corresponding to the pressed key.
第1図は本発明の一実施例を示すキー入力処理回路のブ
ロック図、第2図はその動作を説明するためのタイミン
グチャート、第3図は本発明の別の実施例を示すキー入
力処理回路のブロック図、第4図はその動作を説明する
ためのタイミングチャートである。
1 ・ ・ ・
8 ・ ・
10.11.
12・ ・ ・
15・ ・ ・
キーボード
キー入力検知回路
13・・・レジスタ
コンパレータ
FIFOレジスタFIG. 1 is a block diagram of a key input processing circuit showing one embodiment of the present invention, FIG. 2 is a timing chart for explaining its operation, and FIG. 3 is a key input processing circuit showing another embodiment of the present invention. The block diagram of the circuit and FIG. 4 are timing charts for explaining its operation. 1 ・ ・ ・ 8 ・ ・ 10.11. 12. . . . 15. . . Keyboard key input detection circuit 13...Register comparator FIFO register
Claims (1)
下されたキーに対応するデータを検知する手段と、検知
されたデータを、チャタリング発生時間より長い時間経
過した後に2段にラッチする手段と、2段にラッチされ
たデータを比較する手段と、比較されたデータが一致し
たときにそのデータをラッチすると共に、そのデータを
マイクロコンピューターにより読み取るべく、該マイク
ロコンピューターに割り込み信号を出力する手段とを具
備してなることを特徴とするキー入力処理回路。(1) A means for detecting data corresponding to a pressed key from a keyboard arranged in a matrix, and a means for latching the detected data in two stages after a time longer than the chattering occurrence time; and means for latching the data when the compared data match and outputting an interrupt signal to the microcomputer so that the data can be read by the microcomputer. A key input processing circuit characterized by:
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2153533A JPH0444112A (en) | 1990-06-11 | 1990-06-11 | Key input processing circuit |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2153533A JPH0444112A (en) | 1990-06-11 | 1990-06-11 | Key input processing circuit |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH0444112A true JPH0444112A (en) | 1992-02-13 |
Family
ID=15564602
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2153533A Pending JPH0444112A (en) | 1990-06-11 | 1990-06-11 | Key input processing circuit |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0444112A (en) |
-
1990
- 1990-06-11 JP JP2153533A patent/JPH0444112A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JPH0444112A (en) | Key input processing circuit | |
| RU2006920C1 (en) | Device for priority interrupts | |
| JPH03223949A (en) | Bus mediation circuit | |
| JPS62279438A (en) | trace circuit | |
| JPH0758504B2 (en) | Image input device | |
| JP2804406B2 (en) | Pulse measuring device | |
| SU1636847A2 (en) | Data exchange device | |
| KR920009453B1 (en) | Bus situation analyzer | |
| US6492858B1 (en) | Semiconductor integrated circuit and method for generating a control signal therefor | |
| SU1341636A1 (en) | Program interruption device | |
| JPH0769956B2 (en) | Image input device | |
| JPS5690328A (en) | Keyboard control system | |
| SU1001105A1 (en) | Cash registor | |
| SU1387000A1 (en) | Device for generating instruction flag | |
| SU1619330A1 (en) | Device for monitoring operatorъs performance | |
| JPS6154533A (en) | Data input interface circuit | |
| SU1674140A2 (en) | Input-output interface controller | |
| SU1185343A1 (en) | Device for generating interruption signals in case of debugging programs | |
| JPH0553802A (en) | Double-reading prevention circuit of register | |
| JPH0695304B2 (en) | Data processing device | |
| JPH06325196A (en) | Bar code reader | |
| JPH05233138A (en) | Interruption signal generation circuit of coordinate input device | |
| EP0379155A2 (en) | Large scale integration circuit device | |
| JPH0340116A (en) | Timer circuit | |
| JPS63104142A (en) | Semiconductor arithmetic processor |