JPH02136902A - Data processor - Google Patents

Data processor

Info

Publication number
JPH02136902A
JPH02136902A JP29131088A JP29131088A JPH02136902A JP H02136902 A JPH02136902 A JP H02136902A JP 29131088 A JP29131088 A JP 29131088A JP 29131088 A JP29131088 A JP 29131088A JP H02136902 A JPH02136902 A JP H02136902A
Authority
JP
Japan
Prior art keywords
interrupt
register
processing
pulse
signal
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
JP29131088A
Other languages
Japanese (ja)
Other versions
JP2536103B2 (en
Inventor
Hisaharu Oba
大場 久晴
Hajime Sakuma
肇 佐久間
Yukio Maehashi
幸男 前橋
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 JP63291310A priority Critical patent/JP2536103B2/en
Priority to DE89121317T priority patent/DE68905028T2/en
Priority to EP89121317A priority patent/EP0369470B1/en
Priority to US07/438,750 priority patent/US5126944A/en
Publication of JPH02136902A publication Critical patent/JPH02136902A/en
Application granted granted Critical
Publication of JP2536103B2 publication Critical patent/JP2536103B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Feedback Control In General (AREA)

Abstract

PURPOSE:To realize the highly accurate output control by setting the pulse output end timing based on the data which is previously set without saving the PC and the PSW into a stack space when an interruption process request is received. CONSTITUTION:A data memory 213 stores the process form information to designate a prescribed data process form. When a prescribed data process request is given to a CPU 200 from an interruption controller INTC 211, the CPU 200 interrupts an instruction executing process after detecting that a form designating means 220 points a prescribed data process. Then the CPU 200 operates a 1st comparing register 101, a capture register 105, and the memory 213 in order to control the generation of pulses to output ports P0 - P3. As a result, the output control is attained with high accuracy.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、メカ制御におけるパルス出力において、特に
複数のパルスを連続的に出力するデータ処理装置に関す
る。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to pulse output in mechanical control, particularly to a data processing device that continuously outputs a plurality of pulses.

〔従来の技術〕[Conventional technology]

昨今、メカ制御においては、マイコン(マイクロコンピ
ュータ)が利用されている。基本的には、マイコンから
出力されるPWM出力パルスによって弁の開閉や、モー
タの駆動などを直接行なっているのが一般的である。
Recently, microcomputers have been used for mechanical control. Basically, it is common to open and close valves, drive motors, etc. directly using PWM output pulses output from a microcomputer.

第7図は、4木のパルス出力を行なう場合のパルス出カ
バターン例を示している。−数的にパルス出力制御は、
何らかの基準信号の発生から、ある時間の遅れをもって
パルスをアクティブ(ハイレベル)にし、パルス出力が
アクティブ(ハイレベル)の期間、メカを駆動するとい
う方法をとっている。この場合の、ある時間の遅れとい
うのは、パルスを出力するタイミングを意味し、またパ
ルス出力がアクティブの期間(すなわちアクティブパル
ス@)というのは制御量そのものを意味している。
FIG. 7 shows an example of a pulse output pattern when four-tree pulse output is performed. - Numerically, pulse output control is
A method is used in which a pulse is made active (high level) after a certain time delay from the generation of some reference signal, and the mechanism is driven while the pulse output is active (high level). In this case, a certain time delay means the timing at which the pulse is output, and the period during which the pulse output is active (ie, active pulse @) means the control amount itself.

以下、第8図と第9図を参照しながら従来のパルス発生
装置を説明する。第8図は従来のパルス発生装置のブロ
ック図、第9図は従来の周辺ハードウェアのブロック図
である。第8図は、CPU250、アドレスバス214
.データバス205゜INTC240,フログラムメモ
リ212.データメモリ2132周辺ハードウェア25
1から構成されている。
Hereinafter, a conventional pulse generator will be explained with reference to FIGS. 8 and 9. FIG. 8 is a block diagram of a conventional pulse generator, and FIG. 9 is a block diagram of conventional peripheral hardware. FIG. 8 shows the CPU 250, address bus 214
.. Data bus 205° INTC 240, program memory 212. Data memory 2132 Peripheral hardware 25
It consists of 1.

CPU200は、算術論理演算ユニット(以下ALUと
記す)201.テンポラリレジスタ202゜汎用レジス
タ203.アドレスバッファ204(図ではABで表現
されている)、マイクロアドレス(以下μアドレスと記
す)生成部206゜μ’ROM209.PC207,P
SW208. タイミング制御部225から構成される
The CPU 200 includes an arithmetic logic unit (hereinafter referred to as ALU) 201. Temporary register 202゜General purpose register 203. Address buffer 204 (represented by AB in the figure), micro address (hereinafter referred to as μ address) generation unit 206゜μ'ROM 209. PC207,P
SW208. It is composed of a timing control section 225.

またINTC240には、割り込み要求フラグ215が
あり、タイミング制御部225に対し、割り込み要求信
号218を出力する。タイミング制御部210は、IN
TC240に対し割り込み要求クリア信号2】7を出力
する。
The INTC 240 also has an interrupt request flag 215 and outputs an interrupt request signal 218 to the timing control section 225. The timing control section 210
Outputs an interrupt request clear signal 2]7 to the TC240.

INTC240は、外部のハードウェアから幾つかの割
り込み信号を受は付け、各割り込みソースに割当られた
優先順位を判別し、最も高い優先順位をもった割り込み
ソースを一つ選択し、その割り込みソースに対応した割
り込み要求フラグ215をセットする。割り込み要求フ
ラグ2】5は、割込み要求がn個あるときに、n個設定
されているが、図中には1個だけ記載されている。また
外部のハードウェアからの割り込み信号や、優先順位判
別部などは、特に図示していない。
The INTC 240 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 assigns the interrupt signal to that interrupt source. The corresponding interrupt request flag 215 is set. Although n interrupt request flags 2 and 5 are set when there are n interrupt requests, only one is shown in the figure. In addition, 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.

次に第9図を用いて、周辺ハードウェア251の構成を
説明する。周辺ハードウェア25]は、クロックをベー
スとした第1乃至第4のダウンカウンタ901・〜90
4と、ポートレジスタ909と、出カポ−)PO〜P3
から構成され、ポートPO〜P3に対応した基準信号0
〜3が入力されている。基準信号O〜3は、また、IN
TC240に入力され、それぞれポー)PO〜P3につ
いての割り込み要求を行なう。ダウンカウンタ0〜3は
、データバス205からのカウント値の書き込みで、カ
ウント動作を開始し、ダウンカウンタからのポローの発
生で、INTC240に対し割り込み要求を発生すると
ともに、各ダウンカウンタのカウントを停止する構成に
なっている。また、出力パルスの制御は、データバス2
05から、ポートレジスタ909に出力レベルを直接書
き込むことで行なっている。
Next, the configuration of the peripheral hardware 251 will be explained using FIG. 9. Peripheral hardware 25] includes first to fourth down counters 901 to 90 based on clocks.
4, port register 909, and output port) PO to P3
The reference signal 0 corresponds to ports PO to P3.
~3 has been input. The reference signals O~3 are also IN
They are input to the TC 240 and make interrupt requests for PO to P3, respectively. The down counters 0 to 3 start counting operation when a count value is written from the data bus 205, and when a pollo occurs from the down counter, an interrupt request is generated to the INTC 240 and the counting of each down counter is stopped. It is configured to do this. In addition, the control of the output pulse is performed using the data bus 2.
From 05 onwards, this is done by directly writing the output level to the port register 909.

以下、ポートPOにおける基準信号0が発生したところ
から説明を行なう。
The explanation will be given below from the point where the reference signal 0 is generated at the port PO.

通常の命令処理では、PC207に格納されたプログラ
ムアドレスが、アドレスバッファ204に転送され、ア
ドレスバス214をドライブし、プログラムメモリ2J
、2から次に実行すべき命令がフェッチされる。
In normal instruction processing, the program address stored in the PC 207 is transferred to the address buffer 204, drives the address bus 214, and drives the program memory 2J.
, 2, the next instruction to be executed is fetched.

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

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

