JPH0645886A - Pulse width modulating circuit - Google Patents

Pulse width modulating circuit

Info

Publication number
JPH0645886A
JPH0645886A JP21579692A JP21579692A JPH0645886A JP H0645886 A JPH0645886 A JP H0645886A JP 21579692 A JP21579692 A JP 21579692A JP 21579692 A JP21579692 A JP 21579692A JP H0645886 A JPH0645886 A JP H0645886A
Authority
JP
Japan
Prior art keywords
data
output
comparator
adder
pulse width
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
JP21579692A
Other languages
Japanese (ja)
Inventor
Yoshinobu Oshima
喜信 大島
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 JP21579692A priority Critical patent/JPH0645886A/en
Publication of JPH0645886A publication Critical patent/JPH0645886A/en
Pending legal-status Critical Current

Links

Landscapes

  • Pulse Circuits (AREA)

Abstract

PURPOSE:To use digital data as it is to perform pulse width modulation by comparing the numerical value of output data from a counter and that of digital data with each other and outputting the result as a pulse width modulation signal. CONSTITUTION:Digital data D1 is switched when a counter 3 counts 0, and data is changed from 0 to 16. A comparator 5 compares output data D2 of an adder 4 and digital data D1 with each other and outputs the result. An adder 5 adds one as addition data to the data of the counter 3; and when the output of the adder 5 is one, data value 16 of digital data D1 is larger than output data D2 of the adder 4, and an output signal 6 of the comparator 5 is changed from the low level to the high level. When output data of the counter 16 is 16, that is, when output data D2 of the adder 4 is 17, output data D2 is larger than digital data D1, and the output signal of the comparator 5 is changed from the high level to the low level. That is, the output level width of the comparator 5 is determined by data D1.

Description

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

【0001】[0001]

【産業上の利用分野】本発明はパルス幅変調回路に関
し、特にデジタルデータによりパルス幅変調を行う回路
に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a pulse width modulation circuit, and more particularly to a circuit for performing pulse width modulation with digital data.

【0002】[0002]

【従来の技術】従来のパルス幅変調回路の一例を図3に
示す。この回路は、三角波発生器8と、この三角波発生
器8の出力信号と入力端子から入力されるアナログ信号
7を比較するアナログ比較器9を有している。そして、
アナログ入力信号7のアナログレベルと、三角波発生器
8が出力する三角波のレベルをアナログ比較器9と比較
し、その結果アナログ信号レベルが三角波レベルより高
いとき、比較器は高レベルを出力する。逆のとき、比較
器は低レベルを出力する。その状態を図4に示す。アナ
ログ入力信号のレベルが三角波より高レベルとなったと
ころでPWM信号が高レベルとなっている。この場合、
アナログ入力信号のレベルが高いほどPWM信号の高レ
ベルの時間が長くなっており、アナログ入力信号のレベ
ルによりパルス幅の変調がなされることが判る。
2. Description of the Related Art An example of a conventional pulse width modulation circuit is shown in FIG. This circuit has a triangular wave generator 8 and an analog comparator 9 for comparing the output signal of the triangular wave generator 8 and the analog signal 7 input from the input terminal. And
The analog level of the analog input signal 7 and the level of the triangular wave output by the triangular wave generator 8 are compared with the analog comparator 9. As a result, when the analog signal level is higher than the triangular wave level, the comparator outputs a high level. In the opposite case, the comparator outputs a low level. The state is shown in FIG. When the level of the analog input signal becomes higher than the triangular wave, the PWM signal becomes high level. in this case,
It can be seen that the higher the level of the analog input signal is, the longer the high level of the PWM signal is, and the pulse width is modulated according to the level of the analog input signal.

【0003】[0003]

【発明が解決しようとする課題】この従来のパルス幅変
調回路では、アナログの入力信号と三角波のレベルを比
較しているため、デジタルデータでパルス幅変調を行う
場合に、デジタルデータを一度アナログ信号に変換する
必要がある。このため、デジタル−アナログ変換器が必
要となり、回路規模が増大する。また、アナログ回路が
付加されるため、特性の経年変化が生じ易くなり、特性
の電源電圧依存性、温度依存性が生じるという問題があ
る。本発明の目的は、デジタルデータをそのまま用いて
パルス幅変調を可能にしたパルス幅変調回路を提供する
ことにある。
In this conventional pulse width modulation circuit, since the analog input signal and the level of the triangular wave are compared, when the pulse width modulation is performed by the digital data, the digital data is once converted into the analog signal. Need to be converted to. For this reason, a digital-analog converter is required and the circuit scale increases. Further, since the analog circuit is added, there is a problem that the characteristics tend to change over time, and the characteristics depend on the power supply voltage and the temperature. It is an object of the present invention to provide a pulse width modulation circuit that enables pulse width modulation using digital data as it is.

