JPH0579664U - Pulse output circuit in microcomputer - Google Patents

Pulse output circuit in microcomputer

Info

Publication number
JPH0579664U
JPH0579664U JP1663792U JP1663792U JPH0579664U JP H0579664 U JPH0579664 U JP H0579664U JP 1663792 U JP1663792 U JP 1663792U JP 1663792 U JP1663792 U JP 1663792U JP H0579664 U JPH0579664 U JP H0579664U
Authority
JP
Japan
Prior art keywords
timer
data
bit
register
bits
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
JP1663792U
Other languages
Japanese (ja)
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 JP1663792U priority Critical patent/JPH0579664U/en
Publication of JPH0579664U publication Critical patent/JPH0579664U/en
Pending legal-status Critical Current

Links

Landscapes

  • Microcomputers (AREA)

Abstract

(57)【要約】 【目的】 4本+4本にグループ化されたパルス出力機
能から、容易に6本+2本のパルス出力を得ることがで
きるマイクロコンピュータ内パルス出力回路を得る。 【構成】 片方のグループの2本(11b)について、パ
ルス出力のタイミングを制御する信号源を自グループと
同一(10のタイマ2のオーバーフロー)か他グループと
同一(8のタイマ1のオーバーフロー)にするか選択す
るレジスタ(12)を設ける。
(57) [Abstract] [Purpose] To obtain a pulse output circuit in a microcomputer capable of easily obtaining 6 + 2 pulse outputs from the pulse output function grouped into 4 + 4 lines. [Structure] For the two wires (11b) of one group, the signal source for controlling the timing of pulse output should be the same as the own group (10 timer 2 overflow) or the other group (8 timer 1 overflow). A register (12) for selecting whether to perform or not is provided.

Description

【考案の詳細な説明】[Detailed description of the device]

【0001】[0001]

【産業上の利用分野】[Industrial applications]

この考案はマイクロコンピュータ内パルス出力回路に関するものである。 This invention relates to a pulse output circuit in a microcomputer.

【0002】[0002]

【従来の技術】[Prior Art]

図2は、従来のマイクロコンピュータ内パルス出力回路を示す回路図で、図に おいて、1はCPU、2はアドレスバス、3はデータバス、4は第1のラッチ、 5は第2のラッチ、6はポート出力への出力バッファ、7はタイマ1、8はタイ マ1のオーバーフロー信号、9はタイマ2、10はタイマ2のオーバーフロー信号 、11は第1のラッチから第2のラッチへデータを転送する時ONするゲートであ る。 FIG. 2 is a circuit diagram showing a conventional pulse output circuit in a microcomputer. In the figure, 1 is a CPU, 2 is an address bus, 3 is a data bus, 4 is a first latch, and 5 is a second latch. , 6 is an output buffer to the port output, 7 is a timer 1 and 8 is a timer 1 overflow signal, 9 is a timer 2 and 10 is a timer 2 overflow signal, 11 is data from the first latch to the second latch This is a gate that turns on when transferring.

【0003】 次に動作について説明する。図2において、まずCPU1からアドレスバス2 とデータバス3をとおして、第1のラッチ4にポート出力するHIGH”1”または LOW ”0”のデータを書き込む。HIGH/LOW の出力パルスの幅をあらかじめ7の タイマ1に設定しておき、カウントを開始させる。タイマ1が、オーバーフロー するたびにオーバーフロー信号8が出力され、この信号により第1のラッチ4か ら第2のラッチ5へデータが転送されポート出力が決まる。タイマ1がオーバー フローする直前までに第1のラッチに書かれたデータが、タイマ1のオーバーフ ローのタイミングでポート出力の極性となり出力されるので、リアルタイムポー ト(以下、RTPと記す)出力機能と呼ばれ、パルスモーター駆動制御に有効で ある。Next, the operation will be described. In FIG. 2, first, data of HIGH "1" or LOW "0" output from the CPU 1 to the first latch 4 is written through the address bus 2 and the data bus 3. Set the HIGH / LOW output pulse width to timer 1 of 7 in advance and start counting. Every time the timer 1 overflows, an overflow signal 8 is output, and this signal transfers data from the first latch 4 to the second latch 5 and determines the port output. The data written in the first latch just before the overflow of timer 1 is output as the polarity of the port output at the timing of the overflow of timer 1, so the real-time port (hereinafter referred to as RTP) output function. It is effective for pulse motor drive control.

