JP2597729B2 - Microcomputer - Google Patents

Microcomputer

Info

Publication number
JP2597729B2
JP2597729B2 JP2040658A JP4065890A JP2597729B2 JP 2597729 B2 JP2597729 B2 JP 2597729B2 JP 2040658 A JP2040658 A JP 2040658A JP 4065890 A JP4065890 A JP 4065890A JP 2597729 B2 JP2597729 B2 JP 2597729B2
Authority
JP
Japan
Prior art keywords
output
processing unit
data
central processing
circuit
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.)
Expired - Fee Related
Application number
JP2040658A
Other languages
Japanese (ja)
Other versions
JPH03242776A (en
Inventor
幸枝 黒田
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 JP2040658A priority Critical patent/JP2597729B2/en
Publication of JPH03242776A publication Critical patent/JPH03242776A/en
Application granted granted Critical
Publication of JP2597729B2 publication Critical patent/JP2597729B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、出力装置からの出力データにより、外部の
様々な回路を操作するマイクロコンピュータに関するも
のである。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microcomputer that operates various external circuits based on output data from an output device.

〔従来の技術〕[Conventional technology]

第3図は従来のマイクロコンピュータの入出力機能を
示すブロック図であって、図中、1は中央演算処理装置
(以下、CPUと省略する)、2は出力装置(以下ポート
と呼ぶ)の機能ブロックで、CPU1とはアドレスバス3お
よびデータバス4を介して接続されている。5は周辺回
路であり、タイマ,シリアルI/O,A/D変換器等のいくつ
かの周辺機能を示している。
FIG. 3 is a block diagram showing an input / output function of a conventional microcomputer. In the figure, reference numeral 1 denotes a central processing unit (hereinafter abbreviated as CPU) and 2 denotes an output device (hereinafter referred to as a port). The block is connected to the CPU 1 via an address bus 3 and a data bus 4. Reference numeral 5 denotes a peripheral circuit, which indicates several peripheral functions such as a timer, a serial I / O, and an A / D converter.

次に、ポートを介して出力を行なう場合の動作を説明
する。ポート出力はポート入出力方向レジスタとポート
データレジスタの設定により決まる。CPU1はバス3,4を
介してポート2内の出力方向レジスタとデータレジスタ
を設定する。このCPUからの書き込みのタイミングでポ
ートの出力データが切り替わる。なお、ポート入出力方
向レジスタはデータの入出力方向を切り換えるためのも
のであり、またデータレジスタは外部回路を制御するた
めのデータを設定するためのものである。
Next, the operation when output is performed via a port will be described. The port output is determined by the settings of the port input / output direction register and the port data register. The CPU 1 sets an output direction register and a data register in the port 2 via the buses 3 and 4. The output data of the port is switched at the timing of writing from the CPU. The port input / output direction register is for switching the data input / output direction, and the data register is for setting data for controlling an external circuit.

〔発明が解決しようとする課題〕[Problems to be solved by the invention]

従来のマイクロコンピュータのポート出力機能は以上
のように構成されているので、ポートの出力データの切
替えはCPUによってのみ可能であるため、CPUは常に他の
周辺機能の操作と監視を行いながら、ポート出力の設定
処理を行なう負担を負う。また、ある周辺機能の動作終
了時にポート出力を切替えるような場合、動作終了を感
知した後、ポートの出力データ切り替えの処理が完了す
るまでに無視できない時間を要するという問題があっ
た。
Since the port output function of the conventional microcomputer is configured as described above, the output data of the port can be switched only by the CPU, so the CPU always operates and monitors other peripheral functions while the port operates. It bears the burden of performing output setting processing. Further, when the port output is switched at the end of the operation of a certain peripheral function, there is a problem that it takes a considerable time to complete the process of switching the output data of the port after detecting the end of the operation.

本発明はこのような問題を解決するためになされたも
ので、CPUはポートの出力データ切替えタイミングを始
終図る必要がなくなり、また、ポートの出力データ切替
えの遅延時間も解消することができるマイクロコンピュ
ータを提供することを目的とする。
The present invention has been made in order to solve such a problem, and it is not necessary for the CPU to start and stop the timing of switching the output data of the port, and the microcomputer can also eliminate the delay time of switching the output data of the port. The purpose is to provide.

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

この発明に係るマイクロコンピュータは、中央演算処
理装置と、該中央演算処理装置によりカウントの開始が
制御される第1および第2のタイマを有する周辺回路
と、上記中央演算処理装置から設定されたデータを出力
する出力装置と、上記中央演算処理装置からの極性設定
データを保持する第1の保持回路,上記第2のタイマか
らの制御信号に応じて上記第1の保持回路から出力され
た極性設定データの伝達を制御するゲート回路,このゲ
ート回路の出力により出力の極性が設定された後上記第
1のタイマからの制御信号に応じて当該設定された極性
が維持もしくは反転される第2の保持回路を有し、上記
中央演算処理装置が出力データを設定した後、当該中央
演算処理装置の制御から独立して、外部へ出力するデー
タの内容を任意のタイミングで切替える切替手段とを備
えるようにしたものである。
A microcomputer according to the present invention includes a central processing unit, a peripheral circuit having first and second timers whose start of counting is controlled by the central processing unit, and data set from the central processing unit. Output device, a first holding circuit for holding polarity setting data from the central processing unit, and a polarity setting output from the first holding circuit in response to a control signal from the second timer. A gate circuit for controlling the transmission of data, a second holding circuit for maintaining or inverting the set polarity according to a control signal from the first timer after an output polarity is set by an output of the gate circuit; After the central processing unit sets the output data, the content of the data to be output to the outside can be set to an arbitrary value independently of the control of the central processing unit. It is obtained so as to comprise a switching means for switching in ring.

〔作用〕[Action]

本発明においては、上述のように構成したので、CPU
が一旦、ポート出力データの初期値設定を行うと、以降
はCPUの制御から独立して他の周辺機能の起動によりポ
ート出力が切り替わるように動作することで、CPUを介
することなく、周辺回路の発する信号だけでポート出力
を反転させることができる。
In the present invention, since the configuration is as described above, the CPU
Once the initial value of the port output data is set, the port output is switched by the activation of other peripheral functions independently of the control of the CPU. The port output can be inverted only by the signal generated.

〔実施例〕〔Example〕

以下、本発明の一実施例を図について説明する。 Hereinafter, an embodiment of the present invention will be described with reference to the drawings.

第1図は本発明の一実施例によるマイクロコンピュー
タの構成を示す図であって、図中、1はCPU、2は従来
例と同様のポート出力回路(入出力回路)で、本実施例
はこれに周辺回路5からの制御信号によって動作する第
2出力制御回路6を付加し、第2出力制御回路6の出力
とポート出力回路2の出力とはCPU1の制御によるスイッ
チ9a,9bでその一方を選択できるように構成にしたもの
である。
FIG. 1 is a diagram showing a configuration of a microcomputer according to one embodiment of the present invention, in which 1 is a CPU, 2 is a port output circuit (input / output circuit) similar to the conventional example, A second output control circuit 6 operated by a control signal from the peripheral circuit 5 is added to this, and the output of the second output control circuit 6 and the output of the port output circuit 2 are switched by switches 9a and 9b controlled by the CPU 1 to one of them. Is configured to be selectable.

第2図は第2出力制御回路の一構成例である。ここで
は周辺回路としての2つのタイマA,Bから制御信号を受
け取り、これによりポート制御回路2出力の極性(HIGH
/LOW)を決定するトグルフリップフロップ7を制御する
場合を例にとって説明する。
FIG. 2 is a configuration example of a second output control circuit. Here, control signals are received from two timers A and B as peripheral circuits, and the polarity of the output of the port control circuit 2 (HIGH) is thereby obtained.
/ LOW) will be described as an example.

