JPH05328734A - Microcomputer having built-in motor control circuit - Google Patents

Microcomputer having built-in motor control circuit

Info

Publication number
JPH05328734A
JPH05328734A JP4124567A JP12456792A JPH05328734A JP H05328734 A JPH05328734 A JP H05328734A JP 4124567 A JP4124567 A JP 4124567A JP 12456792 A JP12456792 A JP 12456792A JP H05328734 A JPH05328734 A JP H05328734A
Authority
JP
Japan
Prior art keywords
timer
phase
setting
output
waveform
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.)
Granted
Application number
JP4124567A
Other languages
Japanese (ja)
Other versions
JP2818986B2 (en
Inventor
Michihiro Ito
満弘 伊藤
Hideo Matsui
秀夫 松井
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP4124567A priority Critical patent/JP2818986B2/en
Publication of JPH05328734A publication Critical patent/JPH05328734A/en
Priority to US08/475,478 priority patent/US5550451A/en
Application granted granted Critical
Publication of JP2818986B2 publication Critical patent/JP2818986B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Microcomputers (AREA)
  • Control Of Ac Motors In General (AREA)
  • Inverter Devices (AREA)

Abstract

PURPOSE:To lighten the load on CPU execution processing, and to carry out control in realtime by eliminating the need for setting at every interruption while setting the interruption of a CPU at every several time by automatically inverting the start level of a PWM waveform by hardware. CONSTITUTION:When data are set previously to the reload register 15c and reload register 25d of one-shot timer 5bU at the same time at the time of an automatic mode, data are transferred alternately from each reload register 15c and 25d to the one-shot timer 5bU by a selector 5s when the content of the one-shot time 5bU reaches '0000H'. When '1' is written to the bit b5 of a waveform output mode register and the one-shot timer 5bU is operated, a three-phase waveform output mode is operated, and the content of an automatic output polarity setting flip-flop 5g is set to an output polarity setting toggle flip-flop 5k.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、主として三相インバー
タモータを制御するためのモータコントロール回路を内
蔵したマイクロコンピュータに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention mainly relates to a microcomputer incorporating a motor control circuit for controlling a three-phase inverter motor.

【0002】[0002]

【従来の技術】従来、ACモータ、主として三相インバー
タモータの制御をマイクロコンピュータを利用して行う
場合には、図17及び図18に示されているような構成が採
られていた。
2. Description of the Related Art Conventionally, in the case of controlling an AC motor, mainly a three-phase inverter motor, using a microcomputer, a configuration as shown in FIGS. 17 and 18 has been adopted.

【0003】図17は三相インバータモータ制御用の回路
構成を示すブロック図である。図17において、参照符号
501 はマイクロコンピュータを示しており、 CPU及び記
憶装置であるROM, RAM及びタイマ及びクロック発振器等
を内蔵している。なおこのマイクロコンピュータ501 は
1チップで構成することも可能である。
FIG. 17 is a block diagram showing a circuit configuration for controlling a three-phase inverter motor. In FIG. 17, reference numeral
Reference numeral 501 denotes a microcomputer, which includes a CPU, a storage device such as ROM, RAM, a timer, and a clock oscillator. It should be noted that this microcomputer 501 can also be configured with one chip.

【0004】参照符号502 は追加回路であり、上述のマ
イクロコンピュータ501 が発生するパルス幅変調(以
下、PWM:Pulse Width Modulationという) 信号からなる
PWM出力波形をインバータ出力波形に変換する。この結
果、モータの駆動制御に必要なU, #U, V, #V, W, #W (#
は反転信号を示す) の3相からなる3相インバータ波形
が得られ、これがモータドライブ信号として図示されて
いないモータに与えられる。
Reference numeral 502 denotes an additional circuit, which is composed of a pulse width modulation (hereinafter referred to as PWM) signal generated by the microcomputer 501.
Converts PWM output waveform to inverter output waveform. As a result, U, #U, V, #V, W, #W (#
Indicates an inverted signal, and a three-phase inverter waveform consisting of three phases is obtained, and this is given to a motor (not shown) as a motor drive signal.

【0005】なお実装置としては図18に示されているよ
うに、プリント基板503 上にマイクロコンピュータ501
と追加回路502 とを実装したモータコントロールユニッ
トとして利用される。
As an actual device, as shown in FIG. 18, a microcomputer 501 is mounted on a printed circuit board 503.
It is used as a motor control unit that implements and the additional circuit 502.

【0006】しかし、上述の図17に示されているような
構成を採る場合、マイクロコンピュータ以外に追加回路
を必要とし、図18に示されているようにプリント基板50
3 上に実装する場合には、実装面積が大きくなり、また
外部ノイズの影響を受け易いという問題がある。更に、
マイクロコンピュータの他に種々の部品を含む追加回路
が必要であるためコストが嵩むという問題もある。
However, when the configuration shown in FIG. 17 is adopted, an additional circuit is required in addition to the microcomputer, and the printed circuit board 50 as shown in FIG.
When mounting on top of 3, there is a problem that the mounting area becomes large and it is easily affected by external noise. Furthermore,
There is also a problem that the cost increases because an additional circuit including various components other than the microcomputer is required.

【0007】このような事情に鑑みて本願発明者らは先
に特開平3-70475号公報に開示されている発明を提案し
ている。
In view of such circumstances, the inventors of the present application have previously proposed the invention disclosed in Japanese Patent Laid-Open No. 3-70475.

【0008】この特開平3-70475号公報に開示されてい
る発明は図19のブロック図にその構成が示されているよ
うに、CPU501a, RAM501b, ROM501c,発振器501d, タイマ
501e, モータコントロール回路504 等をマイクロコンピ
ュータ501 として1チップ上に構成している。このよう
な構成を採ることにより、上述の従来例にみられたよう
な、実装面積が大きくなり、また外部ノイズの影響を受
け易いという問題の解決を図らんとしている。
The invention disclosed in Japanese Laid-Open Patent Publication No. 3-70475 has a CPU 501a, a RAM 501b, a ROM 501c, an oscillator 501d, a timer as shown in the block diagram of FIG.
501e, motor control circuit 504 and the like are configured as one microcomputer 501 on one chip. By adopting such a configuration, it is intended to solve the problems that the mounting area becomes large and that it is easily affected by external noise, as seen in the above-mentioned conventional example.

【0009】また、たとえば富士通株式会社発行「FIN
D」Vol.9 No.2 (1991年3月)にはACモータ制御用のマ
イクロコンピュータが開示されている。以下、従来例と
してこのマイクロコンピュータについて説明する。
Also, for example, "FIN" issued by Fujitsu Limited
D ”Vol. 9 No. 2 (March 1991) discloses a microcomputer for controlling an AC motor. This microcomputer will be described below as a conventional example.

【0010】図1は上述の従来例としてのマイクロコン
ピュータの構成を示すブロック図である。図1におい
て、参照符号1aはCPU(中央処理装置) を、1bはRAM を、
1cはROM を、1dは発振器を、1eは汎用ポートを、1f及び
1gは割り込み関連の制御回路を、1hはウォッチドッグタ
イマを、1iはタイマユニットを、1jは8ビットリロード
タイマを、1kは PWMタイマモジュールを、1lは A-Dコン
バータを、1mはUARTを、1nはI/O 拡張シリアルインタフ
ェイスをそれぞれ示しており、これらは内部バス1oによ
り相互に接続されていて1チップマイクロコンピュータ
として同一チップ上に構成されている。
FIG. 1 is a block diagram showing the configuration of the above-mentioned conventional microcomputer. In FIG. 1, reference numeral 1a is a CPU (central processing unit), 1b is a RAM,
1c is a ROM, 1d is an oscillator, 1e is a general-purpose port, 1f and
1g is an interrupt control circuit, 1h is a watchdog timer, 1i is a timer unit, 1j is an 8-bit reload timer, 1k is a PWM timer module, 1l is an AD converter, 1m is a UART, and 1n is The I / O expansion serial interfaces are respectively shown, and these are connected to each other by an internal bus 1o and are configured on the same chip as a one-chip microcomputer.

【0011】図2は、上述の図1中のタイマユニット1i
の構成を示すブロック図である。図2において、参照符
号2a〜2cはアウトプットコンペアレジスタ0〜3を、2f
〜2iはコンペアバッファレジスタ0〜3を、2jはタ
イマカウンタを、2kはタイマ制御レジスタを、2lはタイ
マ割り込み制御レジスタを、2mはコンペアレジスタをそ
れぞれ示している。
FIG. 2 shows the timer unit 1i shown in FIG.
3 is a block diagram showing the configuration of FIG. In FIG. 2, reference numerals 2a to 2c denote output compare registers 0 to 3 and 2f, respectively.
2i is a compare buffer register 0 to 3, 2j is a timer counter, 2k is a timer control register, 2l is a timer interrupt control register, and 2m is a compare register.

【0012】図3は、上述の図1中の8ビットリロード
タイマ1jの構成を示すブロック図である。このタイマ1j
は後述するように短絡防止タイマ(以下、デッドタイム
タイマと略)として機能する。図3において、参照符号
3aはタイマ制御レジスタを、3bはタイマデータバッファ
を、3cはフリップフロップを、3dはポート選択器を、3e
は8ビットリロードタイマをそれぞれ示している。
FIG. 3 is a block diagram showing the structure of the 8-bit reload timer 1j shown in FIG. This timer 1j
Functions as a short-circuit prevention timer (hereinafter, abbreviated as dead time timer) as described later. In FIG. 3, reference numerals
3a is a timer control register, 3b is a timer data buffer, 3c is a flip-flop, 3d is a port selector, 3e
Indicates an 8-bit reload timer.

【0013】図4は図3に示されているデッドタイムタ
イマと図2に示されているタイマユニットとを組み合わ
せたブロック図である。
FIG. 4 is a block diagram in which the dead time timer shown in FIG. 3 and the timer unit shown in FIG. 2 are combined.

【0014】図4において、タイマユニット側の参照符
号4aは16ビット構成のタイマ(図2のタイマカウンタ2j
に相当) を、4bはU相コンペアバッファ (図2のコンペ
アバッファレジスタ0 2fに相当) を、4cはV相コンペア
バッファ (図2のコンペアバッファレジスタ1 2gに相
当) を、4dはW相コンペアバッファ (図2のコンペアバ
ッファレジスタ2 2hに相当) を、4eは周期設定用コンペ
アレジスタ (図2のコンペアバッファレジスタ3 2iに相
当) を、4f〜4iはアウトプットコンペアレジスタ0〜3
(図2のアウトプットコンペアレジスタ0 2a〜3 2dに相
当) を、4jはデータバッファを、4oはコンペアレジスタ
(図2のコンペアレジスタ2mに相当) をそれぞれ示して
いる。
In FIG. 4, reference numeral 4a on the timer unit side is a 16-bit timer (timer counter 2j in FIG. 2).
4b is a U-phase compare buffer (corresponding to compare buffer register 0 2f in FIG. 2), 4c is a V-phase compare buffer (corresponding to compare buffer register 1 2g in FIG. 2), and 4d is a W-phase compare buffer. A buffer (corresponding to the compare buffer register 22h in FIG. 2), 4e is a cycle setting compare register (corresponding to the compare buffer register 32i in FIG. 2), and 4f to 4i are output compare registers 0 to 3.
(Corresponding to output compare registers 0 2a to 32d in Fig. 2), 4j is a data buffer, and 4o is a compare register.
(Corresponding to the compare register 2m in FIG. 2).

【0015】また、デッドタイムタイマ側の参照符号4k
はタイマデータバッファ (図3のタイマデータバッファ
3bに相当) を、4lはデッドタイムタイマ (図3の8ビッ
トリロードタイマに相当) を、4mはフリップフロップ
(図3の3cに相当) を、4nはポート選択器 (図3の3dに
相当) をそれぞれ示している。なお、図4において、参
照符号RTO0〜RTO5は各相の出力ポートを示している。
Reference numeral 4k on the dead time timer side
Is a timer data buffer (the timer data buffer in FIG. 3
3b), 4l a dead time timer (corresponding to the 8-bit reload timer in Figure 3), and 4m a flip-flop.
(Corresponding to 3c in FIG. 3) and 4n indicate a port selector (corresponding to 3d in FIG. 3). In FIG. 4, reference symbols RTO0 to RTO5 indicate output ports of each phase.

【0016】図13は、前述の図1中の A-Dコンバータ1l
の構成を示すブロック図である。図13において、参照符
号13a はセレクタを、 13bは A-Dモードレジスタを、 1
3cはコンパレータを、 13dは抵抗ラダーを、 13eは A-D
変換データバッファを、 13fはデコーダをそれぞれ示し
ている。
FIG. 13 shows the AD converter 1l shown in FIG.
3 is a block diagram showing the configuration of FIG. In FIG. 13, reference numeral 13a is a selector, 13b is an AD mode register, 1
3c is a comparator, 13d is a resistance ladder, 13e is AD
The conversion data buffer and the decoder 13f are shown.

【0017】次に、上述のような構成の従来のACモータ
制御用マイクロコンピュータの動作について説明する。
Next, the operation of the conventional AC motor control microcomputer having the above-mentioned configuration will be described.

【0018】まず最初に周期設定用コンペアレジスタ4e
(コンペアバッファレジスタ3 2i)に PWM周期が設定さ
れる。周期設定用コンペアレジスタ4e (コンペアバッフ
ァレジスタ3 2i) に設定された内容は、タイマ4a (タイ
マカウンタ2j) の内容が”0000H ”(Hは16進数を表す)
になるとアウトプットコンペアレジスタ3 4i (アウトプ
ットコンペアレジスタ3 2d) に転送される。また同時
に、タイマ4a (タイマカウンタ2j) の内容が”0000H ”
になるとCPU 1aに割り込みを発生させ、その割り込み処
理により周期設定用コンペアレジスタ4e (コンペアバッ
ファレジスタ32i) のデータが更新される。
First, the cycle setting compare register 4e
The PWM cycle is set in (compare buffer register 3 2i). The content set in the cycle setting compare register 4e (compare buffer register 3 2i) is the content of the timer 4a (timer counter 2j) is "0000H" (H represents a hexadecimal number).
Then, it is transferred to the output compare register 3 4i (output compare register 3 2d). At the same time, the content of timer 4a (timer counter 2j) is "0000H".
Then, an interrupt is generated in CPU 1a, and the interrupt processing updates the data in cycle setting compare register 4e (compare buffer register 32i).

【0019】一方、U相コンペアバッファ4b (コンペア
バッファレジスタ0 2f) には PWMの波形の変化タイミン
グが設定される。U相コンペアバッファ4b (コンペアバ
ッファレジスタ0 2f) に設定された内容は、タイマ4a
(タイマカウンタ2j) の内容が”0000H ”になるとアウ
トプットコンペアレジスタ3 4i (アウトプットコンペア
レジスタ0 2a) に転送されて保持される。そして、タイ
マ4a (タイマカウンタ2j) の値と、アウトプットコンペ
アレジスタ3 4i (アウトプットコンペアレジスタ0 2a)
が保持している値とが同一値になると、対応したポー
ト、この場合にはU相及び#U相用の出力ポートRTO0及び
RTO3の出力レベルが反転する。
On the other hand, the change timing of the PWM waveform is set in the U-phase compare buffer 4b (compare buffer register 02f). The contents set in the U-phase compare buffer 4b (compare buffer register 0 2f) are stored in timer 4a.
When the content of (timer counter 2j) reaches "0000H", it is transferred to and held in output compare register 3 4i (output compare register 0 2a). Then, the value of timer 4a (timer counter 2j) and output compare register 3 4i (output compare register 0 2a)
When the value held by is the same value, the corresponding port, in this case the output ports RTO0 and
The output level of RTO3 is inverted.

【0020】これらのコンペアバッファレジスタ等が使
用するデータは、マイクロコンピュータに内蔵されてい
る A-Dコンバータ1l, 計測用タイマ (タイマユニット1i
等)で得られるデータが用いられることが多い。A−D
コンバータ1lは、外部からのアナログ入力値をデジタル
値に変換してコンペアバッファレジスタ2f, 2g, 2h, 2i
等のレジスタ値の比較データ又はレジスタ値を求めるた
めの演算データ等に用いられる。
The data used by these compare buffer registers and the like are the AD converter 1l and the measurement timer (timer unit 1i) built in the microcomputer.
Etc.) is often used. A-D
The converter 1l converts the analog input value from the outside into a digital value and compares it with the compare buffer registers 2f, 2g, 2h, 2i.
It is used for comparison data of register values such as, or calculation data for obtaining register values.

【0021】従来の A-Dコンバータの動作としては、図
13に示されているように、アナログ入力端子AN0 〜AN4
の5入力の A-D変換を行う場合、アナログ入力情報に対
してサンプリング周期は必要頻度に関係なく図11の模式
図に示されているように、アナログ入力端子AN0 〜AN4
を均等に反復して順番にサンプリングしていた。
The operation of the conventional AD converter is shown in FIG.
As shown in 13, analog input pins AN0 to AN4
When performing AD conversion of 5 inputs, analog input terminals AN0 to AN4 are used as shown in the schematic diagram of FIG. 11 regardless of the required sampling cycle for analog input information.
Were repeatedly repeated evenly and sampled in order.

【0022】[0022]

【発明が解決しようとする課題】従来のモータコントロ
ール回路内蔵マイクロコンピュータは以上のように構成
されているため、 PWM出力波形のスタートレベルの内容
を周期毎に任意に変化させたい場合及びタイマデータ又
はクロックの周波数等の変更を行いたい場合には、通常
はCPU 上で実行しているプログラムの割り込みで変数を
書き換える必要がある。従って、これらのデータを書き
換えた場合には CPUの負担が大きくなる。また、高周波
数のインバータ波形をコントロールする場合、 CPUの処
理速度が追いつかず、データの更新がリアルタイムにで
きなくなるという事態が発生する虞がある。
Since the conventional microcomputer with a built-in motor control circuit is configured as described above, it is necessary to arbitrarily change the contents of the start level of the PWM output waveform for each cycle, and the timer data or If you want to change the frequency of the clock, you usually have to rewrite the variables by interrupting the program running on the CPU. Therefore, if these data are rewritten, the load on the CPU will increase. Further, when controlling a high-frequency inverter waveform, there is a possibility that the processing speed of the CPU cannot keep up with the situation and the data cannot be updated in real time.

【0023】また、従来のモータコントロール回路内蔵
マイクロコンピュータに使用されている A-Dコンバータ
では、アナログ入力情報それぞれに対してサンプリング
周期を必要頻度に応じて変化させるような操作は行われ
ておらず、このため不必要なサンプリングが介在して A
-D変換のサンプリング時間が全体的に長くなっている。
このようにして得られた A-D変換値を PWM出力データ等
に用いる場合、 A-D変換のサンプリング周期は使用頻度
に関係なく一定であるため、データの更新が間に合わな
くなる虞もある。
Further, in the AD converter used in the conventional microcomputer with a built-in motor control circuit, the operation of changing the sampling cycle for each analog input information according to the required frequency is not performed. Because of unnecessary sampling, A
-The sampling time for D conversion is longer overall.
When the AD conversion value obtained in this way is used for PWM output data or the like, the AD conversion sampling cycle is constant regardless of the frequency of use, and therefore there is a risk that the data may not be updated in time.

【0024】本発明は上述のような問題点に鑑みてなさ
れたものであり、 PWM出力波形のスタートレベルの内容
を周期毎に反転させる場合、それに必要な変数を CPU上
で実行しているプログラムで設定することにより、自動
的にスタートレベルの内容が周期毎に反転されるように
し、割り込み毎の設定を不必要とすることを目的として
いる。更に、タイマデータ又はクロックの周波数等の変
更を行う場合、通常はCPU上で実行しているプログラム
の割り込み処理により変数を書き換えているが、これら
の割り込み処理の都度行われているデータの書き換えを
1度おきにすることを可能としたモータコントロール回
路内蔵マイクロコンピュータの提供を目的とする。
The present invention has been made in view of the above problems, and in the case of inverting the contents of the start level of the PWM output waveform for each cycle, a program executing the necessary variables on the CPU The setting is made so that the contents of the start level are automatically inverted every cycle and the setting for each interrupt is unnecessary. Furthermore, when changing timer data or clock frequency, variables are usually rewritten by interrupt processing of the program running on the CPU, but data rewriting performed each time these interrupt processing are performed. An object of the present invention is to provide a microcomputer with a built-in motor control circuit that can be set every other time.

【0025】また、応用例を考慮した場合、逆に割り込
み処理により上述のデータを書き換える必要がない場合
もあるが、このような場合についても制御可能なように
割り込みタイミングコントロールができるモータコント
ロール回路内蔵マイクロコンピュータの提供をも目的と
している。
In consideration of the application example, on the contrary, there is a case where it is not necessary to rewrite the above-mentioned data by interrupt processing, but in such a case, a motor control circuit having an interrupt timing control capable of controlling is also built-in. It also aims to provide a microcomputer.

【0026】また更に、 A-Dコンバータでは、アナログ
入力情報に対してサンプリング周期を各情報の必要頻度
に応じて変化させることが可能なモータコントロール回
路内蔵マイクロコンピュータの提供を目的とする。
Further, it is another object of the present invention to provide a microcomputer with a built-in motor control circuit capable of changing the sampling cycle of analog input information according to the required frequency of each information.

【0027】[0027]