【0004】[0004]

【課題を解決するための手段】本発明は、クロックをカ
ウントし、所要数カウントしたときにカウントアップ信
号を出力するカウンタと、このカウンタからのカウント
出力データに定数を加える加算器と、この加算器の出力
データとデジタルデータの数値の大小を比較し、その結
果をパルス幅変調信号として出力する比較器とを備え
る。
SUMMARY OF THE INVENTION According to the present invention, a counter that counts clocks and outputs a count-up signal when a required number is counted, an adder that adds a constant to count output data from the counter, and an adder And a comparator for comparing the magnitude of the numerical values of the output data of the comparator and the digital data and outputting the result as a pulse width modulation signal.

【0005】[0005]

【実施例】次に、本発明について図面を参照して説明す
る。図1は本発明の第1実施例の回路図である。ここで
はパルス幅変調の周期を 500KHZ 、クロック周波数を
50MHZ 、デジタルデータのビット数を7ビットとし、
パルス幅変調の最小ステップを1%としている。尚、以
下の説明において、括弧で括った数値は2進数である。
同図において、3はクロック信号2をカウントするカウ
ンタであり、0から99までクロック信号2をカウント
したときに、加算器4にデータを出力する。この加算器
4は、カウンタ3からのデータに加算データ“1”を加
算し、これを7ビットの比較器5に出力する。この比較
器5の他方にはデジタルデータ信号1(0000000)〜(111
1111) が入力される。そして、この比較器5からは、デ
ジタルデータ信号1と比較器5からの信号を比較し、そ
の結果のPWM信号6を出力する。この比較器5の論理
はデジタルデータ信号1のデータD1と加算器4の出力
データD2がD1≧D2のとき高レベルを出力し、D1
<D2のとき低レベルを出力する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, the present invention will be described with reference to the drawings. FIG. 1 is a circuit diagram of a first embodiment of the present invention. Here 500KH Z a cycle of the pulse width modulation, the clock frequency
50 mH Z, the number of bits of the digital data of 7 bits,
The minimum step of pulse width modulation is 1%. In the following description, the numerical values enclosed in parentheses are binary numbers.
In the figure, 3 is a counter for counting the clock signal 2 and outputs data to the adder 4 when the clock signal 2 is counted from 0 to 99. The adder 4 adds the addition data “1” to the data from the counter 3 and outputs it to the 7-bit comparator 5. The other side of the comparator 5 has digital data signals 1 (0000000) to (111).
1111) is input. Then, the comparator 5 compares the digital data signal 1 with the signal from the comparator 5, and outputs the PWM signal 6 as a result. The logic of the comparator 5 outputs a high level when the data D1 of the digital data signal 1 and the output data D2 of the adder 4 are D1 ≧ D2, and D1
When <D2, low level is output.

