JPH0530772U - Frequency signal measuring device - Google Patents

Frequency signal measuring device

Info

Publication number
JPH0530772U
JPH0530772U JP7858991U JP7858991U JPH0530772U JP H0530772 U JPH0530772 U JP H0530772U JP 7858991 U JP7858991 U JP 7858991U JP 7858991 U JP7858991 U JP 7858991U JP H0530772 U JPH0530772 U JP H0530772U
Authority
JP
Japan
Prior art keywords
counter
value
microprocessor
frequency
count value
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
JP7858991U
Other languages
Japanese (ja)
Inventor
等 森澤
賢治 山口
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.)
Yokogawa Electric Corp
Original Assignee
Yokogawa Electric Corp
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 Yokogawa Electric Corp filed Critical Yokogawa Electric Corp
Priority to JP7858991U priority Critical patent/JPH0530772U/en
Publication of JPH0530772U publication Critical patent/JPH0530772U/en
Pending legal-status Critical Current

Links

Landscapes

  • Measuring Frequencies, Analyzing Spectra (AREA)

Abstract

(57)【要約】 (修正有) 【目的】マイクロプロセッサの負担を軽減し、低い周波
数信号から高い周波数信号間での広い範囲で、精度の高
い周波数測定を行うことができるようにする。 【構成】測定すべき周波数信号が印加されるイベントカ
ウンタ3と、ラッチ機能を持つタイマカウンタ2と、イ
ベントカウンタ3からのカウンタ値とタイマカウンタ2
のカウント値とを定周期で読込むマイクロプロセッサ1
とを備え、マイクロプロセッサ1は、前回に読込んだイ
ベントカウンタ3からのカウンタ値(No)、タイマカ
ウンタ2のカウント値(Mo)と、今回読込んだイベン
トカウンタ3からのカウンタ値(N1)、タイマカウン
タ2のカウント値(M1)とを用いて、所定の演算を行
って測定すべき信号の周波数(Fi)を求めるように構
成されている。
(57) [Summary] (Modified) [Purpose] To reduce the load on the microprocessor and enable accurate frequency measurement over a wide range from low frequency signals to high frequency signals. [Constitution] An event counter 3 to which a frequency signal to be measured is applied, a timer counter 2 having a latch function, a counter value from the event counter 3 and a timer counter 2
Microprocessor 1 that reads the count value of
The microprocessor 1 includes a counter value (No) from the event counter 3 read last time, a count value (Mo) of the timer counter 2 and a counter value (N1) read from the event counter 3 read this time. , The count value (M1) of the timer counter 2 is used to perform a predetermined calculation to obtain the frequency (Fi) of the signal to be measured.

Description

【考案の詳細な説明】[Detailed description of the device]

【0001】[0001]

【産業上の利用分野】[Industrial applications]

本考案は、パルス信号を出力する流量計や速度計等からのパルス周波数信号を 入力とし、その周波数を測定するための装置に関し、さらに詳しくは、マイクロ プロセッサを用いてパルス周波数の測定を行うものであって、マイクロプロセッ サの負担を軽減し、高い精度で周波数の測定を行えるようにした周波数信号測定 装置に関する。 The present invention relates to an apparatus for measuring the frequency of a pulse frequency signal from a flow meter or a speedometer that outputs a pulse signal, and more specifically to a device for measuring the pulse frequency using a microprocessor. In addition, the present invention relates to a frequency signal measuring device that reduces the burden on the microprocessor and can measure the frequency with high accuracy.

【0002】[0002]

【従来の技術】[Prior Art]

