[go: up one dir, main page]

JPH02178802A - Data processor - Google Patents

Data processor

Info

Publication number
JPH02178802A
JPH02178802A JP33152788A JP33152788A JPH02178802A JP H02178802 A JPH02178802 A JP H02178802A JP 33152788 A JP33152788 A JP 33152788A JP 33152788 A JP33152788 A JP 33152788A JP H02178802 A JPH02178802 A JP H02178802A
Authority
JP
Japan
Prior art keywords
processing
interrupt
pulse output
data
request
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
JP33152788A
Other languages
Japanese (ja)
Other versions
JP2844624B2 (en
Inventor
Hisaharu Oba
大場 久晴
Osamu Matsushima
修 松嶋
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 JP63331527A priority Critical patent/JP2844624B2/en
Publication of JPH02178802A publication Critical patent/JPH02178802A/en
Application granted granted Critical
Publication of JP2844624B2 publication Critical patent/JP2844624B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Control By Computers (AREA)

Abstract

PURPOSE:To execute the control of a continuous pulse output by processing the interrupt for setting (update) of start and end timings of the pulse output. CONSTITUTION:When accepting the timing signal of the start and the end of the pulse output from an INTC (interrupt occurrence request circuit) 112 as an interrupt request signal, a CPU 100 does not refer to a vector table to execute a prescribed data processing, namely, the micro service based on processing mode information preliminarily set in a specific address of a data memory 114. Consequently, start and end timings of the pulse output in the next cycle are set based on data preliminarily set in a prescribed address without saving contents of a PC (program counter) 107 and a PSW (program execution state holding register) 108 in a stack space. Thus, the continuous pulse output is controlled.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、機械制御におけるパルス出力において、特に
パルスを連続的に出力する方法に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to pulse output in machine control, particularly to a method of continuously outputting pulses.

〔従来の技術〕[Conventional technology]

昨今、機械制御においては、マイコンが利用されている
。基本的には、マイコンから出力されるPWM出力パル
スによって弁の開閉や、モータの駆動などを直接性なっ
ているのが一般的である。
Microcomputers are now being used for machine control. Basically, PWM output pulses output from a microcomputer are generally used to directly open and close valves, drive motors, etc.

第5図は、従来の技術によるパルス出力を行なう場合の
パルス出カバターン例を示している。
FIG. 5 shows an example of a pulse output pattern when performing pulse output according to the conventional technique.

以下、第6図と第7図を参照しながら従来のパルス発生
装置を説明する。第6図は従来のパルス発生装置のブロ
ック図、第7図は従来の周辺ハードウェアのブロック図
である。第8図の装置は、CPU800.データバス1
10.アドレスバス111、INTC(割込み発生要求
回路)112.プログラムメモリ113.データメモリ
1141周辺ハードウェア115から構成されている。
Hereinafter, a conventional pulse generator will be explained with reference to FIGS. 6 and 7. FIG. 6 is a block diagram of a conventional pulse generator, and FIG. 7 is a block diagram of conventional peripheral hardware. The device shown in FIG. 8 includes a CPU 800. data bus 1
10. Address bus 111, INTC (interrupt generation request circuit) 112. Program memory 113. It is composed of a data memory 1141 and peripheral hardware 115.

CPU800は、算術論理演算ユニット(以下ALUと
記す)101.テンポラリレジスタ102゜汎用レジス
タ103.アドレスバッファ104(図ではABで表現
されている)、マイクロアドレス(以下μアドレスと記
す)生成部105.μROMI 06. PC(プログ
ラムカウンタ)107゜PSW(プログラム実行状態保
持レジスタ)108゜タイミング制御部109から構成
される。
The CPU 800 includes an arithmetic logic unit (hereinafter referred to as ALU) 101. Temporary register 102° General purpose register 103. Address buffer 104 (represented by AB in the figure), micro address (hereinafter referred to as μ address) generation unit 105. μROMI 06. It is composed of a PC (program counter) 107 degrees, a PSW (program execution state holding register) 108 degrees, and a timing control section 109.

またINTC112は、割り込み要求フラグ116があ
り、タイミング制御部109に対し、割り込み要求信号
117を出力する。タイミング制御部109は、割り込
み要求を受は付けると、INTC112に対し割り込み
要求クリア信号118を出力する。
The INTC 112 also has an interrupt request flag 116 and outputs an interrupt request signal 117 to the timing control section 109. When the timing control unit 109 accepts the interrupt request, it outputs an interrupt request clear signal 118 to the INTC 112 .

INTCl 12は、外部のハードウェアから幾つかの
割り込み信号を受は付け、各割り込みソースに制光てら
れた優先順位を判別し、最も高い優先順位をもった割り
込みソースを一つ選択し、その割り込みソースに対応し
た割り込み要求フラグ116をセットする。割り込み要
求フラグ116は、割り込み要求がn個あるときには、
n個設定されているが、図中には1個だけ記載されてい
る。
The INTCl 12 accepts several interrupt signals from external hardware, determines the priority assigned to each interrupt source, selects the one interrupt source with the highest priority, and The interrupt request flag 116 corresponding to the interrupt source is set. The interrupt request flag 116 indicates that when there are n interrupt requests,
Although n pieces are set, only one is shown in the figure.

また、外部のハードウェアからの割り込み信号や、優先
順位判別部などは、特に図示していない。
Furthermore, interrupt signals from external hardware, a priority level determination unit, and the like are not particularly shown.

従来からの割り込み処理は、通常ベクタ割り込みと呼ば
れ、メモリ空間中にベクタテーブル空間が予め設定され
、この空間には各割り込みソースに対応した、割り込み
処理プログラムのエントリアドレスが格納されている。
Conventional interrupt processing is usually called vectored interrupt, and a vector table space is set in advance in a memory space, and this space stores entry addresses of interrupt processing programs corresponding to each interrupt source.

ベクタ割り込みが発生すると、割り込みソースに対応し
たエントリアドレスへ分岐する。
When a vectored interrupt occurs, a branch is made to the entry address corresponding to the interrupt source.

次に第7図を用いて、周辺ハードウェア115の構成を
説明する。
Next, the configuration of the peripheral hardware 115 will be explained using FIG. 7.

周辺ハードウェア115は、クロックφをカウントする
タイマ901.タイマ901の値と比較動作を行い、出
力パルスを制御する3つのコンベアレジスタ(以下CO
MPT、COMPS、COMPR)902,903,9
04、出力パルスのレベルを保持するセット・リセット
型フリップフロップ(以下出力F/F)905、および
出力F/F’の値を外部に出力するボー)Pから構成さ
れている。
Peripheral hardware 115 includes timer 901 . There are three conveyor registers (hereinafter referred to as CO) that perform a comparison operation with the value of timer 901 and control the output pulse.
MPT, COMPS, COMPR)902,903,9
04, a set/reset type flip-flop (hereinafter referred to as output F/F) 905 that holds the level of the output pulse, and a baud P that outputs the value of the output F/F' to the outside.

COMPT902は、出力パルスの周期を規定するコン
ベアレジスタで、出力パルスの周期TOに相当する値が
CPU800によりあらかじめ設定しである。また、C
OMPT902は、常にタイマ901と比較動作を行い
、タイマ901の値のレジスタの保持値が一致すると、
一致信号912を出力する。同様に、COMPS903
.COMPR904は、それぞれ出力パルスのパルス出
力開始タイミングと、パルス出力終了タイミングを規定
するコンベアレジスタで、常にタイマ901と比較動作
を行い、タイマ901の値とそれぞれのレジスタの保持
値が一致すると、それぞれ一致信号913.914を出
力する。これらのコンベアレジスタはすべてCPU80
0からリード、ライトが可能である。
COMPT902 is a conveyor register that defines the period of the output pulse, and a value corresponding to the period TO of the output pulse is set in advance by the CPU 800. Also, C
The OMPT 902 always performs a comparison operation with the timer 901, and when the value held in the register matches the value of the timer 901,
A match signal 912 is output. Similarly, COMPS903
.. COMPR904 is a conveyor register that specifies the pulse output start timing and pulse output end timing of each output pulse, and always performs a comparison operation with the timer 901, and when the value of the timer 901 and the value held in each register match, a match is determined. Outputs signals 913 and 914. All these conveyor registers are CPU80
It is possible to read and write from 0.

一致信号912はタイマ901に入力され、タイマ90
1はこの信号が入力されるとオール“0″にクリアされ
る。これにより、タイマ901は、カウント値0からT
Oまでを継続的にカウントするインターバルタイマとし
ての機能を果たす。
The coincidence signal 912 is input to the timer 901, and the timer 90
1 is cleared to all "0" when this signal is input. As a result, the timer 901 changes from the count value 0 to T.
It functions as an interval timer that continuously counts up to 0.

