JP2002325459A - Pulse width modulation signal generator - Google Patents

Pulse width modulation signal generator

Info

Publication number
JP2002325459A
JP2002325459A JP2001123683A JP2001123683A JP2002325459A JP 2002325459 A JP2002325459 A JP 2002325459A JP 2001123683 A JP2001123683 A JP 2001123683A JP 2001123683 A JP2001123683 A JP 2001123683A JP 2002325459 A JP2002325459 A JP 2002325459A
Authority
JP
Japan
Prior art keywords
value
duty
pulse width
width modulation
setting means
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
JP2001123683A
Other languages
Japanese (ja)
Inventor
Masaru Obara
勝 小原
Shigehiro Masamoto
茂裕 政本
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP2001123683A priority Critical patent/JP2002325459A/en
Publication of JP2002325459A publication Critical patent/JP2002325459A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To set an upper/lower limit value of duty cycle of pulse width modulation, without checking the value set in a register by a software without using a separate hardware, in a pulse width modulation signal generator circuit. SOLUTION: A pulse width modulation signal generator circuit 15, a setting means for setting a maximum/minimum value duty cycle, and a CPU12 having an instruction for transfer of a duty set value, are provided. When the duty cycle set value is transferred from the CPU12 in the case of this set value larger the maximum value set in the setting means, this maximum value is transferred, the duty cycle width of a pulse width modulation output is controlled to a value or less set in the setting means. Further, when the duty set value is transferred from the CPU12, in the case of its set value smaller than the minimum value set in the setting means, this minimum value is transferred, and the duty cycle width of the pulse width modulation output is controlled to a value or larger, set in the setting means.

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 signal generator, and more particularly, to a pulse width modulation signal in a semiconductor device such as a microcomputer capable of generating a pulse width modulation signal for use in motor control, inverter control and the like. It relates to a generating device.

【0002】[0002]

【従来の技術】モータ制御やインバータ制御などを行な
うために、PWM(Pulse Width Modulation、パルス幅
変調)信号と呼ばれるパルス信号が用いられる。このP
WM信号を生成するため、従来から、図5のような構成
のマイクロコンピュータ等が用いられることが多い。 *従来技術(PWM生成方法) 図5において、51は、PWM信号を生成するため1チ
ップマイクロコンピュータのハードウェア部で、CPU
52や、PWM信号生成回路53などを有する。CPU
52は、ソフトウェア部としての命令セット54を備え
る。命令セット54には、通常の算術演算命令や論理演
算命令のほかに、データ転送命令55が含まれる。
2. Description of the Related Art A pulse signal called a PWM (Pulse Width Modulation) signal is used for controlling a motor or an inverter. This P
In order to generate a WM signal, a microcomputer having a configuration as shown in FIG. * Conventional technology (PWM generation method) In FIG. 5, reference numeral 51 denotes a hardware unit of a one-chip microcomputer for generating a PWM signal.
52, a PWM signal generation circuit 53, and the like. CPU
52 includes an instruction set 54 as a software unit. The instruction set 54 includes a data transfer instruction 55 in addition to a normal arithmetic operation instruction and a logical operation instruction.

【0003】図6は、図5におけるPWM信号生成回路
53の詳細構造を示す。ここで56はカウンタ、57、
58はコンパレータ、59は周期設定レジスタ、60は
デューティ設定レジスタ、61はフリップフロップ回路
である。図示は省略するが、PWM信号生成回路53に
は、PWM信号のデューティ比を設定するためのコンペ
アレジスタが含まれる。カウンタ56およびコンペアレ
ジスタは、8bitや16bitなどの決まったビット
幅のレジスタから構成される。
FIG. 6 shows a detailed structure of the PWM signal generation circuit 53 in FIG. Here, 56 is a counter, 57,
58 is a comparator, 59 is a cycle setting register, 60 is a duty setting register, and 61 is a flip-flop circuit. Although not shown, the PWM signal generation circuit 53 includes a compare register for setting the duty ratio of the PWM signal. The counter 56 and the compare register are composed of registers having a fixed bit width such as 8 bits or 16 bits.

【0004】図6のカウンタ56は、クロック毎にカウ
ントアップされる。コンパレータ57はカウンタ値とコ
ンペアレジスタ値とを比較し、図7に示すようにそれぞ
れの値が一致した時に出力信号が反転される。またカウ
ンタ値がオーバーフローしたときには、コンパレータ5
7からのリセット信号62によって出力信号がリセット
される。これらの操作の連続により、PWM信号が生成
される。
[0006] The counter 56 shown in FIG. 6 counts up every clock. The comparator 57 compares the counter value with the compare register value, and when the respective values match as shown in FIG. 7, the output signal is inverted. When the counter value overflows, the comparator 5
7, the output signal is reset. A PWM signal is generated by a sequence of these operations.

