JPS61151726A - Key scan system - Google Patents

Key scan system

Info

Publication number
JPS61151726A
JPS61151726A JP59272947A JP27294784A JPS61151726A JP S61151726 A JPS61151726 A JP S61151726A JP 59272947 A JP59272947 A JP 59272947A JP 27294784 A JP27294784 A JP 27294784A JP S61151726 A JPS61151726 A JP S61151726A
Authority
JP
Japan
Prior art keywords
key
scan
pressed
depressed
information
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
Application number
JP59272947A
Other languages
Japanese (ja)
Inventor
Yasunori Yonezu
米津 康紀
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP59272947A priority Critical patent/JPS61151726A/en
Publication of JPS61151726A publication Critical patent/JPS61151726A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To detect quickly a depressed key by fetching a scanning in an X direction and depression information from Y direction at the same time to detect a position in the Y direction and using a scan signal based on the position so as to detect the position in the X direction. CONSTITUTION:Scan signals are outputted simultaneously from the X direction to a key input means 3 from a scanning signal output means 12, and whether or not the number of depressed keys is 1 is detected by a depressed key number detection means 13 based on the fetch information from the Y direction of the means 3. When the number of depressed key is 1, the position in the Y direction is stored by a key depressed information detecting position storage means 15 and after the scan direction is changed by a scan direction change means 14, a scan position setting means 16 outputs a scan signal from the Y direction including the position in the Y direction. Whether or not the number of depressed keys is 1 is detected by a depressed number detection means 18 based on the fetch information from the means 3 to the scan signal and when the number of depressed keys is 1, a depressed key information report means 19 reports the information of one depressed key.

Description

【発明の詳細な説明】 〔発明の利用分野〕 本発明は、マトリックス状に配置された複数のキーの何
nが押下され友かを速やかに検出するためのキースキャ
ン方式に関するものである。
DETAILED DESCRIPTION OF THE INVENTION [Field of Application of the Invention] The present invention relates to a key scanning method for quickly detecting how many keys of a plurality of keys arranged in a matrix are pressed.

〔発明の背景〕[Background of the invention]

第3図はソフトウェア処理によるキースキャン回路の一
例でのブロック構成を示したものである。
FIG. 3 shows a block configuration of an example of a key scan circuit based on software processing.

複数のキーがマトリックス状に配置されてなるキーマト
リックス3の中で、何れのキーが押下されているかをC
PU1がPIA2を介しソフトウエアスキャンニングに
よって特定して検出するようになっているものである。
C shows which key is pressed in the key matrix 3 in which multiple keys are arranged in a matrix.
The PU1 is designed to identify and detect it by software scanning via the PIA2.

