JPS58184631A - Keyboard reading method - Google Patents
Keyboard reading methodInfo
- Publication number
- JPS58184631A JPS58184631A JP57066625A JP6662582A JPS58184631A JP S58184631 A JPS58184631 A JP S58184631A JP 57066625 A JP57066625 A JP 57066625A JP 6662582 A JP6662582 A JP 6662582A JP S58184631 A JPS58184631 A JP S58184631A
- Authority
- JP
- Japan
- Prior art keywords
- keyboard
- scan
- return data
- line
- 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
Classifications
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M11/00—Coding in connection with keyboards or like devices, i.e. coding of the position of operated keys
- H03M11/20—Dynamic coding, i.e. by key scanning
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Input From Keyboards Or The Like (AREA)
Abstract
Description
【発明の詳細な説明】
本発明は、マイクロプロセッサを使用した機器における
キーボード入力信号の読込み方法に関するものである。DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a method for reading keyboard input signals in a device using a microprocessor.
一般にマイクロプロセッサを使用した機器における入ツ
ノ装置にはキーボードが使用されている。Generally, a keyboard is used as an input device in devices using a microprocessor.
この場合、キーボード入力信号の読込み方法としては、
マイクロプロセッサに割込みを発生させ、キーボードの
接点状態をスキャン、監視し、その応答でキーの押下を
判断し、読み込むことが行なわれている。また、この際
、読取りの信頼性を向上させるために、キーボードのス
キャンを2回以上繰り退し、データが一致した時に入力
信号として読み込む方法がとられている。しかしながら
、このような方法ではキーボードを常に同じ順序でスキ
ャンしているために、データの一致を検出するまでの時
間、すなわちマイクロプロセッサへの割込み時間が長く
なってしまう欠点を有している。In this case, the method for reading keyboard input signals is as follows:
It generates an interrupt in the microprocessor, scans and monitors the contact status of the keyboard, and uses the response to determine whether a key has been pressed and reads it. At this time, in order to improve the reliability of reading, a method is used in which the keyboard scan is repeated twice or more, and when the data matches, it is read as an input signal. However, this method has the disadvantage that since the keyboard is always scanned in the same order, it takes a long time to detect a data match, that is, it takes a long time to interrupt the microprocessor.
本発明は、上記のような従来方法の欠点をなくし、キー
ボードを効率よくスキャンしてマイクロプロセッサへの
割込み時間を短かくすることのできるキーボード読込み
方法を提供することを目的としたものである。SUMMARY OF THE INVENTION It is an object of the present invention to provide a keyboard reading method that eliminates the drawbacks of the conventional methods as described above and can efficiently scan the keyboard and shorten the time required to interrupt the microprocessor.
本発明のキーボード読込み方法は、キーボードをスキャ
ンした際に、キーボードの押下に対応して得られたデー
タを一時記憶しておき、次回のスキャンでは前回押下を
検出したキーからスキャンを開始することにより、デー
タの一致を検出するまでの時間を短縮し、マイクロプロ
セッサへの割込み時間を短かくするようにしたものであ
る。The keyboard reading method of the present invention temporarily stores data obtained in response to keyboard presses when the keyboard is scanned, and in the next scan, starts scanning from the key whose press was detected last time. , the time required to detect data matching is shortened, and the interrupt time to the microprocessor is shortened.
以下、図面を使用して本発明のキーボード読込み方法を
説明する。Hereinafter, the keyboard reading method of the present invention will be explained using the drawings.
第1図は本発明のキーボード読込み方法を応用したキー
ボード読込み装置の一実施例を示す構成図である。図に
おいて、CPUはマイクロプロセッサ、 TCLはマイ
クロプロセッサCPUにスキャンを開始させるための割
込信号Ptを印加するタイマー、KEYはキーボード、
SO〜S7はキーボードKEYの押下状態を検出するた
めの検出パルスが印加されるスキャンライン、 RO〜
R7はスキャンラインSO〜S7から印加される検出パ
ルスに対して各キーの押下状態に応じたリターンデータ
::が発生されるリターンラインである。また、キーボ
ードKEYにおいてスキャンラインSO〜S7とリター
ンラインRO〜R7との交点には、それぞれキーが配置
されている。FIG. 1 is a block diagram showing an embodiment of a keyboard reading device to which the keyboard reading method of the present invention is applied. In the figure, CPU is a microprocessor, TCL is a timer that applies an interrupt signal Pt to the microprocessor CPU to start scanning, KEY is a keyboard,
SO~S7 are scan lines to which a detection pulse is applied to detect the pressed state of the keyboard KEY, and RO~
R7 is a return line in which return data :: is generated according to the pressed state of each key in response to the detection pulses applied from the scan lines SO to S7. Further, on the keyboard KEY, keys are arranged at the intersections of the scan lines SO to S7 and the return lines RO to R7, respectively.
上記のように構成されたキーボード読込み装置において
、その動作は次の通りである。マイクロプロセッサCP
UはタイマーTCLから割込信号Ptが印加されると、
キーボード入ノJの読込み動作を開始し、スキャンライ
ンSO〜S7を順次スキャンして検出パルスを印加する
とともに、リターンラインRO〜R7から得られるリタ
ーンデータを取り込む。The operation of the keyboard reading device configured as described above is as follows. Microprocessor CP
When U is applied with the interrupt signal Pt from the timer TCL,
The reading operation of the keyboard input is started, scan lines SO to S7 are sequentially scanned and detection pulses are applied, and return data obtained from return lines RO to R7 is taken in.
また、1回のスキャンが終了すると、終了信号Paを発
生し、タイマーTCLに印加する。第2図はこの状態を
示すタイムチャートであり、タイマーTCLは一定の時
間間隔をもって割込信号Ptを発生するとともに、割込
信号PtはマイクロプロセッサCPUからの終了信号P
aによりリセットされる。Furthermore, when one scan is completed, an end signal Pa is generated and applied to the timer TCL. FIG. 2 is a time chart showing this state, in which the timer TCL generates an interrupt signal Pt at regular time intervals, and the interrupt signal Pt is a termination signal Pt from the microprocessor CPU.
It is reset by a.
さて、1回のスキャンが終了し、任意のキーの押下に対
応したリターンデータが得られたとすると、マイクロプ
ロセッサCPUはこのリターンデータをRAMなどに記
憶讐るとともに終了信号Paを発生し、次の割込信号P
tを待つ。こうした後、次の割込信号f’tが印加され
ると、マイクロプロセッサCPUは前回記憶しておいた
リターンデータを読み出し、そのデータに対応したスキ
ャンラインがらスキャンを開始する。したがって、前回
のスキャンの時と同じキーが押されていれば、最初に選
択されたスキャンラインでリターンデータが一致するこ
とになり、その時点でキーボード入力信号の読込みが行
なわれ、その回のスキャンが終了する。Now, when one scan is completed and the return data corresponding to the press of any key is obtained, the microprocessor CPU stores this return data in RAM etc. and generates the end signal Pa, and then the next scan is performed. Interrupt signal P
wait for t. After this, when the next interrupt signal f't is applied, the microprocessor CPU reads out the previously stored return data and starts scanning from the scan line corresponding to that data. Therefore, if the same key was pressed during the previous scan, the return data will match on the first selected scan line, and the keyboard input signal will be read at that point, and the scan will begin. ends.
このため、それ以後のスキャンラインについてはスキャ
ンを行なう必要がなくなり、キーボード入力の読込みの
ためにマイクロプロセッサCPUを占有してしまう時間
を短かくすることができる。Therefore, there is no need to scan subsequent scan lines, and the time that the microprocessor CPU is occupied for reading keyboard input can be shortened.
ここで、割込信号Ptの発生される周期はデパウンス時
間と呼ばれるもので、キーボードKEYにおけるチャタ
リングの防止を考慮して設定されたものである。すなわ
ち、このデバウンス時間以上の時間間隔をおいてキーボ
ードKEYの押下状態を検出することにより、キー接点
におけるチャタリングの影響を除去することができる。Here, the period at which the interrupt signal Pt is generated is called a debounce time, and is set in consideration of prevention of chattering in the keyboard KEY. That is, by detecting the pressed state of the keyboard KEY at time intervals equal to or longer than the debounce time, the influence of chattering at the key contacts can be removed.
なお、上記の説明においては、デパウンス時間内に1回
のスキャンを行なう場合について例示したが、スキャン
の間隔はこれに限られるものではなく、デパウンス時間
とは無関係に一定周期でスキャンを繰り返し、リターン
データの比較はデパウンス時間を隔てて得られたデータ
同士で行なうようにしても同様の動作を行なわせること
ができる。このようにすると、何回目のスキャンごとに
比較が行なわれるかによりデパウンス時間が決定され、
デパウンス時間の設定をマイクロプロセッサCPU側で
ソフト的に行なうことができる。In addition, in the above explanation, the case where one scan is performed within the debounce time is exemplified, but the scan interval is not limited to this, and the scan is repeated at a constant cycle regardless of the debounce time, and the return A similar operation can be performed by comparing data obtained at different debounce times. In this way, the debounce time is determined depending on how many times the comparison is performed,
The debounce time can be set by software on the microprocessor CPU side.
以上説明したように、本発明のキーボード読込み方法で
は、印加される割込み信号に応じてキーボードをスキャ
ンした際に、キーボードの押下に対応して得られたデー
タを一時記憶しておき、吹回のスキャンでは前回押下を
検出したキーがらスキャンを開始するようにしているの
で、データの一致を検出するまでの時間が短縮され、マ
イクロプロセッサへの割込み時間を短がくすることがで
きる。As explained above, in the keyboard reading method of the present invention, when the keyboard is scanned in response to an applied interrupt signal, data obtained in response to keyboard presses is temporarily stored, and Since the scan is started from the key whose press was detected last time, the time required to detect data matching is shortened, and the time required to interrupt the microprocessor can be shortened.
11図および第2図は本発明のキーボード読込み方法を
応用したキーボード読込み装置の−実施手続補正−(方
式)
1.事件の表示 特願昭57−66625号2、
発明の名称 キーボード読込み方法3、補正する
者
事何との関係 出願人
住 所 東京都武蔵野市中町2丁目9番32月
名 称 (670) 株式会社 横列電機製
作所4、代理人Figures 11 and 2 show - correction of implementation procedure - (method) of a keyboard reading device to which the keyboard reading method of the present invention is applied. 1. Indication of the incident: Patent Application No. 57-66625 2,
Title of the invention Keyboard reading method 3, relationship with the person making the amendment Applicant address 2-9 Nakamachi, Musashino-shi, Tokyo Name (670) Yokoretsu Electric Manufacturing Co., Ltd. 4, Agent
Claims (1)
各ラインごとにスキャンしてキーボードの押下状態に応
じたリターンデータを得るとともにこのスキャンを繰り
返しリターンデータが一致した場合にそのリターンデー
タをキー人力信号として読み込むようにしたキーボード
読込み方法において、キーボードをスキャンした際にキ
ーボードの押下に対応して得られたリターンデータを一
時記憶しておき、吹回のスキャンでは曲回押下を検出し
たキーを含むラインからスキャンを開始することを特徴
とするキーボード読込み方法。A keyboard in which multiple keys are arranged in a matrix is scanned line by line to obtain return data according to the pressed state of the keyboard, and this scanning is repeated and when the return data matches, the return data is converted into a key human input signal. In the keyboard reading method, the return data obtained in response to the keyboard press is temporarily stored when the keyboard is scanned, and when the keyboard is scanned, the return data obtained in response to the keyboard press is temporarily stored. A keyboard reading method characterized by starting scanning from .
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP57066625A JPS58184631A (en) | 1982-04-21 | 1982-04-21 | Keyboard reading method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP57066625A JPS58184631A (en) | 1982-04-21 | 1982-04-21 | Keyboard reading method |
Publications (1)
Publication Number | Publication Date |
---|---|
JPS58184631A true JPS58184631A (en) | 1983-10-28 |
Family
ID=13321253
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP57066625A Pending JPS58184631A (en) | 1982-04-21 | 1982-04-21 | Keyboard reading method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPS58184631A (en) |
-
1982
- 1982-04-21 JP JP57066625A patent/JPS58184631A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US4804278A (en) | Key input apparatus provided with a key input buffer | |
JPS58184631A (en) | Keyboard reading method | |
JPH036919B2 (en) | ||
JP2757992B2 (en) | Input device | |
JPS63188217A (en) | Key scanning circuit | |
JP3078194B2 (en) | Key scan circuit | |
JPH03245218A (en) | Push down position detecting system for digital touch panel | |
JP2836683B2 (en) | Process termination processing method | |
SU1679478A1 (en) | Functions generator | |
JPS63118818A (en) | Key input processor | |
JPS5858640A (en) | Key input device | |
RU2069894C1 (en) | Device for determining optimal maintenance intervals of equipment | |
JPS63124086A (en) | Cursor control system | |
JP2804406B2 (en) | Pulse measuring device | |
KR19990055561A (en) | Interrupt handler | |
JPS6084626A (en) | Keyboard circuit | |
JPH0621970B2 (en) | Keyboard device | |
JPH0335310A (en) | Key input device and method | |
JPS62165227A (en) | Key detecting circuit | |
JPH01126060A (en) | Scanning speed inspection device for picture input device | |
JPS6327726B2 (en) | ||
JPH0758504B2 (en) | Image input device | |
JPS62206632A (en) | Control system for main storage device | |
JPS62126422A (en) | Programmable controller | |
JPH05122537A (en) | Two-dimensional encoder |