【0005】PWM信号を制御に使用する場合、パルス
におけるHiレベルとなっている割合(デューティ)を
制御対象の状態等に応じて変化させることで、制御を行
なう。
When the PWM signal is used for control, the control is performed by changing the ratio (duty) of the pulse at the Hi level according to the state of the control target.

【0006】図6の構成の場合は、コンペアレジスタの
値を設定することで、出力されるPWMのデューティが
決定される。マイクロコンピュータにおけるPWM信号
を生成可能なPWM信号生成回路53(図5)として
は、さまざまな構成が知られており、図6の構成は一例
である。しかし、いずれの場合も、CPU52からのデ
ータ転送命令55によって制御レジスタの値を変更する
点や、カウンタ56とある設定値とを比較することによ
ってPWMのデューティを変更する点については共通し
ている。 *従来技術(PWM信号を用いた制御方法) PWM信号生成回路53を用いてモータ制御やインバー
タ制御を行なう際に、PWMのキャリアやデューティ
は、各制御レジスタの値により決定される。制御レジス
タに値が設定されると、その設定された通りのキャリ
ア、デューティのPWM信号が生成される。
In the configuration of FIG. 6, the duty of the output PWM is determined by setting the value of the compare register. Various configurations are known as the PWM signal generation circuit 53 (FIG. 5) capable of generating a PWM signal in a microcomputer, and the configuration in FIG. 6 is an example. However, in either case, the point that the value of the control register is changed by the data transfer instruction 55 from the CPU 52 and the point that the duty of the PWM is changed by comparing the counter 56 with a certain set value are common. . * Conventional technology (control method using PWM signal) When performing motor control or inverter control using the PWM signal generation circuit 53, the PWM carrier and duty are determined by the values of the respective control registers. When a value is set in the control register, a PWM signal having the carrier and duty as set is generated.

【0007】制御レジスタへの値の設定は、CPU52
からのデータ転送命令55によって行われる。ソフトウ
ェアにより設定したい値が計算され、計算された値はデ
ータ転送命令55によって制御レジスタに転送され、こ
の制御レジスタに設定される。
The setting of the value in the control register is performed by the CPU 52.
This is performed by a data transfer instruction 55 from. The value to be set is calculated by software, and the calculated value is transferred to the control register by the data transfer instruction 55, and is set in the control register.

【0008】[0008]

【発明が解決しようとする課題】制御する対象には、ハ
ードウェア特性や制御アルゴリズムによって、PWMの
デューティに制限がある。例えばモータ制御を行なう場
合は、PWMのデューティが大きすぎると、トランジス
タのON期間が長くなり、電流が多く流れるため、モー
タ等制御対象のハードウェアの破壊につながるおそれが
ある。逆に、PWMのデューティが小さすぎると、トラ
ンジスタがONする期間が非常に短くなる。すると、ト
ランジスタが完全にONする前にOFFさせることにな
り、トランジスタの破壊につながるおそれがある。
The duty to be controlled is limited by the PWM duty depending on the hardware characteristics and the control algorithm. For example, when performing motor control, if the PWM duty is too large, the ON period of the transistor becomes longer and a large amount of current flows, which may lead to destruction of hardware to be controlled such as a motor. Conversely, if the duty of the PWM is too small, the period during which the transistor is ON becomes very short. Then, the transistor is turned off before it is completely turned on, which may lead to destruction of the transistor.

【0009】このため、制御演算でコンペアレジスタの
ための設定値を求めたあとで、このコンペアレジスタの
設定のためのデューティが、制御対象に求められる下限
を下回っていないこと、および上限を上回っていないこ
とを確認する必要がある。 *従来の解決手段1 上記問題の解決手段として、図8に示すようにソフトウ
ェアで値を制限する方法がある。図8のフローにもとづ
く従来のソフトウェアの処理では、処理ステップS81
で設定値を求めた後に、その値がPWM信号生成回路が
求める範囲内の値であるかどうかを、処理ステップS8
2、S83の比較命令にて確認する。そして、もしその
値がPWM信号生成回路53が求める範囲外の値の時
は、処理ステップS84、S85にて設定値を範囲内の
値に書き換え、その後に、転送命令(mov)でCPU
からレジスタに転送している。反対に範囲内の値である
場合は、処理ステップS86にてそのままの値で処理を
行っている。
For this reason, after the setting value for the compare register is obtained by the control operation, the duty for setting the compare register is not lower than the lower limit required for the control target and is higher than the upper limit. You need to make sure that there are no. * Conventional Solution 1 As a solution to the above problem, there is a method of limiting the value by software as shown in FIG. In the processing of the conventional software based on the flow of FIG.
After determining the set value in step S8, it is determined whether the value is within the range determined by the PWM signal generation circuit in processing step S8.
2. Check with the comparison instruction in S83. If the value is outside the range determined by the PWM signal generation circuit 53, the set value is rewritten to a value within the range in processing steps S84 and S85, and thereafter, the CPU issues a transfer instruction (mov).
From to the register. Conversely, if the value is within the range, the processing is performed with the value as it is in the processing step S86.

