JP3088395B2 - Switch interrupt processing circuit and switch interrupt processing method - Google Patents

Switch interrupt processing circuit and switch interrupt processing method

Info

Publication number
JP3088395B2
JP3088395B2 JP10326900A JP32690098A JP3088395B2 JP 3088395 B2 JP3088395 B2 JP 3088395B2 JP 10326900 A JP10326900 A JP 10326900A JP 32690098 A JP32690098 A JP 32690098A JP 3088395 B2 JP3088395 B2 JP 3088395B2
Authority
JP
Japan
Prior art keywords
edge
interrupt
predetermined time
interrupt processing
interrupt 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.)
Expired - Fee Related
Application number
JP10326900A
Other languages
Japanese (ja)
Other versions
JP2000148510A (en
Inventor
信一 稲森
Original Assignee
日本電気オフィスシステム株式会社
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 日本電気オフィスシステム株式会社 filed Critical 日本電気オフィスシステム株式会社
Priority to JP10326900A priority Critical patent/JP3088395B2/en
Publication of JP2000148510A publication Critical patent/JP2000148510A/en
Application granted granted Critical
Publication of JP3088395B2 publication Critical patent/JP3088395B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、機械スイッチの処
理回路に関し、特にモーメンタリ型機械スイッチの割り
込み処理回路及びその割り込み処理方法に関するもので
ある。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a processing circuit of a mechanical switch, and more particularly to an interrupt processing circuit of a momentary type mechanical switch and a method of processing the interrupt.

【0002】[0002]

【従来の技術】報処理装置、制御機器、家庭電化製
品、あるいは産業用設備等の操作部等においては、機械
スイッチを人間に操作させ、これをきっかけにして装置
に所望の動作を行わせることが広く一般的に行われてい
る。そのために機械スイッチから装置に内蔵したCPU
に対して割り込み信号を与えることも極めて一般的な方
法である。従来、機械スイッチを用いてCPUへの割り
込み信号を発生させる場合、機械スイッチの操作時に接
点の機械的振動によるチャタリングが生じ、CPUで正
常な割り込み処理が行えなくなるという問題があった。
初期では、ロジック回路によるチャタリング防止回路や
CRによる積分回路によって機械式スイッチから発生す
るチャタリングを抑えていた。
BACKGROUND ART Information processing apparatus, control devices, home appliances or in the operation portion or the like of the industrial equipment, etc., to operate the machine switches to a human, to which the apparatus is triggered to perform the desired operation It is widely and generally done. For that purpose, the CPU built into the device from the mechanical switch
It is also a very general method to give an interrupt signal to Conventionally, when an interrupt signal to a CPU is generated using a mechanical switch, chattering occurs due to mechanical vibration of a contact when the mechanical switch is operated, and there has been a problem that normal interrupt processing cannot be performed by the CPU.
Initially, chattering generated from mechanical switches was suppressed by a chattering prevention circuit using a logic circuit or an integrating circuit using a CR.

【0003】その後、このようなチャタリングを防止す
るスイッチ割り込み処理回路として、例えば、特開平6
−83643号公報が公開されている。従来のスイッチ
割り込み処理回路について説明する。図5は、従来のス
イッチ割り込み処理回路のブロック図である。従来のス
イッチ割り込み処理回路は、CPU110の割込み信
号入力端子INT111に割り込み処理インタフェース
120を介して割り込み信号発生用の機械スイッチ(S
W)130が接続されている。さらに、機械スイッチ1
30は、CPU110の入力ポートIP112にも接続
されている。割り込みインタフェース120は、ラッチ
部121と、リセット部122とから構成されており、
ラッチ部121の入力端子Aには機械スイッチ130
が、出力端子QにはCPU110の割り込み入力端子I
NT111が接続されている。また、リセット部122
の入力端子IはCPU110の割り込み入力リセット端
子113に、出力端子Oはラッチ部121のリセット端
子Rにそれぞれ接続されている。さらに、ラッチ部12
1に入力端子Aの電位は、抵抗140によって常時(機
械スイッチ130が不動作のとき)+5Vのレベルに設
定されている。
After that, a switch interrupt processing circuit for preventing such chattering is disclosed in, for example,
No. 83643 is disclosed. A conventional switch interrupt processing circuit will be described. FIG. 5 is a block diagram of a conventional switch interrupt processing circuit. Conventional switch interrupt processing circuitry, mechanical switch (S for interrupt signal generation via the interrupt processing interface 120 to split Ri inclusive signal input terminal INT111 the CPU110
W) 130 is connected. In addition, mechanical switch 1
30 is also connected to the input port IP 112 of the CPU 110. The interrupt interface 120 includes a latch unit 121 and a reset unit 122.
A mechanical switch 130 is connected to the input terminal A of the latch unit 121.
However, the output terminal Q is connected to the interrupt input terminal I of the CPU 110.
NT111 is connected. Also, the reset unit 122
The input terminal I is connected to the interrupt input reset terminal 113 of the CPU 110, and the output terminal O is connected to the reset terminal R of the latch unit 121. Further, the latch unit 12
1, the potential of the input terminal A is always set to a level of +5 V by the resistor 140 (when the mechanical switch 130 is not operated).

【0004】このような構成のスイッチ割り込み処理回
路の動作について説明する。 操作スイッチ130が操作
されない時、その接点は開いており、割り込み処理イン
タフェース120のラッチ部121の入力端子Aは、抵
抗140を介して+5Vであり、信号MSの論理はHi
ghとなっている。この時、ラッチ部121の出力端子
Qの状態の論理はLowである。この状態では、CPU
110は、割り込み処理待ちの状態である。機械スイッ
チ130がオンされると、接点が閉じられ、信号MSの
論理はLowとなる。MSが割り込みインタフェース1
20に入力すると、ラッチ部121の出力信号Qの論理
はHighに反転し、CPU110の割込み信号入力
端子111に割込み信号INTが入力される。CPU
110は、信号INTを読み込み、これを確認すると割
り込み入力リセット端子113にリセット信号RES
(論理High)を出力し、割り込みインタフェース1
20のリセット部122は、リセット信号RESによっ
てラッチ部121の出力端子Qに出力されている割
み信号INTをクリアする。以上の動作は、機械スイッ
チ130を閉じたときに生じるチャタリングにより、信
号MSの論理がHighからLowに反転する毎に行わ
れる。すなわち、CPU110は、チャタリングが生じ
ている間、上記信号MSの立ち下がりを有効信号として
割り込み入力端子111から繰り返し読み込むことにな
る。
A switch interrupt processing circuit having such a configuration is described.
The operation of the road will be described. Operation switch 130 is operated
If not, the contact is open and interrupt handling
Input terminal A of the latch section 121 of the
+ 5V via the anti-140, and the logic of the signal MS is Hi
gh. At this time, the output terminal of the latch unit 121
The logic of the state of Q is Low. In this state, the CPU
Reference numeral 110 denotes a state of waiting for interrupt processing. Mechanical switch
When the switch 130 is turned on, the contact is closed and the signal MS
The logic is Low. MS is interrupt interface 1
20, the logic of the output signal Q of the latch unit 121
Is inverted to High and the CPU 110RSignal input
Split to terminal 111RThe input signal INT is input. CPU
110 reads the signal INT and confirms it, and
Input signal to the reset terminal 113.
(Logic High) is output and the interrupt interface 1
20 is reset by a reset signal RES.
Of the signal output to the output terminal Q of the latch unit 121RIncluding
Clear only the signal INT. The above operation is performed using the mechanical switch.
The chattering that occurs when the
Performed every time the logic of the signal MS is inverted from High to Low
It is. That is, the CPU 110 generates chattering.
The falling edge of the signal MS as an effective signal
Repeated reading from interrupt input terminal 111
You.

【0005】次に、CPU110の動作について説明す
る。図6は、従来のスイッチ割り込み処理の状態遷移図
である。電源が投入されると(S11)、スイッチ割り
込み以外の処理を行うオフ状態(S12)になる。割り
込み信号INTを読み込むと、INTをリセットし(S
13)、入力ポート112により機械スイッチ130の
状態監視動作(S14)を開始する。すなわち、当該信
号INTを読み込むとタイミング動作を開始し、一定周
期で入力ポート112の論理を読み込む。この周期時間
が経過する前に、再度INTを読み込むと、INTをリ
セットし(S13)、それまでのタイミング動作を一旦
クリアし、改めてタイミング動作を開始する(S1
4)。この機械スイッチ130の状態を監視する周期
は、チャタリングによって生ずる機械スイッチ130の
断続周期より長くなるように設定されており、チャタリ
ングが生じている間は、入力ポート112から信号MS
を読み込む前に、上記タイミング動作の再開を繰り返す
ので割り込み処理が開始されることはない。さらにこの
ような処理を行うことにより、チャタリングだけではな
く信号ラインに載った一過性の外来ノイズの影響をも排
除することができる。
Next, the operation of the CPU 110 will be described. FIG. 6 is a state transition diagram of conventional switch interrupt processing. When the power is turned on (S11), the power supply is turned off (S12) for performing processing other than the switch interrupt. When the interrupt signal INT is read, the INT is reset (S
13), the state monitoring operation (S14) of the mechanical switch 130 is started by the input port 112. That is, when the signal INT is read, the timing operation starts, and the logic of the input port 112 is read at a constant cycle. If INT is read again before the elapse of this cycle time, the INT is reset (S13), the timing operation up to that time is temporarily cleared, and the timing operation is started again (S1).
4). The cycle of monitoring the state of the mechanical switch 130 is set to be longer than the intermittent cycle of the mechanical switch 130 caused by chattering. During chattering, the signal MS from the input port 112 is output.
Before reading the timing, the restart of the timing operation is repeated, so that the interrupt process is not started. Further, by performing such processing, it is possible to eliminate not only the chattering but also the influence of transient external noise on the signal line.