次に、本例におけるパルス出力の制御動作を、第5図乃
至第7図を参照しながら、パルス出力の制御動作の説明
をする。ただし、出力F/F 905はりセットされて
いて、ボー)Pからの出力がロウレベルである時から説
明を行う。
Next, the pulse output control operation in this example will be explained with reference to FIGS. 5 to 7. However, the explanation will start when the output F/F 905 is set and the output from the baud P is at low level.

通常の命令処理では、PC107に格納されたフログラ
ムアドレスが、アドレスバッファ104に転送され、ア
ドレスバス111をドライフシ、フロダラムメモリ11
3から次に実行すべき命令がフェッチされる。
In normal instruction processing, the program address stored in the PC 107 is transferred to the address buffer 104, the address bus 111 is transferred to the address bus 111, and the program address stored in the program memory 11 is transferred to the address buffer 104.
3, the next instruction to be executed is fetched.

取り込まれた命令は、データバス110を経由し、μア
ドレス生成部105に転送される。μアドレス生成部1
05は、命令コードからμROM106のアドレスを生
成する。以降、μROM106ニ格納されている該命令
に対するμプログラムの指令に従い、ALUIOI、テ
ンポラリレジスタ102、汎用レジスタ103などを操
作することで命令の処理を行なう。
The fetched instruction is transferred to the μ address generation unit 105 via the data bus 110. μ address generation unit 1
05 generates the address of μROM 106 from the instruction code. Thereafter, the instruction is processed by manipulating the ALUIOI, temporary register 102, general-purpose register 103, etc. according to the instructions of the μ program for the instruction stored in the μROM 106.

INTCl 12は、CPU800の処理とは独立に、
周辺ハードウェアから割り込み要求が発生しているか否
かを絶えずサンプルし、要求が発生していれば要求を1
つ選択し、そのソースに対応する割り込み要求フラグ1
16をセットする。
INTCl 12 independently of the processing of the CPU 800,
It constantly samples whether or not an interrupt request is generated from peripheral hardware, and if a request is generated, the request is set to 1.
Interrupt request flag 1 corresponding to that source
Set 16.

さて、COMPS903の値とタイマ901の値が一致
すると、COMPS903は一致信号913を出力し、
この信号により出力F/F 905をセットすることで
ポー)Pからの出力をハイレベルにする。(第5図−タ
イミングtl、t4.t7)また、一致信号913はI
NTC112に入力され、INTCl 12に対し割込
み要求を発生し、工NTC112が要求を受は付け、割
り込み要求フラグ116がセットされれば、割り込み要
求信号117がタイミング制御部109に対して出力さ
れる。
Now, when the value of COMPS903 and the value of timer 901 match, COMPS903 outputs a match signal 913,
By setting the output F/F 905 with this signal, the output from P is set to high level. (Figure 5 - Timing tl, t4.t7) Also, the coincidence signal 913 is I
The interrupt request signal 117 is input to the NTC 112 and generates an interrupt request to the INTCl 12. If the NTC 112 accepts the request and the interrupt request flag 116 is set, an interrupt request signal 117 is output to the timing control unit 109.

各命令実行の最後のタイミングでは、通常割り込みが発
生しているかいないかを検知するためのタイミングで、
このタイミングでは、タイミング制御部109は、割り
込み要求信号117の有無をサンプルする。割り込み要
求信号117がアクティブであれば、割り込み要求を受
は付け、割り込み要求クリア信号118をINTC11
2に対し出力し、割り込み要求フラグ116をクリアす
る。
The final timing of each instruction execution is the timing to detect whether or not an interrupt has occurred.
At this timing, the timing control unit 109 samples the presence or absence of the interrupt request signal 117. If the interrupt request signal 117 is active, the interrupt request is accepted and the interrupt request clear signal 118 is sent to the INTC11.
2 and clears the interrupt request flag 116.

次にPC107とPSW108をスタックポインタ(C
PU800中に設定されているレジスタであるが図示は
していない)が指し示すスタック空間に退避し、データ
メモリー14中の特定のアドレスに設定されているベク
タテーブルに格納されている割り込みソースに対応する
割り込み処理プログラムのエントリアドレスを読み出し
、データバス110経由でPC107に設定する。PC
107に新たに設定されたプログラムアドレスから割り
込み処理プログラムの実行が開始される。
Next, connect the PC 107 and PSW 108 to the stack pointer (C
It is saved in the stack space pointed to by a register (not shown) set in the PU 800, and corresponds to an interrupt source stored in a vector table set at a specific address in the data memory 14. The entry address of the interrupt processing program is read and set in the PC 107 via the data bus 110. PC
Execution of the interrupt processing program is started from the program address newly set in 107.

この一致信号913による割り込み処理要求に基づく割
り込み処理プログラムは、ボー)Pから次の周期に出力
されるパルスの、パルス出力開始タイミングを設定する
ための割り込み処理で、例えば、第5図において、周期
S1のタイミングt1で起動される割り込み処理では、
次周期S2のタイミングt4を設定するというように、
順次、次周期のパルス出力開始タイミングを設定するも
ので、このときCPU800は、タイマ901がオール
“′0”にクリアされてから、パルス出力をアクティブ
にするまでの期間に相当するデータをCOMPS903
に設定する。
The interrupt processing program based on the interrupt processing request by this coincidence signal 913 is an interrupt processing for setting the pulse output start timing of the pulse output from Baud P in the next cycle. In the interrupt processing started at timing t1 of S1,
Setting the timing t4 of the next cycle S2, etc.
The CPU 800 sequentially sets the pulse output start timing of the next cycle. At this time, the CPU 800 stores data corresponding to the period from when the timer 901 is cleared to all "'0" until the pulse output is activated to the COMPS 903.
Set to .

割り込み処理プログラムを終了する命令の処理では、ス
タック空間に退避しあったPC値、PSW値をそれぞれ
PC107,PSW108へ復帰することで、割り込み
が発生した時点の次の命令から処理を再開する。
In the processing of the instruction that ends the interrupt processing program, the PC value and PSW value saved in the stack space are restored to the PC 107 and PSW 108, respectively, and processing is restarted from the next instruction at the time when the interrupt occurred.

次に、COMPR904の値とタイマ901の値が一致
すると、COMPR904は一致信号914を出力し、
この信号により、出力F/F 905をリセットするこ
とで、ポートPからのパルス出力をロウレベルにする。
Next, when the value of COMPR904 and the value of timer 901 match, COMPR904 outputs a match signal 914,
This signal resets the output F/F 905, thereby setting the pulse output from port P to a low level.

(第5図−タイミングt2゜t5.t8) また、一致信号914はINTC112に入力され、I
NTC112に対し割り込み要求を発生し、INTC1
12が要求を受は付け、割り込み要求フラグ116がセ
ットされれば、割り込み要求信号117がタイミング制
御部109に対して出力される。
(Figure 5 - Timing t2゜t5.t8) Also, the coincidence signal 914 is input to the INTC 112, and the I
Generates an interrupt request to NTC112, and INTC1
12 accepts the request and the interrupt request flag 116 is set, an interrupt request signal 117 is output to the timing control section 109.

命令実行の最後のタイミングでは、タイミング制御部1
09は、割り込み要求信号117の有無をサンプルする
At the final timing of instruction execution, the timing control unit 1
09 samples the presence or absence of the interrupt request signal 117.

割り込み要求信号117がアクティブであれば、前記一
致信号913により起動される割り込み処理と同様に、
割り込み要求クリア信号117をINTCI 12に対
し出力し、割り込み要求フラグ116をクリアする。
If the interrupt request signal 117 is active, similar to the interrupt processing activated by the match signal 913,
An interrupt request clear signal 117 is output to the INTCI 12, and the interrupt request flag 116 is cleared.

次にPC107とPSW108のスタック空間に退避し
、データメモリ114中の特定のアドレスに設定されて
いるベクタテーブルに格納されている割り込みソースに
対応する割り込み処理プログラムのエントリアドレスに
分岐し、割り込み処理プログラムは実行開始する。
Next, it is saved to the stack space of the PC 107 and PSW 108, and branches to the entry address of the interrupt processing program corresponding to the interrupt source stored in the vector table set at a specific address in the data memory 114, and the interrupt processing program starts execution.