【0010】しかしながら、この場合は、デューティを
規定の値に納めるためのソフトウェアの処理時間が必要
となる。モータ制御やインバータ制御にPWM信号を用
いる際は、PWMのデューティは、図9に示すようにP
WMのキャリア毎に更新される。したがって、PWMの
キャリア周期内にデューティ設定値を計算しなければな
らず、ソフトウェアの処理時間は可能な限り短くする必
要がある。この対策をソフトウェアで行った場合は、ソ
フトウェアの処理量が多くなる問題点がある。 *従来の解決手段2 このような問題を解決する手段として、特開平6−83
985号公報に記載のように、PWM信号生成回路部
に、上限値および下限値を設定するレジスタを設ける方
法がある。この方法では、図8に示したようなソフトウ
ェアの処理量を増加させることなく、PWMのデューテ
ィの制限が可能である。
However, in this case, software processing time is required to keep the duty at a specified value. When a PWM signal is used for motor control or inverter control, the duty of PWM is set to P as shown in FIG.
It is updated for each WM carrier. Therefore, the duty set value must be calculated within the PWM carrier cycle, and the processing time of the software needs to be as short as possible. If this countermeasure is performed by software, there is a problem that the processing amount of the software increases. * Conventional solution 2 As means for solving such a problem, Japanese Patent Application Laid-Open No. 6-83
As described in Japanese Patent No. 985, there is a method in which a register for setting an upper limit value and a lower limit value is provided in the PWM signal generation circuit unit. In this method, the duty of the PWM can be limited without increasing the processing amount of software as shown in FIG.

【0011】しかし、一般にPWM出力回路の構成とし
ては多くの異なった回路構成が考えられている。たとえ
ば、図10(a)に示すように、あるハードウエア部5
1Aの回路におけるPWM信号生成回路53Aにデュー
ティ制限回路65Aを新規に設計し追加した場合は、図
10(b)に示すように異なるハードウエア部51Bの
異なるPWM信号生成回路53Bにデューティ制御を行
うときには、図10(a)で作成したデューティ制限回
路65Aはそのまま使用できない。このため、PWM信
号生成回路53Bに専用のデューティ制限回路65Bを
新規に設計する必要がある。
However, many different circuit configurations are generally considered as the configuration of the PWM output circuit. For example, as shown in FIG.
When the duty limiting circuit 65A is newly designed and added to the PWM signal generating circuit 53A in the 1A circuit, the duty control is performed on the different PWM signal generating circuits 53B of the different hardware units 51B as shown in FIG. At times, the duty limiting circuit 65A created in FIG. 10A cannot be used as it is. For this reason, it is necessary to newly design a duty limit circuit 65B dedicated to the PWM signal generation circuit 53B.

【0012】したがって、このような手法によってデュ
ーティを制限する場合は、PWM出力回路毎に回路を設
計し直さなければならず、設計の工数が多くなる、ま
た、汎用性がないという問題点がある。
Therefore, when the duty is limited by such a method, it is necessary to redesign the circuit for each PWM output circuit, so that the number of design steps is increased and there is a problem that there is no versatility. .

【0013】そこで本発明は、このような問題点を解決
して、レジスタに設定する値をソフトウェアでチェック
したり、別のハードウェアを用いたりすることなしに、
PWMのデューティの上限値、下限値を設定できるよう
にすることを目的とする。
Therefore, the present invention solves such a problem, and does not check the value set in the register by software or use another hardware.
It is an object of the present invention to be able to set an upper limit value and a lower limit value of a PWM duty.

【0014】[0014]

【課題を解決するための手段】この目的を達成するた
め、請求項1に記載の本発明のパルス幅変調信号生成装
置は、パルス幅変調信号生成回路と、デューティの最大
値を設定する設定手段と、デューティ設定値を転送する
命令を有したCPUとを具備するとともに、前記CPU
からデューティ設定値を転送する際にその設定値が前記
設定手段により設定された最大値より大きい場合は、そ
の最大値を転送して、パルス幅変調出力のデューティ幅
を前記設定手段により設定された値以下に制御するよう
にしたものである。
To achieve the above object, according to the present invention, there is provided a pulse width modulation signal generation apparatus comprising: a pulse width modulation signal generation circuit; and a setting means for setting a maximum value of a duty. And a CPU having an instruction to transfer a duty set value.
If the set value is larger than the maximum value set by the setting means when transferring the duty set value from the above, the maximum value is transferred and the duty width of the pulse width modulation output is set by the setting means. It is controlled to be less than the value.