なお、図中4はCPU−P I A間データバスを示す
〇 これまでソフトウェア処理によるキースキャン処理とし
ては例えは、「マイコン回路の手はどき」(白土義男著
、日本放送出版協会p147.148 )にもあるよう
に、ソフトウェアによルマトリックスの片方(例えtf
y方向)の列に順番にスキャン信号を送る鮫に逆の方向
(例えはX方向)よりキー押下信号を取り込むことKよ
って、倒れのキーが押下されたかを判断するものが知ら
れている。
Note that 4 in the figure indicates the data bus between the CPU and the PIA. Until now, key scan processing using software processing has been exemplified by "How to use microcomputer circuits" (written by Yoshio Shirato, Japan Broadcast Publishing Association, p147.148). ), one side of the le matrix (for example, tf
It is known to determine whether a down key has been pressed by taking in a key press signal from the opposite direction (for example, the X direction) to a shark that sequentially sends scan signals to columns in the y direction.

一般にこのようなキースキャン処理はキーが押下される
時点が不明であることから、周期的に行なわnる必要が
ある。ここで、キースキャン処理に要される時間t’ 
tsキースキャン処理の周期をTとすnは、ソフトウェ
ア全体の処理時間のうち約t/Tがキースキャン処理に
よって占められることKなる。ま几、キースキャン処理
は単純なものではなくキーの数が多くなる程に処理時間
も多く要されることから1例えば通信端末のようにリア
ルタイムで動作する装置ではキースキャン処理に多くの
時間が要さnているために他の処理が遅れるなど、ソフ
トウェアの処理能力に悪影響を及はしているのか実状で
ある。
Generally, such key scan processing needs to be performed periodically because the time point at which a key is pressed is unknown. Here, the time t' required for key scan processing
ts Let T be the period of the key scan process, and n means that about t/T of the entire software processing time is occupied by the key scan process. However, the key scanning process is not simple, and the more keys there are, the more processing time it takes.1 For example, in devices that operate in real time, such as communication terminals, the key scanning process takes a lot of time. The reality is that the processing power of the software is being adversely affected, such as delays in other processing due to the delay.

第4図拡間時に2個以上のキーが押下さf′Lfc場合
はそれらキーの押下は無効とされ、しかも押下キー情報
はキューに登録されるようK L7t、これまでのキー
スキャン処理の70−を示し次ものである@これKよる
とport BaからB7まで順次スキャンする場合に
、各スキャンにおいて押下されているキーが存在するか
、存在する場合には2個以上押下さnているか否かが判
定されるものとなっている。2個以上押下されているか
否かはまたスキャン間においても判定さ牡るが、このよ
うに処理する場合扛1個だけ押下され九キーが特定して
検出さn得、全スキャン終了後にその押下キー情報はキ
ューに登録さnるようになっているわけである。
If two or more keys are pressed during enlargement f'Lfc, the presses of those keys are invalidated, and the pressed key information is registered in the queue. - indicates the following @KoreK: When sequentially scanning from port Ba to B7, whether there is a key pressed in each scan, and if so, whether two or more keys are pressed. It is to be determined whether Whether two or more keys have been pressed is also determined between scans, but when processing in this way, only one key is pressed and the 9 key is specifically detected, and after all scans are completed, that key is pressed. The key information is registered in the queue.

第5図は以上の処理をハードウェア的に実施した場合で
の一例での構成を示し次ものである0これKよnは最初
にスキャン開始位置設定手段5によりスキャン開始位置
の初期設定が行なわれた後、スキャン信号出力手段6よ
りスキャン信号がキー人力手段(キーマトリックス3)
に出力されるようになっている。このスキャン信号に対
する押下キー数の検出は押下キー数検出手段7によって
行なわれるが、この検出で押下キーが1個ならばその押
下キー情報を押下キー情報記憶手段8に記憶せしめるよ
うにするものである0この後はスキャン回数の判定がス
キャン回数判定手段9により行なわれるが、もしもスキ
ャンが全て終了していない場合にはスキャン位置変更手
段10によってスキャン位置を変更し几うえ上記動作を
繰シ返すようにするものである。し7tがって、押下キ
ー情報記憶手段8には全スキャンを通じての押下キー1
個の場合でのそのキー情報が記憶されていることになる
が、これは全スキャン終了後にスキャン回数判定手段9
を介し押下キー情報報告手段117fC報告されるとこ
ろとなるものである。なお、押下キー数検出手段7にお
いてはそれまで行なわれたスキャン時での検出結果が記
憶されておシ、押下キーが1個である旨の検出結果が2
回得られ几場合には直ちにキースキャン処理動作を停止
すべく処理終了信号を発するものとなって−る・同一ス
キャンにおいて押下キーが2個以上ある場合も同様に処
理されるよ5になっている。
FIG. 5 shows an example of a configuration in which the above processing is implemented in terms of hardware. First, the scan start position is initialized by the scan start position setting means 5. After that, the scan signal is output from the scan signal output means 6 to the key manual means (key matrix 3).
It is now output to . Detection of the number of pressed keys in response to this scan signal is performed by the pressed key number detection means 7, and if there is only one pressed key in this detection, the pressed key information is stored in the pressed key information storage means 8. Yes 0 After this, the number of scans is determined by the scan number determining means 9, but if all the scans have not been completed, the scan position is changed by the scan position changing means 10, and the above operation is repeated. It is intended to do so. Therefore, the pressed key information storage means 8 stores the pressed key 1 throughout the entire scan.
The key information in the case of
The pressed key information reporting means 117fC is to be reported. Note that the pressed key number detecting means 7 stores the detection results from the scans performed up to that point, and the detection result indicating that the number of pressed keys is 1 is 2.
If the number of keys is obtained, a processing end signal is immediately issued to stop the key scan processing operation. ・If two or more keys are pressed in the same scan, the same process is performed. There is.

このようにソフトウェア処理によるか否かに拘わらず一
般にキーの数が多くなる程にスキャン処理に要される時
間は大となシ、特にソフトウェア処理による場合は問題
である。
As described above, regardless of whether software processing is used or not, the time required for scanning processing generally increases as the number of keys increases, which is particularly problematic when software processing is used.

〔発明の目的〕[Purpose of the invention]

よって本発明の目的は、キーの数か多い場合であっても
何れのキーが押下されているかを速やかに特定して検出
し得るキースキャン方式を供するにある。
SUMMARY OF THE INVENTION Therefore, an object of the present invention is to provide a key scanning method that can quickly identify and detect which key is being pressed even when there are many keys.

〔発明の概要〕[Summary of the invention]

この目的のため不発8Aは、マトリックス状に配置され
たキーの倒れが押下されたかを判断する処理はx−y平
面上の格子の中の一点を探すことに等しいことに着目し
、X方向よりスキャン信号を順次送ることなく同時に送
るようにしてy方向より押下情報t−a込し、これによ
って押下キーのy方向上での位置を検出し、この後その
位置を含むy方向よ)スキャン信号を送ることによって
その位置のX方向上での位置を検出するようkし比もの
である@ 〔発明の実施例〕 以下、不発8Atl−第1図、第2図にょシ説明する。
For this purpose, the misfire 8A focuses on the fact that the process of determining whether a key arranged in a matrix has been pressed is equivalent to searching for a point in a grid on the x-y plane, and Scan signals are not sent sequentially but simultaneously, and press information t-a is included from the y direction, thereby detecting the position of the pressed key in the y direction, and then sending scan signals in the y direction including that position. [Embodiments of the Invention] Hereinafter, the unexploded 8Atl--FIGS. 1 and 2 will be explained.

