JPH06121591A - Microcomputer - Google Patents

Microcomputer

Info

Publication number
JPH06121591A
JPH06121591A JP4270076A JP27007692A JPH06121591A JP H06121591 A JPH06121591 A JP H06121591A JP 4270076 A JP4270076 A JP 4270076A JP 27007692 A JP27007692 A JP 27007692A JP H06121591 A JPH06121591 A JP H06121591A
Authority
JP
Japan
Prior art keywords
output
value
motor
register
port
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
JP4270076A
Other languages
Japanese (ja)
Other versions
JP2903903B2 (en
Inventor
Tomofumi Higashide
朋史 東出
Hiroko Mihira
裕子 三平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP4270076A priority Critical patent/JP2903903B2/en
Publication of JPH06121591A publication Critical patent/JPH06121591A/en
Application granted granted Critical
Publication of JP2903903B2 publication Critical patent/JP2903903B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Abstract

PURPOSE:To provide a microcomputor for blocking through current at the time of switching a motor while realizing high speed switching. CONSTITUTION:The microcomputor comprises an output latch 6 connected with a buffer register 5, a delay circuit 7 connected between the output latch 6 and output ports P0-P5, a selector 12 selecting register sections 11a, 11b in a compare register 10, and a selector 18 selecting register sections 17a, 17b in a delay designation register 16. A delay time set by a selected delay designation register 16 is stored in a delay storage register 19 and a data, representative of a motor currently controlled, is stored at a motor designation flag 22 through a port output times storing register 20 and an output times counter 21. High speed switching is realized because switching of motor is carried out not through interruption processing based on a command fed from an interruption control section 14 but through utilization of a motor switching request signal being fed upon inversion of the motor designation flag 22.

Description

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

【0001】[0001]

【産業上の利用分野】本発明はリアルタイムに端子出力
制御を行なうマイクロコンピュータに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microcomputer for controlling terminal output in real time.

【0002】[0002]

【従来の技術】従来、マイクロコンピュータ(以下、マ
イコンと称す)には、シングルチップ・マイコン(ある
いはワンチップ・マイコン等)と呼ばれる周辺回路を内
蔵したタイプがある。この周辺回路としては、割り込み
コントローラ,DMA(ダイレクト・メモリ・アクセ
ス)コントローラ,タイマ,シリアル・インターフェー
ス等があり、各種システムの制御を行っている。ここで
対象とするマイコンは、複数個のモータ制御のための波
形を外部へ出力する端子(以下、ポートという)の制御
を行なう周辺回路を有している。
2. Description of the Related Art Conventionally, there is a type of microcomputer (hereinafter referred to as a microcomputer) which has a built-in peripheral circuit called a single-chip microcomputer (or a one-chip microcomputer). This peripheral circuit includes an interrupt controller, a DMA (direct memory access) controller, a timer, a serial interface, etc., and controls various systems. The target microcomputer has a peripheral circuit that controls a terminal (hereinafter referred to as a port) that outputs a plurality of waveforms for controlling a motor to the outside.

【0003】図5はかかる従来の一例を示すマイコンの
構成図である。図5に示すように、マイコン1aは、C
PU2と、割込み制御部14aと、指定した時間ごとに
バッファ・レジスタの値を6つのポートP0〜P5に出
力するポート出力制御部3とを含み、それぞれ内部バス
4により接続されている。このポート出力制御部3a
は、次にポートP0〜P5に出力するデータを格納して
おくためのビットa〜ビットfのレジスタ部23からな
るバッファ・レジスタ5と、ポートP0〜P5に出力し
ているデータを保持するためのラッチ部24からなる出
力ラッチ6と、この出力ラッチ6がバッファ・レジスタ
5の値をラッチする時間の間隔をカウントするタイマ・
カウンタ8と、かかる時間の間隔を指定するコンペア・
レジスタ10aと、タイマ・カウンタ8の値およびコン
ペア・レジスタ10aの値を比較し且つ一致していれば
一致信号101を出力ラッチ6に出力する比較器13
と、タイマ・カウンタ8のカウント動作を開始させるタ
イマ・カウンタ開始ビットST9と、第1のモータ29
および第2のモータ30をモータ制御部28により切り
換えるまでにデータを出力させる回数を格納しておくポ
ート出力回数格納レジスタ20と、この出力回数をカウ
ントし一致信号101を受けてモータ切換要求信号10
3aを出力する出力回数カウンタ21aとから構成され
ている。
FIG. 5 is a block diagram of a microcomputer showing such a conventional example. As shown in FIG. 5, the microcomputer 1a has a C
It includes a PU 2, an interrupt control unit 14a, and a port output control unit 3 that outputs the value of the buffer register to the six ports P0 to P5 at each designated time, and are connected by an internal bus 4. This port output controller 3a
Holds the data output to the ports P0 to P5 and the buffer register 5 including the register unit 23 of the bits a to f for storing the data to be output next to the ports P0 to P5. Of the output latch 6 and a timer for counting the time interval during which the output latch 6 latches the value of the buffer register 5.
Counter 8 and a compare that specifies the time interval
A comparator 13 that compares the value of the timer counter 8 and the value of the compare register 10a with the register 10a and outputs a match signal 101 to the output latch 6 if they match.
And a timer / counter start bit ST9 for starting the counting operation of the timer / counter 8, and the first motor 29.
Also, the port output count storage register 20 that stores the number of times the data is output before the second motor 30 is switched by the motor control unit 28, and the motor switch request signal 10 that counts this output count and receives the coincidence signal 101.
It is composed of an output counter 21a for outputting 3a.

【0004】また、図6は図5におけるポート出力のタ
イミング図である。図6に示すように、ここではポート
出力P0〜P5とタイマスタートからの第1,第2のモ
ータの動作とを表わしている。また、N1,N2はそれ
ぞれ第1,第2のモータに対するポート出力回数であ
る。以下、図5および図6を参照して説明する。
FIG. 6 is a timing chart of the port output in FIG. As shown in FIG. 6, here, the port outputs P0 to P5 and the operation of the first and second motors from the timer start are shown. N1 and N2 are the numbers of port outputs to the first and second motors, respectively. Hereinafter, description will be given with reference to FIGS. 5 and 6.

【0005】まず、CPU2の命令により、ポートP0
〜P5へ接続された第1のモータ29に対する1回目の
出力値(図6では“100011”)を出力ラッチ6
に、第1のモータ29に対する2回目の出力値(図6で
は“110001”)をバッファ・レジスタ5に、1回
目の出力値をポートP0〜P5に出力する期間に対応し
た値(図6ではT11)をコンペア・レジスタ10a
に、第1のモータ29に対するポート出力回数(図6で
はN1)を出力回数カウンタ21aに、また第2のモー
タ30に対するポート出力回数(図6ではN2)をポー
ト出力回数格納レジスタ20にそれぞれあらかじめ設定
しておく。その後、タイマ・カウンタ開始ビットST9
を“1”にセットし、タイマ・カウンタ8のカウント動
作を開始させる。
First, the port P0 is instructed by the instruction of the CPU2.
~ Output latch 6 outputs the first output value ("100011" in Fig. 6) to the first motor 29 connected to P5.
In addition, the second output value (“110001” in FIG. 6) to the first motor 29 is output to the buffer register 5, and the value corresponding to the period in which the first output value is output to the ports P0 to P5 (in FIG. 6, T11) to compare register 10a
In addition, the port output count (N1 in FIG. 6) for the first motor 29 is stored in the output count counter 21a, and the port output count (N2 in FIG. 6) for the second motor 30 is stored in the port output count storage register 20 in advance. Set it. After that, the timer / counter start bit ST9
Is set to "1" to start the counting operation of the timer / counter 8.

【0006】かかるタイマ・カウンタ8はタイマ・カウ
ンタ開始ビットST9が“1”にセットされると“0”
クリアされ、内部クロックCLK入力の立ち上がりエッ
ジを検出するたびに“1”インクリメントするカウント
動作を開始する。また、比較器13はコンペア・レジス
タ10aにあらかじめ設定された値とタイマ・カウンタ
8の値とを常に比較しているので、このタイマ・カウン
タ8がインクリメントした結果コンペア・レジスタ10
aに設定された値と一致したとき、一致信号101を活
性化する。この一致信号101が活性化されると、バッ
ファ・レジスタ5の値は出力ラッチ6にラッチされ、ポ
ートP0〜P5に出力される。すなわち、バッファ・レ
ジスタ5に格納されている第1のモータ29に対する2
回目のポートの出力値が出力ラッチ6にラッチされ、ポ
ートP0〜P5に出力される。また、一致信号101の
活性化により、タイマ・カウンタ8の値は“0”に初期
化され、再びCLKが入力するたびにインクリメントす
るカウント動作を開始する。
The timer counter 8 is set to "0" when the timer counter start bit ST9 is set to "1".
It is cleared and the counting operation of incrementing by "1" is started each time the rising edge of the internal clock CLK input is detected. Further, since the comparator 13 constantly compares the value preset in the compare register 10a with the value of the timer counter 8, the result obtained by the increment of the timer counter 8 is the compare register 10
When it matches the value set in a, the match signal 101 is activated. When the match signal 101 is activated, the value of the buffer register 5 is latched by the output latch 6 and output to the ports P0 to P5. That is, 2 for the first motor 29 stored in the buffer register 5.
The output value of the port for the second time is latched by the output latch 6 and output to the ports P0 to P5. Further, the activation of the coincidence signal 101 initializes the value of the timer / counter 8 to "0", and starts the counting operation for incrementing each time CLK is input again.

【0007】一方、一致信号101はタイマ割り込み要
求信号として割り込み制御部14aに対し供給され、ま
た出力回数検出信号として出力回数カウンタ21aに対
し供給される。この割り込み制御部14aは、一致信号
101がタイマ割り込み要求信号として活性化されたこ
とを検知すると、CPU2に対する割り込み処理要求信
号100を出力する。
On the other hand, the coincidence signal 101 is supplied to the interrupt control section 14a as a timer interrupt request signal, and is also supplied to the output number counter 21a as an output number detection signal. When detecting that the coincidence signal 101 is activated as the timer interrupt request signal, the interrupt control unit 14a outputs the interrupt processing request signal 100 to the CPU 2.

【0008】次に、CPU2は割り込み処理要求信号1
00が活性化したことを検知すると、実行中のプログラ
ム処理を中断し、割り込みプログラム処理を開始する。
この割り込み処理ルーチンでは、ポートP0・〜P5へ
第1のモータ29に対する3回目の出力値(図6では
“111000”)をバッファ・レジスタ5に、第1の
モータ29に対する2回目の出力値をポートP0〜P5
に出力する期間に対応した値(図6ではT12)をコン
ペア・レジスタ10aにそれぞれ設定する。また、出力
回数カンウンタ21aは、出力回数検出信号としての一
致信号101が活性化したことを検知すると、“1”デ
クリメントするカウント動作を開始する。
Next, the CPU 2 sends an interrupt processing request signal 1
When it is detected that 00 is activated, the program processing being executed is interrupted and the interrupt program processing is started.
In this interrupt processing routine, the third output value (“111000” in FIG. 6) for the first motor 29 is output to the ports P0 to P5 in the buffer register 5, and the second output value for the first motor 29 is output. Ports P0-P5
The value (T12 in FIG. 6) corresponding to the period to be output to is set in the compare register 10a. Further, when the output number counter 21a detects that the coincidence signal 101 as the output number detection signal is activated, it starts the counting operation of decrementing "1".

【0009】このデクリメント動作により、出力回数カ
ウンタ21aが“0”となったとき、モータ切り換え要
求信号103aが活性化される。従って、モータ切り換
え要求信号103aが活性化すると、ポート出力回数格
納レジスタ20はあらかじめ設定されていた第2のモー
タ30に対するポート出力回数(図6ではN2)を出力
回数カウンタ21aにプリセットする。
By this decrement operation, when the output counter 21a becomes "0", the motor switching request signal 103a is activated. Therefore, when the motor switching request signal 103a is activated, the port output number storage register 20 presets the preset port output number (N2 in FIG. 6) to the second motor 30 in the output number counter 21a.

【0010】一方、割り込み制御部14aは、モータ切
り換え要求信号103aが活性化されたことを検知する
と、CPU2に対し再び割り込み処理要求信号100を
出力する。この割り込み処理要求信号100が活性化し
たことをCPU2が検知すると、実行中のプログラム処
理を中断し、割り込みプログラム処理を開始する。この
割り込み処理ルーチンでは、ポートP0〜P5へ第2の
モータ30に対する1回目の出力(図6では“1000
11”)を出力ラッチ6に設定する。以下同様に、第2
のモータ30に対する2回目の出力値(図6では“11
0001”)をバッファ・レジスタ5に、第2のモータ
30に対する1回目の出力値をポートP0〜P5に出力
する期間に対応した値(図6ではT21)をコンペア・
レジスタ10aに、第1のモータ29に対するポート出
力回数(図6ではN1)をポート出力回数格納レジスタ
20にそれぞれ設定する。その後、タイマ・カウンタ開
始ビットST9を“1”にセットし、タイマ・カウンタ
8のカウント動作を開始させる。
On the other hand, when the interrupt controller 14a detects that the motor switching request signal 103a has been activated, it outputs the interrupt processing request signal 100 to the CPU 2 again. When the CPU 2 detects that the interrupt processing request signal 100 is activated, the program processing being executed is interrupted and the interrupt program processing is started. In this interrupt processing routine, the first output (“1000 in FIG. 6” to the second motor 30 is output to the ports P0 to P5.
11 ") is set in the output latch 6. Similarly, the second
Second output value to the motor 30 (in FIG. 6, “11
0001 ") to the buffer register 5 and a value (T21 in FIG. 6) corresponding to the period during which the first output value for the second motor 30 is output to the ports P0 to P5.
The port output count (N1 in FIG. 6) for the first motor 29 is set in the register 10a in the port output count storage register 20, respectively. After that, the timer / counter start bit ST9 is set to "1" to start the counting operation of the timer / counter 8.

【0011】このようにして、CPU2により設定され
たコンペア・レジスタ10aの値は、比較器13でタイ
マ・カウンタ8の値と比較される。また、第2のモータ
30に対する1回目の出力値をポートP0〜P5に出力
する期間(図6のT21)を経過したとき、タイマ・カ
ウンタ8の値とコンペア・レジスタ10aの値とが一致
し、前述したように、バッファ・レジスタ5の値を出力
ラッチ6にラッチする。このバッファ・レジスタ5に
は、第2のモータ30に対する2回目のポートへの出力
値が格納されているので、1回目の出力値を出力する期
間が経過した後、第2のモータ30に対する2回目の出
力値がポートP0〜P5に出力される。
In this way, the value of the compare register 10a set by the CPU 2 is compared with the value of the timer counter 8 by the comparator 13. Further, when the period (T21 in FIG. 6) of outputting the first output value to the second motor 30 to the ports P0 to P5 has elapsed, the value of the timer counter 8 and the value of the compare register 10a match. As described above, the value of the buffer register 5 is latched in the output latch 6. Since the buffer register 5 stores the output value of the second motor 30 to the port for the second time, after the period for outputting the first output value elapses, the second motor 30 outputs the second value. The output value of the second time is output to the ports P0 to P5.

【0012】上述した処理を繰り返し実行することによ
り、対応するモータのポートへn回目の出力値を出力す
る期間が終了した時に発生する一致信号により、(n+
1)回目の出力値がポートに出力される。また、この一
致信号により起動される割り込み処理ルーチンにおい
て、(n+2)回目のポート出力値をバッファ・レジス
タ5に、(n+1)回目の出力値をポートに出力する期
間に対応した値をコンペア・レジスタ10aにそれぞれ
設定することによって、任意の期間ごとにポート出力値
を切り換えてポートに出力することができる。しかも、
対応するモータへの出力回数のポート出力が終了したと
きに出力される切り換え信号により起動される割り込み
処理ルーチンで、モータを切り換えることができる。
By repeatedly executing the above-described processing, the coincidence signal generated when the period for outputting the n-th output value to the corresponding motor port is completed causes (n +
1) The output value of the first time is output to the port. In the interrupt processing routine activated by this match signal, the (n + 2) th port output value is output to the buffer register 5, and the (n + 1) th output value is output to the port during the compare register. By setting each to 10a, the port output value can be switched and output to the port every arbitrary period. Moreover,
The motor can be switched by an interrupt processing routine that is started by a switching signal output when the port output corresponding to the number of output times to the corresponding motor is completed.

【0013】[0013]

【発明が解決しようとする課題】上述した従来のポート
出力制御部を備えたマイコンにおいて、ポートP0〜P
5の出力波形を三相インバータモータ出力波形に用いて
モータの制御を行うものとし、またポートP0,P1,
P2を三相波形出力(U相,V相,W相)、P3,P
4,P5のその逆相波形(U反転相,V反転相,W反転
相)として使用するものとする。
In the microcomputer provided with the conventional port output control section described above, the ports P0 to P
The output waveform of No. 5 is used as a three-phase inverter motor output waveform to control the motor, and the ports P0, P1,
P2 is a three-phase waveform output (U phase, V phase, W phase), P3, P
4 and P5 are used as the opposite phase waveforms (U inversion phase, V inversion phase, W inversion phase).

【0014】このとき、ポート出力の切り換わり目で各
ポートの出力が同時に切り換わらないことがある。例え
ば、図6のタイミングにおいて、3回目の出力から4回
目の出力に切り換わる場合、P0(U相)およびP3
(U反転相)の出力値が変化する。この場合、比較器1
3からの各ラッチまでの一致信号101を伝達する信号
線の長さ、各ラッチの特性、各ラッチからポートまでの
信号線の長さ等の要因によって、P3(U反転相)の出
力の切り換わりがP0(U相)より遅れてしまうことが
ある。従って、かかる場合にはP0(U相)とP3(U
反転相)の出力が一瞬同時に“0”となってしまい、貫
通電流が流れてしまうといったモータ制御上の欠点があ
る。
At this time, the output of each port may not be switched at the same time due to the switching of the port output. For example, at the timing of FIG. 6, when switching from the third output to the fourth output, P0 (U phase) and P3
The output value of (U inversion phase) changes. In this case, the comparator 1
Depending on factors such as the length of the signal line transmitting the coincidence signal 101 from 3 to each latch, the characteristics of each latch, the length of the signal line from each latch to the port, etc., the output of P3 (U inversion phase) is switched The replacement may be delayed from P0 (U phase). Therefore, in such a case, P0 (U phase) and P3 (U phase)
There is a drawback in motor control in that the outputs of the reversed phase) become "0" at the same time for a moment and a through current flows.

【0015】また、従来は複数のモータを制御する際に
複数個のマイコンを使用すると、ハードウェアが大きく
なり且つコストがかかるため、1個のマイコンで時分割
に制御している。しかしながら、CPUに対する割り込
み処理によりモータの切り換えを行なっているので、高
速にモータを切り換えることができないという欠点もあ
る。
Further, conventionally, when a plurality of microcomputers are used to control a plurality of motors, the hardware becomes large and the cost is high. Therefore, one microcomputer controls the time division. However, since the motors are switched by interrupt processing to the CPU, there is also a drawback that the motors cannot be switched at high speed.

【0016】本発明の目的は、かかるモータ切り換え時
の貫通電流を防止するとともに、高速切り換えを実現す
ることのできるマイコンを提供することにある。
It is an object of the present invention to provide a microcomputer capable of preventing such a shoot-through current at the time of switching a motor and realizing high-speed switching.

【0017】[0017]

【課題を解決するための手段】本発明のマイコンは、外
部にデータを出力するための出力端子に出力しているデ
ータを保持しておく端子出力値保持手段と、前記出力端
子に次に出力すべきデータを記憶しておく次データ記憶
手段と、前記次データ記憶手段の値を前記端子出力値保
持手段へ格納する時間を記憶する少なくとも2つの格納
時間記憶手段と、前記次データ記憶手段の値を前記端子
出力値保持手段へ格納する時間の間隔を計測し且つ計測
した結果が前記格納時間記憶手段の値と一致したときに
前記次データ記憶手段の値を前記端子出力値保持手段に
格納する手段と、前記次データ記憶手段の値を前記端子
出力値保持手段に格納した時点から前記出力端子に出力
するまでの遅延時間を格納する少なくとも2つの遅延時
間記憶手段と、前記次データ記憶手段の値を前記端子出
力値保持手段に格納した時点から前記出力端子に出力す
るまでの遅延時間を計測し且つ前記次データ記憶手段の
値を前記端子出力値保持手段に格納した直後に前記端子
出力値保持手段の値を前記出力端子に出力するかあるい
は遅延時間を計測した結果が前記遅延時間記憶手段の値
と一致したときに前記端子出力値記憶手段の値を前記出
力端子に出力するかのどちらか一方を前記端子出力値記
憶手段に格納された値により選択し出力する手段と、前
記出力端子にデータを出力した回数を計測し且つ計測し
た値が所定の値になったときに切り換え信号を出力する
手段と、前記切り換え信号により前記遅延時間記憶手段
および前記格納時間記憶手段を切り換える手段とを有
し、リアルタイムに複数の前記出力端子へデータを出力
するように構成される。
The microcomputer of the present invention is provided with a terminal output value holding means for holding data being output to an output terminal for outputting data to the outside, and a next output to the output terminal. Of the next data storage means for storing data to be stored, at least two storage time storage means for storing the time for storing the value of the next data storage means in the terminal output value holding means, and the next data storage means. The value of the next data storage means is stored in the terminal output value holding means when the time interval for storing the value in the terminal output value holding means is measured and the measured result matches the value of the storage time storage means. Means, and at least two delay time storage means for storing a delay time from the time when the value of the next data storage means is stored in the terminal output value holding means to the time when the value is output to the output terminal, Immediately after the delay time from the time when the value of the next data storage means is stored in the terminal output value holding means to the time of outputting to the output terminal is measured and the value of the next data storage means is stored in the terminal output value holding means The value of the terminal output value storage means is output to the output terminal or the value of the terminal output value storage means is output to the output terminal when the result of measuring the delay time matches the value of the delay time storage means. Means for selecting and outputting either one of the output according to the value stored in the terminal output value storage means, and the number of times data is output to the output terminal is measured, and the measured value becomes a predetermined value. And a means for outputting a switching signal at the time of switching, and a means for switching between the delay time storage means and the storage time storage means according to the switching signal. Configured to output the data to.

【0018】[0018]

【実施例】次に、本発明の実施例について図面を参照し
て説明する。
Embodiments of the present invention will now be described with reference to the drawings.

【0019】図1は本発明の一実施例を示すマイコンの
構成図である。図1に示すように、本実施例のマイクロ
コンピュータ(マイコン)1は、CPU2と、このCP
U2に対する割り込み制御部14と、指定した時間毎に
バッファ・レジスタ5の値をポートP0〜P5に出力す
るポート出力制御部3とを備え、それぞれ内部バス4に
より接続されている。
FIG. 1 is a block diagram of a microcomputer showing an embodiment of the present invention. As shown in FIG. 1, a microcomputer 1 of this embodiment includes a CPU 2 and a CP
The interrupt control unit 14 for U2 and the port output control unit 3 for outputting the value of the buffer register 5 to the ports P0 to P5 at every designated time are provided and are connected to each other by the internal bus 4.

【0020】このうち、ポート出力制御部3は、次にポ
ートP0〜P5に出力するデータを格納しておくバッフ
ァ・レジスタ5と、ポートP0〜P5に出力しているデ
ータを保持する出力ラッチ6と、この出力ラッチ6がバ
ッファ・レジスタ5の値をラッチする時間の間隔をカウ
ントするタイマ・カウンタ8と、かかる時間の間隔を指
定する2つのコンペア・レジスタ部11a,11bを備
えたコンペア・レジスタ10と、このコンペア・レジス
タ10を選択するセレクタ12と、かかるタイマ・カウ
ンタ8の値およびコンペア・レジスタ10の値を比較す
る比較器13と、タイマ・カウンタ8のカウント動作を
開始するタイマ・カウンタ開始ビットST9と、遅延時
間をカウントするディレイ・カウンタ15と、この遅延
時間をあらかじめ設定しておくために2つのディレイ指
定レジスタ部17a,17bを備えたディレイ指定レジ
スタ16と、このディレイ指定レジスタ16の値を選択
するセレクタ18と、選択されたディレイ指定レジスタ
部17aあるいは17bに設定された遅延時間を格納し
ておくディレイ格納レジスタ19と、出力ラッチ6の各
ラッチ部24の値が“0”であるときポートP0〜P5
への出力タイミングを遅延させる遅延回路7と、モータ
制御部28により第1,第2のモータ29,30を切り
換えるまでにデータを出力させる回数を格納しておくポ
ート出力回数格納レジスタ20と、この出力回数をカウ
ントする出力回数カウンタ21と、現在制御しているモ
ータがどれであるかを示すモータ指定フラグF22とか
ら構成されている。
Of these, the port output controller 3 stores a buffer register 5 for storing the data to be output next to the ports P0 to P5 and an output latch 6 for holding the data output to the ports P0 to P5. And a timer / counter 8 that counts the time interval at which the output latch 6 latches the value of the buffer register 5, and a compare register that includes two compare register units 11a and 11b that specify the time interval. 10, a selector 12 for selecting the compare register 10, a comparator 13 for comparing the value of the timer counter 8 and the value of the compare register 10, and a timer counter for starting the counting operation of the timer counter 8. The start bit ST9, the delay counter 15 that counts the delay time, and the delay time The delay designating register 16 having two delay designating register sections 17a and 17b for presetting, a selector 18 for selecting the value of the delay designating register 16 and setting in the selected delay designating register section 17a or 17b. When the values of the delay storage register 19 for storing the generated delay time and each latch unit 24 of the output latch 6 are “0”, the ports P0 to P5
A delay circuit 7 for delaying the output timing to the port, a port output count storage register 20 for storing the number of times data is output before the motor control unit 28 switches the first and second motors 29, 30, and It is composed of an output counter 21 for counting the number of outputs and a motor designation flag F22 indicating which motor is currently controlled.

【0021】図2は図1におけるポート出力のタイミン
グ図である。図2に示すように、本実施例も6本のポー
トに出力する場合である。まず、ポート出力動作を開始
するにあたり、CPU2の命令により、ポートP0〜P
5へ第1のモータ29に対する1回目の出力値(図2で
は“000111”)を出力ラッチ6にあらかじめ設定
しておく。同様に、第1のモータ29に対する2回目の
出力値(図2では“100011”)をバッファ・レジ
スタ5に、第1,第2のモータ29,30に対する1回
目の出力値をポートP0〜P5に出力する期間に対応し
た値(図2ではそれぞれT11,T21)をコンペア・
レジスタ10のレジスタ部11a,11bに、第1,第
2のモータ29,30に対するポート出力を“1”から
“0”に切り換えるときに遅延する時間に対応した値
(図2ではそれぞれD1,D2)をディレイ指定レジス
タ16のレジスタ部17a,17bに、第1のモータ2
9に対するポート出力を“1”から“0”に切り換える
ときに遅延する時間に対応した値(図2ではD1)をデ
ィレイ格納レジスタ19に、第1のモータ29に対する
ポート出力回数(図2ではN1)を出力回数カウンタ2
1に、第2のモータ30に対するポート出力回数(図2
ではN2)をポート出力回数格納レジスタ20にそれぞ
れあらかじめ設定しておく。しかる後、タイマ・カウン
タ開始ビットST9を“1”にセットし、タイマ・カウ
ンタ8のカウント動作を開始させる。
FIG. 2 is a timing chart of the port output in FIG. As shown in FIG. 2, the present embodiment is also a case of outputting to six ports. First, when starting the port output operation, the ports P0 to P
5, the first output value (“000111” in FIG. 2) for the first motor 29 is preset in the output latch 6. Similarly, the second output value for the first motor 29 (“100011” in FIG. 2) is stored in the buffer register 5, and the first output value for the first and second motors 29, 30 is stored in the ports P0 to P5. The values (T11 and T21 in Fig. 2) corresponding to the period output to
In the register units 11a and 11b of the register 10, values corresponding to the delay time when switching the port output to the first and second motors 29 and 30 from "1" to "0" (D1 and D2 in FIG. 2 respectively). ) In the register portions 17a and 17b of the delay designation register 16 for the first motor 2
The value (D1 in FIG. 2) corresponding to the delay time when the port output for 9 is switched from "1" to "0" is stored in the delay storage register 19 and the number of port outputs to the first motor 29 (N1 in FIG. 2). ) Output counter 2
1, the number of port outputs to the second motor 30 (see FIG.
Then, N2) is preset in each of the port output count storage registers 20. Then, the timer / counter start bit ST9 is set to "1" to start the counting operation of the timer / counter 8.