【0015】請求項2に記載の本発明のパルス幅変調信
号生成装置は、設定手段が、最大値を設定できる専用の
レジスタを持つようにしたものである。請求項3に記載
の本発明のパルス幅変調信号生成装置は、パルス幅変調
信号生成回路と、デューティの最小値を設定する設定手
段と、デューティ設定値を転送する命令を有したCPU
とを具備するとともに、前記CPUからデューティ設定
値を転送する際にその設定値が前記設定手段により設定
された最小値より小さい場合は、その最小値を転送し
て、パルス幅変調出力のデューティ幅を前記設定手段に
より設定された値以上に制御するようにしたものであ
る。
According to a second aspect of the present invention, in the pulse width modulation signal generating apparatus, the setting means has a dedicated register for setting a maximum value. A pulse width modulation signal generating apparatus according to a third aspect of the present invention provides a pulse width modulation signal generating circuit, a setting means for setting a minimum value of a duty, and a CPU having an instruction for transferring a duty set value.
When the duty set value is transferred from the CPU, if the set value is smaller than the minimum value set by the setting means, the minimum value is transferred and the duty width of the pulse width modulation output is transferred. Is controlled to be equal to or more than the value set by the setting means.

【0016】請求項4に記載の本発明のパルス幅変調信
号生成装置は、設定手段が、最小値を設定できる専用の
レジスタを持つようにしたものである。請求項5に記載
の本発明のパルス幅変調信号生成装置は、パルス幅変調
信号生成回路と、デューティの最大値および最小値を設
定する設定手段と、デューティ設定値を転送する命令を
有したCPUとを具備するとともに、前記CPUからデ
ューティ設定値を転送する際にその設定値が前記設定手
段により設定された最大値より大きい場合は、その最大
値を転送して、パルス幅変調出力のデューティ幅を前記
設定手段により設定された値以下に制御し、かつ、前記
CPUからデューティ設定値を転送する際にその設定値
が前記設定手段により設定された最小値より小さい場合
は、その最小値を転送して、パルス幅変調出力のデュー
ティ幅を前記設定手段により設定された値以上に制御す
るようにしたものである。
According to a fourth aspect of the present invention, in the pulse width modulation signal generating apparatus, the setting means has a dedicated register for setting a minimum value. A pulse width modulation signal generating apparatus according to a fifth aspect of the present invention includes a pulse width modulation signal generating circuit, a setting unit for setting a maximum value and a minimum value of a duty, and a CPU having an instruction for transferring the duty set value. When the duty set value is transferred from the CPU, if the set value is larger than the maximum value set by the setting means, the maximum value is transferred and the duty width of the pulse width modulation output is transferred. Is controlled to be equal to or less than the value set by the setting means, and when the duty set value is transferred from the CPU, if the set value is smaller than the minimum value set by the setting means, the minimum value is transferred. Then, the duty width of the pulse width modulation output is controlled to be equal to or greater than the value set by the setting means.

【0017】請求項6に記載の本発明のパルス幅変調信
号生成装置は、設定手段が、最大値および最小値を設定
できる専用のレジスタを持つようにしたものである。
According to a sixth aspect of the present invention, in the pulse width modulation signal generating apparatus of the present invention, the setting means has a dedicated register for setting a maximum value and a minimum value.

【0018】[0018]

【発明の実施の形態】以下、本発明の実地の形態を図1
〜図4に基づいて説明する。図1のマイクロコンピュー
タ11は、CPU12、ROM13、RAM14、PW
M信号生成回路15、シリアル16、A/D17、タイ
マ18、その他の周辺回路で構成される。PWM信号生
成回路15で生成されるPWM波形のデューティ比は、
CPU12から転送される値によって決定される。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS FIG.
This will be described with reference to FIG. 1 includes a CPU 12, a ROM 13, a RAM 14, a PW
It comprises an M signal generation circuit 15, a serial 16, an A / D 17, a timer 18, and other peripheral circuits. The duty ratio of the PWM waveform generated by the PWM signal generation circuit 15 is
It is determined by a value transferred from the CPU 12.