この一致信号914による割り込み処理要求に基づく割
込み処理プログラムは、ボー)Pから次の周期に出力さ
れるパルスの、パルス出力終了タイミングを設定するた
めの割り込み処理で、例えば、第5図において、周期S
1のタイミングt2で起動される割り込み処理で、次周
期S2のタイミングt5を設定するというように、順次
、次周期のパルス出力終了タイミングを設定する。この
ときCPU800は、COMPR904にタイマ901
がオール″0”にクリアされてから、パルス出力をリセ
ットするまでの期間に相当するデータをCOMPR90
4に設定することにより、出カバルスのパルス幅を設定
することになる。
The interrupt processing program based on the interrupt processing request by this coincidence signal 914 is an interrupt processing for setting the pulse output end timing of the pulse output from Baud P in the next cycle. S
The pulse output end timing of the next cycle is sequentially set, such as by setting the timing t5 of the next cycle S2 in the interrupt process activated at timing t2 of the first cycle. At this time, the CPU 800 sets the timer 901 to the COMPR 904.
The data corresponding to the period from when is cleared to all "0" until the pulse output is reset is stored in COMPR90.
By setting it to 4, the pulse width of the output pulse is set.

割り込み処理プログラムを終了する命令の処理では、ス
タック空間に退避してあったPC値。
In the processing of the instruction to terminate the interrupt processing program, the PC value saved in the stack space.

psw値をそれぞれPCI 07.PSWI 08へ復
帰することで、割り込みが発生した時点の次の命令から
処理を再開する。
Each psw value is PCI 07. By returning to PSWI 08, processing is resumed from the next instruction at the time when the interrupt occurred.

以上の様に、COMPS 903 、 COMPR90
4から出力される一致信号913,914によって、ポ
ートPからのパルス出力を直接制御するとともに、これ
らの信号によって起動される割り込み処理によって、次
の周期に出力されるパルス出力のパルス出力開始タイミ
ングとパルス出力終了タイミングを設定している。従っ
て、この動作を繰り返して行うことにより、ボートPか
らのパルス出力およびパルス出力の制御を継続的に行う
ことができる。なお、以上の説明は、種々あるパルス出
力制御方法の1例を示したものであるが、基本的には同
様の処理方法で制御が行なわれる。
As mentioned above, COMPS 903, COMPR90
The coincidence signals 913 and 914 output from the ports 4 directly control the pulse output from the port P, and the interrupt processing activated by these signals determines the pulse output start timing of the pulse output to be output in the next cycle. The pulse output end timing is set. Therefore, by repeating this operation, the pulse output from the boat P and the control of the pulse output can be continuously performed. The above explanation shows one example of various pulse output control methods, but control is basically performed using the same processing method.

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

前述したように、従来のパルス発生装置は、パルス出力
を開始させる信号とパルス出力を終了させる信号とを、
割り込み信号として受は付け、割り込み処理プログラム
によって、次の周期に出力するパルス出力の開始タイミ
ングと終了タイミングの設定を行っているため、その際
のPC,PSWのスタック空間への退避や、割り込み処
理プログラムからメイン処理へ戻る時に、スタックの内
容をPC,PSWへ復帰する処理が頻繁に発生するため
、出力するパルスの周波数が高くなる程、退避、復帰に
分かれるCPU時間の比率が膨大なものになる。
As mentioned above, the conventional pulse generator generates a signal to start pulse output and a signal to end pulse output.
It is accepted as an interrupt signal, and the interrupt processing program sets the start timing and end timing of the pulse output to be output in the next cycle. When returning from the program to main processing, the process of restoring the contents of the stack to the PC and PSW occurs frequently, so the higher the frequency of the output pulse, the greater the proportion of CPU time divided into saving and returning. Become.

しかも、CPUはパルスの制御の他に、その他のデータ
処理など種々のプログラムの実行を行なっており、パル
ス出力制御のための割り込み処理に多大な時間がかかる
と、これらのメイン処理に分かれるCPU時間が少なく
なり、場合によっては全くできない処理が発生すること
も起こり得る。
Moreover, in addition to pulse control, the CPU also executes various programs such as other data processing, and if interrupt processing for pulse output control takes a large amount of time, the CPU time divided into these main processes will be wasted. In some cases, processing that cannot be performed at all may occur.

さらに、第7図において、S2の周期の割り込み処理に
よって、次周期S3のパルス出力開始タイミング(タイ
ミングt7)として設定される値が、現在のタイマのカ
ウント値に対して大きい場合、S3の周期のパルス出力
タイミングを指定する意図で設定を行っても、現周期S
2内でパルス出力開始のための一致信号が再び発生する
ことになる(タイミングtX)。したがって、現周期S
2のパルス出力が終了していた場合、次周期S3を待た
ずにパルスの出力を開始してしまうという事象が生ずる
。このときのパルス出力は、タイミングtX〜t6〜t
7〜t8の期間をもつ、2周期にまたがったパルス出力
になってしまう。
Furthermore, in FIG. 7, if the value set as the pulse output start timing (timing t7) of the next cycle S3 by the interrupt processing of the cycle S2 is larger than the current timer count value, then Even if the setting is made with the intention of specifying the pulse output timing, the current cycle S
A coincidence signal for starting pulse output is generated again within 2 (timing tX). Therefore, the current period S
If the second pulse output has been completed, an event occurs in which the pulse output is started without waiting for the next cycle S3. The pulse output at this time is from timing tX to t6 to t.
This results in a pulse output that spans two periods with a period of 7 to t8.

上記の様なパルス出力は、本来意図したパルス出力の開
始と終了タイミングとは異なり、意図しないパルス幅を
持ったパルスが出力されてしまうため、例えば、パルス
の出力幅が制御量そのものであるような場合には、制御
対象に対して誤った制御を実行してしまうという重大な
問題となる。
The above pulse output is different from the originally intended start and end timing of the pulse output, and a pulse with an unintended pulse width is output.For example, if the pulse output width is the control amount itself, In such a case, a serious problem arises in that incorrect control is executed on the controlled object.

しかも、これを防止、補正するためには、専用のフログ
ラム処理が必要となり、この処理を、パルス出力の開始
と終了タイミングを設定する割り込み処理に付加すると
、パルス出力制御の割り込み処理に要する時間が、全体
としてますます増大してしまう。
Moreover, in order to prevent and correct this, dedicated program processing is required, and if this processing is added to the interrupt processing that sets the start and end timing of pulse output, the time required for interrupt processing for pulse output control will be reduced. , will continue to increase as a whole.

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

本発明は、PCとPSWと汎用レジスタとμROMを含
むCPUと、CPUへ非同期に割り込み処理要求を発生
するINTOと、プログラムメモリと、データメモリと
周辺回路を有する処理装置において、 周辺回路はタイマと、タイマとの比較を行う複数のコン
ベアレジスタと、パルス出力用のポートから構成され、 且つINTCは、割り込み処理要求の発生に加え、所定
のデータ処理の要求を発生する手段と、割り込み処理要
求と所定のデータ処理の要求を識別するための形態指示
手段を備え、前記データメモリ内には所定のデータ処理
の処理形態を指定する処理形態情報が格納され、INT
Oから所定のデータ処理の要求がCPUに対して発生さ
れると、CPUは形態指示手段が所定のデータ処理を指
示していることを検知した場合には、命令実行処理を中
断し、処理形態情報に従い、データメモリ内の所定のデ
ータと、尚該タイミングにおけるタイマの値tたはコン
ベアレジスタの値とを比較し、比較結果が所定の条件の
とき、前記所定のコンベアレジスタへのデータ転送を行
う手段を有し、出力ポートからのパルス発生を制御する
という特徴を有している。
The present invention provides a processing device having a CPU including a PC, a PSW, a general-purpose register, and a μROM, an INTO that asynchronously generates an interrupt processing request to the CPU, a program memory, a data memory, and a peripheral circuit, wherein the peripheral circuit is a timer. , a plurality of conveyor registers for comparison with a timer, and a port for pulse output. A mode specifying means for identifying a request for predetermined data processing is provided, processing mode information specifying a processing mode for the predetermined data processing is stored in the data memory, and INT
When a request for predetermined data processing is issued from O to the CPU, if the CPU detects that the format instruction means is instructing predetermined data processing, the CPU interrupts the instruction execution process and changes the processing format. According to the information, the predetermined data in the data memory is compared with the timer value t or the value of the conveyor register at the timing, and when the comparison result meets the predetermined condition, the data is transferred to the predetermined conveyor register. It has a feature of controlling pulse generation from the output port.

