JPH04195311A - Microcomputer - Google Patents

Microcomputer

Info

Publication number
JPH04195311A
JPH04195311A JP2327735A JP32773590A JPH04195311A JP H04195311 A JPH04195311 A JP H04195311A JP 2327735 A JP2327735 A JP 2327735A JP 32773590 A JP32773590 A JP 32773590A JP H04195311 A JPH04195311 A JP H04195311A
Authority
JP
Japan
Prior art keywords
output
signal
counter
latch
conveyor
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
JP2327735A
Other languages
Japanese (ja)
Inventor
Yukihiro Nishiguchi
西口 幸弘
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC IC Microcomputer Systems Co Ltd
Original Assignee
NEC IC Microcomputer Systems 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 NEC IC Microcomputer Systems Co Ltd filed Critical NEC IC Microcomputer Systems Co Ltd
Priority to JP2327735A priority Critical patent/JPH04195311A/en
Publication of JPH04195311A publication Critical patent/JPH04195311A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To outputs the control signal for an AC induction motor and a general-use pulse signal by adding a circuit which reads the contents of a comparing register out in synchronism with the operation of other comparing registers and using hardware effectively. CONSTITUTION:A coincidence signal EQi is passed through an AND gate 113, etc., and connected to the reset/set input of a D latch 119, etc. Further, coincidence signals EQ0 and EQ1 are connected to a D latch 140 through an OR gate 138. The output of the D latch 140 comes to the readout signal of a comparing register 109 through an OR gate 142 which inputs a signal RDCM4 at the other input terminal. Similarly, coincidence signals EQ2 and EQ3 are inputted to a D latch 141, whose output comes to the readout signal of the comparing register 110 through an OR gate 143 inputting a signal RDCM5 at the other input terminal. A counter bus 104 which connects respective comparing registers and a counter 112 is connected even to a multiplexer 137.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、プログラマブルな波形を出力するタイマ機能
を有するマイクロコンピュータ(以下“マイコン”と記
す)に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a microcomputer (hereinafter referred to as "microcomputer") having a timer function that outputs a programmable waveform.

[従来の技術] マイクロコンピュータの応用分野は、近年急速に拡大し
、多方面で用いられている。特に最近はOA化、FA化
等で物体を動かすモータの制御にマイコンを使用するこ
とが多くなってきている。
[Prior Art] The field of application of microcomputers has expanded rapidly in recent years, and microcomputers are used in many fields. Particularly recently, microcomputers are increasingly being used to control motors that move objects due to automation, automation, etc.

モータ制御にはモータ制御に適したハードウェアを備え
たマイクロコンピュータが必要である。
Motor control requires a microcomputer with hardware suitable for motor control.

一般に、マイコンは、第8図に示すように構成され、メ
モリ2内に記憶されている命令に従い、CPU1が演算
処理を行ない、周辺制御回路3を制御する0周辺制御回
路3は、マイコンの外部に接続される外付機器に対し制
御信号を出力したり、外付機器からステータス信号を入
力したりして外付機器を制御する。前記モータ制御に適
したハードウェアはこの周辺制御回路3に属する。
In general, a microcomputer is configured as shown in FIG. Controls external devices by outputting control signals to external devices connected to the device and inputting status signals from external devices. Hardware suitable for the motor control belongs to this peripheral control circuit 3.

モータ制御として、交流誘導モータの制御方法を説明す
る。一般に交流誘導モータ駆動システムは、PWMイン
バータによる駆動システムが用いられている(OHM誌
、 1984年7月号33〜36ベージ)。交流誘導モ
ータの駆動は、第9図に示すように、3相の正弦波信号
(A、B、C)により行なう、しかし、マイコンからは
正弦波信号を出力することができないため、正弦波信号
の周波数より高い周波数の搬送波を想定し、搬送波と正
弦波信号とが同期するような各相に対する矩形信号で近
似する。矩形信号のことをPWM信号と呼び、矩形信号
のハイレベル幅は正弦波信号の振幅の逆の値に対応して
おり、PWMインバータに前記PWM信号を入力すると
、PWMインバータは交流誘導モータを回転させる。
As motor control, a method of controlling an AC induction motor will be explained. Generally, a drive system using a PWM inverter is used as an AC induction motor drive system (OHM magazine, July 1984 issue, pages 33-36). As shown in Figure 9, the AC induction motor is driven by three-phase sine wave signals (A, B, C). However, since the microcomputer cannot output sine wave signals, the sine wave signals Assuming a carrier wave with a higher frequency than the frequency of A rectangular signal is called a PWM signal, and the high level width of the rectangular signal corresponds to the opposite value of the amplitude of the sine wave signal. When the PWM signal is input to the PWM inverter, the PWM inverter rotates the AC induction motor. let

第1O図はPWM信号を出力するタイマユニットの構成
図である。カウンタ112はカウントクロックが入力さ
れるごとにカウントアツプしている。
FIG. 1O is a configuration diagram of a timer unit that outputs a PWM signal. The counter 112 counts up every time a count clock is input.

コンベアレジスタ 105.106.107.108.
109゜110、 IllはCPU (図示せず)がそ
れぞれのコンベアレジスタ105〜Illのアドレスを
アドレスバス101に出力し、読出し信号102または
書込み信号103を出力することにより、RDCMO,
WRCMI、 ・RDCM6.WRCM6信号がリード
ライト制御回路147から出力され、また、オアゲート
149の出力が“1”となり、バス接続回路+50がデ
ータバス100と各コンベアレジスタ105〜II+を
接続しているバス104とを接続するので、各コンベア
レジスタ105〜I11の値がデータバス100に読出
されたり、また、データバス100上のデータが各コン
ベアレジスタ105〜Illに書込まれたりする。各コ
ンベアレジスタ105〜111は、通常、書込まれたデ
ータとカウンタ112との比較を行なっており、カウン
タ112の値とコンベアレジスタ105〜111に書込
まれたデータとが一致すると、一致信号EQO,EQ1
.EQ2゜EQ3.EQ4.EQ5.EQ6を出力する
。−致信号EQOとEQI、EQ2とEQ3、EQ4と
EQ5はペアとなり、発生するとRSフリップフロップ
213.214.215をそれぞれリセット(内容が“
O“)、セット(内容が“1”)する、−致信号EQ6
が発生すると、CPUに割込み要求信号を送出したり、
また、カウンタ112をクリアして値を初期値“○”に
戻す。カウンタ112はクリア後カウントクロックのカ
ウントを続ける。また、8ビツト構成のポートラッチ1
23は各コンベアレジスタ105〜111と同様にCP
Uからり一ド/ライト制御回路147から発生するRD
PL、WRPL信号によ゛リアクセスされる。RSフリ
ップフロップ213.214.215の出力は、マルチ
プレクサ(MPX) 124.125.126および出
力バッファ128.129.130を介して出力ボート
po。
Conveyor register 105.106.107.108.
109°110, Ill is RDCMO, by the CPU (not shown) outputting the addresses of the respective conveyor registers 105 to Ill to the address bus 101 and outputting the read signal 102 or the write signal 103.
WRCMI, ・RDCM6. The WRCM6 signal is output from the read/write control circuit 147, the output of the OR gate 149 becomes "1", and the bus connection circuit +50 connects the data bus 100 and the bus 104 connecting each conveyor register 105 to II+. Therefore, the values of each conveyor register 105 to I11 are read to the data bus 100, and the data on the data bus 100 is written to each conveyor register 105 to Ill. Each conveyor register 105 to 111 normally compares the written data with a counter 112, and when the value of the counter 112 and the data written to the conveyor registers 105 to 111 match, a match signal EQO is generated. ,EQ1
.. EQ2゜EQ3. EQ4. EQ5. Outputs EQ6. - Match signals EQO and EQI, EQ2 and EQ3, and EQ4 and EQ5 form a pair, and when they occur, they reset the RS flip-flops 213, 214, and 215, respectively (the contents are “
O"), set (content is "1"), - match signal EQ6
occurs, an interrupt request signal is sent to the CPU,
Further, the counter 112 is cleared and the value is returned to the initial value "○". The counter 112 continues counting the count clock after being cleared. In addition, port latch 1 with 8-bit configuration
23 is a CP similar to each conveyor register 105 to 111.
RD generated from the read/write control circuit 147
It is accessed again by the PL and WRPL signals. The output of the RS flip-flop 213.214.215 is sent to the output port po via a multiplexer (MPX) 124.125.126 and an output buffer 128.129.130.

PI、P2よりマイコンの外部に出力される。また、マ
ルチプレクサ124.125.126の他方の入力はポ
ートラッチ123のビット0.1.2が入力されている
。マルチプレクサ124.125.126は別に制御さ
れるモード信号が“O“のときはポートラッチ+23の
内容を出力し、モード信号が“1“のときはRSフリッ
プフロップ213〜215の内容を出力するような動作
をする。このことは、マイコンは種々の応用分野に使用
されるため、PWM信号を使用しない応用分野にも出力
ボートPO〜P2を汎用の出力ボートとしてどうにか使
用できるように考慮していることによる。出力ボートP
3、P4.P5.P6.P7からはそれぞれポートラッ
チ+23のビット3,4,5,6.7の内容が出力バッ
ファ131.132.133.134.135を介して
出力される。カウンタ112の出力は通常バス104に
出力されているが、CPUのアクセス時は読出し信号1
02.書込み信号103信号によりバス接続回路+53
を遮断してカウンタ112をバス104から切離す。
It is output to the outside of the microcontroller from PI and P2. Furthermore, bits 0.1.2 of the port latch 123 are input to the other input of the multiplexer 124, 125, and 126. The multiplexers 124, 125, and 126 output the contents of the port latch +23 when the separately controlled mode signal is "O", and output the contents of the RS flip-flops 213 to 215 when the mode signal is "1". make certain movements. This is because, since microcomputers are used in various application fields, it is considered that the output ports PO to P2 can somehow be used as general-purpose output ports even in application fields that do not use PWM signals. Output boat P
3, P4. P5. P6. The contents of bits 3, 4, 5, and 6.7 of port latch +23 are output from P7 via output buffers 131, 132, 133, 134, and 135, respectively. The output of the counter 112 is normally output to the bus 104, but when accessed by the CPU, the read signal 1
02. Bus connection circuit +53 by write signal 103 signal
to disconnect the counter 112 from the bus 104.

次に、第1O図に示すタイマユニットを用いてPWM信
号を発生する方法を説明する。コンベアレジスタ11.
1には、第9図のA相のPWM信号のT、で示す時間に
対応するデータを書込む、また、コンベアレジスタ10
5.106にはそれぞれT 2 、 T +で示す時間
に対応するデータを書込む。モード信号が“1”の状態
でカウンタ112がクリア状態からカウントアツプして
いって、T1時間後に一致信号EQIが発生すると、R
Sフリップフロップ213がセットされるので出力ボー
トPOが“1”となる。次に、12時間後に一致信号E
QOが発生すると、RSフリップフロップ213がリセ
ットされるので出力ボートPOが“0”となる。次に、
T5時間後に一致信号EQ6が発生し、カウンタ112
がクリアされ、PWM信号の一周期が終了する。CPU
は一致信号EQ6の発生による割込み要求信号に基づい
て次のPWM信号に対応するデータをコンベアレジスタ
105.106に書込む。第9図に示すB相(出力ボー
トPI)、C相(出力ボートP2)についても同様にコ
ンベアレジスタ+07と108、コンベアレジスタ+0
9と110とを制御することによりPWM信号を出力す
ることができる。以上の制御を繰返すことにより、第9
図に示すA相、B相、C相のPWM信号を発生し、交流
誘導モータを制御することができる。
Next, a method of generating a PWM signal using the timer unit shown in FIG. 1O will be explained. Conveyor register 11.
1, write data corresponding to the time indicated by T of the A-phase PWM signal in FIG.
5. Data corresponding to times indicated by T 2 and T + are written in 106, respectively. When the mode signal is "1" and the counter 112 counts up from the clear state, and a match signal EQI is generated after time T1, R
Since the S flip-flop 213 is set, the output port PO becomes "1". Next, after 12 hours, the coincidence signal E
When QO occurs, the RS flip-flop 213 is reset, so the output port PO becomes "0". next,
A match signal EQ6 is generated after time T5, and the counter 112
is cleared, and one cycle of the PWM signal ends. CPU
writes data corresponding to the next PWM signal to the conveyor registers 105 and 106 based on the interrupt request signal generated by the occurrence of the match signal EQ6. Conveyor registers +07 and 108, conveyor register +0 similarly for B phase (output boat PI) and C phase (output boat P2) shown in FIG.
By controlling 9 and 110, a PWM signal can be output. By repeating the above control, the ninth
The A-phase, B-phase, and C-phase PWM signals shown in the figure can be generated to control an AC induction motor.

[発明が解決しようとする課題] マイコンは、多方面の応用に使用されるため、第10図
に示すようなタイマユニットを内蔵した従来のマイコン
が、交流誘導モータの制御分野以外に使用されることも
考えられる。その場合は、出力ボートはモード信号を“
0”にし、汎用の出力ボートとして使用する。しかし、
タイマユニットの回路は全く使用されないので非常にも
ったいないばかりか、交流誘導モータの制御分野以外の
応用分野のユーザーは、全く使用しない回路を含んだ価
格でマイコンを購入しなければならない訳で、非経済的
である。また、第1O図に示すタイマユニットを備えた
従来のマイコンは、交流誘導モータの制御分野以外の応
用分野には使いずらいのでマイコンの応用分野が非常に
狭くなり、マイコンの販売数量、生産数量があまり増え
なく、量産効果が得られず、結果的に従来のマイコンの
単価を安くできない。
[Problems to be Solved by the Invention] Microcomputers are used in a wide variety of applications, so conventional microcomputers with a built-in timer unit as shown in Figure 10 are used in fields other than the control of AC induction motors. It is also possible. In that case, the output boat will send the mode signal “
0" and use it as a general-purpose output port. However,
Not only is it a huge waste because the circuit of the timer unit is never used, but users in application fields other than the control field of AC induction motors have to purchase a microcontroller at a price that includes circuits that are never used, making it uneconomical. It is true. In addition, the conventional microcontroller equipped with the timer unit shown in Figure 1O is difficult to use in application fields other than the control field of AC induction motors, so the application field of microcontrollers has become very narrow, and the sales volume and production volume of microcontrollers have decreased. does not increase much, the mass production effect cannot be achieved, and as a result, the unit price of conventional microcontrollers cannot be lowered.

本発明の目的は、交流誘導モータの制御分野以外の分野
にも応用できるマイコンを提供することである。
An object of the present invention is to provide a microcomputer that can be applied to fields other than the control field of AC induction motors.

〔課題を解決するための手段〕[Means to solve the problem]

本発明のマイクロコンピュータは、 供給されるクロックに基づいて内容を更新するカウンタ
と、 該カウンタの内容と保持している内容比較を行なう複数
のコンベアレジスタと、 該コンベアレジスタの内容と前記カウンタの内容とが一
致した場合に、一致が発生したコンベアレジスタに対応
して出力信号を生成する出力信号発生回路と、 前記コンベアレジスタと前記カウンタの内容とが一致し
た場合に、前記コンベアレジスタの内容を読出す読出し
回路と、 該読出し回路により読出した前記コンベアレジスタの内
容もしくは、前記出力信号発生回路から発生する出力信
号のいずれかを選択的にマイクロコンピュータ外部に導
出する出力制御回路とを備えている。
The microcomputer of the present invention includes: a counter that updates its contents based on a supplied clock; a plurality of conveyor registers that compare the contents of the counter with held contents; and the contents of the conveyor register and the contents of the counter. an output signal generation circuit that generates an output signal corresponding to the conveyor register where a match has occurred when the contents of the conveyor register and the counter match, and an output signal generation circuit that reads the contents of the conveyor register when the contents of the conveyor register and the counter match and an output control circuit that selectively outputs either the contents of the conveyor register read by the readout circuit or the output signal generated from the output signal generation circuit to the outside of the microcomputer.

(作用) 一般に、外付の機器を制御する応用に適するマイコンに
は所定のタイミングに所定のパルス信号を出力するいわ
ゆる実時間処理機能が要求される。
(Function) In general, microcomputers suitable for applications that control external equipment are required to have a so-called real-time processing function that outputs a predetermined pulse signal at a predetermined timing.

本発明は、従来の交流誘導モータ制御回路を備えたマイ
コンに対し交流誘導モータ制御回路を構成するコンベア
レジスタの内容を他のコンベアレジスタの動作に同期し
て読出す回路を付加し、備えているハードウェアを有効
に使用することにより、交流誘導モータの制御信号およ
び汎用のパルス信号を出力するものである。
The present invention adds a circuit to a conventional microcomputer equipped with an AC induction motor control circuit to read out the contents of a conveyor register constituting the AC induction motor control circuit in synchronization with the operation of other conveyor registers. By effectively using hardware, control signals for an AC induction motor and general-purpose pulse signals can be output.

[実施例] 次に、本発明の実施例について図面を参照して説明する
[Example] Next, an example of the present invention will be described with reference to the drawings.

第1図は本発明の第1の実施例のタイマユニットの構成
図、第2図はコンベアレジスタ105〜111の詳細な
構成図、第3図はカウンタモード信号が“O”のときの
タイマユニットの動作タイミング図、第4図はカウンタ
モード信号が“」”のときのタイマユニットの動作タイ
ミング図、第5図はカウンタモード信号が“1”のとき
の出力ボートから出力されるパルス列のタイミング図で
ある。
Fig. 1 is a block diagram of the timer unit according to the first embodiment of the present invention, Fig. 2 is a detailed block diagram of the conveyor registers 105 to 111, and Fig. 3 is the timer unit when the counter mode signal is "O". Fig. 4 is an operation timing diagram of the timer unit when the counter mode signal is "'', and Fig. 5 is a timing diagram of the pulse train output from the output port when the counter mode signal is "1". It is.

カウンタ112 、コンベアレジスタ105.106゜
107、108.109.110. !IIは従来例で
説明した第1O図のカウンタ112、コンベアレジスタ
105゜106、107.108.109.110. 
Illと同様の動作をするので説明を省略する。一致信
号EQO,EQ1、EQ2.EQ3.EQ4.EQ5は
アントゲ−[13,114,115,116,117,
118を介してそれぞれセット、リセット機能付のDラ
ッチ119のリセット入力、セット入力、120のリセ
ット入力、セット入力、+21のリセット入力、セット
入力に接続されている。また、一致信号EQOとEQI
はオアゲート138を介してDラッチ+40に接続され
ている。Dラッチ140の出力は他人力がRDCM4信
号であるオアゲー[42を介してコンベアレジスタ+0
9の読出し信号となっている。
Counter 112, conveyor register 105.106°107, 108.109.110. ! II is the counter 112, conveyor register 105, 106, 107, 108, 109, 110, .
Since it operates in the same way as Ill, the explanation will be omitted. Match signals EQO, EQ1, EQ2 . EQ3. EQ4. EQ5 is an anime game [13, 114, 115, 116, 117,
It is connected to the reset input, set input, reset input, set input, +21 reset input, set input of D latch 119, which has set and reset functions, respectively, through 118. Also, the match signals EQO and EQI
is connected to D latch +40 via OR gate 138. The output of the D latch 140 is the conveyor register +0
9 read signals.

同様に、一致信号EQ2とEQ3はオアゲート139を
介してDラッチ+41に入力され、Dラッチ+41の出
力は他人力がRDCM5信号であるオアゲート143を
介してコンベアレジスタ110の読出し信号となってい
る。各コンベアレジスタ105〜Ill とカウンタ1
12を接続しているカウンタバス104は8ビツトのバ
スで、マルチプレクサ(MPX)+37にも接続されて
いる。マルチプレクサ+37はDラッチ136の出力が
“1”のときカウンタバス+04の上位4ビツトのデー
タを選択して4ビツトのバッファバス148に出力する
。また、Dラッチ136の出力が“O”のときはカウン
タバス104の下位4ビツトのデータをバッファバス1
4Bに出力する。バッファバス148の0ビツト、1ビ
ツト、2ビツト、3ビツトはそれぞれセット、リセット
付のDラッチ!+9.120.121およびDラッチ1
22の入力に接続されている。また、一致信号EQIと
EQ3はオアゲート144を介してDラッチ136の入
力に接続されており、一致信号EQIまたはEQ3のど
ちらかが“1“のときDラッチ136の出力は“1“ど
なる、オアゲート142.143の出力はオアゲー[4
5,アンドゲート146を介してDラッチ+19.12
0. 121.122のラッチクロックとなっており、
タイマモード信号が“1”でカウントクロックが“0”
のときにDラッチ119゜120、 121. 122
はバッファバス148のデータを書込む。また、タイマ
モード信号が“O”のときはアンドゲート113.11
4. ■5.136.117. 118の出力は“O”
となり、一致信号によりDラッチ1]9゜120.12
1はセットまたはリセットされない。
Similarly, match signals EQ2 and EQ3 are input to D latch +41 via OR gate 139, and the output of D latch +41 becomes a read signal for conveyor register 110 via OR gate 143 whose input is the RDCM5 signal. Each conveyor register 105 to Ill and counter 1
A counter bus 104 connecting 12 is an 8-bit bus, and is also connected to multiplexer (MPX) +37. Multiplexer +37 selects the upper 4 bits of data on counter bus +04 when the output of D latch 136 is "1" and outputs it to 4-bit buffer bus 148. Furthermore, when the output of the D latch 136 is "O", the data of the lower 4 bits of the counter bus 104 is transferred to the buffer bus 1.
Output to 4B. The 0 bit, 1 bit, 2 bit, and 3 bit of the buffer bus 148 are D latches with set and reset functions, respectively! +9.120.121 and D latch 1
22 inputs. Furthermore, the match signals EQI and EQ3 are connected to the input of the D latch 136 via the OR gate 144, and when either the match signal EQI or EQ3 is "1", the output of the D latch 136 is "1". The output of 142.143 is or game [4
5, D latch +19.12 via AND gate 146
0. It is a latch clock of 121.122,
Timer mode signal is “1” and count clock is “0”
When D latch 119°120, 121. 122
writes data on buffer bus 148. Also, when the timer mode signal is "O", the AND gate 113.11
4. ■5.136.117. The output of 118 is “O”
Then, due to the coincidence signal, D latch 1]9°120.12
1 is not set or reset.

ポートラッチ123、マルチプレクサ124.125゜
126、出力バッファ 128.129.130.13
1.132゜133.134. 135、リード/ライ
ト制御回路147、バス接続回路】50、オアゲート1
49は第10図で示したポートラッチ】23、マルチプ
レクサ124゜125、 126 、出力バッファ12
8〜135、リード/ライト制御回路】47と同様の動
作を行なうため説明を省略する。また、Dラッチ】22
は、他のDラッチ119.120.121と同様の動作
を行なう。
Port latch 123, multiplexer 124.125°126, output buffer 128.129.130.13
1.132°133.134. 135, read/write control circuit 147, bus connection circuit] 50, OR gate 1
49 is the port latch shown in FIG. 10] 23, multiplexer 124, 125, 126, output buffer 12
8 to 135, Read/Write Control Circuit] Since the operation is similar to that of 47, the explanation will be omitted. Also, D latch】22
performs the same operation as the other D latches 119, 120, 121.

コンベアレジスタ105〜+11の1ビツト300は、
書込み信号W RCM nによりDラッチ302にカウ
ンタバス】04の内容を書込む、Dラッチ302の出力
は読出し信号RDCMnが“1”のとき読出しバッファ
301を介してカウンタバス104上に読出される6ま
た、Dラッチ302の出力は、カウンタバス】04と共
に排他的オアゲート303に入力される。カウンタバス
104上にはCPUからのアクセスがない場合はカウン
タ112の内容が出力されており、排他的オアゲート3
03はDラッチ302とカウンタ112の出力とを比較
している。カウンタ】12の内容とDラッチ302の内
容とが一致すると、排他的オアゲート303の出力、つ
まりコンベアレジスタ 105〜1】】の1ビツトの一
致出力が“O”となる、コンベアレジスタ105〜I1
1の各ビットの一致出力はノアゲート304に入力され
、すべての入力、つまりコンベアレジスタ 105〜1
11の全ビットとカウンタ112の全ビットとが全く一
致した時にノアゲート304の出力は“1”となり、カ
ウントクロックが“0“のときアンドゲート306の出
カ一致信号EQnが“1”となり、対応するDラッチを
セットまたはリセットする。
1 bit 300 of conveyor registers 105 to +11 is
The contents of the counter bus 04 are written to the D latch 302 by the write signal W RCM n, and the output of the D latch 302 is read onto the counter bus 104 via the read buffer 301 when the read signal RDCMn is "1". Further, the output of the D latch 302 is input to the exclusive OR gate 303 together with the counter bus 04. When there is no access from the CPU, the contents of the counter 112 are output on the counter bus 104, and the exclusive OR gate 3
03 compares the output of the D latch 302 and the counter 112. When the contents of the counter ]12 match the contents of the D latch 302, the output of the exclusive OR gate 303, that is, the 1-bit match output of the conveyor registers 105 to I1 becomes "O".
The match output of each bit of 1 is input to the NOR gate 304, and all inputs, that is, conveyor registers 105 to 1
When all the bits of the counter 11 and all the bits of the counter 112 completely match, the output of the NOR gate 304 becomes "1", and when the count clock is "0", the output match signal EQn of the AND gate 306 becomes "1", and the corresponding Set or reset the D latch.

いま、タイマモード信号が“0”、モード信号が“1”
のときの動作を第3図を用いて説明する。コンベアレジ
スタI11には58)I、コンベアレジスタ+05には
56.、コンベアレジスタ106には51Hが記憶され
ている場合を考える。カウンタ112はカウントクロッ
クの立上がりに同期して内容がインクリメントしている
。カウンタ112の内容が51.4となった時カウント
クロックの立上がりに同期して一致信号EQIが出力さ
れ、続くカウントクロックの立下がりに同期してDラッ
チ+19がセットされ、出力が“l”となるので出カポ
−)POが“1”となる1次に、カウンタ112の内容
が56.4となると一致信号EQOが出力され、Dラッ
チ119がリセットされるので出力が“0”となる、す
ると、出力ボートPOが“0“となる。
Now, the timer mode signal is “0” and the mode signal is “1”
The operation in this case will be explained using FIG. Conveyor register I11 has 58) I, conveyor register +05 has 56. , 51H is stored in the conveyor register 106. The contents of the counter 112 are incremented in synchronization with the rise of the count clock. When the content of the counter 112 reaches 51.4, a match signal EQI is output in synchronization with the rising edge of the count clock, and D latch +19 is set in synchronization with the falling edge of the subsequent counting clock, and the output becomes "L". Therefore, when the output capo) PO becomes "1", the match signal EQO is outputted when the content of the counter 112 becomes 56.4, and the D latch 119 is reset, so the output becomes "0". Then, the output port PO becomes "0".

以上のように出力ボートPOからはPWM信号が出力さ
れ、交流訓導モータの制御ができる。
As described above, the PWM signal is output from the output boat PO, and the AC training motor can be controlled.

次に、タイマモード信号が”1″で、モード信号が“1
“の場合の動作を第4図、第5図を用いて説明する。い
ま、コンベアレジスタ105に51H、コンベアレジス
タ!06に56.、コンベアレジスタ109には25H
、コンベアレジスタIIIにはFFHのデータが書込ま
れているものとする。通常、カウンタバス+04にはカ
ウンタ目2の内容が出力されている。カウンタ112の
内容が51.のときは一致信号EQOが出力される。す
ると、Dラッチ140には次のカウントクロックの立上
がりで“1”が、また、Dラッチ136には次のカウン
トクロックの立上がりで“O”が書込まれる。すると、
次のカウントクロックサイクルにおいてオアゲート14
2.145.151の出力は”1”となる。
Next, the timer mode signal is “1” and the mode signal is “1”.
The operation in the case of " is explained using FIGS. 4 and 5. Now, 51H is placed in the conveyor register 105, 56.
, it is assumed that FFH data is written in conveyor register III. Normally, the contents of the second counter are output to the counter bus +04. The content of the counter 112 is 51. In this case, a match signal EQO is output. Then, "1" is written into the D latch 140 at the next rise of the count clock, and "O" is written into the D latch 136 at the next rise of the count clock. Then,
OR gate 14 in the next count clock cycle
The output of 2.145.151 is "1".

すると、カウンタ112はバス接続回路+53によりカ
ウンタバス104から切離されると同時にコンベアレジ
スタ109の内容25.4がカウンタバス104に出力
される。すると、バッファバス148には5Hが出力さ
れ、カウントパルスが立下がり“0″となると、Dラッ
チ119.121の出力が“l”、Dラッチ120.1
22の出力は“0”となるので出力ボート端子PO,P
i、P2.P3がそれぞれ”1”、“0°°、“1”、
“0”となる。次に、カウンタ112の内容が56)I
となった時は一致信号EQIが“1”となるため、次の
カウントクロックのサイクルでDラッチ136の内容が
“1”となる、すると、カウンタバス104上に読出さ
れたコンベアレジスタ+09の内容25.の上位バイト
の2Hがバッファバス148に出力されるため、Dラッ
チ119.120.121.122、および出力ボート
PO,P1.P2.P3のデータがそれぞれ0”、1”
、“0”、“0”となる。また、コンベアレジスタ11
0にA 5 Hを書込んでおけば、一致信号EQ2.E
Q3が発生した時にそれぞれのデータが出力ボートPO
〜P3から出力され、第5図に示すような出力パルスを
生成することができる。
Then, the counter 112 is disconnected from the counter bus 104 by the bus connection circuit +53, and at the same time the contents 25.4 of the conveyor register 109 are output to the counter bus 104. Then, 5H is output to the buffer bus 148, and when the count pulse falls and becomes "0", the output of the D latch 119.121 becomes "L" and the D latch 120.1
Since the output of 22 is “0”, the output port terminals PO, P
i, P2. P3 is “1”, “0°°,” “1”, respectively.
It becomes “0”. Next, the contents of the counter 112 are 56)I
When this happens, the match signal EQI becomes "1", so the contents of the D latch 136 become "1" in the next count clock cycle.Then, the contents of the conveyor register +09 read out onto the counter bus 104 25. Since the upper byte 2H of is output to the buffer bus 148, the D latches 119.120.121.122 and the output ports PO, P1. P2. P3 data is 0” and 1” respectively
, “0”, “0”. In addition, conveyor register 11
If A 5 H is written to EQ2.0, the match signal EQ2. E
When Q3 occurs, each data is sent to the output port PO.
~P3, and can generate output pulses as shown in FIG.

以上のように、本実施例ではコンベアレジスタ109と
110に書込むデータにより4ビツトの所定のパルス列
を所定のタイミングで生成することができるため、外部
に接続された制御機器を実時間制御することができる。
As described above, in this embodiment, a 4-bit predetermined pulse train can be generated at a predetermined timing using the data written to the conveyor registers 109 and 110, so that externally connected control equipment can be controlled in real time. I can do it.

第6図は本発明の第2の実施例のタイマユニットの構成
図、第7図は第2の実施例でカウンタモート信号が“1
”のときの出力ボートから出力されるパルス列のタイミ
ング図である。
FIG. 6 is a configuration diagram of a timer unit according to a second embodiment of the present invention, and FIG. 7 is a diagram showing the configuration of a timer unit according to a second embodiment of the present invention.
FIG. 3 is a timing diagram of a pulse train output from an output port when ".

第6図は第1図と同一の番号、名称の回路は同一の動作
を行なう。第6図において、Dラッチ154、140、
+41には一致信号EQO,EQI。
In FIG. 6, circuits with the same numbers and names as in FIG. 1 perform the same operations. In FIG. 6, D latches 154, 140,
+41 has match signals EQO and EQI.

EQ2が接続されている。カウンタモード信号が“1“
、モード信号が“l″の場合に、一致信号EQO,EQ
I、EQ2が発生した時、次のカウントクロックに同期
して、それぞれコンベアレジスタ+08.109.11
0 (7)内容がカウンタハスlo4ニ読出され、Dラ
ッチ+19.120.121.122.156゜157
.158. 159に書込まれる。すると、出力ボート
PO,PI、P2.P3.P4.P5.P6゜P7から
はそれぞれマルチプレクサ124.125,126、1
27.160.161.152.163を介したDラッ
チ119、  +20. 121. 122,156.
157.158. 159のデータが出力される。
EQ2 is connected. Counter mode signal is “1”
, when the mode signal is “l”, the match signals EQO, EQ
When I and EQ2 occur, in synchronization with the next count clock, the conveyor register +08.109.11 respectively.
0 (7) The contents are read out to the counter hash lo4, D latch +19.120.121.122.156°157
.. 158. 159. Then, the output boats PO, PI, P2. P3. P4. P5. Multiplexers 124, 125, 126, 1 from P6 and P7, respectively.
D latch 119 via 27.160.161.152.163, +20. 121. 122,156.
157.158. 159 data are output.

今、コンベアレジスタ108.109.110それぞれ
に89□、27□、 CAMを書込んだ場合、一致信号
EQO,EQI、 Eo2の発生時に出力ボートPO,
PI、  P2.  P3.  P4.  P5.  
P6゜P7から89.、27□、 CAMのデータが出
力され、第7図に示すような波形の8ビツトのパルス列
を発生させることができる。
Now, if 89□, 27□, and CAM are written to conveyor registers 108, 109, and 110, respectively, when the match signals EQO, EQI, and Eo2 are generated, the output ports PO,
PI, P2. P3. P4. P5.
P6゜P7 to 89. , 27□, CAM data is output, and an 8-bit pulse train having a waveform as shown in FIG. 7 can be generated.

したがって、コンベアレジスタ108.109.110
に書込むデータにより、8ビツトの所定のパルス列を所
定のタイミングで生成することができるため、外部に接
続された制御機器を実時間制御することができる。
Therefore, conveyor register 108.109.110
Since a predetermined 8-bit pulse train can be generated at a predetermined timing using the data written to the controller, externally connected control equipment can be controlled in real time.

〔発明の効果] 以上説明したように本発明は、交流誘導モータ制御回路
を構成するコンベアレジスタの内容を他のコンベアレジ
スタの動作に同期して読出す回路を付加することにより
、交流誘導モータの制御および汎用のパルス信号を出力
することができるようになり、応用分野の広いマイコン
を提供できる効果がある6
[Effects of the Invention] As explained above, the present invention improves the control of an AC induction motor by adding a circuit that reads out the contents of a conveyor register constituting an AC induction motor control circuit in synchronization with the operation of other conveyor registers. It is now possible to output control and general-purpose pulse signals, which has the effect of providing microcontrollers with a wide range of applications6.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の第1の実施例のタイマユニットの構成
図、第2図はコンベアレジスタ105〜Il+の詳細な
構成図、第3図はカウンタモード信号が”0”のときの
タイマユニットの動作タイミング図、第4図はカウンタ
モード信号が“1”のときのタイマユニットの動作タイ
ミング図、第5図はカウンタモード信号が“l”のとき
の出力ボートから出力されるパルス列のタイミング図、
第6図は本発明の第2の実施例のタイマユニットの構成
図、第7図は第2の実施例でカウンタモード信号が“l
”のときの出力ボートから出力されるパルス列のタイミ
ング図、第8図は一般的なマイコンの構成図、第9図は
交流誘導モータの制御信号とPWMインバータに入力す
る、交流誘導モータの制御信号に対応したマイコンが出
力すべきPWM信号のタイミング図、第10図は従来の
タイマユニットの構成図である。 100・・・データバス、  +01・・・アドレスバ
ス、102・・・読出し信号、  +03・・・書込み
信号、105〜Ill・・・コンベアレジスタ、+12
・・・カウンタ、113〜118・・・アンドゲート、
119〜】22・・・Dラッチ、123・・・ポートラ
ッチ、124〜+27 ・”;’/L、チブレクサ(M
PX)、128〜135・・・出力バッファ、 +36・・・Dラッチ、 137・・・マルチプレクサ(MPX)、138、13
9・・・オアゲート、140.141・・・Dラッチ、
142〜145・・・オアゲート、 +46・・・アンドゲート、 +47・・・リード/ライト制御回路、+48・・・バ
ッファバス、  149・・・オアゲート、+50・・
・トランスファゲート、 +51・・・オアゲート、   +52・・・インバー
タ、153・・・トランスファゲート、 +54・・・Dラッチ、   155・・・オアゲート
、156〜159・・・Dラッチ、 160〜163・・・マルチプレクサ(MPX)。
Fig. 1 is a block diagram of the timer unit according to the first embodiment of the present invention, Fig. 2 is a detailed block diagram of the conveyor registers 105 to Il+, and Fig. 3 is the timer unit when the counter mode signal is "0". Figure 4 is an operation timing diagram of the timer unit when the counter mode signal is "1", and Figure 5 is a timing diagram of the pulse train output from the output port when the counter mode signal is "L". ,
FIG. 6 is a configuration diagram of a timer unit according to a second embodiment of the present invention, and FIG.
Fig. 8 is a configuration diagram of a general microcomputer, Fig. 9 is an AC induction motor control signal and an AC induction motor control signal input to a PWM inverter. 10 is a diagram showing the configuration of a conventional timer unit. 100...Data bus, +01...Address bus, 102...Read signal, +03 ...Write signal, 105~Ill...Conveyor register, +12
...Counter, 113-118...And gate,
119~]22...D latch, 123...Port latch, 124~+27 ・”;'/L, Chibrexa (M
PX), 128 to 135... Output buffer, +36... D latch, 137... Multiplexer (MPX), 138, 13
9...Or gate, 140.141...D latch,
142-145...OR gate, +46...AND gate, +47...Read/write control circuit, +48...Buffer bus, 149...OR gate, +50...
・Transfer gate, +51...OR gate, +52...Inverter, 153...Transfer gate, +54...D latch, 155...OR gate, 156-159...D latch, 160-163... -Multiplexer (MPX).

Claims (1)

【特許請求の範囲】 1、マイクロコンピュータにおいて、 供給されるクロックに基づいて内容を更新するカウンタ
と、 該カウンタの内容と保持している内容の比較を行なう複
数のコンベアレジスタと、 該コンベアレジスタの内容と前記カウンタの内容とが一
致した場合に、一致が発生したコンベアレジスタに対応
して出力信号を生成する出力信号発生回路と、 前記コンベアレジスタと前記カウンタの内容が一致した
場合に、該コンベアレジスタとは別のコンベアレジスタ
の内容を読出す読出し回路と、該読出し回路により読出
された前記コンベアレジスタの内容または前記出力信号
発生回路から発生する出力信号のいずれかを選択的にマ
イクロコンピュータ外部に出力する出力制御回路とを備
えたことを特徴とするマイクロコンピュータ。
[Claims] 1. In a microcomputer, a counter whose contents are updated based on a supplied clock, a plurality of conveyor registers which compare the contents of the counter with held contents, and a plurality of conveyor registers of the conveyor register. an output signal generation circuit that generates an output signal corresponding to a conveyor register in which a match occurs when the content of the counter matches the content of the conveyor register; a readout circuit that reads the contents of a conveyor register other than the register; and a readout circuit that selectively outputs either the contents of the conveyor register read by the readout circuit or the output signal generated from the output signal generation circuit to the outside of the microcomputer. A microcomputer characterized by comprising an output control circuit for outputting data.
JP2327735A 1990-11-27 1990-11-27 Microcomputer Pending JPH04195311A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2327735A JPH04195311A (en) 1990-11-27 1990-11-27 Microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2327735A JPH04195311A (en) 1990-11-27 1990-11-27 Microcomputer

Publications (1)

Publication Number Publication Date
JPH04195311A true JPH04195311A (en) 1992-07-15

Family

ID=18202400

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2327735A Pending JPH04195311A (en) 1990-11-27 1990-11-27 Microcomputer

Country Status (1)

Country Link
JP (1) JPH04195311A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS52106649A (en) * 1976-03-05 1977-09-07 Hitachi Ltd Timing pulse generater
JPH0243609A (en) * 1988-08-04 1990-02-14 Nec Corp Clock control system
JPH0254321A (en) * 1988-07-08 1990-02-23 Siemens Ag Counter timer circuit for microcontroller

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS52106649A (en) * 1976-03-05 1977-09-07 Hitachi Ltd Timing pulse generater
JPH0254321A (en) * 1988-07-08 1990-02-23 Siemens Ag Counter timer circuit for microcontroller
JPH0243609A (en) * 1988-08-04 1990-02-14 Nec Corp Clock control system

Similar Documents

Publication Publication Date Title
US5944775A (en) Sum-of-products arithmetic unit
JPH04195311A (en) Microcomputer
JP2891711B2 (en) Microcomputer
EP1678827B1 (en) Method and apparatus for generating a distortionless pulse width modulated waveform
JP3237673B2 (en) Microcomputer
JPH0831033B2 (en) Data processing device
JPH0414362B2 (en)
JP2692469B2 (en) Data controller
RU1837329C (en) Device for tracing contours of two-dimensional objects
JP3046093B2 (en) Histogram adding device in image processing device
JP2002042493A (en) Memory test circuit
JPH05181795A (en) Counter and information reproducing device using the same
KR0114239Y1 (en) Interrupt handler circuit
JPS61169952A (en) Automatic checking method of one-bit error correcting function of memory
JPH04207218A (en) Pulse selecting circuit
JPS61130989A (en) X ray image processor
JPH0250750A (en) Bus conversion circuit for microcomputer system
JPH04333954A (en) Information processor
JPH09106385A (en) Data transfer control circuit
JPH02146842A (en) Serial interface circuit
JPS63118967A (en) Serial interface circuit
JPS59122041A (en) Polling system
JPH0394538A (en) Data replacement circuit
JPH02267623A (en) Variable synchronizing circuit
JPH0661076B2 (en) Data transfer device