【0006】チャタリングによる信号MSの断続がなく
なると、その時点から上記周期の経過時に入力ポート1
12の論理を読み取る(S14)。Lowを2回検出す
ると、割り込み処理要求がなされたものとして、割り込
み処理を開始する(S15)。それ以外の場合、処理は
最初に戻り、スイッチ割り込み以外の処理を行うオフ状
態(S12)になる。入力ポート112の論理Lowを
2回読み込むとしたが、この監視回数は機械スイッチ1
30のチャタリング特性とCPU110の処理速度など
によって決まる設計的事項である。
When the intermittent operation of the signal MS due to the chattering is stopped, the input port 1 is switched after the elapse of the above-described period.
Twelve logics are read (S14). If Low is detected twice, it is determined that an interrupt processing request has been made, and interrupt processing is started (S15). In other cases, the process returns to the beginning, and becomes an off state (S12) in which processes other than the switch interrupt are performed. It is assumed that the logic low of the input port 112 is read twice.
This is a design matter determined by the chattering characteristics of the CPU 30 and the processing speed of the CPU 110.

【0007】割り込み処理を終了させるべく、機械スイ
ッチ130をオフすると、機械スイッチ130から出力
されるMSは、論理LowからHighに立ち上がる信
号となる。この信号は割り込み処理インタフェース12
0に入力されるが、通常は、ラッチ部121で出力端子
Qの論理は反転されない。しかしながら、一般に機械ス
イッチ130の接点の開放時にもチャタリングを生ずる
ので、チャタリングによってMS信号が立ち下がる時点
でラッチ部121の出力端子Qの論理が反転し、機械ス
イッチ130をオンした時と同様、CPU110の割り
込み信号入力端子111への信号INTの入力が繰り返
され、見かけ上、割り込み処理の再開が繰り返される状
態となる。
When the mechanical switch 130 is turned off to terminate the interrupt processing, the MS output from the mechanical switch 130 becomes a signal that rises from logic low to high. This signal is sent to the interrupt processing interface 12
Although it is input to 0, the logic of the output terminal Q is not normally inverted in the latch unit 121. However, since chattering generally occurs when the contact of the mechanical switch 130 is opened, the logic of the output terminal Q of the latch unit 121 is inverted when the MS signal falls due to the chattering, and the CPU 110 is turned on in the same manner as when the mechanical switch 130 is turned on. Of the signal INT to the interrupt signal input terminal 111 is repeated, and the restart of the interrupt process is apparently repeated.

【0008】スイッチ割り込み処理を行っているオン状
態(S15)で、割り込み信号INTを読み込むと、I
NTをリセットし(S16)、入力ポート112により
機械スイッチ130の状態監視動作(S17)を開始す
る。すなわち、当該信号INTを読み込むとタイミング
動作を開始し、一定周期で入力ポート112の論理を読
み込む。この周期時間が経過する前に、再度INTを読
み込むと、INTをリセットし(S16)、それまでの
タイミング動作を一旦クリアし、改めてタイミング動作
を開始する(S17)。チャタリングによる信号MSの
断続がなくなると、その時点から上記周期の経過時に入
力ポート112の論理を読み取る(S17)。High
を2回検出すると、割り込み処理終了要求がなされたも
のとして、割り込み処理をオフ状態(S12)にする。
この割り込み処理終了時の入力ポート112による機械
スイッチ130の監視回数は、上記説明の割り込み処理
開始時の場合と同様に設計的事項であるが、通常は割り
込み処理開始時と同じ回数に設定される。
When the interrupt signal INT is read in the ON state (S15) in which the switch interrupt processing is being performed, I
The NT is reset (S16), and the state monitoring operation (S17) of the mechanical switch 130 is started by the input port 112. That is, when the signal INT is read, the timing operation starts, and the logic of the input port 112 is read at a constant cycle. If INT is read again before the elapse of the cycle time, the INT is reset (S16), the timing operation up to that time is temporarily cleared, and the timing operation is started again (S17). When the signal MS is not interrupted due to chattering, the logic of the input port 112 is read when the above-described period has elapsed from that point (S17). High
Is detected twice, it is determined that an interrupt processing end request has been made, and the interrupt processing is turned off (S12).
The number of times the mechanical switch 130 is monitored by the input port 112 at the end of the interrupt processing is a design matter as in the above-described case of the start of the interrupt processing, but is usually set to the same number as that at the start of the interrupt processing. .

【0009】また、プログラムで周期的に状態監視する
代わりに、専用のステートマシンを備え、一定時間機械
スイッチの論理が一定になって初めて必要機能の処理を
実行するという、特開平7−65664のような例も知
られている。
Japanese Patent Laid-Open No. 7-65664 discloses that a dedicated state machine is provided instead of periodically monitoring a state by a program, and processing of a required function is executed only when the logic of a mechanical switch becomes constant for a certain period of time . Such an example is also known.

【0010】[0010]

