JPH0474228A - Interruption circuit - Google Patents

Interruption circuit

Info

Publication number
JPH0474228A
JPH0474228A JP18845890A JP18845890A JPH0474228A JP H0474228 A JPH0474228 A JP H0474228A JP 18845890 A JP18845890 A JP 18845890A JP 18845890 A JP18845890 A JP 18845890A JP H0474228 A JPH0474228 A JP H0474228A
Authority
JP
Japan
Prior art keywords
pulses
time
counting
clock
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.)
Pending
Application number
JP18845890A
Other languages
Japanese (ja)
Inventor
Masahiro Nakagawa
中川 正浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC IC Microcomputer Systems Co Ltd
Original Assignee
NEC IC Microcomputer Systems Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC IC Microcomputer Systems Co Ltd filed Critical NEC IC Microcomputer Systems Co Ltd
Priority to JP18845890A priority Critical patent/JPH0474228A/en
Publication of JPH0474228A publication Critical patent/JPH0474228A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To shorten the processing time and to reduce the load of a computer by applying an interruption to the computer only when an optional number of pulses are inputted within an optional time. CONSTITUTION:The pulse number N is set to a pulse number setting and the clock number M is set to a clock number setting means 9 in response to the time T. Thus a coincidence signal is outputted from a comparison means 3 when N pulses are inputted within the time T. At the same time, an interruption requiring signal INT is outputted from a control means 5. Thus an interruption can be applied to a computer. When the number of pulses inputted within the time T is less than N pieces, the counted value of a counting means 7 is coincident with the clock number M and a coincidence signal is outputted from a comparison means 8. Thus both counting means 2 and 7 are reset and no signal INT is outputted. Thus, the processing time is shortened and the load of the computer is reduced.

Description

【発明の詳細な説明】 [産業上の利用分野コ 本発明は、マイクロコンピュータに内蔵され、外部入力
信号に従ってマイクロコンピュータに割り込みをかける
割り込み回路に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to an interrupt circuit that is built into a microcomputer and interrupts the microcomputer in accordance with an external input signal.

[従来の技術] 従来、例えばロータリエンコーダ等から供給される大力
パルスの所定時間内のパルス数等をマイクロコンピュー
タで検出する場合、前記大力パルスによって割り込みを
かけ、ソフトウェアによって時間測定とパルスの計数と
を行うようにしている。従って、これに使用される割り
込み回路は、第2図に示すような構成となっていた。
[Prior Art] Conventionally, when a microcomputer detects the number of high-power pulses supplied from a rotary encoder or the like within a predetermined time, an interrupt is generated by the high-power pulse, and software performs time measurement and pulse counting. I am trying to do this. Therefore, the interrupt circuit used for this has a configuration as shown in FIG.

即ち、この割り込み回路は、マイクロコンピュータに内
蔵され、外部入力信号sI、、をドライブする入力回路
11と、この入力回路11の出力のエツジを検出するエ
ツジ検出手段12と、このエツジ検出手段12で検出さ
れたエツジでマイクロコンピュータに割り込み要求信号
INTを供給する割り込み制御手段13とによって構成
されている。
That is, this interrupt circuit is built in a microcomputer, and includes an input circuit 11 that drives an external input signal sI, an edge detection means 12 that detects the edge of the output of this input circuit 11, and this edge detection means 12. The interrupt control means 13 supplies an interrupt request signal INT to the microcomputer at the detected edge.

この構成によれば、マイクロコンピュータは、外部入力
信号S1.、のエツジが入力される度に割り込みをかけ
られ、計数動作を行うと共に、ソフトウェアによる時間
判定を行う。
According to this configuration, the microcomputer receives the external input signal S1. , an interrupt is generated every time an edge of , is input, a counting operation is performed, and time is determined by software.

[発明が解決しようとする課題] しかしながら、上述した従来の割り込み回路では、外部
入力信号が1パルス入力される毎にパルス数をカウント
し、時間算出及び判定処理を行う必要があり、これらは
全てソフトウェアによる処理であるため、マイクロコン
ピュータの負担が増し、処理時間が長くなるという問題
点がある。
[Problems to be Solved by the Invention] However, in the conventional interrupt circuit described above, it is necessary to count the number of pulses and perform time calculation and judgment processing every time one pulse of the external input signal is input. Since the processing is performed by software, there are problems in that the burden on the microcomputer increases and the processing time increases.

本発明はかかる問題点に鑑みてなされたものであって、
マイクロコンピュータの負担を軽減すると共に、外部入
力信号のパルス計数処理の時間を短縮することができる
割り込み回路を提供することを目的とする。
The present invention has been made in view of such problems, and includes:
It is an object of the present invention to provide an interrupt circuit that can reduce the burden on a microcomputer and shorten the time required for pulse counting processing of an external input signal.

〔課題を解決するための手段] 本発明に係る割り込み回路は、外部入力信号のパルス数
をカウントする第1のカウント手段と、任意のパルス数
が設定されるパルス数設定手段と、前記第1のカウント
手段の出力と前記パルス数設定手段に設定されたパルス
数とを比較して両者が一致したときに一致信号を出力す
る第1の比較手段と、この第1の比較手段からの一致信
号に基づいて割り込み要求信号を発生する割り込み制御
手段と、クロック信号を発生するクロック発生回路と、
このクロック発生回路からのクロック信号をカウントす
る第2のカウント手段と、任意のクロック数が設定され
るクロック数設定手段と、前記第2のカウント手段の出
力と前記クロック数設定手段に設定されたクロック数と
を比較して両者が一致したときに前記第1及び第2のカ
ウント手段をリセットする第2の比較手段とを有するこ
とを特徴とする。
[Means for Solving the Problems] An interrupt circuit according to the present invention includes: a first counting means for counting the number of pulses of an external input signal; a pulse number setting means for setting an arbitrary number of pulses; a first comparing means that compares the output of the counting means with the number of pulses set in the pulse number setting means and outputs a coincidence signal when the two match; and a coincidence signal from the first comparison means. an interrupt control means that generates an interrupt request signal based on the above; a clock generation circuit that generates a clock signal;
a second counting means for counting clock signals from this clock generation circuit; a clock number setting means for setting an arbitrary number of clocks; and an output of the second counting means and a clock number setting means set to the clock number setting means. It is characterized by comprising a second comparing means for comparing the clock number and resetting the first and second counting means when the two match.

[作用コ 本発明によれば、クロック数設定手段に設定されたクロ
ック数によって決定される時間内に、パルス数設定手段
に設定されたパルス数の外部入力信号が入力されると、
第1の比較手段から一致信号が出力され、割り込み制御
手段から割り込み要求信号が出力される。
[Function] According to the present invention, when an external input signal of the number of pulses set in the pulse number setting means is input within the time determined by the number of clocks set in the clock number setting means,
A match signal is output from the first comparison means, and an interrupt request signal is output from the interrupt control means.

一方、クロック数設定手段に設定されたクロック数によ
って決定される時間内に、パルス数設定手段に設定され
たパルス数の外部入力信号が入力されない場合には、第
1の比較手段がら一致信号が出力される前に、第2の比
較手段によって第1及び第2のカウント手段がリセット
される。したがって、この場合には、割り込み要求信号
は出力されない。
On the other hand, if the external input signal of the number of pulses set in the pulse number setting means is not input within the time determined by the number of clocks set in the clock number setting means, the first comparison means detects a coincidence signal. Before being output, the first and second counting means are reset by the second comparing means. Therefore, in this case, no interrupt request signal is output.

このように、本発明によれば、クロック数設定手段及び
パルス数設定手段に任意の値を設定することにより、任
意の時間内に任意の数のパルスが入力されたときのみマ
イクロコンピュータに割り込みをかけるようにしている
ので、従来のようなソフトウェアによる時間判定及びパ
ルス数のカウント処理の時間を削減することができ、処
理時間の短縮を図ることができると共に、マイクロコン
ピュータの負担を軽減することができる。
As described above, according to the present invention, by setting arbitrary values in the clock number setting means and the pulse number setting means, the microcomputer can be interrupted only when a given number of pulses are input within a given time. This reduces the time required for conventional software-based time judgment and pulse count processing, which reduces processing time and reduces the burden on the microcomputer. can.

[実施例] 以下、添付の図面に基づいて本発明の実施例について説
明する。
[Example] Hereinafter, an example of the present invention will be described based on the accompanying drawings.

第1図は本発明の実施例に係る割り込み回路の構成を示
すブロック図である。
FIG. 1 is a block diagram showing the configuration of an interrupt circuit according to an embodiment of the present invention.

例えば、ロータリーエンコーダ等から供給される外部入
力信号Srnは、入力回路1を介して第1のカウント手
段2に入力されている。第1のカウント手段2の出力は
、第1の比較手段3の一方の比較入力端に入力されてい
る。また、この回路には、プログラムによって任意のパ
ルス数を設定することが可能なパルス数設定手段4が設
けられており、このパルス数設定手段4からの出力が第
1の比較手段3の他方の比較入力端に入力されている。
For example, an external input signal Srn supplied from a rotary encoder or the like is input to the first counting means 2 via the input circuit 1. The output of the first counting means 2 is inputted to one comparison input terminal of the first comparison means 3. Further, this circuit is provided with a pulse number setting means 4 which can set an arbitrary number of pulses by a program, and the output from this pulse number setting means 4 is transmitted to the other one of the first comparison means 3. It is input to the comparison input terminal.

第1の比較手段3は、第1のカウント手段2のカウント
値と、パルス数設定手段4に設定されたパルス数とが一
致したら一致信号を割り込み制御手段5に出力する。割
り込み制御手段5は、上記一致信号が入力されたらマイ
クロコンピュータに割り込みをかけるための割り込み要
求信号INTを出力する。
The first comparison means 3 outputs a match signal to the interrupt control means 5 when the count value of the first counting means 2 and the number of pulses set in the pulse number setting means 4 match. The interrupt control means 5 outputs an interrupt request signal INT for interrupting the microcomputer when the coincidence signal is input.

一方、この回路には、クロック信号を出力するクロック
発生回路6が設けられている。このクロック発生回路6
からのクロック信号は、第2のカウント手段7に入力さ
れている。第2のカウント手段7の出力は、第2の比較
手段8の一方の比較入力端に入力されている。また、こ
の回路には、プログラムによって任意のクロック数を設
定することが可能なりロック数設定手段9が設けられて
おり、このクロック数設定手段9からの出力が第2の比
較手段8の他方の比較入力端に入力されている。第2の
比較手段8は、第2のカウント手段7のカウント値と、
クロック数設定手段9に設定されたクロック数とが一致
したら、第1のカウント手段2及び第2のカウント手段
7をリセットするものとなっている。
On the other hand, this circuit is provided with a clock generation circuit 6 that outputs a clock signal. This clock generation circuit 6
The clock signal from the second counting means 7 is inputted to the second counting means 7. The output of the second counting means 7 is input to one comparison input terminal of the second comparison means 8. Further, this circuit is provided with a lock number setting means 9 which can set an arbitrary number of clocks by a program, and the output from this clock number setting means 9 is applied to the other one of the second comparing means 8. It is input to the comparison input terminal. The second comparing means 8 compares the count value of the second counting means 7 with the count value of the second counting means 7;
When the clock number set in the clock number setting means 9 matches, the first counting means 2 and the second counting means 7 are reset.

次に上記のように構成された本実施例に係る割り込み回
路の動作を説明する。
Next, the operation of the interrupt circuit according to this embodiment configured as described above will be explained.

いま、所定時間Tの間にN個のパルスが入力されたとき
、マイクロコンピュータへの割り込みをかけるものとす
ると、パルス数設定手段4にはNを、また、クロック数
設定手段9には時間Tに対応したクロック数Mをプログ
ラム等によって夫々設定する。
Now, if we assume that an interrupt is to be made to the microcomputer when N pulses are input during a predetermined time T, the pulse number setting means 4 is set to N, and the clock number setting means 9 is set to the time T. The number of clocks M corresponding to the number of clocks M is set by a program or the like.

このような設定を行うと、時間T内にN個のパルスが入
力された時点で第1の比較手段3から一致信号が出力さ
れ、割り込み制御手段5から割り込み要求信号INTが
出力される。この結果、マイクロコンピュータに割り込
みをかけることができる。
With such settings, when N pulses are input within time T, the first comparison means 3 outputs a match signal, and the interrupt control means 5 outputs an interrupt request signal INT. As a result, it is possible to interrupt the microcomputer.

一方、所定時間Tめ間に入力された外部入力信号5If
iのパルスがN個に満たなかったときには、第1の比較
手段3から一致信号が出力される前に、第2のカウント
手段7のカウント値が設定されたクロック数Mと一致し
て、第2の比較手段8から一致信号が出力されるので、
第1のカウント手段2及び第2のカウント手段7がリセ
ットされる。
On the other hand, an external input signal 5If input at a predetermined time T
When the number of pulses of i is less than N, the count value of the second counting means 7 coincides with the set clock number M before the first comparison means 3 outputs a coincidence signal, and the second Since the matching signal is output from the comparing means 8 of 2,
The first counting means 2 and the second counting means 7 are reset.

したがって、この場合には、割り込み要求信号INTは
出力されない。
Therefore, in this case, interrupt request signal INT is not output.

このように、本実施例の回路によれば、ソフトウェアに
負担をかけずに割り込み処理を行うことができる。
In this way, according to the circuit of this embodiment, interrupt processing can be performed without placing a burden on software.

[発明の効果コ 以上説明したように、本発明によれば、クロック数設定
手段に設定された任意の時間内に、パルス数設定手段に
設定された任意のパルス数の外部入力信号が入力された
ときのみマイクロコンピュータに割り込みがかかるよう
にして、従来のようなソフトウェアによる時間判定及び
パルス数のカウント処理等の時間を削減したので、処理
時間の短縮を図ることができると共に、マイクロコンピ
ュータの負担を軽減することができるという効果を奏す
る。
[Effects of the Invention] As explained above, according to the present invention, an external input signal having an arbitrary number of pulses set in the pulse number setting means is inputted within an arbitrary time set in the clock number setting means. By setting the microcomputer to be interrupted only when an event occurs, the time required for time determination and pulse count processing using software, as in the past, is reduced. This reduces processing time and reduces the burden on the microcomputer. This has the effect of being able to reduce the

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

第1図は本発明の実施例に係る割り込み回路のブロック
図、第2図は従来の割り込み回路のブロック図である。 1.11;入力回路、2;第1のカウント手段、3;第
1の比較手段、4:パルス数設定手段、5゜13:割り
込み制御手段、6;クロック発生回路、7;第2のカウ
ント手段、8;第2の比較手段、9;クロック数設定手
段、12;エツジ検出手段出願人 日本電気アイジ−マ
イコン システム株式会社
FIG. 1 is a block diagram of an interrupt circuit according to an embodiment of the present invention, and FIG. 2 is a block diagram of a conventional interrupt circuit. 1.11: Input circuit, 2: First counting means, 3: First comparing means, 4: Pulse number setting means, 5°13: Interrupt control means, 6: Clock generation circuit, 7: Second counting Means, 8; Second comparison means, 9; Clock number setting means, 12; Edge detection means Applicant: Nippon Electric IG Microcomputer System Co., Ltd.

Claims (1)

【特許請求の範囲】[Claims] (1)外部入力信号のパルス数をカウントする第1のカ
ウント手段と、任意のパルス数が設定されるパルス数設
定手段と、前記第1のカウント手段の出力と前記パルス
数設定手段に設定されたパルス数とを比較して両者が一
致したときに一致信号を出力する第1の比較手段と、こ
の第1の比較手段からの一致信号に基づいて割り込み要
求信号を発生する割り込み制御手段と、クロック信号を
発生するクロック発生回路と、このクロック発生回路か
らのクロック信号をカウントする第2のカウント手段と
、任意のクロック数が設定されるクロック数設定手段と
、前記第2のカウント手段の出力と前記クロック数設定
手段に設定されたクロック数とを比較して両者が一致し
たときに前記第1及び第2のカウント手段をリセットす
る第2の比較手段とを有することを特徴とする割り込み
回路。
(1) A first counting means for counting the number of pulses of an external input signal, a pulse number setting means for setting an arbitrary number of pulses, and an output of the first counting means and a pulse number setting means for setting an arbitrary number of pulses. a first comparing means that compares the number of pulses and outputs a match signal when the two match, and an interrupt control means that generates an interrupt request signal based on the match signal from the first comparing means; A clock generation circuit that generates a clock signal, a second counting means that counts clock signals from the clock generation circuit, a clock number setting means that sets an arbitrary number of clocks, and an output of the second counting means. and second comparing means for comparing the number of clocks and the number of clocks set in the number of clocks setting means and resetting the first and second counting means when the two match. .
JP18845890A 1990-07-17 1990-07-17 Interruption circuit Pending JPH0474228A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP18845890A JPH0474228A (en) 1990-07-17 1990-07-17 Interruption circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP18845890A JPH0474228A (en) 1990-07-17 1990-07-17 Interruption circuit

Publications (1)

Publication Number Publication Date
JPH0474228A true JPH0474228A (en) 1992-03-09

Family

ID=16224061

Family Applications (1)

Application Number Title Priority Date Filing Date
JP18845890A Pending JPH0474228A (en) 1990-07-17 1990-07-17 Interruption circuit

Country Status (1)

Country Link
JP (1) JPH0474228A (en)

Similar Documents

Publication Publication Date Title
JPH0474228A (en) Interruption circuit
JPH06348507A (en) Microcomputer
JPH02128287A (en) Microcomputer
JP3166458B2 (en) Timer circuit
JPH0362236A (en) Watchdog timer device
JPS62172442A (en) Detection device for runaway of microcomputer
JPS62289012A (en) Duty control pulse generating circuit
JP3081234B2 (en) How to check CPU board
JPH04225432A (en) Interruption processing time control system for one-chip microcomputer
JPS61281342A (en) Runaway preventing device for program
JPS60230225A (en) Timer processing system of programmable controller
JP2752814B2 (en) Watchdog disconnection alarm processing device
JPH0227854B2 (en)
JPH0553829A (en) Microcomputer
JPS61255421A (en) Time setting system for computer
JPH038005A (en) Timer control system
JPH04112225A (en) Integrated circuit device
JPH0277854A (en) Resetting system for microprocessor
GB1256321A (en) Electronic arithmetic unit sub-assembly
JPS62113245A (en) Operation monitoring device for signal processor
JP2001325870A (en) Input circuit for control signal
JPS6327930A (en) Interruption control circuit
JPH04128981A (en) Microcomputer
JPS6378246A (en) Main clock device
JPH01211159A (en) Clock matching device for computer