【課題を解決するための手段】本発明に係るモータコン
トロール回路内蔵マイクロコンピュータは、 PWM出力の
スタートレベルを自動的に反転するか又は任意の設定パ
ターンによってスタートレベルを変化させることが可能
な PWM発生回路と、割り込みのタイミングをコントロー
ルするための割り込み要求コントロール回路と、多機能
リロードレジスタを追加機能として構成してある。
A microcomputer with a built-in motor control circuit according to the present invention is capable of automatically inverting the start level of a PWM output or changing the start level according to an arbitrary setting pattern. A circuit, an interrupt request control circuit for controlling the timing of interrupts, and a multifunction reload register are configured as additional functions.

【0028】また、 A-Dコンバータでは、アナログ入力
情報に対してサンプリング周期を複数種類に設定するこ
とができるよう構成してある。
Further, the AD converter is constructed so that a plurality of sampling periods can be set for the analog input information.

【0029】更に、DMAC (ダイレクトメモリアクセスコ
ントローラ) を追加することにより、割り込み時のタイ
マデータ設定にかかっていたCPU の負荷をゼロにできる
よう構成してある。
Further, by adding a DMAC (Direct Memory Access Controller), the load on the CPU, which was required to set the timer data at the time of interruption, can be reduced to zero.

【0030】[0030]

【作用】本発明のモータコントロール回路内蔵マイクロ
コンピュータでは、モータ制御信号の各相に対するタイ
マの立ち上がり生成手段がクロック発生手段からのクロ
ックにより立ち上がりパルスを出力し、この立ち上がり
パルスに基づいて3つの三相インバータ波形発生タイマ
が出力を生成する。次に、 CPUにより所定の値が設定さ
れたレジスタが三相インバータ波形発生タイマのスター
トレベルを決定し、立ち上がりパルスとスタートレベル
との論理積からスタートレベル設定信号が得られ、この
スタートレベル設定信号と各出力パルスとからフリップ
フロップ回路により三相インバータ波形が生成される。
この際、スタートレベルは立ち上がりパルス毎に反転さ
れる。
In the microcomputer with a built-in motor control circuit according to the present invention, the rise generation means of the timer for each phase of the motor control signal outputs a rise pulse in response to the clock from the clock generation means, and based on this rise pulse, three three-phase An inverter waveform generation timer produces an output. Next, the register set with a predetermined value by the CPU determines the start level of the three-phase inverter waveform generation timer, and the start level setting signal is obtained from the logical product of the rising pulse and the start level. And a three-phase inverter waveform is generated by the flip-flop circuit from each output pulse.
At this time, the start level is inverted every rising pulse.

【0031】また本発明における三相インバータモータ
コントローラを内蔵したマイクロコンピュータでは、立
ち上がり生成手段がクロック発生手段からのクロックに
よって立ち上がりパルスを出力する際に割り込みを発生
するが、この割り込みを発生する際に割り込みの発生を
立ち上がりパルス毎, 1回おき, 3回おきというように
タイミングを制御する。
In the microcomputer incorporating the three-phase inverter motor controller according to the present invention, an interrupt is generated when the rising generation means outputs a rising pulse by the clock from the clock generation means. The timing is controlled such that the interrupt is generated once every rising pulse and every three times.

【0032】更に、三相インバータPWM 波形の三角波変
調時のデータ設定を行う場合、三相インバータPWM 波形
の周期はマイクロコンピュータのPWM の2周期に相当す
る。この場合、三相インバータPWM 波形の三角波変調時
に対応するマイクロコンピュータのPWM データは1周期
目のデータと2周期目のデータがPWM 周期に対して対象
になるように設定される。例えば、三相インバータPWM
波形の三角波変調時の周期が100 であればマイクロコン
ピュータのPWM 周期は50とされ、1周期目のPWM データ
に10が設定されれば2周期目のPWM データは40が設定さ
れる。
Further, when data is set during triangular wave modulation of the three-phase inverter PWM waveform, the cycle of the three-phase inverter PWM waveform corresponds to two PWM cycles of the microcomputer. In this case, the PWM data of the microcomputer corresponding to the triangular wave modulation of the three-phase inverter PWM waveform is set so that the data of the first cycle and the data of the second cycle are the target for the PWM cycle. For example, three-phase inverter PWM
If the period of the triangular wave modulation of the waveform is 100, the PWM period of the microcomputer is 50, and if the PWM data of the first period is set to 10, the PWM data of the second period is set to 40.

【0033】このような手法が必要な PWM波形を出力す
るためのタイマデータ等の変更を行う場合、従来はデー
タの更新を一度の割り込み処理では次周期のデータのみ
が設定されていたが、本発明のモータコントロール回路
内蔵マイクロコンピュータでは、リロードレジスタの追
加により一度の割り込み処理で同時に2周期分のデータ
が設定可能になる。また、設定されたデータの反転機能
を追加することにより、一度のデータ設定で周期に対し
対象のデータを設定することができる。
In the case of changing the timer data or the like for outputting the PWM waveform which requires such a method, conventionally, only the data of the next cycle was set in one interrupt process for updating the data. In the microcomputer with a built-in motor control circuit according to the present invention, by adding a reload register, data for two cycles can be set at the same time by one interrupt processing. Further, by adding the function of inverting the set data, it is possible to set the target data for the cycle with one data setting.

【0034】また、1周期目のデータを設定することに
より、リロードレジスタを用いてPWM 周期データから1
周期目のデータを減算して2周期目のデータを算出する
回路を追加することにより、周期に対し対象のデータを
一度に設定することができる。
By setting the data of the first cycle, the reload register is used to change the PWM cycle data to 1
By adding a circuit that subtracts the data of the second cycle and calculates the data of the second cycle, the target data can be set at once for the cycle.

【0035】更に本発明のモータコントロール回路内蔵
マイクロコンピュータの A-Dコンバータでは、アナログ
入力情報に対してサンプリング周期を複数種類に対応さ
せることが可能なようにセレクタとデコーダが改良され
ている。このため、デコーダは、レジスタにより設定さ
れた2種類のサンプリング周期でアナログ入力端子をセ
レクトするので、例えば、アナログ入力端子AN0, AN1
は、使用頻度が高く、アナログ入力端子AN3 〜AN4 は使
用頻度が低いアナログ入力端子AN0 〜AN4 の A-D変換を
行う場合、アナログ入力端子AN0 〜AN4 を図12の模式図
に示されているような順番で A-D変換を行うことができ
る。
Further, in the AD converter of the microcomputer with a built-in motor control circuit according to the present invention, the selector and the decoder are improved so that the analog input information can correspond to a plurality of sampling periods. Therefore, the decoder selects the analog input terminal at two kinds of sampling periods set by the register, and therefore, for example, the analog input terminals AN0, AN1
Is used frequently, and analog input terminals AN3 to AN4 are used less frequently.When performing AD conversion of analog input terminals AN0 to AN4, analog input terminals AN0 to AN4 are as shown in the schematic diagram of Fig. 12. AD conversion can be performed in order.

【0036】[0036]

【実施例】以下、本発明をその実施例を示す図面に基づ
いて詳述する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention will be described below in detail with reference to the drawings showing the embodiments.

【0037】まず、本発明のモータコントロール回路内
蔵マイクロコンピュータの一実施例の三相インバータの
PWM波形の出力動作を図5を参照して説明する。なお、
図5は本発明のモータコントロール回路内蔵マイクロコ
ンピュータの要部である三相波形発生回路の構成を示す
ブロック図である。
First, the three-phase inverter of one embodiment of the microcomputer with built-in motor control circuit of the present invention will be described.
The output operation of the PWM waveform will be described with reference to FIG. In addition,
FIG. 5 is a block diagram showing a configuration of a three-phase waveform generating circuit which is a main part of the motor control circuit built-in microcomputer of the present invention.

【0038】図5において、参照符号5UはU相波形を発
生するためのU相ブロックを、5VはV相波形を発生する
ためのV相ブロックを、5WはW相波形を発生するための
W相ブロックをそれぞれ示しており、基本的にはいずれ
も同一の構成を有している。このため、図5にはU相ブ
ロック5Uのみその具体的な内部構成を示してある。
In FIG. 5, reference numeral 5U is a U phase block for generating a U phase waveform, 5V is a V phase block for generating a V phase waveform, and 5W is a W for generating a W phase waveform. Each of the phase blocks is shown, and basically all have the same configuration. Therefore, in FIG. 5, only the U-phase block 5U is shown with its specific internal structure.

【0039】図5において、参照符号5aは周期設定用タ
イマを、 5bUは周期設定用タイマ5aから出力される信号
をトリガとしてパルスを出力するU相用のワンショット
タイマをそれぞれ示している。なお、V相ブロック5V及
びW相ブロック5WにはU相用のワンショットタイマ5bU
と同一構成のV相用のワンショットタイマ5bV 及びW相
用のワンショットタイマ5bW がそれぞれ備えられてい
る。
In FIG. 5, reference numeral 5a indicates a period setting timer, and 5bU indicates a U-phase one-shot timer which outputs a pulse using a signal output from the period setting timer 5a as a trigger. The V-phase block 5V and the W-phase block 5W have a one-shot timer 5bU for the U-phase.
A one-shot timer 5bV for V-phase and a one-shot timer 5bW for W-phase having the same structure as the above are respectively provided.

【0040】また、参照符号5cはワンショットタイマ5b
U 用のリロードレジスタ1を、5dはワンショットタイマ
5bU 用のリロードレジスタ2をそれぞれ示している。参
照符号5eは割り込み有効極性設定用のフリップフロップ
であり、そのD-入力端子には割り込み有効極性ビットが
入力される。5fは割り込み間隔設定用のフリップフロッ
プであり、そのD-入力端子には割り込み間隔設定ビット
が入力される。5gは出力極性選択用のフリップフロップ
であり、そのD-入力端子には出力極性選択ビットが入力
される。5hは自動三相モード設定用のフリップフロップ
であり、そのD-入力端子には自動三相モード設定ビット
が入力される。
Reference numeral 5c is a one-shot timer 5b.
Reload register 1 for U, 5d one shot timer
The reload register 2 for 5bU is shown respectively. Reference numeral 5e is a flip-flop for setting an interrupt valid polarity, and an interrupt valid polarity bit is input to its D-input terminal. Reference numeral 5f is a flip-flop for setting an interrupt interval, and an interrupt interval setting bit is input to its D- input terminal. 5g is a flip-flop for output polarity selection, and the output polarity selection bit is input to its D-input terminal. 5h is a flip-flop for automatic three-phase mode setting, and the automatic three-phase mode setting bit is input to its D-input terminal.

【0041】参照符号5iは出力極性設定フリップフロッ
プを、5jは出力極性セレクタを、5kは出力極性設定用ト
グルフリップフロップを、5lは短絡防止時間設定タイマ
用リロードレジスタを、5mは短絡防止時間設定タイマ
(デッドタイムタイマ) を、5nはデッドタイムフリップ
フロップを、 5o1及び5o2 は論理回路を、 5p1及び5p2
は出力バッファを、5qは”H”レベル出力設定用フリッ
プフロップを、5rは出力バッファ制御フリップフロップ
を、5sは両リロードレジスタ5cと5dとをワンショットタ
イマ5bU に選択的に接続するセレクタをそれぞれ示して
いる。
Reference numeral 5i is an output polarity setting flip-flop, 5j is an output polarity selector, 5k is an output polarity setting toggle flip-flop, 5l is a short circuit prevention time setting timer reload register, and 5m is a short circuit prevention time setting. Timer
(Dead time timer), 5n a dead time flip-flop, 5o1 and 5o2 a logic circuit, 5p1 and 5p2
Is an output buffer, 5q is an "H" level output setting flip-flop, 5r is an output buffer control flip-flop, and 5s is a selector for selectively connecting both reload registers 5c and 5d to the one-shot timer 5bU. Shows.

【0042】図6は波形出力モードレジスタのビット構
成を示す模式図である。
FIG. 6 is a schematic diagram showing the bit configuration of the waveform output mode register.

【0043】この波形出力モードレジスタはビットb0〜
b7までの8ビット構成であり、三相波形モードではビッ
トb2, b1, b0の3ビットが”100 ”に設定される。そし
て、ビットb3はフリップフロップ5gに自動出力極性選択
ビットの初期値として与えられる。具体的には、このビ
ットb3が”0”であれば正極性が、”1”であれば負極
性がそれぞれ設定される。ビットb4はフリップフロップ
5hに自動三相モード選択ビットの設定値として与えられ
る。具体的には、ビットb4が”0”であれば三相モード
が、”1”であれば自動モードがそれぞれ設定される。
This waveform output mode register has bits b0 ...
It has an 8-bit structure up to b7, and in the three-phase waveform mode, the three bits b2, b1, and b0 are set to "100". Then, the bit b3 is given to the flip-flop 5g as the initial value of the automatic output polarity selection bit. Specifically, if the bit b3 is "0", the positive polarity is set, and if the bit b3 is "1", the negative polarity is set. Bit b4 is a flip-flop
It is given to 5h as the setting value of the automatic three-phase mode selection bit. Specifically, if the bit b4 is "0", the three-phase mode is set, and if the bit b4 is "1", the automatic mode is set.

【0044】ビットb6は短絡防止時間設定タイマ5mのト
リガを設定する。具体的には、ビットb6が”0”であれ
ば各相ブロック5U, 5V, 5Wのワンショトタイマ5bU, 5b
V, 5bW のワンショットパルスの両エッジが、”1”で
あれば、各ワンショトタイマ5bU, 5bV, 5bW のワンショ
トパルスの立下がりエッジがそれぞれ選択される。更
に、ビットb7は出力バッファ制御用のフリップフロップ
5rの出力の初期値を設定する。具体的には、ビットb7
が”0”であれば出力バッファ制御用フリップフロップ
5rからの波形出力が禁止され、”1”であれば許可され
る。
Bit b6 sets the trigger of short-circuit prevention time setting timer 5m. Specifically, if bit b6 is "0", each phase block 5U, 5V, 5W one-shot timer 5bU, 5b
If both edges of the V, 5bW one-shot pulse are "1", the falling edge of each one-shot timer 5bU, 5bV, 5bW one-shot pulse is selected. Further, bit b7 is a flip-flop for controlling the output buffer.
Set the initial value of 5r output. Specifically, bit b7
If is "0", output buffer control flip-flop
Waveform output from 5r is prohibited, and if "1", it is permitted.

【0045】このような波形出力モードレジスタにより
各相用のワンショトタイマ5bU, 5bV, 5bW 及び周期設定
用タイマ5aの4つのタイマを使用する三相波形モードを
選択する。なお、ビットb5は未定義である。
With such a waveform output mode register, the three-phase waveform mode using four timers of the one-shot timers 5bU, 5bV, 5bW for each phase and the period setting timer 5a is selected. The bit b5 is undefined.

【0046】また、上述の波形出力モードレジスタによ
り選択される三相波形出力モードでは、図7の模式図に
示されているようにタイマモードレジスタが設定され
る。即ち、図7(a) に示されているように、各ワンショ
トタイマ5bU, 5bV, 5bW はワンショットパルスモードの
外部トリガ、立ち上がりエッジ有効の状態に、図7(b)
に示されているように、周期設定用タイマ5aはタイマモ
ードにそれぞれのタイマモードレジスタで設定する。
In the three-phase waveform output mode selected by the above waveform output mode register, the timer mode register is set as shown in the schematic view of FIG. That is, as shown in Fig. 7 (a), each one-shot timer 5bU, 5bV, 5bW is set to the external trigger of the one-shot pulse mode, the rising edge is valid,
As shown in, the period setting timer 5a sets the timer mode in the respective timer mode registers.

【0047】図5のブロック図に示されている構成の回
路では、三相波形出力モードにおいては正相波形(U
相, V相, W相)及び逆相波形(#U相, #V相, #W相)の
6つの波形がU相ブロック5UのポートP55 ,P54 ,V相
ブロック5VのP53 ,P52 ,W相ブロック5WのP51 ,P50
から”L”レベルアクティブで出力される。
In the circuit having the configuration shown in the block diagram of FIG. 5, the positive phase waveform (U
Phase, V-phase, W-phase) and reverse-phase waveform (#U phase, #V phase, port P5 5 6 of waveforms of the U-phase block 5U #W phase), P5 4, V-phase block 5V of P5 3, P5 2 , W-phase block 5W P5 1 , P5 0
From "L" level active.

【0048】この三相波形出力モードで使用されるタイ
マの内、ワンショトタイマ5bU はU相, #U相の波形を、
ワンショトタイマ5bV はV相, #V相の波形を、ワンショ
トタイマ5bW はW相, #W相の波形をそれぞれ制御し、周
期設定用タイマ5aによりこれらの各ワンショトタイマ5b
U, 5bV, 5bW のワンショットパルス出力の周期が制御さ
れる。
Of the timers used in this three-phase waveform output mode, the one-shot timer 5bU has U-phase and # U-phase waveforms,
The one-shot timer 5bV controls the V-phase and # V-phase waveforms, and the one-shot timer 5bW controls the W-phase and # W-phase waveforms. The period setting timer 5a controls each of these one-shot timers 5b.
The cycle of U, 5bV, 5bW one-shot pulse output is controlled.

【0049】波形出力においては、三相波形出力 (U
相, V相, W相) の”L”レベルがその逆相波形出力
(#U相, #V相, #W相) の”L”レベルと重ならないよう
にするための短絡防止時間が設定される。この短絡防止
時間の設定はリロードレジスタ5lを共用して各相ブロッ
クにそれぞれ備えられている8ビット構成の短絡防止時
間設定タイマ3本で行う (図5にはU相ブロック5Uの短
絡防止時間設定タイマ5mのみ示されているが、V相ブロ
ック5V及びW相ブロック5Wにもそれぞれ短絡防止時間設
定タイマ5mと同様の短絡防止時間設定タイマが備えられ
ている) 。なおこの短絡防止時間設定タイマ5mはワンシ
ョットタイマとして動作する。
In the waveform output, the three-phase waveform output (U
Phase, V phase, W phase) "L" level is the opposite phase waveform output
The short circuit prevention time is set so that it does not overlap with the "L" level of (#U phase, #V phase, #W phase). This short-circuit prevention time is set by three 8-bit short-circuit prevention time setting timers, which are provided in each phase block and share the reload register 5l (see Fig. 5, short-circuit prevention time setting for U-phase block 5U). Although only the timer 5m is shown, the V-phase block 5V and the W-phase block 5W are each provided with a short circuit prevention time setting timer similar to the short circuit prevention time setting timer 5m). The short-circuit prevention time setting timer 5m operates as a one-shot timer.

【0050】開始トリガにはワンショトタイマ5bU, 5b
V, 5bW のワンショットパルスの立ち上がり, 立ち下が
りの両エッジか、または立ち下がりエッジのみのいずれ
かが選択可能である。この選択は前述の図6に示されて
いるように、波形出力モードレジスタのビットb6で行わ
れ、このビットb6が”0”であれば立ち上がり,立ち下
がりの両エッジで、”1”であれば立ち下がりエッジの
みがそれぞれ開始トリガになる。
One-shot timers 5bU, 5b are used as start triggers.
Either the rising or falling edge of the V, 5bW one-shot pulse, or only the falling edge can be selected. This selection is performed by the bit b6 of the waveform output mode register as shown in FIG. 6 described above. If this bit b6 is "0", it is "1" at both the rising and falling edges. For example, only the falling edge becomes the start trigger.

【0051】短絡防止時間設定タイマ5mは、図8に示さ
れているように、パルス出力データレジスタ0のビット
b6,b7でカウントソースが設定される。ビットb6, b7
が”00”であればf2 (源発振の2分周クロック)
が、”01”であればf4 (源発振の4分周クロック)
が、”10”であればf8 (源発振の8分周クロック)が
それぞれ選択される。
The short-circuit prevention time setting timer 5m is, as shown in FIG. 8, a bit of the pulse output data register 0.
The count source is set by b6 and b7. Bits b6, b7
If is "00", f 2 (source oscillation divided by 2 clock)
Is "01", f 4 (source oscillation divided by 4 clock)
But if "10" f 8 (8-divided clock of the source oscillation) is selected respectively.

【0052】短絡防止時間設定タイマ5mに値を書き込む
と、各相ブロック5U(5V, 5W)の短絡防止時間設定タイマ
5m等が共有しているリロードレジスタ5lにその値が書き
込まれる。短絡防止時間設定タイマ5m等はそれぞれのブ
ロック5U, 5V, 5W内のワンショトタイマ5bU(5bV, 5bW)
から開始トリガが与えられるとリロードレジスタ5lが保
持している値を内蔵しているカウンタにロードし、タイ
マモードレジスタで設定されているカウントソースによ
りダウンカウントを行う。
When a value is written to the short circuit prevention time setting timer 5m, the short circuit prevention time setting timer for each phase block 5U (5V, 5W)
The value is written in the reload register 5l shared by 5m and the like. Short-circuit prevention time setting timer 5m etc. is for each block 5U, 5V, 5W one-shot timer 5bU (5bV, 5bW)
When a start trigger is given from, the value held in the reload register 5l is loaded into the built-in counter, and down counting is performed by the count source set in the timer mode register.

【0053】また、各短絡防止時間設定タイマ5m等は前
回のトリガによる動作が完了する前に再度トリガを受け
付けることもできる。この場合は、トリガによりリロー
ドレジスタ5lの内容が短絡防止時間設定タイマ5mに転送
された後、その値がダウンカウントされる。短絡防止時
間設定タイマ5mはワンショットパルスタイマとして動作
するため、トリガが与えられるとパルス出力及びダウン
カウントを開始し、その内容が”00H ”になるとパルス
出力を終了して動作を停止し、次のトリガが与えられる
まで待機状態になる。
Further, each short-circuit prevention time setting timer 5m or the like can accept a trigger again before the operation by the previous trigger is completed. In this case, the trigger transfers the contents of the reload register 5l to the short-circuit prevention time setting timer 5m, and then the value is down-counted. The short-circuit prevention time setting timer 5m operates as a one-shot pulse timer. Therefore, when a trigger is given, it starts pulse output and down count, and when the content becomes "00H", it stops pulse output and stops operation. Wait until the trigger is given.

【0054】三相波形の出力極性は出力極性設定トグル
フリップフロップ5kによって決定される。出力極性設定
トグルフリップフロップ5kの内容が”0”である場合は
三相波形の正相波形は”H”レベルを出力し、”1”で
ある場合は”L”レベルを出力する (三相波形出力は負
論理で出力される) 。出力極性設定トグルフリップフロ
ップ5kはそれぞれ図8に示されるU相, V相, W相に対
応した出力極性設定バッファを有しており、周期設定用
タイマ5aのカウンタの内容が”0000H ”になった時点で
出力極性設定バッファの内容が出力極性設定トグルフリ
ップフロップ5kにセットされる。
The output polarity of the three-phase waveform is determined by the output polarity setting toggle flip-flop 5k. When the content of the output polarity setting toggle flip-flop 5k is "0", the positive phase waveform of the three-phase waveform outputs "H" level, and when it is "1", the "L" level is output (three-phase) The waveform output is output in negative logic). The output polarity setting toggle flip-flop 5k has output polarity setting buffers corresponding to the U phase, V phase and W phase shown in FIG. 8, respectively, and the content of the counter of the cycle setting timer 5a becomes "0000H". At that time, the contents of the output polarity setting buffer are set in the output polarity setting toggle flip-flop 5k.

【0055】また、図6に示されている波形出力モード
レジスタのビットb4(自動三相モード選択ビット)の内
容を”1”にすると自動モードが設定される。この場合
には、図8に示されているU相, V相, W相に対応した
出力極性設定バッファは無効となり、パルス出力データ
レジスタ1,0は図9に示されているようなビット構成
になる。
The automatic mode is set by setting the content of the bit b4 (automatic three-phase mode selection bit) of the waveform output mode register shown in FIG. 6 to "1". In this case, the output polarity setting buffers corresponding to the U phase, V phase, and W phase shown in FIG. 8 are invalidated, and the pulse output data registers 1 and 0 have the bit configurations shown in FIG. become.

【0056】自動モードが設定されている場合は、周期
設定用タイマ5aのカウンタの内容が”0000H ”になった
時点で図6に示されている波形出力モードレジスタのビ
ットb3の自動出力極性設定フリップフロップ5gの内容が
反転し、反転した自動出力極性設定フリップフロップ5g
の内容が各U相, V相, W相に対応した出力極性設定ト
グルフリップフロップ5kにセットされる。その後、出力
極性設定トグルフリップフロップ5kの内容は、各相のブ
ロック5U, 5V, 5Wに対応したタイマ(ワンショトタイマ
5bU, 5bV, 5bW)のワンショットパルスの終了の都度、そ
の極性が反転する。
When the automatic mode is set, the automatic output polarity setting of bit b3 of the waveform output mode register shown in FIG. 6 is set when the content of the counter of the cycle setting timer 5a becomes "0000H". The contents of the flip-flop 5g are inverted, and the inverted automatic output polarity setting flip-flop 5g
Is set in the output polarity setting toggle flip-flop 5k corresponding to each U-phase, V-phase and W-phase. After that, the contents of the output polarity setting toggle flip-flop 5k is the timer (one shot timer) corresponding to the blocks 5U, 5V, 5W of each phase.
Each time the one-shot pulse of (5bU, 5bV, 5bW) ends, its polarity is inverted.

【0057】次に自動モード時のU相波形出力の一例を
示す図10の波形図を参照して波形出力動作を説明する。
Next, the waveform output operation will be described with reference to the waveform diagram of FIG. 10 showing an example of the U-phase waveform output in the automatic mode.

【0058】自動モード時には、図10(c) 及び図10(d)
に示されているように、ワンショットタイマ5bU のリロ
ードレジスタ1 5c とリロードレジスタ2 5d とにデー
タを同時に設定しておくことにより、ワンショットタイ
マ5bU の内容が”0000H ”になるとセレクタ5sにより各
リロードレジスタ1 5c と2 5d とから交互にワンショ
ットタイマ5bU へデータを転送することができる。
In the automatic mode, FIG. 10 (c) and FIG. 10 (d)
As shown in, when data is set in the reload register 1 5c and reload register 2 5d of the one-shot timer 5bU at the same time, when the content of the one-shot timer 5bU becomes "0000H", each one is selected by the selector 5s. Data can be alternately transferred from the reload registers 1 5c and 2 5d to the one-shot timer 5bU.

【0059】波形出力モードレジスタのビットb5に”
1”を書き込み、ワンショットタイマ5bU を動作させる
と、三相波形出力モードが動作する。図10(a) 及び図10
(b) に示されているように、ワンショットタイマ5bU の
カウンタの内容が”0000H ”になるとワンショットタイ
マ5bU のレジスタの内容がワンショットタイマ5bU に転
送されてワンショットパルス出力を開始する。この時点
で、図10(e) 及び図10(f) に示されているように、出力
極性設定トグルフリップフロップ5kに自動出力極性設定
フリップフロップ5gの内容(この場合”0”)が設定さ
れる。
Set to bit b5 of the waveform output mode register
Writing "1" and operating the one-shot timer 5bU activates the three-phase waveform output mode. Fig. 10 (a) and Fig. 10
As shown in (b), when the content of the one-shot timer 5bU counter reaches “0000H”, the content of the one-shot timer 5bU register is transferred to the one-shot timer 5bU and starts one-shot pulse output. At this point, as shown in FIGS. 10 (e) and 10 (f), the contents of the automatic output polarity setting flip-flop 5g (in this case, "0") are set in the output polarity setting toggle flip-flop 5k. It

【0060】ワンショットタイマ5bU のワンショットパ
ルス出力が終了すると、図10(f) に示されているよう
に、出力極性設定トグルフリップフロップ5kの内容が”
0”から”1”に反転すると同時に、図10(g) に示され
ているように、U相波形とその逆相である#U相波形と
の”L”レベルが重ならない時間を設定する8ビットの
短絡防止時間設定タイマ (デッドタイムタイマ)5m のワ
ンショットパルスが出力される。
When the one-shot pulse output from the one-shot timer 5bU is completed, the contents of the output polarity setting toggle flip-flop 5k are changed to "" as shown in FIG. 10 (f).
At the same time as inverting from “0” to “1”, as shown in FIG. 10 (g), the time when the “L” level of the U-phase waveform and its opposite phase, the # U-phase waveform, does not overlap is set. 8-bit short-circuit prevention time setting timer (dead time timer) One-shot pulse of 5 m is output.

【0061】この場合、図10(h) に示されているよう
に、”H”レベルから開始したU相波形の出力はワンシ
ョットタイマ5bU のワンショットパルス出力により出力
極性設定トグルフリップフロップ5kの内容が”0”か
ら”1”に反転しても、短絡防止時間設定タイマ5mのワ
ンショットパルス出力が終わるまでは”H”レベルを出
力する。
In this case, as shown in FIG. 10 (h), the output of the U-phase waveform started from the "H" level is output by the one-shot pulse output of the one-shot timer 5bU to the output polarity setting toggle flip-flop 5k. Even if the content is inverted from "0" to "1", "H" level is output until the short-circuit prevention time setting timer 5m outputs the one-shot pulse.

【0062】短絡防止時間設定タイマ5mのワンショット
パルスが終了すると、すでに反転した出力極性設定トグ
ルフリップフロップ5kの出力”1”が有効となり、U相
波形は”L”レベルに転じる。その後、ワンショットタ
イマ5bU のカウンタの内容が”0000H ”になると、ワン
ショットタイマ5bU のリロードレジスタ2 5d の内容が
ワンショットタイマ5bU に転送されてワンショットパル
ス出力が開始される。同時に、自動出力極性設定フリッ
プフロップ5gの内容が反転し (この場合”1”) 、 反
転した内容が出力極性設定トグルフリップフロップ5kに
セットされ、U相波形出力は”L”レベルの状態のまま
となる。
When the one-shot pulse of the short-circuit prevention time setting timer 5m ends, the already inverted output "1" of the output polarity setting toggle flip-flop 5k becomes valid, and the U-phase waveform shifts to "L" level. After that, when the content of the counter of the one-shot timer 5bU becomes "0000H", the content of the reload register 25d of the one-shot timer 5bU is transferred to the one-shot timer 5bU and the one-shot pulse output is started. At the same time, the contents of the automatic output polarity setting flip-flop 5g are inverted (in this case "1"), the inverted contents are set in the output polarity setting toggle flip-flop 5k, and the U-phase waveform output remains at the "L" level. Becomes

【0063】ワンショットタイマ5bU のワンショットパ
ルス出力が終了すると、出力極性設定トグルフリップフ
ロップ5kの内容が”1”から”0”に反転すると同時
に、短絡防止時間設定タイマ5mのワンショットパルス出
力が開始される。U相波形の出力は出力極性設定トグル
フリップフロップ5kの内容が”1”から”0”に変わる
場合は、短絡防止時間設定タイマ5mのワンショットパル
ス出力の終了を待つことなく出力レベルが”L”から”
H”に変わる。
When the one-shot pulse output of the one-shot timer 5bU ends, the content of the output polarity setting toggle flip-flop 5k is inverted from "1" to "0", and at the same time, the one-shot pulse output of the short-circuit prevention time setting timer 5m is changed. Be started. When the content of the output polarity setting toggle flip-flop 5k changes from "1" to "0", the output of the U-phase waveform has an output level of "L" without waiting for the end of the one-shot pulse output of the short-circuit prevention time setting timer 5m. "From"
Change to H ".

【0064】また自動モード時には、パルス出力データ
レジスタのビットb4(ワンショットタイマ5bU の割り込
み間隔制御ビット) を”0”に設定することにより、図
10にINT にて示されているように、ワンショットタイマ
5bU の割り込み間隔を1回おきに、”1”に設定するこ
とにより2回おきにそれぞれ割り込み発生間隔を設定す
ることができる。
In the automatic mode, by setting bit b4 (interrupt interval control bit of one-shot timer 5bU) of the pulse output data register to "0",
One shot timer, as indicated by INT on 10
By setting the interrupt interval of 5bU every other time and setting it to "1", the interrupt generation interval can be set every two times.

【0065】また、パルス出力データレジスタのビット
b5(ワンショットタイマ5bU の割り込み有効出力極性設
定ビット) を”0”に設定することによりワンショット
タイマ5bU の割り込みをU相の出力極性設定トグルフリ
ップフロップ5kの内容が”L”レベルのときに発生させ
ることができ、”1”に設定することによりワンショッ
トタイマ5bU の割り込みをU相の出力極性設定トグルフ
リップフロップ5kの内容が”H”レベルのときに発生さ
せることができる。
Also, the bits of the pulse output data register
By setting b5 (one-shot timer 5bU interrupt valid output polarity setting bit) to "0", the one-shot timer 5bU interrupt is output when the U-phase output polarity setting toggle flip-flop 5k is at "L" level. It can be generated, and by setting it to "1", the interrupt of the one-shot timer 5bU can be generated when the content of the U-phase output polarity setting toggle flip-flop 5k is at "H" level.

【0066】なお自動モード時には、ワンショットタイ
マ5bU の割り込み毎に割り込みを発生させることはでき
ない。
In the automatic mode, it is impossible to generate an interrupt for each interrupt of the one-shot timer 5bU.

【0067】このような動作が反復されて、図10(h) に
示されているように、U相波形が発生する。このU相波
形の逆相である#U相波形は、図10(i) に位示されている
ように、出力極性設定トグルフリップフロップ5kの内容
がU相波形の場合とは反転された信号となって扱われる
のみであり、動作の内容はU相波形の発生の場合と同様
である。このようにして、U相波形出力とその逆相の#U
相波形との”L”レベルが重ならない波形が端子P55
びP54 から出力される。”L”レベルの幅もワンショッ
トタイマ5bU の値及び周期設定用タイマ5aの値を変更し
て設定することで可変にできる。
By repeating the above operation, a U-phase waveform is generated as shown in FIG. 10 (h). As shown in Fig. 10 (i), the #U phase waveform, which is the opposite phase of this U phase waveform, is a signal whose content is reversed in the output polarity setting toggle flip-flop 5k when it is the U phase waveform. The contents of the operation are similar to those in the case of generating the U-phase waveform. In this way, the U-phase waveform output and the opposite phase #U
A waveform whose "L" level does not overlap with the phase waveform is output from terminals P5 5 and P5 4 . The width of the "L" level can also be made variable by changing and setting the value of the one-shot timer 5bU and the value of the period setting timer 5a.

【0068】V相, W相及びそれらの逆相である#V相,
#W相についても、それらに対応したワンショトタイマ5b
V, 5bWでそれぞれ同様の動作が行われて、波形が発生さ
れる。
V phase, W phase and their opposite phases, #V phase,
Also for #W phase, one-shot timer 5b corresponding to them
Similar operations are performed at V and 5bW to generate waveforms.

【0069】なお、以上の説明は三角波変調 (ダブルエ
ッジ変調とも言われる) による三相波形の発生例である
が、のこぎり波変調 (シングルエッジ変調とも言われ
る) による三相波形の発生も各相の開始レベルを固定さ
せることにより実現可能である。
Although the above description is an example of generating a three-phase waveform by triangular wave modulation (also called double-edge modulation), three-phase waveform generation by sawtooth wave modulation (also called single-edge modulation) is also possible for each phase. This can be achieved by fixing the starting level of.

【0070】また、パルス出力データレジスタのビット
b5, ビットb6, ビットb7(U,V,W相の”H”出力極
性設定バッファ)を”1”に設定すると、U相, V相,
W相の各出力レベルをタイマ, 出力極性設定バッファ,
自動モードタイプには関係なく”H”に固定することが
できる。このようにして発生する三相波形(U相, V
相, W相)とその逆相波形(#U相, #V相, #W相)は、波
形出力モードレジスタの波形出力制御ビット(ビットb
7)を”1”にすることにより各ポートから出力され
る。このビットを”0”に設定した場合には各ポートは
フローティング状態になる。またこのビットを命令で”
0”に設定する以外に、外部割り込みの #INT0入力端子
に立ち下がりエッジを入力するか、あるいはRset入力端
子にリセット信号を入力してリセットをかけても”0”
にできる。
The bit of the pulse output data register
If b5, bit b6, bit b7 (“H” output polarity setting buffer for U, V, W phases) are set to “1”, U phase, V phase,
Each output level of W phase is controlled by timer, output polarity setting buffer,
It can be fixed at "H" regardless of the automatic mode type. Three-phase waveform generated in this way (U phase, V
Phase, W phase) and its opposite phase waveform (#U phase, #V phase, #W phase) are the waveform output control bit (bit b) of the waveform output mode register.
It is output from each port by setting 7) to "1". When this bit is set to "0", each port is in a floating state. In addition, this bit is commanded
In addition to setting to "0", even if a falling edge is input to the external interrupt #INT 0 input terminal or a reset signal is input to the Rset input terminal to reset, "0"
You can

【0071】次に本発明のモータコントロール回路内蔵
マイクロコンピュータにより従来のU相波形出力の一例
を行った場合の説明をする。
Next, description will be given of a case where an example of conventional U-phase waveform output is performed by the microcomputer with a built-in motor control circuit of the present invention.

【0072】U相出力極性設定バッファのビットb1に”
0”を書き込み、ワンショットタイマ5bU を動作させる
と三相波形出力モードが動作する。ワンショットタイマ
5bU のカウンタの内容が”0000H ”になるとワンショッ
トタイマ5bU のリロードレジスタ1 5c の内容がワンシ
ョットタイマ5bU に転送されてワンショットタイマ5bU
はワンショットパルス出力を開始する。この時点で、出
力極性設定トグルフリップフロップ5kにU相出力極性設
定バッファの内容(この場合は”0”)が設定される。
Set to bit b1 of the U phase output polarity setting buffer
Writing "0" and operating the one-shot timer 5bU activates the three-phase waveform output mode.
When the content of the 5bU counter reaches "0000H", the content of the reload register 1 5c of the one-shot timer 5bU is transferred to the one-shot timer 5bU and the one-shot timer 5bU
Starts one-shot pulse output. At this point, the contents of the U-phase output polarity setting buffer (“0” in this case) are set in the output polarity setting toggle flip-flop 5k.

【0073】ワンショットタイマ5bU のワンショットパ
ルス出力が終了すると出力極性設定トグルフリップフロ
ップ5kの内容が”0”から”1”に反転すると同時に、
U相波形とその逆相である#U相波形との”L”レベルと
が重ならない時間を設定する8ビットの短絡防止時間設
定タイマ5mのワンショットパルスが出力される。”H”
レベルから開始したU相波形の出力はワンショットタイ
マ5bU のワンショットパルス出力により出力極性設定ト
グルフリップフロップ5kの内容が”0”から”1”に反
転しても、短絡防止時間設定タイマ5mのワンショットパ
ルス出力が終わるまでは”H”レベルを出力する。
When the one-shot pulse output from the one-shot timer 5bU ends, the contents of the output polarity setting toggle flip-flop 5k are inverted from "0" to "1", and at the same time,
The one-shot pulse of the 8-bit short-circuit prevention time setting timer 5m that sets the time when the "L" level of the U-phase waveform and its opposite phase, the # U-phase waveform, does not overlap is output. "H"
The output of the U-phase waveform starting from the level is controlled by the one-shot timer 5bU's one-shot pulse output, even if the content of the output polarity setting toggle flip-flop 5k is inverted from "0" to "1". Until the one-shot pulse output ends, "H" level is output.

【0074】短絡防止時間設定タイマ5mのワンショット
パルスが終わると、すでに反転した出力極性設定トグル
フリップフロップ5kの出力”1”が有効となり、U相波
形は”L”レベルに転じる。次に、再度ワンショットタ
イマ5bU のカウンタの内容が”0000H ”になる前にU相
出力極性設定バッファのビットb1に”1”を書き込んで
おく。その後、ワンショットタイマ5bU のカウンタの内
容が”0000H ”になると、ワンショットタイマ5bU のリ
ロードレジスタ1の内容がワンショットタイマ5bU に転
送され、ワンショットタイマ5bU ワンショットパルス出
力が開始される。同時に、U相極性設定バッファに書き
込まれた”1”が出力極性設定トグルフリップフロップ
5kにセットされ、U相波形出力は”L”レベルの状態の
ままとなる。
When the one-shot pulse of the short-circuit prevention time setting timer 5m ends, the already inverted output "1" of the output polarity setting toggle flip-flop 5k becomes valid, and the U-phase waveform changes to "L" level. Next, "1" is written in the bit b1 of the U-phase output polarity setting buffer before the content of the counter of the one-shot timer 5bU becomes "0000H" again. After that, when the content of the counter of the one-shot timer 5bU becomes "0000H", the content of the reload register 1 of the one-shot timer 5bU is transferred to the one-shot timer 5bU, and the one-shot timer 5bU one-shot pulse output is started. At the same time, "1" written in the U-phase polarity setting buffer is the output polarity setting toggle flip-flop.
It is set to 5k and the U-phase waveform output remains at the "L" level.

【0075】ワンショットタイマ5bU のワンショットパ
ルス出力が終了すると、出力極性設定トグルフリップフ
ロップ5kの内容が”1”から”0”に反転すると同時
に、短絡防止時間設定タイマ5mのワンショットパルス出
力が開始される。U相波形の出力は出力極性設定トグル
フリップフロップ5kの内容が”1”から”0”に変わる
場合は、短絡防止時間設定タイマ5mのワンショットパル
ス出力の終了を待つことなく出力レベルが”L”から”
H”に変わる。
When the one-shot pulse output of the one-shot timer 5bU is completed, the content of the output polarity setting toggle flip-flop 5k is inverted from "1" to "0", and at the same time, the one-shot pulse output of the short-circuit prevention time setting timer 5m is changed. Be started. When the content of the output polarity setting toggle flip-flop 5k changes from "1" to "0", the output of the U-phase waveform has an output level of "L" without waiting for the end of the one-shot pulse output of the short-circuit prevention time setting timer 5m. "From"
Change to H ".

【0076】図16は、本発明のモータコントロール回路
内蔵マイクロコンピュータの具体的なレイアウトを示す
ブロック図である。
FIG. 16 is a block diagram showing a specific layout of the motor control circuit-embedded microcomputer of the present invention.

【0077】図16において、参照符号15a はCPU(中央処
理装置) を、 15bはRAM を、 15cはROM を、 15dは発振
器を、 15eは汎用ポートを、 15fはタイマユニットを、
15gは A-Dコンバータを、 15hはDMAC (ダイレクトメモ
リアクセスコントローラ) を、 15iはバスインタフェイ
スユニットを、15j はその他周辺回路をそれぞれ示して
いる。これらは同一チップ上に成形されていて、1チッ
プマイクロコンピュータを構成している。
In FIG. 16, reference numeral 15a is a CPU (central processing unit), 15b is a RAM, 15c is a ROM, 15d is an oscillator, 15e is a general-purpose port, and 15f is a timer unit.
Reference numeral 15g indicates an AD converter, 15h indicates a DMAC (direct memory access controller), 15i indicates a bus interface unit, and 15j indicates other peripheral circuits. These are molded on the same chip and constitute a one-chip microcomputer.

【0078】なお、上述の実施例では、 CPUの割り込み
により各データ(タイマデータ, スタートレベル設定デ
ータなど)の設定を行っていたが、ここでは上述の実施
例にDMACを加えて本発明のモータコントロール回路内蔵
マイクロコンピュータを構成している。
In the above-described embodiment, each data (timer data, start level setting data, etc.) is set by the interruption of the CPU, but here, the motor of the present invention is added by adding DMAC to the above-mentioned embodiment. It constitutes a microcomputer with a built-in control circuit.

【0079】従来例のように CPUの割り込みにより各デ
ータ (タイマデータ, スタートレベル設定データなど)
の設定を行う場合、周期設定用タイマ5aの周期が短くな
るほど各データ設定のためにCPU の負荷が大きくなるこ
とは避けられない。このような事態を回避するために、
各データ設定をDMACを用いて周期設定用タイマ5aのトリ
ガ信号又はU相, V相, W相用のワンショットタイマ5b
U, 5bV, 5bW のトリガ信号によりレジスタ又はあるメモ
リ番地からタイマレジスタへ転送するように構成する。
Each data (timer data, start level setting data, etc.) is generated by the CPU interrupt as in the conventional example.
When setting the above, it is inevitable that the shorter the cycle of the cycle setting timer 5a, the larger the load on the CPU for each data setting. In order to avoid such a situation,
Uses DMAC for each data setting. Trigger signal of cycle setting timer 5a or one-shot timer 5b for U phase, V phase, W phase.
It is configured to transfer to a timer register from a register or a certain memory address by a trigger signal of U, 5bV, 5bW.

【0080】図13は、本発明のモータコントロール回路
内蔵マイクロコンピュータの A-Dコンバータの構成例を
示すブロック図である。
FIG. 13 is a block diagram showing a configuration example of an AD converter of the microcomputer with a built-in motor control circuit of the present invention.

【0081】図13において、参照符号13a はセレクタ
を、 13bは A-Dモードレジスタを、 13cはコンパレータ
を、 13dは抵抗ラダーを、 13eは A-D変換データバッフ
ァを、13fはデコーダをそれぞれ示している。
In FIG. 13, reference numeral 13a is a selector, 13b is an AD mode register, 13c is a comparator, 13d is a resistor ladder, 13e is an AD conversion data buffer, and 13f is a decoder.

【0082】セレクタ13a には本実施例ではAN0 〜AN7
までの8入力端子が備えられている。このセレクタ13a
の各入力端子AN0 〜AN7 に入力されるアナログ信号を、
デコーダ13f が A-Dモードレジスタ13b に設定されてい
るサンプリング周期で選択する。この選択されたアナロ
グ信号と、抵抗ラダー13d で発生される電圧値とをコン
パレータ13c で比較することにより A-D変換が行われ
る。
In the present embodiment, the selector 13a has AN0 to AN7.
Up to 8 input terminals are provided. This selector 13a
The analog signals input to the input terminals AN0 to AN7 of
The decoder 13f selects at the sampling cycle set in the AD mode register 13b. AD conversion is performed by comparing the selected analog signal with the voltage value generated by the resistance ladder 13d by the comparator 13c.

【0083】ところで、この本発明のモータコントロー
ル回路内蔵マイクロコンピュータに使用されている A-D
コンバータでは、アナログ入力情報に対してサンプリン
グ周期を必要頻度に応じて2種類に分けることができる
ようにセレクタ13a 及びデコーダ13f がそれぞれ改良さ
れている。
By the way, the AD used in the motor control circuit built-in microcomputer of the present invention.
In the converter, the selector 13a and the decoder 13f are improved so that the sampling cycle for the analog input information can be divided into two types according to the required frequency.

【0084】以下、 A-Dコンバータの動作について、そ
のサンプリング周期の遷移状態を示す模式図を参照して
説明する。
The operation of the AD converter will be described below with reference to the schematic diagram showing the transition state of the sampling period.

【0085】デコーダ13f は A-Dモードレジスタ13b に
より設定される2種類のサンプリング周期でアナログ入
力端子AN0 〜AN7 の選択を行うが、図14及び図15に示さ
れているように、16ビット構成の A-Dモードレジスタ13
b の掃引端子設定ビットを設定することにより、選択す
る入力端子の順序を任意に設定することが出来る。
The decoder 13f selects the analog input terminals AN0 to AN7 at two kinds of sampling periods set by the AD mode register 13b, but as shown in FIGS. Mode register 13
By setting the sweep terminal setting bit of b, the order of the input terminals to be selected can be set arbitrarily.

【0086】例えば、アナログ入力端子AN0, AN1はいず
れも使用頻度が高く、アナログ入力端子AN2 〜AN4 は使
用頻度が低いとする。これらのアナログ入力端子AN0 〜
AN4への入力信号を A-D変換する場合、掃引端子設定ビ
ット (b8〜b10)を”101 ”に設定すると図12に示されて
いるように、1周期で3個の入力をサンプリングし、そ
の各1周期において入力端子AN0 とAN1 とは必ずサンプ
リングし、他に入力端子AN2, AN3及びAN4 を各1周期に
順次的に1回ずつサンプリングするような順序でアナロ
グ入力端子AN0 〜AN4 がサンプリングされて A-D変換が
行われる。
For example, it is assumed that the analog input terminals AN0 and AN1 are used frequently and the analog input terminals AN2 to AN4 are used less frequently. These analog input pins AN0 to
When the input signal to AN4 is AD converted, if the sweep pin setting bits (b8 to b10) are set to "101", as shown in Fig. 12, three inputs are sampled in one cycle and each of them is sampled. The analog input terminals AN0 to AN4 are sampled in such a sequence that the input terminals AN0 and AN1 are always sampled in one cycle, and the input terminals AN2, AN3 and AN4 are sampled once in each cycle. AD conversion is performed.

【0087】[0087]

【発明の効果】以上のように、本発明では三相PWM 波形
のスタートレベルをハードウェアで自動的に反転するよ
うに構成したので、 CPUの割り込み処理による従来のよ
うな設定が不必要になる。このためプログラム負荷が軽
減される。また、 CPUの割り込みを数回おきに設定でき
るように構成したことにより、ソフトウェアサービスを
行う必要のあるタイミングにおいてのみ割り込みが発生
するので、 CPUの割り込み処理に費やされていた時間が
削減できる。
As described above, according to the present invention, since the start level of the three-phase PWM waveform is automatically inverted by hardware, the conventional setting by CPU interrupt processing is unnecessary. .. Therefore, the program load is reduced. Also, by configuring the CPU interrupt to be set every few times, the interrupt is generated only when the software service needs to be performed, so that the time spent in the CPU interrupt processing can be reduced.

【0088】従来はタイマのリロードレジスタを1段で
構成していたため、三相PWM 周期毎に発生する CPU割り
込み処理により三相PWM の次周期データをその都度設定
しなければならなかった。しかし、本発明ではリロード
レジスタを2段で構成し、各リロードレジスタから交互
にタイマへ設定データを転送するようにしたため、タイ
マデータの設定回数が削減される。
Conventionally, since the reload register of the timer was composed of one stage, it was necessary to set the next cycle data of the three-phase PWM each time by the CPU interrupt processing generated every three-phase PWM cycle. However, in the present invention, the reload register is configured in two stages and the setting data is alternately transferred from each reload register to the timer, so that the number of times of setting the timer data is reduced.

【0089】また、従来技術のように CPUの割り込み処
理においてデータテーブルから読み出したデータ又は演
算等で算出したデータなどの各データ(タイマデータ,
スタートレベル設定データなど)の設定を行う場合、周
期設定用タイマの周期が短くなればなるほど各データ設
定のための CPU負荷が大きくなっていた。しかし、本発
明ではDMACを用いることにより、 CPUの割り込み処理内
においてデータ設定に費やされる時間が削減できるた
め、 CPUの負荷をゼロにすることができる。
Further, each data (timer data, timer data, etc.) such as data read from the data table in the interrupt processing of the CPU or data calculated by calculation as in the prior art is used.
When setting the start level setting data, etc.), the shorter the cycle of the cycle setting timer, the larger the CPU load for each data setting. However, in the present invention, by using the DMAC, the time spent for data setting in the interrupt processing of the CPU can be reduced, so that the load on the CPU can be made zero.

【0090】更に、 A-Dコンバータのサンプリング周期
を2種類に設定できるように構成したため、アナログ入
力情報の必要頻度に対応した A-D変換処理が可能にな
る。
Further, since the sampling period of the AD converter can be set to two types, AD conversion processing corresponding to the required frequency of analog input information becomes possible.

【0091】本発明では以上により、 CPU実行処理の負
荷を削減し、リアルタイム制御, 処理を実現することが
できる。従来技術では、本発明の目的である三相PWM 波
形出力の制御を行った場合、三相PWM の周波数が高くな
ればなるほど三相PWM のデータ設定のための CPUの負荷
が非常に高くなり、周波数の高い三相PWM の制御が不可
能であった。また、 A-D変換ではアナログ入力情報に対
してサンプリング周期を必要頻度に分けることができ
ず、 A-D変換のサンプリング時間が総合的に長くなって
いたため、 A-D変換値をPWM 出力データに用いたい場
合、データの更新が間に合わないなどの問題点があった
が、本発明ではこれらの問題点が解消される。
As described above, according to the present invention, the load of CPU execution processing can be reduced and real-time control and processing can be realized. In the conventional technology, when the control of the three-phase PWM waveform output, which is the object of the present invention, is performed, the higher the frequency of the three-phase PWM, the higher the CPU load for setting the three-phase PWM data becomes. It was impossible to control the high-frequency three-phase PWM. In addition, in AD conversion, the sampling period for analog input information could not be divided into the required frequency, and the sampling time for AD conversion was generally long, so if you want to use the AD conversion value for PWM output data, However, the present invention solves these problems.

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

【図1】従来例としてのマイクロコンピュータの構成を
示すブロック図である。
FIG. 1 is a block diagram showing a configuration of a microcomputer as a conventional example.

【図2】図1中のタイマユニットの構成を示すブロック
図である。
FIG. 2 is a block diagram showing the configuration of a timer unit in FIG.

【図3】図1中の8ビットリロードタイマの構成を示す
ブロック図である。
FIG. 3 is a block diagram showing a configuration of an 8-bit reload timer shown in FIG.

【図4】図3に示されているデッドタイムタイマと図2
に示されているタイマユニットとを組み合わせたブロッ
ク図である。
FIG. 4 shows the dead time timer shown in FIG. 3 and FIG.
It is a block diagram which combined with the timer unit shown by FIG.

【図5】本発明のモータコントロール回路内蔵マイクロ
コンピュータの要部である三相波形発生回路の構成を示
すブロック図である。
FIG. 5 is a block diagram showing a configuration of a three-phase waveform generating circuit which is a main part of the motor control circuit-embedded microcomputer of the present invention.

【図6】波形出力モードレジスタのビット構成を示す模
式図である。
FIG. 6 is a schematic diagram showing a bit configuration of a waveform output mode register.

【図7】タイマモードレジスタの構成を示す模式図であ
る。
FIG. 7 is a schematic diagram showing a configuration of a timer mode register.

【図8】パルス出力データレジスタの構成及び三相モー
ド時の内容を示す模式図である。
FIG. 8 is a schematic diagram showing a configuration of a pulse output data register and contents in a three-phase mode.

【図9】パルス出力データレジスタの構成及び自動三相
モード時の内容を示す模式図である。
FIG. 9 is a schematic diagram showing a configuration of a pulse output data register and contents in an automatic three-phase mode.

【図10】自動モード時の三相波形出力の一例としてU
相波形出力を示す示す波形図である。
FIG. 10 shows U as an example of a three-phase waveform output in the automatic mode.
It is a waveform diagram which shows a phase waveform output.

【図11】従来の A-Dコンバータのサンプリング周期の
遷移を示す模式図である。
FIG. 11 is a schematic diagram showing a transition of a sampling period of a conventional AD converter.

【図12】本発明のモータコントロール回路内蔵マイク
ロコンピュータの A-Dコンバータのサンプリング周期の
遷移を示す模式図である。
FIG. 12 is a schematic diagram showing the transition of the sampling cycle of the AD converter of the microcomputer with built-in motor control circuit of the present invention.

【図13】本発明のモータコントロール回路内蔵マイク
ロコンピュータの A-Dコンバータの構成を示すブロック
図である。
FIG. 13 is a block diagram showing a configuration of an AD converter of a microcomputer with a motor control circuit according to the present invention.

【図14】A-Dモードレジスタの構成及び掃引端子設定
ビットの設定状態を示す模式図である。
FIG. 14 is a schematic diagram showing a configuration of an AD mode register and a setting state of sweep terminal setting bits.

【図15】A-Dモードレジスタの構成及び掃引端子設定
ビットの設定状態を示す模式図である。
FIG. 15 is a schematic diagram showing a configuration of an AD mode register and a setting state of sweep terminal setting bits.

【図16】本発明のモータコントロール回路内蔵マイク
ロコンピュータの具体的なレイアウトを示すブロック図
である。
FIG. 16 is a block diagram showing a specific layout of the microcomputer with a built-in motor control circuit of the present invention.

【図17】従来の三相インバータモータの制御をマイク
ロコンピュータを利用して行う場合の構成を示す模式図
である。
FIG. 17 is a schematic diagram showing a configuration when a conventional three-phase inverter motor is controlled using a microcomputer.

【図18】従来の三相インバータモータの制御をマイク
ロコンピュータを利用して行う場合の実構成を示す模式
図である。
FIG. 18 is a schematic diagram showing an actual configuration when a conventional three-phase inverter motor is controlled using a microcomputer.

【図19】従来理としての特開平3-70475号公報に開示
されている発明の構成を示すブロック図である。
FIG. 19 is a block diagram showing a configuration of the invention disclosed in Japanese Patent Laid-Open No. 3-70475 as a conventional principle.

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

15a 中央演算処理装置(CPU) 15d クロック発生回路 15e 入出力ポート 5a 周期設定用タイマ 5bU U相用ワンショットタイマ 5bV V相用ワンショットタイマ 5bW W相用ワンショットタイマ 5g 自動出力極性設定フリップフロップ 5f 割り込み間隔設定用のフリップフロップ 5c U相用ワンショットタイマのリロードレジスタ 1 5d U相用ワンショットタイマのリロードレジスタ 2 15h DMAC (ダイレクトメモリアクセスコントローラ) 15a Central processing unit (CPU) 15d Clock generation circuit 15e I / O port 5a Cycle setting timer 5b U U-phase one-shot timer 5bV V-phase one-shot timer 5b W W-phase one-shot timer 5g Automatic output polarity setting flip-flop 5f Flip-flop for setting interrupt interval 5c U-phase one-shot timer reload register 1 5d U-phase one-shot timer reload register 2 15h DMAC (Direct Memory Access Controller)

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 中央演算処理装置と、クロックを発生す
るクロック発生手段とを備え、外部から与えられるアナ
ログ信号に応じて発生されるパルス幅変調出力をインバ
ータ出力波形に変換して三相インバータモータ制御のた
めの三相信号を発生するモータコントロール回路内蔵マ
イクロコンピュータにおいて、 前記クロックに同期した立上がりパルスに基づいて出力
パルスを生成する3つの三相インバータ波形発生タイマ
と、これらの三相インバータ波形発生タイマのスタート
レベルを各1周期経過の都度自動的に反転するか、また
は予め設定されているパターンに従って設定するスター
トレベル設定回路とを有するパルス幅変調出力発生回路
と、 前記三相インバータ波形発生タイマの計時値を設定する
ためのレジスタを2個有し、これらのレジスタの設定値
を前記三相インバータ波形発生タイマに交互に設定する
タイマデータ設定回路と、 前記タイマデータ設定回路の2個のレジスタに前記中央
演算処理装置から値を設定させるための割込み処理のタ
イミングを、前記三相インバータ波形発生タイマの計時
が複数回終了する時点で発生する割込み処理回路と、 外部から与えられる複数のアナログ信号をそれぞれに対
して予め設定された異なる頻度でサンプリングしてディ
ジタル信号に変換入力する A-Dコンバータとを備えたこ
とを特徴とするモータコントロール回路内蔵マイクロコ
ンピュータ。
1. A three-phase inverter motor comprising a central processing unit and a clock generating means for generating a clock, converting a pulse width modulation output generated in accordance with an analog signal given from the outside into an inverter output waveform. In a microcomputer with a built-in motor control circuit for generating a three-phase signal for control, three three-phase inverter waveform generation timers for generating output pulses based on a rising pulse synchronized with the clock, and these three-phase inverter waveform generations A pulse width modulation output generation circuit having a start level setting circuit for automatically inverting the start level of the timer each time one cycle elapses or setting it according to a preset pattern, and the three-phase inverter waveform generation timer It has two registers for setting the clock value of A timer data setting circuit for alternately setting the set value of the resistor in the three-phase inverter waveform generation timer, and an interrupt processing timing for setting values in the two registers of the timer data setting circuit from the central processing unit Is a digital signal obtained by sampling an interrupt processing circuit that is generated when the three-phase inverter waveform generation timer counts a plurality of times and a plurality of externally applied analog signals at different preset frequencies. A microcomputer with a built-in motor control circuit, which is equipped with an AD converter for converting and inputting into the.
【請求項2】 ダイレクトメモリアクセスコントローラ
を備え、三相インバータ波形発生タイマに設定されるべ
きデータを2個のレジスタへダイレクトメモリアクセス
転送すべくなしてあることを特徴とする請求項1に記載
のモータコントロール回路内蔵マイクロコンピュータ。
2. The direct memory access controller is provided, and the data to be set in the three-phase inverter waveform generation timer is transferred to the two registers by direct memory access transfer. Microcomputer with built-in motor control circuit.
JP4124567A 1992-05-18 1992-05-18 Microcomputer with built-in motor control circuit Expired - Fee Related JP2818986B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP4124567A JP2818986B2 (en) 1992-05-18 1992-05-18 Microcomputer with built-in motor control circuit
US08/475,478 US5550451A (en) 1992-05-18 1995-06-07 Microcomputer with built-in motor control circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4124567A JP2818986B2 (en) 1992-05-18 1992-05-18 Microcomputer with built-in motor control circuit

Publications (2)

Publication Number Publication Date
JPH05328734A true JPH05328734A (en) 1993-12-10
JP2818986B2 JP2818986B2 (en) 1998-10-30

Family

ID=14888681

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4124567A Expired - Fee Related JP2818986B2 (en) 1992-05-18 1992-05-18 Microcomputer with built-in motor control circuit

Country Status (1)

Country Link
JP (1) JP2818986B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09308249A (en) * 1996-05-09 1997-11-28 Toshiba Corp Power converter
US5825141A (en) * 1997-05-22 1998-10-20 Mitsubishi Electric Engineering Co., Ltd. Motor control apparatus
WO2011058703A1 (en) * 2009-11-16 2011-05-19 パナソニック株式会社 Semiconductor device for inverter control, motor drive device, and air-conditioning equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09308249A (en) * 1996-05-09 1997-11-28 Toshiba Corp Power converter
US5825141A (en) * 1997-05-22 1998-10-20 Mitsubishi Electric Engineering Co., Ltd. Motor control apparatus
WO2011058703A1 (en) * 2009-11-16 2011-05-19 パナソニック株式会社 Semiconductor device for inverter control, motor drive device, and air-conditioning equipment

Also Published As

Publication number Publication date
JP2818986B2 (en) 1998-10-30

Similar Documents

Publication Publication Date Title
JP3505018B2 (en) Semiconductor integrated circuit
JP3687861B2 (en) Control system and method for forming complementary non-overlapping PWM signals
JPH05307485A (en) Data processor
US5550451A (en) Microcomputer with built-in motor control circuit
JPS6043757B2 (en) Electric motor control method and its control device
JP2818986B2 (en) Microcomputer with built-in motor control circuit
US7536533B2 (en) MCU based motor controller with pre-load register and DMA controller
US6563282B2 (en) Motor control apparatus
US5199052A (en) Reload timer circuit
JP4204655B2 (en) Microcomputer with pulse output function
JPH10323084A (en) Motor controller
JPH04373002A (en) Programmable controller
JP2000139099A (en) Motor controller
JPH0718174Y2 (en) Arbitrary waveform generator
JP2001286189A (en) Motor controller
JPH04225409A (en) Microcomputer system
JP3720669B2 (en) Motor control device
JPH05120205A (en) Processor system with address conversion device for dma transfer and dma transfer method
JP3488059B2 (en) Interrupt address extension circuit
JPS6133721Y2 (en)
JPH09305413A (en) Microcomputer and data processor
JP2635863B2 (en) Central processing unit
JPH06139076A (en) Interruption processor
Wright Multichannel PWM TPU Function (MCPWM)
JPH06259264A (en) Clock control circuit

Legal Events

Date Code Title Description
S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20070828

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20080828

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20080828

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20090828

Year of fee payment: 11

LAPS Cancellation because of no payment of annual fees