JPH0621990B2 - Input filter - Google Patents
Input filterInfo
- Publication number
- JPH0621990B2 JPH0621990B2 JP62069796A JP6979687A JPH0621990B2 JP H0621990 B2 JPH0621990 B2 JP H0621990B2 JP 62069796 A JP62069796 A JP 62069796A JP 6979687 A JP6979687 A JP 6979687A JP H0621990 B2 JPH0621990 B2 JP H0621990B2
- Authority
- JP
- Japan
- Prior art keywords
- time
- input
- level
- change
- interrupt routine
- 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
Links
- 238000000034 method Methods 0.000 description 18
- 244000145845 chattering Species 0.000 description 6
- 238000001914 filtration Methods 0.000 description 2
- 230000003213 activating effect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
Landscapes
- Input From Keyboards Or The Like (AREA)
- Manipulation Of Pulses (AREA)
Description
【発明の詳細な説明】 〔概 要〕 エッジ割込ルーチン(手段)とタイマ一致割込ルーチン
(手段)を併用することで、ソフトウエアによる入力フ
ィルタのフィルタ時間を他の処理に解放する。DETAILED DESCRIPTION [Overview] By using an edge interrupt routine (means) and a timer coincidence interrupt routine (means) together, the filter time of an input filter by software is released to other processing.
本発明は入力信号からノイズやチャタリングをソフト的
に除去する入力フィルタに関する。The present invention relates to an input filter that softly removes noise and chattering from an input signal.
車速に応じてパルス幅が変化する車速センサ信号は機械
的な振動や点火パルス等による影響を受け易い。このた
め、この種の信号を処理する前にフィルタを通すのが一
般的である。The vehicle speed sensor signal whose pulse width changes according to the vehicle speed is easily affected by mechanical vibration, ignition pulse, and the like. For this reason, it is common to filter such signals before processing them.
第2図はかゝる入力フィルタをソフトウエアで構成した
従来例である。この入力フィルタは車速センサ信号のエ
ッジ割込ルーチンとして構成されている。処理はエッ
ジ割込でレジスタに取込まれた信号レベルとその後の信
号レベルを比較し、両者が同じであるときはノイズやチ
ャタリング無(N)と判断し、また異なるときはこれら
が有(Y)と判断する。有(Y)と判断されると処理
で入力変化がキャンセルされる(レジスタの内容がクリ
アされる)。例えば、第3図のような入力の場合、最初
のエッジE1で割込がかかると、エッジE2が現われる
までは同じ信号レベルを保つので処理はNへ分岐す
る。しかし、エッジE2が現われると処理はYへ分岐
して一旦終了し、次のエッジE3で再度割込みがかか
る。このような処理を繰り返し、最後のエッジEnで割
込みがかかると、そこから一定のフィルタ時間(例えば
1ms)経過後に処理はYへ分岐し、処理でレジス
タの内容をメモリへ移す。FIG. 2 shows a conventional example in which such an input filter is configured by software. This input filter is configured as an edge interruption routine of the vehicle speed sensor signal. The processing compares the signal level taken into the register by the edge interrupt with the subsequent signal level. If they are the same, it is judged that there is no noise or chattering (N), and if they are different, they are present (Y ). If it is determined to be present (Y), the input change is canceled in the process (the contents of the register are cleared). For example, in the case of the input as shown in FIG. 3, if the interrupt is applied at the first edge E 1 , the same signal level is maintained until the edge E 2 appears, so the process branches to N. However, when the edge E 2 appears, the process branches to Y and ends once, and an interrupt occurs again at the next edge E 3 . When such a process is repeated and an interrupt occurs at the last edge En, the process branches to Y after a lapse of a certain filter time (for example, 1 ms), and the content of the register is transferred to the memory in the process.
上述したフィルタ処理ではフィルタ時間を経過するまで
処理が繰り返されるため、この間他の処理をするこ
とができない。一般に車速センサ信号を扱うシステムで
は車速制御や変速制御等が主たる処理として位置づけら
れているので、入力フィルタ処理の占有時間が長いとこ
れら主制御に遅れが生ずる原因となる。また、このよう
な方法であると複数のセンサ入力を同時に処理すること
ができない。In the above-described filter processing, the processing is repeated until the filter time elapses, and therefore other processing cannot be performed during this time. Generally, in a system that handles a vehicle speed sensor signal, vehicle speed control, speed change control, and the like are positioned as the main processing, so that a long occupation time of the input filter processing causes a delay in the main control. Further, such a method cannot process a plurality of sensor inputs at the same time.
本発明はエッジ割込とタイマ一致割込を併用することで
これらの問題点を解決しようとするものである。The present invention intends to solve these problems by using both edge interrupt and timer coincident interrupt.
本発明は、入力信号のレベル変化の有無を判断する第1
の判断ステップと、該第1の判断ステップにて入力信号
のレベル変化がなければフィルタ時間を規定する一致タ
イマのタイムアウト時刻をセットして処理を終了するス
テップを備えたエッジ割込みルーチンと、前記入力信号
のレベル変化の有無を判断する第2の判断ステップと、
該第2の判断ステップにて入力信号のレベル変化がなけ
れば入力受付処理をし、レベル変化があれば入力変化を
キャンセルして終了するステップを備えたタイマ一致割
込ルーチンと、前記入力信号のレベル変化で前記エッジ
割込ルーチンを起動させ、該ルーチンの起動後、前記タ
イムアウト時刻が経過するまでは以降のエッジ割込ルー
チンの実行を禁止させ、更に前記タイムアウト時刻が経
過したとき前記タイマ割込みルーチンを起動させる処理
手段とを備えたことを特徴とするものである。The first aspect of the present invention is to determine whether there is a change in the level of an input signal.
And an edge interrupt routine including the step of terminating the processing by setting the timeout time of the coincidence timer that defines the filter time if there is no change in the level of the input signal in the first determination step. A second determination step of determining whether or not there is a signal level change;
If there is no change in the level of the input signal in the second judgment step, input acceptance processing is performed, and if there is a level change, a timer coincidence interrupt routine having a step of canceling the input change and terminating, The edge interrupt routine is activated by a level change, and after the routine is activated, execution of the edge interrupt routine thereafter is prohibited until the time-out time elapses, and when the time-out time elapses, the timer interrupt routine And a processing means for activating.
本発明ではエッジ割込ルーチンでフィルタ時間を規定す
る一致タイマを始動させたら、その後タイマ一致割込ル
ーチンが起動されるまではプロセッサをこのフィルタ処
理から解放する。従って、プロセッサはこの間に制御等
の処理を実行できる。また、複数のセンサ入力を同時に
取込んでフィルタ処理することもできる。In the present invention, after the match timer that defines the filter time is started by the edge interrupt routine, the processor is released from this filtering process until the timer match interrupt routine is activated thereafter. Therefore, the processor can execute processing such as control during this time. Also, multiple sensor inputs can be simultaneously captured and filtered.
第1図は本発明の一実施例を示すフローチャートで、
(a)はエッジ割込ルーチン、(b)はタイマ一致割込ルーチ
ンを示している。両ルーチン共に処理を有するが、こ
れは第2図と異なりエッジ割込後に1回だけ行われるレ
ベル比較であり、一般に割込から数〜20μs後のレベ
ル比較となる。ここでノイズやチャタリングが有(Y)
と判断されれば第2図と同様に処理で入力変化がキャ
ンセルされる。FIG. 1 is a flow chart showing an embodiment of the present invention.
(a) shows an edge interrupt routine, and (b) shows a timer match interrupt routine. Both routines have processing, but unlike FIG. 2, this is a level comparison that is performed only once after an edge interrupt, and is generally a level comparison several to 20 μs after the interrupt. There is noise or chattering here (Y)
If it is determined that the input change is canceled by the process similar to FIG.
(a)のエッジ割込ルーチンではノイズやチャタリング無
(N)と判断したら処理で一致タイマにフィルタ時間
を規定するタイムアウト時刻をセットして終了する。こ
の後プロセッサはこのフィルタ処理から解放される。や
がてフィルタ時間が経過しタイマ一致割込がかかると、
プロセッサは(b)のレーチンを実行する。ここでもノイ
ズやチャタリング無(N)と判断したらの入力受付処
理を実行して終了する。In the edge interrupt routine of (a), when it is determined that there is no noise or chattering (N), the process sets the timeout time for defining the filter time in the coincidence timer and ends. The processor is then freed from this filtering. Eventually, if the filter time elapses and a timer match interrupt occurs,
The processor executes the retin in (b). In this case as well, the input reception process is executed when it is determined that there is no noise or chattering (N), and the process ends.
このようにエッジ割込ルーチンとタイマ一致割込ルーチ
ンを併用すると、第2図のように処理繰り返すルー
プが不用になるので、プロセッサは第1図(a)のルーチ
ン終了後に他の処理に移ることができる。また、複数の
センサ入力処理を行う場合、それぞれの割込処理時間は
短いので、互いに影響を与えることなく同様のフィルタ
処理を行うことができる。さらに、第3図の例では最後
のエッジEnより早い時点で、例えばエッジE1とE2
の間が処理の判定時間(例えば20μs)より長けれ
ば最初のエッジE1の段階からフィルタ時間を設定でき
る。When the edge interrupt routine and the timer coincidence interrupt routine are used together in this way, the loop for repeating the process as shown in FIG. 2 becomes unnecessary, so the processor shifts to another process after the routine of FIG. 1 (a) ends. You can Further, when a plurality of sensor input processes are performed, the respective interrupt process times are short, so that similar filter processes can be performed without affecting each other. Further, in the example of FIG. 3, at a time earlier than the last edge En, for example, the edges E 1 and E 2
If the interval is longer than the processing determination time (for example, 20 μs), the filter time can be set from the stage of the first edge E 1 .
以上述べたように本発明によれば、入力信号からノイズ
やチャタリングを除去する入力フィルタをソフトウエア
で構成する場合、フィルタ時間にレベルチェックをしな
いので、その間プロセッサは他の処理を行うことができ
る。このため同じプロセッサによる他の制御遅れ等の問
題がなく、また複数のセンサ入力を同時に取込んでフィ
ルタ処理することができる。As described above, according to the present invention, when the input filter that removes noise and chattering from the input signal is configured by software, the level is not checked at the filter time, so the processor can perform other processing during that time. . Therefore, there is no other problem such as control delay due to the same processor, and a plurality of sensor inputs can be simultaneously taken in and filtered.
第1図は本発明の一実施例を示すフローチャート、 第2図は従来の車速入力フィルタのフローチャート、 第3図は車速センサ信号の波形図である。 FIG. 1 is a flowchart showing an embodiment of the present invention, FIG. 2 is a flowchart of a conventional vehicle speed input filter, and FIG. 3 is a waveform diagram of a vehicle speed sensor signal.
Claims (1)
1の判断ステップと、該第1の判断ステップにて入力信
号のレベル変化がなければフィルタ時間を規定する一致
タイマのタイムアウト時刻をセットして処理を終了する
ステップを備えたエッジ割込みルーチンと、 前記入力信号のレベル変化の有無を判断する第2の判断
ステップと、該第2の判断ステップにて入力信号のレベ
ル変化がなければ入力受付処理をし、レベル変化があれ
ば入力変化をキャンセルして終了するステップを備えた
タイマ一致割込ルーチンと、 前記入力信号のレベル変化で前記エッジ割込ルーチンを
起動させ、該ルーチンの起動後、前記タイムアウト時刻
が経過するまでは以降のエッジ割込ルーチンの実行を禁
止させ、更に前記タイムアウト時刻が経過したとき前記
タイマ割込みルーチンを起動させる処理手段とを備えた
ことを特徴とする入力フィルタ。1. A first determination step of determining whether or not there is a level change of an input signal, and a time-out time of a coincidence timer that defines a filter time if the level of the input signal does not change in the first determination step. An edge interrupt routine including a step of terminating the processing, a second determination step of determining whether the level of the input signal has changed, and an input if the level of the input signal does not change in the second determination step. A timer coincidence interrupt routine including a step of performing acceptance processing and canceling and ending the input change if there is a level change, and the edge interrupt routine is activated by the level change of the input signal, and after the routine is activated , The execution of the edge interrupt routine thereafter is prohibited until the time-out time elapses, and before the time-out time elapses. Input filter comprising the processing means for starting a timer interrupt routine.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP62069796A JPH0621990B2 (en) | 1987-03-24 | 1987-03-24 | Input filter |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP62069796A JPH0621990B2 (en) | 1987-03-24 | 1987-03-24 | Input filter |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS63236136A JPS63236136A (en) | 1988-10-03 |
| JPH0621990B2 true JPH0621990B2 (en) | 1994-03-23 |
Family
ID=13413063
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP62069796A Expired - Fee Related JPH0621990B2 (en) | 1987-03-24 | 1987-03-24 | Input filter |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0621990B2 (en) |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS5164846A (en) * | 1974-12-03 | 1976-06-04 | Fujitsu Ltd | |
| JPS5486244A (en) * | 1977-12-21 | 1979-07-09 | Nec Corp | Information processor |
| JPS55162155A (en) * | 1979-06-05 | 1980-12-17 | Matsushita Electric Ind Co Ltd | Interrupting circuit of microcomputer |
| JPS5920029A (en) * | 1982-07-27 | 1984-02-01 | Fuji Xerox Co Ltd | Taking-in device of sensor signal |
-
1987
- 1987-03-24 JP JP62069796A patent/JPH0621990B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPS63236136A (en) | 1988-10-03 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JPH03288942A (en) | Program run-away detecting method for microcomputer | |
| JPS63238630A (en) | Interruption controller for microprocessor | |
| JPH0621990B2 (en) | Input filter | |
| JPH0415912B2 (en) | ||
| JPH0230524B2 (en) | ||
| JP2643435B2 (en) | Input signal recognition method | |
| JPH10161888A (en) | Device and method for task margin degree analysis, and recording medium stored with task margin degree analyzing program | |
| JP2990111B2 (en) | Timer circuit | |
| JPS60241104A (en) | Arithmetic method of digital controller | |
| JPH0325519A (en) | Timer control method | |
| JPS61226839A (en) | Event processing system | |
| JPH0683652A (en) | Micro computer system | |
| JPH11110231A (en) | Interruption control system | |
| SU1547051A1 (en) | Device for monitoring pulse series | |
| JPH10254713A (en) | Digital arithmetic unit | |
| JPH0614322B2 (en) | Interrupt generation circuit | |
| JPH0146960B2 (en) | ||
| JPH01207837A (en) | System diagnostic system | |
| JPS63205755A (en) | Real time multiprocessing system | |
| JPH04332056A (en) | Microcomputer | |
| JPH05257875A (en) | Method for evading interruption processing start delay | |
| JPS60178524A (en) | One-chip microcomputer | |
| JPS6114548B2 (en) | ||
| JPH02299032A (en) | Interruption processing control system | |
| JPH0468839A (en) | State change processing system for digital signal |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| LAPS | Cancellation because of no payment of annual fees |