【発明が解決しようとする課題】しかしながら、このよ
うな従来のスイッチ割り込み処理回路では、第1に、機
械スイッチの数だけ入力ポートが必要となるという問題
点がある。通常、情報処理装置やデジタル制御機器の操
作パネル等には複数の機械スイッチが具備されることが
多い。このため、従来のスイッチの数だけ入力ポートが
必要となるスイッチ割り込み処理回路は、機械スイッチ
の多いシステムでは、回路が大規模になり装置が大型化
し、コストアップとなってしまう。また、外来ノイズの
影響を考えると、複数の信号ラインに同時にノイズが印
可されてしまうため、複数のスイッチの状態監視を同時
に行わなければならず、処理性能が低下する。
However, in such a conventional switch interrupt processing circuit, first, there is a problem that the number of input ports required is equal to the number of mechanical switches. Usually, a plurality of mechanical switches are often provided on an operation panel of an information processing apparatus or a digital control device. For this reason, the switch interrupt processing circuit that requires input ports as many as the number of switches in the related art requires a large-scale circuit, a large device, and a high cost in a system having many mechanical switches. Considering the influence of external noise, noise is applied to a plurality of signal lines at the same time. Therefore, it is necessary to monitor the states of a plurality of switches at the same time, and the processing performance deteriorates.

【0011】また、第2に入力ポートの監視動作を長時
間にわたって行い、機械スイッチから出力される論理が
一定になってから割り込み処理を行うようにしているた
め、CPUの処理が監視動作に割かれ、処理性能の低下
を招くという問題がある。機械スイッチを誤って押した
場合や、ものがぶつかった場合など、誤動作要因を除去
するためには、長時間にわたる状態監視が必要であり、
監視時間を短くすることはできない。
Second, since the monitoring operation of the input port is performed for a long time and the interrupt processing is performed after the logic output from the mechanical switch becomes constant, the processing of the CPU is divided into the monitoring operation. However, there is a problem that the processing performance is reduced. Long-term status monitoring is required to eliminate malfunction factors such as accidental pressing of a mechanical switch or collision with something.
The monitoring time cannot be shortened.

【0012】さらに、第3に設置場所のノイズ状況に応
じた時間監視パラメータの設定ができないという問題が
ある。これは、時間監視条件により除去された事象を記
録する手段がないことによる。本発明はこのような点に
鑑みてなされたものであり、機械スイッチのチャタリン
グや外来ノイズの影響を防止するスイッチ割り込み処理
回路及びスイッチ割り込み処理方法を提供することを目
的とする。また、本発明の第2の目的は、回路規模の小
さいスイッチ割り込み処理回路を提供することである。
Third, there is a problem that the time monitoring parameter cannot be set according to the noise situation at the installation place. This is because there is no means for recording the events removed by the time monitoring condition. The present invention has been made in view of such a point, and an object of the present invention is to provide a switch interrupt processing circuit and a switch interrupt processing method for preventing the influence of chattering of a mechanical switch and external noise. A second object of the present invention is to provide a switch interrupt processing circuit having a small circuit scale.

【0013】[0013]

【課題を解決するための手段】上記目的を達成するた
め、本発明のうち請求項1記載の発明は、操作がされた
時に割り込み信号レベルが変化する機械スイッチの割り
込み処理回路において、前記割り込み信号レベルのエッ
ジを検出して割り込み処理を起動させる起動手段と、次
の割り込み信号のエッジ検出までの時間を含む所定の時
間を計時する計時手段と、前記計時手段により計時され
た割り込み信号のエッジ間の間隔が予め決められた時間
の範囲にあった場合に所定の割り込み処理を行う割り込
み制御手段とを有し、前記割り込み制御手段は、第1の
エッジ検出時の割り込み処理で前記計時手段により第1
の所定時間の計時を開始し、前記第1の所定時間を経過
してもエッジを検出しなかった場合前記第1のエッジを
有効とし、前記計時手段により第2の所定時間の計時を
開始し、前記第2の所定時間の経過前に第2のエッジを
検出した場合前記第2のエッジを有効とし、所定の割り
込み処理を行うことを特徴とする。ここで第1の所定時
間とは、機械スイッチ押下時にチャタリングによる割り
込み信号が発生しているかどうかを判定するために設定
される時間である。この第1の所定時間は、チャタリン
グによる割り込み信号の立ち上がりエッジが発生する時
間によって設定される。例えば0.2秒等と予め設定す
ることができる。ただし、割り込み信号を入力する機械
スイッチの特性との関係で適宜設定する必要があり、
0.2秒に限られるものではない。
According to a first aspect of the present invention, there is provided an interrupt processing circuit for a mechanical switch in which an interrupt signal level changes when an operation is performed. A starter for detecting an edge of a level to start an interrupt process; a timer for measuring a predetermined time including a time until the edge detection of the next interrupt signal; and an edge of the interrupt signal measured by the timer. Interrupt control means for performing a predetermined interrupt process when the interval is within a predetermined time range, the interrupt control means comprising:
In the interrupt processing at the time of edge detection, the first
Of the predetermined time is started, and the first predetermined time has elapsed.
If no edge is detected, the first edge is
Is valid, and the timing of the second predetermined time is
Start and before the second predetermined time has elapsed, a second edge
If a second edge is detected, the second edge is validated and a predetermined
Is performed. Here, the first predetermined time is a time set for determining whether or not an interrupt signal due to chattering is generated when the mechanical switch is pressed. The first predetermined time is set by the time when the rising edge of the interrupt signal due to chattering occurs. For example, it can be set in advance to 0.2 seconds or the like. However, it is necessary to set it appropriately in relation to the characteristics of the mechanical switch that inputs the interrupt signal.
It is not limited to 0.2 seconds.

【0014】また、本発明のうち請求項2は、請求項1
の発明に加え、操作がされた時に割り込み信号レベルが
変化する機械スイッチの割り込み処理回路において、前
記割り込み処理信号レベルのエッジを検出して割り込み
処理を起動させる起動手段と、次の割り込み信号のエッ
ジ検出までの時間を含む所定の時間を計時する計時手段
と、前記計時手段により計時された割り込み信号のエッ
ジ間の間隔が予め決められた時間の範囲にあった場合の
所定の割り込み処理を行う割り込み制御手段とを有し、
前記起動手段は、さらに、次の割り込み信号のエッジが
検出されず前記計時手段により第1の所定時間を経過し
たことを検出した場合にも割り込み処理を起動させ、前
記制御手段は、第1のエッジ検出時の割り込み処理で前
記計時手段により第1の所定時間の計時を開始し、前記
第1の所定時間を経過してもエッジを検出しなかった場
合前記第1のエッジを有効とし、前記計時手段により第
2の所定時間の計時を開始し、前記第2の所定時間の経
過前に第2のエッジを検出した場合前記第2のエッジを
有効とし、所定の割り込み処理を行うことを特徴とす
る。また、本発明のうち請求項3に記載の発明は、請求
項1または請求項2の発明に加え、前記割り込み制御手
段は、さらに、前記割り込み信号のエッジ間の間隔が予
め決められた時間の範囲外であった場合にこれを記録す
ることを特徴とする。ここで第2の所定時間とは、機械
スイッチが押下している間に外来ノイズによる割り込み
信号が発生しているかどうかを判定するために設定され
る時間である。この第2の所定時間は、外来ノイズによ
る割り込み信号の立ち上がりエッジが発生する時間によ
って設定される。例えば3秒等と予め設定することがで
きる。ただし、外来ノイズの頻度との関係で適宜設定す
る必要があり、3秒に限られるものではない。スイッチ
割り込み処理回路によれば、第1に、機械スイッチの信
号状態を入カポートで検出しなくて良いので機械スイッ
チの数が多くなっても入カポート端子が不要で回路数が
少なくて済み、機械スイッチの数だけ入カポートが必要
なく、機械スイッチの多いシステムでも回路が大規模に
ならず装置を小型化でき安価となる。
Further, claim 2 of the present invention is claim 1
In addition to the invention, in an interrupt processing circuit of a mechanical switch in which an interrupt signal level changes when an operation is performed, an activation means for detecting an edge of the interrupt processing signal level and activating interrupt processing, and an edge of a next interrupt signal A timer for counting a predetermined time including a time until the detection, and an interrupt for performing a predetermined interrupt processing when an interval between edges of the interrupt signal measured by the timer is within a predetermined time range. Control means ,
The activating means may further include an edge of the next interrupt signal.
Not detected and the first predetermined time has passed by the timing means.
Also starts interrupt processing when it detects that
The control means performs the interrupt processing at the time of the first edge detection.
The first predetermined time is started by the clock means,
If no edge is detected after the first predetermined time has elapsed
If the first edge is valid,
Start timing of the second predetermined time, and wait for the second predetermined time.
If the second edge is detected before, the second edge is detected.
Enables and performs predetermined interrupt processing.
You. The invention of claim 3 of the present invention, wherein
In addition to the first or second aspect of the present invention, when the interval between the edges of the interrupt signal is out of a predetermined time range, the interrupt control means records this. . Here, the second predetermined time is a time set for determining whether or not an interrupt signal due to external noise is generated while the mechanical switch is being pressed. The second predetermined time is set by the time when the rising edge of the interrupt signal due to external noise occurs. For example, 3 seconds or the like can be set in advance. However, it is necessary to appropriately set the relationship with the frequency of external noise, and the setting is not limited to 3 seconds. According to the switch interrupt processing circuit, first, since the signal state of the mechanical switch does not need to be detected at the input port, even if the number of mechanical switches increases, the number of input port terminals is unnecessary and the number of circuits can be reduced. The number of input ports required by the number of switches is not required, and even in a system having many mechanical switches, the circuit does not become large and the device can be reduced in size and inexpensive.