【0019】また図1のマイクロコンピュータ11は、
PWM信号生成回路15で生成されるPWM波形のデュ
ーティ比を設定するレジスタに値を転送する際に、設定
されている最大値、最小値の範囲内の値を転送する機能
を持っている。すなわち、マイクロコンピュータ11に
おいて、20は命令セットであり、この命令セット20
には、制限付きデータ転送21が含まれる。
The microcomputer 11 shown in FIG.
When a value is transferred to a register for setting a duty ratio of a PWM waveform generated by the PWM signal generation circuit 15, the register has a function of transferring a value within the set maximum value and minimum value range. That is, in the microcomputer 11, reference numeral 20 denotes an instruction set.
Includes a restricted data transfer 21.

【0020】図2は、最大値の設定手段により最大値
「90」を設定し、最小値の設定手段により最小値を
「10」に設定した時の例を示す。このうち、最大値に
ついて説明すると、同図(a)に示す従来の技術におい
てはデータ転送命令 mov95,(PWMREG)の
命令を記述すると、CPU12から値「95」がそのま
まPWMREG(PWM専用レジスタ)に書き込まれ
る。これに対し、本発明の実施の形態のマイクロコンピ
ュータ11では、CPU12に、従来のデータ転送命令
に加えて、上限値を制限する転送命令(movlim)
を持っている。この転送命令を用いたうえで、movl
im95,(PWMREG)と記述しても、上述のよう
に上限値が「90」と設定されていることから、CPU
から「90」がPWMREGに転送される。要するに、
上述のように最大値「90」と設定されると、CPU1
2に備わっているレジスタ転送命令(movlim)に
より、「95」という「90」より大きい値が書きこま
れても、最大値「90」をPWM波形のデューティ比と
して転送する。この結果、ソフトや、外付けハードがな
くても、PWMのデューティの上限を制限することがで
きる。
FIG. 2 shows an example in which the maximum value is set to "90" by the maximum value setting means and the minimum value is set to "10" by the minimum value setting means. Among them, the maximum value will be described. In the prior art shown in FIG. 9A, if the instruction of the data transfer instruction mov95, (PWMREG) is described, the CPU 12 transfers the value “95” directly to the PWMREG (PWM dedicated register). Written. On the other hand, in the microcomputer 11 according to the embodiment of the present invention, in addition to the conventional data transfer command, the CPU 12 sends a transfer command (movlim) for limiting the upper limit value to the CPU 12.
have. After using this transfer instruction, movl
im95, (PWMREG), since the upper limit is set to “90” as described above,
Are transferred to PWMREG. in short,
When the maximum value is set to “90” as described above, the CPU 1
Even if a value larger than "90" of "95" is written by the register transfer instruction (movlim) provided in 2, the maximum value "90" is transferred as the duty ratio of the PWM waveform. As a result, the upper limit of the PWM duty can be limited without software or external hardware.

【0021】次に、図3にもとづいて、最小値について
説明する。同図(a)に示す従来の技術においてはデー
タ転送命令 mov5,(PWMREG)という命令を
記述すると、CPU12から値「5」がそのままPWM
REGに書き込まれる。これに対し、本発明の実施の形
態のマイクロコンピュータ11では、CPU12に、従
来のデータ転送命令に加えて、下限値を制限する転送命
令(movlim)を持っている。この転送命令を用い
たうえで、同図(b)に示すように movlim5,
(PWMREG)と記述した場合において、下限値が
「10」と設定されているときには、CPU12から
「10」がPWMREGに転送される。要するに最小値
が「10」と設定されると、CPU12に備わっている
レジスタ転送命令(movlim)により「5」という
「10」よりも小さい値が書きこまれても、最小値「1
0」をPWM波形のデューティ比として転送する。この
結果、ソフトや外付けハードがなくても、PWMのデュ
ーティの下限を制限することができる。
Next, the minimum value will be described with reference to FIG. In the prior art shown in FIG. 1A, when a data transfer instruction mov5, (PWMREG) is described, the CPU 12 outputs the value “5” as it is to the PWM.
Written to REG. On the other hand, in the microcomputer 11 according to the embodiment of the present invention, the CPU 12 has a transfer command (movlim) for limiting the lower limit in addition to the conventional data transfer command. After using this transfer instruction, as shown in FIG.
In the case where (PWMREG) is described, when the lower limit value is set to “10”, “10” is transferred from the CPU 12 to PWMREG. In short, when the minimum value is set to "10", even if a value smaller than "10" of "5" is written by a register transfer instruction (movlim) provided in the CPU 12, the minimum value is "1".
"0" is transferred as the duty ratio of the PWM waveform. As a result, the lower limit of the PWM duty can be limited without software or external hardware.