【0006】この条件でのタイムチャートを図2に示
す。このタイムチャートを用いて動作を説明する。クロ
ック信号2によりカウンタ3は0(0000000)から99(1
100011までカウントアップする。加算器4の出力データ
はカウンタ3のデータに加算データの1を加えたもの
で、1(000001)から100(1100100) を出力する。デ
ジタルデータD1はカウンタ3が0となるときに切り替
えている。ここでは、データ20から16へ変化した場
合を示す。
A time chart under these conditions is shown in FIG. The operation will be described with reference to this time chart. The counter 3 is changed from 0 (0000000) to 99 (1 by the clock signal 2).
Count up to 100011. The output data of the adder 4 is obtained by adding 1 of the addition data to the data of the counter 3 and outputs 1 (000001) to 100 (1100100). The digital data D1 is switched when the counter 3 becomes zero. Here, the case where the data 20 is changed to 16 is shown.

【0007】比較器5は加算器4の出力データD2とデ
ジタルデータ信号1のデータD1を比較して出力する。
加算器4の出力が1となったところで、デジタルデータ
信号のデータD1のデータ値16の方が加算器4の出力
データD2より大となるので、比較器5の出力信号6が
低レベルから高レベルへと変化する。その後、カウンタ
3の出力データが15、つまり加算器4の出力データD
2が16まで比較器5は高レベルを維持する。カウンタ
3の出力データが16、つまり加算器4の出力データD
2が17となったところで、加算器4の出力データがデ
ジタルデータ信号のデータD1より大となるので、比較
器5の出力信号6は高レベルから低レベルへ変化する。
The comparator 5 compares the output data D2 of the adder 4 with the data D1 of the digital data signal 1 and outputs it.
When the output of the adder 4 becomes 1, the data value 16 of the data D1 of the digital data signal becomes larger than the output data D2 of the adder 4, so the output signal 6 of the comparator 5 changes from low level to high. Change to a level. After that, the output data of the counter 3 is 15, that is, the output data D of the adder 4
The comparator 5 maintains a high level from 2 to 16. The output data of the counter 3 is 16, that is, the output data D of the adder 4
When 2 becomes 17, the output data of the adder 4 becomes larger than the data D1 of the digital data signal, so that the output signal 6 of the comparator 5 changes from the high level to the low level.

【0008】以上のように、デジタルデータ信号のデー
タD1により比較器5の出力が高レベルとなる幅が決ま
る。つまり、パルス幅変調器が実現できる。ここで加算
データの値を変えて10とすれば、加算器4の出力は1
0(0001010) から109(1101101) まで変化することに
なり、デジタルデータにオフセットを加えるのと同等の
効果を持たせることができる。
As described above, the width at which the output of the comparator 5 becomes high level is determined by the data D1 of the digital data signal. That is, a pulse width modulator can be realized. If the value of the addition data is changed to 10, the output of the adder 4 is 1
Since it changes from 0 (0001010) to 109 (1101101), the same effect as adding an offset to digital data can be provided.

【0009】図5は本発明の第2実施例を示す図であ
る。ここでは、第1実施例のカウンタ3の出力データ
と、デューティデータ10の大きさを第2比較器11で
比較するように構成している。この第2比較器11はカ
ウンタ3の出力データがデューティデータ10よりも小
さいと高レベルを出力し、カウンタ3の出力データがデ
ューティデータ10と同じ値以上の値となったときに低
レベルを出力する。そして第2比較器11の出力と、第
1実施例と同じ比較器5のデータをAND回路12で論
理をとってその出力をPWM信号6とする。つまり、こ
の回路はデューティデータ10がカウンタ3の出力デー
タよりも大きなときだけパルス幅変調の出力を有効と
し、それ以外の場合には出力信号を強制的に低レベルに
する効果をもつ。即ち、デューティデータ10によって
パルス幅変調の有効時間を制限するものであり、換言す
ればパルス幅変調の最大デューティを規定することがで
きる。
FIG. 5 is a diagram showing a second embodiment of the present invention. Here, the output data of the counter 3 of the first embodiment and the magnitude of the duty data 10 are configured to be compared by the second comparator 11. The second comparator 11 outputs a high level when the output data of the counter 3 is smaller than the duty data 10, and outputs a low level when the output data of the counter 3 has a value equal to or larger than the duty data 10. To do. Then, the output of the second comparator 11 and the data of the same comparator 5 as in the first embodiment are ANDed by the AND circuit 12 and the output thereof is used as the PWM signal 6. That is, this circuit has the effect of validating the output of pulse width modulation only when the duty data 10 is larger than the output data of the counter 3, and forcing the output signal to the low level otherwise. That is, the duty data 10 limits the effective time of the pulse width modulation. In other words, the maximum duty of the pulse width modulation can be defined.

【0010】[0010]

【発明の効果】以上説明したように本発明は、デジタル
データをカウンタから出力されるデータと比較した上で
パルス幅変調の出力を得ているので、デジタル−アナロ
グ変換器が不要となる。また、全てデジタル回路で構成
できるため、クロックが安定であれば電源電圧や温度依
存性や経年変化に無関係であるという効果がある。
As described above, according to the present invention, since the output of pulse width modulation is obtained after comparing the digital data with the data output from the counter, the digital-analog converter becomes unnecessary. Further, since all the circuits can be configured by digital circuits, there is an effect that if the clock is stable, it is irrelevant to power supply voltage, temperature dependence, and secular change.

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

【図1】本発明の第1実施例の回路図である。FIG. 1 is a circuit diagram of a first embodiment of the present invention.

【図2】図1の回路の動作を説明するためのタイミング
チャートである。
FIG. 2 is a timing chart for explaining the operation of the circuit of FIG.

【図3】従来のパルス幅変調回路の一例の回路図であ
る。
FIG. 3 is a circuit diagram of an example of a conventional pulse width modulation circuit.

【図4】図3の回路のパルス幅変調を説明するための波
形図である。
FIG. 4 is a waveform diagram for explaining pulse width modulation of the circuit of FIG.

【図5】本発明の第2実施例の回路図である。FIG. 5 is a circuit diagram of a second embodiment of the present invention.

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

1 デジタルデータ信号 2 クロック 3 カウンタ 4 加算器 5 比較器 10 デューティデータ 11 第2比較器 12 AND回路 1 Digital Data Signal 2 Clock 3 Counter 4 Adder 5 Comparator 10 Duty Data 11 Second Comparator 12 AND Circuit

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 クロックをカウントし、所要数カウント
したときにカウントアップ信号を出力するカウンタと、
このカウンタからのカウント出力データに定数を加える
加算器と、この加算器の出力データとデジタルデータの
数値の大小を比較し、その結果をパルス幅変調信号とし
て出力する比較器とを備えることを特徴とするパルス幅
変調回路。
1. A counter that counts clocks and outputs a count-up signal when a required number is counted,
It is equipped with an adder that adds a constant to the count output data from this counter, and a comparator that compares the output data of this adder and the numerical value of the digital data and outputs the result as a pulse width modulation signal. Pulse width modulation circuit.
JP21579692A 1992-07-22 1992-07-22 Pulse width modulating circuit Pending JPH0645886A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP21579692A JPH0645886A (en) 1992-07-22 1992-07-22 Pulse width modulating circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP21579692A JPH0645886A (en) 1992-07-22 1992-07-22 Pulse width modulating circuit

Publications (1)

Publication Number Publication Date
JPH0645886A true JPH0645886A (en) 1994-02-18

Family

ID=16678390

Family Applications (1)

Application Number Title Priority Date Filing Date
JP21579692A Pending JPH0645886A (en) 1992-07-22 1992-07-22 Pulse width modulating circuit

Country Status (1)

Country Link
JP (1) JPH0645886A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5982842A (en) * 1997-06-23 1999-11-09 Mitsubishi Electric Semiconductor Software Co., Ltd. Output timer

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5982842A (en) * 1997-06-23 1999-11-09 Mitsubishi Electric Semiconductor Software Co., Ltd. Output timer

Similar Documents

Publication Publication Date Title
US5337338A (en) Pulse density modulation circuit (parallel to serial) comparing in a nonsequential bit order
US5789992A (en) Method and apparatus for generating digital pulse width modulated signal using multiplied component and data signals
US5812831A (en) Method and apparatus for pulse width modulation
JP2599634Y2 (en) AD conversion circuit with dither circuit
JPH0645886A (en) Pulse width modulating circuit
US5969656A (en) Digital-to-analog converter for increasing number of bits converted
JPS63176020A (en) D/a conversion system
JPH06244639A (en) Frequency synthesizer
JPH0653794A (en) Pulse width modulation circuit
US4249119A (en) Digital drive circuit for electric motor or the like
KR100390384B1 (en) Pulse width modulator and arbitrary frequency generator using pulse distribution technique
US4473819A (en) Digital-to-analog conversion apparatus with a variable active-level
JP3125651B2 (en) Rate generator
JPH07162294A (en) Pulse counting circuit and pulse switching circuit
JPH11150479A (en) Pulse width signal conversion circuit
KR100236083B1 (en) Pulse generator
JPH08195654A (en) Clock regenerating circuit
JP2757090B2 (en) Divider / multiplier circuit
KR100207509B1 (en) Stability frequency multiplier by using FIR filter
JPH07225630A (en) Optional waveform generator with sequence function
JPH07135469A (en) D/a converter
SU1451731A1 (en) Device for determining voltage ratio
JPH0983368A (en) D/a converting circuit
JPH0410812A (en) Digital/analog conversion circuit
JPH0621790A (en) Pulse width modulation circuit