【0015】また、本発明のうち請求項5に記載の発明
は、操作がされた時に割り込み信号レベルが変化する機
械スイッチの割り込み処理方法において、前記割り込み
信号レベルのエッジで割り込み処理を起動し、次の割り
込み信号のエッジ検出までに要する第1の定時間の計
時を開始して割り込み処理を終了し、次の割り込み信号
レベルのエッジまたは次の割り込み信号のエッジが検出
されない状態で前記第1の定時経過することによ
り割り込み処理を起動し、前記第1の定時間が経過す
る前に次の割り込み信号レベルのエッジを検出したか否
かを調べ、前記第1の定時経過する前に次の割り
込み信号レベルのエッジを検出した場合に、エッジの間
隔が予め決められた所定時間の範囲外であるとして前記
次の割り込み信号レベルのエッジ検出時を起点として前
第1の定時間の計時開始からの手順を繰り返し、前
第1の定時経過しても次の割込み信号レベル
のエッジを検出しない場合に第2の所定時間の計時を開
始して割り込み処理を終了し、次の割り込み信号レベル
のエッジにより割り込み処理を起動し、前記第2の所定
時間の経過前に次の割込み信号レベルのエッジを検出
した場合にエッジの間隔が予め決められた所定時間の範
囲であるとして所定の割り込み処理を行う手順、とを有
することを特徴とする。ここで第1の所定時間とは、上
述の請求項2に記載の発明での第1の所定時間と同様で
ある。すなわち、第1の所定時間とは、機械スイッチ押
下時にチャタリングによる割り込み信号が発生している
かどうかを判定するために設定される時間である。この
第1の所定時間は、チャタリングによる割り込み信号の
立ち上がりエッジが発生する時間によって設定される。
例えば0.2秒等と予め設定することができる。ただ
し、割り込み信号を入力する機械スイッチの特性との関
係で適宜設定する必要があり、0.2秒に限られるもの
ではない。また第2の所定時間とは、上述の請求項3に
記載の発明での第2の所定時間と同様である。すなわ
ち、第2の所定時間とは、機械スイッチが押下している
間に外来ノイズによる割り込み信号が発生しているかど
うかを判定するために設定される時間である。この第2
の所定時間は、外来ノイズによる割り込み信号の立ち上
がりエッジが発生する時間によって設定される。例えば
3秒等と予め設定することができる。ただし、外来ノイ
ズの頻度との関係で適宜設定する必要があり、3秒に限
られるものではない。
According to a fifth aspect of the present invention, in the interrupt processing method for a mechanical switch in which an interrupt signal level changes when an operation is performed, interrupt processing is started at an edge of the interrupt signal level, starts counting between first place scheduled required until the edge detection of the next interrupt signal to the interrupt process ends, the edge of the next interrupt signal level of the edge or the next interrupt signal is detected
It has detected the edge of the next interrupt signal level before being Start <br/> Ri interrupt processing by the fact that elapses between the first place scheduled with no, between said first predetermined scheduled elapses is It investigated whether, in the case of detecting the next interrupt signal level of the edge for a period shorter between the first place scheduled, said next interrupt as the interval of the edge is outside the range of a predetermined prescribed time the signal level of repeat the procedure from the start of counting between said first predetermined fixed time and upon detection of an edge as a starting point, before <br/> SL be passed between the first place time of the next split Ri inclusive signal level when detecting no edge starts counting between scheduled second place and the interrupt process ends, and starts the more interrupt processing edge of the next interrupt signal level, before the elapse of the second predetermined time when detecting the next split Ri inclusive signal level of the edge Performing a predetermined interrupt process assuming that the edge interval is within a predetermined time range. Here, the first predetermined time is defined as
The same as the first predetermined time according to the second aspect of the invention.
is there. That is, the first predetermined time is the time when the mechanical switch is pressed.
An interrupt signal due to chattering has occurred at the time of lowering
It is a time set to determine whether or not. this
The first predetermined time is a time period during which an interrupt signal due to chattering is generated.
It is set by the time when the rising edge occurs.
For example, it can be set in advance to 0.2 seconds or the like. However
And the relationship with the characteristics of the mechanical switch that inputs the interrupt signal.
It is necessary to set appropriately in the section, it is limited to 0.2 seconds
is not. Further, the second predetermined time is defined in claim 3 described above.
This is the same as the second predetermined time in the described invention. Sand
That is, the second predetermined time is when the mechanical switch is pressed.
Whether an interrupt signal due to external noise
This is the time set to determine whether the This second
The predetermined time is the rise of the interrupt signal due to external noise.
It is set by the time at which the edge is generated. For example
For example, 3 seconds can be set. However, outpatient neu
Must be set appropriately in relation to the frequency of the
It is not something that can be done.

【0016】また、本発明のうち請求項に記載の発明
は、請求項の発明に加え、前記機械スイッチの割り込
み処理方法の手順は、さらに、前記計時手順により計時
された割り込み信号のエッジ間の間隔が予め決められた
時間の範囲外であった場合にこれを記録することを特徴
とする。
According to a sixth aspect of the present invention, in addition to the fifth aspect , the procedure of the interrupt processing method of the mechanical switch further includes an edge of an interrupt signal clocked by the clocking procedure. When the interval is out of a predetermined time range, this is recorded.

【0017】[0017]