【0022】このタイマ・カウンタ8はST9が“1”
にセットされると、“0”クリアされ、内部クロックC
LK入力の立ち上がりエッジを検出するたびに“1”イ
ンクリメントする。比較器13は、コンペア・レジスタ
10にあらかじめ設定された値とタイマ・カウンタ8の
値とを常に比較しており、タイマ・カウンタ8がインク
リメントした結果コンペア・レジスタ10に設定された
値と一致したとき、一致信号101を活性化する。この
一致信号101が活性化するとバッファ・レジスタ5の
各ビット23の値が出力ラッチ6の対応したラッチ部2
4にそれぞれラッチされる。
In this timer / counter 8, ST9 is "1".
Set to 0, it is cleared to "0" and the internal clock C
It is incremented by "1" every time the rising edge of the LK input is detected. The comparator 13 constantly compares the value preset in the compare register 10 with the value of the timer counter 8, and as a result of the increment of the timer counter 8, it coincides with the value set in the compare register 10. At this time, the coincidence signal 101 is activated. When this coincidence signal 101 is activated, the value of each bit 23 of the buffer register 5 corresponds to the latch unit 2 of the output latch 6.
4 respectively.

【0023】しかるに、バッファ・レジスタ5には、あ
らかじめポートP0〜P5へ第1のモータ29に対する
2回目の出力値が格納されているので、出力ラッチ6の
ラッチ部24には上記2回目のポート出力値がラッチさ
れる。また、一致信号101の活性化により、ディレイ
格納レジスタ19の値がディレイ・カウンタ15にプリ
セットされるとともに、ディレイ・カウンタ15は内部
クロックCLK入力の立ち上がりエッジを検出するたび
に“1”デクリメントするカウント動作を開始する。こ
のデクリメント動作によりディレイ・カウンタ15が
“0”となったとき、ワンショット・パルスである一致
信号102がアクティブになり、ディレイ・カウンタ1
5はカウント動作を停止する。
However, since the buffer register 5 previously stores the second output value for the first motor 29 in the ports P0 to P5, the latch section 24 of the output latch 6 stores the second port value. The output value is latched. Further, the activation of the coincidence signal 101 causes the value of the delay storage register 19 to be preset in the delay counter 15, and the delay counter 15 decrements "1" every time it detects the rising edge of the internal clock CLK input. Start operation. When the delay counter 15 becomes "0" by this decrement operation, the coincidence signal 102, which is a one-shot pulse, becomes active and the delay counter 1
5 stops the counting operation.