【0004】 2相ステッピングモーターにおいては、4ビットのRTPのパルス出力を用い てモーター制御を行う。ブラシレスモーターにおいては、120 °位相のずれた3 相(U・V・W相)のパルスで制御するため、6ビットのRTPパルスが必要で ある。ところが、従来のRTP出力機能においては、4ビットを1グループとし て、1グループに対して1つのタイマで出力タイミング制御を行う構成になって いる。第2図中で、ビット0からビット5の6つのビットをブラシレスモーター の制御に用いる場合、ビット0から3に対しては7のタイマ1、ビット4と5に 対しては9のタイマ2、と2つの別タイマで出力を制御する。CPUは、これら 2つのタイマが全く同等に動作するように操作する。In the two-phase stepping motor, motor control is performed by using 4-bit RTP pulse output. Brushless motors require 6-bit RTP pulses because they are controlled by three-phase (U, V, W phase) pulses that are 120 ° out of phase. However, in the conventional RTP output function, 4 bits are set as one group, and the output timing control is performed by one timer for each group. In FIG. 2, when the six bits from bit 0 to bit 5 are used to control the brushless motor, timer 1 is 7 for bits 0 to 3, timer 2 is 9 for bits 4 and 5, And two separate timers control the output. The CPU operates so that these two timers operate in exactly the same way.

【0005】[0005]

【考案が解決しようとする課題】[Problems to be solved by the device]

従来のマイクロコンピュータ内パルス出力回路は以上のように構成されている ので、4ビットを1グループとして1つのタイマを割り当ててそのオーバーフロ ーに同期してパルス出力させるので、6ビットのRTPパルス出力を必要とする 場合には、2グループ(8ビット)のRTPを動作させそのうちの6ビットを用 いるというように、必然的に2つのタイマを全く同等に制御させなくてはならな いという問題点があった。 Since the conventional pulse output circuit in the microcomputer is configured as described above, one timer is assigned with 4 bits as one group and the pulse is output in synchronization with its overflow. In case of needing, the problem is that two timers must be controlled in exactly the same way, for example, operating two groups (8 bits) of RTP and using 6 bits of them. There was a point.

【0006】 この考案は、上記のような問題点を解消するためになされたもので、RTP出 力について4ビットか6ビットかをレジスタの設定で容易に選択できるとともに 、6ビットを選択した場合は、選択された6ビットを1グループとして1つのタ イマで制御できることを目的としている。The present invention has been made to solve the above-mentioned problems, and it is possible to easily select 4 bits or 6 bits for RTP output by register setting, and when 6 bits are selected. Aims to control selected 6 bits as one group with one timer.

【0007】[0007]

【課題を解決するための手段】[Means for Solving the Problems]

この考案に係るマイクロコンピュータ内パルス出力回路は、制御タイマについ て、新設のビット数選択レジスタの内容により、タイマ1が4ビット・タイマ2 が4ビットの制御をする場合と、タイマ1が6ビット・タイマ2が2ビットの制 御をする場合とを自動的にきりかえる手段を備えたものである。 The pulse output circuit in the microcomputer according to the present invention has a control timer in which the timer 1 controls 4 bits and the timer 2 controls 4 bits, and the timer 1 controls 6 bits, depending on the contents of the newly set bit number selection register. -It is equipped with a means to automatically switch between the case where the timer 2 controls 2 bits.

【0008】[0008]

【作用】[Action]