図4および図5は、マイクロプロセッサを用いた従来の周波数信号測定装置の 構成概念図である。 図4のものは、マイクロプロセッサ1と、これに接続されるタイマカウンタ2 とで構成したものであって、マイクロプロセッサ1は、測定すべき入力パルス( 周波数信号)を入力し、パルスのエッジを検出するごとにタイマカウンタ2の値 をラッチするようになっている。そして、パルスのエッジを検出した後に割込み 処理にて、タイマカウンタ2の値を読み、前回の値との差を演算する。この差を パルス周期として測定した値とする。 図5のものは、マイクロプロセッサ1とこれに接続されるイベントカウンタ3 とで構成したもので、測定すべきパルス周波数信号Sfをイベントカウンタ3に 印加するようにしている。マイクロプロセッサ1は、一定周期Tsの割込みでイ ベントカウンタ3のカウント値Nsを読み込み、(カウント値Ns/一定周期T s)の演算を行うことにより、測定パルス周波数を求めるようにしている。 4 and 5 are conceptual configuration diagrams of a conventional frequency signal measuring apparatus using a microprocessor. The one shown in FIG. 4 is composed of a microprocessor 1 and a timer counter 2 connected to the microprocessor 1. The microprocessor 1 inputs an input pulse (frequency signal) to be measured, and detects the edge of the pulse. The value of the timer counter 2 is latched each time it is detected. Then, after detecting the edge of the pulse, the value of the timer counter 2 is read in the interrupt process, and the difference from the previous value is calculated. This difference is the value measured as the pulse period. The one shown in FIG. 5 comprises a microprocessor 1 and an event counter 3 connected thereto, and a pulse frequency signal Sf to be measured is applied to the event counter 3. The microprocessor 1 reads the count value Ns of the event counter 3 at an interrupt of a fixed cycle Ts and calculates (count value Ns / fixed cycle Ts) to obtain the measured pulse frequency.

【0003】[0003]

【考案が解決しようとする課題】[Problems to be solved by the device]

図4の装置は、低い周波数信号の測定に適するが、周波数が高くなるとマイク ロプロセッサ1への割込み回数が増加して、マイクロプロセッサの負担が重くな ると言う課題がある。 また、図5の装置は、逆に高い周波数信号の測定に適するが、低い周波数信号 の測定は、測定時間が長くなるという課題がある。 本考案は、これらの点に鑑みてなされたもので、低い周波数信号から高い周波 数信号までの広い範囲で、精度の高い周波数測定を行うことができる周波数信号 測定装置を提供することを目的とする。 The apparatus shown in FIG. 4 is suitable for measuring low-frequency signals, but there is a problem in that the number of interrupts to the microprocessor 1 increases as the frequency increases, and the load on the microprocessor becomes heavy. On the contrary, the apparatus of FIG. 5 is suitable for measuring a high frequency signal, but the measurement of a low frequency signal has a problem that the measurement time becomes long. The present invention has been made in view of these points, and an object thereof is to provide a frequency signal measuring device capable of performing highly accurate frequency measurement in a wide range from low frequency signals to high frequency signals. To do.

【0004】[0004]

【課題を解決するための手段】[Means for Solving the Problems]

この様な目的を達成する本考案は、 測定すべき周波数信号が印加されるイベントカウンタと、 測定すべき周波数信号が印加されるラッチ機能を持つタイマカウンタと、 前記イベントカウンタからのカウンタ値と前記タイマカウンタのカウント値と を定周期で読込むマイクロプロセッサとを備え、 前記マイクロプロセッサは、前回に読込んだイベントカウンタからのカウンタ 値(Mo)、タイマカウンタのカウント値(No)と、今回読込んだイベントカ ウンタからのカウンタ値(M1)、タイマカウンタのカウント値(N1)とを用 いて、下記の式で示される演算を行って測定すべき信号の周波数(Fi)を求め ることを特徴とする周波数信号測定装置である。 Fi={(M1−Mo)/(N1−No)}×(1/Tt) ただし、Ttは、タイマカウンタのクロック周期 The present invention which achieves such an object includes an event counter to which a frequency signal to be measured is applied, a timer counter having a latch function to which a frequency signal to be measured is applied, a counter value from the event counter and the The microprocessor includes a microprocessor that reads the count value of the timer counter at a constant cycle, and the microprocessor reads the counter value (Mo) from the event counter that was read previously, the count value (No) of the timer counter, and the current read value. The counter value (M1) from the event counter and the count value (N1) of the timer counter are used to calculate the frequency (Fi) of the signal to be measured by performing the operation shown in the following equation. It is a characteristic frequency signal measuring device. Fi = {(M1-Mo) / (N1-No)} × (1 / Tt) where Tt is the clock cycle of the timer counter