まず、CPU1がバス3,4を介して極性設定バッファ8に
データを設定し、かつタイマA,Bに対してカウントの開
始を命令する。タイマBが制御信号を発すると、初期デ
ータがトグルフリップフロップ7にセットされ、以降は
タイマAが制御信号を発するたびにトグルフリップフロ
ップの出力Q,の極性が反転する。従って、ポート出力
はCPUから独立して、しかもタイマAからの制御信号で
リアルタイムに反応し、極性を切り替えることができる
ようになる。
First, the CPU 1 sets data in the polarity setting buffer 8 via the buses 3 and 4, and instructs the timers A and B to start counting. When the timer B issues the control signal, the initial data is set in the toggle flip-flop 7, and thereafter, whenever the timer A issues the control signal, the polarity of the output Q of the toggle flip-flop is inverted. Therefore, the port output can respond to the control signal from the timer A in real time independently of the CPU and switch the polarity.

このように、本実施例によれば、CPUはポートの出力
データ切り替えタイミングを始終図る必要がなくなり、
またポート出力の切り替えにおいても、周辺回路の動作
にリアルタイムに反応するので、外部回路(例えばモー
タ駆動制御回路など)に対してもより簡単なソフトウェ
アの処理で、より高精度に制御できるという優れた効果
が得られる。
As described above, according to this embodiment, the CPU does not need to start and stop the output data switching timing of the port,
In addition, since the port output is switched in real time to the operation of the peripheral circuit even when the port output is switched, it is possible to control the external circuit (for example, a motor drive control circuit) with simpler software processing and with higher accuracy. The effect is obtained.