この考案によるマイクロコンピュータ内パルス出力回路は、ビット4と5につ いて、第1のラッチから第2のラッチへのデータ転送を操作するオーバーフロー 信号の入力源を、新設のビット数選択レジスタの内容により、4ビット・4ビッ トの場合はタイマ2、6ビット・2ビットの場合はタイマ1に切り替えることで 1つのタイマ1で6ビットのRTP出力を操作することができる。 In the pulse output circuit in the microcomputer according to the present invention, for bits 4 and 5, the input source of the overflow signal for operating the data transfer from the first latch to the second latch is set to the contents of the new bit number selection register. Thus, by switching to timer 2 for 4-bit / 4-bit and timer 1 for 6-bit / 2-bit, one timer 1 can operate 6-bit RTP output.

【0009】[0009]

【実施例】【Example】

実施例1. 以下、この考案の実施例1を図について説明する。 図1はこの考案の実施例1によるマイクロコンピュータ内パルス出力回路を示 す図で、図において、12はRTPビット数選択レジスタ、13は制御タイマ切り替 え回路、そのほかは従来の図2と同一符号は同一または相当部分を示す。 次に動作について説明する。RTP出力データの第1のラッチ4から第2のラ ッチ5へのデータ転送を制御するためにタイマのオーバーフロー信号をゲート11 に入れる。下位4ビットには従来どうりタイマ1のオーバーフロー信号8を制御 信号としてゲート11aに入れ、上位2ビットのゲート11cにはタイマ2のオーバ ーフロー信号をいれる。間のビット4と5の2ビットについて、ゲート11bの制 御信号にタイマ1のオーバーフローかタイマ2のオーバーフローかのどちらかを 、RTPビット数選択レジスタ12で選ぶ。レジスタ12が”0”の場合、タイマ2 のオーバーフロー信号が13の切り替え回路で選ばれゲート11bにはいり、ビット 4と5は上位2ビットのグループになり、4ビット・4ビットのRTPが選択さ れる。レジスタ12が”1”の場合は、タイマ1のオーバーフロー信号が13の切り 替え回路で選ばれてゲート11bにはいり、ビット4と5は下位4ビットのグルー プに入り、6ビット・2ビットのRTPが選択される。この場合、6ビットの制 御を行うのにタイマ1のみを操作すればよく、残り2ビットのRTPが不要な場 合は、タイマ2は他の用途に使えるようになった。また、RTPの出力をポート に出力するかしないかの選択レジスタを残りの2ビットについて、出力なしに設 定することで、残りの2ビットのポートは通常の入出力ポートとして有効に利用 できる。 Example 1. Embodiment 1 of the present invention will be described below with reference to the drawings. FIG. 1 is a diagram showing a pulse output circuit in a microcomputer according to a first embodiment of the present invention. In the figure, 12 is an RTP bit number selection register, 13 is a control timer switching circuit, and others are the same as those of the conventional FIG. Indicates the same or a corresponding portion. Next, the operation will be described. A timer overflow signal is applied to gate 11 to control the transfer of the RTP output data from the first latch 4 to the second latch 5. In the lower 4 bits, the overflow signal 8 of the timer 1 is inputted to the gate 11a as a control signal as in the conventional case, and the overflow signal of the timer 2 is put in the gate 11c of the upper 2 bits. The RTP bit number selection register 12 selects either the overflow of timer 1 or the overflow of timer 2 for the control signal of the gate 11b for the two bits 4 and 5 between them. When the register 12 is "0", the overflow signal of the timer 2 is selected by the switching circuit of 13 and enters the gate 11b, and the bits 4 and 5 become the group of the higher 2 bits, and the 4-bit / 4-bit RTP is selected. Be done. When the register 12 is "1", the overflow signal of the timer 1 is selected by the switching circuit of 13 and goes to the gate 11b. Bits 4 and 5 enter the lower 4 bits group, and 6 bits / 2 bits. RTP is selected. In this case, only timer 1 needs to be operated to perform 6-bit control, and timer 2 can be used for other purposes when the remaining 2-bit RTP is unnecessary. Also, by setting the selection register as to whether or not to output the output of the RTP to the port for the remaining 2 bits, the port of the remaining 2 bits can be effectively used as a normal input / output port.