【0005】[0005]

【作用】[Action]

イベントカウンタおよびタイマカウンタは、測定すべき周波数信号をいずれも 入力し、タイマカウンタは、入力パルスのエッジ毎にカウンタ値をラッチする。 マイクロプロセッサは、定周期でイベントカウンタからのカウンタ値とタイマ カウンタのカウント値とを読込み、所定の演算を行って入力パルスの周波数を求 める。 The event counter and the timer counter both input the frequency signal to be measured, and the timer counter latches the counter value at each edge of the input pulse. The microprocessor reads the counter value from the event counter and the count value of the timer counter at regular intervals and performs a predetermined calculation to obtain the frequency of the input pulse.

【0006】[0006]

【実施例】【Example】

以下図面を用いて本考案の実施例を詳細に説明する。 図1は、本考案の一実施例を示す構成ブロック図である。図において、1はマ イクロプロセッサ、2は測定すべき周波数信号Siが印加されるタイマカウンタ で、入力パルスのエッジ毎にカウンタ値をラッチするラッチ回路21を有してい る。3は測定すべき周波数信号Siが印加され、そのパルス数をカウントするイ ベントカウンタである。マイクロプロセッサ1とこれらの各カウンタ2,3とは 、データバスを介して結合している。 マイクロプロセッサ1内において、11はソフトウェアによって実現されるデ ータ読込み手段で、一定周期でタイマカウンタ2からのカウント値、イベントカ ウンタ3からのカウンタ値を読込むように構成してある。12はデータ読込み手 段11が読込んだデータを格納するRAMで構成されたメモリ、13はソフトウ ェアによって実現される演算手段で、メモリ12に格納されたデータや、データ 読込み手段11が読込んだカウンタ値などを用いて所定の演算を行うように構成 されている。メモリ12には、タイマカウンタ2からのカウント値、イベントカ ウンタ3からのカウンタ値が、それぞれ少なくとも前回値,今回値分記憶される 。 また、演算手段13は、メモリ12に格納されている前回に読込んだイベン トカウンタからのカウンタ値(Mo)、タイマカウンタのカウント値(No)と 、今回読込んだイベントカウンタからのカウンタ値(M1)、タイマカウンタの カウント値(N1)とを用いて、差演算、割り算演算を行う機能を持っている。 Embodiments of the present invention will be described in detail below with reference to the drawings. FIG. 1 is a configuration block diagram showing an embodiment of the present invention. In the figure, 1 is a microprocessor, 2 is a timer counter to which a frequency signal Si to be measured is applied, and has a latch circuit 21 for latching the counter value at each edge of an input pulse. Reference numeral 3 is an event counter to which the frequency signal Si to be measured is applied and which counts the number of pulses. The microprocessor 1 and each of these counters 2 and 3 are connected via a data bus. In the microprocessor 1, 11 is a data reading means realized by software, which is configured to read the count value from the timer counter 2 and the counter value from the event counter 3 at a constant cycle. Reference numeral 12 is a memory composed of a RAM for storing the data read by the data reading means 11, and 13 is an arithmetic means realized by software, which is the data stored in the memory 12 or the data reading means 11 reads the data. It is configured to perform a predetermined calculation by using the counter value and the like. The memory 12 stores at least the previous value and the current value of the count value from the timer counter 2 and the counter value from the event counter 3, respectively. In addition, the calculating means 13 stores the counter value (Mo) from the event counter read in the previous time stored in the memory 12 and the count value (No) of the timer counter, and the counter value from the event counter read this time ( M1) and the count value (N1) of the timer counter are used to perform a difference operation and a division operation.

