JP2903526B2 - Pulse generator - Google Patents
Pulse generatorInfo
- Publication number
- JP2903526B2 JP2903526B2 JP33112788A JP33112788A JP2903526B2 JP 2903526 B2 JP2903526 B2 JP 2903526B2 JP 33112788 A JP33112788 A JP 33112788A JP 33112788 A JP33112788 A JP 33112788A JP 2903526 B2 JP2903526 B2 JP 2903526B2
- Authority
- JP
- Japan
- Prior art keywords
- fuel injection
- processing
- interrupt
- register
- cnt
- 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
Links
Landscapes
- Electrical Control Of Air Or Fuel Supplied To Internal-Combustion Engine (AREA)
Description
【発明の詳細な説明】 〔産業上の利用分野〕 本発明はパルス発生装置に関し、特に、自動車のエン
ジン制御における燃料噴射パルスを発生するためのパル
ス発生装置に関する。Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a pulse generator, and more particularly, to a pulse generator for generating a fuel injection pulse in an engine control of an automobile.
昨今、自動車のエンジン制御にマイクロコンピュータ
が数多く利用されている。エンジン制御の中で、最も中
心的な制御は燃料噴射制御であり、マイクロコンピュー
タは、吸入空気量やエンジン回転数から基準となる噴射
量を算出し、その基準値に対し、その時々の温度や排気
ガス中に含まれる酸素量などの測定値から求められる補
正係数を掛け、最適な燃料噴射量を噴射時間に換算し、
出力ポートを所望の噴射時間だけアクティブにすること
で各気筒に対する燃料噴射を行う。Recently, many microcomputers are used for controlling the engine of a vehicle. Among the engine controls, the most central control is fuel injection control, and the microcomputer calculates a reference injection amount based on the intake air amount and the engine speed. Multiplying by the correction coefficient obtained from the measured value such as the amount of oxygen contained in the exhaust gas, the optimal fuel injection amount is converted into the injection time,
By activating the output port for a desired injection time, fuel injection is performed for each cylinder.
通常、各気筒ごとに回転サイクルの特定の位置、例え
ば上死点または吸入開始タイミングを示す信号などを基
準信号とし、それを割込み信号としてマイクロコンピュ
ータは受付け、割込み処理プログラムで基準点からの燃
料噴射開始時間の設定をタイマなどのハードウェアを利
用して行う。そして、タイマからの割込み信号で起動さ
れる割込み処理プログラムで出力ポートをアクティブレ
ベルにし、その上で燃料噴射終了時間の設定を再度タイ
マを利用して行なう。次に、タイマからの割込み信号で
起動される割込み処理プログラムでは、出力ポートをイ
ンアクティブにし、燃料噴射を終了する。Normally, a specific position of a rotation cycle for each cylinder, for example, a signal indicating a top dead center or a suction start timing is used as a reference signal, which is accepted by the microcomputer as an interrupt signal, and the fuel injection from the reference point is performed by an interrupt processing program. The start time is set using hardware such as a timer. Then, the output port is set to the active level by the interrupt processing program started by the interrupt signal from the timer, and the fuel injection end time is set again using the timer. Next, in the interrupt processing program started by the interrupt signal from the timer, the output port is made inactive and the fuel injection ends.
第7図(a)および(b)は、4気筒エンジンの場合
の燃料噴射パルス発生パターン(横軸は時間)を示して
いる。図中の4本の出力ポートP0〜P3からは、気筒それ
ぞれに対応した時間帯において燃料噴射パルスが出力さ
れる。パルスの立上りが燃料噴射開始のタイミングを示
し、パルスの立下りが燃料噴射終了のタイミングを示し
ている。燃料噴射開始のタイミングより前に基準信号の
タイミングがあるが、これは第7図(a)および(b)
には示していない。また、パルスのハイレベル期間は燃
料噴射時間すなわち燃料噴射量を示し、ハイレベル期間
が長いほど燃料噴射量が多くなる。燃料噴射制御におけ
るパルス発生のパターンは、制御方法によつて様々な形
態を採るが、本例の場合は、個々の気筒ごとに独立に制
御をする方法で、最もきめの細かい制御が可能である。FIGS. 7A and 7B show a fuel injection pulse generation pattern (the horizontal axis is time) in the case of a four-cylinder engine. From four output ports P 0 to P 3 in FIG., The fuel injection pulse is output in the time period corresponding to each cylinder. The rising of the pulse indicates the timing of starting the fuel injection, and the falling of the pulse indicates the timing of ending the fuel injection. There is a reference signal timing before the fuel injection start timing, which is shown in FIGS. 7 (a) and 7 (b).
Not shown. The high level period of the pulse indicates the fuel injection time, that is, the fuel injection amount. The longer the high level period, the larger the fuel injection amount. The pattern of the pulse generation in the fuel injection control takes various forms depending on the control method, but in the case of this example, the finest control is possible by a method of controlling each cylinder independently. .
第7図(a)は、低速、一定速度走行時における燃料
噴射パルスのパターンで、各気筒に対するパルスの重な
りがない状態であり、第7図(b)は、急加速時におけ
る燃料噴射パルスのパターンで、各気筒に対するパルス
の重なりが発生する状態である。実際のパルスパターン
は、その時々の状態に応じて、これらの二つの例のラン
ダムな組合せとなり、出力ポートからのパルス発生制御
はより複雑となる。FIG. 7A shows a fuel injection pulse pattern when the vehicle is traveling at a low speed and a constant speed, and shows a state in which pulses do not overlap with each other. FIG. 7B shows a fuel injection pulse pattern during rapid acceleration. In this pattern, pulses are overlapped for each cylinder. The actual pulse pattern will be a random combination of these two examples, depending on the current state, and the control of pulse generation from the output port will be more complex.
以下、第8図および第9図を参照して、パルス発生装
置の従来例を説明する。Hereinafter, a conventional example of the pulse generator will be described with reference to FIG. 8 and FIG.
第8図は、前記従来例のシステム・ブロック図であ
る、本従来例は、データバス400およびアドレスバス401
に対応して、算術論理演算ユニット(以下、ALUと記
す)201、テンポラリレジスタ202、高速記憶手段として
作用する汎用レジスタ203、アドレスバッファ204(図に
おいては、ABとして表現されている)、マイクロアドレ
ス生成部(以下μアドレス生成部と記す)205、プログ
ラムカウンタ(以下PCと記す)206、プログラムの実行
状態を保持する手段(以下PSWと記す)207、マイクロプ
ログラムROM(以下μROMと記す)208およびタイミング
制御部209を含む中央処理装置(以下CPUと記す)200
と、割込み要求フラグ211を含む割込み要求発生回路
(以下INTCと記す)210と、プログラムメモリ212と、デ
ータメモリ213と、周辺ハードウェア214と、により構成
されている。なお、第8図においては、括弧内に略記さ
れている表示が示されている。FIG. 8 is a system block diagram of the conventional example. In this conventional example, a data bus 400 and an address bus 401 are shown.
In response to the above, an arithmetic and logic unit (hereinafter, referred to as ALU) 201, a temporary register 202, a general-purpose register 203 acting as high-speed storage means, an address buffer 204 (represented as AB in the figure), a micro address A generation unit (hereinafter, referred to as μ address generation unit) 205, a program counter (hereinafter, referred to as PC) 206, means for holding a program execution state (hereinafter, referred to as PSW) 207, a microprogram ROM (hereinafter, referred to as μROM) 208, Central processing unit (hereinafter referred to as CPU) 200 including timing control unit 209
, An interrupt request generation circuit (hereinafter referred to as INTC) 210 including an interrupt request flag 211, a program memory 212, a data memory 213, and peripheral hardware 214. In FIG. 8, a display abbreviated in parentheses is shown.
INTC 210は、外部のハードウェアから幾つかの割込み
信号を受付け、各割込みソースに割当てられた優先順位
を持つた割込みソースを一つ選択して、その割込みソー
スに対応した割込み要求フラグ211を設定する。割込み
要求フラグ211は、割込み要求がn個ある時にはn個設
定されているが、第8図においては、1例として、1個
だけの割込み要求フラグ211が記載されている。なお、
外部のハードウェアからの割込み信号および優先順位判
別部等は図示していない。The INTC 210 receives several interrupt signals from external hardware, selects one interrupt source with the priority assigned to each interrupt source, and sets the interrupt request flag 211 corresponding to that interrupt source. I do. When there are n interrupt requests, n interrupt request flags 211 are set. However, in FIG. 8, only one interrupt request flag 211 is described as an example. In addition,
An interrupt signal from external hardware, a priority determination unit, and the like are not shown.
従来から行なわれている割込み処理は、通常ベクタ割
込みと呼ばれ、メモリ空間中にベクタテーブル空間が予
め設定されて、この空間には、各割込みソースに対応し
た割込み処理プログラムのエントリアドレスが格納され
ている。ベクタ割込みが発生すると、割込みソースに対
応したエントリアドレスへ分岐される。Conventional interrupt processing is usually called vector interrupt, and a vector table space is preset in a memory space, and an entry address of an interrupt processing program corresponding to each interrupt source is stored in this space. ing. When a vector interrupt occurs, a branch is made to an entry address corresponding to the interrupt source.
第9図は、従来例における周辺ハードウェア214のブ
ロック図である。周辺ハードウェア214は、データバス4
00対応して、クロックをベースとしたフリーランニング
タイマ215、コンペアレジスタ216,218,219,220,および2
21、キャプチャレジスタ217、ポートレジスタ223ならび
にバッファ224を含むポート出力回路222、および出力ポ
ートP0〜P3により構成されている。FIG. 9 is a block diagram of the peripheral hardware 214 in the conventional example. The peripheral hardware 214 is connected to the data bus 4
00 corresponding to the clock-based free-running timer 215, compare registers 216, 218, 219, 220, and 2
21, is constituted by port output circuit 222, and an output port P 0 to P 3 comprises a capture register 217, the port register 223 and a buffer 224.
本例においては、基準信号による割込み処理プログラ
ムで、コンペアレジスタ216に燃料噴射開始タイミング
を指定する値が設定され、コンペアレジスタ216の一致
信号が、4気筒総てに対する燃料噴射開始タイミングを
与え、コンペアレジスタ218〜221からの一致信号が、そ
れぞれ出力ポートP0〜P3に対応する燃料噴射終了タイミ
ングを与えるように構成されている。In this example, in the interrupt processing program based on the reference signal, a value specifying the fuel injection start timing is set in the compare register 216, and the match signal in the compare register 216 gives the fuel injection start timing for all four cylinders, coincidence signal from the register 218 to 221 is configured to provide a fuel injection termination timing corresponding to the output ports P 0 to P 3, respectively.
なお、上記各コンペアレジスタからの一致信号は、そ
れぞれ、割込み要求ソース信号としてINTC 210に対して
出力されているが、第9図においては、前記一致信号は
INTとして表現されている。以下、INTで表現された信号
は、総て同様の意味を持つものとする。Note that the match signals from the respective compare registers are output to the INTC 210 as interrupt request source signals, respectively.
Expressed as INT. Hereinafter, all signals represented by INT have the same meaning.
以下において、コンペアレジスタ216には、基準信号
による割込み処理プログラムで、事前に出力ポートP0に
対応する燃料噴射タイミングを指定する値が設定されて
いるものとして、コンペアレジスタ216からの一致信号
が発生したところからの動作説明を行なう。In the following, the compare register 216, the interrupt processing program by the reference signal, as the value that specifies the fuel injection timing corresponding to the output ports P 0 in advance is set, the coincidence signal from the compare register 216 is generated The operation will be described from the point at which the operation is performed.
第8図において、通常の命令処理では、PC 206に格納
されたプログラムアドレスが、アドレスバッファ204に
転送され、アドレスバス401をドライブして、プログラ
ムメモリ212から次に実行すべき命令がフェッチされ
る。取込まれた命令はデータバス400を経由し、μアド
レス生成部205に転送される。μアドレス生成部205は、
転送されてくる命令コードからμROM 208のアドレスを
生成する。以降、μROM 208に格納されている前記命令
に対するμプログラムの指令に従い、汎用レジスタ20
3、ALU 201およびテンポラリレジスタ202等を操作する
ことにより、命令の処理が行なわれる。In FIG. 8, in the normal instruction processing, the program address stored in the PC 206 is transferred to the address buffer 204, the address bus 401 is driven, and the next instruction to be executed is fetched from the program memory 212. . The fetched instruction is transferred to the μ address generation unit 205 via the data bus 400. μ address generation section 205,
The address of the μROM 208 is generated from the transferred instruction code. Thereafter, according to the instruction of the μ program corresponding to the instruction stored in the μ ROM 208, the general-purpose register 20
3. Instruction processing is performed by operating the ALU 201, the temporary register 202, and the like.
INTC 210は、CPU 200における処理とは独立に、周辺
ハードウェア214から割込み要求が発生しているか否か
を絶えずサンプルし、要求が発生していれば要求を一つ
選択して、その要求ソースに対応する割込み要求フラグ
211を設定する。The INTC 210 continually samples whether or not an interrupt request has been issued from the peripheral hardware 214 independently of the processing in the CPU 200, and if a request has been issued, selects one request and sends a request to the request source. Interrupt request flag corresponding to
Set 211.
コンペアレジスタ216からの一致信号が発生すると、
キャプチャレジスタ217は、その時のフリーランニング
タイマ215の値を取込む。そして、コンペアレジスタ216
からの一致信号は、INTC 210に対して割込み要求を発生
し、INTC 210において、その割込み要求が受付けられて
割込み要求フラグ211が設定されると、割込み要求信号4
03がタイミング制御部209に出力される。When a match signal from compare register 216 is generated,
The capture register 217 captures the value of the free running timer 215 at that time. Then, the compare register 216
Generates an interrupt request to the INTC 210. When the INTC 210 receives the interrupt request and sets the interrupt request flag 211, the interrupt request signal 4
03 is output to the timing control unit 209.
μプログラムの最後の指令は、通常割込みが発生して
いるかいないかを検知するための指令で、この指令が出
ると、タイミング制御部209は、割込み要求信号403の有
無をサンプルする。割込み要求信号403がアクティブで
あれば、割込み要求クリア信号402をINTC 210に対して
出力し、割込み要求フラグ211をクリアする。The last command of the μ program is a command for normally detecting whether or not an interrupt has occurred. When this command is issued, the timing controller 209 samples the presence or absence of the interrupt request signal 403. If the interrupt request signal 403 is active, an interrupt request clear signal 402 is output to the INTC 210, and the interrupt request flag 211 is cleared.
次に、PC 206とPSW 207をスタックポインタ(CPU 200
中に設定されているレジスタであるが図示していない)
が指し示すスタック空間に退避させ、データメモリ213
中の特定のアドレスに設定されているベクタテーブルに
格納されている割込みソースに対応する割込み処理プロ
グラムのエントリアドレスを読出し、データバス400を
経由してPC 206に設定する。PC 206に新たに設定された
前記プログラムアドレスから、割込み処理プログラムは
実行を開始する。Next, the PC 206 and the PSW 207 are connected to the stack pointer (CPU 200
(The register is set inside but not shown)
Is saved in the stack space pointed to by the data memory 213.
The entry address of the interrupt processing program corresponding to the interrupt source stored in the vector table set at the specific address is read out, and set to the PC 206 via the data bus 400. The interrupt processing program starts executing from the program address newly set in the PC 206.
割込み処理プログラムでは、まず、ポートレジスタ22
3のビット0を“1"に設定することで、出力ポートP0か
らの出力パルスをハイレベルにし、出力ポートP0に対応
する気筒における燃料噴射パルス幅に相当するデータを
加算して、その結果をコンペアレジスタ218に転送す
る。In the interrupt processing program, first, the port register 22
By setting bit 0 of 3 to “1”, the output pulse from the output port P 0 is set to the high level, and data corresponding to the fuel injection pulse width in the cylinder corresponding to the output port P 0 is added. The result is transferred to compare register 218.
割込み処理プログラムを終了する命令の処理では、ス
タック空間に退避させてあつたPC値およびPSW値を、そ
れぞれPC206およびPSW207に復帰させることで、割込み
が発生した時点における次の命令からの処理を再開す
る。In the processing of the instruction that terminates the interrupt processing program, the PC value and PSW value saved in the stack space are returned to the PC 206 and PSW 207, respectively, so that processing from the next instruction at the time when the interrupt occurs is restarted. I do.
次に、通常の命令実行中に、燃料噴射終了タイミング
を示すコンペアレジスタ218からの一致信号が発生する
と、前述の説明と同様に、INTC 210が割込み要求を受付
け、割込み要求信号403がタイミング制御部209に対して
出力される。Next, when a coincidence signal from the compare register 218 indicating the fuel injection end timing is generated during the normal instruction execution, the INTC 210 accepts the interrupt request and the interrupt request signal 403 outputs the interrupt request signal 403 as described above. Output to 209.
μプログラムから、割込みが発生しているかいないか
を検知するための指令が発生すると、タイミング制御部
209は、割込み要求信号403の有無をサンプルする。割込
み要求信号403がアクティブであれば、割込み要求クリ
ア信号402をINTC 210に対して出力し、割込み要求フラ
グ211をクリアする。When a command is issued from the μ program to detect whether or not an interrupt has occurred, the timing controller
209 samples the presence or absence of the interrupt request signal 403. If the interrupt request signal 403 is active, an interrupt request clear signal 402 is output to the INTC 210, and the interrupt request flag 211 is cleared.
次に、PC 206およびPSW 207をスタック空間に退避さ
せ、データメモリ213中の特定のアドレスに設定されて
いるベクタテーブルに格納されている割込みソースに対
応する割込み処理プログラムのエントリアドレスに分岐
し、割込み処理プログラムは実行を開始する。Next, the PC 206 and the PSW 207 are evacuated to the stack space, and branch to an entry address of an interrupt processing program corresponding to an interrupt source stored in a vector table set at a specific address in the data memory 213, The interrupt processing program starts executing.
割込み処理プログラムは、出力ポートP0に対する燃料
噴射終了処理であるため、ポートレジスタ233のビット
0を“0"に設定することで、出力ポートP0からの出力パ
ルスをローレベルにし、対応する気筒に対する燃料噴射
を終了する。The interrupt processing program are the fuel injection termination processing for output ports P 0, by setting bit 0 of the port register 233 to "0", the output pulse from the output port P 0 to a low level, the corresponding cylinder Is terminated.
割込み処理プログラムを終了する命令の処理において
は、スタック空間に退避してあつたPC値およびPSW値
を、PC 206およびPSW 207に復帰させることで、割込み
が発生した時点における次の命令からの処理を再開す
る。同様の処理は、出力ポートP1からP3に対しても同様
に行なう。以上、自動車エンジン制御用のパルス発生装
置の1従来例について説明したが、従来の一般的なパル
ス発生装置の基本的な処理機能は、大凡上述の通りであ
る。In the processing of the instruction that terminates the interrupt processing program, the PC value and the PSW value saved in the stack space are returned to the PC 206 and the PSW 207, so that the processing from the next instruction when the interrupt occurs can be performed. Resume. Similar processing is performed similarly for P 3 from the output port P 1. As described above, one conventional example of the pulse generator for controlling the automobile engine has been described, but the basic processing functions of the conventional general pulse generator are almost as described above.
上述した従来のパルス発生装置においては、マイクロ
コンピュータは、燃料噴射パルス出力のための基準信号
を割込み信号として受付け、割込み処理プログラムによ
つて燃料噴射時間の設定などの制御を行なつている。こ
のため、エンジンの回転数が増し、基準信号の発生回数
が増えると、基準信号割込み、燃料噴射開始割込み、燃
料噴射終了割込みなどの割込み要求も多く発生し、その
際のPC値およびPSW値のスタックへの退避処理や、割込
み処理プログラムからメイン処理に戻る時に、スタック
の内容をPC 206およびPSW 207に復帰させる処理が頻繁
に発生し、退避および復帰に割かれるCPU時間が膨大な
時間になる。In the above-described conventional pulse generator, the microcomputer receives a reference signal for outputting a fuel injection pulse as an interrupt signal, and performs control such as setting of a fuel injection time by an interrupt processing program. For this reason, when the engine speed increases and the number of times the reference signal is generated increases, many interrupt requests such as a reference signal interrupt, a fuel injection start interrupt, and a fuel injection end interrupt occur, and the PC value and the PSW value at that time are also generated. When returning to the main process from an interrupt processing program or when saving to the stack, processing to restore the contents of the stack to the PC 206 and PSW 207 occurs frequently, resulting in a huge amount of CPU time dedicated to saving and restoring. .
また、一方、CPUは燃料噴射制御の他に点火時期制御
や、アイドル回転制御など種々雑多な仕事をも実行して
おり、エンジンの回転数が上がると、これらのメイン処
理に割かれるCPU時間が少なくなり、場合によつては、
全く対応できない処理が発生することも起こり得る。従
つて、昨今の高速回転、多気筒エンジン搭載の車種にお
けるマイクロコンピュータによるエンジン制御は、非常
に難しいものになつてきている。On the other hand, the CPU also performs various other tasks such as ignition timing control and idle rotation control in addition to fuel injection control, and when the engine speed increases, the CPU time allocated to these main processes is reduced. Less, and in some cases,
It is possible that processing that cannot be handled at all may occur. Accordingly, it has become very difficult to control the engine by a microcomputer in a vehicle model equipped with a high-speed rotation and a multi-cylinder engine these days.
また、最近のエンジン制御においては、排気ガス規制
や燃料費節減などの要求から、精度の高い燃料噴射制御
が必要となつており、燃料噴射開始タイミングおよび燃
料噴射終了タイミングを最小の誤差で制御でき、且つ各
気筒ごとに、それぞれ独立に制御することが必要になり
つつある。これらの要求に対して、従来からのソフトウ
ェア処理だけで制御する方法では、割込み要因が発生し
てから割込み処理プログラムが開始するまでの時間の遅
れや、出力ポートへのデータ書込み時間による遅れなど
が発生して、精度の高い制御が期待できない。精度の高
い制御を行なうためには、一連の処理サイクルよりも数
段に分解能が高く、且つ制御の許容誤差範囲内の信号を
ベースとした専用ハードウェアを装備し、ハードウェア
による直接制御を行なわなければならない。具体的に
は、クロック数をカウントアップするタイマ、ある事象
が発生した時にタイマの値を記憶するためのキャプチャ
レジスタ、タイマの所定の値と一致がとれたことを示す
コンペアレジスタなどの専用のハードウェアを必要とす
る。ここでキャプチャレジスタは、燃料噴射開始タイミ
ングを記憶するために利用し、コンペアレジスタは、燃
料噴射開始タイミングや終了タイミングを発生するため
に利用する。前述したように、出力ポートからの出力パ
ルスは、重なりあつたり、なかつたり様々なパターンを
とるため、ソフトウェアの介在なしに、燃料噴射開始タ
イミング用と終了タイミング用の2本のコンペアレジス
タだけで、4気筒に対応した制御はできない。従つて、
ハードウェアだけで制御するためには、4組のコンペア
レジスタが必要になり、ハードウェア量が多くなつて経
済的な負担となる。当然、気筒数が6個、8個と増えれ
ば、コンペアレジスタも6個、8組と増大し、特にシン
グルチップのように、CPUと周辺回路を単一基盤上に集
積する構成に適用すると負担が増大する。In recent engine control, high-precision fuel injection control is required due to requirements such as exhaust gas regulations and fuel cost reduction, and the fuel injection start timing and fuel injection end timing can be controlled with a minimum error. In addition, it is becoming necessary to control each cylinder independently. In the conventional method of controlling these requests only by software processing, there is a delay in the time between the occurrence of an interrupt factor and the start of the interrupt processing program, and a delay due to the time required to write data to the output port. Occurs and high-precision control cannot be expected. In order to perform high-precision control, dedicated hardware based on signals within several tolerances and higher resolution than a series of processing cycles and with direct control by hardware is provided. There must be. Specifically, a dedicated hardware such as a timer for counting up the number of clocks, a capture register for storing the value of the timer when an event occurs, and a compare register for indicating that a predetermined value of the timer has been matched is obtained. Requires hardware. Here, the capture register is used to store fuel injection start timing, and the compare register is used to generate fuel injection start timing and end timing. As described above, since the output pulses from the output port take various patterns, overlapping and losing, there is no software intervention and only two compare registers for the fuel injection start timing and the end timing are used. Control corresponding to four cylinders cannot be performed. Therefore,
In order to control only by hardware, four sets of compare registers are required, and the amount of hardware is increased, resulting in an economic burden. Naturally, if the number of cylinders increases to six or eight, the number of compare registers also increases to six or eight. Especially when applied to a configuration in which a CPU and peripheral circuits are integrated on a single board, such as a single chip. Increase.
基準信号燃料噴射開始タイミングの関係に於いては、
必ず気筒(n)の燃料噴射開始タイミングよりも、気筒
(n+1)に対する基準信号が時間的に後にくるように
基準信号を選択すれば、第9図に示したように、キャプ
チャレジスタと燃料噴射開始タイミングを発生するコン
ペアレジスタだけは1本ずつの構成で良いが、気筒
(n)の燃料噴射終了タイミングよりも、気筒(n+
1)の燃料噴射開始タイミングが時間的に先にくる場合
があることを考慮すると、燃料噴射終了タイミングを与
えるコンペアレジスタは、気筒数分装備しなければなら
ず、やはりハードウェア量の増大を招く結果となる。In relation to the reference signal fuel injection start timing,
If the reference signal is selected such that the reference signal for the cylinder (n + 1) always comes later than the fuel injection start timing for the cylinder (n), as shown in FIG. 9, the capture register and the fuel injection start are started. Although only one compare register for generating the timing may be used, the cylinder (n +) may be arranged at a timing shorter than the fuel injection end timing of the cylinder (n).
In consideration of the fact that the fuel injection start timing of 1) may come earlier in time, the compare registers that provide the fuel injection end timing must be provided for the number of cylinders, which also increases the amount of hardware. Results.
すなわち、従来のパルス発生回路は、最近の自動車エ
ンジン制御の高精度化に対応するためには、一連の制御
処理サイクルよりも数段分解能が高く、且つ制御精度上
の許容誤差範囲内の信号をベースとした専用ハードウェ
アを増設して、ハードウェアによる直接制御を行なわな
ければならない。従つて、上記専用ハードウェアを含む
ハードウェア量が顕著に増大するという欠点がある。That is, in order to respond to the recent increase in the accuracy of automobile engine control, the conventional pulse generation circuit generates a signal having a higher resolution than a series of control processing cycles and within an allowable error range in control accuracy. It is necessary to add dedicated hardware as a base and directly control the hardware. Therefore, there is a disadvantage that the amount of hardware including the dedicated hardware is significantly increased.
本発明のパルス発生回路は、CPUを用いた自動車エン
ジン制御用のパルス発生装置において、前記CPUに対し
て非同期の割込み処理の要求を発生するとともに、所定
のデータ処理の要求をも発生する手段と、前記割込み処
理の要求と前記所定のデータ処理の要求とを識別するた
めの形態指示手段と、を含むINTCと、所要のデータとと
もに、前記所定のデータ処理の処理形態を指定する処理
形態情報をも併せて格納するデータメモリと、フリーラ
ンニングタイマと、燃料噴射終了タイミング決定のため
に所定のタイミングで前記フリーランニングタイマの値
を取込むキャプチャレジスタと、前記フリーランニング
タイマの値が所定の値と一致したときに燃料噴射開始タ
イミング及び終了タイミングを発生する一対のコンペア
レジスタと、エンジン制御のための燃料噴射パルスを出
力する複数の出力ポートと、燃料噴射パルスを発生すべ
きポートを選択する第1のビット選択レジスタ及び第1
の制御回路と、燃料噴射パルスの発生を停止すべきポー
トを選択する第2のビット選択レジスタ及び第2の制御
回路と、を含む周辺ハードウェアとを備え、前記CPU
は、命令の実行アドレスを保持するPCと、プログラムの
実行状態を保持する段と、高速記憶手段と、μROMとを
含み、前記INTCから前記所定のデータ処理の要求が発生
され、前記形態指示手段において前記所定のデータ処理
を指示していることが検知された場合には、前記PCの内
容及び前記プログラムの実行状態を保持する手段の内容
を保持したまま命令実行処理を中断し、前記処理形態情
報に従い、前記μROMの所定アドレスに格納されたマイ
クロプログラム指令を実行して、前記一対のコンペアレ
ジスタと前記キャプチャレジスタと前記データメモリと
を操作することにより、前記複数の出力ポートから出力
される自動車エンジン制御用の燃料噴射パルスを制御す
ることを特徴とする。A pulse generation circuit according to the present invention, in a pulse generation device for controlling an automobile engine using a CPU, means for generating a request for asynchronous interrupt processing to the CPU and also generating a request for predetermined data processing. An INTC including a request for interrupt processing and a request for the predetermined data processing, and a processing mode information for specifying a processing mode of the predetermined data processing together with required data. A data register that also stores the data, a free-running timer, a capture register that captures the value of the free-running timer at a predetermined timing to determine the fuel injection end timing, and that the value of the free-running timer is a predetermined value. A pair of compare registers for generating fuel injection start timing and end timing when they match, and engine control Output ports for outputting fuel injection pulses, a first bit selection register for selecting a port for generating fuel injection pulses, and a first bit selection register.
A peripheral circuit including a control circuit, a second bit selection register for selecting a port to stop generating fuel injection pulses, and a second control circuit;
Includes a PC for holding an execution address of an instruction, a stage for holding an execution state of a program, a high-speed storage unit, and a μROM, wherein a request for the predetermined data processing is generated from the INTC, When it is detected that the instruction of the predetermined data processing is given, the instruction execution processing is interrupted while retaining the contents of the PC and the contents of the means for retaining the execution state of the program. A vehicle output from the plurality of output ports by executing a microprogram command stored at a predetermined address of the μROM according to information and operating the pair of compare registers, the capture registers, and the data memory. The fuel injection pulse for engine control is controlled.
次に、本発明について図面を参照して説明する。第1
図は、本発明の第1の実施例のシステム・ブロック図、
第2図は、前記第1の実施例における周辺ハードウェア
のブロック図である。Next, the present invention will be described with reference to the drawings. First
FIG. 1 is a system block diagram of a first embodiment of the present invention;
FIG. 2 is a block diagram of peripheral hardware in the first embodiment.
第1図に示されるように、前記第1の実施例は、デー
タバス300およびアドレスバス301に対応して、ALU 10
1、テンポラリレジスタ102、汎用レジスタ103、アドレ
スバッファ104、μアドレス生成部105、PC 106、PSW 10
7、μROM 108およびタイミング制御部109を含むCPU 100
と、割込み要求フラグ111および形態指定フラグ112を含
むINTC 110と、プログラムメモリ113と、データメモリ1
14と、周辺ハードウェア115とを備えて構成されてい
る。As shown in FIG. 1, the first embodiment has an ALU 10 corresponding to the data bus 300 and the address bus 301.
1, temporary register 102, general-purpose register 103, address buffer 104, μ address generator 105, PC 106, PSW 10
7, CPU 100 including μROM 108 and timing control unit 109
, An INTC 110 including an interrupt request flag 111 and a form designation flag 112, a program memory 113, and a data memory 1
14 and peripheral hardware 115.
また、第2図に示されるように、周辺ハードウェア11
5は、フリーランニングタイマ116と、コンペアレジスタ
(図中にCOMP 1と記載)117およびコンペアレジスタ
(図中にCOMP 2と記載)119と、キャプチャレジスタ
(図中にCAPと記載)118と、ビット選択レジスタ(SR)
120と、ビット選択レジスタ(RR)121と、それぞれ4個
のANDゲート124を含む制御回路122,123と、4個の出力
ポートP0〜P3に対しそれぞれ対応する4個のRSフリップ
フロップ126ならびにバッファ127を含むポート出力回路
125と、を備えている。In addition, as shown in FIG.
5 is a free-running timer 116, a compare register (described as COMP 1 in the figure) 117 and a compare register (described as COMP 2 in the figure) 119, a capture register (described as CAP in the figure) 118, a bit Select register (SR)
120, a bit selection register (RR) 121, a control circuit 122 and 123 respectively including four AND gates 124, four RS flip-flop 126 and buffers respectively corresponding to the four output ports P 0 to P 3 Port output circuit including 127
125 and.
INTC 110は、外部のハードウェアから幾つかの割込み
信号を受付け、各割込み要求ソースに割当てられた優先
順位を判別し、最も高い優先順位をもつた割込みソース
を一つ選択して、その割込みソースに対応した割込み要
求フラグ111をセットする。割込み要求フラグ111と形態
指定フラグ112は、割込み要求がn個あるときに、それ
ぞれn個設定されているが、説明を簡略にするために、
図中には1組だけが記載されている。また、外部のハー
ドウェアからの割込み信号や、優先順位判別部などは、
本発明の趣旨に直接に関係がないため特に図示していな
い。The INTC 110 receives several interrupt signals from external hardware, determines the priority assigned to each interrupt request source, selects one interrupt source having the highest priority, and selects the interrupt source. Is set to the interrupt request flag 111 corresponding to. When there are n interrupt requests, n interrupt request flags 111 and mode designation flags 112 are set respectively. However, in order to simplify the description,
Only one set is shown in the figure. In addition, an interrupt signal from external hardware, a priority determination unit, etc.
It is not particularly shown because it has no direct bearing on the gist of the present invention.
INTC 110からの割込み要求を、CPU 100は二通りの形
態で処理することができる。一つは、従来から行なわれ
ているベクタ割込み処理であり、もう一つは、本発明の
特徴である処理形態で、割込み要求が発生すると、ベク
タテーブルを参照せずに、データメモリ114の中の特定
アドレスに予め設定されている処理形態情報に基づき、
所定のデータ処理を実行する処理形態である。以下、こ
の所定のデータ処理のことをマクロサービスと記す。な
お、上記の二つの処理形態の区分につき、ベクタ割込み
かマクロサービスかの指定は、形態指定フラグ112で行
なうが、CPU 100から、形態指定フラグ112に“0"が指定
されている時にはベクタ割込みとして指定され、“1"が
指定されている時にはマクロサービスとして指定され
る。The CPU 100 can process an interrupt request from the INTC 110 in two forms. One is a conventional vector interrupt processing, and the other is a processing mode which is a feature of the present invention. When an interrupt request is generated, the data memory 114 is stored in the data memory 114 without referring to the vector table. Based on the processing mode information set in advance for the specific address of
This is a processing mode for executing predetermined data processing. Hereinafter, this predetermined data processing is referred to as a macro service. For the above two processing modes, whether the vector interrupt or the macro service is specified is specified by the mode specifying flag 112. When the CPU 100 specifies “0” in the mode specifying flag 112, the vector interrupt or the macro service is specified. When "1" is specified, it is specified as a macro service.
次に、本発明のマクロサービスの処理形態を指定する
処理形態情報について説明する。第3図は、マクロサー
ビスの処理形態情報構成例を示す図、第4図は、第1の
実施例におけるマクロサービス処理フローチャートを示
す図である。Next, processing mode information for specifying the processing mode of the macro service of the present invention will be described. FIG. 3 is a diagram showing an example of a processing configuration information configuration of a macro service, and FIG. 4 is a diagram showing a macro service processing flowchart in the first embodiment.
処理形態情報はデータメモリ114の中の特定のアドレ
スに配置され、本実施例の処理形態情報は、マクロサー
ビスモードとチャネルポインタ(第3図中にPTRと記
載)を有する2バイトのヘッダ部と、前記チャネルポイ
ンタによつて指し示される13バイトのマクロサービスチ
ャネルによつて構成される。本実施例のマクロサービス
チャネルは、4気筒の燃料噴射制御を想定した構成とな
つており、初期カウンタ(第3図中にINITと記載)、燃
料噴射パルス幅を指定するリセットデータ、一時的に燃
料噴射パルス幅を記憶するワードバッファ(P0〜P
3用)、前記ワードバッファに対する書込み位置を示す
ライトカウンタ(第3図中にWR CNT.と記載)、および
前記ワードバッファからの読出し位置を示すリードカウ
ンタ(第3図中にRD CNT.と記載)から構成されてい
る。The processing mode information is arranged at a specific address in the data memory 114. The processing mode information of this embodiment includes a macro service mode and a 2-byte header section having a channel pointer (denoted as PTR in FIG. 3). , A 13-byte macro service channel pointed to by the channel pointer. The macro service channel of the present embodiment has a configuration assuming fuel injection control of four cylinders, and includes an initial counter (described as INIT in FIG. 3), reset data for specifying the fuel injection pulse width, and temporary Word buffer (P 0 to P
3 ), a write counter indicating the write position to the word buffer (described as WR CNT. In FIG. 3), and a read counter indicating the read position from the word buffer (described as RD CNT. In FIG. 3). ).
コンペアレジスタ117には、燃料噴射制御に於ける基
準信号から燃料噴射開始タイミングまでの変位を示すデ
ータが、CPU 100によつて格納される。データの設定タ
イミングは、基準信号が割込みを発生した時点におい
て、割込み処理プログラムによつて設定が行なわれる。
従来例にて述べたように、本実施例では、1本のコンペ
アレジスタ117だけで、複数の気筒に対して燃料噴射開
始タイミングを与えるための基準信号の選択を行なつて
いる。In the compare register 117, data indicating a displacement from a reference signal in fuel injection control to a fuel injection start timing is stored by the CPU 100. The data setting timing is set by an interrupt processing program when the reference signal generates an interrupt.
As described in the conventional example, in the present embodiment, a reference signal for giving a fuel injection start timing to a plurality of cylinders is selected by only one compare register 117.
本実施例のマクロサービスは、コンペアレジスタ117
からの一致信号307と、コンペアレジスタ119からの一致
信号308によつて起動される。マクロサービスが起動さ
れる以前に、CPU 100は、マクロサービスチャネルやハ
ードウェアに対して初期化を行なう。マクロサービスチ
ャネルのINIT、WR CNT.およびRD CNT.には、4気筒の時
には4を設定しておく。また、ビット選択レジスタ(S
R)120とビット選択レジスタ(RR)121には、最初に燃
料噴射パルスを出力すべき出力ポートがP0であることを
指定するために、出力ポートP0に対応するビットだけを
“1"に、それ以外については“0"に設定しておく。The macro service according to the present embodiment includes a compare register 117.
And a match signal 308 from the compare register 119. Before the macro service is activated, the CPU 100 initializes a macro service channel and hardware. The macro service channel INIT, WR CNT., And RD CNT. Are set to 4 in the case of four cylinders. The bit selection register (S
To R) 120 and bit selection register (RR) 121, first to the output port should output a fuel injection pulse to specify that the P 0, bit only corresponding to the output ports P 0 "1" Otherwise, it is set to “0”.
以下に、第7図(a)および(b)に示される燃料噴
射パルスパターンに対応して、マクロサービスについて
の説明を行なう。The macro service will be described below in accordance with the fuel injection pulse patterns shown in FIGS. 7 (a) and 7 (b).
第7図(a)に示される燃料噴射パルスパターンの場
合には、最初に、コンペアレジスタ117からの一致信号3
07が発生すると、ビット選択レジスタSR 120の初期値か
ら、出力ポートP0に対応するRSフリップフロップ126だ
けがセットされ、出力ポートP0からの出力レベルがハイ
レベルになり、気筒0に対する燃料噴射が開始される。
同時に、一致信号307によつて、フリーランニングタイ
マ116の値はキャプチャレジスタ118に格納される。ま
た、一致信号307は、割込み要求をINTC 110に対して発
生する。INTC 110が、データバス300を介して一致信号3
07を受付けると、このソースに対応する割込み要求フラ
グ111をセットし、割込み要求信号303をアクティブにす
る。タイミング制御部109は、命令処理の終りにおいて
割込み要求信号303をサンプルするが、割込み要求信号3
03がアクティブであるため、形態指定信号305をサンプ
ルする。形態指定信号305がマクロサービスを示す“1"
であることを検知すると、PC 106およびPSW 107を保持
したまま、μROM 108のマクロサービス処理エントリア
ドレスを生成し、マクロサービスを開始する。以降、マ
イクロサービスのμプログラム指定に従つてマクロサー
ビス処理が実行される。In the case of the fuel injection pulse pattern shown in FIG. 7A, first, the match signal 3 from the compare register 117 is output.
When 07 occurs, only the RS flip-flop 126 corresponding to the output port P 0 is set from the initial value of the bit selection register SR 120, the output level from the output port P 0 becomes high, and the fuel injection to the cylinder 0 is performed. Is started.
At the same time, the value of the free running timer 116 is stored in the capture register 118 by the coincidence signal 307. The match signal 307 generates an interrupt request to the INTC 110. INTC 110 provides match signal 3 via data bus 300
When 07 is accepted, the interrupt request flag 111 corresponding to this source is set, and the interrupt request signal 303 is activated. The timing control unit 109 samples the interrupt request signal 303 at the end of the instruction processing.
Since 03 is active, the configuration specifying signal 305 is sampled. “1” indicating that the form designation signal 305 indicates a macro service
Is detected, the macro service processing entry address of the μROM 108 is generated while holding the PC 106 and the PSW 107, and the macro service is started. Thereafter, the macro service processing is executed according to the specification of the μ program of the micro service.
以下、μプログラム指令による処理フローについて、
第4図のフローチャートを用いて説明する。Hereinafter, regarding the processing flow by the μ program command,
This will be described with reference to the flowchart of FIG.
最初に、一致信号307を割込みソースとするマクロサ
ービスのヘッダを、データメモリ114の中の特定アドレ
スから読出す。この場合のマクロサービスモードは事前
にM1(モードの名称)に設定しておく。マクロサービス
モードがM1の時には、WR CNT.とRD CNT.の比較を行な
う。First, a macro service header using the coincidence signal 307 as an interrupt source is read from a specific address in the data memory 114. In this case, the macro service mode is set to M1 (mode name) in advance. When the macro service mode is M1, the WR CNT. And RD CNT. Are compared.
上記のWR CNT.とRD CNT.は、共に初期値が4であるた
め、キャプチャレジスタ118の内容と、マクロサービス
チャネルの中のリセットデータを、ALU 101を利用して
加算し、その結果をコンペアレジスタ119に格納する。
リセットデータは、CPU100によつて絶えず更新されてお
り、マクロサービスは、最新の燃料噴射時間であるとこ
ろのリセットデータを利用することになる。Since both WR CNT. And RD CNT. Have an initial value of 4, the contents of the capture register 118 and the reset data in the macro service channel are added using the ALU 101, and the result is compared. It is stored in the register 119.
The reset data is constantly updated by the CPU 100, and the macro service will use the reset data which is the latest fuel injection time.
次に、WR CNT.を1デクリメントして3とする。WR CN
T.は0でないからビット選択レジスタ(SR)120の左シ
フト処理を実行し、出力ポートP1に相当するビットだけ
1にセットする。この場合にはシフトアウトが発生しな
いため、タイミング制御部109は、割込み要求クリア信
号302をINTC 110に対して出力し、割込み要求フラグ111
をリセットして、マクロサービス処理を終了する。マク
ロサービス処理が終了すると、タイミング制御部109
は、保持していたPC 106およびPSW 107の値から通常の
命令処理を再開する。Next, WR CNT. Is decremented by 1 to 3. WR CN
T. performs left shift processing because non-zero bit selection register (SR) 120, and sets only one bit corresponding to the output port P 1. In this case, since no shift-out occurs, the timing control unit 109 outputs the interrupt request clear signal 302 to the INTC 110, and outputs the interrupt request flag 111
Is reset, and the macro service process ends. When the macro service processing ends, the timing control unit 109
Resumes normal instruction processing from the values of PC 106 and PSW 107 held.
第7図(a)のパルスパターンの場合には、パルスの
重なりがないことから、次にコンペアレジスタ119から
の一致信号308が発生する。ビット選択レジスタ(RR)1
21は、出力ポートP0に対応するビットだけが1で、その
他の出力ポートに対応するビットが0であるため、出力
ポートP0のRSフリップフロップ126だけがリセットさ
れ、気筒0に対する燃料噴射は終了する。上記の一致信
号308は、INTC 110に対して割込み要求を発生する。In the case of the pulse pattern shown in FIG. 7A, since there is no overlap of the pulses, a coincidence signal 308 from the compare register 119 is generated next. Bit select register (RR) 1
In 21, only the bit corresponding to the output port P 0 is 1 and the bits corresponding to the other output ports are 0, so only the RS flip-flop 126 of the output port P 0 is reset, and the fuel injection to the cylinder 0 is not performed. finish. The match signal 308 generates an interrupt request to the INTC 110.
INTC 110は、この一致信号308の割込み要求を受付け
ると、このソースに対応する割込み要求フラグ111をセ
ットし、割込み要求信号303をアクティブにする。タイ
ミング制御部109は、命令処理の終りにおいて割込み要
求信号303をサンプルするが、割込み要求信号303がアク
ティブであるため、形態指定信号305をサンプルする。
この結果、形態指定信号305がマクロサービスを示す
“1"であることを検知すると、PC 106およびPSW 107を
保持したままμROM 108のマクロサービス処理エントリ
アドレスを生成し、マクロサービス処理を開始する。When receiving the interrupt request of the coincidence signal 308, the INTC 110 sets the interrupt request flag 111 corresponding to the source and activates the interrupt request signal 303. The timing control unit 109 samples the interrupt request signal 303 at the end of the instruction processing, but samples the configuration designation signal 305 because the interrupt request signal 303 is active.
As a result, when detecting that the form designation signal 305 is “1” indicating the macro service, the macro service processing entry address of the μROM 108 is generated while holding the PC 106 and the PSW 107, and the macro service processing is started.
マクロサービス処理においては、最初に、一致信号30
8を割込みソースとするマクロサービスのヘッダを、デ
ータメモリ114の中の特定アドレスから読出す。この特
定アドレスは、前述の一致信号307に対応するアドレス
とは異なるアドレスが割当てられている。また、マクロ
サービスモードは、事前にM2(モードの名称)に設定
し、且つチャネルポインタは、一致信号307に対応する
マクロサービスチャネルを指し示している。In the macro service processing, first, the match signal 30
The header of the macro service using 8 as an interrupt source is read from a specific address in the data memory 114. As the specific address, an address different from the address corresponding to the above-described match signal 307 is assigned. The macro service mode is set to M2 (name of mode) in advance, and the channel pointer points to the macro service channel corresponding to the coincidence signal 307.
マクロサービスモードがM2の時は、RD CNT.の1デク
リメントを行ない3にする。RD CNT.は0ではないため
次の処理に進み、RD CNT.が上述のように3で、WD CNT.
も燃料噴射開始タイミング側のマクロサービスの処理で
3となつているため、RD CNT.=WR CNT.となり、次の処
理に進む。When the macro service mode is M2, RD CNT. Is decremented by 1 and set to 3. Since RD CNT. Is not 0, proceed to the next processing, and RD CNT. Is 3 as described above, and WD CNT.
Also, since the macro service processing on the fuel injection start timing side has reached 3, RD CNT. = WR CNT., And the process proceeds to the next processing.
ビット選択レジスタ(RR)121の左シフト処理で、出
力ポートP1に対するビットだけが1となり、その他のビ
ットは0となる。従つてシフトアウトが発生しないた
め、タイミング制御部109は、割込み要求クリア信号302
をINTC 110に対して出力し、割込み要求フラグ111をリ
セットしてマクロサービス処理を終了する。マクロサー
ビス処理が終了すれば、タイミング制御部109は、保持
していたPC 106およびPSW 107の値から通常の命令処理
を再開する。以上の処理を、出力ポートP0からP3まで全
く同様に繰返す。In the left-shift processing of the bit selection register (RR) 121, output port P 1 only bit for the 1, and the other bits zero. Accordingly, since no shift-out occurs, the timing control unit 109 outputs the interrupt request clear signal 302
Is output to the INTC 110, the interrupt request flag 111 is reset, and the macro service processing ends. When the macro service processing is completed, the timing control unit 109 restarts the normal instruction processing from the values of the PC 106 and the PSW 107 held. The above processing is repeated exactly as from the output port P 0 to P 3.
出力ポートP3に対する燃料噴射開始タイミングによつ
て起動されるマクロサービスにおいては、同様にマクロ
サービスモードがM1であるため、WR CNT.とRD CNT.との
比較を行なう。この場合、WR CNT.およびRD CNT.が共に
1であるため、キャプチャレジスタ118の内容と、マク
ロサービスチャネルの中のリセットデータをALU 101を
利用して加算し、その結果をコンペアレジスタ119に格
納する。In the macro service is by connexion start the fuel injection start timing for the output port P 3, similarly for the macro service mode is M1, is compared with WR CNT. And RD CNT.. In this case, since both WR CNT. And RD CNT. Are 1, the contents of the capture register 118 and the reset data in the macro service channel are added using the ALU 101, and the result is stored in the compare register 119. I do.
次に、WR CNT.を1デクリメントして0にする。WR CN
T.が0となるため、INITの値4をWR CNT.に再設定す
る。次いでビット選択レジスタSR 120の左シフト処理を
実行すると、ビット選択レジスタ(SR)120からのシフ
トアウトが発生するため、タイミング制御部109は、形
態変更信号304をINTC 110に対して出力し、形態指定フ
ラグ112をリセットする。Next, WR CNT. Is decremented by 1 to 0. WR CN
Since T. becomes 0, the value 4 of INIT is reset to WR CNT. Next, when the left shift process of the bit selection register SR 120 is performed, a shift-out from the bit selection register (SR) 120 occurs. Therefore, the timing control unit 109 outputs the configuration change signal 304 to the INTC 110, The designated flag 112 is reset.
INTC 110は、割込み要求フラグ111がセット状態にあ
り、形態指定フラグ112がリセット状態であるため、こ
の場合には通常のベクタ割込み要求をCPU 100に対して
発生し、以下、前述したベクタ割込み処理を実行する。
割込み処理プログラムは、4気筒が一巡したところで起
動され、ビット選択レジスタ(SR)120を初期状態に再
設定し、出力ポートP0からの燃料噴射パルス出力に備え
る。Since the interrupt request flag 111 is in the set state and the mode designation flag 112 is in the reset state, the INTC 110 issues a normal vector interrupt request to the CPU 100 in this case. Execute
The interrupt processing program is activated at the 4-cylinder is round, reconfigure the bit selection register (SR) 120 to the initial state comprises a fuel injection pulse output from the output port P 0.
次に、出力ポートP3に対する燃料噴射終了タイミング
によつて起動されるマクロサービスにおいては、マクロ
サービスモードがM2であるため、RD CNT.の1デクリメ
ントを行ない0にする。RD CNT.が0となるため、RD CN
T.にINITの値4を設定する。RD CNT.が4で、WR CNT.も
燃料噴射開始タイミング側のマクロサービス処理で4と
なつているためWR CNT.=RD CNT.となり、次の処理に進
む。Next, the macro service is by connexion start the fuel injection end timing with respect to the output port P 3, since the macro service mode is M2, to 0 performs 1 decremented RD CNT.. Since RD CNT. Becomes 0, RD CN
Set INIT value 4 to T. Since RD CNT. Is 4, and WR CNT. Is also 4 in the macro service processing on the fuel injection start timing side, WR CNT. = RD CNT., And the process proceeds to the next processing.
ビット選択レジスタ(RR)121の左シフト処理により
シフトアウトが発生するため、タイミング制御部109
は、形態変更信号304をINTC 110に対して出力し、形態
指定フラグ112をリセットする。Since shift-out occurs due to the left shift processing of the bit selection register (RR) 121, the timing control unit 109
Outputs the form change signal 304 to the INTC 110 and resets the form designation flag 112.
INTC 110は、割込み要求フラグ111がセット状態にあ
り、形態指定フラグ112がリセット状態にあるため、こ
の場合には、通常のベクタ割込み処理要求をCPU 100に
対して発生し、以下前述したベクタ割込み処理を実行す
る。燃料噴射終了タイミングで起動される割込み処理プ
ログラムも、4気筒が一巡したところで起動されること
になり、ビット選択レジスタ(RR)121を初期状態に再
設定し、出力ポートP0からの燃料噴射パルス出力に備え
る。Since the interrupt request flag 111 is in the set state and the mode designation flag 112 is in the reset state, the INTC 110 issues a normal vector interrupt processing request to the CPU 100 in this case. Execute the process. The interrupt processing program is started in the fuel injection end timing is also would be activated at the 4-cylinder is round, reconfigure the bit selection register (RR) 121 to the initial state, the fuel injection pulse from the output port P 0 Prepare for output.
次に、第7図(b)に示される燃料噴射パルスパター
ンの場合には、最初にコンペアレジスタ117からの一致
信号307が発生し、出力ポートP0に対応するRSフリップ
フロップ126だけが設定され、出力ポートP0からの出力
パルスがハイレベルになつて、気筒0に対する燃料噴射
が開始される。また、一致信号307が割込み要求をINTC
110に対して発生し、マクロサービスを開始する。ここ
までの処理手順は、前述した第7図(a)の場合と全く
同様である。Then, when the fuel injection pulse pattern shown in FIG. 7 (b), the first coincidence signal 307 from the compare register 117 is generated, only the RS flip-flop 126 corresponding to the output ports P 0 is set , such an output pulse is high level from the output port P 0 connexion, fuel injection for the cylinder 0 is started. Also, the match signal 307 sets the interrupt request to INTC
Occurs for 110 and starts the macro service. The processing procedure up to this point is exactly the same as in the case of FIG. 7A described above.
この場合においても、マクロサービスモードがM1であ
るため、WR CNT.とRD CNT.の比較を行なう。WR CNT.とR
D CNT.は共に初期値が4であるため、キャプチャレジス
タ118の内容とマクロサービスチャネル中のリセットデ
ータを、ALU 101を利用して加算し、その結果をコンペ
アレジスタ119に格納する。Also in this case, since the macro service mode is M1, the WR CNT. Is compared with the RD CNT. WR CNT. And R
Since both D CNT. Have an initial value of 4, the contents of the capture register 118 and the reset data in the macro service channel are added using the ALU 101, and the result is stored in the compare register 119.
次に、WR CNT.を1デクリメントし3にする。WR CNT.
は0でないからビット選択レジスタ(SR)120の左シフ
ト処理を実行し、出力ポートP1に相応するビットだけを
1にセットする。この場合にはシフトアウトが発生しな
いため、タイミング制御部109は、割込み要求クリア信
号302をINTC 110に対して出力し、割込み要求フラグ111
をリセットしてマクロサービスを終了する。マクロサー
ビスが終了すれば、タイミング制御部109は、保持して
いたPC 106およびPSW 107の値から、通常の命令処理を
再開して実行する。Next, WR CNT. Is decremented by 1 to 3. WR CNT.
Performs a left shift processing because non-zero bit selection register (SR) 120, and sets only one bit corresponding to the output port P 1. In this case, since no shift-out occurs, the timing control unit 109 outputs the interrupt request clear signal 302 to the INTC 110, and outputs the interrupt request flag 111
Reset to end macro service. When the macro service ends, the timing control unit 109 restarts and executes normal instruction processing from the values of the PC 106 and the PSW 107 held.
第7図(b)のパルスパターンの場合には、パルスの
重なりがあり、コンペアレジスタ119からの一致信号308
が発生する前に、再度コンペアレジスタ117からの一致
信号307が発生する。この時には、出力ポートP1に対応
するRSフリップフロップ126のみがセットされ、出力ポ
ートP1からの出力パルスがハイレベルになり、気筒1に
対する燃料噴射が開始され、気筒0と気筒1の双方とも
に燃料噴射が行なわれることになる。In the case of the pulse pattern shown in FIG. 7B, there is a pulse overlap, and the match signal 308 from the compare register 119 is output.
Occurs, the match signal 307 from the compare register 117 is generated again. At this time, only the RS flip-flop 126 corresponding to the output port P 1 is set, the output pulse from the output port P 1 becomes high level, the fuel injection is started with respect to the cylinder 1, both both cylinder 0 and cylinders 1 Fuel injection will be performed.
一致信号307は割込み要求をINTC 110に対して発生
し、マクロサービスを開始する。この場合においても、
マクロサービスモードがM1であるため、WR CNT.とRD CN
T.の比較を行なう。前述の場合と異り、WR CNT.が3、R
D CNT.が4であるため、キャプチャレジスタ118の内容
と、マクロサービスチャネル中のリセットデータとを、
ALU 101を利用して加算し、その結果は、[PTR−WR CN
T.x2−4]すなわち[PTR−10]の式により表現される
アドレス、この場合にはワードバッファ(P1用)に格納
される。The match signal 307 generates an interrupt request to the INTC 110 and starts macro service. Even in this case,
Since the macro service mode is M1, WR CNT. And RD CN
Perform T. comparison. Unlike the previous case, WR CNT. Is 3, R
Since D CNT. Is 4, the contents of the capture register 118 and the reset data in the macro service channel are
Addition using ALU 101, the result is [PTR-WR CN
T.X2-4] That [PTR-10] wherein addresses represented by the, in this case is stored in the word buffer (for P 1).
次に、WR CNT.を1デクリメントし2にする。WR CNT.
は0ではないので、ビット選択レジスタ(SR)120の左
シフト処理を実行し、出力ポートP2に相当するビットだ
けを1にセットする。この場合にはシフトアウトが発生
しないため、タイミング制御部109は、割込み要求クリ
ア信号302をINTC110に対して出力し、割込み要求フラグ
111をリセットしてマクロサービスを終了する。Next, WR CNT. Is decremented by 1 to 2. WR CNT.
Since is not 0, it performs a left shift operation of the bit selection register (SR) 120, and sets only one bit corresponding to the output port P 2. In this case, since no shift-out occurs, the timing control unit 109 outputs the interrupt request clear signal 302 to the INTC 110, and outputs the interrupt request flag.
Reset 111 to end macro service.
再度コンペアレジスタ117からの一致信号307が発生す
ると、この時には、出力ポートP2に対応するRSフリップ
フロップ126だけがセットされ、出力ポートP2からの出
力パルスがハイレベルになつて、気筒2に対する燃料噴
射が開始される。When a match signal 307 from the compare register 117 occurs again, at this time, only the RS flip-flop 126 corresponding to the output port P 2 is set, connexion such output pulse is high level from the output port P 2, for cylinder 2 Fuel injection is started.
一致信号307は、割込み要求をINTC 110に対して発生
し、マクロサービスを開始する。この場合にも、マクロ
サービスモードがM1であるため、WR CNT.とRD CNT.の比
較を行なう。WR CNT.は2、RD CNT.は4であるため、キ
ャプチャレジスタ118の内容と、マクロサービスチャネ
ル中のリセットデータを、ALU 101を利用して加算し、
その結果は、[PTR−WR CNT.x2−4]すなわち[PTR−
8]の式で表現されるアドレス、この場合はワードバッ
ファ(P2用)に格納される。The match signal 307 generates an interrupt request to the INTC 110 and starts macro service. Also in this case, since the macro service mode is M1, the WR CNT. And the RD CNT. Are compared. Since WR CNT. Is 2 and RD CNT. Is 4, the contents of the capture register 118 and the reset data in the macro service channel are added using the ALU 101,
The result is [PTR-WR CNT.x2-4],
Wherein the address represented by the 8], this case is stored in the word buffer (for P 2).
次に、WR CNT.を1デクリメントし1にする。WR CNT.
は0ではないので、ビット選択レジスタ(SR)120の左
シフト処理を実行し、出力ポートP3に相当するビットだ
け1にセットする。この場合もシフトアウトが発生しな
いため、タイミング制御部109は、割込み要求クリア信
号302をINTC 110に出力し、割込み要求フラグ111をリセ
ットしてマクロサービス処理を終了する。Next, WR CNT. Is decremented by 1 to 1. WR CNT.
Since is not 0, it performs a left shift operation of the bit selection register (SR) 120, and sets only one bit corresponding to the output port P 3. Also in this case, since no shift-out occurs, the timing control unit 109 outputs the interrupt request clear signal 302 to the INTC 110, resets the interrupt request flag 111, and ends the macro service processing.
再度コンペアレジスタ117からの一致信号307が発生す
ると、この時には、出力ポートP3のRSフリップフロップ
126だけがセットされ、出力ポートP3からの出力パルス
がハイレベルになり、気筒3に対する燃料噴射が開始さ
れる。When a match signal 307 from the compare register 117 occurs again, at this time, RS flip-flop of the output port P 3
Only 126 is set, the output pulse from the output port P 3 becomes high level, the fuel injection for the cylinder 3 is started.
一致信号307は、割込み要求をINTC 110に対して発生
し、マクロサービスを開始する。この場合にも、マクロ
サービスモードがM1であるため、WR CNT.とRD CNT.の比
較を行なう。WR CNT.は1、RD CNT.は4であるため、キ
ャプチャレジスタ118の内容と、マクロサービスチャネ
ル中のリセットデータを、ALU 101を利用して加算し、
その結果は、[PTR−WR CNT.x2−4]すなわち[PTR−
6]の式で表現されるアドレス、この場合はワードバッ
ファ(P3用)に格納される。The match signal 307 generates an interrupt request to the INTC 110 and starts macro service. Also in this case, since the macro service mode is M1, the WR CNT. And the RD CNT. Are compared. Since WR CNT. Is 1 and RD CNT. Is 4, the contents of the capture register 118 and the reset data in the macro service channel are added using the ALU 101,
The result is [PTR-WR CNT.x2-4],
Wherein the address represented by the 6], in this case is stored in the word buffer (for P 3).
次に、WR CNT.を1デクリメントし0にする。WR CNT.
が0になると、INITの値4をWR CNT.に再設定する。そ
してビット選択レジスタ(SR)120の左シフト処理を実
行する。この時にはシフトアウトが発生するため、タイ
ミング制御部109は、形態変更信号304をINTC 110に対し
て出力し、形態指定フラグ112をリセットする。Next, WR CNT. Is decremented by 1 to 0. WR CNT.
Becomes 0, reset the value 4 of INIT to WR CNT. Then, a left shift process of the bit selection register (SR) 120 is performed. At this time, since a shift-out occurs, the timing control unit 109 outputs the form change signal 304 to the INTC 110 and resets the form designation flag 112.
INTC 110は、割込み要求フラグ111がセット状態にあ
り、形態指定フラグ112がリセット状態にあるため、こ
の場合には、通常のベクタ割込み要求をCPU 100に対し
て発生し、以降、前述したベクタ割込み処理を実行す
る。割込み処理プログラムでは、ビット選択レジスタ
(SR)120を初期状態に再設定し、出力ポートP0からの
燃料噴射パルス出力に備える。Since the interrupt request flag 111 is in the set state and the mode designation flag 112 is in the reset state, the INTC 110 issues a normal vector interrupt request to the CPU 100 in this case. Execute the process. The interrupt processing program, resetting the bit selection register (SR) 120 to the initial state comprises a fuel injection pulse output from the output port P 0.
次に、出力ポートP0に対する燃料噴射終了タイミング
を与えるコンペアレジスタ119からの一致信号308が発生
すると、ビット選択レジスタ(RR)121は、出力ポートP
0に対応するビットだけが1で、その他は0であるた
め、出力ポートP0に対応するRSフリップフロップ126だ
けがリセットされ、気筒0に対する燃料噴射は終了す
る。この一致信号308は、INTC 110に対して割込み要求
を発生し、マクロサービスが開始される、 この場合におけるマクロサービスモードはM2であるた
め、RD CNT.の1デクリメントを行ない3にする。RD CN
T.が0ではないため次の処理に進み、RD CNT.が3で、W
R CNT.は燃料噴射開始タイミング側のマクロサービスの
処理で4に初期設定されているため、WR CNT.とRD CNT.
の一致がとれず、[PTR−RD CNT.x2−4]すなわち[PT
R−10]の式で表現されるアドレス、ワードバッファ(P
1用)に格納されている燃料噴射パルス幅を示すデータ
をコンペアレジスタ119に転送する。Next, when a match signal 308 is generated from the compare register 119 that gives the fuel injection end timing to the output port P 0 , the bit selection register (RR) 121
Since only the bit corresponding to 0 is 1 and the other bits are 0, only the RS flip-flop 126 corresponding to the output port P 0 is reset, and the fuel injection to the cylinder 0 ends. The coincidence signal 308 generates an interrupt request to the INTC 110 and starts macro service. Since the macro service mode in this case is M2, the RD CNT. RD CN
Since T. is not 0, proceed to the next process, RD CNT. Is 3 and W
Since R CNT. Is initially set to 4 in the macro service processing on the fuel injection start timing side, WR CNT. And RD CNT.
[PTR-RD CNT.x2-4], that is, [PT
R-10], the address and word buffer (P
The data indicating the fuel injection pulse width stored in ( 1 ) is transferred to the compare register 119.
ビット選択レジスタ(RR)121における左シフト処理
により、出力ポートP1に対するビットだけが1となり、
その他のビットは0となる。この場合にはシフトアウト
が発生しないため、タイミング制御部109は、割込み要
求クリア信号302をINTC 110に対して出力し、割込み要
求フラグ111をリセットしてマクロサービスを終了す
る。The left shift process in the bit selection register (RR) 121, only the bit for the output port P 1 becomes 1,
Other bits are 0. In this case, since no shift-out occurs, the timing control unit 109 outputs the interrupt request clear signal 302 to the INTC 110, resets the interrupt request flag 111, and ends the macro service.
次に、出力ポートP1に対する燃料噴射終了タイミング
を与えるコンペアレジスタ119からの一致信号308が発生
すると、ビット選択レジスタ(RR)121は、出力ポートP
1に対応するビットだけが1で、その他は0であるた
め、出力ポートP1に対応するRSフリップフロップ126だ
けがリセットされ、気筒1に対する燃料噴射は終了す
る。この一致信号308は、INTC 110に対して割込み要求
を発生し、マクロサービス処理が開始される。Next, when the coincidence signal 308 from the compare register 119 is generated to provide a fuel injection end timing with respect to the output port P 1, the bit selection register (RR) 121, the output port P
Since only the bit corresponding to 1 is 1 and the other bits are 0, only the RS flip-flop 126 corresponding to the output port P 1 is reset, and the fuel injection to the cylinder 1 ends. The coincidence signal 308 generates an interrupt request to the INTC 110, and the macro service processing is started.
この場合のマクロサービスモードもM2であるため、RD
CNT.の1デクリメントを行ない2にする。RD CNT.が0
でないため次の処理に進み、RD CNT.が2で、WR CNT.は
燃料噴射開始タイミング側のマクロサービスの処理にお
いて4に初期設定されているため、WR CNT.とRD CNT.の
一致がとれず、[PTR−RD CNT.x2−4]すなわち[PTR
−8]の式で表現されるアドレス、ワードバッファ(P2
用)に格納されている燃料噴射パルス幅を示すデータを
コンペアレジスタ119に転送する。Since the macro service mode in this case is also M2, RD
Decrement 1 of CNT. To 2 RD CNT. Is 0
Therefore, the process proceeds to the next process, and the RD CNT. Is set to 2 in the macro service process at the fuel injection start timing side, and the WR CNT. Not [PTR-RD CNT.x2-4]
−8], the address and word buffer (P 2
) Is transferred to the compare register 119.
ビット選択レジスタ(RR)121における左シフト処理
により、出力ポートP2に対するビットだけが1となり、
その他のビットは0となる。こ場合にはシフトアウトが
発生しないため、タイミング制御部109は、割込み要求
クリア信号302をINTC 110に対して出力し、割込み要求
フラグ111をリセットして、マクロサービス処理を終了
する。The left shift process in the bit selection register (RR) 121, only the bit for the output port P 2 becomes 1,
Other bits are 0. In this case, since no shift-out occurs, the timing control unit 109 outputs the interrupt request clear signal 302 to the INTC 110, resets the interrupt request flag 111, and ends the macro service processing.
次に、出力ポートP2に対する燃料噴射終了タイミング
を与えるコンペアレジスタ119からの一致信号308が発生
すると、ビット選択レジスタ(RR)121は、出力ポートP
2に対応するビットだけが1で、その他は0であるた
め、出力ポートP2のRSフリップフロップ126だけがリセ
ットされ、気筒2に対する燃料噴射は終了する。この一
致信号308は、INTC 110に対して割込み要求を発生し、
マクロサービス処理が開始される。Next, when the coincidence signal 308 from the compare register 119 is generated to provide a fuel injection end timing with respect to the output port P 2, bit selection register (RR) 121, the output port P
Only bits corresponding to the 2 in 1, since the others are 0, only the RS flip-flop 126 of the output port P 2 is reset, the fuel injection for the cylinder 2 is completed. This match signal 308 generates an interrupt request to the INTC 110,
Macro service processing is started.
この場合のマクロサービスモードもM2であるため、RD
CNT.の1デクリメントを行ない1にする。RD CNT.は0
でないため次の処理に進み、RD CNT.が1で、WR CNT.は
燃料噴射開始タイミング側のマクロサービスの処理で4
に初期設定されているため、WR CNT.とRD CNT.と一致が
とれず、[PTR−RD CNT.x2−4]すなわち[PTR−6]
の式で表現されるアドレス、ワードバッファ(P3用)に
格納されている燃料噴射パルス幅を示すデータをコンペ
アレジスタ119に転送する。Since the macro service mode in this case is also M2, RD
Decrement 1 of CNT. To 1 RD CNT. Is 0
RD CNT. Is 1 and WR CNT. Is 4 in macro service processing on the fuel injection start timing side.
WR CNT. And RD CNT. Cannot be matched because [PTR-RD CNT.x2-4], ie [PTR-6]
And the data indicating the fuel injection pulse width stored in the word buffer (for P3) are transferred to the compare register 119.
ビット選択レジスタ(RR)121における左シフト処理
により、出力ポートP3に対するビットだけが1となり、
その他のビットは0となる。こ場合にはシフトアウトが
発生しないため、タイミング制御部109は、割込み要求
クリア信号302をINTC 110に対して出力し、割込み要求
フラグ111をリセットして、マクロサービス処理を終了
する。The left shift process in the bit selection register (RR) 121, only the bit for the output port P 3 becomes 1,
Other bits are 0. In this case, since no shift-out occurs, the timing control unit 109 outputs the interrupt request clear signal 302 to the INTC 110, resets the interrupt request flag 111, and ends the macro service processing.
次に、出力ポートP3に対する燃料噴射終了タイミング
を与えるコンペアレジスタ119からの一致信号308が発生
すると、ビット選択レジスタ(RR)121は、出力ポートP
3に対応するビットだけが1で、その他は0であるた
め、出力ポートP3のRSフリップフロップ126だけがリセ
ットされ、気筒3に対する燃料噴射は終了する。この一
致信号308は、INTC 110に対して割込み要求を発生し、
マクロサービス処理が開始される。Next, when the coincidence signal 308 from the compare register 119 is generated to provide a fuel injection end timing with respect to the output port P 3, the bit selection register (RR) 121, the output port P
Only bits corresponding to 3 is 1, because the other is 0, only the RS flip-flop 126 of the output port P 3 is reset, the fuel injection for the cylinder 3 terminates. This match signal 308 generates an interrupt request to the INTC 110,
Macro service processing is started.
この場合のマクロサービスモードもM2であるため、RD
CNT.の1デクリメントを行ない0にする。RD CNT.は0
になるためINITの値は4に再設定される。この結果、RD
CNT.=WR CNT.4となり、コンペアレジスタ119へのデー
タ伝送は行なわれず、ビット選択レジスタ(RR)121の
左シフト処理に移行する。この場合には、ビット選択レ
ジスタ(RR)121からのシフトアウトが発生するため、
タイミング制御部109は、形態変更信号304をINTC 110に
対して出力し、形態指定フラグ112をリセットする。INT
C 110は、割込み要求フラグ111がセット状態にあり、形
態指定フラグ112がリセット状態にあるため、この場合
には、通常のベクタ割込み要求をCPU 100に対して発生
し、以降、前述したベクタ割込み処理を実行する。Since the macro service mode in this case is also M2, RD
Decrement 1 of CNT. To 0. RD CNT. Is 0
Therefore, the value of INIT is reset to 4. As a result, RD
CNT. = WR CNT.4, and no data transmission to the compare register 119 is performed, and the processing shifts to the left shift processing of the bit selection register (RR) 121. In this case, since a shift-out from the bit selection register (RR) 121 occurs,
The timing control unit 109 outputs the form change signal 304 to the INTC 110, and resets the form designation flag 112. INT
Since the interrupt request flag 111 is in the set state and the mode designation flag 112 is in the reset state, the C 110 issues a normal vector interrupt request to the CPU 100 in this case. Execute the process.
燃料噴射終了タイミングで起動される割込み処理プロ
グラムにおいては、ビット選択レジスタ(RR)121を初
期状態に再設定し、出力ポートP0からの燃料噴射パルス
出力に備える。In the interrupt processing program is started in the fuel injection end timing, and resets the bit selection register (RR) 121 to the initial state comprises a fuel injection pulse output from the output port P 0.
本実施例においては、出力ポートP3の燃料噴射終了タ
イミング前に、他の気筒に対する燃料噴射開始タイミン
グが発生していない場合を示したが、例えば、出力ポー
トP3の燃料噴射終了タイミング前に、出力ポートP0の燃
料噴射開始タイミングが発生していたとすると、燃料噴
射開始タイミング側のマクロサービスの処理で、キャプ
チャレジスタ118とリセットデータの加算結果が、[PTR
−WR CNT.x2−4]すなわち[PTR−12]の式で表現され
るアドレス、ワードバッファ(P0用)に格納され、その
後、WR CNT.=3となるため、出力ポートP3の燃料噴射
終了タイミングで起動されるマクロサービス処理におい
ては、WR CNT.=3ならびにRD CNT.=4となつて不一致
となる。この場合には、[PTR−12]の式で表現される
アドレス、つまりワードバッファ(P0用)に格納されて
いるデータを、コンペアレジスタ119に転送する処理が
実行されるため、このような場合においても、論理的に
矛盾なく出力ポートP3に対する燃料噴射終了タイミング
を得ることができる。In this embodiment, before the fuel injection end timing of the output port P 3, although the case where the fuel injection start timing for the other cylinders is not occurring, for example, before the fuel injection end timing of the output port P 3 , when the fuel injection start timing of the output ports P 0 has occurred, the processing of the macro service fuel injection start timing side, the capture register 118 and the reset data of the addition result, [PTR
-WR CNT.X2-4] That [PTR-12 expression address represented by the, stored in a word buffer (for P 0), then, WR CNT. = 3, and therefore, the fuel output port P 3 In the macro service processing started at the injection end timing, the WR CNT. = 3 and the RD CNT. = 4, which are not coincident. In this case, [PTR-12] wherein the address represented by the, ie for the data stored in the word buffer (for P 0), the processing to be transferred to the compare register 119 is executed, like this in case, it is possible to obtain a fuel injection termination timing for logically without contradiction output port P 3.
以上、第7図(a)および(b)に示されるパルスパ
ターンの場合について説明をしてきたが、この二つのパ
ターンの如何なる組合せにおいても、本マクロサービス
処理は適用可能である。Although the case of the pulse patterns shown in FIGS. 7A and 7B has been described above, the macro service processing can be applied to any combination of these two patterns.
また、本実施例においては、ビット選択レジスタ(S
R)120とビット選択レジスタ(RR)121からのシフト処
理の結果、シフトアウトが発生した場合にはベクタ割込
みを発生させ、割込み処理プログラムで初期化を行なう
方法を示したが、これは、エンジンの状態に応じて何等
かの補正処理が必要となつた場合、その補正タイミング
を与える目的で設定したもので、そのような補正処理を
必要としないシステムにおいては、ビット選択レジスタ
(SW)120またはビット選択レジスタ(RR)121に対し
て、ローテート処理を実行し、ビット3からのシフトア
ウトがビット0に転送されるようにマクロサービス処理
を変更すれば、ベクタ割込み処理の発生なしにマクロサ
ービス処理だけで、完全な燃料噴射制御が可能となる。In this embodiment, the bit selection register (S
R) 120 and the bit selection register (RR) 121 show a method in which when a shift-out occurs as a result of shift processing, a vector interrupt is generated and initialization is performed by an interrupt processing program. If some kind of correction processing is required according to the state of the above, it is set for the purpose of giving the correction timing. In a system that does not require such correction processing, the bit selection register (SW) 120 or If the rotation processing is performed on the bit selection register (RR) 121 and the macro service processing is changed so that the shift-out from bit 3 is transferred to bit 0, the macro service processing can be performed without occurrence of vector interrupt processing. Alone, complete fuel injection control is possible.
次に、本発明の第2実施例について説明する。本実施
例のシステム・ブロック図およびマクロサービスの処理
形態情報の構成は、第1の実施例の場合と同様であるた
め、その説明は省略する。第5図は、第2の実施例にお
ける周辺ハードウェアのブロック図である。Next, a second embodiment of the present invention will be described. The configuration of the system block diagram and the processing form information of the macro service in the present embodiment are the same as those in the first embodiment, and thus the description thereof is omitted. FIG. 5 is a block diagram of peripheral hardware in the second embodiment.
第5図に示されるように、,本実施例の周辺ハードウ
ェアは、データバス300に対応して、フリーランニング
タイマ128と、コンペアレジスタ(図中にCOMP 1と記
載)129およびコンペアレジスタ(図中にCOMP 2と記
載)131と、キャプチャレジスタ(図中にCAPと記載)13
0と、ディレイ回路132,133と、ビット選択レジスタ(S
R)134と、ビット選択レジスタ(RR)135と、それぞれ
4個のANDゲート138を含む制御回路136,137と、4個の
出力ポートP0〜P3に対応する4個のRSフリップフロップ
140ならびに4個のバッファ141を含むポート出力回139
と、を備えている。As shown in FIG. 5, the peripheral hardware of this embodiment includes a free-running timer 128, a compare register (described as COMP 1 in the figure) 129 and a compare register (FIG. 13 and the capture register (CAP in the figure) 13
0, delay circuits 132 and 133, and a bit selection register (S
And R) 134, a bit selection register (RR) 135, a control circuit 136, 137 each include four AND gates 138, four RS flip-flop that corresponds to the four output ports P 0 to P 3
140 and a port output circuit 139 including four buffers 141
And
第5図において、一致信号310および311は、それぞれ
コンペアレジスタ129および131より出力される。ビット
選択レジスタ(SR)134とビット選択レジスタ(RR)135
は、シフトレジスタ構成となつており、ディレイ回路13
2,133からの信号により、1ビット単位で左シフトす
る。第1の実施例では、マクロサービスの指令によつ
て、ビット選択レジスタ(SR)120またはビット選択レ
ジスタ(RR)121のシフト処理を実行したが、本実施例
では、前述の一致信号310または311をディレイ回路132
または133によつて数クロック遅延させた信号により、
ビット選択レジスタ(SR)134またはビット選択レジス
タ(RR)135のシフト処理を実行している。In FIG. 5, match signals 310 and 311 are output from compare registers 129 and 131, respectively. Bit select register (SR) 134 and bit select register (RR) 135
Has a shift register configuration, and the delay circuit 13
The signal is left-shifted by 1 bit in accordance with the signal from 2,133. In the first embodiment, the shift processing of the bit selection register (SR) 120 or the bit selection register (RR) 121 is executed according to the instruction of the macro service, but in the present embodiment, the coincidence signal 310 or 311 described above is executed. The delay circuit 132
Or by a signal delayed several clocks by 133,
The shift processing of the bit selection register (SR) 134 or the bit selection register (RR) 135 is executed.
次に、本実施例におけるマクロサービス処理フローを
第6図に示す。ビット選択レジスタ(SR)134またはビ
ット選択レジスタ(RR)135におけるシフト処理が、デ
ィレイ回路132またはディレイ回路133による遅延作用を
介してハードウェア的に実行できた分、第1の実施例に
対して、マクロサービスのμプログラム指令により実行
するシフト処理の部分が削除され、マクロサービスの処
理速度が向上させる。その他の動作については、第1の
実施例の場合と全く同様であるため、詳細な説明は省略
する。Next, a macro service processing flow in the present embodiment is shown in FIG. Since the shift processing in the bit selection register (SR) 134 or the bit selection register (RR) 135 can be executed by hardware through the delay action of the delay circuit 132 or the delay circuit 133, the first embodiment is different from the first embodiment. In addition, the shift processing part executed by the μ service command of the macro service is deleted, and the processing speed of the macro service is improved. The other operations are exactly the same as those in the first embodiment, and thus detailed description is omitted.
以上、詳細に説明したように、本発明は、燃料噴射開
始タイミングの割込みおよび燃料噴射終了タイミングの
割込みなどを、マクロサービスによつて処理し、ベクタ
割込み要求を発生しないため、エンジンの回転数を増し
ても、割込み処理プログラムへ移行する際のPC、PSWの
スタックへの退避や、割込み処理プログラムからメイン
処理に戻る時に、スタックの内容をPC、PSWへ復帰する
処理等においてCPU時間を占めることがない。As described above in detail, according to the present invention, the interruption of the fuel injection start timing, the interruption of the fuel injection end timing, and the like are processed by the macro service and the vector interruption request is not generated. Even if the number increases, the CPU time is occupied in the process of saving the PC and PSW to the stack when shifting to the interrupt processing program, and the process of returning the contents of the stack to the PC and PSW when returning to the main processing from the interrupt processing program There is no.
従つて、エンジン制御における燃料噴射制御、点火時
期制御およびアイドル回転制御など種々雑多な仕事に十
分なCPU時間を割くことが可能となり、多気筒エンジン
による高速回転時にも、マイクロコンピュータが十分余
裕をもつてエンジン制御を行なうことができるという効
果がある。Therefore, it becomes possible to dedicate sufficient CPU time to various tasks such as fuel injection control, ignition timing control and idle rotation control in engine control, and the microcomputer has sufficient margin even at high speed rotation with a multi-cylinder engine. Thus, there is an effect that engine control can be performed.
また、最近の排気ガス規制や燃料費削減などの要求か
ら、精度の高い燃料噴射制御が必要となつていることに
対しても、燃料噴射開始タイミングおよび燃料噴射終了
タイミングを与えるコンペアレジスタからの一致信号に
より、直接出力ポートを制御して燃料噴射パルスを生成
することで、割込み要因が発生してから割込み処理プロ
グラムが開始するまでの時間の遅れや、出力ポートへの
データ書込み時間による遅れなどなしに、最小限の誤差
でエンジン制御を行なうことができ、且つ各気筒ごと
に、それぞれ独立に制御することができるため、燃料噴
射量の調節を高い精度で行なうことが可能になるという
効果もある。In addition, due to recent demands for exhaust gas regulations and reduction of fuel cost, high-precision fuel injection control is required. Signals directly control the output port to generate a fuel injection pulse, so there is no delay from the occurrence of an interrupt factor to the start of the interrupt processing program, and no delay due to the time required to write data to the output port. In addition, since engine control can be performed with a minimum error and control can be performed independently for each cylinder, there is an effect that the fuel injection amount can be adjusted with high accuracy. .
更に加えて、従来例において示されたように、様々な
燃料噴射パターンに対応して複数の気筒の制御を行うた
めには、複数組のコンペアレジスタが必要になり、ハー
ドウェア量が増大して経済的な負担増となる点に関して
も、燃料噴射開始タイミングと燃料噴射終了タイミング
とにおいて、本発明による同一のマクロサービスチャネ
ルを対応させたマクロサービス処理を適用することによ
り、1組のコンペアレジスタとキャプチャレジスタだけ
で、複数気筒に対する燃料噴射制御が可能になり、ハー
ドウェア量を増さずに済ますことができる。このこと
は、気筒数が6個、8個と増えても、マクロサービスチ
ャネル内のワードバッフアの数を増すだけで全く同様な
対応がとれるため、経済的に非常に優位なエンジン制御
システムを構成することが可能となり、CPUと周辺回路
を単一基盤上に集積するシングルチップなどにも十分に
適用させることができるという効果がある。In addition, as shown in the conventional example, in order to control a plurality of cylinders corresponding to various fuel injection patterns, a plurality of sets of compare registers are required, and the amount of hardware increases. Regarding the economic burden, the macro service processing corresponding to the same macro service channel according to the present invention is applied to the fuel injection start timing and the fuel injection end timing, so that one set of compare register and Fuel injection control for a plurality of cylinders can be performed using only the capture register, and the amount of hardware can be reduced. This means that even if the number of cylinders increases to six or eight, exactly the same measures can be taken simply by increasing the number of word buffers in the macro service channel, so that an economically superior engine control system is constituted. This makes it possible to sufficiently apply the present invention to a single chip in which a CPU and peripheral circuits are integrated on a single substrate.
第1図は、本発明の第1および第2の実施例のシステム
・ブロック図、第2図は、前記第1の実施例における周
辺ハードウェアのブロック図、第3図は、マクロサービ
スの処理形態情報構成例を示す図、第4図は、第1の実
施例におけるマクロサービス処理フローチャートを示す
図、第5図は、前記第2の実施例における周辺ハードウ
ェアのブロック図、第6図は、第2の実施例におけるマ
クロサービス処理フローチャートを示す図、第7図
(a)および(b)は、出力ポートからの燃料噴射パル
スの出力パターンを示す図、第8図は、従来例のパルス
発生回路のシステム・ブロック図、第9図は、従来例に
おける周辺ハードウェアのブロック図である。 図において、100,200……CPU、101,201……ALU、102,20
2……テンポラリレジスタ、103,203……汎用レジスタ、
104,204……アドレスバッファ、105,205……μアドレス
生成部、106,206……PC、107,207……PSW、108,208……
μROM、109,209……タイミング制御部、110,210……INT
C、111,211……割込み要求フラグ、112……形態指定フ
ラグ、113,212……プログラムメモリ、114,213……デー
タメモリ、115,214……周辺ハードウェア、116,128,215
……フリーランニングタイマ、117,119,129,131,216,21
8,219,220,221……コンペアレジスタ、118,130,217……
キャプチャレジスタ、120,134……ビット選択レジスタ
(SR)、121,135……ビット選択レジスタ(RR)、122,1
23,136,137……制御回路、124,138……ANDゲート、125,
139,222……ポート出力回路、126,140……RSフリップフ
ロップ、127,141,224……バッファ、132,133……ディレ
イ回路、223……ポートレジスタ。FIG. 1 is a system block diagram of the first and second embodiments of the present invention, FIG. 2 is a block diagram of peripheral hardware in the first embodiment, and FIG. 3 is a macro service processing. FIG. 4 shows a macro service processing flowchart in the first embodiment, FIG. 5 is a block diagram of peripheral hardware in the second embodiment, and FIG. FIG. 7 is a flowchart showing a macro service processing in the second embodiment. FIGS. 7A and 7B are diagrams showing an output pattern of a fuel injection pulse from an output port. FIG. FIG. 9 is a system block diagram of a generating circuit, and FIG. 9 is a block diagram of peripheral hardware in a conventional example. In the figure, 100, 200 ... CPU, 101, 201 ... ALU, 102, 20
2… Temporary register, 103,203 …… General-purpose register,
104, 204 ... address buffer, 105, 205 ... μ address generation unit, 106, 206 ... PC, 107, 207 ... PSW, 108, 208 ...
μROM, 109,209 …… Timing control unit, 110,210 …… INT
C, 111, 211 ... interrupt request flag, 112 ... form designation flag, 113, 212 ... program memory, 114,213 ... data memory, 115, 214 ... peripheral hardware, 116, 128, 215
…… Free running timer, 117,119,129,131,216,21
8,219,220,221 …… Compare register, 118,130,217 ……
Capture register, 120, 134 ... bit selection register (SR), 121, 135 ... bit selection register (RR), 122, 1
23,136,137 …… Control circuit, 124,138 …… AND gate, 125,
139,222 ... port output circuit, 126,140 ... RS flip-flop, 127,141,224 ... buffer, 132,133 ... delay circuit, 223 ... port register.
Claims (1)
用のパルス発生装置において、 前記中央処理装置に対して非同期の割込み処理の要求を
発生するとともに、所定のデータ処理の要求をも発生す
る手段と、前記割込み処理の要求と前記所定のデータ処
理の要求とを識別するための形態指示手段と、を含む割
込み要求発生回路と、 所要のデータとともに、前記所定のデータ処理の処理形
態を指定する処理形態情報をも併せて格納するデータメ
モリと、 フリーランニングタイマと、燃料噴射終了タイミング決
定のために所定のタイミングで前記フリーランニングタ
イマの値を取込むキャプチャレジスタと、前記フリーラ
ンニングタイマの値が所定の値と一致したときに燃料噴
射開始タイミング及び終了タイミングを発生する一対の
コンペアレジスタと、エンジン制御のための燃料噴射パ
ルスを出力する複数の出力ポートと、燃料噴射パルスを
発生すべきポートを選択する第1のビット選択レジスタ
及び第1の制御回路と、燃料噴射パルスの発生を停止す
べきポートを選択する第2のビット選択レジスタ及び第
2の制御回路と、を含む周辺ハードウェアとを備え、 前記中央処理装置は、命令の実行アドレスを保持するプ
ログラムカウンタと、プログラムの実行状態を保持する
手段と、高速記憶手段と、マイクロプログラムROMとを
含み、前記割込み要求発生回路から前記所定のデータ処
理の要求が発生され、前記形態指示手段において前記所
定のデータ処理を指示していることが検知された場合に
は、前記プログラムカウンタの内容及び前記プログラム
の実行状態を保持する手段の内容を保持したまま命令実
行処理を中断し、前記処理形態情報に従い、前記マイク
ロプログラムROMの所定アドレスに格納されたマイクロ
プログラム指令を実行して、前記一対のコンペアレジス
タと前記キャプチャレジスタと前記データメモリとを操
作することにより、前記複数の出力ポートから出力され
る自動車エンジン制御用の燃料噴射パルスを制御するこ
とを特徴とするパルス発生装置。1. A pulse generator for controlling an automobile engine using a central processing unit, wherein a request for asynchronous interrupt processing to the central processing unit and a request for predetermined data processing are also generated. An interrupt request generating circuit including: an interrupt request requesting means for identifying the interrupt processing request and the predetermined data processing request; and specifying a processing mode of the predetermined data processing together with required data. A data memory that also stores processing mode information, a free-running timer, a capture register that captures the value of the free-running timer at a predetermined timing to determine a fuel injection end timing, and a value of the free-running timer. A pair of compare units that generate a fuel injection start timing and an end timing when they match a predetermined value Register, a plurality of output ports for outputting a fuel injection pulse for engine control, a first bit selection register and a first control circuit for selecting a port for generating the fuel injection pulse, and generation of the fuel injection pulse Peripheral hardware including a second bit selection register and a second control circuit for selecting a port to stop the operation, the central processing unit includes: a program counter that holds an execution address of an instruction; Means for holding an execution state, high-speed storage means, and a microprogram ROM, wherein the request for the predetermined data processing is generated from the interrupt request generation circuit, and the form instruction means instructs the predetermined data processing. Is detected, the contents of the program counter and the execution state of the program are stored in the program counter. The instruction execution process is interrupted while holding, and according to the processing mode information, a microprogram command stored at a predetermined address of the microprogram ROM is executed, and the pair of compare registers, the capture registers, and the data memory are executed. Controlling a fuel injection pulse output from the plurality of output ports for controlling an automobile engine.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP33112788A JP2903526B2 (en) | 1988-12-28 | 1988-12-28 | Pulse generator |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP33112788A JP2903526B2 (en) | 1988-12-28 | 1988-12-28 | Pulse generator |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH02176143A JPH02176143A (en) | 1990-07-09 |
| JP2903526B2 true JP2903526B2 (en) | 1999-06-07 |
Family
ID=18240173
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP33112788A Expired - Lifetime JP2903526B2 (en) | 1988-12-28 | 1988-12-28 | Pulse generator |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2903526B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH0763103A (en) * | 1993-08-23 | 1995-03-07 | Nippondenso Co Ltd | Fuel injection control device for internal combustion engine |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2731556B2 (en) | 1988-11-17 | 1998-03-25 | 日本電気株式会社 | Fuel injection control device |
-
1988
- 1988-12-28 JP JP33112788A patent/JP2903526B2/en not_active Expired - Lifetime
Patent Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2731556B2 (en) | 1988-11-17 | 1998-03-25 | 日本電気株式会社 | Fuel injection control device |
Also Published As
| Publication number | Publication date |
|---|---|
| JPH02176143A (en) | 1990-07-09 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP2903526B2 (en) | Pulse generator | |
| JPH0916409A (en) | Microcomputer | |
| JP2731556B2 (en) | Fuel injection control device | |
| JP2770743B2 (en) | Weight control method | |
| EP0333213B1 (en) | Microcomputer producing pulses at outout ports in sequence in response to request signal | |
| JPH08272608A (en) | Pipeline processing equipment | |
| JPH0718373B2 (en) | Electronic fuel injection control device | |
| JP2504044B2 (en) | Pulse measuring device | |
| JP2536103B2 (en) | Data processing device | |
| JP2844624B2 (en) | Data processing device | |
| JPS6128144A (en) | Executing device of tracing | |
| JPH076435B2 (en) | Fuel injection control device | |
| JPH0333934A (en) | Register saving/recovering system | |
| JPH0285951A (en) | Input/output bus cycle control system | |
| JPS6120139A (en) | Interruption control system | |
| JPS63197236A (en) | Control device for automobile | |
| JPS59200356A (en) | Program tracing system | |
| JPH04246764A (en) | Data processor | |
| JPH1055303A (en) | Memory system | |
| JPH02133833A (en) | Controller for in-circuit emulator | |
| JPS6326744A (en) | Memory bank switching circuit for microprocessor | |
| JPH05250161A (en) | Microcomputer device | |
| JPS5942331B2 (en) | Prosetsusasouchinoseigiohoshiki | |
| JPH06202888A (en) | Microprocessor | |
| JPH0283747A (en) | Processing unit debugging mechanism |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| FPAY | Renewal fee payment (prs date is renewal date of database) |
Year of fee payment: 9 Free format text: PAYMENT UNTIL: 20080326 |
|
| FPAY | Renewal fee payment (prs date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090326 Year of fee payment: 10 |
|
| EXPY | Cancellation because of completion of term | ||
| FPAY | Renewal fee payment (prs date is renewal date of database) |
Year of fee payment: 10 Free format text: PAYMENT UNTIL: 20090326 |