【0010】 実施例2. 上記実施例1の制御タイマ切り換え回路13を、AND−ORで置き換えたもの (図313d)も上記実施例1と同様の動作を期待できる。Example 2. An operation in which the control timer switching circuit 13 of the first embodiment is replaced with an AND-OR (FIG. 313d) can also be expected to have the same operation as that of the first embodiment.

【0011】 実施例3. 上記実施例1は、4ビットと4ビットのグループと、6ビットと2ビットのグ ループのグループ化について説明したが、これに限らず、iビットとjビットの グループと(i+k)ビットと(j−k)ビットのグループ(i,j,kは任意 )のようにさまざまな組み合わせで同様の効果を期待できる。Example 3. In the first embodiment, the grouping of 4-bit and 4-bit groups and the grouping of 6-bit and 2-bit groups has been described, but the present invention is not limited to this, and groups of i-bit and j-bit and (i + k) -bit ( Similar effects can be expected in various combinations such as a group of (j−k) bits (i, j, and k are arbitrary).

【0012】[0012]

【考案の効果】[Effect of the device]

以上のようにこの考案によれば、従来2つのタイマで6ビットのRTP出力を 得ていたが、新たにRTPビット数選択レジスタを設けることで、1つのタイマ で同じ機能を得ることが可能になったことで、CPUのタイマ操作の負担が半減 したとともに、残りのタイマを他の目的につかえるようになったという効果があ る。 また、残りの2ビットのポートも通常の入出力ポートとして、他の目的に利用 できる。 As described above, according to the present invention, two timers have conventionally obtained 6-bit RTP output, but by providing a new RTP bit number selection register, one timer can obtain the same function. As a result, the burden of CPU timer operation is halved, and the remaining timers can be used for other purposes. The remaining 2-bit port can also be used for other purposes as a normal input / output port.

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

【図1】この考案の実施例1によるマイクロコンピュー
タ内パルス出力回路の回路図である。
FIG. 1 is a circuit diagram of a pulse output circuit in a microcomputer according to a first embodiment of the present invention.

【図2】従来のマイクロコンピュータ内パルス出力回路
の回路図である。
FIG. 2 is a circuit diagram of a conventional pulse output circuit in a microcomputer.

【図3】制御タイマ切り換え回路13の詳細図である。FIG. 3 is a detailed diagram of a control timer switching circuit 13.

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

1 CPU 2 アドレスバス 3 データバス 4 RTPデータレジスタ第1のラッチ 5 第2のラッチ 6 ポートへの出力バッファ 7 タイマ1 8 タイマ1のオーバーフロー信号 9 タイマ2 10 タイマ2のオーバーフロー信号 11 第1のラッチから第2のラッチにデータを転送する
タイミングでONするゲート 12 RTPビット数選択レジスタ 13 制御タイマ切り換え回路
1 CPU 2 Address Bus 3 Data Bus 4 RTP Data Register First Latch 5 Second Latch 6 Output Buffer to Port 7 Timer 1 8 Timer 1 Overflow Signal 9 Timer 2 10 Timer 2 Overflow Signal 11 First Latch Gate that turns on at the timing of data transfer from the memory to the second latch 12 RTP bit number selection register 13 Control timer switching circuit

Claims (1)

【実用新案登録請求の範囲】[Scope of utility model registration request] 【請求項1】 各種演算を実行し、ROM、RAM等の
各種メモリや各種レジスタへのリード/ライトを制御す
る中央演算処理装置(以下CPUと称する)と、各メモ
リ、レジスタとCPU間のデータ転送を行うアドレスバ
ス、データバスとを有するマイクロコンピュータ内で、
前記CPUからの操作によりカウントを実施する複数の
タイマと、前記CPUにより極性データをビットごとに
設定されるnビットの第1のデータレジスタと、前記第
1のデータレジスタからデータを受取り保持するnビッ
トの第2のデータレジスタと、前記第2のレジスタのデ
ータの極性に応じてポートにパルスを出力するn個の出
力バッファと、前記の任意のタイマのカウントにより発
生したオーバーフロー信号によりON/OFFを制御さ
れる前記第1のデータレジスタから前記第2のデータレ
ジスタへデータを転送するn個のゲートと、同時に極性
を変化させるビット数を決定するビット数選択レジスタ
とからなるパルス発生回路において、同時に変化させる
ビットをi個とj個にグループ化し、それぞれ別々のタ
イマ(タイマIとタイマJ)のオーバーフロー信号で、
前記第1のデータレジスタと前記第2のデータレジスタ
をつなぐ前記ゲートを操作し、任意のパルスの出力タイ
ミングを制御する際、jグループ内のk個についてはタ
イマIかタイマJのどちらかで制御でき、そのどちらの
タイマを選ぶかの選択をビット数選択レジスタで行うこ
とで、i個とj個のグループ化と(i+k)個と(j−
k)個のグループ化のされた複数のパルス出力を得るこ
とを特徴としたマイクロコンピュータ内パルス出力回
路。
1. A central processing unit (hereinafter referred to as CPU) that executes various calculations and controls read / write to various memories such as ROM and RAM and various registers, and data between each memory, registers and CPU. In a microcomputer having an address bus and a data bus for transfer,
A plurality of timers for counting by an operation from the CPU, an n-bit first data register in which polarity data is set for each bit by the CPU, and an n for receiving and holding data from the first data register. ON / OFF by a bit second data register, n output buffers that output a pulse to a port according to the polarity of the data of the second register, and an overflow signal generated by the count of the arbitrary timer. A pulse generation circuit comprising n gates for transferring data from the first data register controlled to the second data register and a bit number selection register for determining the number of bits whose polarity is changed at the same time, Bits that change at the same time are grouped into i and j bits, and separate timers (timer I and timer I and Overflow signal timer J),
When the gate connecting the first data register and the second data register is operated to control the output timing of an arbitrary pulse, k in group j is controlled by either timer I or timer J It is possible to select which of the timers is to be selected by the bit number selection register, thereby grouping i and j and (i + k) and (j-
k) A pulse output circuit in a microcomputer, which obtains a plurality of pulse outputs grouped into pieces.
JP1663792U 1992-03-27 1992-03-27 Pulse output circuit in microcomputer Pending JPH0579664U (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1663792U JPH0579664U (en) 1992-03-27 1992-03-27 Pulse output circuit in microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1663792U JPH0579664U (en) 1992-03-27 1992-03-27 Pulse output circuit in microcomputer

Publications (1)

Publication Number Publication Date
JPH0579664U true JPH0579664U (en) 1993-10-29

Family

ID=11921880

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1663792U Pending JPH0579664U (en) 1992-03-27 1992-03-27 Pulse output circuit in microcomputer

Country Status (1)

Country Link
JP (1) JPH0579664U (en)

Similar Documents

Publication Publication Date Title
JP3687861B2 (en) Control system and method for forming complementary non-overlapping PWM signals
JPS6376044A (en) Bus master
US4142246A (en) Sequence controller with dynamically changeable program
JPH07152586A (en) Cyclic priority-level encoder
JP2527458B2 (en) Data transfer control device
JPH0579664U (en) Pulse output circuit in microcomputer
JPS63236156A (en) Interrupt warning apparatus
US5175482A (en) Stepping motor control circuit
JPH0477559B2 (en)
SU1064458A1 (en) Code/pdm converter
SU1594488A1 (en) Device for program control of m-phase stepping motor
SU1137443A2 (en) Device for program control of m-phase stepping motor
JPS61289448A (en) Buffer memory device
SU1541755A1 (en) Reversing distributor of pulses for control of m-phase stepping motor
SU1192135A1 (en) Switching device
SU1705998A1 (en) Pulse distributor for controlling three phase step motor
SU1580377A1 (en) Matrix distributor
SU1487101A1 (en) Regeneration controller of dynamic memory
JP2569498B2 (en) Flip flop
JPH02196360A (en) Output control circuit for microcomputer
JPS60140434A (en) Scheduler timer
JPH11110346A (en) Data transfer circuit
JPH02101559A (en) Processor circuit
JPS60113695A (en) Drive circuit for pulse motor
JPS62143130A (en) Central processing unit