JP2012094934A - Pulse width modulation device - Google Patents

Pulse width modulation device Download PDF

Info

Publication number
JP2012094934A
JP2012094934A JP2010237864A JP2010237864A JP2012094934A JP 2012094934 A JP2012094934 A JP 2012094934A JP 2010237864 A JP2010237864 A JP 2010237864A JP 2010237864 A JP2010237864 A JP 2010237864A JP 2012094934 A JP2012094934 A JP 2012094934A
Authority
JP
Japan
Prior art keywords
value
digital value
counter
signal
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
JP2010237864A
Other languages
Japanese (ja)
Inventor
Goji Muramatsu
剛司 村松
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.)
Sharp Corp
Original Assignee
Sharp 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 Sharp Corp filed Critical Sharp Corp
Priority to JP2010237864A priority Critical patent/JP2012094934A/en
Publication of JP2012094934A publication Critical patent/JP2012094934A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide a pulse width modulation device that allows repeated or dynamic adjustment to level balance between the precision of pulse width setting and the frequency of a modulated signal.SOLUTION: The pulse width modulation device includes: a counter 11 for counting pulses of a clock signal; a first digital value setting section 17 for setting a first digital value D1 determinative of the frequency of a modulated signal; a second digital value setting section for setting a second digital value D2 determinative of the pulse width of the modulated signal; and a comparison circuit 13 for comparing the count value of the counter 11 with the second digital value D2 in terms of magnitude and outputting a binary signal depending on the magnitude relationship. If the counter 11 is an up counter, when the clock signal is input after the count value reaches a maximum value determined on the basis of the first digital value D1, the count value is changed to an initial value smaller than the maximum value to start a recount.

Description

本発明は、パルス幅変調装置に関する。   The present invention relates to a pulse width modulation device.

パルス幅変調装置の出力信号は、LEDドライバのON/OFF制御や、電圧レギュレータの出力電圧制御等の用途に利用される。   The output signal of the pulse width modulation device is used for applications such as LED driver ON / OFF control and voltage regulator output voltage control.

例えば、LEDドライバへの入力信号が「H」の時にLEDが点灯し、「L」の時にLEDが消灯するとした場合、パルス幅を変化させて「H」の期間を変えることにより、LEDの見かけ上の照度が調整される。   For example, if the LED is turned on when the input signal to the LED driver is “H” and the LED is turned off when it is “L”, the appearance of the LED is changed by changing the pulse width to change the “H” period. The illuminance above is adjusted.

また、パルス幅変調装置からの出力信号をローパスフィルタを通して直流化し、電圧レギュレータの参照電圧に入力することで、同レギュレータの出力電圧が調整される。この出力電圧は、例えば電子機器の電源電圧として利用される。   Further, the output signal from the pulse width modulation device is converted into a direct current through a low-pass filter and input to the reference voltage of the voltage regulator, whereby the output voltage of the regulator is adjusted. This output voltage is used, for example, as a power supply voltage for electronic equipment.

このようなパルス幅変調装置は、カウンタと比較器の組合せにより構成されることが従来知られている(例えば特許文献1,2参照)。   It has been conventionally known that such a pulse width modulation device is constituted by a combination of a counter and a comparator (see, for example, Patent Documents 1 and 2).

特開平5−227033号公報JP-A-5-227033 特開2010−124454号公報JP 2010-124454 A

カウンタと比較器により構成されるパルス幅変調装置では、パルス幅の設定精度を向上させた場合、生成された変調信号の周波数は、より低い側に遷移する。他方、生成された信号の周波数を十分な高さに維持するためには、パルス幅設定の精度を粗くしたり、基本クロックの周波数を上げる等の対策が必要となる。   In the pulse width modulation device constituted by the counter and the comparator, when the pulse width setting accuracy is improved, the frequency of the generated modulation signal shifts to a lower side. On the other hand, in order to maintain the frequency of the generated signal at a sufficiently high level, it is necessary to take measures such as increasing the accuracy of setting the pulse width or increasing the frequency of the basic clock.

しかし、基本クロックの周波数を上げるためにはPLL等の回路が別途必要となり、製造コストの増加や装置規模の拡大につながることから好ましくない。つまり、基本クロックの周波数を上げない場合、パルス幅の設定精度を高くすることと変調信号の周波数を高くすることとは、互いに相反する事象となる。   However, in order to increase the frequency of the basic clock, a circuit such as a PLL is required separately, which is not preferable because it leads to an increase in manufacturing cost and an increase in device scale. That is, when the frequency of the basic clock is not increased, increasing the pulse width setting accuracy and increasing the frequency of the modulation signal are mutually contradictory events.

この点につき、変調信号の利用態様から検討する。上述した、LEDの調光や電源電圧の設定に変調信号が利用される場合、パルス幅の設定精度が高いほど好ましいことは自明である。他方、周波数に関しては、前者の例(LED調光)では極端に周波数が低いとLEDの明滅がチラツキとして視認されてしまう。また、後者の例(電源電圧設定)では、周波数が低いと直流化するためのローパスフィルタが大きくなってしまう。よって、いずれの場合においても周波数は高い方が望ましいことが分かる。   This point will be examined from the mode of use of the modulation signal. When a modulation signal is used for the above-described LED light control or power supply voltage setting, it is obvious that the higher the pulse width setting accuracy, the better. On the other hand, regarding the frequency, in the former example (LED dimming), if the frequency is extremely low, blinking of the LED is visually recognized as flickering. In the latter example (power supply voltage setting), if the frequency is low, the low-pass filter for converting to DC becomes large. Therefore, it can be seen that in any case, a higher frequency is desirable.

従って、変調信号の利用用途から検討すると、パルス幅の設定精度、変調信号の周波数共に、高い値が確保されることが要求される。ところが、上述したように、実装上の制約としてこれらは相互に相反する。このため、大抵の場合は、パルス幅設定の精度とパルス幅変調信号の周波数は、両者のバランスを考慮して決定される。   Therefore, considering the use application of the modulation signal, it is required to ensure a high value for both the accuracy of setting the pulse width and the frequency of the modulation signal. However, as described above, these are mutually contradictory as mounting restrictions. For this reason, in most cases, the accuracy of setting the pulse width and the frequency of the pulse width modulation signal are determined in consideration of the balance between the two.

しかしながら、一旦決定した精度と周波数のバランスは、再度或いはダイナミックに調整するのは困難である。従来、基本クロックの加工までには至らないものの、数通りの基本クロックから最適なクロックを選択して、精度と周波数の両立を試みた例は存在する(上記特許文献1参照)。   However, it is difficult to adjust the balance between accuracy and frequency once determined again or dynamically. Conventionally, although there is no basic clock processing, there is an example in which an optimum clock is selected from several basic clocks to try to achieve both accuracy and frequency (see Patent Document 1).

本発明は、パルス幅設定の精度と変調信号の周波数の高低のバランスを再度或いはダイナミックに調整することの可能なパルス幅変調装置を提供することを目的とする。   It is an object of the present invention to provide a pulse width modulation device that can adjust the balance between the accuracy of pulse width setting and the frequency level of a modulation signal again or dynamically.

本発明は、入力されるクロック信号のパルス幅と周波数を変更した変調信号を形成して出力するパルス幅変調装置であって、
前記クロック信号のパルス数を計数するカウンタと、
前記変調信号の周波数を決定するための第1ディジタル値を設定する第1ディジタル値設定部と、
前記変調信号のパルス幅を決定するための第2ディジタル値を設定する第2ディジタル値設定部と、
前記カウンタの計数値と前記第2ディジタル値の大小を比較し、当該大小関係に応じた2値の信号を出力する比較回路と、を有し、
前記カウンタがアップカウンタである場合には、計数値が前記第1ディジタル値に基づいて決定された最大値に達した後、前記クロック信号が入力されると、その計数値を前記最大値より小さい初期値に変更して再び計数を行い、
前記カウンタがダウンカウンタである場合には、計数値が前記第1ディジタル値に基づいて決定された最小値に達した後、前記クロック信号が入力されると、その計数値を前記最小値より大きい初期値に変更して再び計数を行う構成であり、
前記変調信号は、前記比較回路から出力される前記2値の信号そのもの又は前記2値の信号に対して信号処理が施されてなる信号であることを特徴とする。
The present invention is a pulse width modulation device that forms and outputs a modulation signal in which the pulse width and frequency of an input clock signal are changed,
A counter for counting the number of pulses of the clock signal;
A first digital value setting unit for setting a first digital value for determining the frequency of the modulation signal;
A second digital value setting unit for setting a second digital value for determining the pulse width of the modulation signal;
A comparison circuit that compares the count value of the counter with the second digital value and outputs a binary signal corresponding to the magnitude relationship;
When the counter is an up counter, the count value is smaller than the maximum value when the clock signal is input after the count value reaches the maximum value determined based on the first digital value. Change to the initial value and count again,
When the counter is a down counter, when the clock signal is input after the count value reaches the minimum value determined based on the first digital value, the count value is larger than the minimum value. It is a configuration that changes to the initial value and counts again,
The modulation signal is characterized in that the binary signal itself output from the comparison circuit or a signal obtained by performing signal processing on the binary signal.