このように、本発明は、パルス出力の開始と終了のタイ
ミング信号を割り込み要求信号として受付けた際、PC
,PSWをスタック空間に退避する事なしに、事前に所
定のアドレスに設定されたデータに基づき、次周期のパ
ルス出力の開始と終了タイミングを設定する事で、連続
した、ポートからのパルス出力制御を行ない、 さらに、パルス出力の開始と終了を規定するコンベアレ
ジスタに設定するデータが、誤ったパルス出力を発生さ
せてしまう可能性のある場合には、これを検出してベク
タ割り込みを発生させ、CPUに対して特殊処理の必要
を通知している。
In this way, the present invention enables the PC to receive pulse output start and end timing signals as interrupt request signals.
, Continuous pulse output control from ports can be performed by setting the start and end timing of the next cycle of pulse output based on data set in advance at a predetermined address without saving the PSW to the stack space. Furthermore, if the data set in the conveyor register that defines the start and end of pulse output has the possibility of generating an erroneous pulse output, this is detected and a vectored interrupt is generated. Notifies the CPU of the need for special processing.

〔実施例〕〔Example〕

以下、本発明を図面を参照して説明する。 Hereinafter, the present invention will be explained with reference to the drawings.

第1図は、第1の実施例を示すパルス発生装置のブロッ
ク図である。
FIG. 1 is a block diagram of a pulse generator showing a first embodiment.

本発明のパルス発生装置は、CPU100゜データバス
110.アドレスバス111.INTC112、プログ
ラムメモリ113.データメモリ114、周辺ハードウ
ェア115から構成されている。
The pulse generator of the present invention includes a CPU 100 and a data bus 110. address bus 111. INTC112, program memory 113. It is composed of a data memory 114 and peripheral hardware 115.

CPU100は、ALUIOI、テンポラリレジスタ1
02.汎用レジスタ103.アドレスバッファ104(
図ではABで表現されている)。
The CPU 100 has ALUIOI, temporary register 1
02. General purpose register 103. Address buffer 104 (
(Represented by AB in the figure).

μアドレス生成部105.μROMI O6,PCl 
07、PSWI 08.タイミング制御部109から構
成される。
μ address generation unit 105. μROMI O6, PCl
07, PSWI 08. It is composed of a timing control section 109.

またINTC112は、割り込み要求フラグ116と形
態指定フラグ119から構成され、タイミング制御部1
09に対し、割り込み要求信号117と形態指定信号1
20を出力する。タイミング制御部109は、INTC
112に対し割り込み要求クリア信号118の形態変更
信号121を出力する。
The INTC 112 also includes an interrupt request flag 116 and a format designation flag 119.
09, interrupt request signal 117 and form specification signal 1
Outputs 20. The timing control unit 109 is an INTC
A form change signal 121 of the interrupt request clear signal 118 is output to the interrupt request clear signal 112 .

INTCl 12は、外部のハードウェアから幾つかの
割り込み信号を受は付け、各割り込みソースに割当てら
れた優先順位を判別し、最も高い優先順位をもった割り
込みソースを一つ選択し、その割り込みソースに対応し
た割り込み要求フラグ116をセットする。割り込み要
求フラグ116と形態指定フラグ119は、割込み要求
がn個あるときに、それぞれn個設定されているが、図
中には1組だけ記載されている。また、外部のハードウ
ェアからの割り込み信号や、優先順位判別部などは、本
発明の主旨に直接関係ないため、特に図示はしていない
INTCl 12 accepts several interrupt signals from external hardware, determines the priority assigned to each interrupt source, selects the one interrupt source with the highest priority, and The corresponding interrupt request flag 116 is set. Although n interrupt request flags 116 and mode specification flags 119 are each set when there are n interrupt requests, only one set is shown in the figure. Further, interrupt signals from external hardware, a priority order determining section, and the like are not particularly illustrated because they are not directly related to the gist of the present invention.

INTC112からの割り込み要求を、CPU100は
2通りの形態で処理することができる。
The CPU 100 can process an interrupt request from the INTC 112 in two ways.

1つは従来からのベクタ割り込み処理で、もう1つは、
本発明の主旨であるところの処理形態で、割り込みが発
生すると、ベクタテーブルは参照せず、データメモリ1
14中の特定アドレスに予め設定されている処理形態情
報に基づき、所定のデータ処理を実行する形態である。
One is traditional vectored interrupt processing, and the other is
In the processing mode that is the gist of the present invention, when an interrupt occurs, the vector table is not referenced and the data memory 1 is
This is a form in which predetermined data processing is executed based on processing form information preset to a specific address in 14.

以下、この所定のデータ処理のことをマイクロサービス
と記ス。
Below, this predetermined data processing will be referred to as a microservice.

ベクタ割り込みがマイクロサービスかの指定は、形態指
定フラグ119で行ない、CPU100から形態指定フ
ラグ119に1“0”が設定されている時にはベクタ割
り込みとして、′1″”が設定すれた時にはマイクロサ
ービスとして指定される。
Specifying whether a vectored interrupt is a microservice is done using the type specification flag 119. When the CPU 100 sets the type specification flag 119 to 1 "0", it is considered a vectored interrupt, and when it is set to ``1'', it is considered a microservice. It is specified.

なお、本実施例における周辺ハードウェア構成とその動
作は、従来例における図9に示す周辺ハードウェア構成
および前述の動作説明と同様であるため、ここでの説明
は省略する。
It should be noted that the peripheral hardware configuration and its operation in this embodiment are the same as the peripheral hardware configuration shown in FIG. 9 in the conventional example and the operation described above, and therefore the description thereof will be omitted here.

次に、本発明のマイクロサービスの処理形態を指定する
処理形態情報について説明する。第2図は処理形態情報
の構成を示す。処理形態情報はデータメモリ114中の
特定のアドレスに配置され、本例の処理形態情報は、チ
ャネルポインタを有する1バイトのヘッダ部と、チャネ
ルポインタによって指し示される2ワードのマイクロサ
ービスチャネルによって構成される。
Next, processing form information that specifies the processing form of a microservice according to the present invention will be explained. FIG. 2 shows the structure of processing mode information. The processing mode information is placed at a specific address in the data memory 114, and the processing mode information in this example is composed of a 1-byte header section having a channel pointer and a 2-word microservice channel pointed to by the channel pointer. Ru.

本例のマイクロサービスチャネルは1本のパルス出力を
想定した構成となっており、出力パルスの出力開始タイ
ミングを指定するワードデータ1と、出力パルスの出力
終了タイミングを指定するワードデータ2から構成され
ている。
The microservice channel in this example is configured to output one pulse, and is composed of word data 1 that specifies the output start timing of the output pulse, and word data 2 that specifies the output end timing of the output pulse. ing.

ワードデータ1はポー)Pから出力されるパルス出力の
、タイマ9010カウント値0からパルス出力を開始す
るカウント値までの期間に相当するワードデータが、ま
たワードデータ2は、タイマ9010カウント値0から
、パルス出力を終了するカウント値までの期間に相当す
るワードデータ、すなわち出力パルスのパルス幅を規定
するためのワードデータが、CPU100によって格納
される。
Word data 1 is the word data corresponding to the period of the pulse output output from the timer 9010 count value 0 to the count value at which pulse output is started, and word data 2 is the period from the timer 9010 count value 0 to the count value that starts pulse output. , word data corresponding to the period up to the count value at which the pulse output ends, that is, word data for defining the pulse width of the output pulse, is stored by the CPU 100.

本例のマイクロサービスは、COMPS903゜COM
PR904からの一致信号913,914によって起動
される。マイクロサービスが起動される以前に、CPU
100はマイクロサービスチャネルやハードウェアに対
し初期化を行なう。
The microservice in this example is COMPS903゜COM
It is activated by match signals 913 and 914 from PR904. Before the microservice is started, the CPU
100 initializes the microservice channel and hardware.

第3図(a)、 (b)は、本例のマイクロサービスを
フローチャートで示したもので、実際にはμプログラム
制御となっている。また、第4図4は本実施例における
パルス出カバターン例である。
FIGS. 3(a) and 3(b) are flowcharts showing the microservice of this example, which is actually controlled by the μ program. Further, FIG. 4 shows an example of a pulse output pattern in this embodiment.

以下、第1図乃至第4図を参照しながら、マイクロサー
ビスおよびパルス出力の制御動作の説明を行なう。ただ
し、出力F/F 905はリセットされていて、ポート
Pからのパルス出力がロウレベルである時から説明を行
う。
The microservice and pulse output control operations will be explained below with reference to FIGS. 1 to 4. However, the explanation will start from a time when the output F/F 905 has been reset and the pulse output from port P is at a low level.