先ず本発明によるキースキャン方式’i:/7)ウェア
的に実施し危場合での処理の70−について説明する0
第1図は第4図に対応したその処理のフローを示したも
のである。これKよnはPIAのPort A  は入
力に%また、Port Bは出力として設定されたうえ
Port Bよりスキャンが同時に行なわれるものとな
っている。この同時スキャンの結果、押下キーが1個で
あると考えらnる場合、即ち、Port A、 = A
7のうち何れか1つに押下情報が取込さn几場合にはP
ort A、 Bの入出力設定を逆にし几うえで押下情
報が取込さt′したPort Aよりスキャン信号を出
力するものである。このスキャン信号に対してport
 B(1〜B、の伺nか1つに押下情報が得らnた場合
には、押下キーは1個であるとしてその押下キー情報は
キューに登録されるわけである。したがって、押下キー
の検出はキー数には無関係に実質的には2回のスキャン
処理で済まされるものである。
First, we will explain the key scanning method according to the present invention 'i:/7) 70-, which is implemented by software and is processed in a critical situation.
FIG. 1 shows the flow of the process corresponding to FIG. 4. In this case, Port A of the PIA is set as input, Port B is set as output, and scanning is performed from Port B at the same time. As a result of this simultaneous scanning, if it is considered that there is only one pressed key, that is, Port A, = A.
If press information is captured in any one of 7, P
The input/output settings of ports A and B are reversed, and a scan signal is output from port A after the press information has been captured t'. port for this scan signal.
If press information is obtained for one of B (1 to B), it is assumed that there is only one pressed key, and the pressed key information is registered in the queue. Therefore, the pressed key information is registered in the queue. Detection can essentially be accomplished with two scans, regardless of the number of keys.

第2図は以上の処理をハードウェア的に実施し次場合で
の一例での構成を示したものである◇これによると処理
開始によりスキャン信号出力手段12からはキー人力手
段5に対しては一斉にスキャン信号が一方向よ)出力さ
れるが、キー人力手段3の他方向からの取込情報にもと
づき押下キー数検出手段15によっては押下キー数が1
か否かが検出されるようになっている。押下キーが1個
である場合にはそのキーの他方向での位置がキー押下情
報検出位置記憶手段15に記憶されるとともに、スキャ
ン方向変更手段14によってはスキャン方向が変更さn
t後、スキャン位置設定手段16/a、上記他方向での
位置を含む他方向よりスキャン信号を出力するものとな
っている@このスキャン信号に対するキー人力手段6か
らの取込情報にもとづき押下キー数検出手段18によっ
て扛押下キー数が1か否かが検出されるか、押下キーが
1個である場合には押下キー情報報告手段19によ91
個のみ押下され次キーの情報が報告されるものである。
FIG. 2 shows a configuration in which the above-mentioned processing is implemented in terms of hardware in the following case. According to this figure, when the processing starts, the scan signal output means 12 outputs a signal to the key human power means 5. Scan signals are output all at once (from one direction), but the number of pressed keys is determined to be 1 by the pressed key number detection means 15 based on the information taken in from the other direction by the key manual means 3.
It is now possible to detect whether or not the When only one key is pressed, the position of that key in the other direction is stored in the key press information detection position storage means 15, and the scan direction is changed by the scan direction changing means 14.
After t, the scan position setting means 16/a outputs a scan signal from other directions including the position in the other direction. The number detection means 18 detects whether the number of pressed keys is 1 or not, or if the number of pressed keys is 1, the pressed key information reporting means 19 detects 91.
When only one key is pressed, information on the next key is reported.

