JPS60175135A - Key scanning circuit - Google Patents

Key scanning circuit

Info

Publication number
JPS60175135A
JPS60175135A JP59030594A JP3059484A JPS60175135A JP S60175135 A JPS60175135 A JP S60175135A JP 59030594 A JP59030594 A JP 59030594A JP 3059484 A JP3059484 A JP 3059484A JP S60175135 A JPS60175135 A JP S60175135A
Authority
JP
Japan
Prior art keywords
input
key
output
port
ports
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
JP59030594A
Other languages
Japanese (ja)
Inventor
Yoshikazu Shimizu
清水 義和
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP59030594A priority Critical patent/JPS60175135A/en
Publication of JPS60175135A publication Critical patent/JPS60175135A/en
Pending legal-status Critical Current

Links

Landscapes

  • Input From Keyboards Or The Like (AREA)

Abstract

PURPOSE:To omit a protection diode and to shorten reading time by connecting key switches between two I/O ports and switching both the ports alternately to use them as output and input terminals of a key scanning signal. CONSTITUTION:The 1st I/O ports AIO0-IO3 of a microcomputer 22 are connected to the 2nd I/O ports BIO4-IO7 like a 4X4 matrix, four bits of the port A are made active to output a key scanning signal and the port B is used as the input terminal to check the key scanning signal. When only one bit is active, four bits of the port B are made active and the key scanning signal is outputted from the port B and inputted from the port A to check the signal. Thus, the input state of the key switches can be read out only by repeating I/O twice.

Description

【発明の詳細な説明】 産業上の利用分野 本発明は、マイクロコンピュータにキースイッチにより
入力をする場合に用いることができるキースキャン回路
に関する。
DETAILED DESCRIPTION OF THE INVENTION Field of the Invention The present invention relates to a key scan circuit that can be used when inputting information to a microcomputer using a key switch.

従来例の構成とその問題点 一慇に、マイクロコンピュータへの入力用にキーマトリ
クスを用いキースキャンによってその入力判別を行う時
には、第1図に示すように、マイクロコンピュータ1の
出力ポートと入力ポートとの間にキースイッチ6〜21
をマトリックス状に接続する。そして、出力ポートから
はその出力端子のうち1つだけをアクティブにするよう
にキースキャン信号を出力してその時のキースイッチか
らの信号を入力ポートに入力するということを出力ポー
トの出力端子数だけ繰り返し行ない、これらの一連の入
力のうち1ビツトだけがアクティブである時にそのビッ
トに対応するキースイッチが押されたことを判断するよ
うにしている。
The configuration of the conventional example and its problems are as follows: When using a key matrix for input to a microcomputer and determining the input by key scanning, the output port and input port of the microcomputer 1 are connected as shown in Figure 1. Key switch 6-21 between
are connected in a matrix. Then, from the output port, a key scan signal is output to activate only one of the output terminals, and the signal from the key switch at that time is input to the input port, which is equal to the number of output terminals of the output port. This is repeated, and when only one bit of the series of inputs is active, it is determined that the key switch corresponding to that bit has been pressed.

ところがこのような従来の回路の場合には、スイッチ6
〜21が2個以上同時に押された時に出力ポートのアク
ティブ(高レベル)になっている端子と他の端子間がシ
シートシないように、直列にダイオード2〜6を挿入す
る必要がある。
However, in the case of such a conventional circuit, switch 6
It is necessary to insert diodes 2 to 6 in series so that when two or more of the terminals 21 to 21 are pressed at the same time, there is no disconnection between the active (high level) terminal of the output port and other terminals.

またキースイッチ6〜21の状態を一度に読み取れない
ため、第1図の場合ならば、キースイ・ソチ6〜9,1
0〜13.14〜17.18〜21と4回キースキャン
を繰シ返す必要があシ、読み取りに時間がかかるという
欠点がある。
In addition, since the states of key switches 6 to 21 cannot be read at once, in the case of Fig. 1, key switches 6 to 9, 1
It is necessary to repeat the key scan four times from 0 to 13, 14 to 17, and 18 to 21, and there is a drawback that it takes time to read.

発明の目的 本発明は、上記のような従来の欠点を除去し、保護用の
ダイオードが不要で、かつ読み取り時間を短くすること
ができるキースキャン回路を提供することを目的とする
OBJECTS OF THE INVENTION It is an object of the present invention to provide a key scan circuit that eliminates the conventional drawbacks as described above, does not require a protection diode, and can shorten the reading time.

発明の構成 本発明においては、コンピュータのキースキヤス用の入
出力ポートを交互にキースキャン信号の出力端子と入力
端子とに切換えて使用するようにして、最初は第1の入
出力ポートからキースキャン信号を出力して第2の入出
力ポートから入力し、次には第2の入出力ポートからキ
ースキャン信号を出力して第1の入出力ポートから入力
するようにしたことを特徴とするものであり、入出力ポ
ートを双方向性で使用するためにダイオードが不要であ
り、かつ高速なキー人力を可能にすることができるもの
である。
Structure of the Invention In the present invention, the key scan input/output ports of a computer are alternately switched to output terminals and input terminals for key scan signals, and the key scan signal is first input from the first input/output port. The key scan signal is output from the second input/output port and inputted from the second input/output port, and then the key scan signal is outputted from the second input/output port and inputted from the first input/output port. Since the input/output ports are used bidirectionally, no diode is required, and high-speed key operation is possible.

実施例の説明 以下、本発明の一実施例におけるキースキャン回路につ
いて、図面を参照して説明する。
DESCRIPTION OF THE EMBODIMENTS A key scan circuit according to an embodiment of the present invention will be described below with reference to the drawings.

第2図にその構成を示す。図において、キースイッチ2
3〜38はマイクロコンピュータ22の第1の入出カボ
ート!00〜工o3 と第2の入出力ポートIO4〜I
O7に4×4のマトリックス状に接続する。
Figure 2 shows its configuration. In the figure, key switch 2
3 to 38 are the first input/output ports of the microcomputer 22! 00~03 and second input/output port IO4~I
Connect to O7 in a 4x4 matrix.

第3図にそのキースイッチ入力の読み取り動作のフロー
チャートを示す。まず、第1の入出カポ−)A(IO8
〜■o3)の4ビツトをアクティブ(例えば低レベル)
にしてキースキャン信号を出力する。そして、第2の入
出力ポートB (IO4〜l07)を入力端子とし、キ
ースイッチによシアクチイブになされているビットをチ
ェックする。このとき、どのビットもアクティブでなけ
れば、キースイッチはひとつも押されていないと判断で
きる。また2ビツト以上がアクティブであれば、少なく
とも2個以上のスイッチが押されていると判断できる。
FIG. 3 shows a flowchart of the key switch input reading operation. First, the first input/output capo) A (IO8
~■o3) 4 bits are active (for example, low level)
to output the key scan signal. Then, the second input/output port B (IO4 to 107) is used as an input terminal, and the bits activated by the key switch are checked. At this time, if no bit is active, it can be determined that no key switch has been pressed. Furthermore, if two or more bits are active, it can be determined that at least two or more switches are pressed.

1ビツトだけアクティブのときは、例えばIO6だけが
アクティブである時はキースイッチ26゜29.33.
37のうちのいずれかが押されているため、次に第2の
入出カポ−)B (IO4〜IO□)の4ビツトをアク
ティブにしてキースキャン信号を出力し、第2の入出力
ポートAから入力する。
When only 1 bit is active, for example, when only IO6 is active, the key switch 26°29.33.
37 is pressed, next, 4 bits of the second input/output port A) are activated and a key scan signal is output, and the second input/output port A is activated. Enter from.

この時、どのビットもアクティブでなければ、第2の入
出力ポートBから入力してから第2の入出力ポートAか
ら入力するまでの間にキースイッチが離されたと判断で
き、2ビツト以上がアクティブであれば2個以上のスイ
ッチが押されていると判断できる。そして、1ビツトだ
けがアクティブになっている時には、先に入力がアクテ
ィブであった入出力ポートBのラインと現在アクティブ
な入出カポ−)Aのラインとの交点のキースイッチが押
されていると判断できる。
At this time, if none of the bits are active, it can be determined that the key switch was released between input from the second input/output port B and input from the second input/output port A, and two or more bits are If it is active, it can be determined that two or more switches are pressed. When only one bit is active, if the key switch at the intersection of the previously active input/output port B line and the currently active input/output port A line is pressed. I can judge.

このようにこのキースキャン回路によれば、ただ2回の
入出力を繰り返すだけでキースイッチからの入力状態を
高速に読み取ることかできる。また、従来必要であった
保護用のダイオードも不要・−にでき、回路を簡易化す
ることができる。
In this way, according to this key scan circuit, the input state from the key switch can be read at high speed by simply repeating input and output twice. Further, the protective diode that was conventionally required can be omitted, and the circuit can be simplified.

発明の効果 、 以上のように、本発明によれば、マイクロコンピュ
ータのキーマトリクス用の入出力ポートを交互にキース
キャン信号の入出力端子として使用するようにしたこと
により、保護用のダイオードを不要にすることができ、
しかも、マトリックスのキー数が多くなっても2回だけ
のキースキャン信号の入出力でキースイッチの入力状態
を読み取ることができるので高速動作が可能になるもの
である。
Effects of the Invention As described above, according to the present invention, the key matrix input/output ports of the microcomputer are alternately used as key scan signal input/output terminals, thereby eliminating the need for protective diodes. can be,
Moreover, even if the number of keys in the matrix increases, the input state of the key switch can be read by inputting and outputting the key scan signal only twice, so high-speed operation is possible.

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

第1図は従来例のキースキャン回路の回路図、第2図は
本発明の一実施例におけるキースキャン回路の回路図、
第3図はその動作を示すフローチャートである。 22・・・・・・マイクロコンピュータ、23〜38・
・・・・・キーボタンスイッチ。 代理人の氏名 弁理士 中 尾 敏 男 ほか1名第1
図 第2図
FIG. 1 is a circuit diagram of a conventional key scan circuit, and FIG. 2 is a circuit diagram of a key scan circuit in an embodiment of the present invention.
FIG. 3 is a flowchart showing the operation. 22...Microcomputer, 23-38.
...Key button switch. Name of agent: Patent attorney Toshio Nakao and 1 other person No. 1
Figure 2

Claims (1)

【特許請求の範囲】[Claims] マイクロコンピュータの第1.第2の入出力ボートの間
にキースイッチを接続し、前記第1.第2の入出力ボー
トを交互・にキースキャン信号の出力端子と入力端子と
して切換えて使用するようにしたキースキャン回路。
The first microcomputer. A key switch is connected between the second input/output boat, and the first input/output port is connected between the first and second input/output ports. A key scan circuit in which a second input/output port is alternately switched and used as an output terminal and an input terminal for a key scan signal.
JP59030594A 1984-02-20 1984-02-20 Key scanning circuit Pending JPS60175135A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP59030594A JPS60175135A (en) 1984-02-20 1984-02-20 Key scanning circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP59030594A JPS60175135A (en) 1984-02-20 1984-02-20 Key scanning circuit

Publications (1)

Publication Number Publication Date
JPS60175135A true JPS60175135A (en) 1985-09-09

Family

ID=12308189

Family Applications (1)

Application Number Title Priority Date Filing Date
JP59030594A Pending JPS60175135A (en) 1984-02-20 1984-02-20 Key scanning circuit

Country Status (1)

Country Link
JP (1) JPS60175135A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4906993A (en) * 1988-04-04 1990-03-06 John Fluke Mfg. Co., Inc. Keyboard scanner apparatus and method
US4959831A (en) * 1989-07-31 1990-09-25 Chrysler Corporation Single wire bus smart keypad controller system

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS60146317A (en) * 1984-01-10 1985-08-02 Matsushita Electric Ind Co Ltd Discriminating method of key switch

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS60146317A (en) * 1984-01-10 1985-08-02 Matsushita Electric Ind Co Ltd Discriminating method of key switch

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4906993A (en) * 1988-04-04 1990-03-06 John Fluke Mfg. Co., Inc. Keyboard scanner apparatus and method
US4959831A (en) * 1989-07-31 1990-09-25 Chrysler Corporation Single wire bus smart keypad controller system

Similar Documents

Publication Publication Date Title
US4620188A (en) Multi-level logic circuit
KR950012663A (en) Semiconductor device with boundary scan test circuit
EP0086634B1 (en) Memory circuitry for use in a digital time division switching system
JPS60175135A (en) Key scanning circuit
JPH074665Y2 (en) Key matrix reading circuit
JPS58197542A (en) Key code reader
SU1451691A2 (en) Modulo-m adding and subtracting device
JPH06138191A (en) Semiconductor integrated circuit
SU1683014A1 (en) Device for modulo three exponentiation of numbers
JP2569765B2 (en) Signal processing integrated circuit device
SU1524184A1 (en) Decoder with check
KR880000422B1 (en) Matrix key and data selector
JPS59153233A (en) Microcomputer
JPH05165559A (en) Key switch matrix circuit
JP2589707B2 (en) Keyboard device
JPH0216818A (en) Key input system
SU1034208A1 (en) Storage with redundancy
JP2615471B2 (en) Keyboard device
JPH0590755U (en) Key matrix circuit
JPS6247009B2 (en)
JPH04262413A (en) Key scan circuit for microcomputer
JPS59163626A (en) Keyboard identifying system
JPH051486B2 (en)
JPH0247121B2 (en) HYOJUNSHINGOHATSUSEISOCHI
KR900003737A (en) Signal Sequence Arrangement and Circuit with Extensibility