JP3223884B2 - Duty ratio determination circuit and duty ratio determination method - Google Patents

Duty ratio determination circuit and duty ratio determination method

Info

Publication number
JP3223884B2
JP3223884B2 JP22811298A JP22811298A JP3223884B2 JP 3223884 B2 JP3223884 B2 JP 3223884B2 JP 22811298 A JP22811298 A JP 22811298A JP 22811298 A JP22811298 A JP 22811298A JP 3223884 B2 JP3223884 B2 JP 3223884B2
Authority
JP
Japan
Prior art keywords
duty ratio
pulse
counting
count
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.)
Expired - Fee Related
Application number
JP22811298A
Other languages
Japanese (ja)
Other versions
JP2000055958A (en
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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP22811298A priority Critical patent/JP3223884B2/en
Publication of JP2000055958A publication Critical patent/JP2000055958A/en
Application granted granted Critical
Publication of JP3223884B2 publication Critical patent/JP3223884B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、パルスのデューテ
ィ比を判別するデューティ比判定回路に関し、特に、任
意のデューティ比を判別するデューティ比判定回路に関
する。
The present invention relates to a duty ratio determining circuit for determining a duty ratio of a pulse, and more particularly to a duty ratio determining circuit for determining an arbitrary duty ratio.

【0002】[0002]

【従来の技術】従来、デューティ比判定回路は、パルス
のデューティ比を判定することにより、各種の動作状態
を判定する場合に使用される。その一例として、ビデオ
装置における、テープの走行方向を検出する目的として
用いられることがある。
2. Description of the Related Art Conventionally, a duty ratio determination circuit is used to determine various operation states by determining a duty ratio of a pulse. As an example, it may be used for the purpose of detecting the running direction of a tape in a video device.

【0003】デューティ比の判定又は測定の技術は、特
開昭64−84475号公報、特開平2−194722
号公報、特開平5−315910号公報、及び、実開平
6−34340号公報に開示されている。
Techniques for judging or measuring the duty ratio are disclosed in JP-A-64-84475 and JP-A-2-194722.
And Japanese Patent Laid-Open Publication No. Hei 5-315910 and Japanese Utility Model Laid-Open Publication No. Hei 6-34340.

【0004】特開昭64−84475号公報に開示され
ている技術では、二種類のデューティ比を判別するため
に、パルスの立ち上がりから若干遅れたリセット信号
と、パルスの立ち上がりから若干遅れ、リセット信号よ
りもクロックのパルス幅だけ早いストローブ信号を生成
して、回路を制御している。
In the technique disclosed in Japanese Patent Application Laid-Open No. 64-84475, a reset signal slightly delayed from the rising edge of the pulse and a reset signal slightly delayed from the rising edge of the pulse are used to determine the two types of duty ratios. The circuit is controlled by generating a strobe signal that is earlier than the pulse width of the clock.

【0005】特開平2−194722号公報に開示され
ている技術では、入力パルス信号のレベルに応じて二つ
のクロックを使用してカウントしている。そして、一周
期の終了時のカウント値で、入力パルス信号のデューテ
ィ比が、基準のデューティ比以上か未満かを判定してい
る。
In the technique disclosed in Japanese Patent Application Laid-Open No. 2-194722, counting is performed using two clocks according to the level of an input pulse signal. Then, it is determined from the count value at the end of one cycle whether the duty ratio of the input pulse signal is equal to or greater than the reference duty ratio.

【0006】特開平5−315910号公報に開示され
ている技術では、PWM波のデューティ比を変化させる
ことによって、基準のデューティ比を設定して、デュー
ティ比判定を行っている。そして、基準のデューティ比
を設定するために、入力信号とPWM波の組み合わせ論
理回路にアンド回路を使用して、基準のデューティ比を
50〜100%で変化させている。また、入力信号とP
WM波の組み合わせ論理回路にノア回路を使用して、基
準のデューティ比を0〜50%で変化させている。
In the technique disclosed in Japanese Patent Laid-Open No. 5-315910, a duty ratio determination is performed by changing a duty ratio of a PWM wave to set a reference duty ratio. Then, in order to set the reference duty ratio, an AND circuit is used for a combinational logic circuit of the input signal and the PWM wave, and the reference duty ratio is changed at 50 to 100%. Also, the input signal and P
The reference duty ratio is changed from 0 to 50% by using a NOR circuit as the combinational logic circuit of the WM wave.

【0007】実開平6−34340号公報に開示されて
いる技術では、カウンタは、入力パルスのレベルに応じ
て、アップカウント及びダウンカウントを行う。そし
て、カウンタがパルスの立ち上がりのタイミングでリセ
ットされる直前のカウント値と入力パルス信号のデュー
ティ比とが対応するように、デコーダを構成してデュー
ティ比を測定している。
In the technique disclosed in Japanese Utility Model Laid-Open Publication No. 6-34340, the counter performs up-counting and down-counting according to the level of the input pulse. The decoder is configured to measure the duty ratio so that the count value immediately before the counter is reset at the rising edge of the pulse corresponds to the duty ratio of the input pulse signal.

【0008】[0008]

【発明が解決しようとする課題】特開昭64−8447
5号公報に開示されている技術では、パルスの立ち上が
り、リセット信号及びストローブ信号のタイミングがそ
れぞれずれるように、リセット信号及びストロープ信号
を生成するため、回路構成が複雑になるという問題があ
る。
Problems to be Solved by the Invention
In the technique disclosed in Japanese Patent Laid-Open No. 5 (1993) -1995, the reset signal and the strobe signal are generated such that the timings of the rising edge of the pulse, the reset signal, and the strobe signal are shifted from each other, so that the circuit configuration is complicated.

【0009】特開平2−194722号公報に開示され
ている技術では、基準のデューティ比に対応した、二つ
のクロックが必要であり、基準のデューティ比を変更す
る度にクロックを変えなければならないという問題があ
る。
The technique disclosed in Japanese Patent Application Laid-Open No. 2-194722 requires two clocks corresponding to the reference duty ratio, and the clock must be changed every time the reference duty ratio is changed. There's a problem.

【0010】特開平5−315910号公報に開示され
ている技術では、基準のデューティ比を、例えば30%
から60%に変更するためには、アンド回路とノア回路
の両方を予め備えるか、その都度回路を変更しなければ
ならないという問題がある。
In the technique disclosed in Japanese Patent Laid-Open No. 5-315910, the reference duty ratio is set to, for example, 30%.
In order to change from 60% to 60%, there is a problem that both the AND circuit and the NOR circuit must be provided in advance or the circuit must be changed each time.

【0011】実開平6−34340号公報に開示されて
いる技術では、デューティ比の判定を任意の基準デュー
ティ比で行うためには、デコーダの出力と基準デューテ
ィ比とを比較するマグニチュードコンパレータ等をさら
に必要とし、回路規模が大きくなるという問題がある。
In the technique disclosed in Japanese Utility Model Laid-Open Publication No. 6-34340, a magnitude comparator for comparing the output of the decoder with the reference duty ratio and the like are additionally provided in order to determine the duty ratio at an arbitrary reference duty ratio. And requires a large circuit scale.

【0012】従って、本発明は、回路規模が小さく、回
路構成が単純なデューティ比判定回路を提供することを
目的とする。
Accordingly, an object of the present invention is to provide a duty ratio determination circuit having a small circuit size and a simple circuit configuration.

【0013】[0013]

【課題を解決するための手段】以上の目的を達成するた
めに、本発明の第1の観点にかかるデューティ比判定回
路は、入力されたパルスのレベル変化を検出する検出手
段と、前記検出手段がレベル変化を検出するのに応じて
基準クロックのカウントを開始し、次に前記検出手段が
レベル変化を検出するのに応じて、前記基準クロックの
逆向きのカウントを開始するカウント手段と、前記カウ
ント手段のスタート値を、基準となるデューティ比に対
応する値に設定する設定手段と、前記カウント手段の連
続する二つの逆向きのカウントを一組とし、該一組のカ
ウント終了時におけるカウント値から、前記パルスのデ
ューティ比が、基準のデューティ比未満か以上かを判定
する判定手段と、を備えることを特徴とする。
In order to achieve the above object, a duty ratio determining circuit according to a first aspect of the present invention comprises a detecting means for detecting a change in the level of an input pulse, and the detecting means. Detects a level change
Counting means for starting counting of a reference clock , and then starting counting in the opposite direction of the reference clock in response to the detection means detecting a level change; and Setting means for setting to a value corresponding to a reference duty ratio, and two consecutive counts of the counter in the opposite direction as one set, and from the count value at the end of the set of counts, the duty of the pulse Determining means for determining whether the ratio is less than or equal to a reference duty ratio.

【0014】この発明によれば、単純な回路構成でデュ
ーティ比判定を行うことができるため、回路規模を小さ
くすることができる。従って、マイコンに内蔵すること
も可能であり、他の電子デバイスにも適用することがで
きる。また、一周期終了時のカウント値で判定を行って
いるので、速度追従性に優れたデューティ比判定が可能
である。
According to the present invention, since the duty ratio can be determined with a simple circuit configuration, the circuit scale can be reduced. Therefore, it can be built in a microcomputer and can be applied to other electronic devices. Further, since the determination is made based on the count value at the end of one cycle, it is possible to make a duty ratio determination excellent in speed followability.

【0015】前記設定手段は、前記カウント手段が、基
準となるデューティ比のパルスが印加された場合、前
記一組のカウント終了時にカウント値が0となるよう
に、一組のカウントのスタート値を設定してもよい。
[0015] The setting means may include a start value of a set of counts such that when a pulse having a reference duty ratio is applied , the count value becomes 0 at the end of the set of counts. May be set.

【0016】前記判定手段は、前記カウント値の正負に
よって、前記パルスのデューティ比が基準のデューティ
比未満か以上かを判定してもよい。
[0016] The determination means may determine whether the duty ratio of the pulse is less than or greater than a reference duty ratio based on whether the count value is positive or negative.

【0017】前記パルスの一周期の間に前記カウント手
段がカウントするカウント値が既知の場合に、前記一組
のカウントの一方のカウント値からデューティ比を求め
る回路をさらに備えてもよい。
[0017] If the count value counted by the counting means during one cycle of the pulse is known, a circuit for obtaining a duty ratio from one count value of the set of counts may be further provided.

【0018】本発明の第2の観点にかかるデューティ比
判定方法は、パルスを入力する入力工程と、前記入力工
程で入力されたパルスのレベル変化を検出する検出工程
と、前記検出工程でレベル変化が検出されるのに応じて
基準クロックのカウントを開始し、次に前記検出工程で
レベル変化が検出されるのに応じて、前記基準クロック
逆向きのカウントを開始するカウント工程と、前記カ
ウント工程で行われる、カウントのスタート値を基準と
なるデューティ比に対応する値に設定する設定工程と、
前記カウント工程の連続する二つの逆向きのカウントを
一組とし、該一組のカウント終了時におけるカウント値
から、前記パルスのデューティ比が、基準のデューティ
比未満か以上かを判定する判定工程と、を備えることを
特徴とする。
According to a second aspect of the present invention, there is provided a duty ratio determining method, comprising: an inputting step of inputting a pulse; a detecting step of detecting a level change of the pulse input in the inputting step; As detected
It starts counting the reference clock, and then according to the level change is detected by the detecting step, the reference clock
A counting step of starting counting in the reverse direction, and a setting step of setting a count start value to a value corresponding to a reference duty ratio, which is performed in the counting step,
A determination step of determining whether the duty ratio of the pulse is less than or equal to a reference duty ratio from a count value at the end of the counting of the pair, wherein , Is provided.

【0019】この発明によると、単純な方法でデューテ
ィ比判定を行うことができるため、回路規模を小さくす
ることができる。また、一周期終了時のカウント値で判
定を行っているので、速度追従性に優れたデューティ比
判定が可能である。
According to the present invention, since the duty ratio can be determined by a simple method, the circuit scale can be reduced. Further, since the determination is made based on the count value at the end of one cycle, it is possible to make a duty ratio determination excellent in speed followability.

【0020】前記設定工程は、前記カウント工程で、基
準となるデューティ比のパルスが印加された場合、前
記一組のカウント終了時にカウント値が0となるよう
に、一組のカウントのスタート値を設定する工程を備え
てもよい。
[0020] The setting step, wherein in the counting step, when the pulse in relation to the standard duty ratio is applied, the so count value becomes 0 when a pair of terminal count start value of a set of count May be provided.

【0021】前記判定工程は、前記カウント値の正負に
よって、前記パルスのデューティ比が基準のデューティ
比未満か以上かを判定する工程を備えてもよい。
[0021] The determining step may include a step of determining whether the duty ratio of the pulse is less than or greater than a reference duty ratio based on whether the count value is positive or negative.

【0022】前記パルスの一周期の間に前記カウント工
程がカウントするカウント値が既知の場合に、前記一組
のカウントの一方のカウント値からデューティ比を求め
る工程をさらに備えてもよい。
[0022] The method may further include a step of obtaining a duty ratio from one count value of the set of counts when a count value counted by the count step during one cycle of the pulse is known.

【0023】[0023]

【発明の実施の形態】次に、本発明の実施の形態につい
て図面を参照して説明する。
Next, embodiments of the present invention will be described with reference to the drawings.

【0024】図1は、本発明の第1の実施の形態にかか
るデューティ比判定回路の構成を示すブロック図であ
る。
FIG. 1 is a block diagram showing a configuration of the duty ratio determination circuit according to the first embodiment of the present invention.

【0025】デューティ比判定回路は、エッジ検出回路
1と、アップダウンカウンタ2と、アップダウンカウン
タステータスフラグレジスタ3と、入力部4と、CPU
(Central Processing Unit;中央演算処理ユニット)5
と、レジスタ6と、から構成されている。
The duty ratio determination circuit includes an edge detection circuit 1, an up / down counter 2, an up / down counter status flag register 3, an input unit 4,
(Central Processing Unit) 5
And a register 6.

【0026】エッジ検出回路1は、入力されたパルス信
号(デューティ比の判定対象となる信号)の立ち上がり
及び立ち下がりの両エッジを検出し、各エッジを検出し
たことを示す信号をアップダウンカウンタ2に出力す
る。また、エッジ検出回路1は、立ち上がりエッジを検
出すると、プリセット信号をアップダウンカウンタ2に
出力する。なお、立上エッジ検出信号は、プリセット信
号が出力されるタイミングよりも若干遅れて出力され
る。但し、この遅れは、クロックの周期よりも十分短
い。
The edge detection circuit 1 detects both rising and falling edges of an input pulse signal (a signal whose duty ratio is to be determined), and outputs a signal indicating the detection of each edge to an up / down counter 2. Output to When detecting the rising edge, the edge detection circuit 1 outputs a preset signal to the up / down counter 2. Note that the rising edge detection signal is output slightly after the timing at which the preset signal is output. However, this delay is sufficiently shorter than the cycle of the clock.

【0027】アップダウンカウンタ2は、一定の基準ク
ロックを使用し、エッジ検出回路1からの立上エッジ検
出信号に応答して、アップカウントを開始し、立下エッ
ジ検出信号に応答して、ダウンカウントを開始する。ま
た、アップダウンカウンタ2は、アップカウントを開始
するときのスタート値をセットするために、エッジ検出
回路1からのプリセット信号の入力に応じて、レジスタ
6からの信号を取り込む。
The up / down counter 2 starts counting up in response to a rising edge detection signal from the edge detection circuit 1 using a fixed reference clock, and counts down in response to a falling edge detection signal. Start counting. Further, the up / down counter 2 takes in a signal from the register 6 in response to the input of a preset signal from the edge detection circuit 1 in order to set a start value when starting up counting.

【0028】アップダウンカウンタステータスフラグレ
ジスタ3は、アップダウンカウンタ2の出力データのう
ち符号ビットを一旦格納し、安定した出力信号として外
部装置に出力する。この出力信号は、アップダウンカウ
ンタ2のカウント値がマイナス、すなわちボローが発生
すると1となり、カウント値がプラスなら0となる。
The up / down counter status flag register 3 temporarily stores the sign bit of the output data of the up / down counter 2 and outputs it as a stable output signal to an external device. This output signal becomes 1 when the count value of the up / down counter 2 is negative, that is, when a borrow occurs, and becomes 0 when the count value is positive.

【0029】入力部4は、アップダウンカウンタ2のア
ップカウント開始時のスタート値を入力する。
The input section 4 inputs a start value when the up / down counter 2 starts counting up.

【0030】CPU5は、入力部4から入力されたスタ
ート値を、レジスタ6にセットする。
The CPU 5 sets the start value input from the input unit 4 in the register 6.

【0031】レジスタ6は、CPU5によってセットさ
れたスタート値を一旦格納し、アップダウンカウンタ2
に出力する。
The register 6 temporarily stores the start value set by the CPU 5, and stores the start value
Output to

【0032】次に、図1に示したデューティ比判定回路
の回路動作について説明する。
Next, the operation of the duty ratio determination circuit shown in FIG. 1 will be described.

【0033】図2は、デューティ比判定回路の、第1の
回路動作例を説明するための波形図である。
FIG. 2 is a waveform diagram for explaining a first circuit operation example of the duty ratio determination circuit.

【0034】ここでは、図に示すように、周期が、T1
=T2=T3という特定周期の入力パルス信号に対し
て、デューティ比があるしきい値より大きいか小さいか
を判定する場合について説明する。このしきい値は、パ
ルスのデューティ比の大小を判定するための基準となる
デューティ比である。
Here, as shown in the figure, the period is T1
A case will be described in which it is determined whether the duty ratio is larger or smaller than a certain threshold value for an input pulse signal having a specific cycle of = T2 = T3. This threshold value is a duty ratio serving as a reference for determining the magnitude of the duty ratio of the pulse.

【0035】しきい値の設定は、以下のようにして行
う。先ず、基準となるデューティ比の入力パルス信号に
おいて、一周期終了時にアップダウンカウンタ2のカウ
ント値が0となるように、アップカウントを開始するス
タート値を実験や計算等によって求める。例えば、図2
(a)のようなデューティ比のパルス信号を基準とする
場合、一周期終了時に、カウント値が0となるようなア
ップカウントのスタート値Cを求める。基準のデューテ
ィ比のパルス信号では、スタート値Cが示す区間(T
00)にアップカウントする区間(T01;パルス信号
がハイレベルである区間)を加えたものと、ダウンカウ
ントする区間(T02)とが等しくなる。入力部4から
スタート値Cを入力すると、CPU5は、入力されたス
タート値Cを、レジスタ6にセットする。そして、アッ
プダウンカウンタ2は、エッジ検出回路1がパルスの立
ち上がりを検出したときに出力するプリセット信号に応
答し、このスタート値Cをレジスタ6から取り込んでセ
ットする。
The setting of the threshold value is performed as follows. First, in an input pulse signal having a reference duty ratio, a start value for starting up-counting is determined by experiment, calculation, or the like so that the count value of the up-down counter 2 becomes 0 at the end of one cycle. For example, FIG.
When a pulse signal having a duty ratio as shown in (a) is used as a reference, a start value C of an up-count is obtained such that the count value becomes 0 at the end of one cycle. In the pulse signal of the reference duty ratio, the section (T
00 ) plus an up-counting section (T 01 ; a section in which the pulse signal is at a high level) is equal to a down-counting section (T 02 ). When the start value C is input from the input unit 4, the CPU 5 sets the input start value C in the register 6. The up / down counter 2 responds to a preset signal output when the edge detection circuit 1 detects a rising edge of the pulse, and takes in the start value C from the register 6 and sets it.

【0036】図2(b)に示すようなパルス信号がエッ
ジ検出回路1に入力された場合、T1区間において、エ
ッジ検出回路1は、パルス信号の立ち上がりを検出し、
立上エッジ検出信号と、プリセット信号をアップダウン
カウンタ2に出力する。アップダウンカウンタ2は、エ
ッジ検出回路1からのプリセット信号を受けて、スター
ト値Cを取り込み、立上検出信号に応答してこのスター
ト値Cからアップカウントを行う。そして、アップダウ
ンカウンタ2は、エッジ検出回路1からのパルス信号の
立ち下がりを検出したことを示す立下エッジ検出信号に
応答して、ダウンカウントを開始する。
When a pulse signal as shown in FIG. 2 (b) is input to the edge detection circuit 1, the edge detection circuit 1 detects a rising edge of the pulse signal in a section T1.
The rising edge detection signal and the preset signal are output to the up / down counter 2. The up / down counter 2 receives a preset signal from the edge detection circuit 1, receives a start value C, and counts up from the start value C in response to a rise detection signal. The up / down counter 2 starts counting down in response to a falling edge detection signal indicating that the falling of the pulse signal from the edge detection circuit 1 has been detected.

【0037】図に示すように、T1区間では、スタート
値Cが示す区間(T00)にアップカウントする区間
(T11;パルス信号がハイレベルである区間)を加え
たものは、ダウンカウントする区間(T12)よりも短
い。このため、一周期終了時(T2区間のパルスが立ち
上がる直前)のアップダウンカウンタ2のカウント値は
途中からマイナス、即ちボローが発生し、アップダウン
カウンタステータスフラグレジスタ3の出力は1とな
る。従って、T1区間のデューティ比は、しきい値未満
であることがわかる。
As shown in figure, in the interval T1, the interval for up-counting period (T 00) indicated by the start value C; plus (T 11 pulse signals is interval at a high level), the down-count It is shorter than the section (T 12 ). For this reason, the count value of the up / down counter 2 at the end of one cycle (immediately before the rise of the pulse in the T2 section) becomes negative, that is, a borrow occurs halfway, and the output of the up / down counter status flag register 3 becomes 1. Therefore, it can be seen that the duty ratio in the T1 section is less than the threshold.

【0038】T2区間において、エッジ検出回路1がパ
ルス信号の立ち上がりを検出すると、上記と同様にし
て、アップダウンカウンタ2は、スタート値Cからアッ
プカウントを開始し、パルス信号の立ち下がりのタイミ
ングで、ダウンカウントを開始する。
In the section T2, when the edge detection circuit 1 detects the rise of the pulse signal, the up / down counter 2 starts counting up from the start value C in the same manner as described above, and at the timing of the fall of the pulse signal. , Start counting down.

【0039】T2区間では、スタート値Cが示す区間
(T00)にアップカウントする区間(T21;パルス
信号がハイレベルである区間)を加えたものは、ダウン
カウントする区間(T22)よりも長い。このため、T
2区間終了時(T3区間のパルスが立ち上がる直前)の
アップダウンカウンタ2のカウント値は、正であるの
で、アップダウンカウンタステータスフラグレジスタ3
の出力は0となる。従って、T2区間のデューティ比
は、しきい値より大きいことがわかる。
In the section T2, the section (T 21 ) in which the up-count is added to the section (T 00 ) indicated by the start value C is added to the section (T 22 ) in which the down-count is performed. Is also long. Therefore, T
Since the count value of the up / down counter 2 at the end of the two sections (immediately before the pulse in the T3 section rises) is positive, the up / down counter status flag register 3
Is 0. Therefore, it is understood that the duty ratio in the T2 section is larger than the threshold.

【0040】以上のようにして、アップダウンカウンタ
ステータスフラグレジスタ3の出力が1ならば、入力パ
ルス信号のデューティ比は設定したしきい値未満であ
り、プラスならば、パルス信号のデューティ比はしきい
値以上であることがわかる。従って、任意のしきい値に
おいて、アップダウンカウンタステータスフラグレジス
タ3の出力を参照するだけで、デューティ比判定が可能
になる。
As described above, if the output of the up / down counter status flag register 3 is 1, the duty ratio of the input pulse signal is less than the set threshold, and if it is plus, the duty ratio of the pulse signal is low. It turns out that it is more than a threshold value. Therefore, the duty ratio can be determined simply by referring to the output of the up / down counter status flag register 3 at an arbitrary threshold value.

【0041】次に、本発明の第2の実施の形態にかかる
デューティ比判定回路について説明する。
Next, a duty ratio determination circuit according to a second embodiment of the present invention will be described.

【0042】特定周期の入力パルス信号では、一周期の
アップダウンカウンタ2のカウント値は、カウンタの分
解能から予め計算等で求めることが可能である。従っ
て、パルス信号の立ち上がりと立ち下がりとの区間のカ
ウント値が分かれば、入力パルス信号のデューティ比を
計算することができる。
With an input pulse signal of a specific cycle, the count value of the up / down counter 2 for one cycle can be obtained in advance by calculation or the like from the resolution of the counter. Therefore, if the count value in the section between the rise and fall of the pulse signal is known, the duty ratio of the input pulse signal can be calculated.

【0043】デューティ比を求めるために、図1に示し
たデューティ比判定回路に加えて、図3に示すように、
エッジ検出回路1からの立下エッジ検出信号と、アップ
ダウンカウンタ2の出力とが、CPU5にも入力され
る。CPU5は、第1の実施の形態で示した機能に加え
て、一周期のカウント値とパルスの立ち上がりから立ち
下がりまでの区間のカウント値とから、デューティ比を
求める機能を有する。そして、CPU5には、求めたデ
ューティ比を出力するための出力端子が備えられてい
る。
To determine the duty ratio, in addition to the duty ratio determination circuit shown in FIG. 1, as shown in FIG.
The falling edge detection signal from the edge detection circuit 1 and the output of the up / down counter 2 are also input to the CPU 5. The CPU 5 has a function of obtaining a duty ratio from a count value in one cycle and a count value in a section from rising to falling of a pulse, in addition to the function described in the first embodiment. The CPU 5 has an output terminal for outputting the obtained duty ratio.

【0044】図4は、デューティ比を求める動作を説明
するための波形図である。この場合のアップダウンカウ
ンタ2のアップカウントのスタート値は、0に設定され
ている。
FIG. 4 is a waveform chart for explaining the operation for obtaining the duty ratio. The start value of the up-count of the up-down counter 2 in this case is set to 0.

【0045】予め求められた、アップダウンカウンタ2
がカウントする一周期(点Aから点C区間)のカウント
値は、入力部4からCPU5に入力される。
Up / down counter 2 obtained in advance
The count value of one cycle (section from point A to point C) counted by is input from the input unit 4 to the CPU 5.

【0046】特定周期のパルス信号が入力され、エッジ
検出回路1がパルスの立ち上がりを検出すると、アップ
ダウンカウンタ2がアップカウントを開始する。そし
て、エッジ検出回路1がパルスの立ち下がりを検出する
と、アップダウンカウンタ2は、ダウンカウントを開始
する。このとき、CPU5は、エッジ検出回路1からの
立下エッジ検出信号に応答して、アップダウンカウンタ
2のカウント値から、パルスの立ち上がり(点A)から
立ち下がり(点B)までのカウント値を求める。そし
て、CPU5は、予め入力部4から入力された一周期の
カウント値と、求めた点Aから点Bまでのカウント値と
を使用して、以下の計算を行い、デューティ比を求め
る。(点Aから点B間でのカウント値)/(入力パルス
信号の一周期のカウント値)
When a pulse signal of a specific cycle is input and the edge detection circuit 1 detects the rise of the pulse, the up / down counter 2 starts counting up. When the edge detection circuit 1 detects the falling edge of the pulse, the up / down counter 2 starts counting down. At this time, in response to the falling edge detection signal from the edge detection circuit 1, the CPU 5 calculates the count value from the rising edge (point A) to the falling edge (point B) of the pulse from the count value of the up / down counter 2. Ask. Then, the CPU 5 performs the following calculation using the count value of one cycle previously input from the input unit 4 and the count value from the point A to the point B to obtain the duty ratio. (Count value between point A and point B) / (Count value of one cycle of input pulse signal)

【0047】なお、このデューティ比判定回路でも、第
1の実施の形態で示したように、任意のしきい値に対し
て、デューティ比判定が可能である。
Note that this duty ratio determination circuit can also determine the duty ratio with respect to an arbitrary threshold value as described in the first embodiment.

【0048】上記した実施の形態では、入力されたパル
スの一周期において、アップダウンカウンタ2は、初め
にアップカウントを行い、次にダウンカウントを行って
いるが、初めにダウンカウントを行って、次にダウンカ
ウントを行ってもよい。このようにしても、上記と同様
に、ダウンカウントのスタート値を設定すれば、アップ
ダウンカウンタステータスフラグレジスタ3の出力を参
照するだけで、デューティ比の判定が可能である。
In the above-described embodiment, in one cycle of the input pulse, the up / down counter 2 first counts up and then counts down, but first counts down. Next, a down count may be performed. Even in this case, the duty ratio can be determined simply by referring to the output of the up / down counter status flag register 3 if the start value of the down count is set in the same manner as described above.

【0049】また、パルスの立ち下がりから次の立ち下
がりまでを一周期として、上記と同様のカウントを行
い、一周期終了時のカウント値からパルスのデューティ
比が基準のデューティ比未満か以上かを判定することも
可能である。
The same counting as described above is performed with one cycle from the pulse falling to the next falling as one cycle, and it is determined from the count value at the end of one cycle whether the pulse duty ratio is less than or equal to the reference duty ratio. It is also possible to make a determination.

【0050】また、上記のスタート値の設定では、レジ
スタ6からアップダウンカウンタ2への入力線に流れる
電流を、CPUを使用せずに、複数のスイッチを手動で
操作して制御することも可能である。
In the setting of the start value, the current flowing from the register 6 to the input line to the up / down counter 2 can be controlled by manually operating a plurality of switches without using the CPU. It is.

【0051】[0051]

【発明の効果】以上の説明から明らかなように、本発明
は、アップダウンカウンタステータスフラグの状態によ
り、デューティ比判定を行っているので、速度追従性に
優れたデューティ比判定が可能である。また、単純なカ
ウンタ回路によりデューティ比判定を行っているため、
回路規模の小さいデューティ比判定回路となる。
As is apparent from the above description, in the present invention, since the duty ratio is determined based on the status of the up / down counter status flag, the duty ratio can be determined with excellent speed following ability. Also, since the duty ratio is determined by a simple counter circuit,
The duty ratio determination circuit has a small circuit scale.

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

【図1】デューティ比判定回路の構成を示すブロック図
である。
FIG. 1 is a block diagram illustrating a configuration of a duty ratio determination circuit.

【図2】デューティ比判定回路の動作を説明するための
波形図である。
FIG. 2 is a waveform chart for explaining an operation of the duty ratio determination circuit.

【図3】デューティ比判定回路の他の構成を示すブロッ
ク図である。
FIG. 3 is a block diagram illustrating another configuration of the duty ratio determination circuit.

【図4】デューティ比を求める動作を説明するための波
形図である。
FIG. 4 is a waveform chart for explaining an operation for obtaining a duty ratio.

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

1 エッジ検出回路 2 アップダウンカウンタ 3 アップダウンカウンタステータスフラグレジスタ 4 入力部 5 CPU 6 レジスタ 1 edge detection circuit 2 up / down counter 3 up / down counter status flag register 4 input unit 5 CPU 6 register

Claims (8)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】入力されたパルスのレベル変化を検出する
検出手段と、 前記検出手段がレベル変化を検出するのに応じて基準ク
ロックのカウントを開始し、次に前記検出手段がレベル
変化を検出するのに応じて、前記基準クロックの逆向き
のカウントを開始するカウント手段と、 前記カウント手段のスタート値を、基準となるデューテ
ィ比に対応する値に設定する設定手段と、 前記カウント手段の連続する二つの逆向きのカウントを
一組とし、該一組のカウント終了時におけるカウント値
から、前記パルスのデューティ比が、基準のデューティ
比未満か以上かを判定する判定手段と、 を備えることを特徴とするデューティ比判定回路。
1. A detecting means for detecting a level change of an input pulse, and a reference clock in response to the detecting means detecting a level change .
Counting means for starting counting of locks , and then starting counting in the opposite direction of the reference clock in response to the detection means detecting a level change; and Setting means for setting to a value corresponding to the ratio, two consecutive counts in the opposite direction of the counting means as a set, from the count value at the end of the set of counts, the duty ratio of the pulse, the reference A determination means for determining whether the duty ratio is less than or greater than a duty ratio.
【請求項2】前記設定手段は、前記カウント手段が、基
準となるデューティ比のパルスが印加された場合、前
記一組のカウント終了時にカウント値が0となるよう
に、一組のカウントのスタート値を設定することを特徴
とする請求項1に記載のデューティ比判定回路。
Wherein said setting means, said counting means, when the pulse in relation to the standard duty ratio is applied, the so count value becomes 0 when a pair of terminal count of a set of count The duty ratio determination circuit according to claim 1, wherein a start value is set.
【請求項3】前記判定手段は、前記カウント値の正負に
よって、前記パルスのデューティ比が基準のデューティ
比未満か以上かを判定することを特徴とする請求項1又
は2に記載のデューティ比判定回路。
3. The duty ratio determination according to claim 1, wherein the determination unit determines whether the duty ratio of the pulse is less than or greater than a reference duty ratio based on whether the count value is positive or negative. circuit.
【請求項4】前記パルスの一周期の間に前記カウント手
段がカウントするカウント値が既知の場合に、前記一組
のカウントの一方のカウント値からデューティ比を求め
る回路をさらに備えることを特徴とする請求項1乃至3
の何れか1項に記載のデューティ比判定回路。
4. The apparatus according to claim 1, further comprising a circuit for calculating a duty ratio from one count value of said set of counts when a count value counted by said count means during one cycle of said pulse is known. Claims 1 to 3
The duty ratio determination circuit according to any one of the above.
【請求項5】パルスを入力する入力工程と、 前記入力工程で入力されたパルスのレベル変化を検出す
る検出工程と、 前記検出工程でレベル変化が検出されるのに応じて基準
クロックのカウントを開始し、次に前記検出工程でレベ
ル変化が検出されるのに応じて、前記基準クロックの
向きのカウントを開始するカウント工程と、 前記カウント工程で行われる、カウントのスタート値を
基準となるデューティ比に対応する値に設定する設定工
程と、 前記カウント工程の連続する二つの逆向きのカウントを
一組とし、該一組のカウント終了時におけるカウント値
から、前記パルスのデューティ比が、基準のデューティ
比未満か以上かを判定する判定工程と、 を備えることを特徴とするデューティ比判定方法。
5. An inputting step of inputting a pulse, a detecting step of detecting a level change of the pulse input in the inputting step, and a reference according to a level change being detected in the detecting step.
A counting step of starting counting of a clock , and then starting counting in a reverse direction of the reference clock in response to a level change being detected in the detecting step, and a count start value performed in the counting step. A setting step of setting a value corresponding to a reference duty ratio; and a set of two consecutively-counted counter-directions in the counting step, and determining the duty of the pulse from the count value at the end of the set of counting. A determining step of determining whether the ratio is less than or greater than a reference duty ratio.
【請求項6】前記設定工程は、前記カウント工程で、基
準となるデューティ比のパルスが印加された場合、前
記一組のカウント終了時にカウント値が0となるよう
に、一組のカウントのスタート値を設定する工程を備え
ることを特徴とする請求項5に記載のデューティ比判定
方法。
Wherein said setting step, in the counting step, when the pulse in relation to the standard duty ratio is applied, the so count value becomes 0 when a pair of terminal count of a set of count The method according to claim 5, further comprising a step of setting a start value.
【請求項7】前記判定工程は、前記カウント値の正負に
よって、前記パルスのデューティ比が基準のデューティ
比未満か以上かを判定する工程を備えることを特徴とす
る請求項5又は6に記載のデューティ比判定方法。
7. The method according to claim 5, wherein the judging step includes a step of judging whether the duty ratio of the pulse is less than or greater than a reference duty ratio based on whether the count value is positive or negative. Duty ratio determination method.
【請求項8】前記パルスの一周期の間に前記カウント工
程がカウントするカウント値が既知の場合に、前記一組
のカウントの一方のカウント値からデューティ比を求め
る工程をさらに備えることを特徴とする請求項5乃至7
の何れか1項に記載のデューティ比判定方法。
8. The method according to claim 1, further comprising a step of obtaining a duty ratio from one count value of the set of counts when a count value counted by the count step during one cycle of the pulse is known. Claims 5 to 7
The duty ratio determination method according to any one of the above.
JP22811298A 1998-08-12 1998-08-12 Duty ratio determination circuit and duty ratio determination method Expired - Fee Related JP3223884B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP22811298A JP3223884B2 (en) 1998-08-12 1998-08-12 Duty ratio determination circuit and duty ratio determination method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP22811298A JP3223884B2 (en) 1998-08-12 1998-08-12 Duty ratio determination circuit and duty ratio determination method

Publications (2)

Publication Number Publication Date
JP2000055958A JP2000055958A (en) 2000-02-25
JP3223884B2 true JP3223884B2 (en) 2001-10-29

Family

ID=16871400

Family Applications (1)

Application Number Title Priority Date Filing Date
JP22811298A Expired - Fee Related JP3223884B2 (en) 1998-08-12 1998-08-12 Duty ratio determination circuit and duty ratio determination method

Country Status (1)

Country Link
JP (1) JP3223884B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5400583B2 (en) * 2009-11-20 2014-01-29 株式会社ショーワ Rotation angle detection device and rotation angle detection method
CN112234958B (en) * 2020-10-29 2023-06-23 杰华特微电子股份有限公司 Pulse signal duty ratio detection method and detection circuit

Also Published As

Publication number Publication date
JP2000055958A (en) 2000-02-25

Similar Documents

Publication Publication Date Title
JP2690210B2 (en) Elevator speed detector
JP3223884B2 (en) Duty ratio determination circuit and duty ratio determination method
JPH02165055A (en) Speed detector
US6072338A (en) Method of and device for determining pulse width
JPH01295168A (en) Analog meter driving circuit
JP3248143B2 (en) Digital AC servo device
JP2002311040A (en) Speed detector
JPH05143480A (en) Monitor circuit for communication equipment
JPH07229979A (en) Multiphase clock time measuring circuit
JPH10255489A (en) Microcomputer
JP2002271427A (en) Noise removing circuit
JPH1028110A (en) Phase difference measuring circuit
JP3435869B2 (en) Pulse width measuring device
JP2000059206A (en) Pulse count system for pulse input circuit
JPH01194709A (en) Phase discrimination circuit
JP2598583Y2 (en) Travel detection device
JP2575936Y2 (en) Maximum temperature detection circuit for multiple temperature sensors
JPH0933579A (en) Frequency measuring circuit
JPS63133066A (en) Detection of speed
JP2001352775A (en) Rotational speed detector for induction motor
JP2840406B2 (en) Error signal generator
JP2008166922A (en) Polarity deciding apparatus and method, and polarity setting apparatus
JPH0340537B2 (en)
JPH0222567A (en) Duty detecting device
JPH0556686B2 (en)

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20010724

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20070824

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080824

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080824

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090824

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090824

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100824

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100824

Year of fee payment: 9

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100824

Year of fee payment: 9

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110824

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110824

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120824

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120824

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130824

Year of fee payment: 12

LAPS Cancellation because of no payment of annual fees