【0022】よって、最大値、最小値の両方を設定して
おくことで、図4に示すように、ソフトや外付けハード
がなくても、PWMのデューティの上限と下限を制限す
ることができる。図4において、(a)は従来の技術を
示し、(b)は本発明の実施の形態を示す。
Therefore, by setting both the maximum value and the minimum value, as shown in FIG. 4, the upper and lower limits of the PWM duty can be limited without software or external hardware. . 4A shows a conventional technique, and FIG. 4B shows an embodiment of the present invention.

【0023】図8に示すように従来のソフト処理ではレ
ジスタに転送する値を制限するため、レジスタ転送命令
の前に上限値と下限値をソフトの比較命令により監視す
る必要あるが、本発明のCPU命令を備えていれば、あ
らかじめ設定されている上限値、下限値の範囲内の値を
1命令(movlim)にてレジスタに転送できる。こ
のため、ソフト処理を簡易化できるとともに、制限範囲
内の値を確実に転送できる。したがって、PWM信号生
成回路15が規格外の値を転送した時の誤動作を防ぐこ
とができ、ハードウェアの保護につながる。またCPU
12にて値を制限できるため、CPU外部のPWM信号
生成回路15でその構成に応じたデューティ幅制限の回
路を設計する必要が無く、さまざまな構成のPWM信号
生成回路に対して一律に有効である。またPWM信号生
成回路以外のタイマやシリアル等の設定のように、値を
制限する必要がある場合にも、タイマ設定値の上限やシ
リアル通信での送信データの上限値を、CPU12にて
制限することができる。このため、PWM信号生成回路
15の時と同様にCPU12の外部に値を制限する回路
が必要無くなり、PWM信号生成回路15以外のハード
ウェアに対しても有効である。
As shown in FIG. 8, in the conventional software processing, in order to limit the value to be transferred to the register, it is necessary to monitor the upper and lower limits by a software comparison instruction before the register transfer instruction. If a CPU instruction is provided, a value within a preset upper limit value or lower limit value range can be transferred to the register by one instruction (movlim). For this reason, the software processing can be simplified, and values within the limit range can be reliably transferred. Therefore, a malfunction when the PWM signal generation circuit 15 transfers a value out of the standard can be prevented, which leads to protection of hardware. Also CPU
Since the value can be limited at 12, the PWM signal generation circuit 15 external to the CPU does not need to design a circuit for limiting the duty width according to the configuration, and is uniformly effective for various configurations of the PWM signal generation circuit. is there. Also, when the value needs to be limited, such as setting of a timer or a serial other than the PWM signal generation circuit, the CPU 12 limits the upper limit of the timer setting value and the upper limit of transmission data in serial communication. be able to. Therefore, as in the case of the PWM signal generation circuit 15, a circuit for limiting the value outside the CPU 12 is not required, and the present invention is also effective for hardware other than the PWM signal generation circuit 15.

【0024】[0024]

【発明の効果】以上説明したように本発明によると、P
WM信号の最大値、最小値を制限し、CPUの命令によ
って、制限された範囲内の値を転送できるようにしたた
め、演算処理によって算出されたPWM信号のデューテ
ィ比のデータがシステム上必要とされるPWM信号のデ
ューティ内にあるかどうかをプログラム処理によって監
視すること無く、制限された値をレジスタに書き込むこ
とができる。このことにより、ソフトの負担や、ハード
ウェアの追加をすることなく、PWMデューティを制限
し、トランジスタ、モータ等のハードウェアの保護を行
なえる。またCPU内部に命令を備えることにより、C
PU外部に回路が必要なくなり、PWM出力回路以外に
も汎用性がある。
As described above, according to the present invention, P
Since the maximum value and the minimum value of the WM signal are limited and the value within the limited range can be transferred by the instruction of the CPU, the duty ratio data of the PWM signal calculated by the arithmetic processing is required in the system. The limited value can be written to the register without monitoring by program processing whether the duty is within the duty of the PWM signal. As a result, the PWM duty can be limited and hardware such as a transistor and a motor can be protected without burdening software or adding hardware. In addition, by providing instructions inside the CPU, C
There is no need for a circuit outside the PU, and there is versatility other than the PWM output circuit.

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

【図1】本発明の実施の形態のパルス幅変調信号生成装
置の概略構成を示す図
FIG. 1 is a diagram showing a schematic configuration of a pulse width modulation signal generation device according to an embodiment of the present invention.

【図2】図1のパルス幅変調信号生成装置の動作の例を
示す図
FIG. 2 is a diagram showing an example of the operation of the pulse width modulation signal generation device of FIG.

【図3】図1のパルス幅変調信号生成装置の動作の例を
示す図
FIG. 3 is a diagram showing an example of the operation of the pulse width modulation signal generator of FIG. 1;

【図4】図1のパルス幅変調信号生成装置の動作の例を
示す図
FIG. 4 is a diagram showing an example of the operation of the pulse width modulation signal generation device of FIG. 1;

【図5】従来のパルス幅変調信号生成装置の概略構成を
示す図
FIG. 5 is a diagram showing a schematic configuration of a conventional pulse width modulation signal generation device.

【図6】図5のパルス幅変調信号生成装置におけるPW
M信号生成回路の構成を示す図
6 is a diagram illustrating a PW in the pulse width modulation signal generation device of FIG. 5;
The figure which shows the structure of an M signal generation circuit

【図7】図6のパルス幅変調信号生成装置の動作例を示
す図
FIG. 7 is a diagram showing an operation example of the pulse width modulation signal generation device of FIG. 6;

【図8】従来の課題解決手段の一例を示す図FIG. 8 is a diagram showing an example of conventional problem solving means.

【図9】図8の課題解決手段の動作例を示す図FIG. 9 is a diagram showing an operation example of the problem solving means of FIG. 8;

【図10】従来の課題解決手段の他の例を示す図FIG. 10 is a diagram showing another example of the conventional problem solving means.

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

11 マイクロコンピュータ 12 CPU 15 PWM信号生成回路 11 microcomputer 12 CPU 15 PWM signal generation circuit

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】 パルス幅変調信号生成回路と、デューテ
ィの最大値を設定する設定手段と、デューティ設定値を
転送する命令を有したCPUとを具備するとともに、前
記CPUからデューティ設定値を転送する際にその設定
値が前記設定手段により設定された最大値より大きい場
合は、その最大値を転送して、パルス幅変調出力のデュ
ーティ幅を前記設定手段により設定された値以下に制御
するようにしたパルス幅変調信号生成装置。
1. A pulse width modulation signal generating circuit, setting means for setting a maximum value of a duty, and a CPU having an instruction for transferring a duty set value, and transferring a duty set value from the CPU. If the set value is larger than the maximum value set by the setting means, the maximum value is transferred, and the duty width of the pulse width modulation output is controlled to be equal to or less than the value set by the setting means. Pulse width modulation signal generator.
【請求項2】 設定手段が、最大値を設定できる専用の
レジスタを持つ、請求項1記載のパルス幅変調信号生成
装置。
2. The pulse width modulation signal generating apparatus according to claim 1, wherein said setting means has a dedicated register for setting a maximum value.
【請求項3】 パルス幅変調信号生成回路と、デューテ
ィの最小値を設定する設定手段と、デューティ設定値を
転送する命令を有したCPUとを具備するとともに、前
記CPUからデューティ設定値を転送する際にその設定
値が前記設定手段により設定された最小値より小さい場
合は、その最小値を転送して、パルス幅変調出力のデュ
ーティ幅を前記設定手段により設定された値以上に制御
するようにしたパルス幅変調信号生成装置。
3. A pulse width modulation signal generating circuit, setting means for setting a minimum value of duty, and a CPU having an instruction for transferring a duty set value, and transferring the duty set value from the CPU. When the set value is smaller than the minimum value set by the setting means, the minimum value is transferred, and the duty width of the pulse width modulation output is controlled to be equal to or more than the value set by the setting means. Pulse width modulation signal generator.
【請求項4】 設定手段が、最小値を設定できる専用の
レジスタを持つ、請求項3記載のパルス幅変調信号生成
装置。
4. The pulse width modulation signal generating apparatus according to claim 3, wherein said setting means has a dedicated register for setting a minimum value.
【請求項5】 パルス幅変調信号生成回路と、デューテ
ィの最大値および最小値を設定する設定手段と、デュー
ティ設定値を転送する命令を有したCPUとを具備する
とともに、前記CPUからデューティ設定値を転送する
際にその設定値が前記設定手段により設定された最大値
より大きい場合は、その最大値を転送して、パルス幅変
調出力のデューティ幅を前記設定手段により設定された
値以下に制御し、かつ、前記CPUからデューティ設定
値を転送する際にその設定値が前記設定手段により設定
された最小値より小さい場合は、その最小値を転送し
て、パルス幅変調出力のデューティ幅を前記設定手段に
より設定された値以上に制御するようにしたパルス幅変
調信号生成装置。
5. A pulse width modulation signal generating circuit, setting means for setting a maximum value and a minimum value of a duty, and a CPU having an instruction for transferring a duty set value, wherein the CPU has a duty set value If the set value is larger than the maximum value set by the setting means when transferring, the maximum value is transferred, and the duty width of the pulse width modulation output is controlled to be equal to or less than the value set by the setting means. When transferring the duty set value from the CPU, if the set value is smaller than the minimum value set by the setting means, the minimum value is transferred to change the duty width of the pulse width modulation output to A pulse width modulation signal generation device configured to control the value to be equal to or more than a value set by a setting unit.
【請求項6】 設定手段が、最大値および最小値を設定
できる専用のレジスタを持つ、請求項5記載のパルス幅
変調信号生成装置。
6. The pulse width modulation signal generator according to claim 5, wherein the setting means has a dedicated register for setting a maximum value and a minimum value.
JP2001123683A 2001-04-23 2001-04-23 Pulse width modulation signal generator Pending JP2002325459A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001123683A JP2002325459A (en) 2001-04-23 2001-04-23 Pulse width modulation signal generator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001123683A JP2002325459A (en) 2001-04-23 2001-04-23 Pulse width modulation signal generator