【発明の実施の形態】本発明の実施の形態を図面を参照
して説明する。図1は、本発明の一実施の形態であるス
イッチ割り込み処理回路の構成を示すロック図であ
る。本発明の一実施の形態であるスイッチ割り込み処理
回路は、割り込み処理を行う割込み制御手段であるC
PU10と、モーメンタリ型の機械スイッチ30と、プ
ルアップ抵抗40とから構成される。CPU10は、割
り込み処理を行う割込み制御手段であり、割り込み処
理の起動手段であるCPU10内蔵の割り込みコントロ
ールユニット(図示せず)と、時間を計時する計時手段
であるタイマー(図示せず)とを有している。CPU1
0の割り込み信号入力端子11には割り込み信号入力用
の機械スイッチ30が接続されるとともに、プルアップ
抵抗40が接続されている。また、機械スイッチ30の
他端はグランド電位に固定されている。なお、機械スイ
ッチ30はモ―メンタリ型のプッシュスイッチであり、
外力が加わると操作具が沈み接点が閉じ、手を離すとバ
ネの復元力により操作具が戻り接点が開くタイプのもの
である。プルアップ抵抗40の他端は+5V電位に固定
されている。
Embodiments of the present invention will be described with reference to the drawings. Figure 1 is a block diagram showing the configuration of the switch interrupt processing circuit according to an embodiment of the present invention. Switch interrupt processing circuit according to an embodiment of the present invention is Ri included control means spite performs interrupt processing C
It comprises a PU 10, a momentary-type mechanical switch 30, and a pull-up resistor 40. CPU10 is Ri included control means spite performs interrupt processing, the interrupt processing starting means is a CPU10 internal interrupt control unit (not shown), a timer is counting means for counting a time (not shown) have. CPU1
A mechanical switch 30 for inputting an interrupt signal and a pull-up resistor 40 are connected to the 0 interrupt signal input terminal 11. The other end of the mechanical switch 30 is fixed at the ground potential. The mechanical switch 30 is a momentary push switch.
When an external force is applied, the operating tool sinks and the contact closes, and when the hand is released, the operating tool returns due to the restoring force of the spring and the contact opens. The other end of the pull-up resistor 40 is fixed at a potential of + 5V.

【0018】 次に、このような構成のスイッチ割り込み
処理回路の動作について、図2を参照して説明する。図
2は本発明の一実施の形態であるスイッチ割り込み処理
回路の動作を示すタイムチャートである。 機械スイッチ
30が押される前は、その接点は開いておりCPU10
の割り込み信号入力端子の電位はHighに保たれてい
る。機械スイッチ30を押すと接点が閉じ、CPU10
の割り込み信号入力端子11の電位はLowとなる。C
PU10内蔵の割り込みコントロールユニット(図示せ
ず)のトリガモードは、両エッジトリガに設定されてい
る。したがてCPU10は、機械スイッチ30が押さ
れたとき、離されたとき、ともに同一の割り込みハンド
ラへ分岐するように動作する。このような割り込みコン
トロールユニットの機能は、きわめて一般的な技術によ
るものである。操作者が機械スイッチ30を押すときと
離すとき両方において、多くの場合、割り込み信号には
機械スイッチ30の機械的特性によるチャタリング50
が生じている。また、機械スイッチ30を操作しない場
合でも、静電気ノイズ、放射性妨害波、AC端子間ノイ
ズ等の外来ノイズにより割り込み信号に一過性の信号ノ
イズ60が印可されることがある。
[0018] Next, switch interrupt with such a configuration
The operation of the processing circuit will be described with reference to FIG. Figure
2 is a switch interrupt processing according to an embodiment of the present invention.
4 is a time chart illustrating an operation of the circuit. Mechanical switch
Before 30 is pressed, its contacts are open and the CPU 10
The potential of the interrupt signal input terminal is kept High.
You. When the mechanical switch 30 is pressed, the contacts close and the CPU 10
Of the interrupt signal input terminal 11 is low. C
Interrupt control unit built in PU10 (not shown)
Trigger mode is set to double edge trigger.
You. ButTsuCPU 10 is pressed when mechanical switch 30 is pressed.
The same interrupt hand when released and released
Operates to branch to la. Such an interrupt controller
The function of the troll unit is based on the most common technology.
Things. When the operator presses the mechanical switch 30
When releasing both, often the interrupt signal
Chattering 50 due to the mechanical characteristics of the mechanical switch 30
Has occurred. If the mechanical switch 30 is not operated,
Noise, radiated disturbance, noise between AC terminals
Transient signal caused by external noise such as noise
The size 60 may be applied.

【0019】 次に、割り込み信号入力端子11に入力し
た割り込み信号によて起動する割り込み処理プログラ
ムの動作について図を参照して説明する。図3は、本
発明の一実施の形態であるスイッチ割り込み処理回路の
プログラム処理内容を示した状態遷移図である。 本発明
の一実施の形態であるスイッチ割り込み処理回路を有す
る装置の電源がオンする(S1)と、プログラムはま
ず、機械スイッチ30押下によりオンすべき機能(例、
ランプを点灯させる、モータを回転させる)をオフにし
(S2)て、割り込み要求の待ち状態となり、プログラ
ムの通常処理の実行を続ける。ここで、機械スイッチ3
0が押され、割り込み信号がHighからLowに変化
すると、割り込み信号(INT)の立ち下がりエッジを
CPU10が検出し、割り込み処理を起動する。割り込
み処理プログラムは次の割り込み信号が有効となるまで
の時間監視を行うタイマー(図示せず)をスタートさせ
る(S3)と、割り込み処理を終了し通常処理に復帰す
る。
[0019] Next, the interrupt signal input terminal11Enter
Interrupt signalTsuInterrupt processing program
Diagram of the operation of the system3This will be described with reference to FIG. Figure 3 is a book
A switch interrupt processing circuit according to an embodiment of the present invention
FIG. 6 is a state transition diagram showing program processing contents. The present invention
Has a switch interrupt processing circuit according to an embodiment of the present invention.
When the power of the device is turned on (S1), the program is executed.
Functions to be turned on by pressing the mechanical switch 30 (eg,
Turn on the lamp, turn on the motor)
(S2) Waiting for an interrupt request, and
The normal processing of the system is continued. Here, mechanical switch 3
0 is pressed and the interrupt signal changes from High to Low
Then, the falling edge of the interrupt signal (INT)
The CPU 10 detects and activates the interrupt processing. Interrupt
Only processing programIsUntil the next interrupt signal becomes valid
Start a timer (not shown) that monitors the time of
(S3), the interrupt processing ends and the processing returns to the normal processing.
You.

【0020】本実施の形態では、第1の所定時間を0.
2秒とした。したがって、機械スイッチ30が押され、
割り込み信号がHighからLowに変化するとき機械
スイッチ30押下時にチャタリング50が発生している
と、遅くとも0.2秒以内に割り込み信号(INT)の
立ち上がりエッジが発生する。この0.2秒という時間
は本実施の形態で使用した機械スイッチ30の特性によ
て決定したものであり、他への応用では当然最適化が
図られるべきであることは言うまでもない。2回目の割
り込み信号(INT)が入力した場合、割り込み処理プ
ログラムは前回の割り込み処理時にスタートさせたタイ
マーの計時結果を参照し0.2秒未満であった場合に
は、機械スイッチ30により実行すべき機能をOFFの
ままとして割り込み処理を終了し通常処理に復帰する。
つまり、割り込み信号が発生する間隔が0.2秒未満
場合には、当該機能はOFF状態のままで変化させない
こととなり結果的に機械スイッチ30の変化は誤操作、
またはチャタリング50によるものと見なされ無視され
る。
In this embodiment, the first predetermined time is set to 0.
2 seconds. Therefore, the mechanical switch 30 is pressed,
If the chattering 50 occurs when the mechanical switch 30 is pressed when the interrupt signal changes from High to Low, a rising edge of the interrupt signal (INT) occurs within 0.2 seconds at the latest. Time that this 0.2 seconds on the characteristics of the mechanical switch 30 used in this embodiment
Are those determined by Tsu, it goes without saying that the application to another should be appreciated optimization can be achieved. When the second interrupt signal (INT) is input, the interrupt processing program refers to the time measurement result of the timer started at the time of the previous interrupt processing, and when the time is less than 0.2 seconds, is executed by the mechanical switch 30. The interrupt processing is terminated with the function to be turned OFF, and the processing returns to the normal processing.
That is, when the interval at which the interrupt signal is generated is less than 0.2 seconds, the function is not changed in the OFF state, and as a result, the change of the mechanical switch 30 is erroneously operated.
Or, it is regarded as being due to the chattering 50 and is ignored.