さて、基準信号0が入力されると、INTC240に対
し割り込み要求を発生し、INTC240が要求を受は
付は割り込み要求フラグ215がセットされれば、割り
込み要求信号218がタイミング制御部225に対して
出力される。
Now, when the reference signal 0 is input, an interrupt request is generated to the INTC 240, and the INTC 240 accepts the request. Output.

μプログラムの最後の指令は、通常割り込みが発生して
いるかいないかを検知するための指令で、この指令が出
るとタイミング制御部225は、割り込み要求信号21
8の有無をサンプルする。割り込み要求信号218がア
クティブであれば、割込み要求クリア信号217をIN
TC240に対し出力し、割り込み要求フラグ215を
クリアする。
The last command of the μ program is a command for detecting whether an interrupt has occurred or not. When this command is issued, the timing control unit 225 sends an interrupt request signal 21
Sample the presence or absence of 8. If the interrupt request signal 218 is active, the interrupt request clear signal 217 is set to IN.
It is output to the TC 240 and the interrupt request flag 215 is cleared.

次にPC207とPSW208をスタックポインタ(C
PU250中に設定されているレジスタであるが図示は
していない)が指し示すスタック空間に退避し、データ
メモリ213中の特定のアドレスに設定されているベク
タテーブルに格納されている割り込みソースに対応する
割り込み処理プログラムのエントリアドレスを読み出し
、データバス205経由でPC207に設定する。PC
207に新たに設定されたプログラムアドレスから割り
込み処理プログラムは実行を開始する6基準信号0によ
る割り込み処理要求に基く割込み処理プログラムは、ボ
ー)POからのパルス出力開始タイミングを規定する割
り込み処理で、C!PU 250は、基準信号0の発生
からボー)POのパルス出力をアクティブにするまでの
期間に相当するデータをダウンカウンタ0に書き込む。
Next, connect the PC 207 and PSW 208 to the stack pointer (C
It is saved in the stack space pointed to by a register (not shown) set in the PU 250, and corresponds to the interrupt source stored in the vector table set at a specific address in the data memory 213. The entry address of the interrupt processing program is read and set in the PC 207 via the data bus 205. PC
The interrupt processing program starts execution from the program address newly set in 207.6 The interrupt processing program based on the interrupt processing request by reference signal 0 is the interrupt processing that specifies the timing to start pulse output from PO. ! The PU 250 writes data corresponding to the period from the generation of the reference signal 0 to the activation of the pulse output of the baud PO to the down counter 0.

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

psw値をそれぞれPC207,PSW208へ復帰す
ることで、割り込みが発生した時点の次の命令から処理
を再開する。
By returning the psw values to the PC 207 and PSW 208, respectively, processing is restarted from the next instruction at the time when the interrupt occurred.

またダウンカウンタ0は、上述したCPU250による
データの書き込みが行なわれると、これに同期してダウ
ンカウンタを開始する。
Furthermore, when the above-described data is written by the CPU 250, the down counter 0 starts counting down in synchronization with this.

次に通常の命令実行中、パルス出力開始タイミングを示
す。ダウンカウンタOからのポルー信号911が発生す
ると、前述の説明と同様に、INTC240が割り込み
要求を受は付け、割り込み要求信号218がタイミング
制御部225に対して出力される。
Next, the pulse output start timing during normal instruction execution is shown. When the poll signal 911 from the down counter O is generated, the INTC 240 accepts the interrupt request and outputs the interrupt request signal 218 to the timing control section 225, as described above.

μプログラムから、割り込みが発生しているかいないか
を検知するための指令が発生すると、タイミング制御部
225は、割り込み要求信号218の有無をサンプルす
る。
When a command for detecting whether an interrupt has occurred is generated from the μ program, the timing control unit 225 samples the presence or absence of the interrupt request signal 218.

割り込み要求信号218がアクティブであれば、割込み
要求クリア信号217をINTC240に対し出力し、
割込み要求フラグ215をクリアする。
If the interrupt request signal 218 is active, an interrupt request clear signal 217 is output to the INTC 240,
Clear the interrupt request flag 215.

次にPC207とPSW20gをスタック空間に退避し
、データメモリ213中の特定のアドレスに設定されて
いるベクタテーブルに格納されている割り込みソースに
対応する割り込み処理プログラムのエントリアドレスに
分岐し、割り込み処理プログラムは実行を開始する。
Next, the PC 207 and PSW 20g are saved to the stack space, the interrupt processing program 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 213, and the interrupt processing program starts execution.

この割込み処理プログラムは、まずポートレジスタ90
9の内容を読み込み、ポートレジスタ9090ビツトO
が“0”であることから、ボー)POにおけるパルス出
力を立ちあげる割り込み処理となり、ポートレジスタ9
09のビット0を“1”に設定することで、ボー)PO
からの出力パルスをハイレベルにし、パルス出力を開始
スる。
This interrupt processing program starts with the port register 90.
Read the contents of port register 9090 bit O
Since this is “0”, the interrupt processing starts the pulse output at PO (baud), and the port register 9
By setting bit 0 of 09 to “1”, the baud) PO
Set the output pulse from to high level and start pulse output.

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

psw値をそれぞれPC207,PSW208へ復帰す
ることで、割り込みが発生した時点の次の命令かρ)処
理を再開才4〕。
By returning the psw values to the PC 207 and PSW 208, respectively, the processing can be resumed with the next instruction at the time when the interrupt occurred.

次に通常())命?、−実行中、今一度目、パルス出力
終了タイミ〕/ゲタ示す。り゛ランカウンタ0からのボ
ロー信壮911が発生すると、前述の説明と同様に、I
NTC240が割り込み要求を受は付け、割り込み要求
信号;;18がタイミング制御部225に対1.て出力
′される。
Next is normal ()) life? , - During execution, once again, indicates pulse output end time]/get. When Borrow Shinsou 911 occurs from the rerun counter 0, the I
The NTC 240 accepts the interrupt request and sends an interrupt request signal; is output.

μプログラムから、割り込みが発生しているかいないか
を検知するための指令メバ発生すると、タイミング制御
部225は、割り込み要求信号218の有無をす゛/プ
ルする。
When the μ program generates a command for detecting whether or not an interrupt has occurred, the timing control unit 225 checks/pulls the presence or absence of the interrupt request signal 218.

割り込み要求信号218がアクティブであれば、割0込
み要求、シリア信号217をTNTC240に対し出力
17、割り込み要求フラグ215をクリアする、 次i:’J”C207とP S V=’ 208をスタ
、、、 夕空間に3Fh M +、 、デー・少メモリ
213中の特定のアドレスに設定されているベクタテー
ブルに格納されている割り込みソーストご対応する割り
込み処理プログラムの!6ン■・す゛アドレスに分岐t
7、割り込み処理ブ・1グラムは実行を開始するつ この割込み処理プログラムは、まず・fミートレジスタ
909の内容を読み込み、ボー) L==ジスタ909
のビット0がパ1″であることから、トートP Oにお
けるパルス出力を立ち下げる割り込み処理となり、ボー
 l−レジスタ909のビットOを・′″0”に設定す
ることで、ポートPOからの出力パルスをロウ:ノヘル
に1〜、パルス出力を終了f 、7.。
If the interrupt request signal 218 is active, output 17 the interrupt request and serial signal 217 to the TNTC 240, clear the interrupt request flag 215, Next i: 'J' Star C207 and P S V = ' 208, ,, In the evening space, 3Fh M +, , Branch to the address of the interrupt processing program corresponding to the interrupt source stored in the vector table set at a specific address in the data/small memory 213. t
7. Interrupt processing program 1 starts execution This interrupt processing program first reads the contents of the f meet register 909 and executes baud) L== register 909
Since the bit 0 of the baud register 909 is ``0'', it is an interrupt process that lowers the pulse output at the port PO, and by setting the bit 0 of the baud register 909 to Low pulse: 1~, end pulse output f, 7..

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

PSW値をそれぞれPC207,PSW208へ復帰す
ることで、割り込みが発生した時点の次の命令から処理
を再開する。
By returning the PSW values to the PC 207 and PSW 208, respectively, processing is restarted from the next instruction at the time when the interrupt occurred.

