JPH07260845A - Pulse period measuring circuit - Google Patents

Pulse period measuring circuit

Info

Publication number
JPH07260845A
JPH07260845A JP4927494A JP4927494A JPH07260845A JP H07260845 A JPH07260845 A JP H07260845A JP 4927494 A JP4927494 A JP 4927494A JP 4927494 A JP4927494 A JP 4927494A JP H07260845 A JPH07260845 A JP H07260845A
Authority
JP
Japan
Prior art keywords
circuit
time
signal
pulse
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.)
Withdrawn
Application number
JP4927494A
Other languages
Japanese (ja)
Inventor
Akiyoshi Kondo
晃由 近藤
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.)
Fujitsu VLSI Ltd
Fujitsu Ltd
Original Assignee
Fujitsu VLSI Ltd
Fujitsu 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 Fujitsu VLSI Ltd, Fujitsu Ltd filed Critical Fujitsu VLSI Ltd
Priority to JP4927494A priority Critical patent/JPH07260845A/en
Publication of JPH07260845A publication Critical patent/JPH07260845A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Measuring Frequencies, Analyzing Spectra (AREA)

Abstract

PURPOSE:To lessen a load of a calculator for calculating a pulse interval across a plurality of external pulses. CONSTITUTION:An external pulse detector 1 detects a rise of an external pulse CK at each time of inputting it, and outputs a detection signal SA to a counter 2. The counter 2 counts the signal SA. A frequency set register 3 sets a predetermined number N for calculating the interval of predetermined number N of the generated pulses CK. A comparator 4 compares a counted value NA with the number N, and outputs a control signal SB in the case of coincidence. The signal SB is output to the counter 2 and an interrupt signal generator 5. The counter 2 resets the counted value NA in response to the signal SB. An interrupt signal generator 5 outputs an interrupt signal SC for calculating the interval of the number N of the pulses CK in response to the signal SB. A transfer circuit 6 reads a time when a timer 7 counts in response to the signal SC, and transfers it to a time storage register 8.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明はパルス周期計測回路に係
り、詳しくは1つのパルス発生を基準とし後に続いて発
生するパルスが予め定めた複数個発生するまでの時間を
計測するパルス周期計測回路に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a pulse period measuring circuit, and more particularly, to a pulse period measuring circuit for measuring the time until a predetermined number of subsequently generated pulses are generated on the basis of one pulse generation. Regarding

【0002】検出対象として連続的に発生される外部パ
ルスを計測し、そのパルスの周期等を計測しその計測結
果に基づいて制御対象物等を精度よく制御するコンピュ
ータシステムにおいては、より高速化、高精度化及び多
機能化が望まれている。そのため、コンピュータシステ
ムにおいて、外部パルスの計測のための負荷を軽減する
パルス周期計測回路が必要となる。
In a computer system in which an external pulse continuously generated as a detection target is measured, the period of the pulse is measured, and the controlled object or the like is accurately controlled based on the measurement result, higher speed, Higher precision and more functions are desired. Therefore, in the computer system, a pulse period measuring circuit that reduces the load for measuring the external pulse is required.

【0003】[0003]

【従来の技術】従来、図5に示すように連続して発生す
る外部パルスCKの計測において、1つのパルス発生を
基準とし後に続いて発生する外部パルスCKが予め定め
た複数個発生するまでのパルス間隔TA (=tn −tn-
1 )を計測する場合がある。図4にそのパルス周期計測
回路を示す。図4において、外部パルス検出回路31は
計測対象の外部パルスCKを入力し、その立上りを検知
して立上り検出信号S1を割込み信号発生回路32に出
力する。割込み信号発生回路32はこの立上り検出信号
S1に応答して割込み信号S2をデータラッチ転送回路
33及び演算装置としての中央処理装置(CPU)34
に出力する。データラッチ転送回路33はこの割込み信
号S2に応答して基準時間軸発生タイマ35がその時の
計時時刻を事象発生時刻tn として読み込み、次段の事
象発生時刻格納レジスタ36に転送する。
2. Description of the Related Art Conventionally, in the measurement of external pulses CK continuously generated as shown in FIG. 5, one pulse is used as a reference until a predetermined plurality of external pulses CK subsequently generated. Pulse interval TA (= tn -tn-
1) may be measured. FIG. 4 shows the pulse cycle measuring circuit. In FIG. 4, the external pulse detection circuit 31 inputs the external pulse CK to be measured, detects the rising edge thereof, and outputs the rising edge detection signal S1 to the interrupt signal generation circuit 32. The interrupt signal generation circuit 32 responds to the rising edge detection signal S1 by transmitting the interrupt signal S2 to the data latch transfer circuit 33 and the central processing unit (CPU) 34 as an arithmetic unit.
Output to. In response to the interrupt signal S2, the data latch transfer circuit 33 causes the reference time axis generation timer 35 to read the time measured at that time as the event occurrence time tn and transfer it to the event occurrence time storage register 36 in the next stage.