なお、タイマAのカウントがタイマBのオーバーフロ
ーで開始され、タイマBの制御信号はタイマBのオーバ
ーフロー時に発せられ、タイマAの制御信号はタイマA
のカウント開始をオーバーフローの両者で発せられると
いう構成においては、タイマA,タイマBのカウント値を
適当に替えることにより、本マイクロコンピュータは正
弦波形成に優れた効果をもち、独立して操作できる第2
出力制御回路を3つ備えることにより、インバータモー
タの制御装置として有効に利用できる。
The timer A starts counting when the timer B overflows, the control signal for the timer B is issued when the timer B overflows, and the control signal for the timer A is timer A
In the configuration in which the count start of the timer is caused by both overflows, the microcomputer has an excellent effect on sine wave formation by appropriately changing the count values of the timers A and B, and can be operated independently. 2
By providing three output control circuits, it can be effectively used as a control device for an inverter motor.

また、上記実施例では制御信号源の一例として2つの
タイマA,Bをとりあげたが、制御信号はこれに限られる
ものではなく、他の周辺機能の信号を利用してもよく、
上記実施例と全く同様の効果が得られる。
Further, in the above embodiment, two timers A and B are taken as an example of the control signal source, but the control signal is not limited to this, and a signal of another peripheral function may be used.
The same effects as in the above embodiment can be obtained.

〔発明の効果〕〔The invention's effect〕

以上のように、この発明に係るマイクロコンピュータ
によれば、中央演算処理装置と、該中央演算処理装置に
よりカウントの開始が制御される第1および第2のタイ
マを有する周辺回路と、上記中央演算処理装置から設定
されたデータを出力する出力装置と、上記中央演算処理
装置からの極性設定データを保持する第1の保持回路,
上記第2のタイマからの制御信号に応じて上記第1の保
持回路から出力された極性設定データの伝達を制御する
ゲート回路,このゲート回路の出力により出力の極性が
設定された後上記第1のタイマからの制御信号に応じて
当該設定された極性が維持もしくは反転される第2の保
持回路を有し、上記中央演算処理装置が出力データを設
定した後、当該中央演算処理装置の制御から独立して、
外部へ出力するデータの内容を任意のタイミングで切替
える切替手段とを備えることにより、CPUを介すること
なく周辺回路の発する信号でポート出力切替えを制御で
きるようにしたので、CPUはポート出力の初期値を設定
し、周辺回路の動作開始命令を送った後は、周辺回路の
操作,監視やポート出力の制御処理を行う必要はなくな
り、この時間を他の演算やデータ処理などにあてること
ができるので、CPUの処理効率の向上が図れる効果があ
る。
As described above, according to the microcomputer of the present invention, the central processing unit, the peripheral circuit having the first and second timers whose start of counting is controlled by the central processing unit, and the central processing unit An output device for outputting data set from the processing device, a first holding circuit for holding polarity setting data from the central processing unit,
A gate circuit for controlling transmission of the polarity setting data output from the first holding circuit in response to a control signal from the second timer, and after the output polarity is set by the output of the gate circuit, the first circuit A second holding circuit in which the set polarity is maintained or inverted in accordance with a control signal from the timer of the above. After the central processing unit sets output data, the control of the central processing unit Independently,
By providing switching means for switching the content of data to be output to the outside at an arbitrary timing, port output switching can be controlled by a signal generated by a peripheral circuit without passing through the CPU. After setting the peripheral circuit and sending a peripheral circuit operation start command, there is no need to perform peripheral circuit operation, monitoring, or port output control processing. This time can be used for other calculations and data processing. This has the effect of improving the processing efficiency of the CPU.

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