同様の処理を、ポートP1からボー・トP3に対1〜て
も同様に行なり8以上、種々あるパルス出力制御方法の
1例り:示1,2だが、基本的に(大同様の処理方法で
制御が行なわれろ。
Similar processing is performed from port P1 to port P3 in the same way. Control is done in a certain way.

〔発明が解決1−7ようとする課題J 前述1.た。1うに、マイクロコンビュ〜りは、パルス
出力発生のための基準信号を、割り込み信号と1,5て
受は付け、割り込み処理プログラムに1、って、パルス
の立ら」−げ、立ち下げなどの制御を行っでいるため、
基準信号の発生回数が増えると、基準信号割り込み、パ
ルスの立ち上がりタイミング、立ち下げタイミングなど
の割り込み要求も多く発生17、その際のPC,PSW
のスタックへの退避や、割り込み処理プログラムからメ
イン処理へ戻る時、ヘタツクの内容をPC,PSWへ復
帰する処理が頻繁に発生し、退避、復帰に割かれるCP
U時間が膨大なものになる、 一方、CI) Uはパルスの制御の他に、その他のデ・
−夕処理など種々雑多な仕事を行な、:)でおり、出力
パルス周波数が高くなると、これらのメイン処理に割か
れるC PTJ時間が少なくなり、場合によっては全く
できない処理が発生することも起こり得る。従って、昨
今の高速、高精度のメカ制御ニオケるマ・fクロ1ンビ
ュータによる制御は非常に難し2いものになっている。
[Problem J to be solved by the invention 1-7 Above 1. Ta. 1. The microcontroller accepts the reference signal for pulse output generation as an interrupt signal, and uses 1 and 5 in the interrupt processing program to make the pulse rise, fall, etc. Since we are controlling
As the number of times the reference signal is generated increases, the number of interrupt requests such as reference signal interrupt, pulse rise timing, and fall timing also increases17.
When returning from the interrupt processing program to the main processing, the process of saving the contents of the stack to the stack and returning the contents of the stack to the PC and PSW occurs frequently, and the CP used for saving and returning
U time becomes enormous. On the other hand, CI) U is not only responsible for pulse control, but also for other
-The CPTJ performs various miscellaneous tasks such as evening processing, etc., and as the output pulse frequency increases, the CPTJ time allocated to these main processing decreases, and in some cases, processing that cannot be done at all may occur. obtain. Therefore, control using modern high-speed, high-precision mechanical controllers has become extremely difficult.

加★で、パルス出力の立ちあげと立ち下げの各タイミン
グにおける割り込み処理を、従来からのソフトウェア処
理だけで制御すイ)方法では、割り込み要因が発生1〜
てから割や)込み処理プログラノ、が開始するまでの時
間の遅れや、ポートへのf・−タ書き”込み時間による
遅れなどが発生し、精度の高い制御ができないゃ さらに、従来のパルス発生装置は、ダウンカウンタにつ
いての名基準信号および各ダ・シンカラ〕/り毎に割り
込み処理要求を行なうため、出力パルス数の増力旧z二
伴う基準信号とダウンカウンタの増加により、INTC
内の割り込み要求フラグも増加し、また割り込み要求信
号線も増加するため、INTCと周辺バー・ドウエア間
の配線領域も璽;ン、システム全体のハードウェア量が
増えることにより、製品コスI・を上げて1−まうこと
になZl。
With method A), the interrupt processing at each timing of pulse output rise and fall is controlled only by conventional software processing.
There will be a delay in the time it takes for the programming process to start, and a delay in the time it takes to write f/- data to the port. Since the device issues an interrupt processing request for each reference signal and down counter for the down counter, the increase in the reference signal and down counter due to the increase in the number of output pulses increases the INTC
As the number of interrupt request flags within the system and the number of interrupt request signal lines also increase, the wiring area between the INTC and peripheral hardware will also increase.As the amount of hardware for the entire system increases, product cost I. Raise it to 1-maikotona Zl.

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

本発明は、PCとPSWと汎用レジスタ八μROMを含
むCPUと、CPUへ非同則に処理要求な発生するIN
TCと5プログラムメモリと、デークラメモリと、周辺
回路とを有する処理装置に於いて、周辺回路は第1のタ
イマと、第」のコンベアレジスタと、キャプチャレジス
タと、第2のタイマと、第2のフンペアレジスタと、パ
ルス発生用の複数の出力ポートと、該出力ポートに対し
選択的にセットパルスを発生する手段と含んで構成され
、且つINTCは、従来の割り込み処理要求の発生に加
え、所定のデータ処理の要求を発生する手段と、従来の
割込み処理要求と前記所定のデータ処理の要求を識別す
るための形態指示手段を備え、且つデータメモリ内には
所定のデータ処理の処理形態を指定する処理形態情報が
格納され、INTCからの所定のデータ処理の要求がC
PUに対して発生されると、CPUは形態指示手段が所
定のデータ処理を指示していることを検知した場合には
、命令実行処理を中断し、処理形態情報に従い、第1の
コンベアレジスタと、キャプチャレジスタと、データメ
モリを操作することで複数の出力ポートからのパルス発
生を制御するという特徴を有している。
The present invention provides a CPU including a PC, a PSW, and a general-purpose register 8μROM, and an IN
In a processing device having a TC, a program memory, a data storage memory, and a peripheral circuit, the peripheral circuit includes a first timer, a first conveyor register, a capture register, a second timer, and a second timer. The INTC includes a function register, a plurality of output ports for pulse generation, and means for selectively generating set pulses for the output ports, and in addition to generating conventional interrupt processing requests, The device includes means for generating a request for predetermined data processing, and format indicating means for distinguishing between a conventional interrupt processing request and the request for the predetermined data processing, and a processing format for the predetermined data processing is stored in the data memory. Specified processing mode information is stored, and requests for specified data processing from INTC are sent to C
When issued to the PU, if the CPU detects that the format instruction means is instructing predetermined data processing, the CPU interrupts the instruction execution process and executes the instruction execution process with the first conveyor register according to the processing format information. , it has the feature of controlling pulse generation from multiple output ports by manipulating the capture register and data memory.

このように、パルス出力開始タイミングを与える専用の
ハードウェアと、パルス出力終了タイミングを与える専
用のハードウェアを備えており、したがって、パルス出
力開始タイミングを割り込み要求信号として受付た際、
PC,PSWをスタック空間に退避する事なしに、事前
に設定されたデータに基すきパルス出力終了タイミング
を設定する事で、複数のパルス出力ポートに対してのパ
ルス出力制御を行うことができる。
In this way, it is equipped with dedicated hardware that provides the pulse output start timing and dedicated hardware that provides the pulse output end timing. Therefore, when the pulse output start timing is received as an interrupt request signal,
By setting the desired pulse output end timing based on preset data without saving the PC and PSW to the stack space, it is possible to perform pulse output control for a plurality of pulse output ports.

〔実施例〕〔Example〕

以下、図面により本発明を詳述する。 Hereinafter, the present invention will be explained in detail with reference to the drawings.

本発明に基づく第1の実施例を第1図と第2図を参照し
て説明する。第1図は第1の実施例の周辺ハードウェア
のブロック図、第2図は第1の実施例を示すパルス発生
装置のブロック図である。
A first embodiment based on the present invention will be described with reference to FIGS. 1 and 2. FIG. 1 is a block diagram of peripheral hardware of the first embodiment, and FIG. 2 is a block diagram of a pulse generator showing the first embodiment.

本発明のパルス発生装置は、CPU200.アドレスバ
ス214.データバス205.INTC211、プログ
ラムメモリ212.データメモリ213、周辺ハードウ
ェア221から構成されている。
The pulse generator of the present invention includes a CPU 200. address bus 214. Data bus 205. INTC 211, program memory 212. It is composed of a data memory 213 and peripheral hardware 221.