(発明の効果〕 以上説明し次ように本発明による場合は% 2回のスキ
ャン処理によって押下キーを特定して検出し得、ソフト
ウェア的に、ま次はハードウェア的に実施するにしても
押下キーを特定して速やかに検出し得るという効果があ
る。
(Effects of the Invention) As explained above and as follows, in the case of the present invention, the pressed key can be specified and detected by two scan processes, and even if the pressed key is implemented by software or hardware. This has the effect that the key can be identified and detected quickly.

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

第1図、第2図は、本発明によるキースキャン方式をソ
フトウェア的、ハードウェア的に実施した場合での処理
のフローとその一例での構成を示す図、第3図は、ソフ
トウェア処理によるキースキャン回路の一例でのブロッ
ク構成を示す図、第4図、第5図は、こnまでのキース
キャン処理の一般的な処理の70−とその処理をハード
ウェア的に実施する場合での一例での構成を示す図であ
る。 2・・・PIA、3・・・キーマトリックス、12.1
7・・・スキャン信号出力手段、13.18・・・押下
キー数検出手段、14・・・スキャン方向変更手段% 
15・・・キー押下情報検出位置記憶手段、16・・・
スキャン位置設定手段、19・・・押下キー情報報告手
段。 才1図 才 2  図 体 31!I
Figures 1 and 2 are diagrams showing the processing flow and configuration of an example of the key scan method according to the present invention implemented in software and hardware, and Figure 3 is a diagram showing the configuration of an example of the key scan method according to the present invention. Figures 4 and 5, which are diagrams showing the block configuration of an example of a scan circuit, show the general process 70- of the key scan process so far and an example of the case where the process is implemented in hardware. FIG. 2... PIA, 3... Key matrix, 12.1
7... Scan signal output means, 13.18... Number of pressed keys detection means, 14... Scan direction changing means %
15...Key press information detection position storage means, 16...
Scan position setting means, 19... Pressed key information reporting means. 1 figure, 2 figure, 31 figure! I

Claims (1)

【特許請求の範囲】[Claims] マトリックス状に配置された複数のキーの何れが押下さ
れたかを特定して検出するためのキースキャン方式にお
いて、一方の方向よりキーマトリックスに対しスキャン
信号を同時に送出し他方向より押下情報を取り込むこと
によって押下キーの他方向上での位置を検出した後、上
記他方向上での位置を含む他方向よりスキャン信号を送
出し上記一方の方向より押下情報を取り込むことによっ
て押下キーの一方の方向上での位置を検出することを特
徴とするキースキャン方式。
In a key scan method for specifying and detecting which of multiple keys arranged in a matrix has been pressed, a scan signal is simultaneously sent to the key matrix from one direction and pressed information is captured from the other direction. After detecting the position of the pressed key in the other direction, a scan signal is sent from the other direction including the position in the other direction, and the pressed key is detected in one direction by capturing the pressed information from the one direction. A key scan method that detects the location of
JP59272947A 1984-12-26 1984-12-26 Key scan system Pending JPS61151726A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP59272947A JPS61151726A (en) 1984-12-26 1984-12-26 Key scan system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP59272947A JPS61151726A (en) 1984-12-26 1984-12-26 Key scan system

Publications (1)

Publication Number Publication Date
JPS61151726A true JPS61151726A (en) 1986-07-10

Family

ID=17520988

Family Applications (1)

Application Number Title Priority Date Filing Date
JP59272947A Pending JPS61151726A (en) 1984-12-26 1984-12-26 Key scan system

Country Status (1)

Country Link
JP (1) JPS61151726A (en)

Similar Documents

Publication Publication Date Title
KR970049288A (en) Reset device and method of central processing unit
US4333719A (en) Multiple flash adaptor
JPS61151726A (en) Key scan system
US8959258B2 (en) Detection system for detecting button being pressed and method thereof
KR950025340A (en) Microwave encoder key input device and interrupt processing method using the device
JP3115130B2 (en) Electronic exchange system
KR900006287B1 (en) N-key roll over scan circuit and method for membrane capacitive keyboard
JPH08194572A (en) Key input device
JP2669432B2 (en) Image data transfer device
JP2685959B2 (en) Digital value chattering determination device
JPS6010323A (en) Key input device
JPH03198121A (en) Keyboard control circuit
JPS60175135A (en) Key scanning circuit
JP2864524B2 (en) Image processing device
JPS5996983U (en) Signal selection scanning circuit
JPH04352050A (en) Reply signal output board
JPS58137050A (en) Processing method of request signal
JPS6367700A (en) Alarm control circuit
JPH02211721A (en) Keyboard device
JPH01251285A (en) Image processor
JPS61190629A (en) Maximum and minimum value detection
JPH0512171A (en) Peripheral controller
JPS63228006A (en) Optical coordinate detector
JPS6068389A (en) Scan system for key and switch of electronic musical instrument
JPH03227100A (en) Device for processing wiring test data of printed wiring board