Publications (1)

Publication Number Publication Date
JP2002325459A true JP2002325459A (en) 2002-11-08

Family

ID=18973194

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001123683A Pending JP2002325459A (en) 2001-04-23 2001-04-23 Pulse width modulation signal generator

Country Status (1)

Country Link
JP (1) JP2002325459A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004173444A (en) * 2002-11-21 2004-06-17 Sanyo Electric Co Ltd Motor control equipment
JP2007124156A (en) * 2005-10-26 2007-05-17 Canon Inc Frequency control circuit, motor driver, frequency control method, control method of motor driver, and program for allowing computer to perform the control method
WO2008006381A2 (en) * 2006-07-11 2008-01-17 The Tc Group A/S Self-oscillating modulator with improved synchronisation and pwm cycle constraints
JP2008206392A (en) * 2007-02-20 2008-09-04 Gm Global Technology Operations Inc Method and arrangement for reducing pulse width modulation voltage distortion in electrical driving unit
WO2008116467A2 (en) * 2007-03-27 2008-10-02 Danfoss Drives A/S Method for driving a pulse width modulated controller

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004173444A (en) * 2002-11-21 2004-06-17 Sanyo Electric Co Ltd Motor control equipment
JP2007124156A (en) * 2005-10-26 2007-05-17 Canon Inc Frequency control circuit, motor driver, frequency control method, control method of motor driver, and program for allowing computer to perform the control method
WO2008006381A2 (en) * 2006-07-11 2008-01-17 The Tc Group A/S Self-oscillating modulator with improved synchronisation and pwm cycle constraints
WO2008006381A3 (en) * 2006-07-11 2008-03-06 Tc Electronic As Self-oscillating modulator with improved synchronisation and pwm cycle constraints
JP2008206392A (en) * 2007-02-20 2008-09-04 Gm Global Technology Operations Inc Method and arrangement for reducing pulse width modulation voltage distortion in electrical driving unit
WO2008116467A2 (en) * 2007-03-27 2008-10-02 Danfoss Drives A/S Method for driving a pulse width modulated controller
WO2008116467A3 (en) * 2007-03-27 2009-04-09 Danfoss Drives As Method for driving a pulse width modulated controller
US8648561B2 (en) 2007-03-27 2014-02-11 Danfoss Drives A/S Method for driving a pulse width modulated controller

Similar Documents

Publication Publication Date Title
JP2885256B2 (en) Microcomputer
JP2002325459A (en) Pulse width modulation signal generator
US10775862B2 (en) Reset isolation bridge
US11531366B2 (en) Integrated circuit with clock gapping
JP2004524761A (en) Pulse width modulation with feedback to toggle module
JPH03204786A (en) Single chip microcomputer
JP2003122600A (en) Watch dog timer device
JP2003296296A (en) Microcontroller
JP3124044B2 (en) Control processor with watchdog timer
JPS63129426A (en) Timer module for data flow type computer
CN117850563A (en) Protection circuit, electronic equipment and protection method of multi-chip system
JP2003330991A (en) Hardware modeling method
JPH06195305A (en) Bus floating preventing circuit
JPH0683985A (en) Single chip microcomputer with pwm signal output function
JP2007316961A (en) Semiconductor integrated circuit device
JP2002207531A (en) Semiconductor integrated circuit
JPH0652333A (en) Single chip microcomputer
JP2000330798A (en) Interrupt controller and method for verifying interrupt control
JPH01124035A (en) Output data control device
JP2003330575A (en) Reset device for microcomputer
JPH1153224A (en) Watch dog timer and microcomputer
JPS62162104A (en) Flow chart type programmable controller
JP2003316759A (en) Operation mode changing device
JP2005250850A (en) Semiconductor integrated circuit device
JPH02189667A (en) Control circuit for microcomputer