CPU200は、ALU201.テンポラリレジスタ2
02.汎用レジスタ203.アドレスバッファ204(
図ではABで表現されている)。
The CPU 200 has an ALU 201. Temporary register 2
02. General purpose register 203. Address buffer 204 (
(Represented by AB in the figure).

μアドレス生成部206.μROM209.PC207
、PSW208.タイミング制御部210から構成され
る。
μ address generation unit 206. μROM209. PC207
, PSW208. It is composed of a timing control section 210.

またINTC211は、割り込み要求フラグ215と形
態指定フラグ216から構成され、タイミング制御部2
10に対し、割り込み要求信号218と形態指定手段2
20を出力する。タイミング制御部210は、INTC
211に対し割り込み要求クリア信号217と形態変更
信号219を出力する。
The INTC 211 also includes an interrupt request flag 215 and a format designation flag 216.
10, the interrupt request signal 218 and the mode specifying means 2
Outputs 20. The timing control section 210 is an INTC
It outputs an interrupt request clear signal 217 and a form change signal 219 to 211.

INTC211は、外部のハードウェアから幾つかの割
り込み信号を受は付け、各割り込みソースに割当てられ
た優先順位を判別し、最も高い優先順位をもった割り込
みソースを一つ選択し、その割り込みソースに対応した
割り込み要求フラグ215をセットする。割り込み要求
フラグ215と形態指定フラグ216は、割り込み要求
がn個あるときに、それぞれn個設定されているが、゛
図中には1組だけ記載されている。また、外部のハード
ウェアからの割り込み信号や、優先順位判別部などは、
本発明の主旨に直接関係ないため、特に図示はしていな
い。
The INTC211 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 applies the interrupt signal to that interrupt source. The corresponding interrupt request flag 215 is set. Although n interrupt request flags 215 and mode specification flags 216 are each set when there are n interrupt requests, only one set is shown in the figure. In addition, interrupt signals from external hardware, priority determination units, etc.
Since it is not directly related to the gist of the present invention, it is not particularly illustrated.

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

1つは従来からのベクタ割り込み処理で、もう1つは、
本発明の主旨であるところの処理形態で、割り込みが発
生すると、ベクタテーブルは参照せず、データメモリ2
13中の特定アドレスに予め設定されている処理形態情
報に基づき、所定のデータ処理を実行する形態である。
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 2 is
This is a mode in which predetermined data processing is executed based on processing mode information preset to a specific address in 13.

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

ベクタ割り込みかマクロサービスかの指定は、形態指定
フラグ216で行ない、CPU200から形態指定フラ
グ216に“0”が設定されている時にはベクタ割り込
みとして、“1”が設定された時にはマクロサービスと
して指定される。
The designation of a vectored interrupt or a macro service is made using the type designation flag 216. When the CPU 200 sets the type designation flag 216 to "0", it is designated as a vectored interrupt, and when it is set to "1", it is designated as a macro service. Ru.

以下、本発明による専用ハードウェア構成と、マクロサ
ービスによるパルス出力処理のフローを説明する。まず
周辺ハードウェア221の構造な第1因に示す。
The dedicated hardware configuration according to the present invention and the flow of pulse output processing by the macro service will be described below. First, the first factor is the structure of the peripheral hardware 221.

周辺ハードウェア221は、クロックをベースとしたフ
リーランニングタイマ100.フリーランニングタイマ
100に対して比較動作を行うフンペアレジスタ101
 (図中にCOMPOと記載)と102(図中にCOM
Plと記載)と1o3(図中にCOMP2と記載)と1
04 (図中にCOMP3と記載)、キャプチャレジス
タ1o5 (図中にCAPと記載)、ビット選択レジス
タ109(図中にSRと記載)、外部パルスT1をカウ
ントソースとするイベントカウンタ1o6、イベントカ
ウンタ106に対して比較動作を行うコンベアレジスタ
107(図中にCOMPA左記載)、出カポ−)PO〜
P3から構成される。
Peripheral hardware 221 includes clock-based free-running timers 100 . Hump pair register 101 that performs comparison operation with respect to free running timer 100
(written as COMPO in the figure) and 102 (written as COMPO in the figure)
Pl) and 1o3 (written as COMP2 in the diagram) and 1
04 (written as COMP3 in the figure), capture register 1o5 (written as CAP in the figure), bit selection register 109 (written as SR in the figure), event counter 1o6 whose count source is external pulse T1, event counter 106 Conveyor register 107 (COMPA written on the left in the figure) that performs a comparison operation with respect to output capo) PO~
Consists of P3.

一致信号111,112,113,114はそれぞれコ
ンベアレジスタ101,102,103゜104から出
力され、一致信号1.17はフンペアレジ〉スタ107
から出力される。キャプチャレジスタ105は一致信号
117が出力さhると、こ九に同期してフリーランニン
グタイマ100の値を格納する。フリーランニングタイ
マ100に入力されるクロックは、制御の許容誤差範囲
内の分解能を持っている。
The coincidence signals 111, 112, 113, 114 are output from the conveyor registers 101, 102, 103, 104, respectively, and the coincidence signal 1.17 is output from the conveyor register 107.
is output from. The capture register 105 stores the value of the free running timer 100 in synchronization with the output of the match signal 117. The clock input to the free running timer 100 has a resolution within the control tolerance range.

また、イベントカウンタ106には、カウントソースと
して外部事象の変化量を示す外部入力信号(例えば、ク
ランク軸の回転角を表す信号など)T1が入力されてお
り、コンベアレジスタ107はこのイベントカウンタ1
.06に対して比較動作を行い一致信号117を発生す
る。イベントカウンタ106は外部クリア信号130に
よってクリアされる。外部クリア信号130は、従来例
の時に記述した基準信号に相当し、基準信号の発生毎に
タイマ、106をクリアする構成をとっている。
Furthermore, an external input signal T1 indicating the amount of change in an external event (for example, a signal indicating the rotation angle of the crankshaft) is input to the event counter 106 as a count source, and the conveyor register 107 receives this event counter 1 as a count source.
.. 06 and generates a match signal 117. Event counter 106 is cleared by external clear signal 130. The external clear signal 130 corresponds to the reference signal described in the conventional example, and is configured to clear the timer 106 every time the reference signal is generated.

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

本例のマクロサービスチャネルは4本のパルス出力を想
定した構成となっており、パルス幅を指定するワードデ
ータ(PO・−P3用)から構成されている。
The macro service channel in this example is configured assuming output of four pulses, and is composed of word data (for PO/-P3) specifying the pulse width.

ワードデータ0,1,2.3はそれぞれポートPO,P
I、P2.P3から出力されるパルス出力のパルス幅を
規定するワードデータで、この値を基にしてコンベアレ
ジスタ101,102,103゜104には、それぞれ
ボー)PO,PL、P2゜P3のパルス出力をリセット
するワードデータが。
Word data 0, 1, 2.3 are ports PO, P, respectively.
I, P2. Word data that defines the pulse width of the pulse output output from P3.Based on this value, the conveyor registers 101, 102, 103 and 104 reset the pulse outputs of PO, PL, P2 and P3, respectively. Word data to be.

CPU 200によって格納される。Stored by the CPU 200.

本例のマクロサービスは、コンベアレジスタ107から
の一致信号117によって起動される。
The macro service in this example is activated by the match signal 117 from the conveyor register 107.

マクロサービスが起動される以前に、CPU200はマ
クロサービスチャネルやハードウェアに対し初期化を行
なう。また、ビット選択レジスタ109には、最初にパ
ルスを出力すべきポートがPOであることを指定するた
めに、ポートPOに対応するビットだけを1にそれ以外
を0に設定しておく。
Before the macro service is started, the CPU 200 initializes the macro service channel and hardware. Further, in the bit selection register 109, in order to specify that the port to which a pulse should be output first is PO, only the bit corresponding to port PO is set to 1 and the other bits are set to 0.

また、イベントカウンタ106に対し比較動作を行うコ
ンベアレジスタ107には、外部クリア信号130の発
生タイミングで起動さhるベクタ割り込み処理プログラ
ム中で、基準信号発生からパルス立ちあげタイミングま
でに相当するデータがCPU200によって設定される
Furthermore, the conveyor register 107 that performs a comparison operation with respect to the event counter 106 contains data corresponding to the period from the reference signal generation to the pulse rise timing in the vector interrupt processing program that is activated at the timing at which the external clear signal 130 is generated. Set by CPU 200.

