JPH04262413A - Key scan circuit for microcomputer - Google Patents

Key scan circuit for microcomputer

Info

Publication number
JPH04262413A
JPH04262413A JP3022522A JP2252291A JPH04262413A JP H04262413 A JPH04262413 A JP H04262413A JP 3022522 A JP3022522 A JP 3022522A JP 2252291 A JP2252291 A JP 2252291A JP H04262413 A JPH04262413 A JP H04262413A
Authority
JP
Japan
Prior art keywords
microcomputer
converter
key
scan circuit
section
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
JP3022522A
Other languages
Japanese (ja)
Inventor
Masaomi Ichikawa
市川 正臣
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.)
NEC Corp
Original Assignee
NEC Corp
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 NEC Corp filed Critical NEC Corp
Priority to JP3022522A priority Critical patent/JPH04262413A/en
Publication of JPH04262413A publication Critical patent/JPH04262413A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M11/00Coding in connection with keyboards or like devices, i.e. coding of the position of operated keys
    • H03M11/22Static coding
    • H03M11/24Static coding using analogue means, e.g. by coding the states of multiple switches into a single multi-level analogue signal or by indicating the type of a device using the voltage level at a specific tap of a resistive divider

Abstract

PURPOSE:To make it possible to use an A/D converter for another application. CONSTITUTION:To (n) output ports P0-Pn, input nodes N1-Nn of key matrix section 3 are connected via resistors R0-Rn of interface section 2, and interface node 2 is connected to the input terminal AD of A/D converter for a microcomputer.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】本発明はマイクロコンピュータの
キー・スキャン回路に関し、特にA/Dコンバータを用
いたアナログ・キー・スキャン回路に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a key scan circuit for a microcomputer, and more particularly to an analog key scan circuit using an A/D converter.

【0002】0002

【従来の技術】従来のアナログ・キー・スキャン回路は
図2に示すように、例えばマイクロコンピュータ1a内
部の複数の4ビットA/Dコンバータ入力端子AD0〜
ADnの各端子毎にプルアップ抵抗R0を有する電源供
給部4を介してスキャンスイッチ部3のn×m個のマト
リックススイッチSW00〜SWnmを用いている。こ
のとき抵抗R0〜Rmを(R1+R2+R3+…Rx)
=(x・R0)/(m−x)としxを0とmを含む間の
数とすれば、スイッチSW0xが押された場合は、A/
Dコバータ入力端子AD0に入力される電圧V0SW0
xは(x/16)・VDDとなる。
2. Description of the Related Art A conventional analog key scan circuit, as shown in FIG.
n×m matrix switches SW00 to SWnm of the scan switch unit 3 are used via a power supply unit 4 having a pull-up resistor R0 for each terminal of ADn. At this time, resistors R0 to Rm are (R1+R2+R3+...Rx)
= (x・R0)/(m-x), and if x is a number between 0 and m, then when switch SW0x is pressed, A/
Voltage V0SW0 input to D converter input terminal AD0
x becomes (x/16)·VDD.

【0003】したがって各A/Dコンバータ入力端子A
D0〜ADnについて端子に入力されている電圧を順次
読み込むことによりスイッチSW00〜SWnmのどの
キーが押されたかを判断することができる。ただし、一
般的にA/Dコバータの精度と、抵抗の精度等により4
ビットA/Dコンバータでは1端子あたり6個程度のス
イッチをスキャンすることが実用的である。
Therefore, each A/D converter input terminal A
By sequentially reading the voltages input to the terminals for D0 to ADn, it is possible to determine which key among the switches SW00 to SWnm has been pressed. However, in general, depending on the accuracy of the A/D converter and the accuracy of the resistor, etc.
In a bit A/D converter, it is practical to scan about six switches per terminal.

【0004】0004

【発明が解決しようとする課題】この従来のマイクロコ
ンピュータのキー・スキャン回路は、1つのA/Dコン
バータ端子には6個程度のスイッチしか使用できないた
め、多くのスイッチをスキャンするためにはA/Dコン
バータ端子が数本必要であるという問題点があった。
[Problems to be Solved by the Invention] This conventional microcomputer key scan circuit can only use about six switches for one A/D converter terminal, so in order to scan many switches, it is necessary to There was a problem in that several /D converter terminals were required.

【0005】[0005]