本装置が備えるカウンタがアップカウンタである場合、入力されるクロック信号のパルス数を計数するに際し、初期値から1ずつカウントアップされていき、第1ディジタル値に基づいて決定された最大値に達すると、再び初期値に復帰し、以下このような動作を繰り返す。また、ダウンカウンタである場合には、初期値から1ずつカウントダウンされていき、第1ディジタル値に基づいて決定された最小値に達すると、再び初期値に復帰し、以下このような動作を繰り返す。   When the counter provided in this apparatus is an up counter, when counting the number of pulses of the input clock signal, the counter is incremented by 1 from the initial value and reaches the maximum value determined based on the first digital value. Then, it returns to the initial value again, and the above operation is repeated thereafter. In the case of a down counter, the counter is counted down by one from the initial value, and when it reaches the minimum value determined based on the first digital value, it returns to the initial value again, and the above operation is repeated thereafter. .

ここで、比較回路は、第2ディジタル値とカウンタの計数値の大小を比較して、当該大小関係に応じた2値の信号を出力する構成である。   Here, the comparison circuit compares the second digital value with the count value of the counter and outputs a binary signal corresponding to the magnitude relationship.

カウンタがアップカウンタである場合において、第2ディジタル値をカウンタの初期値と最大値の間の値に設定しておけば、カウンタの計数値が第2ディジタル値を超えるか若しくは等しい値になった時点で比較回路の出力信号のレベルが反転する。そして、比較回路はその後出力信号のレベルを維持するが、カウンタの計数値が第1ディジタル値に基づいて決定された最大値に達した後、更にクロック信号が入力されて再び初期値に復帰すると、計数値と第2ディジタル値の大小関係が反転するため、再び比較回路の出力信号のレベルが反転する。   When the counter is an up counter, if the second digital value is set to a value between the initial value and the maximum value of the counter, the count value of the counter exceeds or is equal to the second digital value. At that time, the level of the output signal of the comparison circuit is inverted. The comparison circuit then maintains the level of the output signal, but after the count value of the counter reaches the maximum value determined on the basis of the first digital value, when the clock signal is further input to return to the initial value again. Since the magnitude relationship between the count value and the second digital value is inverted, the level of the output signal of the comparison circuit is inverted again.

つまり、第1ディジタル値を変化させることで、比較回路の出力信号の周波数を調整することができ、第2ディジタル値を変化させることで、比較回路の出力信号のパルス幅を調整することができる。   That is, the frequency of the output signal of the comparison circuit can be adjusted by changing the first digital value, and the pulse width of the output signal of the comparison circuit can be adjusted by changing the second digital value. .

従って、本発明の構成によれば、これら第1ディジタル値及び第2ディジタル値を適宜調整することで、変調信号の周波数とパルス幅設定の精度を簡易且つダイナミックに調整することが可能となる。   Therefore, according to the configuration of the present invention, it is possible to easily and dynamically adjust the frequency of the modulation signal and the accuracy of the pulse width setting by appropriately adjusting the first digital value and the second digital value.

また、本発明は、上記の構成に加えて、前記第1ディジタル値を一時的に保持するための第1レジスタを有し、
前記カウンタは、前記第1レジスタに保持された前記第1ディジタル値に基づいて前記最大値又は前記最小値を決定する構成であり、
前記第1レジスタは、前記カウンタの計数値が特定の値に達すると、前記第1ディジタル値設定部より前記第1ディジタル値を読み出して、保持値を更新する構成であることを別の特徴とする。
In addition to the above configuration, the present invention includes a first register for temporarily holding the first digital value,
The counter is configured to determine the maximum value or the minimum value based on the first digital value held in the first register;
Another feature is that, when the count value of the counter reaches a specific value, the first register reads the first digital value from the first digital value setting unit and updates the hold value. To do.

この構成によれば、第1ディジタル値設定部においてどのようなタイミングで第1ディジタル値の変更を行っても、所定のタイミングでカウンタの最大値(アップカウンタの場合)又は最小値(ダウンカウンタの場合)が決定される。このため、例えばアップカウンタにおいて、ある時点で第1ディジタル値が変更された結果、当該時点における計数値よりも小さい値で最大値が設定されてしまうという事態を回避することができる。   According to this configuration, regardless of the timing at which the first digital value is changed in the first digital value setting unit, the maximum value of the counter (in the case of an up counter) or the minimum value (of the down counter) is determined at a predetermined timing. If). For this reason, for example, in the up counter, it is possible to avoid a situation in which the maximum value is set to a value smaller than the count value at the time as a result of the first digital value being changed at a certain time.

また、本発明は、上記の構成に加えて、前記第2ディジタル値を一時的に保持するための第2レジスタを有し、
前記比較回路は、前記第2レジスタに保持された前記第2ディジタル値と前記カウンタの計数値の大小を比較する構成であり、
前記第2レジスタは、前記カウンタの計数値が特定の値に達すると、前記第2ディジタル値設定部より前記第2ディジタル値を読み出して、保持値を更新する構成であることを別の特徴とする。
In addition to the above configuration, the present invention includes a second register for temporarily holding the second digital value,
The comparison circuit is configured to compare the second digital value held in the second register with the count value of the counter;
Another feature is that, when the count value of the counter reaches a specific value, the second register reads the second digital value from the second digital value setting unit and updates the hold value. To do.

この構成によれば、第2ディジタル値設定部においてどのようなタイミングで第2ディジタル値の変更を行っても、比較回路の比較基準値としての設定は、所定のタイミングで行われる。このため、例えばアップカウンタにおいて、ある時点で第2ディジタル値が変更された結果、既に比較回路において出力が反転していたにもかかわらず、大小関係が反転した結果、計数値が初期値に復帰するまでに再び出力が反転し、短いパルス幅の出力信号が生成されてしまうという事態を回避することができる。   According to this configuration, regardless of the timing at which the second digital value setting unit changes the second digital value, the setting as the comparison reference value of the comparison circuit is performed at a predetermined timing. For this reason, for example, in the up counter, as a result of the second digital value being changed at a certain point in time, the output is already inverted in the comparison circuit. It is possible to avoid a situation in which the output is inverted again by this time and an output signal having a short pulse width is generated.

また、本発明は、上記の構成に加えて、前記特定の値が前記初期値であることを別の特徴とする。   In addition to the above configuration, the present invention is characterized in that the specific value is the initial value.

また、本発明は、上記の構成に加えて、前記比較回路から出力される前記2値の信号を成形し、クロック信号に同期させるためのDFF(D−フリップフロップ)を備えることを別の特徴とする。   In addition to the above configuration, the present invention further includes a DFF (D-flip-flop) for shaping the binary signal output from the comparison circuit and synchronizing it with a clock signal. And

本発明の構成によれば、変調信号の周波数とパルス幅設定の精度を簡易且つダイナミックに調整することが可能なパルス幅変調装置が実現される。   According to the configuration of the present invention, a pulse width modulation device capable of easily and dynamically adjusting the frequency of a modulation signal and the accuracy of pulse width setting is realized.

第1実施形態のパルス幅変調装置の概念的ブロック図1 is a conceptual block diagram of a pulse width modulation device according to a first embodiment. 第1実施形態のパルス幅変調装置における各信号のタイミング図の一例An example of a timing diagram of each signal in the pulse width modulation device of the first embodiment 第1実施形態のパルス幅変調装置における各信号のタイミング図の別の一例Another example of timing chart of each signal in the pulse width modulation device of the first embodiment 第2実施形態のパルス幅変調装置の概念的ブロック図Conceptual block diagram of a pulse width modulation apparatus according to the second embodiment 第2実施形態のパルス幅変調装置における各信号のタイミング図の一例An example of a timing diagram of each signal in the pulse width modulation device of the second embodiment 第2実施形態の比較例として構成したパルス幅変調装置の各信号のタイミング図の一例An example of a timing diagram of each signal of a pulse width modulation device configured as a comparative example of the second embodiment 第2実施形態の比較例として構成したパルス幅変調装置の各信号のタイミング図の一例An example of a timing diagram of each signal of a pulse width modulation device configured as a comparative example of the second embodiment

[第1実施形態]
本発明のパルス幅変調装置の第1実施形態について説明する。図1は、本装置の構成を模式的に示すブロック図である。
[First Embodiment]
A first embodiment of the pulse width modulation device of the present invention will be described. FIG. 1 is a block diagram schematically showing the configuration of the present apparatus.

図1に示すように、パルス幅変調装置1は、クロック信号入力端子3(以下、適宜「入力端子3」と記載)から入力されるクロック信号のパルス幅を変調し、変調信号出力端子5(以下、適宜「出力端子5」と記載)より変調信号を出力する。同装置1は、N進カウンタ11,比較回路13,DFF(D−フリップフロップ)15,第1ディジタル値設定部17,及び第2ディジタル値設定部19を備えている。   As shown in FIG. 1, the pulse width modulation device 1 modulates the pulse width of a clock signal input from a clock signal input terminal 3 (hereinafter referred to as “input terminal 3” as appropriate), and outputs a modulated signal output terminal 5 ( Hereinafter, a modulation signal is output from “output terminal 5” as appropriate. The apparatus 1 includes an N-ary counter 11, a comparison circuit 13, a DFF (D-flip flop) 15, a first digital value setting unit 17, and a second digital value setting unit 19.

N進カウンタ11は、入力されるクロック信号をカウント(計数)する。本実施形態において、N進カウンタ11はアップカウンタで構成されており、クロック信号が1回入力されると1だけ計数値を増加させる。計数値を0から順次(N−1)まで1ずつカウントアップしていき、(N−1)をカウントした後にクロック信号が入力されると、再び計数値を0に戻す。以下これを繰り返す。なお、「N進カウンタ」という名称は、この構成によってN進数によって計数値を表記するに等しくなることから付した名称であり、特別なカウンタで構成されているわけではない。アップカウンタであれば、初期値(ここでは0)から最大値(ここではN−1)までの間の値で繰り返し計数する構成であれば良い。   The N-ary counter 11 counts (counts) the input clock signal. In this embodiment, the N-ary counter 11 is composed of an up counter, and increases the count value by 1 when the clock signal is input once. The count value is sequentially incremented by 1 from 0 to (N-1). When the clock signal is input after counting (N-1), the count value is returned to 0 again. This is repeated below. Note that the name “N-ary counter” is a name given because this configuration is equivalent to expressing the count value in N-ary notation, and is not composed of a special counter. In the case of an up-counter, it may be configured to repeatedly count at a value between an initial value (here, 0) and a maximum value (here, N-1).

第1ディジタル値設定部17は、N進カウンタ11でカウントする計数値の最大値(N−1)を決定する。以下では、第1ディジタル値設定部17で設定される数値を「第1ディジタル値D1」と呼ぶ。   The first digital value setting unit 17 determines the maximum count value (N−1) counted by the N-ary counter 11. Hereinafter, the numerical value set by the first digital value setting unit 17 is referred to as “first digital value D1”.

本実施形態では、第1ディジタル値設定部において、第1ディジタル値D1として上記Nの値が設定される。つまり、D1=64と設定されている場合、N進カウンタ11は、0から63(=64−1)までのカウントを繰り返し行う。ここでは、N進カウンタ11の初期値を0とした。   In the present embodiment, the first digital value setting unit sets the N value as the first digital value D1. That is, when D1 = 64 is set, the N-ary counter 11 repeats counting from 0 to 63 (= 64-1). Here, the initial value of the N-ary counter 11 is set to zero.

比較回路13は、N進カウンタ11の計数値と第2ディジタル値設定部19で設定された値を比較する。計数値をVcount、第2ディジタル値設定部19における設定値(第2ディジタル値)をD2とすると、比較回路13は、Vcount<D2のときに「1」を出力し、それ以外の場合には「0」を出力する構成である。   The comparison circuit 13 compares the count value of the N-ary counter 11 with the value set by the second digital value setting unit 19. Assuming that the count value is Vcount and the setting value (second digital value) in the second digital value setting unit 19 is D2, the comparison circuit 13 outputs “1” when Vcount <D2, and otherwise. In this configuration, “0” is output.

DFF15は、比較回路13からの出力信号とクロック信号が入力される構成であり、比較回路13の出力波形を成形し、クロック信号に同期させる作用を有する。本実施形態のパルス幅変調装置1にはこのDFF15を備える構成としたが、本発明の機能を実現するために不可欠な要素というわけではない。   The DFF 15 is configured to receive the output signal from the comparison circuit 13 and the clock signal, and has an effect of shaping the output waveform of the comparison circuit 13 and synchronizing it with the clock signal. Although the pulse width modulation device 1 of the present embodiment is configured to include the DFF 15, it is not an indispensable element for realizing the functions of the present invention.

図2は、第1実施形態のパルス幅変調装置における各信号のタイミング図の一例である。ここでは、一例として、第1ディジタル値設定部17においてD1=64,第2ディジタル値設定部19においてD2=12と夫々設定されているものとした。   FIG. 2 is an example of a timing diagram of each signal in the pulse width modulation apparatus of the first embodiment. Here, as an example, it is assumed that D1 = 64 is set in the first digital value setting unit 17 and D2 = 12 is set in the second digital value setting unit 19.

計数値Vcount=0のとき、比較回路13は「1」をDFF15に出力する。DFF15は、その後に入力されるクロック信号の最初の立ち上がりタイミングで、この出力信号を出力端子5に出力する。   When the count value Vcount = 0, the comparison circuit 13 outputs “1” to the DFF 15. The DFF 15 outputs this output signal to the output terminal 5 at the first rising timing of the clock signal input thereafter.

N進カウンタ11は、クロック信号が入力されるたび、計数値Vcountを上昇させる。比較回路13は、Vcountが第2ディジタル値D2(=12)より小さい期間、つまり、Vcountが11以下を示す期間にわたって引き続き「1」を出力する。DFF15は、比較回路13から「1」が入力されている間は、その後に入力されるクロック信号の最初の立ち上がりタイミングで「1」を出力端子5に出力する。   The N-ary counter 11 increases the count value Vcount every time a clock signal is input. The comparison circuit 13 continues to output “1” over a period in which Vcount is smaller than the second digital value D2 (= 12), that is, a period in which Vcount is 11 or less. While “1” is input from the comparison circuit 13, the DFF 15 outputs “1” to the output terminal 5 at the first rising timing of the clock signal input thereafter.

N進カウンタ11がVcount=12を計数すると、比較回路13は、出力値を「1」から「0」に変化させる。なお、実際には、比較回路13の出力信号が「1」から「0」に変化するタイミングは、N進カウンタ11や比較回路13の演算処理能力等によって左右されるため、図2では一定の幅を持たせて図示している。DFF15は、比較回路13から「0」が入力されると、その後のに入力されるクロック信号の最初の立ち上がりタイミングで「0」を出力端子5に出力する。   When the N-ary counter 11 counts Vcount = 12, the comparison circuit 13 changes the output value from “1” to “0”. Actually, the timing at which the output signal of the comparison circuit 13 changes from “1” to “0” depends on the arithmetic processing capability of the N-ary counter 11 and the comparison circuit 13, and therefore is constant in FIG. It is shown with a width. When “0” is input from the comparison circuit 13, the DFF 15 outputs “0” to the output terminal 5 at the first rising timing of the clock signal input thereafter.

その後も、N進カウンタ11は、クロック信号が入力されるたび計数値Vcountを上昇させる。Vcount=63となるまでの間は、Vcountの値は増加する一方であるため、比較回路13は引き続き「0」を出力し、DFF15も「0」を出力する。   Thereafter, the N-ary counter 11 increases the count value Vcount each time a clock signal is input. Until Vcount = 63, since the value of Vcount is increasing, the comparison circuit 13 continues to output “0” and the DFF 15 also outputs “0”.

N進カウンタ11は、計数値Vcount=63を示した状態で、クロック信号が入力されると、上述したようにVcountを0に戻す。Vcount=0になると、比較回路13はVcountがD2より小さくなったことを検知して、出力信号を「0」から「1」に変化させる。なお、「1」から「0」に変化する場合と同様の理由により、図2では、比較回路13の出力信号が「0」から「1」に変化するタイミングに一定の幅を持たせている。DFF15は、比較回路13から「1」が入力されると、その後のに入力されるクロック信号の最初の立ち上がりタイミングで「1」を出力端子5に出力する。その後は、同様の動作が繰り返される。   When the clock signal is input in a state where the count value Vcount = 63, the N-ary counter 11 returns Vcount to 0 as described above. When Vcount = 0, the comparison circuit 13 detects that Vcount has become smaller than D2, and changes the output signal from “0” to “1”. For the same reason as when changing from “1” to “0”, the timing at which the output signal of the comparison circuit 13 changes from “0” to “1” is given a certain width in FIG. . When “1” is input from the comparison circuit 13, the DFF 15 outputs “1” to the output terminal 5 at the first rising timing of the clock signal input thereafter. Thereafter, the same operation is repeated.

このとき、出力端子3から得られる変調信号は、12クロック数に相当する時間にわたって「1」(Hレベル)を示し、52クロック数に相当する時間にわたって「0」(Lレベル)を示す。よって、上記設定によれば、入力端子3から入力されるクロック信号の1/64の周波数によって、H:L=12:52、デューティ比12/64の変調信号が生成される。   At this time, the modulation signal obtained from the output terminal 3 indicates “1” (H level) over a time corresponding to the number of 12 clocks and “0” (L level) over a time corresponding to the number of 52 clocks. Therefore, according to the above setting, a modulation signal having H: L = 12: 52 and a duty ratio of 12/64 is generated at a frequency 1/64 of the clock signal input from the input terminal 3.

図3は、第1実施形態のパルス幅変調装置における各信号のタイミング図の別の一例である。ここでは、D1=16,D2=10と設定されているものとした。   FIG. 3 is another example of a timing diagram of each signal in the pulse width modulation apparatus of the first embodiment. Here, it is assumed that D1 = 16 and D2 = 10.

この場合、図2の場合と同様に、計数値Vcount=0のとき、比較回路13は「1」をDFF15に出力し、DFF15は、その後に入力されるクロック信号の最初の立ち上がりタイミングで、この出力信号「1」を出力端子5に出力する。   In this case, as in the case of FIG. 2, when the count value Vcount = 0, the comparison circuit 13 outputs “1” to the DFF 15, and the DFF 15 The output signal “1” is output to the output terminal 5.

N進カウンタ11は、クロック信号が入力されるたび、計数値Vcountを上昇させる。そして、N進カウンタ11が計数値Vcount=9となるまでの間、比較回路13は引き続き「1」を出力し、DFF15も、比較回路13から「1」が入力されている間は、その後に入力されるクロック信号の最初の立ち上がりタイミングで「1」を出力端子5に出力する。   The N-ary counter 11 increases the count value Vcount every time a clock signal is input. The comparison circuit 13 continues to output “1” until the N-ary counter 11 reaches the count value Vcount = 9, and the DFF 15 also continues to output “1” from the comparison circuit 13 thereafter. “1” is output to the output terminal 5 at the first rising timing of the input clock signal.

そして、N進カウンタ11がVcount=10を計数すると、比較回路13は「0」を出力する。DFF15は、比較回路13から「0」が入力されると、その後に入力されるクロック信号の最初の立ち上がりタイミングで「0」を出力端子5に出力する。   When the N-ary counter 11 counts Vcount = 10, the comparison circuit 13 outputs “0”. When “0” is input from the comparison circuit 13, the DFF 15 outputs “0” to the output terminal 5 at the first rising timing of the clock signal input thereafter.

その後、Vcount=15となるまでの間は、Vcountの値は増加する一方であるため、比較回路13は引き続き「0」を出力し、DFF15も「0」を出力する。そして、N進カウンタ11は、計数値Vcount=15を示した状態でクロック信号が入力されると、Vcountを0に戻し、比較回路13は、VcountがD2より小さいことを検知して、出力信号を「1」に変化させる。DFF15は、比較回路13から「1」が入力されると、その後のに入力されるクロック信号の最初の立ち上がりタイミングで「1」を出力端子5に出力する。その後は、同様の動作が繰り返される。   Thereafter, until Vcount = 15, since the value of Vcount is increasing, the comparison circuit 13 continues to output “0” and the DFF 15 also outputs “0”. When the clock signal is input in a state where the count value Vcount = 15, the N-ary counter 11 returns Vcount to 0, and the comparison circuit 13 detects that Vcount is smaller than D2 and outputs an output signal. Is changed to “1”. When “1” is input from the comparison circuit 13, the DFF 15 outputs “1” to the output terminal 5 at the first rising timing of the clock signal input thereafter. Thereafter, the same operation is repeated.

図3の場合、出力端子3から得られる変調信号は、10クロック数に相当する時間にわたって「1」(Hレベル)を示し、6クロック数に相当する時間にわたって「0」(Lレベル)を示す。よって、上記設定によれば、入力端子3から入力されるクロック信号の1/16の周波数によって、H:L=10:6、デューティ比10/16の変調信号が生成される。   In the case of FIG. 3, the modulation signal obtained from the output terminal 3 shows “1” (H level) over a time corresponding to 10 clocks and “0” (L level) over a time equivalent to 6 clocks. . Therefore, according to the above setting, a modulation signal having H: L = 10: 6 and a duty ratio of 10/16 is generated by the frequency of 1/16 of the clock signal input from the input terminal 3.

以上を踏まえると、本実施形態のパルス幅変調装置1によれば、第1ディジタル値D1、第2ディジタル値D2によって、変調信号の周波数をクロック信号の1/D1に、HレベルとLレベルのパルス幅の比率をD2:(D1-D2)に、デューティ比をD2/D1に調整できることが分かる。なお、D2=0とすれば変調信号として常時「0」出力の信号が得られ、D2=D1とすれば変調信号として常時「1」出力の信号が得られる。   Based on the above, according to the pulse width modulation device 1 of the present embodiment, the frequency of the modulation signal is set to 1 / D1 of the clock signal by the first digital value D1 and the second digital value D2, and the H level and the L level. It can be seen that the pulse width ratio can be adjusted to D2: (D1-D2) and the duty ratio can be adjusted to D2 / D1. If D2 = 0, a signal of “0” output is always obtained as a modulation signal. If D2 = D1, a signal of “1” output is always obtained as a modulation signal.

図2の例によれば、第1ディジタル値設定部17によって、第1ディジタル値D1=64とすれば、変調信号の周波数は1/64と低くなるが、その分解能(パルス幅設定精度)は64と高くなる。また、図3の例によれば、第1ディジタル値設定部17によって、第1ディジタル値D1=16とすれば、図2の場合と比較して変調信号の周波数は1/16と高くなるが、その分解能は16と低くなる。   According to the example of FIG. 2, if the first digital value D1 = 64 is set by the first digital value setting unit 17, the frequency of the modulation signal is reduced to 1/64, but the resolution (pulse width setting accuracy) is As high as 64. Further, according to the example of FIG. 3, if the first digital value D1 = 16 is set by the first digital value setting unit 17, the frequency of the modulation signal becomes 1/16 higher than in the case of FIG. The resolution is as low as 16.

つまり、変調信号の周波数を高くすることを優先したければ、第1ディジタル値設定部17において第1ディジタル値D1を小さい値に設定すれば良く、分解能(パルス幅設定精度)を高くすることを優先したければ、第1ディジタル値D1を大きい値に設定すれば良い。なお、このように、第1ディジタル値D1を変化させても、第2ディジタル値設定部19によって第2ディジタル値D2を調整することで、所望のデューティ比の変調信号を生成することが可能である。   In other words, if priority is given to increasing the frequency of the modulation signal, the first digital value setting unit 17 may set the first digital value D1 to a small value, and the resolution (pulse width setting accuracy) should be increased. If priority is to be given, the first digital value D1 may be set to a large value. As described above, even if the first digital value D1 is changed, it is possible to generate a modulation signal having a desired duty ratio by adjusting the second digital value D2 by the second digital value setting unit 19. is there.

[第2実施形態]
本発明のパルス幅変調装置の第2実施形態について説明する。図4は、本装置の構成を模式的に示すブロック図である。
[Second Embodiment]
A second embodiment of the pulse width modulation apparatus of the present invention will be described. FIG. 4 is a block diagram schematically showing the configuration of the present apparatus.

図4に示す本実施形態のパルス幅変調装置1Aは、第1実施形態のパルス幅変調装置1と比較して、第1レジスタ21及び第2レジスタ23を更に備える点が異なる。なお、それ以外の構成要素については第1実施形態と共通である。   The pulse width modulation device 1A of this embodiment shown in FIG. 4 is different from the pulse width modulation device 1 of the first embodiment in that it further includes a first register 21 and a second register 23. Other components are the same as those in the first embodiment.

第1レジスタ21は、第1ディジタル値設定部17で設定された第1ディジタル値D1を一時的に保持する。そして、N進カウンタ11よりレジスタ更新要求信号Srldが与えられると、第1レジスタ21は、第1ディジタル値設定部17に第1ディジタル値D1を読みに行き、その保持データを更新する。   The first register 21 temporarily holds the first digital value D1 set by the first digital value setting unit 17. When the register update request signal Srld is given from the N-ary counter 11, the first register 21 reads the first digital value D1 to the first digital value setting unit 17 and updates the held data.

第2レジスタ23は、第2ディジタル値設定部19で設定された第2ディジタル値D2を一時的に保持する。そして、N進カウンタ11よりレジスタ更新要求信号Srldが与えられると、第2レジスタ23は、第2ディジタル値設定部19に第2ディジタル値D2を読みに行き、その保持データを更新する。   The second register 23 temporarily holds the second digital value D2 set by the second digital value setting unit 19. When the register update request signal Srld is given from the N-ary counter 11, the second register 23 reads the second digital value D2 to the second digital value setting unit 19 and updates the held data.

N進カウンタ11は、第1ディジタル値D1に基づいてカウントする計数値の最大値(N−1)が決定される点について、第1実施形態と同様である。ただし、第1実施形態と異なり、第1レジスタ21で保持されている第1ディジタル値D1に基づいて前記最大値を決定する。そして、計数値が最大値(N−1)に到達した時点で、N進カウンタはレジスタ更新要求信号Srldを第1レジスタ21及び第2レジスタ23に出力する。   The N-ary counter 11 is the same as in the first embodiment in that the maximum value (N-1) of the count value to be counted is determined based on the first digital value D1. However, unlike the first embodiment, the maximum value is determined based on the first digital value D1 held in the first register 21. When the count value reaches the maximum value (N−1), the N-ary counter outputs a register update request signal Srld to the first register 21 and the second register 23.

また、比較回路13は、N進カウンタ11の計数値Vcountと第2ディジタル値D2を比較する点について、第1実施形態と同様である。ただし、第1実施形態と異なり、第2レジスタ23で保持されている第2ディジタル値D2と、N進カウンタ11の計数値Vcountとの比較を行う。   Further, the comparison circuit 13 is similar to the first embodiment in that the count value Vcount of the N-ary counter 11 is compared with the second digital value D2. However, unlike the first embodiment, the second digital value D2 held in the second register 23 and the count value Vcount of the N-ary counter 11 are compared.

図5は、本実施形態のパルス幅変調装置における各信号のタイミング図の一例である。ここでは、D1,D2の値に関し、まずD1=64,D2=12に設定された後に、D1=16,D2=10に変更された場合におけるタイミング図を示している。   FIG. 5 is an example of a timing diagram of each signal in the pulse width modulation apparatus of this embodiment. Here, with respect to the values of D1 and D2, a timing diagram is shown in a case where D1 = 64 and D2 = 12, and then changed to D1 = 16 and D2 = 10.

第1レジスタ21は、N進カウンタ11からのレジスタ更新要求信号Srldを受けて、第1ディジタル値設定部17より第1ディジタル値D1を読み出して保持する。同様に、第2レジスタ23は、レジスタ更新要求信号Srldを受けて第2ディジタル値設定部23より第2ディジタル値D2を読み出して保持する。本実施形態では、N進カウンタ11の計数値が最大値(N−1)に到達した時点でレジスタ更新要求信号Srldが与えられるとしたため、各レジスタは、それから1クロック経過後、すなわち計数値が初期値の0に復帰したタイミングで、保持するディジタル値を更新する。   The first register 21 receives the register update request signal Srld from the N-ary counter 11 and reads and holds the first digital value D1 from the first digital value setting unit 17. Similarly, the second register 23 receives the register update request signal Srld and reads and holds the second digital value D2 from the second digital value setting unit 23. In this embodiment, since the register update request signal Srld is given when the count value of the N-ary counter 11 reaches the maximum value (N−1), each register has a count value of one clock after that. The held digital value is updated at the timing when the initial value returns to zero.

なお、各レジスタ21,23によって読み出された後は、次に再び読み出されるまでの間、第1ディジタル値設定部23,第2ディジタル値設定部19の設定値はどのような値であっても構わない。   It should be noted that the values set in the first digital value setting unit 23 and the second digital value setting unit 19 after the reading by the registers 21 and 23 are read out again. It doesn't matter.

第1実施形態と同様、N進カウンタ11は、クロック信号が入力されるたび計数値Vcountを上昇させる。比較回路13は、計数値Vcountと第2レジスタ23に保持された第2ディジタル値D2の大小を比較し、Vcount<D2の間は「1」を出力する。ここでは、まずD2=12と設定されているため、比較回路13は、Vcountが11以下を示す間は「1」を出力し、Vcount=12を計数すると出力を「0」に変化させる。   As in the first embodiment, the N-ary counter 11 increases the count value Vcount each time a clock signal is input. The comparison circuit 13 compares the count value Vcount with the second digital value D2 held in the second register 23, and outputs “1” while Vcount <D2. Here, since D2 = 12 is set first, the comparison circuit 13 outputs “1” while Vcount is 11 or less, and changes the output to “0” when Vcount = 12.

そして、その後クロック信号が入力されるたび、Vcountの値は増加する一方であるため、比較回路13は引き続き「0」を出力する。   Then, every time a clock signal is input, since the value of Vcount is increasing, the comparison circuit 13 continues to output “0”.

N進カウンタ11は、第1レジスタ21に保持されている第1ディジタル値D1より、計数値の最大値を認識する。ここでは、第1レジスタ21にD1=64と保持されているため、N進カウンタ11は、0から63(=64−1)までのカウントを繰り返し行う。   The N-ary counter 11 recognizes the maximum value of the count value from the first digital value D1 held in the first register 21. Here, since D1 = 64 is held in the first register 21, the N-ary counter 11 repeatedly counts from 0 to 63 (= 64-1).

N進カウンタ11は、計数値が最大値(ここでは63)に達すると、第1レジスタ21及び第2レジスタ23に対してレジスタ更新要求信号Srldを出力する。   When the count value reaches the maximum value (63 in this case), the N-ary counter 11 outputs a register update request signal Srld to the first register 21 and the second register 23.

そして、次のクロック信号がN進カウンタ11に入力されると、第1実施形態と同様に、計数値Vcountが0に復帰する。また、第1レジスタ21は、レジスタ更新要求信号Srldの入力を受け付けた次のタイミングでクロック信号が入力されると、第1ディジタル値設定部17より第1ディジタル値D1を読み出し、保持されている値の更新を行う。同様に、第2レジスタ23も、同じタイミングで第2ディジタル値設定部19より第2ディジタル値D2を読み出し、保持されている値の更新を行う。   When the next clock signal is input to the N-ary counter 11, the count value Vcount returns to 0, as in the first embodiment. Further, the first register 21 reads and holds the first digital value D1 from the first digital value setting unit 17 when the clock signal is input at the next timing when the input of the register update request signal Srld is received. Update the value. Similarly, the second register 23 reads the second digital value D2 from the second digital value setting unit 19 at the same timing, and updates the held value.

ここでは、この時点において、第1ディジタル値設定部17においてD1=16,第2ディジタル値設定部19においてD2=10が設定されている。よって、第1レジスタ21にはD1=16,第2レジスタ23にはD2=10が夫々保持される。   Here, at this time point, D1 = 16 is set in the first digital value setting unit 17 and D2 = 10 is set in the second digital value setting unit 19. Therefore, D1 = 16 is held in the first register 21, and D2 = 10 is held in the second register 23.

N進カウンタのVcountが0になると、比較回路13は、Vcount<D2より出力信号を「1」に変化させる。その後、N進カウンタ11は、クロック信号が入力されるたび、計数値Vcountを上昇させる。比較回路13は、計数値Vcountと第2レジスタ23に保持された第2ディジタル値D2の大小を比較し、Vcount<D2の間は「1」を出力する。現時点では、D2=10と設定されているため、比較回路13は、Vcountが9以下を示す間は「1」を出力し、Vcount=10を計数すると出力を「0」に変化させる。   When Vcount of the N-ary counter becomes 0, the comparison circuit 13 changes the output signal to “1” because Vcount <D2. Thereafter, the N-ary counter 11 increases the count value Vcount each time a clock signal is input. The comparison circuit 13 compares the count value Vcount with the second digital value D2 held in the second register 23, and outputs “1” while Vcount <D2. Since D2 = 10 is currently set, the comparison circuit 13 outputs “1” while Vcount is 9 or less, and changes the output to “0” when Vcount = 10.

そして、先ほどと同様に、その後クロック信号が入力されるたびVcountの値は増加する一方であるため、比較回路13は引き続き「0」を出力する。   Then, as before, since the value of Vcount is increasing every time a clock signal is input thereafter, the comparison circuit 13 continues to output “0”.

N進カウンタ11は、第1レジスタ21に保持されている第1ディジタル値D1より、計数値の最大値を認識する。現時点では、第1レジスタ21にD1=16と保持されているため、N進カウンタ11は、0から15(=16−1)までのカウントを繰り返し行うこととなる。   The N-ary counter 11 recognizes the maximum value of the count value from the first digital value D1 held in the first register 21. At this time, since D1 = 16 is held in the first register 21, the N-ary counter 11 repeatedly counts from 0 to 15 (= 16-1).

そして、N進カウンタ11は、先ほどと同様に、計数値が最大値(ここでは15)に達すると、第1レジスタ21及び第2レジスタ23に対してレジスタ更新要求信号Srldを出力する。   Then, the N-ary counter 11 outputs a register update request signal Srld to the first register 21 and the second register 23 when the count value reaches the maximum value (15 in this case) as before.

そして、次のクロック信号がN進カウンタ11に入力されると、計数値Vcountが0に復帰する。第1レジスタ21は、レジスタ更新要求信号Srldの入力を受け付けた次のタイミングでクロック信号が入力されると、第1ディジタル値設定部17より第1ディジタル値D1を読み出し、保持されている値の更新を行う。第2レジスタ23も、同じタイミングで第2ディジタル値設定部19より第1ディジタル値D2を読み出し、保持されている値の更新を行う。ここでは、先ほどと同じ値が第1ディジタル値設定部17及び第2ディジタル値設定部19において設定されているものとしたため、引き続き、第1レジスタ21ではD1=16,第2レジスタ23ではD2=10が保持される。   When the next clock signal is input to the N-ary counter 11, the count value Vcount returns to zero. The first register 21 reads the first digital value D1 from the first digital value setting unit 17 when the clock signal is input at the next timing when the input of the register update request signal Srld is received, and the value of the held value is stored. Update. The second register 23 also reads the first digital value D2 from the second digital value setting unit 19 at the same timing, and updates the held value. Here, since the same value as before is set in the first digital value setting unit 17 and the second digital value setting unit 19, D1 = 16 in the first register 21 and D2 = in the second register 23. 10 is held.

以下同様に、Vcountの値に応じて比較回路13の出力信号が「0」と「1」の間で変化する。なお、DFF15の機能は第1実施形態と同様である。   Similarly, the output signal of the comparison circuit 13 changes between “0” and “1” according to the value of Vcount. The function of the DFF 15 is the same as that of the first embodiment.

本実施形態によれば、N進カウンタ11がレジスタ更新要求信号Srldを送信するタイミングに応じて、第1レジスタ21、第2レジスタ23に夫々の設定値(D1,D2)が取り込まれる。そして、N進カウンタ11や比較回路13は、これらのレジスタ21,23に保持されたディジタル値(D1,D2)に基づいて動作する構成である。よって、第1ディジタル値設定部17における設定値D1,第2ディジタル値設定部19における設定値D2をどのタイミングで変更したとしても、安定したパルス幅変調動作の実行が担保される。   According to the present embodiment, the set values (D1, D2) are taken into the first register 21 and the second register 23 in accordance with the timing at which the N-ary counter 11 transmits the register update request signal Srld. The N-ary counter 11 and the comparison circuit 13 are configured to operate based on the digital values (D1, D2) held in these registers 21, 23. Therefore, even if the setting value D1 in the first digital value setting unit 17 and the setting value D2 in the second digital value setting unit 19 are changed at any timing, stable pulse width modulation operation is ensured.

本実施形態のパルス幅変調装置1Aが備える第1レジスタ21,第2レジスタ23の機能につき、これらのレジスタを有しない場合におけるタイミング図を参照して説明する。   The functions of the first register 21 and the second register 23 provided in the pulse width modulation device 1A of the present embodiment will be described with reference to a timing chart when these registers are not provided.

図6は、図4の変調装置1Aから第2レジスタ23を排除した構成におけるタイミング図の一例である。ここでは、第1ディジタル値D1=64が固定されており、第2ディジタル値D2は、最初の段階で12に設定された後、あるタイミングで48に変更されたものとしている。なお、第2レジスタ23を有しないため、比較回路13は、図1の構成と同様に、第2ディジタル値設定部19から直接読み出した第2ディジタル値D2でもって計数値Vcountとの比較を行う。   FIG. 6 is an example of a timing diagram in a configuration in which the second register 23 is excluded from the modulation device 1A of FIG. Here, the first digital value D1 = 64 is fixed, and the second digital value D2 is set to 12 at the first stage and then changed to 48 at a certain timing. Since the second register 23 is not provided, the comparison circuit 13 compares the count value Vcount with the second digital value D2 directly read from the second digital value setting unit 19, as in the configuration of FIG. .

最初の段階では、D2=12と設定されているため、比較回路13は、Vcountが11以下を示す間は「1」を出力し、Vcount=12を計数すると出力を「0」に変化させる。   Since D2 = 12 is set in the first stage, the comparison circuit 13 outputs “1” while Vcount indicates 11 or less, and changes the output to “0” when Vcount = 12.

しかし、その後、第2ディジタル値設定部19においてD2=48と変更される。図6のタイミング図では、この変更が、Vcount=30を示すタイミングで変更されるものとした。   However, after that, the second digital value setting unit 19 changes D2 = 48. In the timing chart of FIG. 6, it is assumed that this change is made at a timing indicating Vcount = 30.

比較回路13は、このとき、Vcount<D2であることを検知するため、出力を「1」に変化させる(図中の符号E1)。DFF15も1クロック後に変調信号をHレベルに変化させて出力する。   At this time, the comparison circuit 13 changes the output to “1” in order to detect that Vcount <D2 (reference numeral E1 in the figure). The DFF 15 also changes the modulation signal to H level after one clock and outputs it.

そして、VcountがD2と同じ値である48に達すると、比較回路13は出力を「0」に変化させる(図中の符号E2)。DFF15も1クロック後に変調信号をLレベルに変化させて出力する。   When Vcount reaches 48, which is the same value as D2, the comparison circuit 13 changes the output to “0” (symbol E2 in the figure). The DFF 15 also changes the modulation signal to L level and outputs it after one clock.

その後、N進カウンタ11は、計数値が最大値(ここでは63)に達すると、計数値Vcountが0に復帰する。このとき、比較回路13は、Vcount<D2であることを検知するため、出力を「1」に変化させる。DFF15も1クロック後に変調信号をLレベルに変化させて出力する。   Thereafter, when the count value reaches the maximum value (63 in this case), the N-ary counter 11 returns to 0. At this time, the comparison circuit 13 changes the output to “1” in order to detect that Vcount <D2. The DFF 15 also changes the modulation signal to L level and outputs it after one clock.

その後、D1及びD2の値が固定されているとすれば、比較回路13はVcount=48のタイミングで出力を「0」に変化させ、Vcount=0のタイミングで「1」に変化させるという動作を繰り返す。   After that, if the values of D1 and D2 are fixed, the comparison circuit 13 changes the output to “0” at the timing of Vcount = 48 and changes to “1” at the timing of Vcount = 0. repeat.

図6の例によれば、D1=64,D2=12として設定されている条件下では、デューティ比12/64の出力信号が得られるはずであったが、D2の値を48に変更したタイミングでパルスが立ち上がってしまい、この時点で所望の変調信号が得られなくなってしまうという問題が生じる。   According to the example of FIG. 6, an output signal with a duty ratio of 12/64 should be obtained under the conditions set as D1 = 64 and D2 = 12, but the timing when the value of D2 is changed to 48 This causes a problem that the pulse rises and a desired modulation signal cannot be obtained at this point.

なお、これは、Vcount>48の範囲でD2の値を48に変更することで解決する問題ではある。しかし、このことは、第2ディジタル値設定部19における設定変更のタイミングに留意する必要が生じることを意味するものであり、どのようなタイミングでも第2ディジタル値設定部19においてD2の値を変更することができる図4の構成の方が優れていることが分かる。   This is a problem to be solved by changing the value of D2 to 48 in the range of Vcount> 48. However, this means that it is necessary to pay attention to the timing of setting change in the second digital value setting unit 19, and the value of D2 is changed in the second digital value setting unit 19 at any timing. It can be seen that the configuration of FIG.

図7は、図4の変調装置1Aから第1レジスタ21を排除した構成におけるタイミング図の一例である。ここでは、第2ディジタル値D2=12が固定されており、第1ディジタル値D1は、最初の段階で64に設定された後、あるタイミングで16に変更されたものとしている。なお、第1レジスタ21を有しないため、N進カウンタ11は、図1の構成と同様に、第1ディジタル値設定部17から直接読み出した第1ディジタル値D1でもって計数値の最大値を決定する。   FIG. 7 is an example of a timing diagram in a configuration in which the first register 21 is excluded from the modulation device 1A of FIG. Here, the second digital value D2 = 12 is fixed, and the first digital value D1 is set to 64 at the first stage and then changed to 16 at a certain timing. Since the first register 21 is not provided, the N-ary counter 11 determines the maximum value of the count value based on the first digital value D1 directly read from the first digital value setting unit 17, as in the configuration of FIG. To do.

N進カウンタ11は、クロック信号が入力されるたび、計数値Vcountを1ずつ増加させる。D2=12と設定されているため、比較回路13は、Vcountが11以下を示す間は「1」を出力し、Vcount=12を計数すると出力を「0」に変化させる。   The N-ary counter 11 increases the count value Vcount by 1 each time a clock signal is input. Since D2 = 12 is set, the comparison circuit 13 outputs “1” while Vcount is 11 or less, and changes the output to “0” when Vcount = 12.

ここで、Vcount=16を示すタイミングで第1ディジタル値設定部17においてD1=16に変更されたとする。すると、N進カウンタ11は、この時点において、計数値Vcountの最大値が15(16−1)であることを検知する。   Here, it is assumed that the first digital value setting unit 17 changes to D1 = 16 at a timing indicating Vcount = 16. Then, the N-ary counter 11 detects that the maximum value of the count value Vcount is 15 (16-1) at this time.

しかし、この時点で既に計数値Vcountが16を超えているため、N進カウンタ11は、計数値Vcountを0に復帰させるための設定値を見失ってしまう。この結果、N進カウンタ11は計数値Vcountをどんどん増加させてしまう。この間、Vcount≧D2であるため、比較回路13は「0」を出力し続ける。結果として、図7に示すように、長時間にわたる「L」レベル信号が比較回路13及びDFF15から出力されてしまう(符号E3)。   However, since the count value Vcount has already exceeded 16 at this time, the N-ary counter 11 loses sight of the set value for returning the count value Vcount to 0. As a result, the N-ary counter 11 increases the count value Vcount. During this time, since Vcount ≧ D2, the comparison circuit 13 continues to output “0”. As a result, as shown in FIG. 7, the “L” level signal for a long time is output from the comparison circuit 13 and the DFF 15 (reference E3).

なお、図7では、N進カウンタ11が設計上採り得る最大の計数値Xに到達した時点で、「0」に復帰する構成であることを前提に示している。この場合、ひとたびVcountが0に復帰すれば、その後はD1=16,D2=12の設定に従って、所望の変調信号が出力される構成である。しかし、このように正しい動作に復帰するまでに長い時間を要すると共に、その間、所望する信号とは異なる信号が出力され続けてしまう。   In FIG. 7, it is assumed that the N-ary counter 11 is configured to return to “0” when it reaches the maximum count value X that can be designed. In this case, once Vcount returns to 0, a desired modulation signal is output according to the settings of D1 = 16 and D2 = 12. However, it takes a long time to return to the correct operation in this way, and during that time, a signal different from the desired signal continues to be output.

この場合においても、Vcount<12の範囲でD1の値を12に変更することで解決する問題ではある。しかし、このことは、第1ディジタル値設定部17における設定変更のタイミングに留意する必要が生じることを意味するものであり、どのようなタイミングでも第1ディジタル値設定部17においてD1の値を変更することができる図4の構成の方が優れていることが分かる。   Even in this case, the problem can be solved by changing the value of D1 to 12 in the range of Vcount <12. However, this means that it is necessary to pay attention to the timing of setting change in the first digital value setting unit 17, and the value of D1 is changed in the first digital value setting unit 17 at any timing. It can be seen that the configuration of FIG.

[別実施形態]
以下、別実施形態につき説明する。
[Another embodiment]
Hereinafter, another embodiment will be described.

〈1〉 N進カウンタ11は、ダウンカウンタで構成されても良い。この場合、N進カウンタ11は、クロック信号が1回入力されると1だけ計数値を減少させる。計数値を(N−1)から順次0まで1ずつカウントダウンしていき、0をカウントした後にクロック信号が入力されると、再び計数値を(N−1)に戻す。以下これを繰り返す。   <1> The N-ary counter 11 may be a down counter. In this case, the N-ary counter 11 decreases the count value by 1 when the clock signal is input once. The count value is sequentially counted down from (N-1) to 0, and when the clock signal is input after counting 0, the count value is returned to (N-1) again. This is repeated below.

〈2〉 第1ディジタル値設定部17は、計数値の最大値である(N−1)の値が第1ディジタル値D1として設定されるものとしても構わない。この場合、D1=63と設定されれいれば、N進カウンタ11は、0から63までのカウントを繰り返し行う構成となる。   <2> The first digital value setting unit 17 may set the value of (N−1) that is the maximum value of the count value as the first digital value D1. In this case, if D1 = 63 is set, the N-ary counter 11 is configured to repeatedly count from 0 to 63.

更に、N進カウンタ11の計数値の幅を2αで設定する構成である場合には、このαの値を第1ディジタル値D1として設定しても良い。この場合、D1=6と設定されていれば、N進カウンタ11は、上記と同様に0から63(=2−1)までのカウントを繰り返し行う構成となる。 Further, when it is configured to set the width of the count value of the N-ary counter 11 in 2 alpha may set the value of this alpha as a first digital value D1. In this case, if D1 = 6 is set, the N-ary counter 11 is configured to repeatedly count from 0 to 63 (= 2 6 −1) as described above.

〈3〉 第2実施形態に示したパルス幅変調装置1Aは、第1レジスタ21及び第2レジスタ23の双方を備える構成としたが、これらの内の一方のみを備える構成とすることも可能である。ただし、上述したように、第1ディジタル値D1、第2ディジタル値D2の両方につき、設定値の変更を行うタイミングを自由にすることができる点においては、両レジスタを備える方が好ましい。   <3> The pulse width modulation device 1A shown in the second embodiment is configured to include both the first register 21 and the second register 23, but may be configured to include only one of them. is there. However, as described above, it is preferable to provide both registers in that the timing for changing the set value can be freely set for both the first digital value D1 and the second digital value D2.

〈4〉 第2実施形態では、N進カウンタ11は、計数値Vcountが第1ディジタル値D1によって決定される計数値の最大値に達した段階で、レジスタ更新要求信号Srldを送信するものとした。   <4> In the second embodiment, the N-ary counter 11 transmits the register update request signal Srld when the count value Vcount reaches the maximum count value determined by the first digital value D1. .

しかし、信号Srldの送信タイミングは、必ずしもVcountが最大値に達した時点でなければならないというわけではない。例えば、最大値から所定の数だけ減じた値に達した時点でも構わない。更には、別途外部からの制御信号を与えることで、第1レジスタ21及び第2レジスタの更新タイミングを適宜指定できる構成としても良い。   However, the transmission timing of the signal Srld does not necessarily have to be when Vcount reaches the maximum value. For example, it may be the time when a value obtained by subtracting a predetermined number from the maximum value is reached. Furthermore, a configuration may be adopted in which the update timings of the first register 21 and the second register can be appropriately designated by separately providing an external control signal.

〈5〉 図4に示す第2実施形態のパルス幅変調装置1Aでは、N進カウンタ11から第1レジスタ21及び第2レジスタ23にレジスタ更新要求信号Srldが送信される構成としたが、この構成に限られるものではない。例えば、一方のレジスタである第1レジスタ21に対してのみN進カウンタ11からレジスタ更新要求信号Srldが送信される構成とし、第1レジスタ21は、この信号Srldを受信すると、第2レジスタ更新要求信号を第2レジスタ23に出力する構成とする。この場合、第2レジスタ23は、第1レジスタ21よりも1クロック以上遅れてディジタル値が更新されることとなるが、第2実施形態と同様の動作が可能である。   <5> In the pulse width modulation device 1A of the second embodiment shown in FIG. 4, the register update request signal Srld is transmitted from the N-ary counter 11 to the first register 21 and the second register 23. It is not limited to. For example, the register update request signal Srld is transmitted from the N-ary counter 11 only to the first register 21 which is one of the registers, and the first register 21 receives the signal Srld and receives the second register update request. A signal is output to the second register 23. In this case, the digital value of the second register 23 is updated one clock or more later than the first register 21, but the same operation as in the second embodiment is possible.

〈6〉 上記実施形態では、比較回路13は、カウンタ11の計数値Vcountと第2ディジタル値D2の大小関係に関し、Vcount<D2のときに「1」を出力し、それ以外のときに「0」を出力するものとしたが、比較回路13の信号生成規則はこの内容に限られるものではない。例えばある正又は負の整数Pを用いて、Vcount<D2−Pのときに「1」を出力し、それ以外のときに「0」を出力する構成としても構わない。更には、上記の規則において、「1」を出力する場合と「0」を出力する場合の規則が入れ替わっていても構わない。   <6> In the above embodiment, the comparison circuit 13 outputs “1” when Vcount <D2, and “0” otherwise, regarding the magnitude relationship between the count value Vcount of the counter 11 and the second digital value D2. However, the signal generation rule of the comparison circuit 13 is not limited to this content. For example, a certain positive or negative integer P may be used so that “1” is output when Vcount <D2−P and “0” is output otherwise. Furthermore, in the above rules, the rules for outputting “1” and “0” may be switched.

1,1A: 本発明のパルス幅変調装置
3: クロック信号入力端子
5: 変調信号出力端子
11: N進カウンタ
13: 比較回路
15: DFF
17: 第1ディジタル値設定部
19: 第2ディジタル値設定部
21: 第1レジスタ
23: 第2レジスタ
1, 1A: Pulse width modulation device of the present invention 3: Clock signal input terminal 5: Modulation signal output terminal 11: N-ary counter 13: Comparison circuit 15: DFF
17: First digital value setting unit 19: Second digital value setting unit 21: First register 23: Second register

Claims (5)

入力されるクロック信号のパルス幅と周波数を変更した変調信号を形成して出力するパルス幅変調装置であって、
前記クロック信号のパルス数を計数するカウンタと、
前記変調信号の周波数を決定するための第1ディジタル値を設定する第1ディジタル値設定部と、
前記変調信号のパルス幅を決定するための第2ディジタル値を設定する第2ディジタル値設定部と、
前記カウンタの計数値と前記第2ディジタル値の大小を比較し、当該大小関係に応じて2値の信号を出力する比較回路と、を有し、
前記カウンタがアップカウンタである場合には、計数値が前記第1ディジタル値に基づいて決定された最大値に達した後、前記クロック信号が入力されると、その計数値を前記最大値より小さい初期値に変更して再び計数を行い、
前記カウンタがダウンカウンタである場合には、計数値が前記第1ディジタル値に基づいて決定された最小値に達した後、前記クロック信号が入力されると、その計数値を前記最小値より大きい初期値に変更して再び計数を行う構成であり、
前記変調信号は、前記比較回路から出力される前記2値の信号そのもの又は前記2値の信号に対して信号処理が施されてなる信号であることを特徴とするパルス幅変調装置。
A pulse width modulation device that forms and outputs a modulation signal in which the pulse width and frequency of an input clock signal are changed,
A counter for counting the number of pulses of the clock signal;
A first digital value setting unit for setting a first digital value for determining the frequency of the modulation signal;
A second digital value setting unit for setting a second digital value for determining the pulse width of the modulation signal;
A comparison circuit that compares the count value of the counter with the second digital value and outputs a binary signal in accordance with the magnitude relationship;
When the counter is an up counter, the count value is smaller than the maximum value when the clock signal is input after the count value reaches the maximum value determined based on the first digital value. Change to the initial value and count again,
When the counter is a down counter, when the clock signal is input after the count value reaches the minimum value determined based on the first digital value, the count value is larger than the minimum value. It is a configuration that changes to the initial value and counts again,
The pulse width modulation device, wherein the modulation signal is the binary signal itself output from the comparison circuit or a signal obtained by subjecting the binary signal to signal processing.
前記第1ディジタル値を一時的に保持するための第1レジスタを有し、
前記カウンタは、前記第1レジスタに保持された前記第1ディジタル値に基づいて前記最大値又は前記最小値を決定する構成であり、
前記第1レジスタは、前記カウンタの計数値が特定の値に達すると、前記第1ディジタル値設定部より前記第1ディジタル値を読み出して、保持値を更新する構成であることを特徴とする請求項1に記載のパルス幅変調装置。
A first register for temporarily holding the first digital value;
The counter is configured to determine the maximum value or the minimum value based on the first digital value held in the first register;
The first register is configured to update the held value by reading the first digital value from the first digital value setting unit when the count value of the counter reaches a specific value. Item 2. The pulse width modulation device according to Item 1.
前記第2ディジタル値を一時的に保持するための第2レジスタを有し、
前記比較回路は、前記第2レジスタに保持された前記第2ディジタル値と前記カウンタの計数値の大小を比較する構成であり、
前記第2レジスタは、前記カウンタの計数値が特定の値に達すると、前記第2ディジタル値設定部より前記第2ディジタル値を読み出して、保持値を更新する構成であることを特徴とする請求項1又は2に記載のパルス幅変調装置。
A second register for temporarily holding the second digital value;
The comparison circuit is configured to compare the second digital value held in the second register with the count value of the counter;
The second register is configured to read the second digital value from the second digital value setting unit and update a held value when a count value of the counter reaches a specific value. Item 3. The pulse width modulation device according to Item 1 or 2.
前記特定の値が前記初期値であることを特徴とする請求項2又は3に記載のパルス幅変調装置。   4. The pulse width modulation device according to claim 2, wherein the specific value is the initial value. 前記比較回路から出力される前記2値の信号を成形し、クロック信号に同期させるためのDFFを備えることを特徴とする請求項1〜4の何れか1項に記載のパルス幅変調装置。   5. The pulse width modulation device according to claim 1, further comprising a DFF configured to shape the binary signal output from the comparison circuit and synchronize with the clock signal.
JP2010237864A 2010-10-22 2010-10-22 Pulse width modulation device Pending JP2012094934A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010237864A JP2012094934A (en) 2010-10-22 2010-10-22 Pulse width modulation device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010237864A JP2012094934A (en) 2010-10-22 2010-10-22 Pulse width modulation device

Publications (1)

Publication Number Publication Date
JP2012094934A true JP2012094934A (en) 2012-05-17

Family

ID=46387853

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010237864A Pending JP2012094934A (en) 2010-10-22 2010-10-22 Pulse width modulation device

Country Status (1)

Country Link
JP (1) JP2012094934A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015515769A (en) * 2012-02-23 2015-05-28 マイクロチップ テクノロジー インコーポレイテッドMicrochip Technology Incorporated High resolution pulse width modulator

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02165721A (en) * 1988-12-19 1990-06-26 Nec Corp Pulse output device
JPH0589261A (en) * 1991-09-30 1993-04-09 Nec Ic Microcomput Syst Ltd Microcomputer
JPH08139575A (en) * 1994-11-14 1996-05-31 Oki Electric Ind Co Ltd Pulse output circuit
JP2000091889A (en) * 1998-09-17 2000-03-31 Nec Corp Device and method for generating pulse signal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02165721A (en) * 1988-12-19 1990-06-26 Nec Corp Pulse output device
JPH0589261A (en) * 1991-09-30 1993-04-09 Nec Ic Microcomput Syst Ltd Microcomputer
JPH08139575A (en) * 1994-11-14 1996-05-31 Oki Electric Ind Co Ltd Pulse output circuit
JP2000091889A (en) * 1998-09-17 2000-03-31 Nec Corp Device and method for generating pulse signal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JPN6011017389; 「トランジスタ技術 2005年5月号」 , 200505, 164頁, CQ出版社 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015515769A (en) * 2012-02-23 2015-05-28 マイクロチップ テクノロジー インコーポレイテッドMicrochip Technology Incorporated High resolution pulse width modulator

Similar Documents

Publication Publication Date Title
JP5319986B2 (en) Pulse generator
KR100732141B1 (en) Pulse width modulation circuit
US7205800B2 (en) Clock frequency divider circuit
US8436544B2 (en) LED controller with de-flicker function and LED de-flicker circuit and method thereof
US10491201B2 (en) Delay circuit, count value generation circuit, and physical quantity sensor
TW201626721A (en) Pulse width modulation signal generation circuit and method
US20140035646A1 (en) Phase Shift Generating Circuit
JP2015039148A (en) Spread spectrum clock generation circuit, clock transfer circuit, integrated circuit, and image reading apparatus
JP5426943B2 (en) Dimming control device for LED and lighting apparatus using the same
JP2012094934A (en) Pulse width modulation device
KR20150120940A (en) Enhanced numerical controlled oscillator
JP2010282399A (en) Clock switch circuit
CN108111164B (en) Programmable frequency divider
US11076464B2 (en) Control method and driving circuit for light emitting diode
CN103746687A (en) Adaptive-precision timing/counting logic system and timing/counting device
CN213585746U (en) Frequency divider circuit
US10674578B1 (en) Pipelined exponential law brightness conversion for a multi-channel LED driver
JP2002202829A (en) Microcomputer
JP2012028989A (en) Filter device
TWI424305B (en) Clock generators and generating methods, and mobile communication devices
US7924966B2 (en) Symmetry corrected high frequency digital divider
KR20150070779A (en) Clock Generation Circuit
JP2005056214A (en) Clock control circuit and integrated circuit
JP2011109161A (en) Temperature compensation type oscillator, method of compensating temperature, and temperature compensation program
JP2009117121A (en) Led drive circuit

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20131001

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140227

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140304

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20140729