【0004】CPU34は割込み信号S2に応答して同
信号S2に基づく時刻取り込み判断処理動作を実行す
る。時刻取り込み判断処理は、ソフトウェアに従って行
われ、今の割込み信号S2は基準となる外部パルスCK
から何個目の外部パルスCKか判断し、目的の数(図5
では4個)の外部パルスCKが発生したかどうか判断す
る。そして、4個目の外部パルスCKでない場合には、
CPU34はこの時刻取り込み判断処理を終了し他の処
理を実行する。反対に、4個目の外部パルスCKの場合
には事象発生時刻格納レジスタ36に記憶された事象発
生時刻tn を読み込み先に読み取った事象発生時刻tn-
1 と比較しパルス間隔TA の演算を行う。
In response to the interrupt signal S2, the CPU 34 executes a time acquisition determination processing operation based on the signal S2. The time acquisition determination process is performed according to software, and the current interrupt signal S2 is the external pulse CK that serves as a reference.
From the number of external pulses CK, the target number (Fig.
Then, it is determined whether four external pulses CK have been generated. If it is not the fourth external pulse CK,
The CPU 34 ends this time acquisition determination process and executes another process. On the contrary, in the case of the fourth external pulse CK, the event occurrence time tn stored in the event occurrence time storage register 36 is read to the event occurrence time tn-
Comparing with 1, the pulse interval TA is calculated.

【0005】以後、同様な処理を繰り返し、順次発生し
てくる外部パルスCKが4個発生する間のパルス間隔T
A を計測する。又、他のパルス周期計測回路として図示
しないが、図4に示す基準時間軸発生タイマ35とデー
タラッチ転送回路33との間にデータラッチ転送回路と
事象発生時刻格納バッファレジスタを設けたものがあ
る。このデータラッチ転送回路は外部パルス検出回路3
1の立上り検出信号S1に応答して基準時間軸発生タイ
マ35がその時の計時している時刻を事象発生時刻tn
として読み込み、次段の事象発生時刻格納バッファレジ
スタに転送する。そして、データラッチ転送回路33は
割込み信号S2に応答して事象発生時刻格納バッファレ
ジスタに転送された事象発生時刻tn として読み込み、
次段の事象発生時刻格納レジスタ36に転送するように
したものである。このパルス周期計測回路も同様に複数
個の外部パルスCKをまたがったパルス間隔TA を計測
することができる。
Thereafter, the same processing is repeated, and the pulse interval T during the generation of four external pulses CK that are sequentially generated.
Measure A. Although not shown as another pulse cycle measuring circuit, there is a circuit in which a data latch transfer circuit and an event occurrence time storage buffer register are provided between the reference time axis generation timer 35 and the data latch transfer circuit 33 shown in FIG. . This data latch transfer circuit is an external pulse detection circuit 3
In response to the rising detection signal S1 of 1, the reference time axis generation timer 35 measures the time measured at that time as the event occurrence time tn.
, And transfer it to the event occurrence time storage buffer register of the next stage. Then, the data latch transfer circuit 33 reads the event occurrence time tn transferred to the event occurrence time storage buffer register in response to the interrupt signal S2,
The data is transferred to the event occurrence time storage register 36 in the next stage. Similarly, this pulse period measuring circuit can measure the pulse interval TA across a plurality of external pulses CK.

【0006】[0006]

【発明が解決しようとする課題】しかしながら、いずれ
のパルス周期計測回路においても、外部パルスCKが発
生する毎に割込み信号S2が出力され、その割込み信号
S2が出力されるごとに、演算装置としてのCPU34
は他の処理動作を中止して時刻取り込み判断処理を行っ
ている。つまり、目的の数の外部パルスCKでない途中
の外部パルスCKの発生時においてもCPU34は時刻
取り込み判断処理に入り目的の数の外部パルスCKでな
いとして、CPU34はこの時刻取り込み判断処理を終
了し元の処理に戻る。従って、その間CPU34は不必
要な時刻取り込み判断処理動作をすることになり、高速
かつ効率的な処理を行なう上で大きな問題であった。
However, in any of the pulse cycle measuring circuits, the interrupt signal S2 is output every time the external pulse CK is generated, and each time the interrupt signal S2 is output, the arithmetic unit serves as an arithmetic unit. CPU34
Performs the time acquisition determination process by stopping other processing operations. That is, even when an external pulse CK that is not the desired number of external pulses CK occurs, the CPU 34 enters the time acquisition determination process, and it is determined that the external pulse CK is not the desired number of external pulses CK. Return to processing. Therefore, during that time, the CPU 34 performs an unnecessary time acquisition determination processing operation, which is a big problem in performing high-speed and efficient processing.

【0007】本発明は上記問題点を解決するためになさ
れたものであって、その目的は複数個の外部パルスをま
たがったパルス間隔を演算する演算装置の負荷を軽減
し、演算装置を高速かつ効率的にプログラムを実行させ
ることができるパルス周期計測回路を提供することにあ
る。
The present invention has been made in order to solve the above problems, and its object is to reduce the load on an arithmetic unit for calculating a pulse interval over a plurality of external pulses and to make the arithmetic unit operate at high speed. An object is to provide a pulse period measuring circuit that can efficiently execute a program.

【0008】[0008]

【課題を解決するための手段】図1は本発明の原理説明
図である。外部パルス検出回路1は外部パルスCKを入
力し、外部パルスCKを入力するたび毎にその立上がり
又は立下りを検出して検出信号SA をカウンタ2に出力
する。カウンタ2は検出信号SA をカウントする。頻度
設定レジスタ3は発生する外部パルスCKの所定個数N
のパルス間隔を演算するためのその所定個数Nが予め設
定されている。
FIG. 1 is a diagram for explaining the principle of the present invention. The external pulse detection circuit 1 receives the external pulse CK, detects the rising or falling of the external pulse CK each time the external pulse CK is input, and outputs a detection signal SA to the counter 2. The counter 2 counts the detection signal SA. The frequency setting register 3 has a predetermined number N of external pulses CK to be generated.
The predetermined number N for calculating the pulse interval of is set in advance.

【0009】比較回路4はカウンタ2のカウント値NA
と頻度設定レジスタ3の所定個数Nとを比較し、一致し
たとき制御信号SB を出力する。制御信号SB はカウン
タ2及び割込み信号発生回路5に出力される。そして、
カウンタ2はこの制御信号SB に応答してカウント値N
A をリセットする。割込み信号発生回路5は制御信号S
B に応答して前記外部パルスCKの所定個数Nの間隔を
演算するための割込み信号SC を出力する。転送回路6
は割込み信号SC に応答してタイマ7が計時しているそ
の時の時刻tn を読み出し時刻格納レジスタ8に転送す
るようになっている。
The comparison circuit 4 counts the count value NA of the counter 2.
And the predetermined number N of the frequency setting registers 3 are compared, and when they match, the control signal SB is output. The control signal SB is output to the counter 2 and the interrupt signal generation circuit 5. And
The counter 2 responds to the control signal SB with the count value N
Reset A. The interrupt signal generation circuit 5 uses the control signal S
In response to B, an interrupt signal SC for calculating the interval of the predetermined number N of the external pulses CK is output. Transfer circuit 6
Responds to the interrupt signal Sc and transfers the time tn measured by the timer 7 to the read time storage register 8 at that time.

【0010】[0010]

【作用】本発明によれば、外部パルスCKが予め定めた
所定個数N発生すると、比較回路4は制御信号SB を発
生する。そして、この制御信号SB に応答して割込み信
号SC が割込み発生回路5から出力される。即ち、外部
パルスCKが発生する毎に割込み信号SC が出力される
のではなく、所定個数N発生する毎に割込み信号SC が
1つ出力される。従って、例えばこの割込み信号SC を
発生する外部パルスCKの所定個数Nの間隔を演算する
演算装置に出力すれば、演算装置は時刻格納レジスタ8
から時刻を取り込む回数も減り負荷が減少することにな
る。
According to the present invention, when the predetermined number N of external pulses CK are generated, the comparison circuit 4 generates the control signal SB. Then, in response to the control signal SB, the interrupt signal SC is output from the interrupt generation circuit 5. That is, the interrupt signal SC is not output every time the external pulse CK is generated, but one interrupt signal SC is output every time the predetermined number N is generated. Therefore, for example, if this interrupt signal SC is output to the arithmetic unit for calculating the interval of the predetermined number N of the external pulses CK, the arithmetic unit outputs the time storage register 8
Therefore, the number of times of capturing time from is also reduced and the load is reduced.

【0011】[0011]

【実施例】以下、本発明のパルス周期計測回路を具体化
した一実施例を図2に従って説明する。尚、説明の便宜
上、パルス周期計測回路は図5に示す外部パルスCKが
4個発生した時のパルス間隔TA を計測するものとす
る。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the pulse period measuring circuit of the present invention will be described below with reference to FIG. For convenience of explanation, the pulse cycle measuring circuit measures the pulse interval TA when four external pulses CK shown in FIG. 5 are generated.

【0012】外部パルス検出回路11は図5に示す外部
パルスCKを入力し、その立上りを検出し立上がり検出
信号SA を出力する。従って、外部パルス検出回路11
は外部パルスCKを入力するたび毎にその立上がり検出
信号SA を出力する。カウンタ12は立上がり検出信号
SA 入力しその入力した数NA をカウントする。割込み
頻度設定レジスタ13は発生する外部パルスCKが4個
発生した時の間隔TAを演算するためのその所定個数N
(=4)のデータが予め設定されている。
The external pulse detection circuit 11 receives the external pulse CK shown in FIG. 5, detects the rising edge thereof, and outputs the rising edge detection signal SA. Therefore, the external pulse detection circuit 11
Outputs the rising detection signal SA every time the external pulse CK is input. The counter 12 receives the rising edge detection signal SA and counts the input number NA. The interrupt frequency setting register 13 has a predetermined number N for calculating the interval TA when four external pulses CK are generated.
The data of (= 4) is preset.

【0013】比較回路14はカウンタ12のカウント値
NA と割込み頻度設定レジスタ13の所定個数Nのデー
タとを比較し、カウント値NA がN(=4)になった時
に制御信号SB を出力する。制御信号SB はカウンタ1
2及び割込み信号発生回路15に出力される。カウンタ
12はこの制御信号SB に応答してカウント値NA を
「4」から「1」にリセットする。割込み信号発生回路
15は制御信号SB に応答して前記外部パルスCKの所
定個数N(=4)の間隔TA を演算するための割込み信
号SC を出力する。割込み信号SC はデータラッチ転送
回路16及び演算装置としての中央処理装置(CPU)
17に出力される。
The comparison circuit 14 compares the count value NA of the counter 12 with the predetermined number N of data in the interrupt frequency setting register 13 and outputs a control signal SB when the count value NA reaches N (= 4). Control signal SB is counter 1
2 and the interrupt signal generation circuit 15. The counter 12 resets the count value NA from "4" to "1" in response to the control signal SB. In response to the control signal SB, the interrupt signal generation circuit 15 outputs an interrupt signal SC for calculating a predetermined number N (= 4) of intervals TA of the external pulse CK. The interrupt signal SC is the data latch transfer circuit 16 and the central processing unit (CPU) as an arithmetic unit.
It is output to 17.

【0014】データラッチ転送回路16は割込み信号S
C に応答してフリーランニングカウンタよりなる基準時
間軸発生タイマ18が計時しているその時の時刻tn を
読み出し、その時刻tn を事象発生時刻格納レジスタ1
9に転送するようになっている。一方、CPU17は割
込み信号SC に応答して時刻取り込み判断処理を実行す
る。時刻取り込み判断処理は、事象発生時刻格納レジス
タ19に格納された前記時刻tn を読み出し、CPU1
7に内蔵された内部レジスタに格納された1つの前の割
込み信号SC に基づいて読み出した先の時刻tn-1 とに
基づいてパルス間隔TA (=tn −tn-1 )を演算する
ようになっている。そして、間隔TA を演算し、新たに
読み出した時刻tn を内部レジスタに格納した後、CP
U17は時刻取り込み判断処理を終了し、次の新たな割
込み信号SC が入力されるまでその他の処理を実行す
る。
The data latch transfer circuit 16 receives an interrupt signal S
In response to C, the time tn at which the reference time axis generation timer 18 composed of a free-running counter is clocking is read, and the time tn is read as the event occurrence time storage register 1
It is supposed to be transferred to 9. On the other hand, the CPU 17 executes the time acquisition determination processing in response to the interrupt signal SC. In the time acquisition determination processing, the time tn stored in the event occurrence time storage register 19 is read out, and the CPU 1
The pulse interval TA (= tn-tn-1) is calculated based on the previous time tn-1 read out based on the one previous interrupt signal SC stored in the internal register incorporated in FIG. ing. Then, after calculating the interval TA and storing the newly read time tn in the internal register, CP
U17 ends the time acquisition determination process and executes other processes until the next new interrupt signal SC is input.

【0015】次に、上記のように構成されたパルス周期
計測回路の作用を説明する。今、カウンタ12のカウン
ト値NA が「1」で、CPU17の内部レジスタに先の
時刻tn-1 が格納されているとき、新たな外部パルスC
Kが発生すると、外部パルス検出回路11は立上り検出
信号SA を出力する。カウンタ12は立上り検出信号S
A をカウントしカウント値NA を「2」にする。比較回
路14はこのカウント値NA (=2)が割込み頻度設定
レジスタ13で設定した「4」でないので制御信号SB
を出力しない。従って、割込み信号SC は割込み発生回
路15から出力されない。その結果、CPU17は時刻
取り込み判断処理をしない。
Next, the operation of the pulse period measuring circuit configured as described above will be described. Now, when the count value NA of the counter 12 is "1" and the previous time tn-1 is stored in the internal register of the CPU 17, a new external pulse C
When K is generated, the external pulse detection circuit 11 outputs the rising edge detection signal SA. The counter 12 has a rising detection signal S
Count A and set the count value NA to "2". Since the count value NA (= 2) is not "4" set by the interrupt frequency setting register 13 in the comparison circuit 14, the control signal SB
Is not output. Therefore, the interrupt signal SC is not output from the interrupt generation circuit 15. As a result, the CPU 17 does not perform the time acquisition determination process.

【0016】次の新たな外部パルスCKが発生すると、
前記と同様に立上り検出信号SA に基づいてカウンタ1
2は立上り検出信号SA をカウントしカウント値NA を
「2」から「3」にする。従って、カウント値NA が
「3」なので、制御信号SB 及び割込み信号SC は出力
されず、CPU17はこの時点でも時刻取り込み判断処
理をしない。
When the next new external pulse CK is generated,
Similarly to the above, the counter 1 is based on the rising detection signal SA.
2 counts the rising detection signal SA and changes the count value NA from "2" to "3". Therefore, since the count value NA is "3", the control signal SB and the interrupt signal SC are not output, and the CPU 17 does not perform the time acquisition determination process even at this time.

【0017】そして、次の新たな外部パルスCKが発生
すると、前記と同様に立上り検出信号SA に基づいてカ
ウンタ12は立上り検出信号SA をカウントしカウント
値NA を「4」にする。比較回路14はこのカウント値
NA (=4)が割込み頻度設定レジスタ13で設定した
「4」と一致するため、制御信号SB を出力する。
When the next new external pulse CK is generated, the counter 12 counts the rising detection signal SA based on the rising detection signal SA and sets the count value NA to "4" in the same manner as described above. The comparison circuit 14 outputs the control signal SB because the count value NA (= 4) coincides with "4" set in the interrupt frequency setting register 13.

【0018】この制御信号SB に基づいてカウンタ12
はリセットされるとともに、割込み信号SC が割込み信
号発生回路15から出力される。データラッチ転送回路
16は割込み信号SC に応答して基準時間軸発生タイマ
18が計時しているその時の時刻tn (>tn-1 )を読
み出し、その時刻tn を事象発生時刻格納レジスタ19
に転送する。一方、CPU17は割込み信号SC に応答
して時刻取り込み判断処理を実行する。CPU17は事
象発生時刻格納レジスタ19に格納された前記時刻tn
と内部レジスタに格納された先の時刻tn-1 とに基づい
て間隔TA (=tn −tn-1 )を演算する。間隔TA を
求めた後、内部レジスタの内容を時刻tn-1 から時刻t
n に書き換えて時刻取り込み判断処理を終了する。そし
て、次の新たな割込み信号SC が入力されるまでその他
の処理を実行する。
The counter 12 is based on the control signal SB.
Is reset and an interrupt signal SC is output from the interrupt signal generation circuit 15. In response to the interrupt signal Sc, the data latch transfer circuit 16 reads the time tn (> tn-1) at that time, which is being counted by the reference time axis generation timer 18, and the time tn is stored at the event occurrence time storage register 19
Transfer to. On the other hand, the CPU 17 executes the time acquisition determination processing in response to the interrupt signal SC. The CPU 17 stores the time tn stored in the event occurrence time storage register 19
Then, the interval TA (= tn-tn-1) is calculated based on the previous time tn-1 stored in the internal register. After obtaining the interval TA, the contents of the internal register are changed from the time tn-1 to the time t.
It is rewritten to n and the time acquisition determination process ends. Then, other processing is executed until the next new interrupt signal SC is input.

【0019】このように本実施例においては、外部パル
スCKが発生しても、カウンタ12のカウント値NA が
割込み頻度設定レジスタ13で設定した所定個数Nにな
らない限りCPU17に割込み信号SC が出力されな
い。従って、外部パルスCKが発生される毎にCPU1
7は時刻取り込み判断処理をしない。その結果、従来の
ように外部パルスCKが発生するたび毎に不必要な時刻
取り込み判断処理がなくなりその分だけCPU17の負
荷は軽減される。そして、CPU17はその軽減された
分その他の処理が実行することができ、CPU17の高
速かつ効率的なプログラムの実行が可能になる。
As described above, in this embodiment, even if the external pulse CK is generated, the interrupt signal SC is not output to the CPU 17 unless the count value NA of the counter 12 reaches the predetermined number N set by the interrupt frequency setting register 13. . Therefore, every time the external pulse CK is generated, the CPU 1
7 does not perform the time acquisition determination process. As a result, unlike the conventional case, unnecessary time acquisition determination processing is eliminated every time the external pulse CK is generated, and the load on the CPU 17 is reduced accordingly. Then, the CPU 17 can execute other processing by the reduced amount, and the high-speed and efficient program execution of the CPU 17 becomes possible.

【0020】尚、本発明は上記実施例に限定されるもの
ではなく、以下の態様で実施してもよい。 (1)前記実施例では割込み頻度設定レジスタ13の所
定個数Nを「4」としたが、複数個であれば「4」に限
定されない。勿論、「1」に設定してもよい。 (2)前記実施例の外部パルス検出回路11は外部パル
スCKの立上りを検出して立上り信号SA を出力した
が、これを外部パルスCKの立下りを検出して立下り信
号を出力してパルス間隔を計測してもよい。 (3)前記実施例ではカウンタ12は「1」にリセット
される加算カウンタで構成したが、減算カウンタで構成
してもよい。この場合、割込み頻度設定レジスタ13は
その減算カウンタのリセット値を設定するものとなり、
比較回路14は減算カウンタのカウント値が例えば
「0」になった時に制御信号SB を出力するようにす
る。ちなみに、上記実施例の場合にはリセット値は
「3」となる。 (4)図3に示すように基準時間軸発生タイマ18とデ
ータラッチ転送回路16との間にデータラッチ転送回路
20と事象発生時刻格納バッファレジスタ21を設けた
パルス周期計測回路に応用してもよい。すなわち、デー
タラッチ転送回路20は外部パルス検出回路11の立上
り検出信号S1に応答して基準時間軸発生タイマ18の
その時の時刻を事象発生時刻tn として読み込み、次段
の事象発生時刻格納バッファレジスタ21に転送する。
そして、データラッチ転送回路16は割込み信号SC に
応答して事象発生時刻格納バッファレジスタ21に転送
された事象発生時刻tn を読み込み、次段の事象発生時
刻格納レジスタ19に転送するようする。この場合、前
記実施例と同様にCPU17の負荷は軽減される。 (5)パルス周期計測回路をワッンチプマイコン等の半
導体集積回路中に組み込んで実施してもよい。 (6)カウンタ12のリセットを制御信号SB で行った
が、これを割込み信号SC で行ってもよい。
The present invention is not limited to the above embodiment, but may be carried out in the following modes. (1) Although the predetermined number N of the interrupt frequency setting registers 13 is set to "4" in the above embodiment, it is not limited to "4" as long as it is plural. Of course, it may be set to "1". (2) The external pulse detection circuit 11 of the above embodiment detects the rising edge of the external pulse CK and outputs the rising edge signal SA, but detects the falling edge of the external pulse CK and outputs the falling edge signal to output the pulse. The interval may be measured. (3) In the above embodiment, the counter 12 is an addition counter that is reset to "1", but it may be a subtraction counter. In this case, the interrupt frequency setting register 13 sets the reset value of the subtraction counter,
The comparison circuit 14 outputs the control signal SB when the count value of the subtraction counter becomes "0", for example. By the way, in the case of the above embodiment, the reset value is "3". (4) As shown in FIG. 3, it can be applied to a pulse cycle measuring circuit in which a data latch transfer circuit 20 and an event occurrence time storage buffer register 21 are provided between a reference time axis generation timer 18 and a data latch transfer circuit 16. Good. That is, the data latch transfer circuit 20 reads the current time of the reference time axis generation timer 18 as the event occurrence time tn in response to the rising edge detection signal S1 of the external pulse detection circuit 11, and the event occurrence time storage buffer register 21 of the next stage. Transfer to.
Then, the data latch transfer circuit 16 reads the event occurrence time tn transferred to the event occurrence time storage buffer register 21 in response to the interrupt signal SC and transfers it to the event occurrence time storage register 19 in the next stage. In this case, the load on the CPU 17 is reduced as in the above embodiment. (5) The pulse cycle measuring circuit may be incorporated in a semiconductor integrated circuit such as a watch microcomputer to be implemented. (6) Although the counter 12 is reset by the control signal SB, it may be reset by the interrupt signal SC.

【0021】[0021]

【発明の効果】以上詳述したように、請求項1〜3の発
明によれば、複数個の外部パルスをまたがったパルス間
隔を演算する演算装置の負荷を軽減し、演算装置を高速
かつ効率的にプログラムを実行させることができる優れ
た効果がある。
As described in detail above, according to the inventions of claims 1 to 3, the load on the arithmetic unit for calculating the pulse interval over a plurality of external pulses is reduced, and the arithmetic unit is operated at high speed and efficiency. There is an excellent effect that the program can be executed effectively.

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

【図1】本発明の原理説明図である。FIG. 1 is a diagram illustrating the principle of the present invention.

【図2】一実施例を説明するパルス周期計測回路のブロ
ック回路図である。
FIG. 2 is a block circuit diagram of a pulse period measuring circuit for explaining an embodiment.

【図3】その他の実施例を説明するパルス周期計測回路
のブロック回路図である。
FIG. 3 is a block circuit diagram of a pulse period measuring circuit for explaining another embodiment.

【図4】従来のパルス周期計測回路のブロック回路図で
ある。
FIG. 4 is a block circuit diagram of a conventional pulse period measuring circuit.

【図5】パルス周期を説明するための波形図である。FIG. 5 is a waveform diagram for explaining a pulse cycle.

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

1 外部パルス検出回路 2 カウンタ 3 頻度設定レジスタ 4 比較回路 5 割込み信号発生回路 6 転送回路 7 タイマ 8 時刻格納レジスタ CK 外部パルス SA 検出信号 SB 制御信号 SC 割込み信号 1 external pulse detection circuit 2 counter 3 frequency setting register 4 comparison circuit 5 interrupt signal generation circuit 6 transfer circuit 7 timer 8 time storage register CK external pulse SA detection signal SB control signal SC interrupt signal

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 外部パルス(CK)の立上がり又は立下
りを検出して検出信号(SA )を出力する外部パルス検
出回路(1)と、 外部パルス検出回路(1)の検出信号(SA )をカウン
トするカウンタ(2)と、 発生する外部パルス(CK)の所定個数(N)の発生間
隔を演算するためにその所定個数(N)が設定された頻
度設定レジスタ(3)と、 前記カウンタ(2)のカウント値(NA )と頻度設定レ
ジスタ(3)の所定個数(N)とを比較し、一致したと
き制御信号(SB )を出力する比較回路(4)と、 制御信号(SB )を入力し、同制御信号(SB )に応答
して外部パルス(CK)の所定個数(N)の発生間隔の
演算を実行させるための割込み信号(SC )を出力する
割込み信号発生回路(5)と、 前記割込み信号(SC )に応答してタイマ(7)が計時
しているその時の時刻を読み出し時刻格納レジスタ
(8)に転送する転送回路(6)とからなるパルス周期
計測回路。
1. An external pulse detection circuit (1) for detecting the rising or falling of an external pulse (CK) and outputting a detection signal (SA), and a detection signal (SA) for the external pulse detection circuit (1). A counter (2) for counting, a frequency setting register (3) in which a predetermined number (N) is set to calculate the generation interval of a predetermined number (N) of external pulses (CK) to be generated, and the counter ( Comparing the count value (NA) of 2) with the predetermined number (N) of the frequency setting register (3) and outputting the control signal (SB) when they match, the control circuit (SB) and the comparison circuit (4) An interrupt signal generating circuit (5) for inputting and outputting an interrupt signal (SC) for executing a calculation of a predetermined number (N) of generation intervals of external pulses (CK) in response to the control signal (SB) , In response to the interrupt signal (SC) A pulse cycle measuring circuit comprising a transfer circuit (6) for transferring the time measured by the timer (7) to the read time storage register (8).
【請求項2】 タイマ(7)と転送する転送回路(6)
との間に第2の転送回路(20)と時刻格納バッファレ
ジスタ(21)を設け、外部パルス検出回路(1)から
の検出信号(SA )に応答して第2の転送回路(20)
はタイマ(7)のその時の時刻を読み出し時刻格納バッ
ファレジスタ(21)に転送し、転送回路(6)は割込
み信号(SC )に応答して時刻格納バッファレジスタ
(21)に格納された時刻を読み出し時刻格納レジスタ
(8)に転送するようにした請求項1に記載のパルス周
期計測回路。
2. A transfer circuit (6) for transferring with a timer (7)
A second transfer circuit (20) and a time storage buffer register (21) are provided between the second transfer circuit (20) and the external pulse detection circuit (1) in response to the detection signal (SA).
Transfers the current time of the timer (7) to the read time storage buffer register (21), and the transfer circuit (6) transfers the time stored in the time storage buffer register (21) in response to the interrupt signal (SC). The pulse period measuring circuit according to claim 1, wherein the pulse period measuring circuit is adapted to transfer to a read time storage register (8).
【請求項3】 割込み信号(SC )を入力し、その割込
み信号(SC )に応答して時刻格納レジスタ(8)の時
刻と先に読み出した時刻とで発生する外部パルス(C
K)の所定個数(N)の発生間隔を演算する演算装置
(17)を備えた請求項1又は2に記載のパルス周期計
測回路。
3. An external pulse (C) generated by inputting an interrupt signal (SC) and responding to the interrupt signal (SC) at the time of the time storage register (8) and the time previously read.
The pulse period measuring circuit according to claim 1 or 2, further comprising a computing device (17) for computing a generation interval of a predetermined number (K) of K).
【請求項4】 カウンタ(2)は制御信号(SB )又は
割込み信号(SC )のいずれかによってリセットされる
ものである請求項1〜3のいずれか1つに記載のパルス
周期計測回路。
4. The pulse period measuring circuit according to claim 1, wherein the counter (2) is reset by either a control signal (SB) or an interrupt signal (SC).
JP4927494A 1994-03-18 1994-03-18 Pulse period measuring circuit Withdrawn JPH07260845A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4927494A JPH07260845A (en) 1994-03-18 1994-03-18 Pulse period measuring circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4927494A JPH07260845A (en) 1994-03-18 1994-03-18 Pulse period measuring circuit