まずタイマ901はCOMPT902の一致信号912
によりオール“0−”にクリアされ、初期値0よりカウ
ント動作を開始する。(第4図−タイミングtO,t3
.t6.t9) 次に、COMPS903の保持値がタイマ901のカウ
ント値と一致すると、一致信号913を出力する。また
一致信号913は、出力F/F 905に入力され、出
力F/F 905をセットすることで、ポートPからの
パルス出力をノ1イレベルにする。さらに、一致信号9
13は上記の動作を行うとともに、割り込み要求をIN
TCI 12に対し発生する。(第4図−タイミングt
l、 t4. t7)INTCl 12が一致信号91
30割り込み要求を受は付けると、このソースに対応す
る割り込み要求フラグ116をセットし、割り込み要求
信号117をアクティブにする。
First, the timer 901 receives the match signal 912 of COMPT902.
All the bits are cleared to "0-" and the counting operation starts from the initial value 0. (Figure 4 - Timing tO, t3
.. t6. t9) Next, when the held value of COMPS 903 matches the count value of timer 901, a match signal 913 is output. Further, the coincidence signal 913 is input to the output F/F 905, and by setting the output F/F 905, the pulse output from the port P is set to the No. 1 level. Furthermore, the coincidence signal 9
13 performs the above operations and also inputs the interrupt request.
Occurs for TCI 12. (Figure 4 - Timing t
l, t4. t7) INTCl 12 is the match signal 91
When the 30 interrupt request is accepted, the interrupt request flag 116 corresponding to this source is set and the interrupt request signal 117 is activated.