【課題を解決するための手段】本発明のマイクロコンピ
ュータのキー・スキャン回路は、キーマトリックス部を
構成するマトリックススイッチを押して生成した複数の
入力節点のそれぞれの抵抗分圧電圧をマイクロコンピュ
ータのA/Dコンバータ端子で検出するマイクロコンピ
ュータのキー・スキャン回路において、前記キーマトリ
ックス部のそれぞれの前記入力節点に前記マイクロコン
ピュータのそれぞれ対応する出力ポートから分圧源電圧
を供給しそれぞれの前記入力節点をダイオードを介して
一ケのA/Dコンバータ端子に接続するインターフェイ
ス部を設けて構成されている。
[Means for Solving the Problems] A key scan circuit for a microcomputer according to the present invention applies resistor-divided voltages of each of a plurality of input nodes generated by pressing a matrix switch constituting a key matrix section to an A/ In a key scan circuit of a microcomputer that is detected by a D converter terminal, a divided voltage source voltage is supplied from each corresponding output port of the microcomputer to each of the input nodes of the key matrix section, and each of the input nodes is connected to a diode. It is configured by providing an interface section that connects to one A/D converter terminal via a terminal.

【0006】[0006]

【実施例】次に本発明について図面を参照して説明する
。図1は本発明の一実施例のブロック図である。マイク
ロコンピュータ1のn個の出力ポートP0〜Pnにそれ
ぞれインターフェイス部2の抵抗R0〜Rnを介して図
2に示した従来のスキャンスイッチ部3の入力節点N1
〜Nnが接続されており、インターフェイス部2は節点
N1〜NnからそれぞれダイオードD0〜Dnを介して
マイクロコンピュータ1のA/Dコンバータ入力端子A
Dに接続されている。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, the present invention will be explained with reference to the drawings. FIG. 1 is a block diagram of one embodiment of the present invention. The input node N1 of the conventional scan switch section 3 shown in FIG.
~Nn are connected, and the interface unit 2 connects the A/D converter input terminal A of the microcomputer 1 from the nodes N1 to Nn through the diodes D0 to Dn, respectively.
Connected to D.

【0007】今、出力ポートP0に対応するスイッチS
W00〜SW0mをスキャンする場合は、まず、出力ポ
ートP0以外の出力ポートP1〜Pnをすべて“L”レ
ベル出力とし、出力ポートP0のみ“H”レベルを出力
しておく、このときスイッチS00〜S0mのうちの1
個が押されると抵抗R0とR1の交点N1の電圧V0S
W0xはV1をPチャネルトランジスタのオン電圧とす
ると、V0SW0x=(x/16)・(VDD−V1)
となる。
Now, switch S corresponding to output port P0
When scanning W00 to SW0m, first output ports P1 to Pn other than output port P0 at "L" level, and only output port P0 outputs "H" level. At this time, switch S00 to S0m one of them
When the button is pressed, the voltage V0S at the intersection N1 of resistors R0 and R1
W0x is V0SW0x=(x/16)・(VDD-V1) when V1 is the on-voltage of the P-channel transistor.
becomes.

【0008】したがってA/Dコンバータ端子ADに入
力される電圧VADはVAD=V0SW0x−0.6=
(x/16)(VDD=V1−0.6)となる。
Therefore, the voltage VAD input to the A/D converter terminal AD is VAD=V0SW0x-0.6=
(x/16) (VDD=V1-0.6).

【0009】この電圧をA/Dコンバータで読み込むこ
とによりスイッチS00〜S0mのどのスイッチが押さ
れたかを判別することが可能になる。出力ポートP0に
対してのスキャン終了後は同様にしてP1〜Pnをスキ
ャンすることによりすべてのスイッチであるSW00〜
SWnmをスキャンすることができる。なお、ダイオー
ドD0〜Dnは、A/Dコンバータ端子ADに加えられ
た電圧が、他のポートの“L”レベル出力に影響されな
いために使用する。
By reading this voltage with an A/D converter, it becomes possible to determine which switch among the switches S00 to S0m has been pressed. After completing the scan for output port P0, scan P1 to Pn in the same way to set all switches SW00 to SW00.
SWnm can be scanned. Note that the diodes D0 to Dn are used so that the voltage applied to the A/D converter terminal AD is not affected by "L" level outputs from other ports.

【0010】0010

【発明の効果】以上説明したように本発明は、各キーが
押されたときの分圧を生成する電源をマイクロコンピュ
ータの出力ポートから得ることにより、A/Dコンバー
タ端子を1本だけ使用するだけで多数のキーのスキャン
をおこなえるため、A/Dコンバータを他の用途に使用
できる効果や、A/Dコンバータの数によるキーの使用
数量の制限をなくす効果がある。
[Effects of the Invention] As explained above, the present invention uses only one A/D converter terminal by obtaining power from the output port of the microcomputer to generate a partial voltage when each key is pressed. Since a large number of keys can be scanned with just one key, the A/D converter can be used for other purposes, and the number of keys used is no longer limited by the number of A/D converters.

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