【0024】ここで、一例としてポートP2への出力に
ついて説明する。まず、出力ラッチ6におけるラッチ部
cには、前述したようにポートP2への2回目の出力値
がラッチされているが、ラッチされている値が“1”で
ある場合、セット・リセット型のフリップ・フロップ2
5がセットされ、ポートP2に“1”を出力する。
Here, the output to the port P2 will be described as an example. First, as described above, the second output value to the port P2 is latched in the latch section c of the output latch 6, but when the latched value is "1", it is a set / reset type. Flip flop 2
5 is set, and "1" is output to the port P2.

【0025】一方、ラッチ部cに格納されている値が
“0”である場合、インバータ26の出力値が“1”と
なり、ANDゲート27に入力されるが、他方の一致信
号102の入力値が“1”になるまでANDゲート27
の出力値は“0”のままとなる。しかる後、前述したよ
うに、ディレイ・カウンタ15によるディレイ期間のカ
ウントが終了したとき、一致信号102は活性化し
“1”となるので、ANDゲート27の出力値は“1”
になる。従って、フリップ・フロップ25がリセットさ
れ、ポートP2に“0”が出力される。
On the other hand, when the value stored in the latch section c is "0", the output value of the inverter 26 becomes "1" and is input to the AND gate 27, but the input value of the other coincidence signal 102. AND gate 27 until becomes "1"
The output value of is still "0". Thereafter, as described above, when the count of the delay period by the delay counter 15 is completed, the coincidence signal 102 is activated and becomes "1", so that the output value of the AND gate 27 is "1".
become. Therefore, the flip-flop 25 is reset and "0" is output to the port P2.

【0026】他のビットも同様に、それぞれラッチ部に
格納された値が“1”である場合には、ラッチされた直
後にポートに“1”を出力し、逆に“0”である場合に
は、ディレイ時間経過後、ポートに“0”を出力する。
Similarly, for the other bits, when the value stored in the latch section is "1", "1" is output to the port immediately after being latched, and vice versa. Outputs "0" to the port after the delay time has elapsed.

【0027】ここで、一致信号101は、割り込み制御
部14と、出力回数カウンタ21とに対して供給され
る。この割り込み制御部14は、一致信号101が活性
化されたことを検知すると、CPU2に対して割り込み
処理要求信号100を供給する。CPU2は割り込み処
理要求信号100が活性化したことを検知すると、実行
中のプログラム処理を中断し、割り込みプログラム処理
を開始する。この割り込み処理ルーチンでは、ポートP
0〜P5へ第1のモータ29に対する3回目の出力値
(図2では“111000”)をバッファ・レジスタ5
に、第1のモータ29に対する2回目の出力期間に対応
した値(図2ではT12)をコンペア・レジスタ部11
aにそれぞれ設定する。
The match signal 101 is supplied to the interrupt controller 14 and the output counter 21. When detecting that the coincidence signal 101 is activated, the interrupt control unit 14 supplies the interrupt processing request signal 100 to the CPU 2. When the CPU 2 detects that the interrupt processing request signal 100 is activated, the CPU 2 interrupts the program processing being executed and starts the interrupt program processing. In this interrupt processing routine, port P
From 0 to P5, the third output value (“111000” in FIG. 2) to the first motor 29 is stored in the buffer register 5
In addition, the value (T12 in FIG. 2) corresponding to the second output period for the first motor 29 is set to the compare register unit 11
Set to a respectively.

【0028】一方、出力回数カウンタ21は、一致信号
101が活性化したことを検知すると、“1”デクリメ
ントする。このデクリメント動作により出力回数カウン
タ21が“0”となったとき、出力回数カウンタ21か
らのボローによりモータ指定フラグF22が反転し、モ
ータ切り換え要求信号103を発生する。このモータ切
り換え要求信号103により、モータ制御部28は制御
するモータを第1のモータ29から第2のモータ30に
切り換える。
On the other hand, when the output signal counter 21 detects that the coincidence signal 101 is activated, it decrements by "1". When the output number counter 21 becomes "0" by the decrement operation, the borrow from the output number counter 21 inverts the motor designation flag F22 and generates the motor switching request signal 103. By the motor switching request signal 103, the motor control unit 28 switches the controlled motor from the first motor 29 to the second motor 30.

【0029】また、モータ切り換え要求信号103が活
性化すると、セレクタ18はディレイ指定レジスタ16
のディレイ指定レジスタ部17aを第2のモータ30に
対する遅延時間を指定するディレイ指定レジスタ部17
bに切り換え、第2のモータ30に対する遅延時間(図
2ではD2)をディレイ格納レジスタ19に設定する。
このとき、ポート出力回数格納レジスタ20は、あらか
じめ設定されていた第2のモータ30に対するポート出
力回数を出力回数カウンタ21にプリセットする。
When the motor switching request signal 103 is activated, the selector 18 causes the delay designating register 16 to operate.
Of the delay designation register unit 17a for designating the delay time for the second motor 30.
b, and the delay time (D2 in FIG. 2) for the second motor 30 is set in the delay storage register 19.
At this time, the port output count storage register 20 presets the preset port output count for the second motor 30 in the output count counter 21.

【0030】更に、セレクタ12はモータ切り換え要求
信号103の活性化によりコンペア・レジスタ10内の
レジスタ部11aを第2のモータ30に対する1回目の
出力期間に対応した値(図2ではT21)を格納してい
るレジスタ部11bに切り換える。
Further, the selector 12 stores the value (T21 in FIG. 2) corresponding to the first output period for the second motor 30 in the register section 11a in the compare register 10 by activating the motor switching request signal 103. It is switched to the register section 11b which is operating.

【0031】しかるに、CPU2は割り込み要求信号1
00を検出すると、実行中のプログラム処理を中断し割
り込み処理プログラムを開始する。この割り込み処理プ
ログラム中でCPU2は出力回数カウンタ21の値を読
みだし、その値が“1”の時、ポートP0〜P5へ第2
のモータ30に対する1回目の出力値(図2では000
111)をバッファ・レジスタ5に設定する。た、出力
回数カウンタ21の値が“0”の時は、第2のモータ3
0に対する2回目の出力値(図2では100011)を
バッファ・レジスタ5に、第1のモータ29に対するポ
ート出力回数(図2ではN1)をポート出力回数格納レ
ジスタ20に、第1のモータ29に対する1回目の出力
期間に対応した値(図2ではT11)をコンペア・レジ
スタ10のレジスタ部11aにそれぞれ設定する。その
後、タイマ・カウンタ開始ビットST9を“1”にセッ
トし、タイマ・カウンタ8のカウント動作を開始させ
る。
However, the CPU 2 uses the interrupt request signal 1
When 00 is detected, the program processing being executed is interrupted and the interrupt processing program is started. In this interrupt processing program, the CPU 2 reads the value of the output counter 21, and when the value is "1", the second value is sent to the ports P0 to P5.
Output value to the motor 30 of
111) is set in the buffer register 5. When the value of the output counter 21 is "0", the second motor 3
The second output value for 0 (100011 in FIG. 2) is stored in the buffer register 5, the port output count (N1 in FIG. 2) for the first motor 29 is stored in the port output count storage register 20, and the first motor 29 is stored. A value (T11 in FIG. 2) corresponding to the first output period is set in the register section 11a of the compare register 10. After that, the timer / counter start bit ST9 is set to "1" to start the counting operation of the timer / counter 8.

【0032】上述したように、CPU2により設定され
たコンペア・レジスタ10のレジスタ部11bの値は、
セレクタ12を通り比較器13でタイマ・カウンタ8の
値と比較される。従って、第2のモータ30に対する1
回目の出力値を出力する期間(図2のT21)を経過し
たとき、比較器13はタイマ・カウンタ8の値とコンペ
ア・レジスタ10のレジスタ部11bの値との一致を検
出し、第1のモータ29に対する1回目の一致検出時と
同様の動作を行う。また、第2のモータ30から第1の
モータ29に切り換える場合も第1のモータ29から第
2のモータ30に切り換える場合と同様の動作を行う。
As described above, the value of the register section 11b of the compare register 10 set by the CPU 2 is
It passes through the selector 12 and is compared with the value of the timer counter 8 by the comparator 13. Therefore, one for the second motor 30
When the period for outputting the output value for the second time (T21 in FIG. 2) has elapsed, the comparator 13 detects a match between the value of the timer counter 8 and the value of the register section 11b of the compare register 10, and The same operation as the first match detection for the motor 29 is performed. Also, when switching from the second motor 30 to the first motor 29, the same operation as when switching from the first motor 29 to the second motor 30 is performed.

【0033】上記処理を繰り返し行うことによって、ポ
ートへの出力値が“0”である場合にポートへ出力する
タイミングを遅延させながら、任意の時間ごとにポート
に出力する値を高速に切り換えることができ、切り換え
時の貫通電流を防止することができる。また、対応する
モータへのポート出力が所定回数を終了したときに出力
される信号によりモータ指定フラグを反転させることに
より、ポートに出力される切り換え信号を利用してモー
タを高速に切り換えることができる。
By repeating the above processing, when the output value to the port is "0", the value output to the port can be switched at high speed while delaying the output timing to the port. It is possible to prevent a through current at the time of switching. Further, by inverting the motor designation flag by the signal output when the port output to the corresponding motor has finished the predetermined number of times, the motor can be switched at high speed using the switching signal output to the port. .

【0034】図3は本発明の他の実施例を説明するため
のマイコンにおける遅延回路図であり、また図4は図3
におけるポート出力のタイミング図である。図3および
図4に示すように、本実施例は前述した図1の一実施例
とほぼ同様の構成であり、遅延回路7のみが異ってい
る。以下、この遅延回路7について説明するが、その他
の回路は図1を用いる。
FIG. 3 is a delay circuit diagram in a microcomputer for explaining another embodiment of the present invention, and FIG. 4 is a circuit diagram of FIG.
3 is a timing diagram of port output in FIG. As shown in FIGS. 3 and 4, this embodiment has substantially the same configuration as that of the above-described embodiment of FIG. 1 except for the delay circuit 7. The delay circuit 7 will be described below, but FIG. 1 is used for the other circuits.

【0035】まず、遅延回路7は出力ラッチ6の各ラッ
チ部a〜fの値が“1”であるとき、ポートへ出力する
タイミングを遅延させるための論理回路であり、フリッ
プフロップ25とインバータ26およびアンドゲート2
7とを備えている。また、本実施例も、前述した一実施
例と同様に、ポートP2への出力を例にとる。
First, the delay circuit 7 is a logic circuit for delaying the timing of outputting to the port when the value of each of the latch parts a to f of the output latch 6 is "1", and the flip-flop 25 and the inverter 26 are provided. And AND gate 2
7 and 7. Also, in this embodiment, similarly to the above-described embodiment, the output to the port P2 is taken as an example.

【0036】次に、コンペア・レジスタ10の値とタイ
マ・カウンタ8の値とが一致したときに活性化される一
致信号101により、出力ラッチ部c24にはバッファ
・レジスタ5のビット部c23の値がラッチされる。こ
の出力ラッチ部cにラッチされた値が“0”である場
合、インバータ26の出力値が“1”となり、セット・
リセット型のフリップ・フロップ25がリセットされ且
つポートP2に“0”が出力される。
Next, the output latch section c24 causes the value of the bit section c23 of the buffer register 5 to be changed by the match signal 101 which is activated when the value of the compare register 10 and the value of the timer counter 8 match. Is latched. When the value latched by the output latch unit c is "0", the output value of the inverter 26 becomes "1", and
The reset flip-flop 25 is reset and "0" is output to the port P2.

【0037】一方、出力ラッチ6にラッチされた値が
“1”である場合は、“1”がANDゲート27に入力
されるが、他方のディレイ・カウンタ15の出力である
一致信号102の入力値が“1”になるまで、ANDゲ
ート27の出力値は“0”のままとなる。すなわち、デ
ィレイ・カウンタ15は前述した一実施例と同様、遅延
時間をカウントしている。このディレイ・カウンタ15
による遅延時間のカウントが終了したとき、一致信号1
02は活性化され“1”となるので、ANDゲート27
の出力値は“1”となり、フリップ・フロップ25がセ
ットされ、ポートP2に“0”が出力される。他のポー
トP0,P1,P3〜P5への出力もポートP2と同様
の動作で行われる。
On the other hand, when the value latched by the output latch 6 is "1", "1" is input to the AND gate 27, but the coincidence signal 102 which is the output of the other delay counter 15 is input. The output value of the AND gate 27 remains "0" until the value becomes "1". That is, the delay counter 15 counts the delay time as in the above-described embodiment. This delay counter 15
When the counting of the delay time due to
02 is activated and becomes "1", so the AND gate 27
Has an output value of "1", the flip-flop 25 is set, and "0" is output to the port P2. The output to the other ports P0, P1, P3 to P5 is also performed by the same operation as the port P2.

【0038】かかる処理を繰り返し行うことにより、ポ
ートへの出力値が“1”である場合にポートへ出力する
タイミングを遅延させながら、任意の時間ごとにポート
に出力する値を切り換えることができ、一実施例と同様
の動作によりモータ制御部28を介して第1,第2のモ
ータ29,30を切り換えることができる。
By repeating this processing, when the output value to the port is "1", the value to be output to the port can be switched at any time while delaying the timing to output to the port. The first and second motors 29 and 30 can be switched via the motor control unit 28 by the same operation as that of the first embodiment.

【0039】[0039]

【発明の効果】以上説明したように、本発明のマイコン
は、複数のポートに出力する出力値を同時に切り換える
際に、出力値を指定した時間を経過した直後に次の出力
値をポートに出力するか、あるいは一定遅延させてから
ポート出力するかをポートに出力する値によって選択し
て出力し且つ遅延時間をある期間毎に切り換えることに
より、複数個のモータを制御することができるので、ポ
ート出力波形を三相インバータモータ出力波形に用いた
場合にも相対する相(P0出力とP3出力、P1出力と
P4出力、P2出力とP5出力)が一瞬同時に“0”と
なることがなく、貫通電流を流さないようにすることが
できるという効果がある。
As described above, the microcomputer of the present invention outputs the next output value to the port immediately after the designated time of the output value has elapsed when the output values output to the plurality of ports are simultaneously switched. It is possible to control multiple motors by selecting whether to output to the port after a certain delay or output to the port according to the value to be output to the port and switching the delay time at certain intervals. Even when the output waveform is used as the output waveform of the three-phase inverter motor, the phases (P0 output and P3 output, P1 output and P4 output, P2 output and P5 output) that are opposite to each other do not momentarily become "0" at the same time, and penetrate. There is an effect that the current can be prevented from flowing.

【0040】また、本発明は複数個のモータを制御する
場合、ポート出力を切り換えるときに遅延する時間に対
応した値を各モータ毎の特性に合わせて設定し且つ各モ
ータのポート出力期間毎に設定した遅延時間を切り換え
ることにより、モータの切り換えを割り込み処理ではな
く、モータ指定フラグの反転により出力される切り換え
信号を利用することにより行えるので、モータの切り換
えを高速に行うことができるという効果がある。
Further, according to the present invention, when controlling a plurality of motors, a value corresponding to the delay time when switching the port output is set in accordance with the characteristics of each motor, and for each port output period of each motor. By switching the set delay time, the motor switching can be performed not by interrupt processing but by using the switching signal output by the inversion of the motor designation flag, so that the motor switching can be performed at high speed. is there.

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

【図1】本発明の一実施例を示すマイコンの構成図であ
る。
FIG. 1 is a configuration diagram of a microcomputer showing an embodiment of the present invention.

【図2】図1におけるポート出力のタイミング図であ
る。
FIG. 2 is a timing diagram of port output in FIG.

【図3】本発明の他の実施例を説明するためのマイコン
における遅延回路図である。
FIG. 3 is a delay circuit diagram in a microcomputer for explaining another embodiment of the present invention.

【図4】図3におけるポート出力のタイミング図であ
る。
FIG. 4 is a timing diagram of port output in FIG.

【図5】従来の一例を示すマイコンの構成図である。FIG. 5 is a configuration diagram of a microcomputer showing a conventional example.

【図6】図5におけるポート出力のタイミング図であ
る。
FIG. 6 is a timing diagram of port output in FIG.

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

1 マイクロコンピュータ(マイコン) 2 CPU 3 ポート出力制御部 5 バッファ・レジスタ 6 出力ラッチ 7 遅延回路 8 タイマ・カウンタ 9 開始ビット(ST) 10 コンペア・レジスタ 12,18 セレクタ 13 比較器 14 割込み制御部 15 ディレイ・カウンタ 16 ディレイ指定レジスタ 19 ディレイ格納レジスタ 20 ポート出力回数格納レジスタ 21 出力回数カウンタ 22 モータ指定フラグ(F) 23 レジスタ・ビット部 24 ラッチ部 25 フリップ・フロップ 26 インバータ 27 アンドゲート P0〜P5 ポート出力 1 Microcomputer (microcomputer) 2 CPU 3 Port output controller 5 Buffer register 6 Output latch 7 Delay circuit 8 Timer counter 9 Start bit (ST) 10 Compare register 12, 18 Selector 13 Comparator 14 Interrupt controller 15 Delay・ Counter 16 Delay designation register 19 Delay storage register 20 Port output count storage register 21 Output count counter 22 Motor designation flag (F) 23 Register bit part 24 Latch part 25 Flip flop 26 Inverter 27 AND gate P0 to P5 port output

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 外部にデータを出力するための出力端子
に出力しているデータを保持しておく端子出力値保持手
段と、前記出力端子に次に出力すべきデータを記憶して
おく次データ記憶手段と、前記次データ記憶手段の値を
前記端子出力値保持手段へ格納する時間を記憶する少な
くとも2つの格納時間記憶手段と、前記次データ記憶手
段の値を前記端子出力値保持手段へ格納する時間の間隔
を計測し且つ計測した結果が前記格納時間記憶手段の値
と一致したときに前記次データ記憶手段の値を前記端子
出力値保持手段に格納する手段と、前記次データ記憶手
段の値を前記端子出力値保持手段に格納した時点から前
記出力端子に出力するまでの遅延時間を格納する少なく
とも2つの遅延時間記憶手段と、前記次データ記憶手段
の値を前記端子出力値保持手段に格納した時点から前記
出力端子に出力するまでの遅延時間を計測し且つ前記次
データ記憶手段の値を前記端子出力値保持手段に格納し
た直後に前記端子出力値保持手段の値を前記出力端子に
出力するかあるいは遅延時間を計測した結果が前記遅延
時間記憶手段の値と一致したときに前記端子出力値記憶
手段の値を前記出力端子に出力するかのどちらか一方を
前記端子出力値記憶手段に格納された値により選択し出
力する手段と、前記出力端子にデータを出力した回数を
計測し且つ計測した値が所定の値になったときに切り換
え信号を出力する手段と、前記切り換え信号により前記
遅延時間記憶手段および前記格納時間記憶手段を切り換
える手段とを有し、リアルタイムに複数の前記出力端子
へデータを出力することを特徴とするマイクロコンピュ
ータ。
1. A terminal output value holding means for holding data output to an output terminal for outputting data to the outside, and next data for storing data to be output next to the output terminal. Storage means, at least two storage time storage means for storing the time for storing the value of the next data storage means in the terminal output value holding means, and storing the value of the next data storage means in the terminal output value holding means And a means for storing the value of the next data storage means in the terminal output value holding means when the measured result coincides with the value of the storage time storage means; At least two delay time storage means for storing a delay time from the time when the value is stored in the terminal output value holding means to the time when the value is output to the output terminal, and the value of the next data storage means is output to the terminal. The value of the terminal output value holding means is measured immediately after the delay time from the time of storage in the value holding means to the output to the output terminal is measured and immediately after the value of the next data storage means is stored in the terminal output value holding means. Either output to the output terminal or output the value of the terminal output value storage means to the output terminal when the result of measuring the delay time matches the value of the delay time storage means. Means for selecting and outputting the value stored in the output value storage means, means for measuring the number of times data is output to the output terminal, and means for outputting a switching signal when the measured value reaches a predetermined value, The delay time storage means and the storage time storage means according to the switching signal, and outputs data to the plurality of output terminals in real time. Lee Black computer.
JP4270076A 1992-10-08 1992-10-08 Microcomputer Expired - Lifetime JP2903903B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4270076A JP2903903B2 (en) 1992-10-08 1992-10-08 Microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4270076A JP2903903B2 (en) 1992-10-08 1992-10-08 Microcomputer

Publications (2)

Publication Number Publication Date
JPH06121591A true JPH06121591A (en) 1994-04-28
JP2903903B2 JP2903903B2 (en) 1999-06-14

Family

ID=17481196

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4270076A Expired - Lifetime JP2903903B2 (en) 1992-10-08 1992-10-08 Microcomputer

Country Status (1)

Country Link
JP (1) JP2903903B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104360613A (en) * 2014-10-15 2015-02-18 诸暨中澳自动化设备有限公司 Control circuit of intelligent electric tool

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104360613A (en) * 2014-10-15 2015-02-18 诸暨中澳自动化设备有限公司 Control circuit of intelligent electric tool

Also Published As

Publication number Publication date
JP2903903B2 (en) 1999-06-14

Similar Documents

Publication Publication Date Title
US7626438B2 (en) Circuit to switch between clock signals and related method
JP3322893B2 (en) Microcomputer
JP3156269B2 (en) Digital three-phase PWM waveform generator
JPH02165721A (en) Pulse output device
US5535376A (en) Data processor having a timer circuit for performing a buffered pulse width modulation function and method therefor
EP0510833A2 (en) Data processing apparatus having address decoder
EP0695987B1 (en) Improved timer for a data processor
JP2004357450A (en) Pwm circuit and micro controller
JPH06121591A (en) Microcomputer
JP2658549B2 (en) Microcomputer
US4144447A (en) Interval timer
JP2773546B2 (en) Pulse generation circuit
JPH06348507A (en) Microcomputer
JPH06244739A (en) Multiplexer circuit
JP2512119B2 (en) Microprocessor
JP3248698B2 (en) PWM signal generator
US5862352A (en) Variable period and assertion width REQ/ACK pulse generator for synchronous SCSI data transfers
JP2626125B2 (en) Microcomputer
SU1709485A1 (en) Digital dc drive
JPH06139076A (en) Interruption processor
JPH08139576A (en) Contact point noise elimination circuit
JPH02280263A (en) Microprocessor
JPH02259954A (en) Input/output bus cycle control circuit
JPH05215870A (en) Timer
JPH06187065A (en) Clock switching circuit

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19990223