【0007】 この様に構成した装置の動作を次に説明する。 図2は、動作の一例を示すタイムチャートである。この図で、(a)は測定す べき周波数信号(入力パルス)の波形図であり、そのパルス幅はTiであるもの とする。タイマカウンタ2は、(b)に示すように内部のクロック(周期Ttと する)を計数していて、入力パルスの立ち下りのエッジでその計数値Noをラッ チ回路21がラッチする。また、イベントカウンタ3は、(c)に示すように入 力パルスの立ち下りを検出する毎に、その値をMo,Mo+1,Mo+2…のよ うにカウントアップして入力パルス数を計数(カウント)している。 マイクロプロセッサ1のデータ読込み手段11は、定周期Trでラッチ回路2 1がラッチしているタイマカウンタ2のカウンタ値と、イベントカウンタ3から のカウンタ値とをそれぞれ読込む。すなわち、例えば、はじめの読込み時点To では、タイマカウンタ2のカウント値(ラッチしている値)Noと、イベントカ ウンタ3のカウント値Moとをそれぞれ読込み、Tr後の次の読込み時点T1で は、タイマカウンタ2のカウント値(ラッチしている値)N1と、イベントカウ ンタ3のカウント値M1とをそれぞれ読込む。これらの読込み値は、メモリ12 に格納され、演算手段13による演算に利用できるようにしてある。The operation of the apparatus thus configured will be described below. FIG. 2 is a time chart showing an example of the operation. In this figure, (a) is a waveform diagram of the frequency signal (input pulse) to be measured, and its pulse width is Ti. The timer counter 2 counts an internal clock (assumed to be a cycle Tt) as shown in (b), and the count value No is latched by the latch circuit 21 at the trailing edge of the input pulse. Also, the event counter 3 counts the input pulse number by counting up the value like Mo, Mo + 1, Mo + 2 ... Every time the falling edge of the input pulse is detected as shown in (c) (count). is doing. The data reading means 11 of the microprocessor 1 reads the counter value of the timer counter 2 latched by the latch circuit 21 and the counter value of the event counter 3 at a constant cycle Tr. That is, for example, at the first read time To, the count value (latched value) No of the timer counter 2 and the count value Mo of the event counter 3 are read, and at the next read time T1 after Tr. , The count value (latch value) N1 of the timer counter 2 and the count value M1 of the event counter 3 are read. These read values are stored in the memory 12 so that they can be used for the calculation by the calculation means 13.

【0008】 演算手段13は、メモリ12に格納されている前回に読込んだイベントカウン タからのカウンタ値(Mo)、タイマカウンタのカウント値(No)と、今回デ ータ読込み手段11が読込んだイベントカウンタからのカウンタ値(M1)、タ イマカウンタのカウント値(N1)とを用いて、(1)式のような演算を行って 入力パルスの周波数Fi(Hz)を演算する。 Fi={(M1−Mo)/(N1−No)}×(1/Tt) …(1) ただし、Ttは、タイマカウンタのクロック周期 この様な演算を行って入力パルスの周波数Fi(Hz)が求まる理由は、以下 の通りである。 マイクロプロセッサ1内のデータ読込み手段11が、各カウンタ2,3のカウ ンタ値を読込む一定周期Tr内において、イベントカウンタ3の入力パルスの計 測時間TMは、タイマカウンタ2のカウント値から、(2)式で表すことができ る。 TM=(N1−No)×Tt …(2) 入力パルスのパルス幅Tiは、イベントカウンタ3の計数値から、(3)式で 表すことができる。 Ti=TM/(M1−Mo) …(3) (3)式のTMに(2)式を代入すると、(4)式が得られる。 Ti={(N1−No)/(M1−Mo)}×Tt …(4) 入力パルスの周波数Fiは、パルス幅Tiの逆数であるから、(4)式の逆数 を求めると、(1)式が得られ、入力パルスの周波数を求めることができる。The calculation means 13 reads the counter value (Mo) from the event counter read in the previous time stored in the memory 12, the count value (No) of the timer counter, and the data read means 11 read this time. Using the counter value (M1) from the event counter and the count value (N1) of the timer counter, the frequency Fi (Hz) of the input pulse is calculated by performing the calculation as shown in equation (1). Fi = {(M1-Mo) / (N1-No)} * (1 / Tt) (1) where Tt is the clock cycle of the timer counter, and the frequency of the input pulse Fi (Hz) is calculated by performing such a calculation. The reason for obtaining is as follows. Within the constant period Tr in which the data reading means 11 in the microprocessor 1 reads the counter values of the counters 2 and 3, the measuring time TM of the input pulse of the event counter 3 is calculated from the count value of the timer counter 2, It can be expressed by equation (2). TM = (N1-No) * Tt (2) The pulse width Ti of the input pulse can be expressed by the equation (3) from the count value of the event counter 3. Ti = TM / (M1-Mo) (3) Substituting equation (2) for TM in equation (3) yields equation (4). Ti = {(N1-No) / (M1-Mo)} * Tt (4) Since the frequency Fi of the input pulse is the reciprocal of the pulse width Ti, the reciprocal of the equation (4) is calculated as (1). The equation is obtained, and the frequency of the input pulse can be obtained.