【図1】本発明の一実施例のブロック図である。FIG. 1 is a block diagram of one embodiment of the present invention.

【図2】従来のマイクロコンピュータのキー・スキャン
回路の一例のブロック図である。
FIG. 2 is a block diagram of an example of a key scan circuit of a conventional microcomputer.

【符号の説明】[Explanation of symbols]

1    マイクロコンピュータ 2    インターフェイス部 3    キーマトリックス部 4    電源供給部 1 Microcomputer 2 Interface part 3 Key matrix section 4 Power supply section

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】  キーマトリックス部を構成するマトリ
ックススイッチを押して生成した複数の入力節点のそれ
ぞれの抵抗分圧電圧をマイクロコンピュータのA/Dコ
ンバータ端子で検出するマイクロコンピュータのキー・
スキャン回路において、前記キーマトリックス部のそれ
ぞれの前記入力節点に前記マイクロコンピュータのそれ
ぞれ対応する出力ポートから分圧源電圧を供給しそれぞ
れの前記入力節点をダイオードを介して一ケのA/Dコ
ンバータ端子に接続するインターフェイス部を設けたこ
とを特徴とするマイクロコンピュータのキー・スキャン
回路。
Claim 1: A key matrix of a microcomputer that detects, at an A/D converter terminal of the microcomputer, resistor-divided voltages of each of a plurality of input nodes generated by pressing a matrix switch constituting a key matrix section.
In the scan circuit, a divided voltage source voltage is supplied to each of the input nodes of the key matrix section from the corresponding output port of the microcomputer, and each of the input nodes is connected to one A/D converter terminal via a diode. A microcomputer key scan circuit characterized by having an interface section connected to the microcomputer.
JP3022522A 1991-02-18 1991-02-18 Key scan circuit for microcomputer Pending JPH04262413A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3022522A JPH04262413A (en) 1991-02-18 1991-02-18 Key scan circuit for microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3022522A JPH04262413A (en) 1991-02-18 1991-02-18 Key scan circuit for microcomputer

Publications (1)

Publication Number Publication Date
JPH04262413A true JPH04262413A (en) 1992-09-17

Family

ID=12085114

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3022522A Pending JPH04262413A (en) 1991-02-18 1991-02-18 Key scan circuit for microcomputer

Country Status (1)

Country Link
JP (1) JPH04262413A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010218025A (en) * 2009-03-13 2010-09-30 Rhythm Watch Co Ltd Key input device and clock
CN103795423A (en) * 2012-10-29 2014-05-14 苏州工业园区新宏博通讯科技有限公司 Circuit with multiple buttons controlled by single-I/O-port

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010218025A (en) * 2009-03-13 2010-09-30 Rhythm Watch Co Ltd Key input device and clock
CN103795423A (en) * 2012-10-29 2014-05-14 苏州工业园区新宏博通讯科技有限公司 Circuit with multiple buttons controlled by single-I/O-port

Similar Documents

Publication Publication Date Title
US4533903A (en) Analog-to-digital converter
US5371498A (en) Circuit for recognizing key inputs
JPH04262413A (en) Key scan circuit for microcomputer
US4518951A (en) Integrated circuit for a keyboard of an electronic apparatus
JPH0997839A (en) Integrated circuit having selectable function and function selecting method
US4103115A (en) Memory tone dialer
JPS60500843A (en) Digital-to-analog converter array
US4400802A (en) Integrated digital semiconductor circuit
JPS6017261B2 (en) Digital-analog conversion circuit
JPS602809B2 (en) multiplexer circuit
JP2641215B2 (en) Electronic circuit having a data line for carrying a complementary signal
US6005792A (en) Circuit arrangement for a memory cell of a D/A converter
SU628612A1 (en) Digital-analogue converter
JPS6340915Y2 (en)
JP2523190Y2 (en) Key input switching circuit for telephone IC
JPH05342379A (en) One-chip microprocessor
JPS6094532A (en) Programmable logic array circuit
JPH0256116A (en) Ternary value input discrimination device
JPS61196333U (en)
SU1464188A1 (en) Coding device in information transmission systems
JPH0214815B2 (en)
JPH0218494B2 (en)
JPH03148918A (en) D/a converter
JPH0155614B2 (en)
JPH0292044A (en) Transmission circuit