Publications (1)

Publication Number Publication Date
JPH07260845A true JPH07260845A (en) 1995-10-13

Family

ID=12826278

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4927494A Withdrawn JPH07260845A (en) 1994-03-18 1994-03-18 Pulse period measuring circuit

Country Status (1)

Country Link
JP (1) JPH07260845A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7360109B2 (en) 2004-05-19 2008-04-15 Oki Electric Industry Co., Ltd. Measuring the interval of a signal using a counter and providing the value to a processor

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7360109B2 (en) 2004-05-19 2008-04-15 Oki Electric Industry Co., Ltd. Measuring the interval of a signal using a counter and providing the value to a processor

Similar Documents

Publication Publication Date Title
JP3312648B2 (en) Pulse signal generating device and pulse signal generating method
JP2600598B2 (en) Pulse width judgment circuit
JPH07260845A (en) Pulse period measuring circuit
JPH06348507A (en) Microcomputer
JP2000074962A (en) Cycle-measuring device and method therefor, and storage medium
JP2604562B2 (en) Pulse interval measuring device
JP2557785Y2 (en) Single chip microcomputer
JPH0894660A (en) Pulse measuring apparatus
JP2000059206A (en) Pulse count system for pulse input circuit
JPH0933579A (en) Frequency measuring circuit
JPS63269239A (en) Processor load measuring system
JPH0150866B2 (en)
JPH038005A (en) Timer control system
JP3068317B2 (en) Microcomputer
JP3985588B2 (en) Counting device and counting system
JPH04365112A (en) Time counting system for computer system
JPH0451332A (en) Process/task execution time counting circuit
JPH02150942A (en) Bus abnormality detecting circuit
JPH0251749A (en) Circuit for measuring processor application rate
JPH10161908A (en) Detection of run-away of microcomputer
JPS62135916A (en) Pulse train signal processor
JPH11102298A (en) Timer control method, and its circuit and program recording medium
JPH08292822A (en) Intelligent timer
JPH06195245A (en) Monitor timer device
JPS62112422A (en) Counter circuit

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20010605