【0021】 その後、機械スイッチ30のチャタリング
50は収束してゆくが、チャタリング50による割り込
み信号(INT)の最終エッジがCPU10に入力して
から0.2秒経過すると状態は遷移し、新たに次の割り
込み信号が有効となるまでの時間が秒未満か秒以上
かを監視するタイマーをスタートさせ(S4)て、通常
処理に復帰する。すなわち、本実施の形態では第2の所
定時間を外来ノイズの頻度に基づき3秒とした。したが
って、この状態では機械スイッチ30が操作者により押
し込まれた状態になっており、次に操作者が機械スイッ
チ30から手を離すのを待ち受けている状態である。
[0021] Then, chattering of mechanical switch 30
50 converges, but chattering 50 interrupts
The last edge of the signal (INT) is input to the CPU 10
The state changes after 0.2 seconds have elapsed since the next
Time until the embedded signal becomes effective3Less than a second3Seconds or more
Start a timer to monitor whether or not (S4)
Return to processing.That is, in the present embodiment, the second place
The fixed time was set to 3 seconds based on the frequency of extraneous noise. But
WhatIn this state, the mechanical switch 30 is pressed by the operator.
The machine switch is
It is in a state of waiting for the hand to be released from the switch 30.

【0022】 操作者が機械スイッチ30から手を離す
と、割り込み信号にはLowからHighに転じるエッ
ジが生じ、割り込み処理プログラムが起動する。割り込
み処理プログラムはタイマーの計時結果が3秒未満であ
た場合、ここで初めて機械スイッチ押下によって実行
すべき機能をONさせ(S5)て、通常処理に復帰す
る。 3秒経過しても次の割り込み信号が有効とならなか
た場合は、前回の割り込みは外来ノイズ60によるも
のと判断し、3秒経過後に次の割り込み信号が有効にな
たときに割り込み処理プログラムが起動し元のOFF
状態(S2)に遷移し通常処理に復帰する。
[0022] Operator releases hand from mechanical switch 30
The interrupt signal changes from low to high.
Error occurs, and the interrupt processing program starts. Interrupt
The processing program only counts less than 3 seconds
TsuIs executed for the first time by pressing the machine switch
Turn on the function to be performed (S5) and return to the normal processing
You. The next interrupt signal is not valid after 3 seconds
TsuThe previous interrupt was caused by extraneous noise 60
And the next interrupt signal becomes valid after 3 seconds.
TsuInterrupt processing program is activated when the
The state transits to the state (S2) and returns to the normal processing.

【0023】このように機械スイッチ30による複数の
割り込み信号中、任意の二つのエッジについて時間間隔
が0.2秒以上3秒未満の場合に限り、本当に人間が機
械スイッチ30を操作(押下、解放)したと見なして、
OFF状態(S2)からON状態(S5)に遷移させる
ように制御する。通常チャタリングは数10ミリ秒間隔
で複数発生するものであるが、0.2秒以下の間隔で複
数入力した割り込み信号は最後のつのエッジ以外は無
視される結果となる。また、ノイズ60は通常一過性の
ものであり、2回以上のノイズ60が3秒以内の間隔を
保ちつつ信号ラインに印可されることは極めてまれなの
で、一過性のノイズ60による割り込み信号もほとんど
が無視される結果となる。また、機械スイッチ30によ
り実行されるべき機能をOFFする(例、ランプを消灯
させる、モータを停止させる)場合の状態遷移の制御で
あるが、OFF(S2)からON(S5)に転じる場合
と割り込み信号の処理方法は全く同一であるため説明は
省略する。
As described above, only when the time interval between any two edges in the plurality of interrupt signals by the mechanical switch 30 is not less than 0.2 seconds and less than 3 seconds, a human can actually operate (press and release) the mechanical switch 30. )
Control is performed to make a transition from the OFF state (S2) to the ON state (S5). Is usually chattering is for multiple occurrences by the number 10 milliseconds, an interrupt signal in which a plurality of input at intervals of less than 0.2 seconds results in other than the last one edge is ignored. The noise 60 is usually transient, and it is extremely rare that two or more noises 60 are applied to a signal line while maintaining an interval of 3 seconds or less. Also results in most being ignored. The state transition control is performed when the function to be executed by the mechanical switch 30 is turned off (for example, the lamp is turned off or the motor is stopped). The state transition is controlled from OFF (S2) to ON (S5). Since the processing method of the interrupt signal is exactly the same, the description is omitted.

【0024】 次に、本発明の具体的な実施例について図
面を参照して詳細に説明する。図4は、本発明の一実施
の形態であるスイッチ割り込み処理回路を備えた業務用
BGM装置の動作履歴(ログ)リストである。 この装置
では、本発明のスイッチ割り込み処理回路によて実行
される機能は演奏中の音楽の音声を消す(ミュート作
動)と、音楽の再開(ミュート解除)であって機械スイ
ッチを押すごとにこの状態のトグル動作を繰り返す動作
仕様で設計されている。また、スイッチ割り込みによ
てミュート作動・解除を行うのは割り込み信号の間隔が
0.2秒〜3秒であた場合のみであるが、0.2秒
、あるいは3秒以上の間隔で割り込み信号が有効とな
た場合でもその動作履歴をメモリに記録するようにし
てある。図に示したように、0.2秒未満L1、0.
2秒以上3秒未満L2、3秒以上L3の場合で異なるメ
ッセージが記録されていることがわかる。
[0024] Next, a specific example of the present invention
This will be described in detail with reference to planes. FIG. 4 shows one embodiment of the present invention.
Commercial use with switch interrupt processing circuit in the form of
4 is an operation history (log) list of the BGM device. This device
Now, according to the switch interrupt processing circuit of the present invention,TsuRun
Function to mute the sound of the music being played (mute
) And music resume (unmute)
Operation to repeat the toggle operation in this state every time the switch is pressed
Designed by specification. In addition, switch interruptTsu
The mute operation / release is performed only when the interrupt signal interval
0.2 seconds to 3 secondsTsuOnly 0.2 secondsNot yet
Full, Or the interrupt signal becomes effective at intervals of 3 seconds or more.
TsuRecord the operation history in the memory even if
It is. Figure4As shown in FIG.
Different methods for L2 between 2 seconds and less than 3 seconds and L3 for 3 seconds and more
You can see that the message has been recorded.

【0025】 このような機能を動作させなが実運用に
供し動作履歴を調査することで設置場所のノイズの発生
状況、誤操作の状況等を知ることが出来る。 また、設置
場所によっては頻繁にノイズが発生する場合もあり、そ
のような場合には割り込み信号の間隔が、例として3秒
以上5秒未満の場合にのみミュート機能の作動・解除を
行わせるプログラムを作成し遠隔地から該当装置のプロ
グラムの交換をおこなえば設置環境に応じた高い信頼性
を得ることができる。この場合、機械スイッチを操作す
る際、3秒以上押し続け、その後2秒未満に手を離さな
いとミュート機能は作動せず、操作感覚は悪化するが、
機械スイッチの動作信頼性を優先する思想に基づいた処
置である。このように機械スイッチの動作履歴情報を記
録することにより、機械スイッチの動作状況をすること
ができるばかりでなく、これを用いて割り込み信号の時
間間隔パラメータをより最適な値に設定することができ
る。
[0025] While operating such functionsLaFor actual operation
Investigate the operation history to generate noise at the installation location
It is possible to know the situation, the situation of erroneous operation, and the like. Also installed
Noise may occur frequently in some places,
In such a case, the interval between interrupt signals is 3 seconds as an example.
Activate / deactivate the mute function only when it is less than 5 seconds
Create a program to perform the
High reliability according to the installation environment by exchanging grams
Can be obtained. In this case, operate the mechanical switch.
Press for more than 3 seconds, then 2 secondsLess thanKeep your hands on
The mute function does not work and the operation feeling deteriorates,
Processing based on the concept of giving priority to the operational reliability of mechanical switches
It is a place. Thus, the operation history information of the mechanical switch is recorded.
Record the operating status of mechanical switches
Not only can be used, but also
The interval parameter can be set to a more optimal value
You.