【0009】 マイクロプロセッサ1は、各カウンタの値を一定の周期Trで読込めばよいの で、その負担は軽減される。ここで、周波数測定の精度は、タイマカウンタ2の クロック周期Ttと、マイクロプロセッサ1のデータ読込み周期Trに依存して おり、タイマカウンタ2のクロック周期Ttを短くする(クロック周波数を高く する)か、データ読込み周期Trを長くすることで測定精度を高くすることがで きる。Since the microprocessor 1 has only to read the value of each counter in a constant cycle Tr, the load is reduced. Here, the accuracy of the frequency measurement depends on the clock cycle Tt of the timer counter 2 and the data read cycle Tr of the microprocessor 1. Whether the clock cycle Tt of the timer counter 2 is shortened (the clock frequency is increased). By increasing the data reading period Tr, the measurement accuracy can be increased.

【0010】 図3は、本考案装置による周波数測定精度を入力パルスの周波数との関係で示 す線図である。この例では、タイマカウンタ2のクロック周期Ttを0.5μS 、各カウンタのデータ読込み周期Trを4mSとした場合である。 この線図から明らかなように、測定精度は、入力周波数(1/Tr)(Hz) 以上では(Tt/Tr)×100(%)で一定となり、入力周波数(1/Tr) 以下では(Tt/Ti)×100(%)となって、入力周波数に比例して精度が よくなっている。FIG. 3 is a diagram showing the frequency measurement accuracy of the device of the present invention in relation to the frequency of the input pulse. In this example, the clock cycle Tt of the timer counter 2 is 0.5 μS, and the data read cycle Tr of each counter is 4 mS. As is clear from this diagram, the measurement accuracy is constant at (Tt / Tr) × 100 (%) above the input frequency (1 / Tr) (Hz) and (Tt below the input frequency (1 / Tr). / Ti) × 100 (%), and the accuracy is improved in proportion to the input frequency.

【0011】[0011]

【考案の効果】[Effect of the device]

以上詳細に説明したように、本考案によれば、マイクロプロセッサの負担を余 りかけないで、低い周波数信号から高い周波数信号間での広い範囲で、精度の高 い周波数測定を行うことができる周波数信号測定装置が実現できる。 As described in detail above, according to the present invention, highly accurate frequency measurement can be performed in a wide range from a low frequency signal to a high frequency signal without imposing a heavy burden on the microprocessor. A frequency signal measuring device can be realized.

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

【図1】本考案の一実施例を示す構成ブロック図であ
る。
FIG. 1 is a configuration block diagram showing an embodiment of the present invention.

【図2】動作の一例を示すタイムチャートである。FIG. 2 is a time chart showing an example of operation.

【図3】本考案装置による周波数測定精度を入力パルス
の周波数との関係で示す線図である。
FIG. 3 is a diagram showing the frequency measurement accuracy of the device of the present invention in relation to the frequency of an input pulse.

【図4】マイクロプロセッサを用いた従来の周波数信号
測定装置の構成概念図である。
FIG. 4 is a conceptual diagram of a configuration of a conventional frequency signal measuring device using a microprocessor.

【図5】マイクロプロセッサを用いた従来の周波数信号
測定装置の構成概念図である。
FIG. 5 is a conceptual diagram of a configuration of a conventional frequency signal measuring device using a microprocessor.

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