タイミング制御部109は、命令処理の終りで割り込み
要求信号117をサンプルし、アクティブであるため、
形態指示手段120をサンプルする。形態指示手段12
0がマイクロサービスを示す1′”であることを検知す
ると、PC107゜PSW108の情報を保持したまま
、μROM106のマイクロサービス処理エントリアド
レスを生成し、マイクロサービスを開始する。
The timing control unit 109 samples the interrupt request signal 117 at the end of instruction processing and is active.
The form indicating means 120 is sampled. Form indicating means 12
When detecting that 0 is 1''' indicating a microservice, the PC 107 generates a microservice processing entry address in the μROM 106 while retaining the information in the PSW 108, and starts the microservice.

以降、マイクロサービスのμプログラム指令に従って処
理される処理フローの説明を第3図(a)のフローチャ
ートにそって進める。
Hereinafter, the processing flow of the microservice according to the μ program command will be explained along the flowchart of FIG. 3(a).

まず最初に、一致信号913を割込みソースとするマイ
クロサービスのヘッダを、データメモリ114中の特定
アドレスから読み出し、マイクロザービスチャネルのア
ドレスを検出する。
First, the header of the microservice using the match signal 913 as an interrupt source is read from a specific address in the data memory 114, and the address of the microservice channel is detected.

次に、タイマ901の内容を読み込み、このとき読み込
んだタイマのカウント値と、このマイクロサービス処理
に対応するマイクロサービスチャネル中のワードデータ
1とを比較する。(以下、この読み込みデータをTMO
という。)比較の結果、TMOよりワードデータ1が小
なる場合には、ワードデータ1をCOMPS 903に
設定する。
Next, the contents of the timer 901 are read, and the count value of the timer read at this time is compared with word data 1 in the microservice channel corresponding to this microservice processing. (Hereinafter, this read data will be used as TMO
That's what it means. ) As a result of the comparison, if word data 1 is smaller than TMO, word data 1 is set in COMPS 903.

次にμプログラムの指令で、タイミング制御部109は
、割込み要求クリア信号118をINTC112に対し
出力し、割込み要求フラグ116をリセットしたマイク
ロサービス処理を終了する。
Next, in response to a command from the μ program, the timing control unit 109 outputs an interrupt request clear signal 118 to the INTC 112, and ends the microservice processing with the interrupt request flag 116 reset.

マイクロサービス処理が終了すれば、タイミング制御部
109は保持していたPCI 07.PSW108の値
から通常の命令処理を再開する。
When the microservice processing is completed, the timing control unit 109 updates the held PCI 07. Normal instruction processing is resumed from the value of PSW108.

あるいは、比較の結果、TMOよりワードデータ1の方
が犬なる場合には、COMPS903へのワードデータ
1の設定は行わずに、μプログラムの指令で、タイミン
グ制御部109は、形態変更信号121をINTC11
2に対し出力し、形態指定フラグ119をリセットし、
マイクロサービスを終了する。
Alternatively, as a result of the comparison, if word data 1 is better than TMO, the timing control unit 109 does not set word data 1 to COMPS 903, and instead sets the form change signal 121 according to the μ program command. INTC11
2, reset the form specification flag 119,
Terminate the microservice.

INTCl 12は、割り込み要求116フラグがセッ
ト状態で、形態指定フラグ119がリセット状態である
ため、今度は通常のベクタ割り込み要求をCPU100
に対し発生し、前述したベクタ割り込み処理を起動する
Since the interrupt request 116 flag is set and the format specification flag 119 is reset, the INTCl 12 sends a normal vectored interrupt request to the CPU 100.
, and starts the vectored interrupt processing described above.

ここで実行される割り込み処理では、COMPS903
へのワードデータ1の設定(更新)の処理が行われなか
った場合の処理で、COMPS 903へのワードデー
タ1の設定が未完了であることを記憶する等の特殊処理
を行う。
In the interrupt processing executed here, COMPS903
In the processing when the setting (updating) of word data 1 to COMPS 903 is not performed, special processing such as storing that the setting of word data 1 to COMPS 903 is incomplete is performed.

この後、タイマ901はカウント動作を続け、COMP
R904の保持値がタイマ9010カウント値と一致す
ると、一致信号914を出力する。
After this, the timer 901 continues counting operation and COMP
When the value held in R904 matches the count value of timer 9010, a match signal 914 is output.

一致信号914は、出力F/F 905に入力され、出
力F/F 905をリセットすることで、ポートPから
のパルス出力をロウレベルにする。さらに、致信号91
4は上記の動作を行うとともに、割り込み要求INTC
I l 2に対し発生する。(第4図−タイミングt2
.t5.t8) INTC112が一致信号9140割り込み要求を受は
付けると、このソースに対応する割り込み要求フラグ1
16をセットし、割り込み要求信号117をアクティブ
にする。
The match signal 914 is input to the output F/F 905, and by resetting the output F/F 905, the pulse output from the port P is set to a low level. Furthermore, the arrival signal 91
4 performs the above operations and also issues an interrupt request INTC.
Occurs for I l 2. (Figure 4 - Timing t2
.. t5. t8) When the INTC 112 accepts the match signal 9140 interrupt request, the interrupt request flag 1 corresponding to this source is set.
16 and activates the interrupt request signal 117.

タイミング制御部109は、命令処理の終りで割り込み
要求信号117をサンプルし、アクティブであるため、
形態指示手段120をサンプルする。形態指示手段12
0がマイクロサービスを示す1”であることを検知する
と、PC107゜PSWI 08を保持したまま、μR
OM106のマイク四サービス処理エントリアドレスを
生成し、マイクロサービスを開始スる。
The timing control unit 109 samples the interrupt request signal 117 at the end of instruction processing and is active.
The form indicating means 120 is sampled. Form indicating means 12
When it detects that 0 is 1” indicating a microservice, hold PC107゜PSWI 08 and press μR.
Generates a microphone service processing entry address for the OM 106 and starts the microservice.

以降、マイクロサービスのμプログラム指令に従って処
理される。処理フ四−の説明を第2図(b)のフローチ
ャートにそって進める。
Thereafter, processing is performed according to the μ program instructions of the microservice. Explanation of the processing step 4 will proceed along the flowchart of FIG. 2(b).

まず最初に、一致信号914を割り込みソースとするマ
イクロサービスのヘッダを、データメモリ114中の特
定アドレスから読み出し、マイク0サーヒスチヤネルの
位置を検出した後、このマイクロサービス処理に対応す
るマイクロサービスチャネル中のワードデータ2をCO
MPR904に格納する。
First, the header of the microservice whose interrupt source is the match signal 914 is read from a specific address in the data memory 114, and after detecting the position of the microphone 0 service channel, the microservice channel corresponding to this microservice processing is read. CO word data 2 of
Store in MPR904.

次にμプログラムの指令で、タイミング制御部109は
、割込み要求クリア信号118をINTC112に対し
出力し、割込み要求フラグ116をリセットしてマイク
ロサービス処理を終了する。
Next, in response to a command from the μ program, the timing control unit 109 outputs an interrupt request clear signal 118 to the INTC 112, resets the interrupt request flag 116, and ends the microservice processing.

マイクロサービス処理が終了すれば、タイミング制御部
109は保持しテイタPC107、P 5W108の値
から通常の命令処理を再開する。
When the microservice processing is completed, the timing control unit 109 resumes normal instruction processing from the values held in the tater PC 107 and P5W 108.

この後、タイマ901がさらにカウントをつづけ、CO
MPT902の保持値がタイマ901のカウント値と一
致すると、COMPT901は一致信号912を出力す
る。この一致信号912は、タイマ901に入力され、
タイマ901のカウント値をオール“0“に初期化する
。さらに、一致信号912は、INTO112t、m入
力され、INTC112に対して、割り込み処理を要求
する(第4図−タイミングt3.t6.t9) INTCl 12が一致信号9120割込み要求を受は
付けると、このソースに対応する割込み要求フラグ11
6をセットし、割込み要求信号117をアクティブにす
る。
After this, the timer 901 continues counting and the CO
When the held value of MPT 902 matches the count value of timer 901, COMPT 901 outputs a match signal 912. This coincidence signal 912 is input to the timer 901,
The count value of the timer 901 is initialized to all "0". Furthermore, the coincidence signal 912 is input to the INTO 112t, m, and requests the INTC 112 to perform interrupt processing (Fig. 4 - timing t3.t6.t9).When the INTCl 12 accepts the coincidence signal 9120 interrupt request, this Interrupt request flag 11 corresponding to the source
6 and activates the interrupt request signal 117.

タイミング制御部109は、命令処理の終りで割込み要
求信号117をサンプルし、アクティブであるため、形
態指示手段120をサンプルする。
Timing control unit 109 samples interrupt request signal 117 at the end of instruction processing, and since it is active, samples format indicating means 120.

ここでは、形態指示手段120は“0”であるので、前
述のベクタ割り込み処理が起動される。
Here, since the format indicating means 120 is "0", the above-mentioned vector interrupt processing is activated.

ここで起動される割り込み処理では、まず、先の一致信
号913によるマイクロサービスによる割り込み処理の
情報に基づいて、COMPS 903へのデータ更新が
未完了の場合には、この処理を実行する。
In the interrupt processing started here, first, based on the information of the interrupt processing by the microservice based on the match signal 913, if the data update to the COMPS 903 is not completed, this processing is executed.

次に、一致信号913,914によって起動されるマイ
クロサービス実行の際に、COMPS903、COMP
R904に設定するデータを、ワードデータ1とワード
データ2に設定し、割り込み処理を終了する。
Next, when executing microservices activated by match signals 913 and 914, COMPS903 and COMPS
The data to be set in R904 is set to word data 1 and word data 2, and the interrupt processing is ended.

この割り込み処理と一致信号913,914による割り
込み処理の実行により、1周期についてのパルス出力の
制御が完了する。従って、これをくり返し行うと、連続
したパルス出力制御を行うことができる。
By executing this interrupt processing and the interrupt processing using the coincidence signals 913 and 914, control of pulse output for one cycle is completed. Therefore, by repeating this process, continuous pulse output control can be performed.

また、COMPS903に設定した値が、そのときのタ
イマのカウント値より大きい場合に生じていた、次周期
のパルス出力を現周期内で出力を開始してしまうという
不具合に対しては、マイクロサービスでこれを判別し、
ベクタ割り込みを発生させて、ソフトウェア処理により
、常に正しいパルス出力開始タイミングに補正すること
が可能である。
Additionally, microservices can be used to solve the problem that the next cycle's pulse output starts within the current cycle when the value set in COMPS903 is larger than the current timer count value. Determine this,
By generating a vector interrupt, it is possible to always correct the correct pulse output start timing through software processing.

このため、従来のパルス出カバターン例の図7における
、周期S 2+83に示す様なパルスの誤発生部分、す
なわちタイミングtX−t6〜t7〜t8の期間は現れ
ず、本来意図した通りのパルス波形である図4の周期S
2に示す様なパルス出力波形が得られる。
Therefore, in the conventional pulse output pattern example shown in FIG. 7, the erroneous pulse generation part shown at period S2+83, that is, the period from timing tX-t6 to t7 to t8, does not appear, and the pulse waveform is as originally intended. A certain period S in Figure 4
A pulse output waveform as shown in 2 is obtained.

以上説明した様に、本発明のパルス発生装置は、現周期
のCOMPS903.COMPR904の一致によって
起動される割り込み処理により、次周期に出力しようと
する出力パルスの、出力開始タイミングと出力終了タイ
ミングを設定することにより、継続的にパルス出力を行
うことが可能である。
As explained above, the pulse generator of the present invention has COMPS903. It is possible to continuously output pulses by setting the output start timing and output end timing of the output pulse to be output in the next cycle using the interrupt process activated by a match of COMP 904.

なお本実施例では、出力パルスの周期に関する制御、す
なわちCOMPT902の設定データの更新は行ってい
ないが、COMPT902が出力する一致信号912に
よる割り込み処理の際に、COMPT902を逐次、所
定のワードデータに更新する処理を実行すれば、1周期
毎に、異なる周期のパルス出力を発生することが可能と
なるため、応用にあわせてより高精度のパルス出力の制
御が実現できる。
In this embodiment, control regarding the period of the output pulse, that is, the setting data of COMPT902 is not updated, but COMPT902 is sequentially updated to predetermined word data during interrupt processing by the match signal 912 outputted by COMPT902. If this process is executed, it becomes possible to generate pulse outputs with different cycles for each cycle, so that more accurate control of pulse outputs can be realized in accordance with the application.

次に、本発明の第2の実施例をしめす。Next, a second embodiment of the present invention will be shown.

なお本実施例では、パルス発生装置の構成と基本的動作
は、前実施例と同様であるため、ここでは詳細な説明は
省略する。
In this embodiment, the configuration and basic operation of the pulse generator are the same as those in the previous embodiment, so a detailed explanation will be omitted here.

以下に、第3図(a)、 (c)、第4図を参照しなが
ら本実施例における、マイクロサービスおよびパルス出
力の制御動作の説明を行なう。ただし、タイマ901は
、カウント動作を行っていて、また出力F/F 905
はリセットされていて、ポートPからのパルス出力はロ
ウレベルであるとする。
The microservice and pulse output control operations in this embodiment will be explained below with reference to FIGS. 3(a), 3(c), and 4. However, the timer 901 is performing a counting operation, and the output F/F 905
It is assumed that has been reset and the pulse output from port P is at a low level.

なお、本例のマイクロサービスチャネルの構成は、実施
例1と同様であるので、説明は省略する。
Note that the configuration of the microservice channel in this example is the same as that in Example 1, so a description thereof will be omitted.

第3図(a)、 (C)は、本例のマイクロサービスを
フローチャートで示したもので、実際にはμプログラム
制御となっている。また、第4図は、本実施例における
パルス出カバターン例である。
FIGS. 3(a) and 3(C) are flowcharts showing the microservice of this example, which is actually controlled by the μ program. Moreover, FIG. 4 is an example of a pulse output pattern in this embodiment.

さて、COMPS903は、その保持値がタイマ901
のカウント値と一致すると、一致信号913を出力し、
この一致信号913は、出力F/F 905をセットす
ることで、ボートPからのパルス出力をハイレベルにす
るとともに、INTC112に対し割り込み要求を発生
する。この要求によってINTC112は、割り込み要
求信号117をタイミング制御部109に対し出力し、
タイミング制御部109がこの要求を受は付けると、割
り込み処理が起動され、COMPS 903の設定デー
タ更新のための処理が行なわれる。
Now, COMPS903 has a held value of timer 901.
When it matches the count value of , it outputs a match signal 913,
This match signal 913 sets the output F/F 905 to cause the pulse output from the boat P to be at a high level, and also generates an interrupt request to the INTC 112 . In response to this request, the INTC 112 outputs an interrupt request signal 117 to the timing control unit 109,
When the timing control unit 109 accepts this request, interrupt processing is activated and processing for updating the COMPS 903 setting data is performed.

(第4図−タイミングtl、t4.t7)ただし、この
割り込み処理は、実施例1において、一致信号913に
よって起動される割り込み処理と同様であるので、ここ
で説明は省略する。
(FIG. 4 - Timings tl, t4.t7) However, since this interrupt processing is the same as the interrupt processing activated by the match signal 913 in the first embodiment, the explanation will be omitted here.

(処理フローは第3図(a)を参照) 一方、一致信号913によって起動された割り込み処理
の間も、タイマ904はカウントを続け、COMPR9
04の保持値がタイマ904のカウント値と一致すると
、COMPR904は一致信号914を出力し、出力F
/F 905をリセットすることで、ボー)Pからのパ
ルス出力をロウレベルにするとともに、INTC112
に対して割り込み要求を発生する。この要求によってI
NTC112は、割り込み要求信号117をタイミング
制御部109に対し出力し、タイミング制御部109が
この要求を受は付けると、割り込み処理が起動され、C
OMPR904の設定データ更新のための処理が行なわ
れる。(第4図−タイミングt2. t5. t8) ここで起動される割り込み処理では、まずマイクロサー
ビスが起動される。以降、マイクロサービスの処理フロ
ーの説明を第3図(C)のフローチャートにそって進め
る。
(See FIG. 3(a) for the processing flow.) On the other hand, even during the interrupt processing activated by the match signal 913, the timer 904 continues counting,
When the held value of 04 matches the count value of timer 904, COMP 904 outputs a match signal 914 and outputs F.
By resetting /F905, the pulse output from Baud)P is set to low level, and the INTC112
Generates an interrupt request for. With this request I
The NTC 112 outputs an interrupt request signal 117 to the timing control unit 109, and when the timing control unit 109 accepts this request, interrupt processing is activated and the C
Processing for updating the setting data of the OMPR 904 is performed. (Figure 4 - Timings t2, t5, t8) In the interrupt processing started here, a microservice is first started. Hereinafter, the processing flow of the microservice will be explained along the flowchart of FIG. 3(C).

まず最初に、一致信号914を割込みソースとスルマイ
クロサービスへのヘッダを、データメモリ114中の特
定アドレスから読み出し、マイクロサービスチャネルの
位置を検出し、このマイクロサービス処理に、ワードデ
ータ2が対応していることを認知する。
First, the match signal 914 is used as the interrupt source and the header to the microservice is read from a specific address in the data memory 114, the position of the microservice channel is detected, and word data 2 corresponds to this microservice processing. Recognize that

次に、COMPS903の内容を読み出し、この読み出
し値とワードデータ2とを比較する。
Next, the contents of COMPS 903 are read out, and this read value is compared with word data 2.

比較の結果、ワードデータ2の値がCOMPS903か
らの読み出し値より、小なる場合には、ワードデータ2
をCOMPR904に格納したのち、マイクロサービス
処理を終了する。(第4図の周期S1のタイミングt1
とt2の関係に相当) マイクロサービス処理が終了すれば、タイミング制御部
109は保持していたPCI O7,PSW108の値
から通常の命令処理を再開する。
As a result of the comparison, if the value of word data 2 is smaller than the value read from COMPS903, word data 2
is stored in the COMPR 904, and then the microservice processing ends. (Timing t1 of period S1 in FIG.
and t2) When the microservice processing is completed, the timing control unit 109 resumes normal instruction processing from the held values of PCI O7 and PSW 108.

あるいは、比較の結果、ワードデータ2の値がCOMP
S 903からの読み出し値より、大なる場合には、C
OMPR904へのデータ更新は行なわずに、マイクロ
サービスを終了し、今度は通常のベクタ割り込み処理を
起動する。
Alternatively, as a result of the comparison, the value of word data 2 is COMP
If it is larger than the read value from S 903, C
The microservice is terminated without updating data to the OMPR 904, and normal vector interrupt processing is started this time.

ここで起動されるベクタ割り込み処理は、設定しようと
する次周期のパルス出力終了タイミングが、(先の一致
信号913によって起動された割り込み処理ですでに設
定済みの)次周期のパルス出力開始タイミングより前の
タイミングになっている場合の特殊処理で、ワードデー
タ2の内容の補正および補正後のデータのCOMPR9
04への設定、または場合によっては、COMPS 9
03へのデータ再設定等の処理を実行する。
The vectored interrupt processing started here is such that the pulse output end timing of the next cycle to be set is longer than the pulse output start timing of the next cycle (which has already been set in the interrupt processing started by the previous match signal 913). In special processing when the timing is earlier, the content of word data 2 is corrected and the COMPR9 of the corrected data is
04 or, in some cases, COMPS 9
Processing such as data resetting to 03 is executed.

上記の処理実行後、ベクタ割り込み処理は終了し、一致
信号914によって起動される全ての割り込み処理を終
了する。
After the above process is executed, the vector interrupt process ends, and all interrupt processes activated by the match signal 914 end.

この後、COMPT902の保持値と、タイマ901の
カウント値が一致すると、COMP Ta2 902は一致信号912を出力し、割り込み処理を要求
するが、ここで行われる割り込み処理は、実施例1と同
様であるので、ここでの説明は省略する。
After this, when the value held in COMP 902 and the count value of timer 901 match, COMP Ta2 902 outputs a match signal 912 and requests interrupt processing, but the interrupt processing performed here is the same as in the first embodiment. Therefore, the explanation here will be omitted.

以上の、一致信号912,913,914によって起動
される割り込み処理によって1周期におけるパルス出力
が制御できる。したがって、この動作を繰り返し実行す
ることにより、連続したパルス出力の制御を実行するこ
とができる。
The pulse output in one cycle can be controlled by the interrupt processing activated by the coincidence signals 912, 913, and 914 as described above. Therefore, by repeatedly performing this operation, continuous pulse output control can be performed.

また、通常ワードデータ1およびワードデータ2として
設定されるデータは、データメモリ114内にあらかじ
め用意した基本データを基に、他の周辺ハードウェア等
からの情報を加味したプログラム処理によって生成され
る場合が多いが、基本データやワードデータ生成過程の
プログラム等に誤りがあると、タイマ901のカウント
値に対して、パルス出力を開始するタイミングすなわち
ワードデ“−夕1より、パルス出力を終了するタイミン
グすなわちワードデータ2のほうが、小さい値を持つよ
うな組合せのワードデータの設定を行ってしまうことが
考えられる。このような場合、パルス出力を終了するタ
イミングが、パルス出力を開始するタイミングより先に
来てしまうと、パルス出力開始タイミングで出力を開始
したパルスは、同じ周期内では、パルス出力を終了する
タイミングが来ないことにより、次の周期のパルス出力
終了タイミングまで継続したパルス出力になってしまう
ことになる。このような、パルス出力は、実施例1でも
述べた通り、制御対象に対して重大な問題を引き起こす
ことが考えられる。
In addition, the data normally set as word data 1 and word data 2 is generated by program processing based on basic data prepared in advance in the data memory 114 and taking into account information from other peripheral hardware, etc. However, if there is an error in the basic data or the program in the word data generation process, the timing to end pulse output may vary from the timing to start pulse output, i.e. word data 1, to the count value of timer 901. It is possible that a combination of word data is set such that word data 2 has a smaller value.In such a case, the timing to end pulse output may come before the timing to start pulse output. If this happens, the pulse that starts output at the pulse output start timing will not have the timing to end the pulse output within the same cycle, and the pulse output will continue until the pulse output end timing of the next cycle. As described in the first embodiment, such a pulse output may cause serious problems for the controlled object.

このような場合に対し、本実施例では、COMPR90
4が出力する一致信号414によって起動される割り込
み処理で、上記のようなパルスの発生が予想される場合
には、次周期のパルス出力終了タイミングとして設定し
ようとするワードデータ2の値を補正することで対処し
、不具合パルスの発生を防止している。
In this embodiment, COMP90
In the interrupt processing activated by the coincidence signal 414 outputted by 4, if the above-mentioned pulse is expected to occur, the value of word data 2 to be set as the pulse output end timing of the next cycle is corrected. This prevents the occurrence of defective pulses.

〔発明の効果〕〔Effect of the invention〕

以上説明した通り本発明のパルス発生装置は、パルス出
力の開始と終了タイミングの設定(更新)のための割り
込みを、マイクロサービスによって処理し、ベクタ割り
込み要求を発生しないため、パルス出力の周波数が増加
しても、割込み処理プログラムへ移行する際のPC,P
SWのスタックへの退避や、割り込み処理プログラムか
らメイン処理へ戻る時、スタックの内容をPC5PSW
へ復帰する処理でCPU時間を占めることがない。
As explained above, the pulse generator of the present invention processes interrupts for setting (updating) the start and end timings of pulse output using microservices and does not generate vectored interrupt requests, so the frequency of pulse output increases. However, the PC and P when transitioning to the interrupt processing program
When saving the SW to the stack or returning from the interrupt processing program to main processing, the contents of the stack are saved to the PC5PSW.
The CPU time is not occupied by the process of returning to .

また、タイマのカウント値に対して、マイクロサービス
により、パルス出力の開始と終了を制御するコンベアレ
ジスタに設定しようとするデータが、誤ったパルスを発
生させてしまう可能性がある場合には、これを検出して
、その結果により、ベクタ割り込みを起動し、特殊処理
を行うことで、常に正常なパルスを発生することができ
る。
In addition, if the data that the microservice attempts to set in the conveyor register that controls the start and end of pulse output for the timer count value may cause an incorrect pulse to be generated, By detecting this, activating a vectored interrupt based on the result, and performing special processing, it is possible to always generate normal pulses.

さらに、パルス発生装置において、ポート数の増加、す
なわち制御するパルス出力の本数が増加した場合にも、
1周期の間についてみれば、すべてのポートに対しての
割り込み処理を、マイクロサービスによって対処するこ
とができる。このため、ポート数の増加に伴う割り込み
処理時間の増加という点に関しては、これをすべてベク
タ割り込み処理で実行する場合に比して、より短時間で
割り込み処理を実行できる。
Furthermore, when the number of ports increases in the pulse generator, that is, the number of pulse outputs to be controlled increases,
For one cycle, interrupt processing for all ports can be handled by microservices. Therefore, regarding the increase in interrupt processing time due to an increase in the number of ports, interrupt processing can be executed in a shorter time than when all of this is executed by vector interrupt processing.

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

第1図は本発明の第1の実施例におけるシステム構成図
、第2図は実施例におけるマイクロサービスの処理形態
情報構成図、第3図3は実施例における割り込み処理フ
ローチャート、第4図は実施例におけるポー)Pからの
パルス出カバターン図、第5図は従来例におけるポート
Pからのパルス出カバターン図、第6図は従来例におけ
るシステム構成図、第7図は従来例における周辺ハード
ウェア構成図である。 100.800・・・・・・CPU、101・・・・・
・ALU。 102・・・・・・テンポラリレジスタ、103・・・
・・・汎用レジスタ、104・・・・・・アドレスバッ
ファ、105・・・・・・μアドレス生成部、106・
・・・・・μROM、107・・・・・・PC,108
・・・・・・PSW、109・・印・りイミング制御部
、110・・・・・・データバス、111・・・・・・
アドレスバス、112・・・・・・INTC,113・
・・・・・プログラムメモリ、114・・・・・・デー
タメモリ、115・・・・・・周辺ハードウェア、11
6・・・・・・割込み要求フラグ、117・・・・・・
割込み要求・信号、118・・・・・・割込み要求クリ
ア信号、119・・・・・・形態指定フラグ、120・
・・・・・形態指定信号、121・・・・・・形態変更
信号、901・・・・・・タイマ、902,903゜9
04・・・・・・コンベアレジスタ、912,913゜
914・・・・・・一致信号、905・・・・・・出力
F/F。 代理人 弁理士  内 原   晋 =38− 手続補正書 (方式) %式% 事件の表示 昭和63年 特 許 願第331527号 2゜ 発明の名称 データ処理装置 3゜ 補正をする者 事件との関係
Figure 1 is a system configuration diagram in the first embodiment of the present invention, Figure 2 is a configuration diagram of microservice processing form information in the embodiment, Figure 3 is an interrupt processing flowchart in the embodiment, and Figure 4 is the implementation Figure 5 is a pulse output cover diagram from port P in the example, Figure 5 is a pulse output diagram from port P in the conventional example, Figure 6 is a system configuration diagram in the conventional example, and Figure 7 is the peripheral hardware configuration in the conventional example. It is a diagram. 100.800...CPU, 101...
・ALU. 102...Temporary register, 103...
. . . General purpose register, 104 . . . Address buffer, 105 . . . μ address generation unit, 106.
...μROM, 107 ...PC, 108
...PSW, 109...marking/retiming control section, 110...data bus, 111...
Address bus, 112...INTC, 113.
...Program memory, 114...Data memory, 115...Peripheral hardware, 11
6... Interrupt request flag, 117...
Interrupt request/signal, 118... Interrupt request clear signal, 119... Form specification flag, 120...
...Form designation signal, 121...Form change signal, 901...Timer, 902,903゜9
04... Conveyor register, 912,913°914... Match signal, 905... Output F/F. Agent Patent attorney Susumu Uchihara = 38- Procedural amendment (method) % formula % Display of the case 1988 Patent Application No. 331527 2゜Name of the invention Data processing device 3゜Relationship to the case by the person making the amendment

Claims (1)

【特許請求の範囲】[Claims] 命令の実行アドレスを保持するプログラムカウンタ、プ
ログラムの実行状態を保持する手段、汎用レジスタおよ
びマイクロプログラムROMを含む中央処理装置と、前
記中央処理装置へ非同期に割り込み処理要求を発生する
割込み要求発生回路と、プログラムメモリと、データメ
モリと、周辺回路とを有するデータ処理装置において、
前記周辺回路は、タイマと、前記タイマとの比較を行う
複数の比較レジスタと、パルス出力用の出力ポートとを
有し、前記割込み要求発生回路は、割込み処理要求の発
生に加え、所定のデータ処理の要求を発生する手段と、
前記の割込み処理要求と前記所定のデータ処理の要求を
識別するための形態指示手段とを備え、前記データメモ
リ内には前記所定のデータ処理の処理形態を指定する処
理形態情報が格納され、前記割込み要求発生回路から前
記所定のデータ処理の要求が前記中央処理装置に対して
発生されると、前記中央処理装置は前記形態指示手段が
前記所定のデータ処理を指示していることを検知した場
合には、命令実行処理を中断し、前記処理形態情報に従
い、前記データメモリ内の所定のデータと、当該タイミ
ングにおける前記タイマの値または前記比較レジスタの
値とを比較し、比較結果が所定の条件のとき前記所定の
比較レジスタへのデータ転送を行う手段を有し、前記出
力ポートからのパルス発生を制御することを特徴とする
データ処理装置。
a central processing unit including a program counter for holding an execution address of an instruction, a means for holding a program execution state, a general-purpose register, and a microprogram ROM; and an interrupt request generation circuit for asynchronously generating an interrupt processing request to the central processing unit. , a data processing device having a program memory, a data memory, and a peripheral circuit,
The peripheral circuit includes a timer, a plurality of comparison registers for comparing with the timer, and an output port for outputting pulses, and the interrupt request generation circuit generates predetermined data in addition to generating interrupt processing requests. means for generating a request for processing;
a mode specifying means for identifying the interrupt processing request and the predetermined data processing request; processing mode information specifying the processing mode of the predetermined data processing is stored in the data memory; When a request for the predetermined data processing is issued from the interrupt request generation circuit to the central processing unit, the central processing unit detects that the format instruction means is instructing the predetermined data processing; In order to do so, the instruction execution process is interrupted, and according to the processing type information, the predetermined data in the data memory is compared with the value of the timer or the value of the comparison register at the timing, and if the comparison result meets the predetermined condition. A data processing device comprising means for transferring data to said predetermined comparison register when said data processing device controls pulse generation from said output port.
JP63331527A 1988-12-29 1988-12-29 Data processing device Expired - Fee Related JP2844624B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63331527A JP2844624B2 (en) 1988-12-29 1988-12-29 Data processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63331527A JP2844624B2 (en) 1988-12-29 1988-12-29 Data processing device

Publications (2)

Publication Number Publication Date
JPH02178802A true JPH02178802A (en) 1990-07-11
JP2844624B2 JP2844624B2 (en) 1999-01-06

Family

ID=18244652

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63331527A Expired - Fee Related JP2844624B2 (en) 1988-12-29 1988-12-29 Data processing device

Country Status (1)

Country Link
JP (1) JP2844624B2 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS621058A (en) * 1985-06-26 1987-01-07 Nec Corp Information processor

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS621058A (en) * 1985-06-26 1987-01-07 Nec Corp Information processor

Also Published As

Publication number Publication date
JP2844624B2 (en) 1999-01-06

Similar Documents

Publication Publication Date Title
JPH11219302A (en) Method and device affecting subsequent instruction processing in data processor
EP0279953B1 (en) Computer system having mixed macrocode and microcode instruction execution
JPH02178802A (en) Data processor
KR100188374B1 (en) Processing unit
JP2003507815A (en) Interrupt service with save and return flags
JP2508845B2 (en) Pulse width modulation inverter controller
JPH0573296A (en) Microcomputer
JP2536102B2 (en) Data processing device
JPS6269352A (en) Microprocessor
JP3767539B2 (en) Auxiliary arithmetic unit, central processing unit and information processing unit
JPS5850367B2 (en) input/output control device
JP2536103B2 (en) Data processing device
JPS62296236A (en) Interruption processor for microprocessor
JPH05120203A (en) Dma control system
JPH0243626A (en) Apparatus for controlling execution speed of computer processor
JPH0340013A (en) Central arithmetic processing unit
JPS60178524A (en) One-chip microcomputer
JPS62164138A (en) Microprocessor with concurrent loop
JPH10171654A (en) High-speed data processing unit
JPH0452973B2 (en)
JPH01309174A (en) Vector processor
JPS61187044A (en) Information processor
JPS6269350A (en) Microprocessor
JPH01102653A (en) Microprogram control system
JPS62113239A (en) Microinstruction generation system

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees