JP2007102643A - Key scanning circuit - Google Patents

Key scanning circuit Download PDF

Info

Publication number
JP2007102643A
JP2007102643A JP2005294170A JP2005294170A JP2007102643A JP 2007102643 A JP2007102643 A JP 2007102643A JP 2005294170 A JP2005294170 A JP 2005294170A JP 2005294170 A JP2005294170 A JP 2005294170A JP 2007102643 A JP2007102643 A JP 2007102643A
Authority
JP
Japan
Prior art keywords
circuit
input
key
chattering removal
signal
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.)
Granted
Application number
JP2005294170A
Other languages
Japanese (ja)
Other versions
JP4670574B2 (en
Inventor
Teruyuki Ozaki
輝行 尾崎
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.)
Kenwood KK
Original Assignee
Kenwood KK
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 Kenwood KK filed Critical Kenwood KK
Priority to JP2005294170A priority Critical patent/JP4670574B2/en
Publication of JP2007102643A publication Critical patent/JP2007102643A/en
Application granted granted Critical
Publication of JP4670574B2 publication Critical patent/JP4670574B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Input From Keyboards Or The Like (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a key scanning circuit, capable of reducing the software processing load of a CPU while ensuring the freedom of design, and also shortening the processing time, from the viewpoint of various problems of a conventional key scanning circuit, and further a key scanning circuit capable of performing rapid processing even if the CPU is in a sleep state. <P>SOLUTION: The key scanning circuit including the CPU, a memory device, an input/output port, and an interruption controller comprises a chattering removal circuit and a bypass circuit of the chattering removal circuit, so that a key input signal is switched either to the chattering removal circuit or to the bypass route by software control. A one-chip microcomputer is used for the CPU or the like, and key scanning function is constituted using each input/output port of GPIO (general purpose input output port). <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明はキースキャン回路に関し、特に、ワンチップマイクロコンピュータを用いて構成する場合に好適なキースキャン回路に関するものである。   The present invention relates to a key scan circuit, and more particularly to a key scan circuit suitable for a configuration using a one-chip microcomputer.

各種コンピュータには、テン・キーを始めとして、種々の入力手段が付加されることが多いが、少ない信号ラインで効率よくキー操作信号をコンピュータに伝達するために、どのキーが操作されたかを検出するキースキャン処理を行う。また、機械的なスイッチを操作してON/OFFすると瞬間的に信号が立ち上がり、もしくは立ち下がるものの、実際には電位がmsオーダーの時間でばたつく。これをチャタリングと云い、計数回路等においてこのばたつきをカウントしてしまうと誤動作の原因となるので、チャタリング除去回路が付加される。従来、チャタリング除去回路の基本的な機能は、キースイッチが操作されたことを検出すると、チャタリングが発生する一定時間キー信号検出をマスキングした後、中央処理装置(Central Processing Unit:以下「CPU」と略す)に割り込み要求を発生するようにしていた。しかし、いずれかのキーが操作される毎に、全体のキー信号検出をマスキングする方法では、マスキング途中に操作された他のキーについても検出できなくなる。そこで、例えば、特開平2−170615「チャタリング防止装置」では、入力されるキーグループ信号夫々について、個別にマスキング手段を備えた方法が提案されている。
また一方、キースキャン回路を実現する方法としては、従来、キースキャン専用のマイクロコンピュータ(カスタムLSI)を使用していたが、近年、ワンチップマイクロコンピュータを用いたものが主流となった。ワンチップマイクロコンピュータ(以下「ワンチップマイコン」という)は、一つの集積回路(Large Scale Integrated Circuit:LSI)チップのなかに、メモリ、入出力インターフェース回路(I/O)、CPU等を構成し、単体でマイクロコンピュータとしての機能を備えたものである。これらワンチップマイコンは、キーボード等のコンピュータ周辺機器に搭載されてメインCPUに代わり夫々の周辺機器の制御を分担することによって、メインCPUの負担を軽減するといった使用方法の他、家電製品、自動車、産業機器、ゲーム機器等、あらゆる分野の装置の制御にも使用されている。
Various computers are often equipped with various input means, including numeric keys, but it is possible to detect which key has been operated in order to efficiently transmit key operation signals to the computer with fewer signal lines. Perform key scan processing. Further, when a mechanical switch is operated and turned on / off, the signal rises or falls momentarily, but in reality, the potential fluctuates in the order of ms. This is called chattering, and if this fluttering is counted in a counting circuit or the like, it causes a malfunction, so a chattering removal circuit is added. Conventionally, the basic function of the chattering removal circuit is that after detecting that a key switch is operated, the key signal detection for which a chattering occurs is masked for a certain period of time, and then a central processing unit (hereinafter referred to as “CPU”). An interrupt request was generated. However, with the method of masking the entire key signal detection every time any key is operated, it becomes impossible to detect other keys operated during masking. Therefore, for example, Japanese Patent Laid-Open No. 2-170615 “chattering prevention device” proposes a method in which masking means is individually provided for each input key group signal.
On the other hand, as a method for realizing a key scan circuit, a microcomputer (custom LSI) dedicated to key scan has been conventionally used, but in recent years, a one-chip microcomputer has become mainstream. A one-chip microcomputer (hereinafter referred to as “one-chip microcomputer”) includes a memory, an input / output interface circuit (I / O), a CPU, and the like in one integrated circuit (Large Scale Integrated Circuit: LSI) chip. It has a function as a microcomputer by itself. These one-chip microcomputers are mounted on computer peripheral devices such as a keyboard and share the control of each peripheral device instead of the main CPU, thereby reducing the burden on the main CPU, as well as home appliances, automobiles, It is also used to control devices in various fields such as industrial equipment and game machines.

図8は、ワンチップマイコンの一例を示すブロック構成図である。この例に示すワンチップマイコン100は、全体の制御を行うCPU101と、外部メモリ等に接続する外部パラレルコントローラ(EXT MEMORY INTERFACE:外部メモリインターフェース)102と、前記CPU101の制御を受けることなくデータの転送を行うDMA(Direct Memory Controller)103と、内部RAM(INTERNAL RAM)104と、内部ROM(INTERNAL ROM)105と、割り込みコントローラ(ICTL)106と、アナログ・デジタル変換回路(ADC)107と、デジタル・アナログ変換回路(DAC)108と、同期式シリアルインターフェース(SPI)109と、パラレル信号をシリアル信号に変換したり、逆にシリアルデバイスから送られるシリアル信号をパラレル信号に変換したりする調歩同期シリアルインターフェース(Universal Asynchronous Receiver Transmitter:UART)110と、汎用入出力ポートとしての機能を有するパラレルインターフェース(General Purpose Input Output Port:GPIO)111と、キースキャンの対象となる外部キーボード等のキーマトリクスを接続するキースキャン回路112と、カウンターを搭載し時間を計数するタイマ(TIMER)113と、低消費電力モードに移行する制御を行う電源管理部(POWER MANAGEMENT)114と、各クロック信号を発生し各機能ブロック回路にクロック信号の供給/停止を制御するクロック回路(CLKGEN)115とを備え、夫々は内部バスライン116で接続されている。   FIG. 8 is a block diagram showing an example of a one-chip microcomputer. A one-chip microcomputer 100 shown in this example includes a CPU 101 that performs overall control, an external parallel controller (EXT MEMORY INTERFACE) 102 connected to an external memory, and the like, and transfers data without being controlled by the CPU 101. DMA (Direct Memory Controller) 103, internal RAM (INTERNAL RAM) 104, internal ROM (INTERNAL ROM) 105, interrupt controller (ICTL) 106, analog / digital conversion circuit (ADC) 107, digital An analog conversion circuit (DAC) 108, a synchronous serial interface (SPI) 109, and an asynchronous serial interface that converts a parallel signal into a serial signal, or conversely converts a serial signal sent from a serial device into a parallel signal. (Universa l Asynchronous Receiver Transmitter (UART) 110, parallel interface (General Purpose Input Output Port: GPIO) 111, which functions as a general-purpose input / output port, and key scan that connects a key matrix such as an external keyboard to be scanned A circuit 112, a timer (TIMER) 113 that is equipped with a counter and counts time, a power management unit (POWER MANAGEMENT) 114 that performs control to shift to a low power consumption mode, and generates each clock signal to each functional block circuit A clock circuit (CLKGEN) 115 for controlling supply / stop of the clock signal is provided, and each is connected by an internal bus line 116.

図9は従来の、ワンチップマイコンのキースキャン回路112を使用したキースキャン回路であって、前記キースキャン回路112はターゲットとするキーボードのキーマトリクス117に合わせた専用のハードウエア構成を有している。図10は、通常ワンチップパソコンに搭載されているGPIO111を利用したキースキャン回路の例を示す概要構成図である。いずれの回路においても、キースキャン回路112やGPIO111の入出力ポートにキーマトリクス117の入出力端が接続され、夫々の出力ポートから順次所要信号が供給され、その間に入力ポートの電位を順次スキャンしてセンシングすることによって、キーマトリクス117のいずれかのキーが操作されると、割り込みコントローラ(ICTL)106を介してCPU101に割り込みを実行し、CPU101の制御によって操作されたキーを検出して、図示を省略したメインCPUに伝達するものである。
特開平2−170615号公報
FIG. 9 shows a conventional key scan circuit using a key scan circuit 112 of a one-chip microcomputer. The key scan circuit 112 has a dedicated hardware configuration that matches the key matrix 117 of the target keyboard. Yes. FIG. 10 is a schematic configuration diagram showing an example of a key scan circuit using the GPIO 111 normally mounted on a one-chip personal computer. In any circuit, the input / output terminals of the key matrix 117 are connected to the input / output ports of the key scan circuit 112 and the GPIO 111, and necessary signals are sequentially supplied from the respective output ports. When one of the keys in the key matrix 117 is operated by sensing, the CPU 101 is interrupted via the interrupt controller (ICTL) 106, and the key operated by the control of the CPU 101 is detected and illustrated. Is transmitted to the main CPU in which is omitted.
Japanese Patent Laid-Open No. 2-170615

しかしながら、上述した従来技術によれば、夫々、次のような問題点があった。先ず、特許文献1に開示されたように全ての制御をソフトウエアによって実現すると、CPUの負担が増えて処理が遅くなる。公報に例示されたPCMレコーダのように家庭用電子機器の簡単な設定に使用するキーボードであれば処理負担も少ないが、パソコン等のキーボードのように短時間に多くのキー操作が行われるものにおいては、CPUの処理能力として高速のものが必要となる欠点があった。
また、ワンチップマイコンを使用すると、メインCPUの負担軽減が可能であるが、図9に示すように、キーボード等毎に合わせたキースキャン専用の回路(ハードウエア)を備えたものでは、入出力ポート数が固定されている他、チャタリング除去期間(時間的なタイミング)がある程度固定されているので、キーの数が異なる場合や種類の異なるキーボードに対しては、夫々に合わせた構成のハードウエアを用意する必要があり、設計の自由度が大幅に損なわれるものであった。
一方、図10に示したように、ワンチップマイコンのGPIOを利用するものにおいては、設計の自由度は向上するが、GPIOは基本的に入出力ポートの制御機能であることから、ソフトウエアによってチャタリング除去機能の全てを制御する必要があり、キースキャン制御に関わるソフトウエアの処理量が大幅に増えるという問題があった。
また一般に、コンピュータでは一定時間新たな操作をしない場合、省電力等の観点からCPUをスリープ状態にするが、スリープ状態から通常の起動状態に立ち上げる際には、僅かではあるが所要時間が必要となる。キースキャン操作において、関連するCPUがスリープ状態にある場合、キー操作が発生したとき、先ずCPUをスリープ状態から立ち上げるための時間が必要で、その次にチャタリング除去期間が必要となるので、両方の時間が時系列的に加算されたものとなり迅速な処理を妨げる原因となっていた。
本発明は、このような従来のキースキャン回路の諸問題に鑑みてなされたものであって、設計の自由度を確保しながら、ソフトウエア処理負担を軽減することができるキースキャン回路、更には、CPUがスリープ状態にある際にも、迅速な処理を可能とした、キースキャン回路を提供することを目的としている。
However, according to the above-described prior art, there are the following problems. First, if all the controls are realized by software as disclosed in Patent Document 1, the load on the CPU increases and the processing is slowed down. In the case of a keyboard that is used for simple setting of a home electronic device such as the PCM recorder exemplified in the publication, the processing load is small, but in the case where many key operations are performed in a short time like a keyboard of a personal computer or the like. However, there is a drawback that a high processing speed is required for the CPU.
If a one-chip microcomputer is used, the burden on the main CPU can be reduced. However, as shown in FIG. In addition to the fixed number of ports, the chattering removal period (temporal timing) is fixed to some extent, so if the number of keys is different or different types of keyboards, the hardware is configured accordingly. Therefore, the degree of freedom of design is greatly impaired.
On the other hand, as shown in FIG. 10, in the case of using the one-chip microcomputer GPIO, the degree of freedom of design is improved, but the GPIO is basically a control function of the input / output port. There is a problem that it is necessary to control all of the chattering removal function, and the processing amount of software related to the key scan control is greatly increased.
In general, if the computer does not perform a new operation for a certain period of time, the CPU is put into the sleep state from the viewpoint of power saving, etc., but it takes a little time to start from the sleep state to the normal startup state. It becomes. In the key scan operation, if the related CPU is in the sleep state, when a key operation occurs, it takes time to first bring up the CPU from the sleep state, and then a chattering removal period is required. The time was added in time series, which hindered rapid processing.
The present invention has been made in view of such problems of the conventional key scan circuit, and is capable of reducing the software processing burden while ensuring the degree of freedom of design, and further, An object of the present invention is to provide a key scan circuit that enables quick processing even when the CPU is in a sleep state.

上記目的を達成するため、本発明の請求項1のキースキャン回路では、キースキャン等の制御を行う中央処理装置(CPU)と、プログラムや各種データを記憶しておくメモリ装置と、複数の入出力手段を有する入出力ポートと、前記CPUに対し割り込み処理を実行する割り込みコントローラとを備えたキースキャン回路において、前記入出力ポートの入力端に、チャタリング除去回路と、該チャタリング除去回路バイパス回路と、キースイッチ入力信号を前記チャタリング除去回路か前記バイパス回路かに切替える切替回路とを設け、前記切替回路をソフトウエアで制御するように構成したことを特徴としている。
請求項2記載のキースキャン回路では、請求項1において、前記チャタリング除去回路が、縦続接続した複数のフリップフロップ回路(FF回路)と、該フリップフロップ回路にクロック信号を供給する手段と、前記各フリップフロップ回路のQ出力信号を入力信号とする論理和回路とを備え、前記キースイッチ信号を最前段のフリップフロップ回路のD入力端に供給すると共に、他のフリップフロップ回路のD入力端には、その前段のフリップフロップ回路のQ端子出力を供給するように構成したことを特徴とする。
請求項3記載のキースキャン回路では、請求項1又は2において、前記チャタリング除去回路はクロック信号を分周する可変分周機能を備え、その分周比をソフトウエアでコントロールすることによって、チャタリング除去期間を制御できるように構成したことを特徴としている。
請求項4記載のキースキャン回路では、請求項1乃至3の何れか一項において、前記中央処理装置(CPU)がスリープ状態でキースイッチ信号が入力されたとき、前記チャタリング除去回路をバイパスしてキースイッチ信号を前記入力ポートに供給し、所要時間経過後に前記チャタリング除去回路側に切替えるように前記切替回路を制御する手段を備えたことを特徴としている。
In order to achieve the above object, in the key scan circuit according to claim 1 of the present invention, a central processing unit (CPU) that performs control such as key scan, a memory device that stores programs and various data, and a plurality of input devices. In a key scan circuit comprising an input / output port having an output means and an interrupt controller for executing interrupt processing for the CPU, a chattering removal circuit, a chattering removal circuit bypass circuit, and an input terminal of the input / output port And a switching circuit for switching the key switch input signal to the chattering elimination circuit or the bypass circuit, and the switching circuit is controlled by software.
According to a second aspect of the present invention, there is provided the key scan circuit according to the first aspect, wherein the chattering removal circuit includes a plurality of cascade-connected flip-flop circuits (FF circuits), means for supplying a clock signal to the flip-flop circuits, An OR circuit using the Q output signal of the flip-flop circuit as an input signal, and supplying the key switch signal to the D input terminal of the flip-flop circuit in the foremost stage, and at the D input terminal of the other flip-flop circuit The Q terminal output of the preceding flip-flop circuit is supplied.
3. The key scan circuit according to claim 1, wherein the chattering removal circuit has a variable frequency dividing function for dividing a clock signal, and the chattering removal is performed by controlling the frequency division ratio by software. The feature is that the period can be controlled.
The key scan circuit according to claim 4, wherein when the central processing unit (CPU) is in a sleep state and a key switch signal is input, the chattering removal circuit is bypassed. It is characterized in that it comprises means for supplying a key switch signal to the input port and controlling the switching circuit so as to switch to the chattering removal circuit side after a lapse of a required time.

本発明の請求項1のキースキャン回路では、キースキャン等の制御を行う中央処理装置(CPU)と、プログラムや各種データを記憶しておくメモリ装置と、複数の入出力手段を有する入出力ポートと、前記CPUに対し割り込み処理を実行する割り込みコントローラとを備えた、例えばワンチップマイコンを使用したキースキャン回路において、前記入出力ポートの入力端に、チャタリング除去回路と、該チャタリング除去回路バイパス回路と、キースイッチ入力信号を前記チャタリング除去回路か前記バイパス回路かのどちらかに切替える切替回路とを設け、前記切替回路をソフトウエアで制御するように構成したので、必要に応じてチャタリング除去回路をバイパスし、直接キースイッチ信号を割り込みコントローラを介して前記CPUに供給することが可能となる。また、前記入出力ポートをワンチップマイコンに搭載された汎用入出力ポート(GPIO)を使用すれば、ターゲットとするキーボード等の種類に対応して、入力又は出力ポート数を変更することが、ソフトウエア制御によって可能となり、設計の自由度が大幅に向上する。
請求項2記載のキースキャン回路では、請求項1において、前記チャタリング除去回路が、縦続接続した複数のフリップフロップ回路(FF回路)と、該フリップフロップ回路にクロック信号を供給する手段と、前記各フリップフロップ回路のQ出力信号を入力信号とする論理和回路とを備え、前記キースイッチ信号を最前段のフリップフロップ回路のD入力端に供給すると共に、他の回路のD端子には、その前段回路のQ端子出力を供給するようにチャタリング除去回路をハードウエアで構成したので、CPUの負荷が軽減され、処理のスピードアップを図ることが可能となる。
In the key scan circuit according to the first aspect of the present invention, a central processing unit (CPU) for performing control such as key scan, a memory device for storing programs and various data, and an input / output port having a plurality of input / output means A key scan circuit using, for example, a one-chip microcomputer, and a chattering removal circuit and a chattering removal circuit bypass circuit at the input end of the input / output port. And a switching circuit for switching the key switch input signal to either the chattering removal circuit or the bypass circuit, and the switching circuit is configured to be controlled by software. Bypass the direct key switch signal through the interrupt controller with the CP It can be supplied to the. In addition, if a general-purpose input / output port (GPIO) mounted on a one-chip microcomputer is used as the input / output port, it is possible to change the number of input or output ports according to the type of the target keyboard or the like. This is made possible by wear control, which greatly improves the degree of freedom in design.
According to a second aspect of the present invention, there is provided the key scan circuit according to the first aspect, wherein the chattering removal circuit includes a plurality of cascade-connected flip-flop circuits (FF circuits), means for supplying a clock signal to the flip-flop circuits, A logical sum circuit that uses the Q output signal of the flip-flop circuit as an input signal, and supplies the key switch signal to the D input terminal of the flip-flop circuit in the forefront stage. Since the chattering removal circuit is configured by hardware so as to supply the Q terminal output of the circuit, the load on the CPU is reduced and the processing speed can be increased.

請求項3記載のキースキャン回路では、請求項1又は2において、前記チャタリング除去回路はクロック信号を分周する可変分周機能を備え、その分周比をソフトウエアでコントロールすることによってチャタリング除去期間を制御できるように構成したので、ターゲットとするキー入力装置のチャタリング発生時間に合わせて、チャタリング除去タイミング時間を変更することが可能となる。
請求項4記載のキースキャン回路では、請求項1乃至3において、前記中央処理装置(CPU)がスリープ状態でキースイッチ信号が入力されたとき、前記チャタリング除去回路をバイパスしてキースイッチ信号を前記入力ポートに供給し、所要時間経過後に前記チャタリング除去回路側に切替えるように前記切替回路を制御する手段を備えたので、CPUがスリープ状態にあるとき、キースイッチ入力発生に際して直ちにCPUを起動させ、その後にチャタリング除去回路を機能させるように制御することが可能となり、夫々に要する時間を一部並列にすることができるので処理の迅速化が可能となる。
4. The key scan circuit according to claim 3, wherein the chattering removal circuit has a variable frequency dividing function for dividing a clock signal, and the chattering removal period is controlled by software by controlling the frequency division ratio. Therefore, the chattering removal timing time can be changed in accordance with the chattering occurrence time of the target key input device.
A key scan circuit according to a fourth aspect of the present invention is the key scan circuit according to the first to third aspects, wherein when the central processing unit (CPU) is in a sleep state and a key switch signal is input, the chattering removal circuit is bypassed and the key switch signal is transmitted. Since it is provided with means for controlling the switching circuit to switch to the chattering removal circuit side after the required time has elapsed, when the CPU is in a sleep state, the CPU is immediately activated upon occurrence of a key switch, Thereafter, the chattering removal circuit can be controlled to function, and the time required for each can be partially parallelized, so that the processing can be speeded up.

以下、本発明を図に示した実施形態を用いて詳細に説明する。但し、この実施形態に記載される構成要素、種類、組み合わせ、形状、その相対配置などは特定的な記載がない限り、この発明の範囲をそれのみに限定する主旨ではなく単なる説明例に過ぎない。
図1は、本発明に係るキースキャン回路の一実施態様例を示すブロック構成図である。この例に示すキースキャン回路1は、キースキャン回路1の制御を行う中央処理装置(CPU)2と、キースイッチが操作されたとき前記CPUに割り込みを実行する割り込みコントローラ(ICTL)3と、キースキャン部4とを含み、これらは内部バスライン5で接続されている。更に、前記キースキャン部4は、汎用入出力ポートGPIO6が含まれており、その入力ポートのうち、外部のキーボード等のキーマトリクス7からキースイッチ信号が供給される第一入力ポートIN1、第二入力ポートIN2、第三入力ポートIN3夫々には、チャタリング除去回路ch1、ch2、ch3とそれをバイパスするバイパスルートBP1、BP2、BP3と両者を切替えるスイッチSW1、SW2、SW3とが付加されている。そして、制御のターゲットである外部キーボード等のキーマトリクス7(この例では3×3マトリクス)のY軸信号ライン(横ライン)Y1、Y2、Y3は、夫々、出力端子OUT1、OUT2、OUT3を介してGPIO6の三つの出力ポートOP1、OP2、OP3に直接接続するが、X軸信号ライン(縦ライン)X1、X2、X3は、端子I1、I2、I3に接続され、更に、前記切替スイッチSW1、SW2、SW3夫々のコモン端子を介して前記GPIO6の入力ポートIN1、IN2、IN3に接続するように構成されている。なお、入力端I1、I2、I3夫々と電源ラインVCCとの間に挿入されている抵抗器Rは、夫々に電圧を印可するためのプルアップ抵抗である。
Hereinafter, the present invention will be described in detail with reference to embodiments shown in the drawings. However, the components, types, combinations, shapes, relative arrangements, and the like described in this embodiment are merely illustrative examples and not intended to limit the scope of the present invention only unless otherwise specified. .
FIG. 1 is a block diagram showing an embodiment of a key scan circuit according to the present invention. The key scan circuit 1 shown in this example includes a central processing unit (CPU) 2 that controls the key scan circuit 1, an interrupt controller (ICTL) 3 that executes an interrupt to the CPU when a key switch is operated, and a key A scan unit 4 is included, and these are connected by an internal bus line 5. Further, the key scanning unit 4 includes a general-purpose input / output port GPIO6. Among the input ports, a first input port IN1 and a second input port to which a key switch signal is supplied from a key matrix 7 such as an external keyboard. Chattering removal circuits ch1, ch2, and ch3 and bypass routes BP1, BP2, and BP3 that bypass the chattering removal circuits ch1, SW2, and SW3 are added to the input port IN2 and the third input port IN3, respectively. The Y-axis signal lines (horizontal lines) Y1, Y2, and Y3 of the key matrix 7 (3 × 3 matrix in this example) such as an external keyboard that is the control target are respectively connected to the output terminals OUT1, OUT2, and OUT3. Are connected directly to the three output ports OP1, OP2, and OP3 of the GPIO 6. The X-axis signal lines (vertical lines) X1, X2, and X3 are connected to terminals I1, I2, and I3, and the changeover switch SW1, It is configured to be connected to the input ports IN1, IN2, and IN3 of the GPIO 6 through the common terminals of SW2 and SW3. The resistor R inserted between each of the input terminals I1, I2, and I3 and the power supply line VCC is a pull-up resistor for applying a voltage to each.

また、図2に示すキースキャン回路は、構成は前記図1と全く同一であるが、前記切替スイッチSW1、SW2、SW3が前記チャタリング除去回路ch1、ch2、ch3をバイパスする側に設定されている部分が相違しており、その説明については後述する。
この構成において、先ず、キースキャン回路の基本的な動作について説明する。この回路において電源が投入されると、種々の制御方法があるが、例えば、GPIO6の出力ポートOP1、OP2、OP3を介してキーマトリクス7のY軸信号ラインY1、Y2、Y3を一定時間毎に低電位に切替えるスキャン制御を行う(具体的には、順次アースする)、その際一つのY軸信号ラインに低電位を与えている間に、GPIO6の入力ポートIN1、IN2、IN3を順次スキャンすることによって、各入力端子I1、I2、I3の電位、即ち、キーマトリクス7のX軸信号ラインX1、X2、X3の電位を監視する。このとき各入力端子I1、I2、I3には高電位がプルアップ抵抗Rを介して印可されているから、キーが押されていない場合は前記高電位が保持されているが、キーが操作されている(押されている)ものについてはY軸ラインと接続されるので、低電位となる。従って、前記CPU2は、出力ポート側のY軸信号ラインのスキャン情報と入力ポートのX軸信号ラインのスキャン情報及び各ポートの電位情報とから、押されたキーがどれであるかを判断することができる。
なお、電位の関係は、この例に限る必要はなく逆に出力ポートから高電位を供給し、入力ポートではスキャン操作によって高電位を検出する方式であってもかまわない。
The key scan circuit shown in FIG. 2 has the same configuration as that shown in FIG. 1, but the change-over switches SW1, SW2, and SW3 are set to bypass the chattering removal circuits ch1, ch2, and ch3. The parts are different, and the description thereof will be described later.
In this configuration, first, the basic operation of the key scan circuit will be described. When power is turned on in this circuit, there are various control methods. For example, the Y-axis signal lines Y1, Y2, and Y3 of the key matrix 7 are set at regular intervals via the output ports OP1, OP2, and OP3 of the GPIO 6. Scan control for switching to a low potential is performed (specifically, grounding is sequentially performed). In this case, the input ports IN1, IN2, and IN3 of the GPIO 6 are sequentially scanned while a low potential is applied to one Y-axis signal line. Thus, the potentials of the input terminals I1, I2, and I3, that is, the potentials of the X-axis signal lines X1, X2, and X3 of the key matrix 7 are monitored. At this time, since a high potential is applied to each of the input terminals I1, I2, and I3 through the pull-up resistor R, the high potential is held when the key is not pressed, but the key is operated. Those that are pressed (pressed) are connected to the Y-axis line, and therefore have a low potential. Therefore, the CPU 2 determines which key is pressed from the scan information of the Y-axis signal line on the output port side, the scan information of the X-axis signal line of the input port, and the potential information of each port. Can do.
Note that the potential relationship need not be limited to this example, and conversely, a high potential may be supplied from the output port, and a high potential may be detected by a scanning operation at the input port.

図3は、本発明において使用するチャタリング除去回路ch1、ch2、ch3の一例を示す構成図である。この例では、縦続接続した4つの遅延型フリップフロップ回路(Delay flip-flop:D−FF)8乃至11と、各フリップフロップ回路に供給するクロック信号を分周する分周回路(DIVIDER)12と、前記各フリップフロップ回路のQ出力信号を入力信号とする論理和回路13とを備え、外部からのキースイッチ信号を最前段のフリップフロップ回路8のD入力端に供給すると共に、他のフリップフロップ回路のD入力端には、その前段のフリップフロップ回路のQ端子出力を供給するように構成したものである。遅延型フリップフロップ回路(D−FF回路)は周知のとおりD端子に入力された状態が、クロック信号の供給に呼応してQ端子に伝達されるので、一つのフリップフロップ回路で一クロック分信号を遅延させることになる。この例では、4段縦続接続しているので、最前段のフリップフロップ回路8のD入力端子の高/低電位が順次伝達され、結果的に四クロック分遅延して第四のフリップフロップ11のQ端子に至る。また、論理和回路13は、入力信号の全てが低電位の時にのみ、その出力が低電位となるので、入力のいずれか一つでも高電位の場合出力は高電位となる。即ち、論理和回路13の入力の一つでも高電位であると、その出力は高電位となる。   FIG. 3 is a block diagram showing an example of chattering removal circuits ch1, ch2, and ch3 used in the present invention. In this example, four delay flip-flop circuits (Delay flip-flops: D-FF) 8 to 11 connected in cascade, and a frequency divider (DIVIDER) 12 that divides a clock signal supplied to each flip-flop circuit, A logical sum circuit 13 having the Q output signal of each flip-flop circuit as an input signal, and supplying an external key switch signal to the D input terminal of the flip-flop circuit 8 at the front stage, The D input terminal of the circuit is configured to supply the Q terminal output of the preceding flip-flop circuit. The delay type flip-flop circuit (D-FF circuit), as is well known, transmits the state input to the D terminal to the Q terminal in response to the supply of the clock signal. Will be delayed. In this example, since four stages are connected in cascade, the high / low potential of the D input terminal of the flip-flop circuit 8 at the front stage is sequentially transmitted, and as a result, the fourth flip-flop 11 is delayed by four clocks. Leads to Q terminal. Further, since the output of the OR circuit 13 becomes a low potential only when all of the input signals are at a low potential, the output becomes a high potential when any one of the inputs is at a high potential. That is, if even one of the inputs of the OR circuit 13 is at a high potential, the output becomes a high potential.

図4及び図5は、前記図3に示したチャタリング除去回路の動作を説明するための図であって、図4はチャタリングが発生しない場合、図5はチャタリングが発生する場合の信号波形図である。以下、この信号波形図を参照しながら、本発明のスキャン回路の動作例を説明する。
同図(a)は前記フリップフロップ回路に供給されるクロック信号波形である。この図に示すチャタリング除去回路に属するキーが押されると、上述したように前記GPIO6の入力端子IN1、IN2、IN3のうち、その系統に属する入力端子は同図(b)に示すように低電位となる。この信号が第一段のフリップフロップ回路8のD端子に入力されると、次のクロック信号入力に呼応して、当該フリップフロップ回路8のQ出力端子に移行し、同図(c)に示すように出力Aとして低電位が伝達される。同様にして、この信号は順次後段のフリップフロップ回路9、10、11に伝達されて、図4(d)に示す出力B、同図(e)の出力C、同図(f)の出力Dとなる。このときチャタリングが発生しないものとすれば、押されたキーは、少なくともチャタリング除去期間は同一状態を保つので、各フリップフロップ回路8乃至11のQ出力端の信号A、B、C、Dは全て低電位となって、論理回路13に入力される。その結果、前記論理和回路13の出力は低電位となって、前記図1のGPIO6の該当する入力ポート(IN)に供給される。
4 and 5 are diagrams for explaining the operation of the chattering removal circuit shown in FIG. 3. FIG. 4 is a signal waveform diagram when chattering does not occur, and FIG. 5 is a signal waveform diagram when chattering occurs. is there. Hereinafter, an operation example of the scan circuit of the present invention will be described with reference to this signal waveform diagram.
FIG. 5A shows a clock signal waveform supplied to the flip-flop circuit. When a key belonging to the chattering removal circuit shown in this figure is pressed, the input terminals belonging to the system among the input terminals IN1, IN2, and IN3 of the GPIO 6 are low potentials as shown in FIG. It becomes. When this signal is input to the D terminal of the first-stage flip-flop circuit 8, the signal is transferred to the Q output terminal of the flip-flop circuit 8 in response to the next clock signal input, as shown in FIG. Thus, a low potential is transmitted as the output A. Similarly, this signal is sequentially transmitted to the subsequent flip-flop circuits 9, 10, and 11, and output B shown in FIG. 4D, output C shown in FIG. 4E, and output D shown in FIG. It becomes. Assuming that chattering does not occur at this time, the pressed key maintains the same state at least during the chattering removal period. Therefore, the signals A, B, C, and D at the Q output terminals of the flip-flop circuits 8 to 11 are all A low potential is input to the logic circuit 13. As a result, the output of the OR circuit 13 becomes a low potential and is supplied to the corresponding input port (IN) of the GPIO 6 in FIG.

図4は、チャタリングが発生する場合の信号波形図であり、図4(b)に示すように、押されたキー信号入力が一旦低電位になった後、例えば三クロック後に再び高電位になった場合は、フリップフロップ回路8のD端子に入力した低電位が最後のフリップフロップ回路11のQ出力に伝達される時点では、初段フリップフロップ回路8のQ出力信号(出力A)の電位が高電位になっているので、結局、論理回路13の出力が低電位にならず、高電位がCPU2に伝達される。
このようにしてチャタリングが発生したことが判断できれば、その後の処理は種々の方法で対応可能である。例えば、チャタリング発生が検出されない場合は、直ちに検出されたキー信号が真のものとして処理を開始することもできるし、あるいはチャタリング発生が検出されたときは、一度だけキー操作が行われたものとして処理するか、又は、チャタリング除去期間経過後の入力検出信号のみを真のキー信号入力として処理する等の対応を行うことができる。上述したように、チャタリングが発生していないことが確認されたとき、直ちに真のキー入力として処理する方法は、チャタリング発生度合いの少ないキーボードを使用する場合、迅速で効率的な処理を実施し得る可能性がある。
FIG. 4 is a signal waveform diagram when chattering occurs. As shown in FIG. 4B, after the pressed key signal input once becomes low potential, it becomes high potential again after, for example, three clocks. In this case, when the low potential input to the D terminal of the flip-flop circuit 8 is transmitted to the Q output of the last flip-flop circuit 11, the potential of the Q output signal (output A) of the first-stage flip-flop circuit 8 is high. As a result, the output of the logic circuit 13 does not become a low potential, and a high potential is transmitted to the CPU 2 after all.
If it can be determined that chattering has occurred in this way, the subsequent processing can be handled by various methods. For example, if chattering is not detected, processing can be started as soon as the detected key signal is true, or if chattering is detected, it is assumed that the key operation has been performed only once. It is possible to take measures such as processing or processing only the input detection signal after the chattering removal period has passed as a true key signal input. As described above, when it is confirmed that chattering does not occur, the method of processing as a true key input immediately can perform a quick and efficient process when using a keyboard with a low degree of chattering. there is a possibility.

図6は、本発明の他の実施態様例を説明するめのフローチャートであり、この例に示す処理手順は、前記CPU2がスリープ状態にあるときの処理に関するものである。即ち、処理がスタートすると、先ず、キースイッチの操作を待機し(S1)、キー操作が行われたことを検出すると(S1 Yes)CPU2がスリープ状態であるか否かを判断し、CPU2がスリープ状態である場合は(S2 Yes)、前記図1、2に示したチャタリング除去回路chのバイパスルートBPに前記スイッチSWを切替える(S3)。その後所定時間(チャタリング除去期間)が経過したか否かを判断し、その経過を待って(S4 Yes)前記スイッチSWをチャタリング除去回路ch側に切替え(S5)、チャタリング除去機能を経て、キースイッチ信号の処理をCPU2に伝達する(S6)。なお、前記S2において、CPU2がスリープ状態ではないと判断したときは(S2 No)、S5に移行して前記スイッチSWをチャタリング除去回路側に切替え(S5)、チャタリング機能を動作させてキースイッチ信号をCPU2に伝達する。この例によれば、スリープ状態にあるCPU2に直接キースキャン処理を行わせる場合に比べて処理を速くする効果がある。即ち、CPU2がスリープ状態である場合、前記図2に示したようにキースキャン部4のチャタリン部除去回路をバイパスするバイパスルートBP1乃至BP3のいずれかを介して、キースイッチ信号をGPIO6の入力ポートIN1乃至IN3のどれかに伝達するので、この信号が直ちにCPU2に供給され、あるいはCPU2のスリープを解除する制御を行う回路に伝達されるので、チャタリング除去期間を経過した後に、同様にCPU2のスリープを解除するよりCPU2の立ち上がりが早くなることは明らかである。そして、チャタリン部除去回路chをバイパスしてCPU2にスリープ状態解除トリガを供給したら、CPU2の立ち上がりを待つことなく直ちにチャタリング除去回路側に前記スイッチSWを切替える。この処理によればチャタリング除去時間経過中にCPU2が立ち上がり、チャタリング除去期間経過後には、直ちにキースキャン処理を開始することができるので、迅速な処理が可能となる。   FIG. 6 is a flowchart for explaining another embodiment of the present invention, and the processing procedure shown in this example relates to processing when the CPU 2 is in a sleep state. That is, when the process is started, first, the operation of the key switch is waited (S1). When the key operation is detected (S1 Yes), it is determined whether or not the CPU 2 is in the sleep state, and the CPU 2 is in the sleep state. If it is in the state (S2 Yes), the switch SW is switched to the bypass route BP of the chattering removal circuit ch shown in FIGS. 1 and 2 (S3). After that, it is determined whether or not a predetermined time (chattering removal period) has elapsed, and after waiting for the passage (S4 Yes), the switch SW is switched to the chattering removal circuit ch side (S5). The signal processing is transmitted to the CPU 2 (S6). When it is determined in S2 that the CPU 2 is not in the sleep state (No in S2), the process proceeds to S5, the switch SW is switched to the chattering removal circuit side (S5), and the chattering function is operated to activate the key switch signal. Is transmitted to the CPU 2. According to this example, there is an effect of speeding up the process as compared with the case where the CPU 2 in the sleep state directly performs the key scan process. That is, when the CPU 2 is in the sleep state, the key switch signal is sent to the input port of the GPIO 6 via any of the bypass routes BP1 to BP3 that bypass the chattering section removal circuit of the key scan section 4 as shown in FIG. Since the signal is transmitted to any one of IN1 to IN3, this signal is immediately supplied to the CPU 2 or transmitted to a circuit for controlling the CPU 2 to cancel the sleep. It is clear that the rise of the CPU 2 is quicker than canceling. When the chattering section removing circuit ch is bypassed and the sleep state release trigger is supplied to the CPU 2, the switch SW is immediately switched to the chattering removing circuit side without waiting for the CPU 2 to rise. According to this process, the CPU 2 rises during the chattering removal time, and the key scan process can be started immediately after the chattering removal period, so that a quick process is possible.

図7は、本発明の更に他の変形実施態様例を示すブロック構成図であり、GPIO6の設計の自由度を利用して、制御対象のキーボードに対応してGPIO6の余剰ポートを他の機能制御に利用する場合を示している。即ち、この例では制御対象キーボードのキーマトリクス7の数が、2×3と、前記図1に示すものより少ないので、GPIO6の入力ポートが一つ余ることになる。そこで、このポートを第四の出力ポートOP4として制御し、その出力でインバータ回路14を介して発光ダイオード(LED)15の点灯を制御するものである。このようにGPIOは、ソフトウエアによって各ポートを入力として、あるいは出力として機能させることができるので、従来のように専用のキースキャン回路に代えて、GPIOによってキースキャン回路を構成すれば、装置毎に本来のGPIOの特徴を生かしたフレキシブルな利用方法を駆使することが可能となる。
なお、図示は省略するが、前記図3に示した分周回路では、供給されるクロック信号の周波数を種々分周可能である。そこで、複数の分周比にソフトウエアで設定できるように構成し、前記フリップフロップ回路D−FFに供給するクロック周波数を可変すれば、チャタリング除去期間を自由に変化させることができる。従って、対象とするキーボードの特性に応じて、最適な値に変えることが可能となる。例えば、供給されるクロック周波数が32.768kHzであり、前記分周回路(DIVIDER)の分周比が1/16、1/32、1/64、1/128、1/256である場合、夫々、分周後の周波数が、2.048kHz、1.02kHz、512Hz、256Hz、128Hzとなるので、これを時間に直せば1.46msec乃至23.44msecの範囲でチャタリング除去期間を調整することができることになる。このチャタリン部除去期間の調整は、前記図3に示した回路において、フリップフロップの段数を増加すれば細かい刻みでの調整が可能である。
FIG. 7 is a block diagram showing still another modified embodiment of the present invention, and controls the surplus ports of the GPIO 6 corresponding to the keyboard to be controlled by other function control using the degree of freedom of the design of the GPIO 6. The case of using is shown. That is, in this example, the number of key matrixes 7 of the keyboard to be controlled is 2 × 3, which is smaller than that shown in FIG. Therefore, this port is controlled as the fourth output port OP4, and the lighting of the light emitting diode (LED) 15 is controlled via the inverter circuit 14 with the output. In this way, GPIO allows each port to function as an input or an output by software, so if a key scan circuit is configured by GPIO instead of a dedicated key scan circuit as in the prior art, each device In addition, it is possible to make full use of a flexible usage method utilizing the characteristics of the original GPIO.
Although not shown, the frequency dividing circuit shown in FIG. 3 can divide the frequency of the supplied clock signal in various ways. Therefore, the chattering removal period can be freely changed by configuring the frequency division ratio so as to be set by software and changing the clock frequency supplied to the flip-flop circuit D-FF. Therefore, it is possible to change to an optimum value according to the characteristics of the target keyboard. For example, when the supplied clock frequency is 32.768 kHz and the division ratio of the divider circuit (DIVIDER) is 1/16, 1/32, 1/64, 1/128, 1/256, respectively. Since the frequency after frequency division is 2.048 kHz, 1.02 kHz, 512 Hz, 256 Hz, and 128 Hz, the chattering removal period can be adjusted in the range of 1.46 msec to 23.44 msec by adjusting this to time. become. The chattering portion removal period can be adjusted in fine steps by increasing the number of flip-flop stages in the circuit shown in FIG.

以上いくつかの実施態様例について説明したが、本発明の実施に際しては、これらの例に限定する必要は全くなく、種々変形が可能である。例えば、チャタリング除去回路とそのバイパスの切替を、CPUのスリープ状態時だけではなく通常のキー操作においても適用し、割り込み処理に要する時間をチャタリング除去期間に吸収する処理も可能である。即ち、CPUの割り込み制御を早めに行うために、通常はチャタリング除去回路バイパスルートに切替えておき、キー操作を検出したらCPUへの割り込み処理のための信号入力を行った後、直ちにチャタリング除去回路側に切替えるように制御すれば、CPUへの割り込みに要する時間中にチャタリング除去の時間が一部並列に経過するように制御できるので、処理の迅速化をもたらす上で有効である。
また、前記図8に示したワンチップマイコンの構成例では、キースキャンとGPIOとの両方を備えた場合を例示したが、本発明ではGPIOをキースキャンとして機能させているので、他の理由で専用のキースキャンが必要である場合を除き、これを削除することもできる。更に、本発明において使用するチャタリング除去回路は、図3に示したものに限る必要はなく、広く知られている種々のものが適用可能であることはいうまでもなく、なお更に、図4に示したブロック構成図における論理和回路ORは、これに限らず同様に機能するものであれば如何なる回路でも良い。
Although several embodiments have been described above, the present invention is not necessarily limited to these examples, and various modifications are possible. For example, switching of the chattering removal circuit and its bypass can be applied not only in the sleep state of the CPU but also in normal key operations, and processing for absorbing the time required for interrupt processing in the chattering removal period is also possible. That is, in order to perform CPU interrupt control early, the chattering elimination circuit is usually switched to the chattering elimination circuit bypass route, and when a key operation is detected, a signal is input for interrupt processing to the CPU, and then the chattering elimination circuit side immediately If the control is performed so that the chattering removal time partly passes in parallel during the time required for interrupting the CPU, it is effective in speeding up the processing.
In the configuration example of the one-chip microcomputer shown in FIG. 8, the case where both the key scan and the GPIO are provided is illustrated. However, in the present invention, the GPIO functions as the key scan. It can be deleted unless a dedicated key scan is required. Further, the chattering elimination circuit used in the present invention is not limited to the one shown in FIG. 3, and it is needless to say that various well-known ones can be applied. The OR circuit OR in the block configuration diagram shown is not limited to this, and any circuit may be used as long as it functions similarly.

本発明の一実施形態に係るキースキャン回路の概要ブロック図である。1 is a schematic block diagram of a key scan circuit according to an embodiment of the present invention. 本発明の一実施形態に係るキースキャン回路の動作を説明する概要ブロック図である。It is a general | schematic block diagram explaining operation | movement of the key scan circuit which concerns on one Embodiment of this invention. 本発明の一実施形態に使用するチャタリング除去回路の一例を示すブロック図である。It is a block diagram which shows an example of the chattering removal circuit used for one Embodiment of this invention. 本発明の一実施形態に使用するチャタリング除去回路の動作を説明する信号波形図である。It is a signal waveform diagram explaining operation | movement of the chattering removal circuit used for one Embodiment of this invention. 本発明の一実施形態に使用するチャタリング除去回路の動作を説明する信号波形図である。It is a signal waveform diagram explaining operation | movement of the chattering removal circuit used for one Embodiment of this invention. 本発明の一実施形態に係るキースキャン回路の制御例を示すフローチャートである。It is a flowchart which shows the example of control of the key scan circuit which concerns on one Embodiment of this invention. 本発明の変形実施形態に係るキースキャン回路の概要ブロック図である。FIG. 6 is a schematic block diagram of a key scan circuit according to a modified embodiment of the present invention. ワンチップマイクロコンピュータの一例を示すブロック構成図である。It is a block block diagram which shows an example of a one-chip microcomputer. 従来のキースキャン回路の一例を示す概要ブロック図である。It is a general | schematic block diagram which shows an example of the conventional key scan circuit. 従来のキースキャン回路の一例を示す概要ブロック図である。It is a general | schematic block diagram which shows an example of the conventional key scan circuit.

符号の説明Explanation of symbols

1 キースキャン回路、2、101 中央処理装置(CPU)、3、106 割り込みコントローラ、4 キースキャン部、5、116 バスライン、6、111 汎用入出力ポート(GPIO)、7、117 キーマトリクス、8〜11 フリップフロップ回路、12 分周回路、13 論理和回路、14 インバータ回路、15 発光ダイオード(LED)、100 ワンチップマイクロコンピュータ、102 パラレルコントローラ、103 DMA、104 内部RAM、105 内部ROM、107 アナログ・デジタル変換回路(ADC)、108 デジタル・アナログ変換回路(DAC)、109 同期式シリアルインターフェース(SPI)、110 調歩同期シリアルインターフェース(UART)、111 汎用入出力ポート(GPIO)、112 キースキャン回路、113 タイマ(TIMER)、114 電源管理部、115 クロック回路(CLKGEN)、SW1、SW2、SW3 バイパス切替スイッチ。   1 key scan circuit, 2, 101 central processing unit (CPU), 3, 106 interrupt controller, 4 key scan unit, 5, 116 bus line, 6, 111 general-purpose input / output port (GPIO), 7, 117 key matrix, 8 -11 Flip-flop circuit, 12 divider circuit, 13 OR circuit, 14 inverter circuit, 15 light emitting diode (LED), 100 one-chip microcomputer, 102 parallel controller, 103 DMA, 104 internal RAM, 105 internal ROM, 107 analog -Digital conversion circuit (ADC), 108 Digital-analog conversion circuit (DAC), 109 Synchronous serial interface (SPI), 110 Asynchronous serial interface (UART), 111 General-purpose input / output port (GPI) ), 112 key scan circuit, 113 a timer (TIMER), 114 power management unit, 115 a clock circuit (CLKGEN), SW1, SW2, SW3 bypass-switching switch.

Claims (4)

キースキャン等の制御を行う中央処理装置と、プログラムや各種データを記憶しておくメモリ装置と、複数の入出力手段を有する入出力ポートと、前記中央処理装置に対し割り込み処理を実行する割り込みコントローラとを備えたキースキャン回路において、前記入出力ポートの入力端に、チャタリング除去回路と、該チャタリング除去回路バイパス回路と、キースイッチ入力信号を前記チャタリング除去回路か前記バイパス回路かに切替える切替回路とを設け、前記切替回路をソフトウエアで制御するように構成したことを特徴とするキースキャン回路。   A central processing unit that performs control such as key scanning, a memory device that stores programs and various data, an input / output port having a plurality of input / output means, and an interrupt controller that executes interrupt processing for the central processing unit A chattering removal circuit at the input terminal of the input / output port, a chattering removal circuit bypass circuit, and a switching circuit for switching a key switch input signal to the chattering removal circuit or the bypass circuit. And a key scan circuit, wherein the switching circuit is controlled by software. 前記チャタリング除去回路が、縦続接続した複数のフリップフロップ回路と、該フリップフロップ回路にクロック信号を供給する手段と、前記各フリップフロップ回路のQ出力信号を入力信号とする論理和回路とを備え、前記キースイッチ信号を最前段のフリップフロップ回路のD入力端に供給すると共に、他のフリップフロップ回路のD入力端には、その前段のフリップフロップ回路のQ端子出力を供給するように構成したことを特徴とする請求項1記載のキースキャン回路。   The chattering removal circuit includes a plurality of cascaded flip-flop circuits, means for supplying a clock signal to the flip-flop circuits, and an OR circuit using the Q output signal of each flip-flop circuit as an input signal, The key switch signal is supplied to the D input terminal of the first flip-flop circuit, and the Q terminal output of the preceding flip-flop circuit is supplied to the D input terminal of the other flip-flop circuit. The key scan circuit according to claim 1. 前記チャタリング除去回路は、クロック信号を分周する可変分周機能を備え、その分周比をソフトウエアでコントロールすることによってチャタリング除去期間を制御できるように構成したことを特徴とする請求項1又は2記載のキースキャン回路。   The chattering removal circuit includes a variable frequency dividing function for dividing a clock signal, and is configured to control a chattering removal period by controlling the frequency division ratio by software. 2. The key scan circuit according to 2. 前記中央処理装置がスリープ状態でキースイッチ信号が入力されたとき、前記チャタリング除去回路をバイパスしてキースイッチ信号を前記入力ポートに供給し、所要時間経過後に前記チャタリング除去回路側に切替えるように前記切替回路を制御する手段を備えたことを特徴とする請求項1乃至3の何れか一項記載のキースキャン回路。   When the central processing unit is in a sleep state and a key switch signal is input, the chattering removal circuit is bypassed and the key switch signal is supplied to the input port and switched to the chattering removal circuit side after a lapse of a required time. 4. The key scan circuit according to claim 1, further comprising means for controlling the switching circuit.
JP2005294170A 2005-10-06 2005-10-06 Key scan circuit Active JP4670574B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2005294170A JP4670574B2 (en) 2005-10-06 2005-10-06 Key scan circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005294170A JP4670574B2 (en) 2005-10-06 2005-10-06 Key scan circuit

Publications (2)

Publication Number Publication Date
JP2007102643A true JP2007102643A (en) 2007-04-19
JP4670574B2 JP4670574B2 (en) 2011-04-13

Family

ID=38029504

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005294170A Active JP4670574B2 (en) 2005-10-06 2005-10-06 Key scan circuit

Country Status (1)

Country Link
JP (1) JP4670574B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011193108A (en) * 2010-03-12 2011-09-29 Ricoh Co Ltd Image processor
JP2013013128A (en) * 2007-08-16 2013-01-17 Renesas Electronics Corp Microcomputer system
CN110879725A (en) * 2019-10-17 2020-03-13 北京华北兴业技术有限公司 Implementation method for timing closing of Bypass
CN113391980A (en) * 2021-06-25 2021-09-14 西安超越申泰信息科技有限公司 Computer monitoring system based on single chip microcomputer

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06259177A (en) * 1993-03-10 1994-09-16 Fujitsu Ltd Data setting device
JPH1165734A (en) * 1997-08-19 1999-03-09 Kansei Corp Switching interface circuit
JP2000259323A (en) * 1999-03-05 2000-09-22 Nec Eng Ltd Input signal control circuit

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06259177A (en) * 1993-03-10 1994-09-16 Fujitsu Ltd Data setting device
JPH1165734A (en) * 1997-08-19 1999-03-09 Kansei Corp Switching interface circuit
JP2000259323A (en) * 1999-03-05 2000-09-22 Nec Eng Ltd Input signal control circuit

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013013128A (en) * 2007-08-16 2013-01-17 Renesas Electronics Corp Microcomputer system
US9083384B2 (en) 2007-08-16 2015-07-14 Renesas Electronics Corporation Microcomputer system
JP2011193108A (en) * 2010-03-12 2011-09-29 Ricoh Co Ltd Image processor
CN110879725A (en) * 2019-10-17 2020-03-13 北京华北兴业技术有限公司 Implementation method for timing closing of Bypass
CN113391980A (en) * 2021-06-25 2021-09-14 西安超越申泰信息科技有限公司 Computer monitoring system based on single chip microcomputer
CN113391980B (en) * 2021-06-25 2024-04-05 超越科技股份有限公司 Computer monitoring system based on singlechip

Also Published As

Publication number Publication date
JP4670574B2 (en) 2011-04-13

Similar Documents

Publication Publication Date Title
US5025387A (en) Power saving arrangement for a clocked digital circuit
JP4726337B2 (en) One-chip microcomputer
US5551044A (en) Method and apparatus for interrupt/SMI# ordering
JP5317356B2 (en) Clock control signal generation circuit, clock selector, and information processing apparatus
KR20060119728A (en) System lsi
JP4670574B2 (en) Key scan circuit
EP1586979A2 (en) Power reduction for unintentional activation of a wireless input device
JPH07281782A (en) Clock control circuit
JP2011097138A (en) Noise reduction circuit and semiconductor device provided with noise reduction circuit
JP2009205377A (en) Integrated circuit device having reset control
US6823413B2 (en) Interrupt signal processing apparatus
KR20180031151A (en) Glitch-free clock multiplexer and selecting method of clock signal using the multiplexer
US6834339B2 (en) Microprocessor
US6566906B1 (en) Specialized programmable logic region with low-power mode
TWI655577B (en) Operation speed compensation circuit and compensation method thereof
CN1332287C (en) Frequency-voltage mechanism for power management and its control method
JPH076155A (en) Single chip microcomputer
JP4750505B2 (en) Clock switching circuit
US20060195714A1 (en) Clock control device, microprocessor, electronic device, clock control method, and clock control program
JP2006201856A (en) Semiconductor integrated circuit
KR100272531B1 (en) Method for prohibitting exhaust of power source in electronic equipment
JP3652269B2 (en) Signal processing device
JPH11305887A (en) Method for controlling microcontroller and microcontroller
JP2000259323A (en) Input signal control circuit
CN114117969A (en) Chip circuit design of direct memory access channel chain supporting conditional branching

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20081002

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100910

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20101221

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20110103

R150 Certificate of patent or registration of utility model

Ref document number: 4670574

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140128

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140128

Year of fee payment: 3

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140128

Year of fee payment: 3

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350