【0026】なお、上記の処理機能は、コンピュータに
よって実現することができる。その場合、スイッチ割り
込み処理回路が有すべき機能の処理内容は、コンピュー
タで読み取り可能な記録媒体に記録されたプログラムに
記述しておく。そして、このプログラムをコンピュータ
で実行することにより、上記処理がコンピュータで実現
される。コンピュータで読み取り可能な記録媒体として
は、磁気記録装置や半導体メモリ等がある。
The above processing functions can be realized by a computer. In this case, the processing contents of the functions that the switch interrupt processing circuit should have are described in a program recorded on a computer-readable recording medium. Then, by executing this program on a computer, the above processing is realized on the computer. Examples of the computer-readable recording medium include a magnetic recording device and a semiconductor memory.

【0027】[0027]

【発明の効果】以上、本発明のスイッチ割り込み処理回
路によれば、第1に、機械スイッチの信号状態を入カポ
ートで検出しなくて良いので機械スイッチの数が多くな
っても入カポート端子が不要で回路数が少なくて済み、
機械スイッチの数だけ入カポートが必要なく、機械スイ
ッチの多いシステムでも回路が大規模にならず装置を小
型化でき安価となる。第2に、機械スイッチを誤て押
した場合やものがぶつかた場合などの誤動作要因を、
専用回路やプログラムにより長時間にわたて状態監視
しなくても良いため、処理性能が低下しない。 第3に、
時間監視条件を外れた事象を記録する機能を設けたこと
により、設置場所のノイズ状況に応じた時間監視パラメ
ータの設定が可能となる。 また、本発明のスイッチ割り
込み処理方法によれは、前記と同様の効果を得ることが
できる。
As described above, the switch interrupt processing time of the present invention is described.
According to the road, first, the signal state of the mechanical switch is input
The number of mechanical switches is large
Even though the input port terminal is unnecessary, the number of circuits is small,
The number of input ports is not necessary for the number of mechanical switches.
Even in a system with many switches, the circuit is not large and the equipment is small.
It can be modeled and inexpensive. Second, wrong mechanical switchesTsuPush
If you do or bumpTsuMalfunction factors such as
Dedicated circuits and programs for a long timeTsuMonitoring
Since the processing need not be performed, the processing performance does not decrease. Third,
A function to record events that are out of time monitoring conditions
Time monitoring parameters according to the noise situation at the installation location.
Data can be set. Also, according to the switch allocation of the present invention,
Depending on the processing method, the same effect as described above can be obtained.
it can.

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

【図1】 本発明の一実施の形態であるスイッチ割り込
み処理回路のブロック図である。
FIG. 1 is a block diagram of a switch interrupt processing circuit according to an embodiment of the present invention.

【図2】 本発明の一実施の形態であるスイッチ割り込
み処理回路のスイッチのタイムチャートである。
FIG. 2 is a time chart of a switch of a switch interrupt processing circuit according to an embodiment of the present invention.

【図3】 本発明の一実施の形態であるスイッチ割り込
み処理の状態遷移図である。
FIG. 3 is a state transition diagram of switch interrupt processing according to an embodiment of the present invention.

【図4】 本発明の一実施の形態であるスイッチ割り込
み処理回路の動作履歴(ログ)リストである。
FIG. 4 is an operation history (log) list of the switch interrupt processing circuit according to the embodiment of the present invention;

【図5】 従来のスイッチ割り込み処理回路のブロック
図である。
FIG. 5 is a block diagram of a conventional switch interrupt processing circuit.

【図6】 従来のスイッチ割り込み処理の状態遷移図で
ある。
FIG. 6 is a state transition diagram of conventional switch interrupt processing.

【符号の説明】 10 CPU(割込み制御手段) 11 割り込み信号入力端子 30 機械スイッチ 40 プルアップ抵抗 50 チャタリング 60 ノイズ[Explanation of symbols]  10 CPU (%RControl means)  11 Interrupt signal input terminal  30 Mechanical switch  40 Pull-up resistor  50 chattering  60 noise

フロントページの続き (58)調査した分野(Int.Cl.7,DB名) G06F 9/46 G06F 13/24 G06F 11/30 Continuation of the front page (58) Field surveyed (Int.Cl. 7 , DB name) G06F 9/46 G06F 13/24 G06F 11/30

Claims (5)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 操作がされた時に割り込み信号レベルが
変化する機械スイッチの割り込み処理回路において、 前記割り込み信号レベルのエッジを検出して割り込み処
理を起動させる起動手段と、 次の割り込み信号のエッジ検出までの時間を含む所定の
時間を計時する計時手段と、 前記計時手段により計時された割り込み信号のエッジ間
の間隔が予め決められた時間の範囲にあった場合に所定
の割り込み処理を行う割り込み制御手段とを有し、前記
割り込み制御手段は、第1のエッジ検出時の割り込み処
理で前記計時手段により第1の所定時間の計時を開始
し、前記第1の所定時間を経過してもエッジを検出しな
かった場合前記第1のエッジを有効とし、前記計時手段
により第2の所定時間の計時を開始し、前記第2の所定
時間の経過前に第2のエッジを検出した場合前記第2の
エッジを有効とし、所定の割り込み処理を行うことを特
徴とする機械スイッチの割り込み処理回路。
1. An interrupt processing circuit of a mechanical switch, wherein an interrupt signal level changes when an operation is performed, a starting means for detecting an edge of the interrupt signal level to start an interrupt process, and detecting an edge of a next interrupt signal. A timer means for counting a predetermined time including a time until: and interrupt control for performing a predetermined interrupt processing when an interval between edges of the interrupt signal measured by the clock means is within a predetermined time range. and means, wherein
The interrupt control means is configured to execute an interrupt processing when the first edge is detected.
Start timing of the first predetermined time by the timing means
However, no edge is detected even after the first predetermined time has elapsed.
The first edge is made valid and the timing means
Starts a second predetermined time by the second predetermined time.
If the second edge is detected before the lapse of time, the second edge is detected.
Enables the edge and performs the specified interrupt processing.
An interrupt processing circuit for a mechanical switch.
【請求項2】 操作がされた時に割り込み信号レベルが
変化する機械スイッチの割り込み処理回路において、 前記割り込み処理信号レベルのエッジを検出して割り込
み処理を起動させる起動手段と、 次の割り込み信号のエッジ検出までの時間を含む所定の
時間を計時する計時手段と、 前記計時手段により計時された割り込み信号のエッジ間
の間隔が予め決められた時間の範囲にあった場合の所定
の割り込み処理を行う割り込み制御手段とを有し、 前記起動手段は、さらに、次の割り込み信号のエッジが
検出されず前記計時手段により第1の所定時間を経過し
たことを検出した場合にも割り込み処理を起動させ、前
記制御手段は、第1のエッジ検出時の割り込み処理で前
記計時手段により第1の所定時間の計時を開始し、前記
第1の所定時間を経過してもエッジを検出しなかった場
合前記第1のエッジを有効とし、前記計時手段により第
2の所定時 間の計時を開始し、前記第2の所定時間の経
過前に第2のエッジを検出した場合前記第2のエッジを
有効とし、所定の割り込み処理を行うことを特徴とする
請求項1記載の 機械スイッチの割り込み処理回路。
2. An interrupt processing circuit of a mechanical switch in which an interrupt signal level changes when an operation is performed, a starting means for detecting an edge of the interrupt processing signal level and starting an interrupt process, and an edge of a next interrupt signal. A timer for measuring a predetermined time including a time until the detection; and an interrupt for performing a predetermined interrupt process when an interval between edges of the interrupt signal measured by the timer is within a predetermined time range. and control means, said activation means further edge of the next interrupt signal
Not detected and the first predetermined time has passed by the timing means.
Also starts interrupt processing when it detects that
The control means performs the interrupt processing at the time of the first edge detection.
The first predetermined time is started by the clock means,
If no edge is detected after the first predetermined time has elapsed
If the first edge is valid,
2 starts counting during a predetermined time, after the second predetermined time
If the second edge is detected before, the second edge is detected.
It is valid and performs predetermined interrupt processing.
The interrupt processing circuit for a mechanical switch according to claim 1 .
【請求項3】 前記割り込み制御手段は、さらに、前記
割り込み信号のエッジ間の間隔が予め決められた時間の
範囲外であった場合にこれを記録することを特徴とする
請求項1または請求項2記載の機械スイッチの割り込み
処理回路。
3. The method according to claim 2, wherein the interrupt control unit records the interval between edges of the interrupt signal when the interval is out of a predetermined time range.
An interrupt processing circuit for a mechanical switch according to claim 1 or 2 .
【請求項4】操作がされた時に割り込み信号レベルが変
化する機械スイッチの割り込み処理方法において、 前記割り込み信号レベルのエッジで割り込み処理を起動
し、 次の割り込み信号のエッジ検出までに要する第1の所定
時間の計時を開始して割り込み処理を終了し、 次の割り込み信号レベルのエッジまたは次の割り込み信
号のエッジが検出されない状態で前記第1の所定時間を
経過することにより割り込み処理を起動し、 前記第1の所定時間が経過する前に次の割り込み信号レ
ベルのエッジを検出したか否かを調べ、 前記第1の所定時間を経過する前に次の割り込み信号レ
ベルのエッジを検出した場合に、エッジの間隔が予め決
められた所定時間の範囲外であるとして前記次の割り込
み信号レベルのエッジ検出時を起点として前記第1の所
定時間の計時開始からの手順を繰り返し、 前記第1の所定時間を経過しても次の割り込み信号レベ
ルのエッジを検出しない場合に第2の所定時間の計時を
開始して割り込み処理を終了し、 次の割り込み信号レベルのエッジにより割り込み処理を
起動し、 前記第2の所定時間の経過前に次の割り込み信号レベル
のエッジを検出した場合にエッジの間隔が予め決められ
た所定時間の範囲であるとして所定の割り込み処理を行
う手順、 とを有することを特徴とする機械スイッチの割り込み処
理方法。
4. An interrupt processing method for a mechanical switch in which an interrupt signal level changes when an operation is performed, wherein interrupt processing is started at an edge of the interrupt signal level, and a first time required until an edge of the next interrupt signal is detected. Triggering a predetermined time to end the interrupt processing, starting the interrupt processing by passing the first predetermined time in a state where the edge of the next interrupt signal level or the edge of the next interrupt signal is not detected, It is checked whether or not the edge of the next interrupt signal level is detected before the first predetermined time elapses. If the edge of the next interrupt signal level is detected before the first predetermined time elapses, The edge interval is determined to be out of the range of a predetermined time, and the second interrupt signal level is detected starting from the edge when the edge is detected. Is repeated from the start of timing of the predetermined time. If the edge of the next interrupt signal level is not detected even after the first predetermined time has elapsed, timing of the second predetermined time is started and the interrupt processing is ended. Then, interrupt processing is started by the edge of the next interrupt signal level, and when the edge of the next interrupt signal level is detected before the second predetermined time has elapsed, the edge interval is within a predetermined time range. And performing a predetermined interrupt process.
【請求項5】 前記機械スイッチの割り込み処理方法の
手順は、さらに、前記計時手順により計時された割り込
み信号のエッジ間の間隔が予め決められた時間の範囲外
であった場合にこれを記録することを特徴とする請求項
5記載の機械スイッチの割り込み処理方法。
5. The procedure of the mechanical switch interrupt processing method further records when an interval between edges of the interrupt signal measured by the timing procedure is out of a predetermined time range. 6. The interrupt processing method for a mechanical switch according to claim 5, wherein:
JP10326900A 1998-11-17 1998-11-17 Switch interrupt processing circuit and switch interrupt processing method Expired - Fee Related JP3088395B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP10326900A JP3088395B2 (en) 1998-11-17 1998-11-17 Switch interrupt processing circuit and switch interrupt processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP10326900A JP3088395B2 (en) 1998-11-17 1998-11-17 Switch interrupt processing circuit and switch interrupt processing method

Publications (2)

Publication Number Publication Date
JP2000148510A JP2000148510A (en) 2000-05-30
JP3088395B2 true JP3088395B2 (en) 2000-09-18

Family

ID=18193012

Family Applications (1)

Application Number Title Priority Date Filing Date
JP10326900A Expired - Fee Related JP3088395B2 (en) 1998-11-17 1998-11-17 Switch interrupt processing circuit and switch interrupt processing method

Country Status (1)

Country Link
JP (1) JP3088395B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002132280A (en) * 2000-10-25 2002-05-09 Roland Corp Speech reproduction system
JP6330214B2 (en) * 2013-12-19 2018-05-30 株式会社デンソー Opening / closing member control device
JP6731273B2 (en) * 2016-04-18 2020-07-29 シャープ株式会社 Vacuum cleaner

Also Published As

Publication number Publication date
JP2000148510A (en) 2000-05-30

Similar Documents

Publication Publication Date Title
US6112320A (en) Computer watchdog timer
US6038671A (en) Power management of a computer system using a power button
JPH0528005A (en) Malfunction detecting method
EP1217522A2 (en) Watchdog timer and method for detecting abnormal operation of computer, and computer including the timer
TW475109B (en) Method and system for automated technical support for computers
CN101009684B (en) Monitoring device and method for single-board operation state in the distributed system
JP3088395B2 (en) Switch interrupt processing circuit and switch interrupt processing method
JP2593915B2 (en) Double microcomputer system runaway prevention circuit
US20080140890A1 (en) Electronic Circuit Arrangement For Detecting a Failing Clock
US5200998A (en) Process and apparatus for automatic safeguarding of information data
JP4444172B2 (en) Information processing device
WO2018003560A1 (en) Electronic control device
JPH10207586A (en) Power-off control system for computer
KR200280669Y1 (en) interrupt equipement having an error detecting function
JP3724034B2 (en) Control circuit for production equipment
JPS632922Y2 (en)
JPS60118941A (en) Runaway control circuit
JP2832599B2 (en) Pachinko machine control device
JPH0683643A (en) Cpu interruption processing control system using machine switch
JP2021189864A (en) Vehicle electronic controller and vehicle control method
JPS642981B2 (en)
JP3308670B2 (en) Event-driven processing equipment failure detection device
JPS6389941A (en) Monitor and control equipment for microprocessor applied equipment
CN117170532A (en) Touch key control method, device, equipment and storage medium
JPH06309182A (en) Interrupt processing method

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees