JPH076435B2 - Fuel injection control device - Google Patents

Fuel injection control device

Info

Publication number
JPH076435B2
JPH076435B2 JP63291308A JP29130888A JPH076435B2 JP H076435 B2 JPH076435 B2 JP H076435B2 JP 63291308 A JP63291308 A JP 63291308A JP 29130888 A JP29130888 A JP 29130888A JP H076435 B2 JPH076435 B2 JP H076435B2
Authority
JP
Japan
Prior art keywords
interrupt
register
fuel injection
processing
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.)
Expired - Lifetime
Application number
JP63291308A
Other languages
Japanese (ja)
Other versions
JPH02136544A (en
Inventor
清 福嶋
肇 佐久間
幸男 前橋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP63291308A priority Critical patent/JPH076435B2/en
Priority to EP89121317A priority patent/EP0369470B1/en
Priority to DE89121317T priority patent/DE68905028T2/en
Priority to US07/438,750 priority patent/US5126944A/en
Publication of JPH02136544A publication Critical patent/JPH02136544A/en
Publication of JPH076435B2 publication Critical patent/JPH076435B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Electrical Control Of Air Or Fuel Supplied To Internal-Combustion Engine (AREA)

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はエンジン制御装置に関し、特にエンジンの燃料
噴射制御装置に関するものである。
The present invention relates to an engine control device, and more particularly to a fuel injection control device for an engine.

〔従来の技術〕[Conventional technology]

昨今、自動車のエンジン制御にマイクロコンピュータが
数多く利用されている。エンジン制御の中で最も中心的
な制御は、燃料噴射制御であり、マイクロコンピュータ
は、吸入空気量やエンジン回転数から基準となる噴射量
を算出し、その基準値に対し、その時々の温度や排気ガ
ス中に含まれる酸素量などの測定値から求められる補正
係数を掛け、最適な燃料噴射量を算出し、求められた燃
料噴射量を噴射時間に換算し、出力ポートを噴射時間だ
けアクティブにすることで各気筒のインジェクタは燃料
噴射を行う。
Recently, many microcomputers are used for controlling the engine of automobiles. The most central control in engine control is fuel injection control, in which the microcomputer calculates the reference injection amount from the intake air amount and the engine speed, and the temperature and temperature at each time are compared with the reference value. Multiply the correction factor obtained from measured values such as the amount of oxygen contained in the exhaust gas to calculate the optimum fuel injection amount, convert the obtained fuel injection amount into injection time, and activate the output port only for the injection time. By doing so, the injector of each cylinder injects fuel.

通常、各気筒毎に回転サイクルの特定の位置、例えば上
死点を示す信号などを基準信号とし、それを割込み信号
としてマイクロコンピュータは受け付け、割込み処理プ
ログラムで基準点からの燃料噴射開始時間の設定はタイ
マなどのハードウェアを利用して行なう。そしてタイマ
からの割り込み信号で起動される割り込み処理プログラ
ムで出力ポートをアクティブレベルにし、インジェクタ
から燃料噴射を行う。次に燃料噴射終了時間の設定を再
度タイマを利用して行ない、タイマからの割り込み信号
で起動される割り込み処理プログラムで、出力ポートを
インアクティブにし、インジェクタからの燃料噴射を終
了する。第8図は、4気筒エンジンの場合の燃料噴射パ
ルス発生パターンを示している。図中の4本の出力ポー
トP0〜P3からは気筒0〜3それぞれに対応した燃料噴射
パルスが出力される。パルスの立ち上がりが燃料噴射開
始タイミングをパルスの立ち下がり燃料噴射終了タイミ
ングを示している。燃料噴射開始タイミングより前に、
基準信号のタイミングがあるが、これは図示していな
い。またパルスのハイレベル期間が燃料噴射時間、つま
り燃料噴射量を示し、ハイレベル期間が長いほど燃料噴
射量が多くなる。燃料噴射制御におけるパルス発生のパ
ターンは、制御方法によって様々な形態を採るが、本例
は個々の気筒ごと独立に制御をする方法で、最もきめの
細かい制御ができる方法である。
Normally, a specific position of the rotation cycle for each cylinder, for example, a signal indicating the top dead center is used as a reference signal, which the microcomputer accepts as an interrupt signal, and the interrupt processing program sets the fuel injection start time from the reference point. Is performed using hardware such as a timer. Then, the interrupt processing program activated by the interrupt signal from the timer sets the output port to the active level, and the fuel is injected from the injector. Next, the fuel injection end time is set again using the timer, and the output port is made inactive by the interrupt processing program activated by the interrupt signal from the timer, and the fuel injection from the injector is ended. FIG. 8 shows a fuel injection pulse generation pattern in the case of a 4-cylinder engine. Fuel injection pulses corresponding to the cylinders 0 to 3 are output from the four output ports P0 to P3 in the figure. The rising edge of the pulse indicates the fuel injection start timing and the falling edge of the pulse indicates the fuel injection end timing. Before the fuel injection start timing,
There is reference signal timing, which is not shown. The high level period of the pulse indicates the fuel injection time, that is, the fuel injection amount, and the longer the high level period, the larger the fuel injection amount. The pulse generation pattern in the fuel injection control may take various forms depending on the control method, but this example is a method of controlling each cylinder independently, which is the method with the finest control.

第8図(a)は、低速、一定速度走行時での燃料噴射パ
ルスのパターンで、各気筒に対するパルスの重なりがな
い状態であり、第8図(b)は、急加速時での燃料噴射
パルスのパターンで、各気筒に対するパルスの重なりが
発生する状態である。実際のパルスパターンは、時々の
状態に応じて、この2例のランダムな組み合わせとな
り、出力ポートからのパルス発生制御はより複雑となっ
ている。
FIG. 8 (a) is a fuel injection pulse pattern at low speed and constant speed running, showing a state in which there is no pulse overlap for each cylinder, and FIG. 8 (b) is a fuel injection pulse during rapid acceleration. This is a state in which pulse overlap occurs for each cylinder in the pulse pattern. The actual pulse pattern is a random combination of these two cases depending on the state at any time, and the pulse generation control from the output port is more complicated.

以下、第11図と第12図を参照しながら従来の燃料噴射制
御を行うパルス発生装置を説明する。第11図は従来のパ
ルス発生装置のブロック図、第12図は従来の周辺ハード
ウェアのブロック図である。
Hereinafter, a conventional pulse generator for performing fuel injection control will be described with reference to FIGS. 11 and 12. FIG. 11 is a block diagram of a conventional pulse generator, and FIG. 12 is a block diagram of conventional peripheral hardware.

第11は、CPU1100、アドレスバス214、データバス205、I
NTC(割込み発生回路)1111、プログラムメモリ212、デ
ータメモリ213、周辺ハードウェア1121から構成されて
いる。CPU1100は、算術論理演算ユニット(以下ALUと記
す)201、テンポラリレジスタ202、汎用レジスタ203、
アドレスバッファ204(図ではABで表現されている)、
マイクロアドレス(以下μアドレスと記す)生成部20
6、μROM209、PC207、PSW208、タイミング制御部1110か
ら構成される。
Eleventh is CPU 1100, address bus 214, data bus 205, I
It is composed of an NTC (interrupt generation circuit) 1111, a program memory 212, a data memory 213, and peripheral hardware 1121. The CPU 1100 includes an arithmetic logic unit (hereinafter referred to as ALU) 201, a temporary register 202, a general register 203,
Address buffer 204 (represented by AB in the figure),
Micro address (hereinafter referred to as μ address) generation unit 20
6, μROM209, PC207, PSW208, timing control unit 1110.

またINTC1111には、割り込み要求フラグレジスタ215が
あり、タイミング制御部1110に対し、割り込み要求信号
218を出力する。タイミング制御部1110は、INTC1111に
対し割り込み要求クリア信号217を出力する。
Further, the INTC1111 has an interrupt request flag register 215, which sends an interrupt request signal to the timing control unit 1110.
Outputs 218. The timing control unit 1110 outputs an interrupt request clear signal 217 to the INTC 1111.

INTC1111は、外部のハードウェアから幾つかの割り込み
信号を受け付け、各割り込みソースに割当てられた優先
順位を判別し、最も高い優先順位をもった割り込みソー
スを一つ選択し、その割り込みソースに対応した値を割
り込み要求フラグレジスタ215にセットする。割り込み
要求フラグレジスタ215は、割り込み要求がn個あると
きに、n個設定されているが、図中には1個だけ記載さ
れている。また、外部のハードウェアからの割り込み信
号や、優先順位判別部などは、特に図示していない。
The INTC1111 accepts several interrupt signals from external hardware, determines the priority assigned to each interrupt source, selects the interrupt source with the highest priority, and supports that interrupt source. The value is set in the interrupt request flag register 215. When there are n interrupt requests, n interrupt request flag registers 215 are set, but only one is shown in the figure. Further, an interrupt signal from external hardware, a priority determination unit, etc. are not shown in the figure.

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

次に図12を用いて、周辺ハードウェア1121の構成を説明
する。周辺ハードウェア1121は、クロックをベースとし
た第1乃至第4のダウンカウンタ1200〜1203と、ポート
レジスタ1204と、出力ポートP0〜P3から構成されてい
る。第1乃至第4のダウンカウンタ1200〜1203は、デー
タバス205からのカウント値の書き込みで、カウント動
作を開始し、各ダウンカウンタからのボロー信号1205〜
1208が発生するとカウントを停止し、このボロー信号の
発生で、INTC1111に対し割り込み要求を発生する。ま
た、出力パルスの制御は、データバス205から、ポート
レジスタ1204に出力レベルを直接書き込むことで行なっ
ている。
Next, the configuration of the peripheral hardware 1121 will be described with reference to FIG. The peripheral hardware 1121 includes clock-based first to fourth down counters 1200 to 1203, a port register 1204, and output ports P0 to P3. The first to fourth down counters 1200 to 1203 start counting operation by writing the count value from the data bus 205, and borrow signals 1205 to 1205 to 1205 to
When 1208 is generated, counting is stopped, and when this borrow signal is generated, an interrupt request is generated to INTC1111. The output pulse is controlled by directly writing the output level from the data bus 205 to the port register 1204.

以下、ポートP0における基準信号が発生したところから
説明を行なう。通常の命令処理では、PC207に格納され
たプログラムアドレスが、アドレスバッファ204に転送
され、アドレスバス214をドライブし、プログラムメモ
リ212から次に実行すべき命令がフェッチされる。取り
込まれた命令は、データバス205を経由し、μアドレス
生成部206に転送される。μアドレス生成部206は、命令
コードからμROM209のアドレスを生成する。以降、μRO
M209に格納されている該命令に対するμプログラムの指
令に従い、汎用レジスタ203、ALU201、テンポラリレジ
スタ202などを操作することで命令の処理を行なう。
Hereinafter, description will be given from the point where the reference signal at the port P0 is generated. 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 fetches the next instruction to be executed from the program memory 212. The fetched instruction is transferred to the μ address generation unit 206 via the data bus 205. The μ address generation unit 206 generates the address of the μROM 209 from the instruction code. After that, μRO
The instruction processing is performed by operating the general-purpose register 203, the ALU 201, the temporary register 202, etc. in accordance with the μ program instruction for the instruction stored in the M209.

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

さて、基準信号が入力されると、INTC1111に対し割り込
み要求を発生し、INTC1111が要求を受け付け割り込み要
求フラグ215がセットされれば、割り込み要求信号218が
タイミング制御部1110に対して出力される。μプログラ
ムの最後の指令は、通常割り込みが発生しているかいな
いかを検知するための指令で、この指令が出るとタイミ
ング制御部1110は、割り込み要求信号218の有無をサン
プルする。割り込み要求信号218がアクティブであれ
ば、割り込み要求クリアし号217をINTC1111に出力し割
り込み要求フラグレジスタ215をクリアする。
Now, when the reference signal is input, an interrupt request is generated to the INTC1111, and if the INTC1111 accepts the request and the interrupt request flag 215 is set, the interrupt request signal 218 is output to the timing control unit 1110. The last command of the μ program is a command for detecting whether or not a normal interrupt is generated, and when this command is issued, the timing control unit 1110 samples the presence or absence of the interrupt request signal 218. If the interrupt request signal 218 is active, the interrupt request clearing signal 217 is output to the INTC1111 and the interrupt request flag register 215 is cleared.

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

基準信号による割り込み処理要求に基づく割り込み処理
プログラムは、ポートP0からのパルス出力開始タイミン
グを規定する割り込み処理で、CPU1100は、基準信号の
発生からポートP0のパルス出力をアクティブにし、イン
ジェクタより燃料噴射を開始するまでの期間に相当する
データを第1のダウンカウンタ1200に書き込む。割り込
み処理プログラムを終了する命令の処理では、スタック
空間に退避してあったPC値,PSW値をそれぞれPC207,PSW2
08へ復帰することで、割り込みが発生した時点の次の命
令から処理を再開する。
The interrupt processing program based on the interrupt processing request by the reference signal is the interrupt processing that defines the pulse output start timing from the port P0.The CPU 1100 activates the pulse output of the port P0 from the generation of the reference signal, and injects fuel from the injector. The data corresponding to the period until the start is written in the first down counter 1200. In the processing of the instruction that terminates the interrupt processing program, the PC value and PSW value saved in the stack space are set to PC207 and PSW2, respectively.
By returning to 08, the process is restarted from the next instruction at the time when the interrupt occurred.

また第1のダウンカウンタ1200は、上述したCPU1100に
よるデータの書き込みが行なわれると、これに同期して
ダウンカウントを開始する。
Further, when the CPU 1100 writes data as described above, the first down counter 1200 starts down counting in synchronization with this.

次に通常の命令実行中、パルス出力開始タイミングを示
す。第1のダウンカウンタ1200からのボロー信号1205が
発生すると、前述の説明と同様に、INTC1111が割り込み
要求を受け付け、割り込み要求信号218がタイミング制
御部1110に対して出力される。
Next, the pulse output start timing is shown during execution of a normal instruction. When the borrow signal 1205 from the first down counter 1200 is generated, the INTC 1111 accepts the interrupt request and the interrupt request signal 218 is output to the timing control unit 1110, as in the above description.

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

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

以下、前述同様の過程を経て、割り込み処理プログラム
の実行を開始する。
Thereafter, the execution of the interrupt processing program is started through the same process as described above.

この割り込み処理プログラムは、まずポートレジスタ12
04の内容を読み込み、ポートレジスタ1204のビット0が
“0"であることから、ポートP0におけるパルス出力を立
ち上げる割り込み処理となり、ポートレジスタ1204のビ
ット0を“1"に設定することで、ポートP0からの出力パ
ルスをハイレベルにし、インジェクタより燃料噴射を開
始する。
This interrupt processing program starts with port register 12
Since the content of 04 is read and bit 0 of port register 1204 is "0", it becomes an interrupt process to raise the pulse output at port P0. By setting bit 0 of port register 1204 to "1", The output pulse from P0 is set to high level and fuel injection is started from the injector.

ボロー信号1205による割り込み処理要求に基づく割り込
み処理プログラムでは、ポートP0からのパルス出力期間
を規定する割り込み処理で、CPU1100はインジェクタが
燃料噴射を続ける期間に相当するデータをダウンカウン
タ0に書き込む。
In the interrupt processing program based on the interrupt processing request by the borrow signal 1205, the CPU 1100 writes the data corresponding to the period during which the injector continues fuel injection to the down counter 0 in the interrupt processing that defines the pulse output period from the port P0.

割り込み処理プログラムを終了する命令の処理では、ス
タック空間に退避してあったPC値,PSW値をそれぞれPC20
7、PSW208へ復帰することで、割り込みが発生した時点
の次の命令から処理を再開する。ダウンカウンタ0は、
上述したCPU1100によるデータの書き込みが行なわれる
と、これに同期してダウンカウントを開始する。
In the processing of the instruction that ends the interrupt processing program, the PC value and PSW value saved in the stack space are
7. By returning to PSW208, processing resumes from the next instruction at the time the interrupt occurred. The down counter 0 is
When data is written by the CPU 1100 described above, the down count is started in synchronization with this.

次に通常の命令実行中、今度はパルス出力終了タイミン
グを示す、ダウンカウンタ0からのボロー信号1205が発
生すると、前述の説明と同様にINTC1111が割り込み要求
を受け付け、割り込み要求信号218がタイミング制御部1
110に対して出力される。
Next, during a normal instruction execution, when the borrow signal 1205 from the down counter 0, which indicates the pulse output end timing this time, is generated, the INTC1111 accepts the interrupt request and the interrupt request signal 218 causes the timing control unit 218 as in the above description. 1
Output to 110.

以下同様に、割り込み処理プログラムの実行を開始す
る。
Similarly, the execution of the interrupt processing program is started.

この割り込み処理プログラムは、まずポートレジスタ12
04の内容を読み込み、ポートレジスタ1204のビット0が
“1"であることから、ポートP0におけるパルス出力を立
ち下げる割り込み処理となり、ポートレジスタ1204のビ
ット0を“0"に設定することで、ポートP0からの出力パ
ルスをロウレベルにし、インジェクタからの燃料噴射を
終了する。
This interrupt processing program starts with port register 12
Since the content of 04 is read and bit 0 of port register 1204 is "1", it becomes an interrupt process that drops the pulse output at port P0. By setting bit 0 of port register 1204 to "0", the port The output pulse from P0 is set to low level, and fuel injection from the injector is completed.

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

同様の処理を、ポートP1からポートP3に対しても同様に
行なう。以上、種々あるパルス出力制御方法の1例を示
したが、基本的には同様の処理方法で制御が行なわれ
る。
The same process is similarly performed for ports P1 to P3. Although one example of various pulse output control methods has been described above, the control is basically performed by the same processing method.

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

前述したように、マイクロコンピュータは、燃料噴射パ
ルス出力のための基準信号を、割り込み信号として受け
付け、割り込み処理プログラムによって、燃料噴射時間
の設定などの制御を行っているため、エンジン回転数が
増し、基準信号の発生回数が増えると、基準信号割り込
み、燃料噴射開始割り込み、燃料噴射終了割り込みなど
の割り込み要求も多く発生し、その際のPC,PSWのスタッ
クへの退避や、割り込み処理プログラムからメイン処理
へ戻る時、スタックの内容をPC,PSWへ復帰する処理が頻
繁に発生し、退避,復帰に割かれるCPU時間が膨大なも
のになる。
As described above, the microcomputer accepts the reference signal for fuel injection pulse output as an interrupt signal and controls the fuel injection time by the interrupt processing program, so the engine speed increases, When the number of times the reference signal is generated increases, many interrupt requests such as reference signal interrupts, fuel injection start interrupts, fuel injection end interrupts, etc. are also generated, and at that time, saving to the stack of PC, PSW and the main processing from the interrupt processing program When returning to, the process of restoring the contents of the stack to PC and PSW frequently occurs, and the CPU time for saving and restoring becomes enormous.

一方、CPUは燃料噴射制御の他に点火時期制御やアイド
ル回転制御など種々雑多な仕事を行なっており、エンジ
ンの回転数が上がるとこれらのメイン処理に割かれるCP
U時間が少なくなり、場合によっては全くできない処理
が発生することも起こり得る。従って、昨今の高速回
転、多気筒エンジン搭載の車種におけるマイクロコンピ
ュータによるエンジン制御は非常に難しいものになって
いる。
On the other hand, the CPU performs various miscellaneous tasks such as ignition timing control and idle speed control in addition to fuel injection control, and when the engine speed increases, CP is allocated to these main processes.
It is possible that the U time becomes short and processing that cannot be done at all occurs in some cases. Therefore, engine control by a microcomputer in a vehicle model equipped with a high-speed rotation, multi-cylinder engine has become very difficult.

また、最近のエンジン制御においては、排気ガス規制や
燃料費節減などの要求から、精度の高い燃料噴射制御が
必要となってきており、燃料噴射開始タイミング、及び
燃料噴射終了タイミングを最小の誤差で制御でき、且つ
各気筒毎にそれぞれ独立に制御することが必要になりつ
つある。これらの要求に対して従来からのソフトウェア
処理だけで制御する方法では、割り込み要因が発生して
から割り込み処理プログラムが開始するまでの時間の遅
れや、ポートへのデータ書き込み時間による送れなどが
発生し、精度の高い制御ができない。しかも、燃料噴射
開始タイミングと燃料噴射終了タイミングの双方とも割
り込み処理プログラムで制御しているため、この2つの
タイミングが近接した場合、先に要求の出された割り込
み処理要求に対する割り込み処理の実行に時間がかかる
と、後から要求の出された割り込み処理要求に対する割
り込み処理の実行が待たされることが有り得るため、本
来期待された燃料噴射の開始と終了とタイミングがずれ
るということが生じてくることになり、この点から言っ
ても、やはり精度の高い制御ができないことになる。
Further, in recent engine control, highly accurate fuel injection control is required due to requirements such as exhaust gas regulation and fuel cost reduction, and fuel injection start timing and fuel injection end timing can be minimized. It is becoming necessary to control and to control each cylinder independently. In the conventional method of controlling these requests only by software processing, there is a delay in the time from the occurrence of an interrupt factor to the start of the interrupt processing program, or the delay due to the time to write data to the port. , High precision control is not possible. Moreover, since both the fuel injection start timing and the fuel injection end timing are controlled by the interrupt processing program, when these two timings are close to each other, it takes time to execute the interrupt processing for the interrupt processing request that was previously requested. If this happens, the execution of interrupt processing for the interrupt processing request that is requested later may be delayed, so that the originally expected start and end of fuel injection may be misaligned. Even from this point, it is impossible to control with high accuracy.

またハードウェアの面でも、各起動毎に割り込みソース
を割当て、各々の割り込みソースを全てINTCへの要求信
号にすると、例えば気筒数が6,8と増えれば配線領域が
増大しCPUと周辺回路を単一半導体基板上に集積するシ
ングルチップマイコンには不経済となる。
Also in terms of hardware, if interrupt sources are assigned at each startup and all interrupt sources are request signals to INTC, for example, if the number of cylinders increases to 6,8, the wiring area increases and the CPU and peripheral circuits are increased. It is uneconomical for a single-chip microcomputer to be integrated on a single semiconductor substrate.

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

本発明は、PCとPSWと汎用レジスタとμROMを含むCPU
と、前記CPUへ非同期に処理要求を発生するINTCと、プ
ログラムメモリと、データメモリと、周辺回路と、複数
のインジェクタを有する燃料噴射制御装置に於いて、前
記周辺回路は第1のタイマと、前記第1のタイマとの比
較を行う複数の第1のコンペアレジスタと、所定のタイ
ミングで前記第1のタイマの地を取込むキャプチャレジ
スタと、第2のタイマと、前記第2のタイマとの比較を
行う第2のコンペアレジスタと、前記インジェクタに接
続するパルス発生用の複数の出力ポートと、該出力ポー
トに対し選択的にセットパルスを発生する手段とを含ん
で構成され、前記INTCは、従来の割り込み処理要求の発
生に加え、所定のデータ処理の要求を発生する手段と、
前記従来の割り込み処理要求と前記所定のデータ処理の
要求を識別するための形態指示手段を備え、且つ前記デ
ータメモリ内には前記所定のデータ処理の処理形態を指
定する処理形態情報が格納され、前記INTCから前記所定
のデータ処理の要求が前記CPUに対して発生されると、
前記CPUは前記形態指示手段が前記所定のデータ処理を
指示していることを検知した場合には、命令実行処理を
中断し、前記処理形態情報に従い、前記第1のコンペア
レジスタと、前記キャプチャレジスタと、前記データメ
モリを操作することで前記複数の出力ポートからパルス
を発生させ前記インジェクタを制御するという特徴を有
している。
The present invention is a CPU including a PC, PSW, general-purpose register, and μROM.
In an fuel injection control device having an INTC that asynchronously issues a processing request to the CPU, a program memory, a data memory, a peripheral circuit, and a plurality of injectors, the peripheral circuit includes a first timer, A plurality of first compare registers for comparing with the first timer, a capture register for taking in the ground of the first timer at a predetermined timing, a second timer, and a second timer. A second compare register for comparison, a plurality of pulse generation output ports connected to the injector, and means for selectively generating a set pulse to the output port, wherein the INTC is In addition to the conventional interrupt processing request generation means for generating a predetermined data processing request,
The conventional interrupt processing request is provided with a form designating unit for identifying the predetermined data processing request, and processing form information designating a processing form of the predetermined data processing is stored in the data memory, When a request for the predetermined data processing is generated from the INTC to the CPU,
When the CPU detects that the form instructing means is instructing the predetermined data process, the CPU suspends the instruction execution process, and according to the process form information, the first compare register and the capture register. By operating the data memory, a pulse is generated from the plurality of output ports to control the injector.

すなわち、本発明では、第1のタイマと、第1のタイマ
の値と比較動作を行い、その一致信号により燃料噴射終
了タイミングを与える複数のコンペアレジスタと、外部
パルスをカウントする第2のタイマと第2のタイマの値
と比較動作を行い、その一致信号により燃料噴射開始タ
イミングを与えるコンペアレジスタと、燃料噴射開始タ
イミングを記憶するキャプチャレジスタとを装備し、且
つ燃料噴射開始タイミングを与える割り込み処理要求が
発生した際、PC,PSWの退避処理をせずに、事前に設定さ
れた処理形態情報に応じた処理を実行することで、複数
の気筒に対する燃料噴射パルス出力を制御している。
That is, in the present invention, a first timer, a plurality of compare registers that perform a comparison operation with the value of the first timer and give a fuel injection end timing by the coincidence signal, and a second timer that counts external pulses. An interrupt processing request that is provided with a compare register that performs a comparison operation with the value of the second timer and that gives a fuel injection start timing by the coincidence signal and a capture register that stores the fuel injection start timing, and that gives a fuel injection start timing When this occurs, the fuel injection pulse output for the plurality of cylinders is controlled by executing the process according to the preset process mode information without performing the saving process of the PC and PSW.

〔実施例〕〔Example〕

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

本発明に基づく第1の実施例の周辺ハードウェアのブロ
ック図とエンジンの断面図である。第2図は、第1の実
施例を示すパルス発生装置のブロック図である。第2図
において、本発明のパルス発生装置は、CPU200,アドレ
スバス214,データバス205,INTC211,プログラムメモリ21
2,データメモリ213,周辺ハードウェア221から構成され
ている。CPU200は、ALU201,テンポラリレジスタ202,汎
用レジスタ203,アドレスバッファ204(図ではABで表現
されている),μアドレス生成部206,μROM209,PC207,P
SW208,タイミング制御部210から構成される。またINTC2
11は、割り込み要求フラグレジスタ215と形態指定フラ
グレジスタ216から構成され、タイミング制御部210に対
し、割り込み要求信号218と形態指定信号220を出力す
る。タイミング制御部210は、INTC211に対し割り込み要
求クリア信号217と形態変更信号219を出力する。
1 is a block diagram of peripheral hardware and a cross-sectional view of an engine according to a first embodiment of the present invention. FIG. 2 is a block diagram of a pulse generator showing the first embodiment. In FIG. 2, the pulse generator of the present invention comprises a CPU 200, an address bus 214, a data bus 205, an INTC 211, a program memory 21.
2, the data memory 213 and the peripheral hardware 221. The CPU 200 includes an ALU 201, a temporary register 202, a general-purpose register 203, an address buffer 204 (represented by AB in the figure), a μ address generation unit 206, a μROM 209, a PC 207, P.
It is composed of a SW 208 and a timing control unit 210. Also INTC2
11 includes an interrupt request flag register 215 and a form designation flag register 216, and outputs an interrupt request signal 218 and a form designation signal 220 to the timing control unit 210. The timing control unit 210 outputs an interrupt request clear signal 217 and a form change signal 219 to the INTC 211.

INTC211は、外部のハードウェアから幾つかの割り込み
信号を受け付け、各割り込みソースに割当てられた優先
順位を判別し、最も高い優先順位をもった割り込みソー
スを一つ選択し、その割り込みソースに対応した値を割
り込み要求フラグレジスタ215にセットする。割り込み
要求フラグレジスタ215と形態指定フラグレジスタ216
は、割り込み要求がn個あるときに、それぞれn個設定
されているが、図中には1組だけ記載されている。ま
た、外部のハードウェアからの割り込み信号や、優先順
位判別部などは、本発明の主旨に直接関係ないため、特
に図示はしていない。
The INTC211 accepts some interrupt signals from external hardware, determines the priority assigned to each interrupt source, selects the interrupt source with the highest priority, and supports that interrupt source. The value is set in the interrupt request flag register 215. Interrupt request flag register 215 and form designation flag register 216
When there are n interrupt requests, n are set respectively, but only one set is described in the figure. Further, an interrupt signal from external hardware, a priority determination unit, and the like are not shown in the figure because they are not directly related to the gist of the present invention.

INTC211からの割り込み要求を、CPU200は2通りの形態
で処理することができる。1つは従来かののベクタ割り
込み処理で、もう1つは、本発明の趣旨であるところの
処理形態で、割り込みが発生すると、ベクタテーブルは
参照せず、データメモリ213中の特定アドレスに予め設
定されている処理形態情報に基づき、所定のデータ処理
を実行する形態である。以下、この所定のデータ処理の
ことをマクロサービスと記す。
The CPU 200 can process the interrupt request from the INTC 211 in two forms. One is the conventional vector interrupt processing, and the other is the processing form within the scope of the present invention. When an interrupt occurs, the vector table is not referred to and a specific address in the data memory 213 is previously stored. This is a mode in which predetermined data processing is executed based on the set processing mode information. Hereinafter, this predetermined data processing will be referred to as a macro service.

ベクタ割り込みかマクロサービスかの指定は、形態指定
フラグレジスタ216で行ない、CPU200から形態指定フラ
グレジスタ216に“0"が設定されている時にはベクタ割
り込みとして、“1"が設定された時にはマクロサービス
として指定される。
Designation of vector interrupt or macro service is performed by the configuration flag register 216. When the CPU 200 sets "0" in the configuration flag register 216, it is a vector interrupt, and when "1" is set, it is a macro service. It is specified.

以下、本発明による専用ハードウェア構成と、マクロサ
ービスによる燃料噴射パルス出力処理のフローを説明す
る。まず周辺ハードウェア221の構造の燃料噴射関係の
装置を第1図に示す。
The dedicated hardware configuration according to the present invention and the flow of the fuel injection pulse output process by the macro service will be described below. First, FIG. 1 shows a device related to fuel injection having a structure of peripheral hardware 221.

周辺ハードウェア221は、クロック(図中にCLKと記載)
をベースとしたフリーランニングタイマ100(図中にFRT
と記載)、フリーランニングタイマ100に対して比較動
作を行うコンペアレジスタ101(図中にCOMP0と記載)と
102(図中にCOMP1と記載)と103(図中にCOMP2と記載)
と104(図中にCOMP3と記載)、キャプチャレジスタ105
(図中にCAPと記載)、ビット選択レジスタ(SR)109、
角度センサによるパルス発生装置111の出力信号T1(以
下パルスT1と記す)をクロック入力とするタイマ106、
タイマ106に対して比較動作を行うコンペアレジスタ107
(図中にCOMPAと記載)、出力ポートP0〜P3から構成さ
れる。また図1で燃料噴射関係の装置はインジェクタ10
8、フォトダイオード118、フォトセンサ110、クランク
軸に直結した円盤112、角度センサによるパルス発生装
置111で構成している。尚、4気筒の場合には、4セッ
ト分同様の燃料噴射装置を具備しているが、図1では出
力ポートP0に対応する装置だけを図示している。
The peripheral hardware 221 is a clock (described as CLK in the figure)
Free running timer 100 (based on FRT
And a compare register 101 (denoted as COMP0 in the figure) that performs a comparison operation on the free running timer 100.
102 (denoted as COMP1 in the figure) and 103 (denoted as COMP2 in the figure)
And 104 (denoted as COMP3 in the figure), capture register 105
(Described as CAP in the figure), bit selection register (SR) 109,
A timer 106 that uses an output signal T1 (hereinafter referred to as pulse T1) of a pulse generator 111 using an angle sensor as a clock input,
Compare register 107 that performs comparison operation on timer 106
(Indicated as COMPA in the figure) and output ports P0 to P3. Further, in FIG. 1, a device related to fuel injection is an injector 10
8. A photodiode 118, a photo sensor 110, a disk 112 directly connected to the crankshaft, and a pulse generator 111 with an angle sensor. In the case of four cylinders, the same fuel injection device for four sets is provided, but in FIG. 1, only the device corresponding to the output port P0 is shown.

一致信号113,114,115,116はそれぞれコンペアレジスタ1
01,102,103,104から出力し、一致信号117はコンペアレ
ジスタ107から出力する。キャプチャレジスタ105は一致
信号117が出力すると、これに同期してフリーランニン
グタイマ100の値を格納する。フリーランニングタイマ1
00に入力されるクロック(図中にCLKと記載)は、制御
の許容誤差範囲内の分解能を持っている。
Match signals 113, 114, 115, and 116 are the compare register 1 respectively.
Output from 01, 102, 103 and 104, and the coincidence signal 117 is output from the compare register 107. When the match signal 117 is output, the capture register 105 stores the value of the free running timer 100 in synchronization with this. Free running timer 1
The clock input to 00 (described as CLK in the figure) has a resolution within the control allowable error range.

ここでタイマ106に入力するパルスT1の発生装置とタイ
マクリア信号130の発生装置について述べる。
Here, a generator of the pulse T1 input to the timer 106 and a generator of the timer clear signal 130 will be described.

1) クロック信号T1 パルス発生装置111より出力する信号。クランク軸に固
定した円盤112の回転角を計測し、例えば1度角度が変
化する毎に1つのパルスを発生する。これをタイマ106
のクロック信号として使用する。
1) Clock signal T1 A signal output from the pulse generator 111. The rotation angle of the disk 112 fixed to the crankshaft is measured, and one pulse is generated every time the angle changes, for example. This is timer 106
Used as the clock signal of.

2) 基準信号130 フォトダイオード118,フォトセンサ110及び円盤112によ
り基準信号130を生成している。円盤112には緑に近い位
置に小さい穴が一つ開いている、ピストンが所定の位置
にある時の円盤の穴がある位置に、フォトダイオード11
8及びフォトセンサ110を固定している。従って円盤112
が回転する毎に、フォトセンサ110はピストンの所定の
位置でフォトダイオードの光を感知してパルスを発生す
る。このパルスを基準信号として使用する。
2) Reference signal 130 The reference signal 130 is generated by the photodiode 118, the photosensor 110, and the disk 112. There is one small hole on the disk 112 near green, and the photodiode 11 is located at the position where the disk hole is when the piston is in place.
8 and the photo sensor 110 are fixed. Therefore disk 112
Each time the photo sensor 110 rotates, the photo sensor 110 senses the light of the photodiode at a predetermined position of the piston and generates a pulse. This pulse is used as a reference signal.

次に、本発明のマクロサービスの処理形態を指定する処
理形態情報について説明する。第3図は処理形態情報の
構成を示す。処理形態情報はデータメモリ213中の特定
のアドレスに配置され、本例の処理形態情報は、チャネ
ルポインタを有する1バイトのヘッダ部と、チャネルポ
インタによって指し示される8バイトのマクロサービス
チャネルによって構成される。
Next, processing form information that specifies the processing form of the macro service of the present invention will be described. FIG. 3 shows the structure of the processing mode information. The processing form information is arranged at a specific address in the data memory 213, and the processing form information of 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. It

本例のマクロサービスチャネルは4気筒の燃料噴射制御
を想定した構成となっており、燃料噴射パルス幅を指定
するワードデータ(P0〜P3用)から構成されている。
The macro service channel of this example is configured to assume fuel injection control of four cylinders, and is composed of word data (for P0 to P3) designating a fuel injection pulse width.

ワードデータ0,1,2,3はそれぞれポートP0,P1,P2,P3から
出力するパルス出力のパルス幅を規定するワードデータ
で、この値を基にしてコンペアレジスタ101,102,103,10
4には、それぞれポートP0,P1,P2,P3のパルス出力をリセ
ットするワードデータが、CPU200によって格納される。
Word data 0, 1, 2, 3 is word data that defines the pulse width of the pulse output output from the ports P0, P1, P2, P3, respectively.Based on this value, the compare registers 101, 102, 103, 10
The word data for resetting the pulse outputs of the ports P0, P1, P2, P3 are stored in the CPU 4, respectively, by the CPU 200.

本例のマクロサービスは、コンペアレジスタ107からの
一致信号117によって起動する。マクロサービスが起動
する以前に、CPU200はマクロサービスチャネルやハード
ウェアに対して初期化を行なう。また、ビット選択レジ
スタSR109には、最初に燃料噴射パルスを出力すべきポ
ートP0であることを指定するために、ポートP0に対応す
るビットだけを1にそれ以外を0に設定しておく。
The macro service of this example is activated by the match signal 117 from the compare register 107. Before the macro service is activated, the CPU 200 initializes the macro service channel and hardware. Further, in the bit selection register SR109, only the bit corresponding to the port P0 is set to 1 and the other bits are set to 0 in order to specify that the port P0 should output the fuel injection pulse first.

次に、本発明のCPU200の通常動作の中で燃料噴射制御に
必要な、1)燃料噴射開始タイミング1、及び2)燃料
噴射量1Wを求める演算のパラメータについて図5のフロ
ーチャートを基に説明する。
Next, the parameters of the operation required for the fuel injection control during the normal operation of the CPU 200 of the present invention, 1) the fuel injection start timing 1 and 2) the fuel injection amount 1W, will be described based on the flowchart of FIG. .

1) 燃料噴射開始タイミングI パラメータ:a)吸入空気量(Q) 気化器のエアフロメータにあたるセンサからのデータを
AD変換して得る b)エンジン回転数(N) イグニションコイルの1次側信号時間間隔を演算して得
る 上記パラメータa),b)を用い演算して得る。
1) Fuel injection start timing I Parameter: a) Intake air amount (Q) Data from the sensor corresponding to the air flow meter of the carburetor
Obtained by AD conversion b) Engine speed (N) Obtained by calculating the primary side signal time interval of the ignition coil. Obtained by using the above parameters a), b).

2) 燃料噴射量IW パラメータ:a)補正係数(K) b)電圧補正値KV:バッテリ電圧より演算して得る c)エンジン回転数(N) d)吸入空気量(Q) このパラメータを用いて IW=定数*Q/N *K+KVで算出する。2) Fuel injection amount IW parameter: a) Correction coefficient (K) b) Voltage correction value KV: Obtained by calculation from battery voltage c) Engine speed (N) d) Intake air amount (Q) Using this parameter IW = constant * Q / N * K + KV

CPU200は上記の燃料噴射開始タイミングIと燃料噴射量
IWを随時計算している。尚、補正係数Kは、冷却水温、
スロットル開度、エンジン回転数、吸入空気量、エンジ
ンの排気パイプの酸素濃度等からのデータを元に求めら
れるが、詳細は本発明の処理に直接関係無いので省略す
る。
The CPU 200 determines the fuel injection start timing I and the fuel injection amount described above.
IW is calculated from time to time. The correction coefficient K is the cooling water temperature,
It can be obtained based on data from the throttle opening, the engine speed, the intake air amount, the oxygen concentration in the exhaust pipe of the engine, etc., but since the details are not directly related to the processing of the present invention, they are omitted.

第4図は、本例のマクロサービスをフローチャートで示
したもので、実際にはμプログラム制御となっている。
以下、第1図乃至第8図を参照しながら、第8図
(a),(b)それぞれのパルスパターンに分けて、マ
クロサービスの詳細な説明を行なう。
FIG. 4 is a flow chart showing the macro service of this example, which is actually μ program control.
Hereinafter, the macro service will be described in detail with reference to FIGS. 1 to 8 by dividing the pulse patterns of FIGS. 8 (a) and 8 (b).

(1) 第8図(a)に示すようなパルスパターンの場
合 第1図においてフォトセンサ110の出力信号130がピスト
ンの所定の位置でアクティブになるとINTC211に対して
割り込み要求を発生する(基準点割り込みと記す)、IN
TC211は基準割り込みを受付て、このソースに対応する
値を割り込み要求フラグレジスタ215にセットし割り込
み要求信号218をアクティブにする。タイミング制御部2
10は命令処理を終わりで割り込み要求信号218はサンプ
ルしアクティブであるので形態指定信号220をサンプル
し、ここでこの形態指定信号が0であるとベクタ割り込
みに分岐し割り込みルーチンに入る。
(1) In the case of a pulse pattern as shown in FIG. 8 (a) In FIG. 1, when the output signal 130 of the photo sensor 110 becomes active at a predetermined position of the piston, an interrupt request is issued to the INTC211 (reference point Interruption), IN
The TC211 receives the reference interrupt, sets a value corresponding to this source in the interrupt request flag register 215, and activates the interrupt request signal 218. Timing control unit 2
When 10 is the end of the instruction processing, the interrupt request signal 218 is sampled and active, so the form designating signal 220 is sampled. If this form designating signal is 0, it branches to the vector interrupt and enters the interrupt routine.

次に第6図のフローチャートを参照して基準点割り込み
ルーチンについて説明する。この割り込みでは、まずCP
U200が予めメインルーチンで算出した燃料噴射開始タイ
ミングIをコンペアレジスタ(COMPA)107にセットし、
次に燃料噴射量IWをマクロサービスチャネル、ワードデ
ータ0へセットし、次に点火時期制御などのその他のエ
ンジン制御を行いメインルーチンに復帰する。実際に
は、制御の方法に応じて数々の処理フローが考えられる
が、ここでは基準点割り込みで燃料噴射量の設定の他に
上記処理も含めて行なうことを想定した。フォトセンサ
110の出力信号130はタイマ106に入力し、タイマ106のク
リア信号となる。このタイマ106のカウンタクロックは
角度センサによるパルス発生装置111の出力であり、従
ってタイマ106はクランク角をカウントしていることに
なる。
Next, the reference point interrupt routine will be described with reference to the flowchart of FIG. In this interrupt, first CP
U200 sets the fuel injection start timing I previously calculated in the main routine in the compare register (COMPA) 107,
Next, the fuel injection amount IW is set to the macro service channel and word data 0, and then other engine controls such as ignition timing control are performed and the process returns to the main routine. Actually, various processing flows are conceivable depending on the control method, but here it is assumed that the above processing is performed in addition to the setting of the fuel injection amount by the reference point interruption. Photo sensor
The output signal 130 of 110 is input to the timer 106 and becomes a clear signal of the timer 106. The counter clock of the timer 106 is the output of the pulse generator 111 by the angle sensor, and therefore the timer 106 counts the crank angle.

次に基準点割り込みルーチンによってコンペアレジスタ
(COMPA)107にセットされた燃料噴射開始タイミングI
とタイマ106の出力信号が一致すると、コンペアレジス
タ(COMPA)107の出力信号117がアクティブになる。一
致信号117がアクティブになると、ビット選択レジスタ
(SR)109の初期値より、ポートP0のRSフリップフロッ
プだけセットされ、ポートP0からの出力パレスがハイレ
ベルになり、インジェクタ108は気筒0に対して燃料噴
射を開始する。また同時に、一致信号117がアクティブ
となったので、フリーランニングタイマ100の値がキャ
プチャレジスタ105に格納される。また一致信号117は、
INTC211に対し割り込み要求を発生する。一致信号117に
対応するINTC211内の形態指定信号220は、CPU200によっ
て事前に“1"が設定されているものとする。
Next, the fuel injection start timing I set in the compare register (COMPA) 107 by the reference point interrupt routine.
When the output signal of the timer 106 matches the output signal of the timer 106, the output signal 117 of the compare register (COMPA) 107 becomes active. When the match signal 117 becomes active, only the RS flip-flop of the port P0 is set from the initial value of the bit selection register (SR) 109, the output palace from the port P0 becomes high level, and the injector 108 is set to the cylinder 0. Start fuel injection. At the same time, since the coincidence signal 117 is activated, the value of the free running timer 100 is stored in the capture register 105. The match signal 117 is
Generates an interrupt request to INTC211. It is assumed that the form designation signal 220 in the INTC 211 corresponding to the match signal 117 is set to “1” in advance by the CPU 200.

INTC211が一致信号117の割り込み要求を受け付けると、
このソースに対応する値を割り込み要求フラグレジスタ
215にセットし、割り込み要求信号218をアクティブにす
る。タイミング制御部210は、命令処理の終りで割り込
み要求をサンプルする。ここで割り込み要求信号218が
アクティブであるため、形態指定信号220をサンプルす
る。形態指定信号220がマクロサービスを示す“1"であ
ること検知すると、PC207,PSW208を保持したまま、μRO
M209のマクロサービス処理エントリアドレスを生成し、
マクロサービスを開始する。以降、マクロサービスのμ
プログラム指令に従って処理される。処理フローの説明
を第4図のフローチャートにそって進める。
When the INTC211 receives the interrupt request of the match signal 117,
The value corresponding to this source is the interrupt request flag register
Set to 215 to activate the interrupt request signal 218. The timing controller 210 samples the interrupt request at the end of instruction processing. Since the interrupt request signal 218 is active here, the form designation signal 220 is sampled. When the form designation signal 220 is detected as "1" indicating the macro service, the μRO is held while the PC207 and PSW208 are held.
Generate macro service processing entry address of M209,
Start the macro service. Since then, μ of the macro service
It is processed according to program instructions. The processing flow will be described along the flowchart of FIG.

まず最初に、一致信号117を割り込みソースとするマク
ロサービスのヘッダを、データメモリ213中の特定アド
レスから読み出し、マクロサービスチャネルの位置を検
出する。次に、ビット選択レジスタ(SR)109の内容を
読み込み、ポートP0を示すビットに1が立っていること
から、このビットに対応するマクロサービスチャネル中
のワードデータ0の値、つまり基準点割り込みでセット
した燃料噴射量(IW)とキャプチャレジスタ105の内容
とを、ALU201を利用して加算し、その結果を、コンペア
レジスタ101に格納する。次にビット選択レジスタ(S
R)109の左シフト処理を実行しポート1に相当するビッ
トだけ1にセットする。この場合シフトアウトは発生し
ないため、μプログラムの指令により、タイミング制御
部210は割り込みクリア信号217をINTC211に対し出力し
割り込み要求フラグレジスタ215をリセットしてマクロ
サービス処理を終了する。
First, the macro service header with the coincidence signal 117 as an interrupt source is read from a specific address in the data memory 213 to detect the position of the macro service channel. Next, the contents of the bit selection register (SR) 109 are read, and since the bit indicating port P0 is set to 1, the value of word data 0 in the macro service channel corresponding to this bit, that is, the reference point interrupt The set fuel injection amount (IW) and the contents of the capture register 105 are added using the ALU 201, and the result is stored in the compare register 101. Next, select the bit selection register (S
R) 109 left shift processing is executed and only the bit corresponding to port 1 is set to 1. In this case, since shift-out does not occur, the timing control unit 210 outputs the interrupt clear signal 217 to the INTC 211, resets the interrupt request flag register 215, and terminates the macro service process in accordance with the μ program command.

マクロサービス処理が終了すればタイミング制御部210
は保持していたPC207,PSW208の値から通常の命令処理を
再開する。
When the macro service processing ends, the timing control unit 210
Restarts normal instruction processing from the stored values of PC207 and PSW208.

ここでコンペアレジスタ101に格納した値は、一致信号1
17がアクティブになった時のフリーライニングタイマ10
0の値と燃料噴射量IWを加えた値であり、且つフリーラ
ンニングタイマ100はカウントクロックCLKでカウントア
ップし続けているので、コンペアレジスタ101の出力で
ある一致信号113がアクティブになるのは一致信号117が
アクティブになってから燃料噴射量IW時間後となる。
The value stored in the compare register 101 here is the match signal 1
Freelining timer 10 when 17 becomes active
It is a value obtained by adding the value of 0 and the fuel injection amount IW, and since the free running timer 100 continues to count up with the count clock CLK, the match signal 113 output from the compare register 101 becomes active. It is after the fuel injection amount IW time after the signal 117 becomes active.

一致信号113がアクティブになるとポート0のフリップ
フロップをリセットしポート0の出力はロウレベルとな
りインジェクタ108は燃料の噴射を終了する。
When the coincidence signal 113 becomes active, the flip-flop of the port 0 is reset, the output of the port 0 becomes low level, and the injector 108 ends the fuel injection.

また上記のマクロサービス処理の後、タイマ106はフォ
トセンサ110の出力であるクリア信号130によってクリア
され、再びコンペアレジスタ107に設定した値と一致す
れば、コンペアレジスタ107は一致信号117を発生するこ
とになる。
After the above macro service processing, the timer 106 is cleared by the clear signal 130 which is the output of the photo sensor 110, and if the value set in the compare register 107 matches again, the compare register 107 generates a match signal 117. become.

以上の処理をポートP0からP3まで全く同様に繰り返す。
ポートP3に対する燃料噴射開始タイミングによって起動
されるマクロサービスでは、やはり前述したマクロサー
ビス処理の通りに、最初にSR109の内容を読み込み、ポ
ートP3を示すビットに1が立っていることから、このビ
ットに対応するマクロサービスチャネル中のワードデー
タ3と、キャプチャレジスタ105の内容を、ALU201を利
用して加算し、その結果を、コンペアレジスタ104に格
納する。
The above processing is repeated in exactly the same way for ports P0 to P3.
In the macro service started at the fuel injection start timing for port P3, the contents of SR109 are read first and the bit indicating port P3 is set to 1 as in the macro service process described above. The word data 3 in the corresponding macro service channel and the contents of the capture register 105 are added using the ALU 201, and the result is stored in the compare register 104.

4回目のマクロサービス処理でビット選択レジスタ(S
R)109の左シフト処理を実行すると、ビット選択レジス
タ(SR)109からのシフトアウトが発生し、μプログラ
ムの指令でタイミング制御部210は、形態変更信号219を
INTC211に対し出力し、形態指定フラグレジスタ216をリ
セットする。
The bit selection register (S
When the R) 109 left shift processing is executed, a shift-out from the bit selection register (SR) 109 occurs, and the timing control unit 210 outputs the form change signal 219 in response to a μ program command.
Output to INTC211, and reset the form designation flag register 216.

INTC211は、割り込み要求フラグレジスタ215がセット状
態で、形態指定フラグレジスタ216がリセット状態であ
るため、今度は通常のベクタ割り込み要求(シフトアウ
ト割り込みと記す)をCPU200に対し発生する。以下にこ
のベクタ割り込み処理について図7を用いて説明する。
Since the interrupt request flag register 215 is in the set state and the form designation flag register 216 is in the reset state, the INTC 211 issues a normal vector interrupt request (referred to as a shift-out interrupt) to the CPU 200 this time. The vector interrupt process will be described below with reference to FIG.

シフトアウト割り込み処理プログラムは、4気筒が一巡
してシフトアウト信号が出たところで起動され、まずビ
ット選択レジスタ(SR)109に“0001"(初期値)をセッ
トする。次にその他の補正を行い通常処理に復帰する。
The shift-out interrupt processing program is started when a shift-out signal is output after one cycle of four cylinders. First, "0001" (initial value) is set in the bit selection register (SR) 109. Next, other corrections are performed and the normal processing is resumed.

(2) 第8図(b)に示すようなパルスパターンの場
合 最初にフォトセンサ110の出力信号130がアクティブとな
りタイマ106はクリアされる。次にタイマ106の値とコン
ペアレジスタ107にセットした燃料噴射開始タイミング
Iの値が一致すると一致信号117がアクティブとなり、
ポートP0のRSフリップフロップだけセットされ、ポート
P0からの出力パルスがハイレベルになり、インジェクタ
108は、気筒0に対する燃料噴射を開始する。また一致
信号117が割り込み要求をINTC211に対し発生し、マクロ
サービスを開始する。ここまでは前述した(1)の
(a)の場合と全く同様である。この場合にも、マクロ
サービスチャネル中の所定のデータ、すなわちワードデ
ータ0と、キャプチャレジスタ105の内容とを、ALU201
を利用して加算し、その結果をコンペアレジスタ101に
格納する。
(2) In case of pulse pattern as shown in FIG. 8 (b) First, the output signal 130 of the photo sensor 110 becomes active and the timer 106 is cleared. Next, when the value of the timer 106 and the value of the fuel injection start timing I set in the compare register 107 match, the match signal 117 becomes active,
Only the RS flip-flop of port P0 is set
The output pulse from P0 goes high and the injector
108 starts fuel injection into cylinder 0. Further, the coincidence signal 117 generates an interrupt request to the INTC 211 and starts the macro service. The process up to this point is exactly the same as in the case (a) of (1) described above. Also in this case, the predetermined data in the macro service channel, that is, the word data 0 and the contents of the capture register 105 are set to the ALU201.
Are added and the result is stored in the compare register 101.

次に、ビット選択レジスタ(SR)109の左シフト処理を
実行し、ポートP1に相当するビットだけ1にセットす
る。この場合シフトアウトは発生しないため、タイミン
グ制御部210は、割り込み要求クリア信号217をINTC211
に対し出力し、割り込み要求フラグレジスタ215をリセ
ットしてマクロサービス処理を終了する。
Next, the left shift processing of the bit selection register (SR) 109 is executed, and only the bit corresponding to the port P1 is set to 1. In this case, since shift-out does not occur, the timing control unit 210 sets the interrupt request clear signal 217 to INTC211.
, And the interrupt request flag register 215 is reset to end the macro service processing.

マクロサービス処理が終了すれば、タイミング制御210
は保持していたPC207,PSW208の値から通常の命令処理を
再開する。
When the macro service processing ends, the timing control 210
Restarts normal instruction processing from the stored values of PC207 and PSW208.

第8図(b)のパルスパターンの場合には、パルスの重
なりがあり、コンペアレジスタ101からの一致信号113が
発生する前に、再度コンペアレジスタ107からの一致信
号117が発生している。
In the case of the pulse pattern shown in FIG. 8B, the pulses overlap each other, and the match signal 117 from the compare register 107 is generated again before the match signal 113 from the compare register 101 is generated.

この時には、ポートP1のRSフリップフロップだけセット
され、ポートP1からの出力パルスがハイレベルになり、
気筒1に対する燃料噴射が開始され、気筒0と気筒1両
方とも燃料噴射を行なっていることになる。
At this time, only the RS flip-flop of port P1 is set, and the output pulse from port P1 becomes high level,
Fuel injection to the cylinder 1 is started, and both cylinder 0 and cylinder 1 are injecting fuel.

一致信号117は割り込み要求をINTC211に対し発生し、マ
クロサービスを開始する。この場合にも、キャプチャレ
ジスタ105の内容と、マクロサービスチャネル中のワー
ドデータ1を、ALU201を利用して加算し、その結果をコ
ンペアレジスタ102に格納する。またビット選択レジス
タ(SR)109の左シフト処理を実行し、ポートP2に相当
するビットだけ1にセットする。この場合にもシフトア
ウトは発生しないので、タイミング制御部210は、割り
込み要求クリア信号217をINTC211に対し出力し、割り込
み要求フラグレジスタ215をリセットしてマクロサービ
ス処理を終了する。
The coincidence signal 117 issues an interrupt request to the INTC 211 and starts macro service. Also in this case, the contents of the capture register 105 and the word data 1 in the macro service channel are added by using the ALU 201, and the result is stored in the compare register 102. In addition, the left shift processing of the bit selection register (SR) 109 is executed and only the bit corresponding to the port P2 is set to 1. In this case as well, shift-out does not occur, so the timing control unit 210 outputs an interrupt request clear signal 217 to the INTC 211, resets the interrupt request flag register 215, and ends the macro service processing.

再度コンペアレジスタ107からの一致信号117が発生する
と、この時にはポートP2のRSフリップフロップだけセッ
トされ、ポートP2からの出力パルスがハイレベルにな
り、気筒2に対する燃料噴射が開始される。
When the coincidence signal 117 from the compare register 107 is generated again, only the RS flip-flop of the port P2 is set at this time, the output pulse from the port P2 becomes high level, and fuel injection to the cylinder 2 is started.

一致信号117は割り込み要求をINTC211に対し発生し、マ
クロサービスを開始する。この場合にも、キャプチャレ
ジスタ105の内容と、マクロサービスチャネル中のワー
ドデータ2を、ALU201を利用して加算し、その結果をコ
ンペアレジスタ103に格納する。またビット選択レジス
タ(SR)109の左シフト処理を実行し、ポートP3に相当
するビットだけ1にセットする。この場合にもシフトア
ウトは発生しないため、タイミング制御部210は、割り
込み要求クリア信号217をINTC211に対し出力し、割り込
み要求フラグレジスタ215をリセットしてマクロサービ
ス処理を終了する。
The coincidence signal 117 issues an interrupt request to the INTC 211 and starts macro service. Also in this case, the contents of the capture register 105 and the word data 2 in the macro service channel are added by using the ALU 201, and the result is stored in the compare register 103. Further, the left shift processing of the bit selection register (SR) 109 is executed, and only the bit corresponding to the port P3 is set to 1. In this case as well, shift-out does not occur, so the timing control unit 210 outputs the interrupt request clear signal 217 to the INTC 211, resets the interrupt request flag register 215, and ends the macro service process.

再度コンペアレジスタ107からの一致信号117が発生する
と、この時にはポートP3のRSフリップフロップだけセッ
トされ、ポートP3からの出力パルスがハイレベルにな
り、気筒3に対する燃料噴射が開始される。
When the coincidence signal 117 from the compare register 107 is generated again, only the RS flip-flop of the port P3 is set at this time, the output pulse from the port P3 becomes high level, and fuel injection to the cylinder 3 is started.

一致信号117は割り込み要求をINTC211に対し発生し、マ
クロサービスを開始する。この場合にも、キャプチャレ
ジスタ105の内容と、マクロサービスチャネル中のワー
ドデータ3を、ALU201を利用して加算し、その結果をコ
ンペアレジスタ104に格納する。またビット選択レジス
タ(SR)104の左シフト処理を実行すると、この時はシ
フトアウトが発生するため、タイミング制御部210は、
形態変更信号219をINTC211に対し出力し、形態指定フラ
グレジスタ216をリセットする。
The coincidence signal 117 issues an interrupt request to the INTC 211 and starts macro service. Also in this case, the contents of the capture register 105 and the word data 3 in the macro service channel are added by using the ALU 201, and the result is stored in the compare register 104. Further, when the left shift processing of the bit selection register (SR) 104 is executed, shift-out occurs at this time, so the timing control unit 210
The form change signal 219 is output to the INTC 211, and the form designation flag register 216 is reset.

INTC211は、割り込み要求フラグレジスタ215がセット状
態で、形態指定フラグレジスタ216がリセット状態であ
るため、今度は通常のベクタ割り込み要求をCPU200に対
し発生し、シフトアウト割り込みのベクタ割り込み処理
を実行する。
Since the interrupt request flag register 215 is in the set state and the form designation flag register 216 is in the reset state, the INTC 211 issues a normal vector interrupt request to the CPU 200 this time and executes the shift-out interrupt vector interrupt process.

次に、ポートP0に対する燃料噴射終了タイミングを与え
るコンペアレジスタ101からの一致信号113が発生する
と、ポートP0のRSフリップフロップだけリセットされ、
ポートP0の出力はロウレベルとなりインジェクタ108は
気筒0への燃料噴射を終了する。以降、コンペアレジス
タ102からの一致信号114、コンペアレジスタ103からの
一致信号115、コンペアレジスタ104からの一致信号116
が発生すると、それぞれポートP1,ポートP2,ポートP3の
RSフリップフロップをリセットして、各気筒への燃料噴
射を終了する。
Next, when the coincidence signal 113 from the compare register 101 which gives the fuel injection end timing to the port P0 is generated, only the RS flip-flop of the port P0 is reset,
The output of the port P0 becomes low level, and the injector 108 finishes the fuel injection into the cylinder 0. After that, the match signal 114 from the compare register 102, the match signal 115 from the compare register 103, and the match signal 116 from the compare register 104.
Occurs, port P1, port P2, and port P3
The RS flip-flop is reset and fuel injection to each cylinder is completed.

以上、第8図(a)のパルスパターンと、同図(b)の
様なパルスパターンとを、分けて説明してきたが、この
2パターンの如何なる組合せに於いても、本マクロサー
ビス処理は適用できる。
The pulse pattern of FIG. 8 (a) and the pulse pattern of FIG. 8 (b) have been separately described above, but this macro service processing is applicable to any combination of these two patterns. it can.

また本実施例におけるタイマ106は、クリア信号130でク
リアされた後、コンペアレジスタ107に設定した所定の
値の数のパルスT1をカウントすると、コンペアレジスタ
107が一致信号117を発生し、所定のポートからのパルス
出力をハイレベルにする。これは、フォトセンサ110の
出力信号130がアクティブとなった後、パルス出力をハ
イレベルにするまでの所定の物理的(コンペアレジスタ
107の値*パルスT1)を計測していることになる。これ
に対し、クロックをベースにするフリーランニングタイ
マ100とコンペアレジスタ101,102,103,104は、コンペア
レジスタ107による一致信号117の発生後、各コンペアレ
ジスタに割り当てられたワードデータ分のクロックをカ
ウントすると、ポートからのパルス出力をロウレベルに
する。これは、パルス出力のハイレベルの幅だけの、ク
ロックを単位とする所定の時間量(ワードデータ0,1,2,
3)を計測していることになる。
Further, the timer 106 in this embodiment counts the number of pulses T1 of the predetermined value set in the compare register 107 after being cleared by the clear signal 130, and then the compare register
107 generates the coincidence signal 117, and makes the pulse output from a predetermined port high level. This is a predetermined physical (compare register after the output signal 130 of the photo sensor 110 becomes active until the pulse output becomes high level).
It means that the value of 107 * pulse T1) is being measured. On the other hand, the clock-based free-running timer 100 and the compare registers 101, 102, 103, and 104 have the pulse from the port when the clock for the word data assigned to each compare register is counted after the match signal 117 is generated by the compare register 107. Set the output to low level. This is a predetermined amount of time (word data 0, 1, 2,
3) is being measured.

従って、本実施例のようにタイマ106のクリア信号とし
て、シリンダ回転サイクルの基準点で発生するパルス信
号130を用い、またタイマ106のカウントクロックとし
て、クランク角の基本角毎に発生するパルスを用いる
と、ポートのパルス出力をハイレベルにする時期、すな
わちインジェクタが燃料噴射を開始する時期を所定のク
ランク角度(位置)で選択することができ、また、ポー
トのパルス出力をロウレベルにする時期、すなわち燃料
を噴射する時間を所定の時間(噴射量)行うことができ
ることになり、精度の高い、最適な燃料噴射制御を実現
することができる。
Therefore, as in this embodiment, the pulse signal 130 generated at the reference point of the cylinder rotation cycle is used as the clear signal of the timer 106, and the pulse generated every basic angle of the crank angle is used as the count clock of the timer 106. And when the pulse output of the port becomes high level, that is, when the injector starts fuel injection can be selected at a predetermined crank angle (position), and when the pulse output of the port becomes low level, that is, The fuel can be injected for a predetermined time (injection amount), and highly accurate and optimum fuel injection control can be realized.

また本例では、ビット選択レジスタ(SR)109からのシ
フト処理の結果、シフトアウトが発生した場合、ベクタ
割込みを発生させ、割込み処理プログラムで初期化を行
なう方法を示したが、これはエンジンの状態に応じて何
等かの補正処理が必要となった場合、その補正タイミン
グを与える目的で設定したもので、そのような補正処理
を必要としないシステムにおいては、ビット選択レジス
タ(SR)109にローテート処理を実行し、ビット3から
のシフトアウトがビット0に転送される様に、マクロサ
ービス処理を変更すれば、ベクタ割込みの発生なしにマ
クロサービス処理だけで、完全な燃料噴射制御が可能と
なる。
Also, in this example, when shift-out occurs as a result of shift processing from the bit selection register (SR) 109, a vector interrupt is generated and initialization is performed by the interrupt processing program. If some correction processing is required depending on the state, it is set for the purpose of giving the correction timing. In systems that do not require such correction processing, the bit selection register (SR) 109 is rotated. If the macro service processing is changed such that the processing is executed and the shift-out from bit 3 is transferred to bit 0, complete fuel injection control is possible only by the macro service processing without the occurrence of vector interruption. .

尚、本実施例では、燃料噴射開始タイミングをT1による
系で制御し、燃料噴射終了タイミングをクロックによる
系で制御する方法を示したが、図1において、フリーラ
ンニングタイマ100をタイマに、またタイマ106をフリー
ランニングタイマに設定すれば、系は逆になり、応用に
合わせた選択も可能である。また本実施例では、タイマ
106に与えるカウンタパルスT1は角度センサによるパル
ス発生装置の出力を用いているが、クランク角をロータ
リーエンコーダで基本角度を基としてエンコードした、
エンコードパルスを用いてもよい。
In this embodiment, the method of controlling the fuel injection start timing by the system of T1 and the fuel injection end timing by the system of the clock is shown. In FIG. 1, the free running timer 100 is a timer and the timer is also a timer. If 106 is set as a free-running timer, the system will be reversed and you can select it according to the application. In this embodiment, the timer
The counter pulse T1 given to 106 uses the output of the pulse generator by the angle sensor, but the crank angle is encoded by the rotary encoder based on the basic angle,
Encode pulses may be used.

次に、本発明の基づく第2の実施例を示す。Next, a second embodiment according to the present invention will be shown.

第9図は第2の実施例の周辺ハードウェアのブロック
図、第10図は第2の実施例を示すパルス発生装置のブロ
ック図である。第10図において、本発明のパルス発生装
置は、CPU1000、アドレスバス214、データバス205、INT
C1011、プログラムメモリ212、データメモリ213、周辺
ハードウェア1021から構成されている。
FIG. 9 is a block diagram of peripheral hardware of the second embodiment, and FIG. 10 is a block diagram of a pulse generator showing the second embodiment. In FIG. 10, the pulse generator of the present invention comprises a CPU 1000, an address bus 214, a data bus 205, an INT.
It is composed of a C 1011, a program memory 212, a data memory 213, and peripheral hardware 1021.

CPU1000は、ALU201、テンポラリレジスタ202、汎用レジ
スタ203、アドレスバッファ204(図ではABで表現されて
いる)、μアドレス生成部206、μROM209、PC207、PSW2
08、タイミング制御部1010から構成される。
The CPU 1000 includes an ALU 201, a temporary register 202, a general-purpose register 203, an address buffer 204 (represented by AB in the figure), a μ address generation unit 206, a μROM 209, a PC 207, a PSW2.
08 and timing control unit 1010.

またINTC1011は、割り込み要求フラグレジスタ215−1,2
15−2と形態指定フラグレジスタ216−1,216−2から構
成され、タイミング制御部1010に対し、割り込み要求信
号218−1,218−2と形態指定信号220−1,220−2を出力
する。タイミング制御部1010は、INTC1011に対し割り込
み要求クリア信号217−1,217−2と形態変更信号219−
1,219−2を出力する。
In addition, INTC1011 is the interrupt request flag register 215-1,2.
15-2 and form designation flag registers 216-1 and 216-2, and outputs interrupt request signals 218-1 and 218-2 and form designation signals 220-1 and 220-2 to the timing control unit 1010. The timing control unit 1010 sends interrupt request clear signals 217-1 and 217-2 and a form change signal 219− to the INTC 1011.
Outputs 1,219-2.

INTC1011は、外部のハードウェアから幾つかの割り込み
信号を受け付け、各割り込みソースに割当てられた優先
順位を判別し、最も高い優先順位をもった割り込みソー
スを一つ選択し、その割り込みソースに対応した値を割
り込み要求フラグレジスタ215にセットする。割り込み
要求フラグレジスタ215と形態指定フラグ216は、割り込
み要求がn個あるときに、それぞれn個設定されている
が、図中では本実施例で関係している2組だけ記載され
ている。また、外部のハードウェアからの割り込み信号
や、優先順位判別部などは、本発明の主旨に直接関係な
いため、特に図示はしていない。
The INTC1011 accepts several interrupt signals from external hardware, determines the priority assigned to each interrupt source, selects the interrupt source with the highest priority, and supports that interrupt source. The value is set in the interrupt request flag register 215. The interrupt request flag register 215 and the form designation flag 216 are set to n when there are n interrupt requests, but only two sets related to this embodiment are shown in the figure. Further, an interrupt signal from external hardware, a priority determination unit, and the like are not shown in the figure because they are not directly related to the gist of the present invention.

周辺ハードウェア1021は、クロックをベースとしたフリ
ーランニングタイマ900、フリーランニングタイマ900に
対して比較動作を行うコンペアレジスタ901(図中にCOM
P0と記載)と902(図中にCOMP1と記載)と903(図中にC
OMP2と記載)と904(図中にCOMP3と記載)、キャプチャ
レジスタ905(図中にCAPAと記載)、ビット選択レジス
タ909(図中にSRと記載)外部パルスT1をカウントソー
スするイベントカウンタ906、イベントカウンタ906に対
して比較動作を行うコンペアレジスタ907(図中にCOMPA
と記載)、所定のタイミングでイベントカウンタ907の
値を格納するキャプチャレジスタ908(図中にCAPBと記
載)、インジェクタ910、フォトダイオード919、フォト
センサ911、角度センサによるパルス発生装置912、クラ
ンク軸に直結した円盤913、出力ポーP0〜P3から構成さ
れる。一致信号914,915,916,917はそれぞれコンペアレ
ジスタ901,902,903,904から出力され、一致信号918はコ
ンペアレジスタ907から出力される。キャプチャレジス
タ905は一致信号918が出力されると、これに同期してフ
ラーランニングタイマ900の値を格納する。キャプチャ
レジスタ908はフォトセンサ911の出力信号930が入力さ
れると、これに同期してイベントカウンタ906の値を格
納する。フリーランニングタイマ900に入力されるクロ
ックは、制御の許容誤差範囲内の分解能を持っている。
また、イベントカウンタ906には、カウントソースとし
てクランク軸の回転角を表す信号T1が入力されており、
コンペアレジスタ907はこのイベントカウンタ906に対し
て比較動作を行い一致信号918を発生する。
The peripheral hardware 1021 includes a clock-based free-running timer 900 and a compare register 901 (COM in the figure) that performs a comparison operation with respect to the free-running timer 900.
P0) and 902 (COMP1 in the figure) and 903 (C in the figure)
OMP2) and 904 (denoted as COMP3 in the figure), capture register 905 (denoted as CAPA in the figure), bit selection register 909 (denoted as SR in the figure) Event counter 906 that counts the external pulse T1 The compare register 907 (compare in the figure
,), A capture register 908 (described as CAPB in the figure) that stores the value of the event counter 907 at a predetermined timing, an injector 910, a photodiode 919, a photo sensor 911, a pulse generator 912 using an angle sensor, and a crank shaft. It consists of a disk 913 directly connected and output ports P0 to P3. Match signals 914, 915, 916 and 917 are output from compare registers 901, 902, 903 and 904, respectively, and match signal 918 is output from compare register 907. When the match signal 918 is output, the capture register 905 stores the value of the fuller running timer 900 in synchronization with this. When the output signal 930 of the photo sensor 911 is input, the capture register 908 stores the value of the event counter 906 in synchronization with this. The clock input to the free-running timer 900 has a resolution within the control allowable error range.
Further, the event counter 906 receives a signal T1 representing the rotation angle of the crankshaft as a count source,
The compare register 907 performs a comparison operation on the event counter 906 and generates a coincidence signal 918.

一致信号918によるマクロサービスの起動およびパルス
出力を制御する動作は、実施例1での一致信号117によ
るマクロサービスの起動およびパルス出力の制御と同様
であるので説明は省略し、ここでは、イベントカウンタ
906と、コンペアレジスタ907と、キャプチャレジスタ90
8およびフォトセンサ911の出力信号930の間の動作を説
明する。まずキャプチャレジスタ908は、出力信号930が
入力されると、これに同期して、イベントカウンタ906
の値を格納する。出力信号930はまたコンペアレジスタ9
07の設定データ更新を要求する割り込み要求信号となっ
ていて、INTC1011に入力されコンペアレジスタ907の更
新の割り込み処理要求をおこなう。
The operation of controlling the macro service start-up and pulse output by the coincidence signal 918 is the same as the macro service start-up and pulse output control by the coincidence signal 117 in the first embodiment, and a description thereof will be omitted.
906, compare register 907, capture register 90
The operation between 8 and the output signal 930 of the photo sensor 911 will be described. First, when the output signal 930 is input, the capture register 908 synchronizes with this and outputs the event counter 906.
Stores the value of. The output signal 930 is also output to the compare register 9
It is an interrupt request signal for requesting update of setting data of 07, and is input to INTC1011 to request an interrupt process of updating the compare register 907.

INTC1011では、クリア信号930により割り込み要求フラ
グレジスタ215−2がセットされ、一致信号917により割
り込み要求フラグレジスタ215−2がセットされる。CPU
1000は、INTC1011より割り込み信号218−2による割り
込み処理要求がだされると、割り込み要求フラグレジス
タ215−2と形態指定フラグレジスタ216−2の状態を基
に、ベクタ割り込みあるいはマクロサービス処理のいず
れかの割り込み処理により、コンペアレジスタ907の更
新を実行する。
In the INTC 1011, the clear signal 930 sets the interrupt request flag register 215-2, and the match signal 917 sets the interrupt request flag register 215-2. CPU
When the INTC 1011 issues an interrupt processing request by the interrupt signal 218-2, the 1000 is either a vector interrupt or a macro service processing based on the states of the interrupt request flag register 215-2 and the form designation flag register 216-2. The compare register 907 is updated by the interrupt processing of.

このときのマクロサービス処理は、キャプチャレジスタ
908の内容とコンペアレジスタ907に関してのマクロサー
ビスチャネル中のワードデータをALU201を利用して加算
し、その結果をコンペアレジスタ907に格納するという
処理を実行するが、基本的な割り込み処理の動作は実施
例1における一致信号117による割り込み処理要求に対
する割り込み処理と同様であるため、詳しい説明は省略
する。
The macro service process at this time is the capture register
The contents of 908 and the word data in the macro service channel regarding the compare register 907 are added using the ALU201, and the result is stored in the compare register 907, but the basic interrupt processing operation is performed. Since it is the same as the interrupt processing for the interrupt processing request by the coincidence signal 117 in the example 1, detailed description will be omitted.

以上の通り、第1の実施例でフォトセンサ110の出力信
号130によってイベントカウンタ106をクリアしコンペア
レジスタ107に一致信号117を発生させる代わりとして、
本第2の実施例では、キャプチャレジスタ908を用いて
コンペアレジスタ907を割り込み処理によって更新して
ゆくこと一致信号918を発生させることができ、実施例
1と同様にこの一致信号918によって制御されるポート
からのパルス出力の制御を実現することができる。
As described above, instead of clearing the event counter 106 and generating the coincidence signal 117 in the compare register 107 by the output signal 130 of the photosensor 110 in the first embodiment,
In the second embodiment, the match signal 918 can be generated by updating the compare register 907 by interrupt processing using the capture register 908, and is controlled by this match signal 918 as in the first embodiment. Control of the pulse output from the port can be realized.

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

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

以上説明した通り本発明は、燃料噴射開始タイミングの
割り込み、燃料噴射終了タイミングの割り込みなどを、
マクロサービスによって処理し、ベクタ割り込み要求を
発生しないため、エンジンの回転数が増しても、割込み
処理プログラムへ移行する際のPC,PSWのスタックの退避
や、割り込み処理プログラムからメイン処理へ戻る時、
スタックの内容をPC,PSWへ復帰する処理でCPU時間を占
めることがない。従って、エンジン制御に於ける燃料噴
射制御、点火時期制御、アイドル回転制御など種々雑多
な仕事に十分なCPU時間をさくことができ、多気筒エン
ジンによる高速回転時にもマイクロコンピュータが十分
余裕をもって制御できるようになる。
As described above, the present invention can interrupt the fuel injection start timing, the fuel injection end timing, etc.
Since it processes by macro service and does not generate a vector interrupt request, even when the engine speed increases, when saving the stack of PC and PSW when shifting to the interrupt processing program, or when returning to the main processing from the interrupt processing program,
CPU time is not occupied in the process of restoring the contents of the stack to PC or PSW. Therefore, sufficient CPU time can be saved for various miscellaneous tasks such as fuel injection control, ignition timing control, idle rotation control, etc. in engine control, and the microcomputer can control with sufficient margin even at high speed rotation with a multi-cylinder engine. Like

また、最近の排気ガス規制や燃料費節減などの要求か
ら、精度の高い燃料噴射制御が必要となってきているこ
とに対しても、燃料噴射開始タイミング、及び燃料噴射
終了タイミングを与えるコンペアレジスタからの一致信
号で、直接ポートを制御し燃料噴射パルスを生成するこ
とで、割り込み要因が発生してから割り込み処理プログ
ラムが開始するまでの時間の遅れや、ポートへのデータ
書き込み時間による遅れなど無しに、最小の誤差で制御
でき、且つ各気筒毎にそれぞれ独立に制御することがで
きるため、燃料噴射量の調節を高い精度で行なうことが
できる。
In addition, due to the recent demands for exhaust gas regulations and fuel cost savings, it is necessary to control fuel injection with high accuracy. By controlling the port directly and generating the fuel injection pulse with the coincidence signal of, there is no delay between the occurrence of the interrupt factor and the start of the interrupt processing program, and the delay due to the data writing time to the port. Since the control can be performed with a minimum error and can be controlled independently for each cylinder, the fuel injection amount can be adjusted with high accuracy.

加えて、本発明の燃料噴射制御装置におけるパルス発生
装置は、特定の単一のコンペアレジスタが各気筒の燃料
噴射開始タイミングを与え、複数のコンペアレジスタが
各気筒毎に燃料噴射終了タイミングを与える方式をとっ
ているため、気筒数が6,8と増えても、燃料噴射終了タ
イミングを与えるコンペアレジスタとマクロサービスチ
ャネル内のワードバッファの数を増やすだけで全く同様
な制御が可能となる。さらに、INTCに対する割り込み要
求信号は、常に、単一のコンペアレジスタが発生するだ
けであるので、INTC内の割り込み要求フラグ、INTCと周
辺ハードウェア間の配線領域等のハードウェアの増加は
ない。従って、本発明の燃料噴射制御装置におけるパル
ス発生装置は、最小限のハードウェアの追加により気筒
数の増加にも容易に対応でいき、経済的に非常に優位な
システムを構成することが可能となり、CPUと周辺回路
を単一基板上に集積するシングルチップなどにも十分に
適用させることができる。
In addition, in the pulse generator in the fuel injection control device of the present invention, a specific single compare register gives the fuel injection start timing of each cylinder, and a plurality of compare registers give the fuel injection end timing for each cylinder. Therefore, even if the number of cylinders is increased to 6,8, exactly the same control is possible only by increasing the number of compare registers for giving the fuel injection end timing and the number of word buffers in the macro service channel. Further, the interrupt request signal to the INTC is always generated only by a single compare register, so that there is no increase in hardware such as an interrupt request flag in the INTC and a wiring area between the INTC and peripheral hardware. Therefore, the pulse generation device in the fuel injection control device of the present invention can easily cope with the increase in the number of cylinders by adding the minimum hardware, and it is possible to configure a very economically superior system. , It can be sufficiently applied to a single chip in which a CPU and peripheral circuits are integrated on a single substrate.

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

第1図は第1の実施例に於ける周辺ハードウェア図、第
2図は第1の実施例に於ける燃料噴射制御装置の構成
図、第3図は第1の実施例に於けるマクロサービスの処
理形態情報構成図、第4図は第1の実施例に於けるマク
ロサービス処理フローチャート、第5図は第1の実施例
に於ける燃料噴射を算出するためのフローチャート、第
6図は第1の実施例に於ける上死点割り込みのフローチ
ャート、第7図は第1の実施例に於けるシフトアウト割
り込みのフローチャート、第8図はポートからの燃料噴
射パルス出力パターン図、第9図は第2の実施例に於け
る周辺ハードウェア構成図、第10図は第2の実施例に於
ける燃料噴射制御装置の構成図、第11図は従来例に於け
る燃料噴射制御装置の構成図、第12図は従来例に於ける
周辺ハードウェア構成図である。 100,900……フリーランニングタイマ、101,102,103,10
4,107,901,902,903,904,907……コンペアレジスタ、10
5,905、908……キャプチャレジスタ、106……タイマ、1
08,910……インジェクタ、109,909……ビット選択レジ
スタSR、110,911……フォトセンサ、111,912……角度セ
ンサによるパルス発生装置、112,913……円盤、113,11
4,115,116,117,914,915,916,917,918……一致信号、11
8,919……フォトダイオード、200、1000,1100……CPU、
201……ALU、202……テンポラリレジスタ、203……汎用
レジスタ、204……アドレスバッファAB、205……データ
バス、206……μアドレス生成部、207……PC、208……P
SW、209……μROM、210,1010,1110……タイミング制御
部、211,1011,1111……INTC、212……プログラムメモ
リ、213……データメモリ、214……アドレスバス、215,
215−1,215−2……割り込み要求フラグ、216,216−1,2
16−2……形態指定フラグ、217,217−1,217−2……割
り込み要求クリア信号、218,218−1,218−2……割り込
み要求信号、219,219−1,219−2……形態変更信号、22
0,220−1,220−2……形態指定信号、221,1021,1121…
…周辺ハードウェア、130,930……クリア信号、906……
イベントカウンタ、1200,1201,1202,1203……ダウンカ
ウンタ、1204……ポートレジスタ、1205,1206,1207,120
8……ボロー信号。
FIG. 1 is a diagram of peripheral hardware in the first embodiment, FIG. 2 is a configuration diagram of a fuel injection control device in the first embodiment, and FIG. 3 is a macro in the first embodiment. FIG. 4 is a flowchart of the macro service processing in the first embodiment, FIG. 5 is a flowchart for calculating the fuel injection in the first embodiment, and FIG. FIG. 7 is a flow chart of a top dead center interrupt in the first embodiment, FIG. 7 is a flow chart of a shift out interrupt in the first embodiment, FIG. 8 is a fuel injection pulse output pattern diagram from a port, and FIG. Is a configuration diagram of peripheral hardware in the second embodiment, FIG. 10 is a configuration diagram of a fuel injection control device in the second embodiment, and FIG. 11 is a configuration of a fuel injection control device in a conventional example. Fig. 12 and Fig. 12 show the peripheral hardware configuration in the conventional example. It is. 100,900 ... Free running timer, 101,102,103,10
4,107,901,902,903,904,907 …… Compare register, 10
5,905, 908 ... Capture register, 106 ... Timer, 1
08,910 …… Injector, 109,909 …… Bit selection register SR, 110,911 …… Photo sensor, 111,912 …… Angle sensor pulse generator, 112,913 …… Disk, 113,11
4,115,116,117,914,915,916,917,918 …… Match signal, 11
8,919 …… photodiode, 200,1000,1100 …… CPU,
201 ... ALU, 202 ... temporary register, 203 ... general-purpose register, 204 ... address buffer AB, 205 ... data bus, 206 ... μ address generator, 207 ... PC, 208 ... P
SW, 209 …… μROM, 210,1010,1110 …… Timing control block, 211,1011,1111 …… INTC, 212 …… Program memory, 213 …… Data memory, 214 …… Address bus, 215,
215-1, 215-2 ... Interrupt request flag, 216, 216-1, 2
16-2 ... Form designation flag, 217,217-1,217-2 ... Interrupt request clear signal, 218,218-1,218-2 ... Interrupt request signal, 219,219-1,219-2 ... Form change signal, 22
0,220-1,220-2 ... Form designation signal, 221,1021,1121 ...
… Peripheral hardware, 130,930 …… Clear signal, 906…
Event counter, 1200,1201,1202,1203 …… Down counter, 1204 …… Port register, 1205,1206,1207,120
8 ... borrow signal.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】命令の実行アドレスを保持するプログラム
カウンタ、プログラムの実行状態を保持する手段、高速
記憶手段およびマイクロプログラムROMを含む中央処理
装置と、前記中央処理装置へ非同期に処理要求を発生す
る割り込み要求発生回路と、プログラムメモリと、デー
タメモリと、周辺回路と、複数の燃料噴射器とを有する
燃料噴射制御装置に於いて、前記周辺回路は、第1のタ
イマと、前記第1のタイマとの比較を行う複数の比較レ
ジスタと、所定のタイミングで前記第1のタイマの値を
取込むキャプチャレジスタと、第2のタイマと、前記第
2のタイマとの比較を行う比較レジスタと、前記燃料噴
射器に接続するパルス発生用の複数の出力ポートと、該
出力ポートに対し選択的にセットパルスを発生する手段
と含んで構成され、前記割り込み要求発生回路は、所定
のデータ処理の要求を発生する手段と、前記所定のデー
タ処理の要求を識別するための形態維持手段とを備え、
且つ前記データメモリ内には前記所定のデータ処理の処
理形態を指定する処理形態情報が格納され、前記割り込
み要求発生回路から前記所定のデータ処理の要求が前記
中央処理装置に対して発生されると、前記中央処理装置
は前記形態指示手段が前記所定のデータ処理を指示して
いることを検知した場合には、命令実行処理を中断し、
前記処理形態情報に従い、前記第1の比較レジスタと、
前記キャプチャレジスタと、前記データメモリを操作す
ることで前記複数の出力ポートからパルスを発生させ前
記インジェクタを制御することを特徴とする燃料噴射制
御装置。
1. A central processing unit including a program counter for holding an execution address of an instruction, a unit for holding a program execution state, a high speed storage unit and a micro program ROM, and a processing request to the central processing unit asynchronously. In a fuel injection control device having an interrupt request generation circuit, a program memory, a data memory, a peripheral circuit, and a plurality of fuel injectors, the peripheral circuit includes a first timer and a first timer. A plurality of comparison registers for making a comparison with the second timer, a capture register for taking in the value of the first timer at a predetermined timing, a second timer, and a comparison register for making a comparison with the second timer; A plurality of pulse-generating output ports connected to the fuel injector, and means for selectively generating set pulses to the output ports, Serial interrupt request generation circuit comprises means for generating a request for predetermined data processing, and form maintaining means for identifying said request for predetermined data processing,
Further, processing form information designating a processing form of the predetermined data processing is stored in the data memory, and when the interrupt request generating circuit issues a request for the predetermined data processing to the central processing unit. When the central processing unit detects that the form instructing means is instructing the predetermined data processing, the central processing unit interrupts the instruction execution processing,
According to the processing form information, the first comparison register,
A fuel injection control device for controlling the injector by generating pulses from the plurality of output ports by operating the capture register and the data memory.
JP63291308A 1988-11-17 1988-11-17 Fuel injection control device Expired - Lifetime JPH076435B2 (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP63291308A JPH076435B2 (en) 1988-11-17 1988-11-17 Fuel injection control device
EP89121317A EP0369470B1 (en) 1988-11-17 1989-11-17 Data processing apparatus for producing in sequence pulses having variable width at output ports
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.
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
JP63291308A JPH076435B2 (en) 1988-11-17 1988-11-17 Fuel injection control device

Publications (2)

Publication Number Publication Date
JPH02136544A JPH02136544A (en) 1990-05-25
JPH076435B2 true JPH076435B2 (en) 1995-01-30

Family

ID=17767218

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63291308A Expired - Lifetime JPH076435B2 (en) 1988-11-17 1988-11-17 Fuel injection control device

Country Status (1)

Country Link
JP (1) JPH076435B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7479305B2 (en) * 2021-01-13 2024-05-08 株式会社今仙電機製作所 Reclining device
JP3236615U (en) * 2021-08-30 2022-03-04 時男 山海 Generator using solenoid and crank

Also Published As

Publication number Publication date
JPH02136544A (en) 1990-05-25

Similar Documents

Publication Publication Date Title
JPS6060024B2 (en) Engine control method
JP2000047883A (en) Task controlling method and storage medium
US5126944A (en) Data processing apparatus for producing in sequence pulses having variable width at output ports
JPS6158841B2 (en)
US7930523B2 (en) Inter-CPU data transfer device
JPS6352225B2 (en)
JP3323655B2 (en) Control processing device and one-chip microcomputer
JPS6245578B2 (en)
JPH076435B2 (en) Fuel injection control device
JPH07271408A (en) Processor for control
JP2731556B2 (en) Fuel injection control device
JP2903526B2 (en) Pulse generator
JPS6336521B2 (en)
JP3314458B2 (en) Microcomputer system
JP2536103B2 (en) Data processing device
JPS5895214A (en) Signal processing method for hot-wire flow rate sensor
JP2914580B2 (en) Event-driven vehicle control computer
JPH03226883A (en) Control processor
Rinolfi Engine control system with ultrasonic mass air flowmeter
Tomisawa et al. Trends in electronic engine control and development of optimum microcomputers
JPS608331B2 (en) Fuel control device for internal combustion engines
JP2536102B2 (en) Data processing device
JPH0744407A (en) Backup device for microcomputer
JPH0718373B2 (en) Electronic fuel injection control device
JPS6210453A (en) Internal combustion engine control device

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080130

Year of fee payment: 13

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090130

Year of fee payment: 14

EXPY Cancellation because of completion of term