第4図は、本例のマクロサービスをフローチャートで示
したもので、実際にはμプログラム制御となっている。
FIG. 4 is a flowchart showing the macro service of this example, which is actually μ program controlled.

以下、第1図乃至第4図および第7図を参照しながら、
マクロサービスの詳細な説明を行なう。
Hereinafter, with reference to FIGS. 1 to 4 and 7,
A detailed explanation of macro services will be provided.

まず最初にイベントカウンタ106rこ対するフンペア
レジスタ107からの一致信号117が発生すると、5
R109の初期値から、ポートPOのRSフリップフロ
ップだけセットされ、ポートPOからの出力パルスがハ
イレベルになる。同時ニ、一致M 号117によって、
フリーランニングタイマ100の値はキャプチャレジス
タ105に格納される。また一致信号1】7け、割込み
要求をINTC2i 1に対し発生する。
First, when a match signal 117 is generated from the fun pair register 107 to the event counter 106r, 5
From the initial value of R109, only the RS flip-flop of port PO is set, and the output pulse from port PO becomes high level. At the same time, according to coincidence M No. 117,
The value of free running timer 100 is stored in capture register 105. Also, the match signal 1]7 generates an interrupt request to INTC2i1.

INTC211が一致信号1170割込み要求を受は付
けると、このソースに対応する割込み要求フラグ215
をセットし、割込み要求信号218をアクティブにする
When the INTC 211 accepts the match signal 1170 interrupt request, the interrupt request flag 215 corresponding to this source is set.
is set, and the interrupt request signal 218 is activated.

タイミング制御部210は、命令処理の終りで要求信号
218をサンプルし、アクティブであるため、形態指定
手段220をサンプルする。形態指定手段220がマク
ロサービスを示す“1”であることを検知すると、PC
207,PSW208を保持したまま、μROM209
のマクロサービス処理エントリアドレスを生成し、マク
ロサービスを開始する。
Timing control unit 210 samples request signal 218 at the end of command processing, and since it is active, samples form specifying means 220. When the format specifying means 220 detects "1" indicating macro service, the PC
207, μROM209 while retaining PSW208
Generates a macro service processing entry address and starts the macro service.

以降、マクロサービスのμフログラム指令に従って処理
される。処理フローの説明を第4図のフローチャートに
そって進める。
Thereafter, processing is performed according to the macro service's μ program instructions. The processing flow will be explained along the flowchart of FIG.

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

次に、5R109の内容を読み込み、ボー)POを示す
ビットに1が立っていることからこのビットに対応する
マクロサービスチャネル中のワードデータ0とキャプチ
ャレジスタ105の内容とを、ALU201を利用して
加算し、その結果をコンベアレジスタ101に格納する
Next, the contents of 5R109 are read, and since the bit indicating baud (PO) is set to 1, word data 0 in the macro service channel corresponding to this bit and the contents of the capture register 105 are read using the ALU 201. The result is stored in the conveyor register 101.

次に、5R109の左シフト処理を実行し、ポートP1
に相当するビットだけ1にセットする。
Next, execute the left shift processing of 5R109, and
Set only the bit corresponding to .

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

マクロサービス処理が終了すれば、タイミング制御部2
10は保持しテイタPc 207 、 P 5W208
の値から通常の命令処理を再開する。
When the macro service processing is completed, the timing control unit 2
10 holds Teita Pc 207, P 5W208
Resume normal instruction processing from the value of .

この後、コンベアレジスタ101からの一致信号111
0発生によってPOのRSフリップフロップがリセット
されて、ボー)POに対するパルス出力は終了する。こ
の時には、一致信号111によるINTC211に対し
ての割込み要求の発生はない。
After this, the match signal 111 from the conveyor register 101
The 0 generation resets the RS flip-flop of PO, and the pulse output to PO ends. At this time, no interrupt request is generated to the INTC 211 due to the coincidence signal 111.

また上記のマクロサービス処理の後、クリア信号130
の発生によってイベントカウンタ106はクリアされベ
クタ割り込み処理が発生する。再びコンベアレジスタ1
07に設定した値と一致すレバ、コンベアレジスタ10
7は一致信号117を発生することになる。
Also, after the above macro service processing, the clear signal 130
Upon occurrence of , the event counter 106 is cleared and vectored interrupt processing occurs. Conveyor register 1 again
Lever and conveyor register 10 that match the value set in 07
7 will generate a match signal 117.

以上の処理をボー)POからP3まで全く同様に繰り返
す。ポートP3に対するセットタイミングによって起動
されるマクロサービスでは、やはり前述したマクロサー
ビス処理の通りに、最初に5R109の内容を読み込み
、ボー)P3を示すビットに1が立っていることから、
このビットに対応するマクロサービスチャネル中のワー
ドデータ3と、キャプチャレジスタ105の内容を、A
LU 201を利用して加算し、その結果をコンベアレ
ジスタ104に格納する。
The above process is repeated in exactly the same way from PO to P3. In the macro service activated by the set timing for port P3, as in the macro service processing described above, the contents of 5R109 are first read, and since the bit indicating baud P3 is set to 1,
Word data 3 in the macro service channel corresponding to this bit and the contents of the capture register 105 are
The LU 201 is used to perform the addition and the result is stored in the conveyor register 104.

4回目のマクロサービス処理で5R109の左シフト処
理を実行すると、5R109からのシフトアウトが発生
するため、μプログラムの指令でタイミング制御部21
0は、形態変更信号219をINTC211に対し出力
し、形態指定フラグ216をリセットする。
When the left shift processing of 5R109 is executed in the fourth macro service processing, a shift out from 5R109 occurs, so the timing control unit 21
0 outputs the format change signal 219 to the INTC 211 and resets the format designation flag 216.

INTC211は、割込み要求フラグ215がセット状
態で、形態指定フラグ216がリセット状態であるため
、今度は通常のベクタ割込み要求をCPU200に対し
発生し、以下前述したベクタ割込み処理を実行する。
Since the interrupt request flag 215 is set and the format designation flag 216 is reset, the INTC 211 issues a normal vector interrupt request to the CPU 200 and executes the vector interrupt processing described above.

割込み処理プログラムは、4つのポートのパルス出力が
一巡したところで起動され、SRI 09を初期状態に
再設定し、ポートPOからのパルス出力に備える。
The interrupt processing program is started when the pulse outputs of the four ports have completed one cycle, resets the SRI 09 to the initial state, and prepares for the pulse output from the port PO.

以上、第7図に示すパルスパターンについて説明してき
たが、その他の如何なる構成のパルスパターンについて
も、本マクロサービス処理は適用できる。
Although the pulse pattern shown in FIG. 7 has been described above, this macro service processing can be applied to any other configuration of pulse patterns.

また本実施例におけるイベントカウンタ106は、外部
クリア信号130でクリアされた後、コンベアレジスタ
107に設定した所定の値の数の外部パルスT1をカウ
ントすると、コンベアレジスタ107は一致信号117
を発生し、所定のポートからのパルス出力をハイレベル
にする。これは、ある基準信号(外部クリア信号130
)の後、パルス出力をハイレベルにするまでの所定の物
理JL (コンベアレジスタ107の値*外部パルスT
I)を計測していることになる。これに対し、クロック
をベースにするフリーランニングタイマ100とコンベ
アレジスタ101,102,103゜104は、コンベ
アレジスタ107による一致信号117の発生後、各コ
ンベアレジスタに割り当てられたワードデータ分のクロ
ックをカウントすると、ポートからのパルス出力を四つ
レベルにする。これは、パルス出力のハイレベルの幅だ
けの、クロックを単位とする所定の時間!(ワーVデー
タ0,1.2,3)を計測していることになる。
Further, in this embodiment, after being cleared by the external clear signal 130, the event counter 106 counts a predetermined number of external pulses T1 set in the conveyor register 107, and then the conveyor register 107 receives a coincidence signal 117.
is generated and the pulse output from a predetermined port is set to high level. This is based on a certain reference signal (external clear signal 130
), the specified physical JL (value of conveyor register 107 * external pulse T) until the pulse output is set to high level.
This means that I) is being measured. On the other hand, the clock-based free-running timer 100 and conveyor registers 101, 102, 103, 104 count clocks for word data assigned to each conveyor register after the conveyor register 107 generates a match signal 117. Then, the pulse output from the port is set to four levels. This is a predetermined time in units of clocks, which is only the width of the high level of the pulse output! (War V data 0, 1.2, 3) is being measured.

また本実施例では、5R109からのシフト処理の結果
、シフトアウトが発生した場合、ベクタ割込みを発生さ
せ、割込み処理プログラムで初期化を行なう方法を示し
たが、これはエンジンの状態に応じて何等かの補正処理
が必要となった場合、その補正タイミングを与える目的
で設定したが、そのような補正処理を必要としないシス
テムにおいては、5R109にローテート処理を実行し
、ビット3からのシフトアウトがビット0に転送される
様に、マクロサービス処理を変更すれば、ベクタ割込み
の発生なしにマクロサービス処理だけで、完全なパルス
出力制御が可能となる。
Furthermore, in this embodiment, when shift out occurs as a result of shift processing from 5R109, a vector interrupt is generated and initialization is performed using the interrupt processing program. This setting was made to provide the correction timing when such correction processing becomes necessary, but in a system that does not require such correction processing, rotate processing is performed on 5R109, and the shift out from bit 3 is set. If the macro service processing is changed so that the signal is transferred to bit 0, complete pulse output control can be achieved by just the macro service processing without generating a vector interrupt.

なお、本実施例では、パルス出力開始タイミングをT1
による系で制御し、パルス出力終了タイミングをクロッ
クによる系で制御する方法を示したが、図1において、
フリーランニングタイマ100をイベントカウンタに、
またイベントカウンタ106をフリーランニングタイマ
に設定すれば、系は逆になり、応用に合わせた選択も可
能である。
In this embodiment, the pulse output start timing is set to T1.
We have shown a method of controlling the pulse output end timing using a clock system, but in Fig. 1,
Free running timer 100 as an event counter,
Furthermore, if the event counter 106 is set as a free running timer, the system is reversed, and selection can be made according to the application.

次に、本発明の第2の実施例を示す。第5図は第2の実
施例の周辺ハードウェアのブロック図、第6図は第2の
実施例を示すパルス発生装置のブロック図である。
Next, a second embodiment of the present invention will be described. FIG. 5 is a block diagram of peripheral hardware of the second embodiment, and FIG. 6 is a block diagram of a pulse generator showing the second embodiment.

本発明のパルス発生装置は、CPU590.アドレスバ
ス214.データバス205.INTC511、プログ
ラムメモリ212.データメモリ213、周辺ハードウ
ェア521から構成されている。
The pulse generator of the present invention includes a CPU 590. address bus 214. Data bus 205. INTC511, program memory 212. It is composed of a data memory 213 and peripheral hardware 521.

CPU590は、ALU201.テンポラリレジスタ2
02.汎用レジスタ203.アドレスバッファ204(
図ではABで表現されている)、μアドレス生成部20
6.μROM209.PO207、PSW208.タイ
ミング制御部580から構成される。
The CPU 590 has the ALU 201. Temporary register 2
02. General purpose register 203. Address buffer 204 (
(represented by AB in the figure), μ address generation unit 20
6. μROM209. PO207, PSW208. It is composed of a timing control section 580.

またINTC511は、割り込み要求フラグ215と形
態指定フラグ216から構成され、タイミング制御部5
80に対し、割り込み要求信号218と形態指定手段2
20を出力する。タイミング制御部580は、INTC
511に対し割り込み要求クリア信号217と形態変更
信号219を出力する。
The INTC 511 also includes an interrupt request flag 215 and a format designation flag 216.
80, the interrupt request signal 218 and the mode specifying means 2
Outputs 20. The timing control section 580 is an INTC
511, outputs an interrupt request clear signal 217 and a form change signal 219.

INTC541は、外部のノ1−ドウエアから幾つかの
割り込み信号を受は付け、各割り込みソースに割当てら
れた優先順位を判別し、最も高い優先順位をもった割り
込みソースを一つ選択し、その割り込みソースに対応し
た割り込み要求フラグ215をセットする。割り込み要
求フラグ215と形態指定フラグ216は、割込み要求
がn個あるときに、それぞれn個設定されているが、図
中では1組だけ記載されている。また、外部のハードウ
ェアからの割り込み信号や、優先順位判別部などは、本
発明の主旨に直接関係ないため、特に図示はしていない
The INTC541 accepts several interrupt signals from external hardware, determines the priority assigned to each interrupt source, selects one interrupt source with the highest priority, and interrupts that interrupt. Set the interrupt request flag 215 corresponding to the source. Although n interrupt request flags 215 and mode specification flags 216 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.

周辺ハードウェア521は、クロックをベースとしたフ
リーランニングタイマ500、フリーランニングタイマ
500に対して比較動作を行うコンベアレジスタ501
 (図中にCOMPOと記載)と502(図中にCOM
PIと記載)と503(図中にCOMP2と記載)と5
04(図中にCOMP3と記載)、キャプチャレジスタ
505(図中にCAPAと記載)、ビット選択レジスタ
509(図中にSRと記載)、外部パルスT1をカウン
トソースとするイベントカウンタ506、イベントカウ
ンタ506に対して比較動作を行うコンベアレジスタ5
07 (図中にCOMPA、!:記載)、所定のタイミ
ングでイベントカウンタ506の値を格納するキャプチ
ャレジスタ508(図中にCAPEと記載)、出カポ−
)PO〜P3から構成される。
Peripheral hardware 521 includes a clock-based free running timer 500 and a conveyor register 501 that performs a comparison operation with respect to the free running timer 500.
(written as COMPO in the figure) and 502 (written as COMPO in the figure)
PI), 503 (written as COMP2 in the figure), and 5
04 (written as COMP3 in the figure), capture register 505 (written as CAPA in the figure), bit selection register 509 (written as SR in the figure), event counter 506 whose count source is external pulse T1, event counter 506 Conveyor register 5 that performs comparison operation against
07 (written as COMPA, !: in the figure), a capture register 508 (written as CAPE in the figure) that stores the value of the event counter 506 at a predetermined timing, and an output register 508 (written as CAPE in the figure).
) It consists of PO to P3.

一致信号511,512,513,514はそれぞれコ
ンベアレジスタ501,502,503゜504から出
力され、一致信号517はコンベアレジスタ507から
出力される。キャプチャレジスタ505は一致信号11
7が出力されると、これに同期してフリーランニングタ
イマ500の値を格納する。キャプチャレジスタ508
は外部基準信号535が入力されると、これに同期して
イベントカウンタ506の値を格納する。フリーランニ
ングタイマ500に入力されるクロックは、制御の許容
誤差範囲内の分解能を持っている。
Match signals 511, 512, 513, and 514 are output from conveyor registers 501, 502, 503, and 504, respectively, and match signal 517 is output from conveyor register 507. Capture register 505 captures match signal 11
When 7 is output, the value of the free running timer 500 is stored in synchronization with this. Capture register 508
When external reference signal 535 is input, it stores the value of event counter 506 in synchronization with this. The clock input to the free running timer 500 has a resolution within the control tolerance range.

また、イベントカウンタ506には、カウントソースと
して外部事象の変化量を示す外部入力信号T1が入力さ
れており、コンベアレジスタ507にはこのイベントカ
ウンタ506に対して比較動作を行い一致信号517を
発生する。
Furthermore, an external input signal T1 indicating the amount of change in an external event is inputted to the event counter 506 as a count source, and the conveyor register 507 performs a comparison operation on this event counter 506 to generate a coincidence signal 517. .

一致信号517によるマクロサービスの起動およびパル
ス出力を制御する動作は、実施例1での一致信号117
によるマクロサービスの起動およびパルス出力の制御と
同様であるので説明は省略し、ここでは、イベントカウ
ンタ506と、コンベアレジスタ507と、キャプチャ
レジスタ508および外部基準信号535の間の動作を
説明する。
The operation of controlling the activation of the macro service and the pulse output by the coincidence signal 517 is the same as that of the coincidence signal 117 in the first embodiment.
Since this is the same as the macro service startup and pulse output control, the explanation will be omitted, and the operations among the event counter 506, conveyor register 507, capture register 508, and external reference signal 535 will be explained here.

まずキャプチャレジスタ508は、外部基準信号535
が入力されると、これに同期して、イベントカウンタ5
06の値を格納する。外部基準信号535は、またコン
ベアレジスタ507の設定データ更新を要求する割り込
み要求信号となっていて、工NTC511に入力されコ
ンベアレジスタ5070更新を割り込み処理要求を行う
First, the capture register 508 receives the external reference signal 535.
is input, event counter 5 is synchronized with this.
Stores the value of 06. The external reference signal 535 also serves as an interrupt request signal for requesting update of the setting data of the conveyor register 507, and is input to the NTC 511 to issue an interrupt processing request for updating the conveyor register 5070.

この割り込み処理要求に対する割り込み処理は、ここで
はベクタ割り込み処理によるものとすると、CPU59
0は、キャプチャレジスタ508の内容と、外部基準信
号5350発生からパルス出力開始タイミングまでの期
間に相当する所定のパルス幅データとの加算を実行し、
その加算結果なコンベアレジスタ507に格納する、と
いう処理を実行する。
Assuming that the interrupt processing for this interrupt processing request is performed by vectored interrupt processing, the CPU 59
0 executes addition of the contents of the capture register 508 and predetermined pulse width data corresponding to the period from the generation of the external reference signal 5350 to the pulse output start timing,
A process of storing the addition result in the conveyor register 507 is executed.

この後、コンベアレジスタ507とイベントカウンタ5
06の値とが一致すると、コンベアレジスタ507は一
致信号517を発生する。
After this, the conveyor register 507 and the event counter 5
06, the conveyor register 507 generates a match signal 517.

以上の通り、実施例1で外部クリア信号130によって
イベントカウンタ106をクリアし、コンベアレジスタ
107に一致信号117を発生させる代わりとして、本
実施例では、キャプチャレジスタ508を用いてコンベ
アレジスタ507を割り込み処理によって更新してゆく
ことで一致信号517を発生させることができ、実施例
1と同様にこの一致信号517によって制御されるポー
トからのパルス出力の制御を実現することができる。
As described above, instead of clearing the event counter 106 by the external clear signal 130 and generating the match signal 117 in the conveyor register 107 in the first embodiment, in this embodiment, the capture register 508 is used to interrupt the conveyor register 507. A match signal 517 can be generated by updating the match signal 517, and the pulse output from the port controlled by this match signal 517 can be controlled as in the first embodiment.

その他の動作に関しては、第1の実施例と全く同様であ
るため、詳細な説明は割愛する。
Other operations are exactly the same as those in the first embodiment, so detailed explanations will be omitted.

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

以上説明した通り本発明は、パルス出力開始タイミング
の割り込みを、マクロサービスによって処理し、ベクタ
割り込み要求を発生しないため、パルス出力の周波数が
増しても、割り込み処理プログラムへ以降する際のPC
,PSWのスタックへの退避や、割り込み処理プログラ
ムからメイン処理へ戻る時、スタックの内容をpc、p
swへ復帰する処理でCPU時間を占めることがない。
As explained above, in the present invention, the interrupt at the pulse output start timing is processed by the macro service and no vectored interrupt request is generated.
, When saving the PSW to the stack or returning from the interrupt processing program to main processing, the contents of the stack are saved to pc, p.
Processing to return to sw does not occupy CPU time.

また、最近の高速、高精度の制御が要求されるメカ制御
においては、精度の高いパルス出力制御が必要となって
きていることに対しても、パルス出力開始タイミング、
及びパルス出力終了タイミングを与えるコンベアレジス
タからの一致信号で、直接ポートを制御し出力パルスを
生成することで、割り込み要因が発生してから割り込み
処理プログラムが開始するまでの時間の遅れや、ポート
へのデータ書き込み時間による遅れなど無しに、最小の
誤差で制御できるため、出力パルス幅の調節を高い精度
で行なうことができる。
In addition, in recent mechanical controls that require high-speed, high-precision control, highly accurate pulse output control has become necessary.
By directly controlling the port and generating output pulses using the match signal from the conveyor register that gives the pulse output end timing, there is no time delay between the occurrence of an interrupt factor and the start of the interrupt processing program, and no delay to the port. Since the output pulse width can be controlled with a minimum error without any delay due to data writing time, the output pulse width can be adjusted with high precision.

加えて、本発明のパルス発生装置は、専用の1組のイベ
ントカウンタとコン1ペアレジスタで各気筒のパルス出
力開始タイミングを与え、複数のコンペアレジスタが各
ポート毎にパルス出力終了タイミングを与える方式をと
っているため、パ・ルス出力数が6,8と増えても、パ
ルス出力終了タイミングを与えるコンベアレジスタとマ
クロサービスチャネル内のワードバッファの数を増やす
だけで全く同様な制御が可能となる。さらに、INTC
に対する割り込み要求信号は、常に、単一のコンベアレ
ジスタが発生するだけであるので、INTC内の割り込
み要求フラグ、INTCと周辺ノ1−ドウエア間の配線
領域等のハードウェアの増加はない。従って、本発明の
パルス発生装置は、最小限のハードウェアの追加により
気筒数の増加にも容易に対応でき、経済的に非常に優位
なシステムを構成することが可能となり、CPUと周辺
回路を単一基板上に集積するシングルチップなどにも十
分に適用させることができる。
In addition, the pulse generator of the present invention uses a dedicated event counter and a pair of compare registers to give the pulse output start timing for each cylinder, and a plurality of compare registers to give the pulse output end timing for each port. Therefore, even if the number of pulse outputs increases to 6 or 8, exactly the same control can be achieved by simply increasing the number of conveyor registers that provide pulse output end timing and the number of word buffers in the macro service channel. . Furthermore, INTC
Since the interrupt request signal for the input signal is always generated by a single conveyor register, there is no increase in hardware such as the interrupt request flag in the INTC or the wiring area between the INTC and peripheral node 1 hardware. Therefore, the pulse generator of the present invention can easily cope with an increase in the number of cylinders by adding a minimum amount of hardware, making it possible to configure an extremely economically advantageous system, and reducing the CPU and peripheral circuits. It can also be fully applied to a single chip integrated on a single substrate.

さらに、パルス出力開始タイミングとパルス出力終了タ
イミングを、T1による系での制御とクロックによる系
での制御、あるいはクロックによる系での制御とT1に
よる系での制御としても、いずれの場合においても、パ
ルス出力制御は可能であるため、この2つの制御系を選
択的に用いることにより、状況に応じたパルス出力制御
が行えるため、システムを構成する上で、非常に柔軟性
をもたせることができる。
Furthermore, the pulse output start timing and pulse output end timing may be controlled by the system using T1 and the system using the clock, or by the system using the clock and the system using T1. Pulse output control is possible, and by selectively using these two control systems, pulse output control can be performed depending on the situation, allowing for great flexibility in configuring the system.

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

第1図は第1の実施例に於ける周辺ハードウェア構成図
、第2図は第1の実施例に於けるシステム構成図、第3
図は第1の実施例に於けるマクロサービスの処理形態情
報構成図、第4図は第1の実施例に於けるマクロサービ
ス処理フローチャート、第5図は第2の実施例に於ける
周辺ノ飄−ドウエア構成図、第6図は第2の実施例に於
けるシステム構成図、第7図はポートからのパルス出カ
バターン図、第8図は従来例に於けるシステム構成図、
第9図は従来例に於ける周辺ハードウェア構成図である
。 100.500・・・・・・フリーランニングタイマ、
106.506・・・・・・イベントカウンタ、101
.。 102.103,104,107,501,502゜5
03.504,507・・・・・・コンベアレジスタ、
105.505,508・・・・・・キャプチャレジス
タ、109.509・・・・・・ビット選択レジスタS
R。 11.1,112,113,114,117,511゜
512.503,514,517・・・・・・一致信号
、200.250,590・・・・・・CPU、201
・・・・・・ALU、202・・・・・・テンポラリレ
ジスタ、203・・・・・汎用レジスタ、204・・・
・・・アドレスバッファ、205・・・・・・データバ
ス、206・・・・・・μアドレス生成部、207・・
・・・・PC,208・・・・・・PSW、209・・
・・・・μROM、21.0,225,580・・・・
・・タイミング制御部、211,240,511・・・
・・・INTC。 212・・・・・・プログラムメモリ、213・・・・
・・データメモリ、214・・・・・・アドレスバス、
215・・・・・・割込み要求フラグ、216・・・・
・・形態指定フラグ、217・・・・・・割込み要求ク
リア信号、218・・・・・・割込み要求信号、219
・・・・・・形態変更信号、220・・・・・・形態指
定手段、130・・・・・・外部クリア信号、535・
・・・・・外部基準信号、221,251.!Ml・・
・・・・周辺ハードウェア、901,902,903゜
904・・・・・・ダウンカウンタ、911,912゜
913.914・・・・・・ポロー信号、909・・・
・・・ポートレジスタ。
Figure 1 is a peripheral hardware configuration diagram in the first embodiment, Figure 2 is a system configuration diagram in the first embodiment, and Figure 3 is a system configuration diagram in the first embodiment.
Figure 4 is a macro service processing form information configuration diagram in the first embodiment, Figure 4 is a macro service processing flowchart in the first embodiment, and Figure 5 is a peripheral node diagram in the second embodiment. 6 is a system configuration diagram in the second embodiment, FIG. 7 is a pulse output pattern diagram from a port, and FIG. 8 is a system configuration diagram in a conventional example.
FIG. 9 is a diagram showing the configuration of peripheral hardware in a conventional example. 100.500...Free running timer,
106.506...Event counter, 101
.. . 102.103,104,107,501,502゜5
03.504,507...Conveyor register,
105.505,508...Capture register, 109.509...Bit selection register S
R. 11.1,112,113,114,117,511゜512.503,514,517... Match signal, 200.250,590... CPU, 201
...ALU, 202...Temporary register, 203...General-purpose register, 204...
...Address buffer, 205...Data bus, 206...μ address generation unit, 207...
...PC, 208...PSW, 209...
...μROM, 21.0,225,580...
...Timing control section, 211, 240, 511...
...INTC. 212...Program memory, 213...
...Data memory, 214...Address bus,
215... Interrupt request flag, 216...
...Format specification flag, 217...Interrupt request clear signal, 218...Interrupt request signal, 219
...Form change signal, 220... Format specifying means, 130... External clear signal, 535.
...External reference signal, 221, 251. ! Ml...
...Peripheral hardware, 901,902,903°904...Down counter, 911,912°913.914...Pollow signal, 909...
...port register.

Claims (1)

【特許請求の範囲】[Claims] 命令の実行アドレスを保持するプログラムカウンタ、プ
ログラムの実行状態を保持する手段、高速記憶手段とし
ての汎用レジスタおよびマイクロプログラムROMを含
む中央処理装置と、前記中央処理装置へ非同期に処理要
求を発生する割り込み要求発生回路と、プログラムメモ
リと、データメモリと、周辺回路とを有するデータ処理
装置に於いて、前記周辺回路は、第1のタイマと、前記
第1のタイマとの比較を行うコンペアレジスタと、所定
のタイミングで前記第1のタイマの値を取込むキャプチ
ャレジスタと、第2のタイマと、前記第2のタイマとの
比較を行うコンペアレジスタと、パルス発生用の複数の
出力ポートと、該出力ポートに対し選択的にセットパル
スを発生する手段とを含んで構成され、前記INTCは
、所定のデータ処理の要求を発生する手段と、前記所定
のデータ処理の要求を識別するための形態指示手段とを
備え、前記データメモリ内には前記所定のデータ処理の
処理形態を指定する処理形態情報が格納され、前記割り
込み要求発生回路から前記所定のデータ処理の要求が前
記中央処理装置に対して発生されると、前記中央処理装
置は前記形態指示手段が前記所定のデータ処理を指示し
ていることを検知した場合には、命令実行処理を中断し
、前記処理形態情報に従い、前記第1のコンペアレジス
タと、前記キャプチャレジスタと、前記データメモリを
操作することで前記複数の出力ポートからのパルス発生
を制御することを特徴とするデータ処理装置。
A central processing unit that includes a program counter that holds the execution address of an instruction, a means for holding the execution state of the program, a general-purpose register as a high-speed storage means, and a microprogram ROM, and an interrupt that asynchronously issues a processing request to the central processing unit. In a data processing device including a request generation circuit, a program memory, a data memory, and a peripheral circuit, the peripheral circuit includes a first timer and a compare register that compares the first timer; a capture register that captures the value of the first timer at a predetermined timing; a second timer; a compare register that compares the second timer; a plurality of output ports for pulse generation; means for selectively generating a set pulse for a port; Processing mode information specifying a processing mode of the predetermined data processing is stored in the data memory, and a request for the predetermined data processing is generated from the interrupt request generation circuit to the central processing unit. Then, if the central processing unit detects that the format instructing means instructs the predetermined data processing, the central processing unit interrupts the instruction execution processing, and executes the first comparison according to the processing format information. A data processing device, characterized in that pulse generation from the plurality of output ports is controlled by manipulating a register, the capture register, and the data memory.
JP63291310A 1988-11-17 1988-11-17 Data processing device Expired - Fee Related JP2536103B2 (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP63291310A JP2536103B2 (en) 1988-11-17 1988-11-17 Data processing device
DE89121317T DE68905028T2 (en) 1988-11-17 1989-11-17 Data processing device for generating a sequence of pulses which have a variable length at the outputs.
EP89121317A EP0369470B1 (en) 1988-11-17 1989-11-17 Data processing apparatus for producing in sequence pulses having variable width at output ports
US07/438,750 US5126944A (en) 1988-11-17 1989-11-17 Data processing apparatus for producing in sequence pulses having variable width at output ports

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63291310A JP2536103B2 (en) 1988-11-17 1988-11-17 Data processing device

Publications (2)

Publication Number Publication Date
JPH02136902A true JPH02136902A (en) 1990-05-25
JP2536103B2 JP2536103B2 (en) 1996-09-18

Family

ID=17767244

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63291310A Expired - Fee Related JP2536103B2 (en) 1988-11-17 1988-11-17 Data processing device

Country Status (1)

Country Link
JP (1) JP2536103B2 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5574601A (en) * 1978-11-27 1980-06-05 Gen Motors Corp Engine control unit
JPS63271601A (en) * 1987-04-30 1988-11-09 Toshiba Corp Output pulse generating device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5574601A (en) * 1978-11-27 1980-06-05 Gen Motors Corp Engine control unit
JPS63271601A (en) * 1987-04-30 1988-11-09 Toshiba Corp Output pulse generating device

Also Published As

Publication number Publication date
JP2536103B2 (en) 1996-09-18

Similar Documents

Publication Publication Date Title
US5261107A (en) Programable interrupt controller
US10657039B2 (en) Control device for a motor vehicle
US5557764A (en) Interrupt vector method and apparatus
JPH0550022B2 (en)
US4977494A (en) High speed digital motion controller architecture
EP0426331B1 (en) Programmable interrupt controller and method
JPH07104830B2 (en) Computer system and method of operating a computer system
JP2002152020A (en) Pulse signal generator
JPH02136902A (en) Data processor
US20020147944A1 (en) Apparatus and method for adaptive address-based historical utilization recording
JP2536102B2 (en) Data processing device
JPS60218152A (en) Microprocessor
JP2844624B2 (en) Data processing device
JP2731556B2 (en) Fuel injection control device
JPS6049951B2 (en) Simultaneous instruction signal sending circuit
JPH06324861A (en) System and method for controlling cpu
JP2903526B2 (en) Pulse generator
JP2847729B2 (en) Information processing device
JPS5850367B2 (en) input/output control device
JP2623501B2 (en) Direct memory access control circuit
JPS63311553A (en) Synchronization control system microprocessor peripheral circuit
JPH06202888A (en) Microprocessor
JP3405513B2 (en) Redundant controller for programmable controller
JPS5942331B2 (en) Prosetsusasouchinoseigiohoshiki
JPH02252047A (en) Microprocessor

Legal Events

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