第1図は本発明に係るマイクロコンピュータの構成を示
すブロック図、第2図は本発明に係るマイクロコンピュ
ータの実施例を示す図、第3図は従来のマイクロコンピ
ュータの構成を示すブロック図である。 図において、1はCPU、2は入出力回路、3はアドレス
バス、4はデータバス、5は周辺回路、6は第2出力制
御回路、7はトグルフリップフロップ、8は出力データ
設定バッファである。 なお図中同一符号は同一又は相当部分を示す。
FIG. 1 is a block diagram showing a configuration of a microcomputer according to the present invention, FIG. 2 is a diagram showing an embodiment of a microcomputer according to the present invention, and FIG. 3 is a block diagram showing a configuration of a conventional microcomputer. . In the figure, 1 is a CPU, 2 is an input / output circuit, 3 is an address bus, 4 is a data bus, 5 is a peripheral circuit, 6 is a second output control circuit, 7 is a toggle flip-flop, and 8 is an output data setting buffer. . In the drawings, the same reference numerals indicate the same or corresponding parts.

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】中央演算処理装置と、 該中央演算処理装置によりカウントの開始が制御される
第1および第2のタイマを有する周辺回路と、 上記中央演算処理装置から設定されたデータを出力する
出力装置と、 上記中央演算処理装置からの極性設定データを保持する
第1の保持回路,上記第2のタイマからの制御信号に応
じて上記第1の保持回路から出力された極性設定データ
の伝達を制御するゲート回路,このゲート回路の出力に
より出力の極性が設定された後上記第1のタイマからの
制御信号に応じて当該設定された極性が維持もしくは反
転される第2の保持回路を有し、上記中央演算処理装置
が出力データを設定した後、当該中央演算処理装置の制
御から独立して、外部へ出力するデータの内容を任意の
タイミングで切替える切替手段とを備えたことを特徴と
するマイクロコンピュータ。
A central processing unit; a peripheral circuit having first and second timers whose start of counting is controlled by the central processing unit; and outputting data set from the central processing unit. An output device; a first holding circuit for holding polarity setting data from the central processing unit; and transmission of polarity setting data output from the first holding circuit in response to a control signal from the second timer. And a second holding circuit for maintaining or inverting the set polarity according to a control signal from the first timer after the output polarity is set by the output of the gate circuit. A switching means for switching the content of data to be output to the outside at an arbitrary timing independently of the control of the central processing unit after the central processing unit sets the output data; Microcomputer comprising the.
JP2040658A 1990-02-20 1990-02-20 Microcomputer Expired - Fee Related JP2597729B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2040658A JP2597729B2 (en) 1990-02-20 1990-02-20 Microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2040658A JP2597729B2 (en) 1990-02-20 1990-02-20 Microcomputer

Publications (2)

Publication Number Publication Date
JPH03242776A JPH03242776A (en) 1991-10-29
JP2597729B2 true JP2597729B2 (en) 1997-04-09

Family

ID=12586642

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2040658A Expired - Fee Related JP2597729B2 (en) 1990-02-20 1990-02-20 Microcomputer

Country Status (1)

Country Link
JP (1) JP2597729B2 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH022444A (en) * 1988-06-10 1990-01-08 Sanyo Electric Co Ltd Microcomputer

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH022444A (en) * 1988-06-10 1990-01-08 Sanyo Electric Co Ltd Microcomputer

Also Published As

Publication number Publication date
JPH03242776A (en) 1991-10-29

Similar Documents

Publication Publication Date Title
JP2597729B2 (en) Microcomputer
JPS629418A (en) Timer control system
JPH07146842A (en) Bus interface circuit
JPH1185306A (en) Clock switch circuit
JPH0418655A (en) Data processor
JPS63180103A (en) Method for setting signal of input/output terminal of programmable controller
JPH0210478A (en) Program table interface circuit
JPH0387790A (en) Synchronous switching circuit
JPH06187065A (en) Clock switching circuit
JPH03156552A (en) Direct memory access control circuit system
JPS59216227A (en) Data transfer system
JPH0738776A (en) Video signal processing circuit
JPS59191647A (en) Serial i/o of data processing system
JPS62107304A (en) Programmable controller
JPH02272667A (en) Input/output signal processing system
JPH04142648A (en) Data transfer processing system
JPH0341542A (en) Peripheral controller
JPH0433152A (en) Bus system
JPS61141069A (en) Microprocessor
JPS61208559A (en) Input and output interface circuit for printer
JPH0329067A (en) Microcomputer
JPH0749793A (en) Interrupt controller
JPH02214328A (en) Output controller
JPH04117585A (en) Microcomuter
JPS61236243A (en) Terminal equipment

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

LAPS Cancellation because of no payment of annual fees