1 マイクロプロセッサ 2 タイマカウンタ 21 ラッチ回路 3 イベントカウンタ 11 データ読込み手段 12 メモリ 13 演算手段 1 Microprocessor 2 Timer Counter 21 Latch Circuit 3 Event Counter 11 Data Reading Means 12 Memory 13 Arithmetic Means

Claims (1)

【実用新案登録請求の範囲】[Scope of utility model registration request] 【請求項1】測定すべき周波数信号が印加されるイベン
トカウンタと、 測定すべき周波数信号が印加されるラッチ機能を持つタ
イマカウンタと、 前記イベントカウンタからのカウンタ値と前記タイマカ
ウンタのカウント値とを定周期で読込むマイクロプロセ
ッサとを備え、 前記マイクロプロセッサは、前回に読込んだイベントカ
ウンタからのカウンタ値(Mo)、タイマカウンタのカ
ウント値(No)と、今回読込んだイベントカウンタか
らのカウンタ値(M1)、タイマカウンタのカウント値
(N1)とを用いて、下記の式で示される演算を行って
測定すべき信号の周波数(Fi)を求めることを特徴と
する周波数信号測定装置。 Fi={(M1−Mo)/(N1−No)}×(1/Tt) ただし、Ttは、タイマカウンタのクロック周期
1. An event counter to which a frequency signal to be measured is applied, a timer counter having a latch function to which a frequency signal to be measured is applied, a counter value from the event counter and a count value of the timer counter. And a microprocessor for reading in a fixed cycle, wherein the microprocessor reads the counter value (Mo) from the event counter read last time, the count value of the timer counter (No), and the count value from the event counter read this time. A frequency signal measuring device characterized by using a counter value (M1) and a count value (N1) of a timer counter to calculate a frequency (Fi) of a signal to be measured by performing an operation represented by the following formula. Fi = {(M1-Mo) / (N1-No)} × (1 / Tt) where Tt is the clock cycle of the timer counter
JP7858991U 1991-09-30 1991-09-30 Frequency signal measuring device Pending JPH0530772U (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7858991U JPH0530772U (en) 1991-09-30 1991-09-30 Frequency signal measuring device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7858991U JPH0530772U (en) 1991-09-30 1991-09-30 Frequency signal measuring device

Publications (1)

Publication Number Publication Date
JPH0530772U true JPH0530772U (en) 1993-04-23

Family

ID=13666101

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7858991U Pending JPH0530772U (en) 1991-09-30 1991-09-30 Frequency signal measuring device

Country Status (1)

Country Link
JP (1) JPH0530772U (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6146476B2 (en) * 1981-07-15 1986-10-14 Otsuka Pharma Co Ltd

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6146476B2 (en) * 1981-07-15 1986-10-14 Otsuka Pharma Co Ltd

Similar Documents

Publication Publication Date Title
JPH0650772Y2 (en) Travel detector
JPH0530772U (en) Frequency signal measuring device
JP2584990Y2 (en) Pulse width measurement device
JP3031970B2 (en) Filter circuit
JP2969733B2 (en) Pulse waveform symmetry measurement circuit
JPS5912819Y2 (en) Clock pulse generation circuit
JPH035990Y2 (en)
JP2504753B2 (en) Electronic thermometer
SU411410A1 (en) Device for automatic registering of nuclear radiation counter characteristics
JP3114388B2 (en) Electronic balance
SU834408A1 (en) Device for measuring non-staionary temperatures
JP3047264B2 (en) Time measurement device
JP2568121Y2 (en) Average value period measurement device
JPH02110379A (en) Motor-speed detecting apparatus
JP3098759B2 (en) Pedometer
JPH0678873U (en) Duty ratio measurement circuit
SU960721A1 (en) Device for measuring time intervals
JPH0336936Y2 (en)
JP2780282B2 (en) Method and apparatus for measuring rotational speed
JPH0535830B2 (en)
JP2917278B2 (en) Phase difference detection circuit
JPH0658965A (en) Phase meter
JPS5839312B2 (en) Vehicle speed measurement method
SU1510000A1 (en) Device for measuring fluctuation of magnetic tape transport speed
JPH06324096A (en) Universal counter