JP2018072921A - On-vehicle electronic control device - Google Patents
On-vehicle electronic control device Download PDFInfo
- Publication number
- JP2018072921A JP2018072921A JP2016208589A JP2016208589A JP2018072921A JP 2018072921 A JP2018072921 A JP 2018072921A JP 2016208589 A JP2016208589 A JP 2016208589A JP 2016208589 A JP2016208589 A JP 2016208589A JP 2018072921 A JP2018072921 A JP 2018072921A
- Authority
- JP
- Japan
- Prior art keywords
- interrupt
- cpu
- processing
- address
- program
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 claims description 52
- 230000008569 process Effects 0.000 claims description 49
- 230000008859 change Effects 0.000 claims description 5
- 108010014173 Factor X Proteins 0.000 description 16
- 230000000694 effects Effects 0.000 description 4
- 230000002093 peripheral effect Effects 0.000 description 4
- 230000004044 response Effects 0.000 description 3
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 239000000498 cooling water Substances 0.000 description 1
- 239000000446 fuel Substances 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
Landscapes
- Stored Programmes (AREA)
Abstract
Description
本発明は、車載電子制御装置に関する。 The present invention relates to an on-vehicle electronic control device.
従来、マイクロコンピュータでは、CPUが実行する割り込みルーチンは、割り込みが入った場合にマイクロコンピュータに搭載された割り込み制御回路がROM上に設定されたベクタテーブルに格納されたアドレス値を参照し、現在の処理を一度スタック領域へ退避させ、ベクタテーブルの示すアドレス先の処理を実施する。その後割り込み処理が終了すると、CPUが中断されていた処理から再開するというものであった。この際、ベクタテーブルはROM上に存在する為変更することができず、一つの割り込み要因に対して複数の割り込み処理を設定することができなかった。 Conventionally, in a microcomputer, an interrupt routine executed by a CPU refers to an address value stored in a vector table set in a ROM by an interrupt control circuit installed in the microcomputer when an interrupt occurs, The processing is once saved in the stack area, and the processing at the address indicated by the vector table is performed. Then, when the interrupt process is completed, the CPU resumes from the interrupted process. At this time, the vector table cannot be changed because it exists in the ROM, and a plurality of interrupt processes cannot be set for one interrupt factor.
これに対し、割り込みベクタテーブルをRAM上に設け、その時CPUが実行しているプログラム用に割り込みベクタテーブルを書き換えるものが提案されている(特許文献1参照)。これは、割り込みベクタテーブルをスタートアップ読み出し専用メモリと読み書き可能なメモリの固定番地に設けることで、1つの割り込み要因に対して複数の割り込み処理を設定するものである。 On the other hand, an interrupt vector table is provided on the RAM, and the interrupt vector table is rewritten for a program executed by the CPU at that time (see Patent Document 1). In this method, a plurality of interrupt processes are set for one interrupt factor by providing an interrupt vector table at fixed addresses of a startup read-only memory and a readable / writable memory.
上記技術の割り込み制御機能は、スタートアップROM上にPOWERON BITプログラムを有すると共に、ROM上に通常処理プログラムを有し、外部ハードウェア及び内部ハードウェアからの割り込みを受けた際にスタートアッププログラムと通常処理プログラムにおいてRAM上の割り込みベクタテーブルを書き換えることにより、1つの割り込み要因に対して複数の割り込み処理を設定することができる。 The interrupt control function of the above technique has a POWERON BIT program on the startup ROM and a normal processing program on the ROM, and when receiving an interrupt from external hardware and internal hardware, the startup program and the normal processing program By rewriting the interrupt vector table on the RAM, a plurality of interrupt processes can be set for one interrupt factor.
しかしながら、上記技術では、その時CPUが実行しているプログラム用に割り込みベクタテーブルを書き換えるため、各プログラムはそれぞれが静的にどの飛び先に切り替えるかを決定する必要があり、周辺装置やマイクロコンピュータの状態、つまりCPUの負荷状態に応じた処理ができない。例えば、スタートアッププログラムから通常処理に入る場合はスタートアップ終了時に割り込みベクタテーブルを通常処理用に単に上書きしているだけであり、CPUの負荷状態に応じた割り込み処理を実行できないのが実情である。 However, in the above technique, since the interrupt vector table is rewritten for the program being executed by the CPU at that time, it is necessary for each program to determine which jump destination is to be statically switched. Processing according to the state, that is, the load state of the CPU cannot be performed. For example, when normal processing is entered from a startup program, the interrupt vector table is simply overwritten for normal processing at the end of startup, and the actual situation is that interrupt processing according to the load state of the CPU cannot be executed.
本発明は上記事情に鑑みてなされたもので、その目的は、CPUの負荷状態に応じた割り込み処理を実行することができる車載電子制御装置を提供することにある。 The present invention has been made in view of the above circumstances, and an object thereof is to provide an in-vehicle electronic control device capable of executing an interrupt process according to a load state of a CPU.
請求項1の発明によれば、割り込み制御部(7)は、割り込み要因が発生した場合は、CPU(4)に割り込みを要求すると共にCPU(4)が次に実行する予定であったアドレスを中断アドレスとして退避する。CPU(4)は、割り込み要求を受けた場合は、記憶部(6)に記憶されている飛び先アドレスに移行し、当該飛び先アドレスの割り込みプログラムの実行が終了した場合は、中断アドレスに移行する。 According to the first aspect of the present invention, when an interrupt factor occurs, the interrupt control unit (7) requests the CPU (4) for an interrupt, and sets the address that the CPU (4) is scheduled to execute next. Saved as a suspended address. When receiving an interrupt request, the CPU (4) shifts to the jump destination address stored in the storage unit (6), and shifts to the interrupt address when execution of the interrupt program at the jump destination address is completed. To do.
ここで、取得部(4a)がCPU(4)の動作に影響を及ぼす負荷状態を取得すると、スケジューラ(4b)は、負荷状態に応じて、記憶部(6)に記憶されている飛び先アドレスをCPU(4)の負荷状態に応じた処理を実行する割り込みプログラムのアドレスに変更する。これにより、CPU(4)の負荷状態に応じて適切な割り込みプログラムを実行することができるので、CPU(4)の処理能力をより有効に活用することができる。 Here, when the acquisition unit (4a) acquires a load state that affects the operation of the CPU (4), the scheduler (4b) determines a jump address stored in the storage unit (6) according to the load state. Is changed to the address of the interrupt program for executing the process according to the load state of the CPU (4). Thus, an appropriate interrupt program can be executed according to the load state of the CPU (4), so that the processing capability of the CPU (4) can be utilized more effectively.
(第1実施形態)
以下、車両機器であるガソリンエンジンを制御するエンジンECUに適用した第1実施形態について図1から図4を参照しながら説明する。
(First embodiment)
Hereinafter, a first embodiment applied to an engine ECU that controls a gasoline engine as a vehicle device will be described with reference to FIGS. 1 to 4.
図1に示すように、エンジンECU1(車載電子制御装置に相当)は、主体となるマイクロコンピュータ(以下、マイコン)2と、外部入出力回路3(割り込み制御部に相当)とを備えて構成されている。マイコン2は、CPU4、ROM5、RAM6(記憶部に相当)、割り込み制御回路7、タイマ8、入出力ポート9を備えており、図示しないエンジンを制御するための様々な処理を行う。外部入出力回路3は、エンジンECU1を制御するための外部機器との間で信号の入出力処理を行う。
As shown in FIG. 1, an engine ECU 1 (corresponding to an on-vehicle electronic control device) includes a main microcomputer (hereinafter referred to as a microcomputer) 2 and an external input / output circuit 3 (corresponding to an interrupt control unit). ing. The microcomputer 2 includes a
ROM5にはエンジンを制御するための各種プログラムが格納されており、CPU4は、ROM5に格納された各種プログラムを実行することでエンジンを制御する。タイマ8は、エンジンを制御するのに必要な各種パルス信号を出力するタイミングを決定するために設けられている。RAM6には各種プログラムが処理に用いる演算データを一時的に格納する領域が確保されている。尚、ROM5やRAM6に代えて、ハードディスクドライブやフラッシュメモリに代表される半導体メモリのような非遷移的実体的記録媒体を設けるようにしても良い。
Various programs for controlling the engine are stored in the
外部入出力回路3には、インジェクタ10、イグナイタ11、電子スロットル12、クランクセンサ13、水温センサ14、スロットルセンサ15などエンジンを制御するための各種アクチュエータやエンジンの状態を検出するための各種センサが接続されている。インジェクタ10は、エンジンの吸気通路に燃料を噴射する。電子スロットル12は、エンジンの吸気通路を流れる空気量を調節する。イグナイタ11は、エンジンの点火プラグ(図示せず)に着火させる。
The external input /
クランクセンサ13は、エンジンのクランク軸の回転に応じて所定角度毎(例えば30゜CA毎)にエッジをクランク信号として出力する。水温センサ14は、エンジンの冷却水の温度を検出する。スロットルセンサ15は、電子スロットル12の開度を検出する。
The
外部入出力回路3は、入力した各種信号をデジタル信号に波形整形しマイコン2に出力する。また、外部入出力回路3はA/D変換器(図示せず)を内蔵しており、水温センサ14やスロットルセンサ15によるアナログセンサ信号を入力し、A/D変換器を用いてデジタル信号に変換してマイコン2に出力する。
The external input /
割り込み制御回路7は、クランクセンサ13からのクランク信号を割り込み要因として入力可能であり、クランク信号を入力すると割り込み要求をCPU4に出力する。
図2に示すように、ROM5には、スケジューラプログラムと、パターンA〜Dプログラムとが記憶されている。CPU4がスケジューラプログラムを実行することで図1に示す取得部4a及びスケジューラ4bの動作が実現される。スケジューラプログラムは、後述するようにエンジンの回転状態に応じてRAM6の割り込みベクタテーブル(以下、ベクタテーブル)に記憶されている飛び先アドレスをパターンA〜Dプログラムのアドレスに書き換える処理(書き換え処理)を実行するものである。本実施形態では、説明の簡単化のためにエンジンを制御するプログラムとしてパターンA〜Dプログラムを示したが、実際には多数のプログラムによりエンジンを制御するようになっている。
The interrupt control circuit 7 can input a crank signal from the
As shown in FIG. 2, the
図4に示すように、パターンAプログラムは、処理A,B,Cから構成されている。尚、説明の簡単化のためにプログラムAプログラムを処理A,B,Cから構成されているものとして説明するが、実際には多数の処理から構成されている。これは、他のプログラムも同様である。パターンBプログラムは、処理Aと、処理B,Cの処理を簡単化した処理Dとから構成されており、全体の処理時間がパターンAプログラムよりも短縮されている。パターンCプログラムは処理Aのみから構成されており、全体の処理時間がパターンBプログラムよりも短縮されている。パターンDプログラムは、実行対象となる処理を有していない。つまり、パターンDプログラムは、何も実行しないようになっており、全体の処理時間はほぼ0である。このパターンDプログラムは、後述するように割り込み処理を実行する必要がない状態で割り込み要因が発生した場合に実行する特殊な処理である。 As shown in FIG. 4, the pattern A program is composed of processes A, B, and C. In order to simplify the description, the program A program will be described as being composed of processes A, B, and C, but in practice it is composed of a large number of processes. The same applies to other programs. The pattern B program includes a process A and a process D obtained by simplifying the processes B and C, and the entire processing time is shorter than that of the pattern A program. The pattern C program is composed only of the process A, and the entire processing time is shorter than that of the pattern B program. The pattern D program does not have a process to be executed. That is, the pattern D program does not execute anything, and the overall processing time is almost zero. The pattern D program is a special process that is executed when an interrupt factor occurs in a state where it is not necessary to execute an interrupt process, as will be described later.
RAM6には、ベクタテーブルと、周辺ICの状態やマイコンの状態が記憶されている。ベクタテーブル内には割り込み要因Xに対する飛び先アドレスが記憶されている。本実施形態の割り込み要因Xはクランク軸が所定角度回転する毎に発生し、割り込み要因は割り込み要因Xのみの一つである。ベクタテーブルは、エンジンECU1が電源投入により立ち上がった際に実行されるブートプログラムにより書き込まれる。周辺ICの状態とはCPU4の負荷状態に影響を与える状態を示す状態値で、CPU4が割り込みプログラムを実行する際に周辺ICから状態値を取得することでCPU4の負荷状態を間接的に判断可能となる。マイコンの状態とはCPU4の負荷に影響を与える状態を示す状態値で、CPU4が割り込みプログラムを実行する際にマイコンの状態から状態値を取得することでCPU4の負荷状態を直接的に判断可能となる。本実施形態の場合、エンジンの回転状態がRAM6に記憶されており、その回転状態によりCPU4の負荷状態を直接的に判断するようになっている。回転状態とは、エンジンの低回転、通常回転、高回転である。従って、本実施形態では、マイコンの状態として記憶されている状態値をCPU4の負荷状態を判断するために直接使用することになる。
The RAM 6 stores a vector table, peripheral IC states, and microcomputer states. A jump address for the interrupt factor X is stored in the vector table. The interrupt factor X of this embodiment is generated every time the crankshaft rotates by a predetermined angle, and the interrupt factor is only one of the interrupt factors X. The vector table is written by a boot program that is executed when the engine ECU 1 is started up by turning on the power. The state of the peripheral IC is a state value indicating a state that affects the load state of the
さて、CPU4は、ROM5に記憶されているスケジューラプログラムによりスケジューラ処理を繰り返して実行している。このスケジューラプログラムは、マイコンの状態に基づいてベクタテーブルに記憶されている割り込み要因Xのベクタテーブルの飛び先アドレスを変更するものである。即ち、図3に示すようにスケジューラ処理を開始すると、周辺ICやマイコンの状態を取得する(S101)。以降、CPU4は取得した状態に応じて、割り込み要因に対する割り込み処理を切り替える。具体的には、状態Aか(S102:NO)、状態Bか(S103:NO)、状態C(104:YES)または状態D(S104:NO)かを判断する。状態A,B,Cは、エンジンの低回転、通常回転、高回転に対応する。状態Dは、イグニッションスイッチがOFFされることに応じて、データのバックアップなどのシャットダウン処理を実行している状態で、エンジン制御に関する処理を停止している状態である。尚、エンジンの回転状態をさらに細かく分類するようにしても良い。
Now, the
ここで、クランク軸が所定角度回転する毎にクランクセンサ13からクランク信号が出力されるので、割り込み制御回路7は、クランク信号を入力したタイミングでCPU4に対して割り込み要求を出力し、それに応じてCPU4が割り込み処理を実行する。
Here, since the crank signal is output from the
ところで、割り込み処理は、エンジンの低回転時はCPU4の負荷が小さいことからエンジン制御に必要となる多くの処理を行うことができるが、通常時はCPU4の負荷が比較的大きいことから必要な処理だけを実施し、高回転時はCPU4の負荷が極めて大きいことから最低限必要な処理だけを実施することで、割り込み要因Xに対する割り込みプログラムを状況に応じて最適に実行することができる。従来では飛び先アドレスを書き変えた後にCPU4の負荷状態が変化した場合には対応できなかったが、本実施形態ではCPU4がスケジュールプログラムを実行することでスケジュール管理しているため対応が可能となる。
By the way, the interruption process can perform many processes necessary for engine control since the load on the
具体的には、状態Aの場合(S102:YES)、割り込み要因Xのベクタテーブルの飛び先アドレスをパターンAの処理内容に書き変えてから(S105)、スケジューラ処理を終了する。状態Bの場合(S103:YES)、割り込み要因Xのベクタテーブルの飛び先アドレスをパターンBに書き変えてから(S106)、スケジューラ処理を終了する。状態Cの場合(S104:YES)、割り込み要因Xのベクタテーブルの飛び先アドレスをパターンCに書き変えてから(S107)、スケジューラ処理を終了する。状態Dの場合(S104:NO)、割り込み要因Xのベクタテーブルの飛び先アドレスをパターンDに書き変えてから(S108)、スケジューラ処理を終了する。 Specifically, in the case of the state A (S102: YES), the jump destination address in the vector table of the interrupt factor X is rewritten to the processing content of the pattern A (S105), and the scheduler process is terminated. In the case of the state B (S103: YES), the jump destination address of the vector table of the interrupt factor X is rewritten to the pattern B (S106), and the scheduler process is terminated. In the case of the state C (S104: YES), the jump destination address in the vector table of the interrupt factor X is rewritten to the pattern C (S107), and the scheduler process is terminated. In the state D (S104: NO), the jump destination address of the vector table of the interrupt factor X is rewritten to the pattern D (S108), and the scheduler process is terminated.
この様に割り込み要因Xに対する処理パターンとして予め複数のパターンA〜Dが用意されており、割り込み要因Xによる割り込みが発生した場合、割り込みベクターブル内に示された飛び先アドレスの割り込みプログラムが実行される。この場合、CPU4によって飛び先アドレスは変更されるため、割り込みが発生した時点でパターンA〜Dのいずれかのプログラムが開始され、それぞれに応じてCPU4の負荷状態に対応した処理が実施されることになる。
In this way, a plurality of patterns A to D are prepared in advance as processing patterns for the interrupt factor X, and when an interrupt due to the interrupt factor X occurs, the interrupt program at the jump destination address shown in the interrupt vectorable is executed. The In this case, since the jump destination address is changed by the
具体的には、飛び先アドレスがパターンAプログラムとなっていた場合、図4に示すパターンAの割り込み処理が開始され、処理A、処理B、処理Cの順に実施した後、リターンする。飛び先アドレスがパターンBプログラムとなっていた場合、パターンBの割り込み処理が開始され、処理A、処理Dの順に実施した後、リターンする。飛び先アドレスがパターンCプログラムとなっていた場合、パターンCの割り込み処理が開始され、処理Aを実施した後、リターンする。飛び先アドレスがパターンDプログラムとなっていた場合、パターンDの割り込み処理が開始され、何の処理も実施することなくリターンする。つまり、イグニッションスイッチがOFFされた場合は、電源の自己保持状態を維持した状態でデータのバックアップ等のシャットダウン処理を実施し、シャットダウン処理が終了すると電源の自己保持状態を解除することで電源を遮断するようにしているが、シャットダウン処理中もエンジンが駆動していることに応じてクランク信号が入力している。このため、クランク信号の入力に応じて割り込み要因が発生することで、CPU4が割り込みプログラムを無駄に実行している状態となっていることから、割り込みプログラムを実行するにしてもCPU4の処理負担を軽減するための工夫である。
Specifically, if the jump address is a pattern A program, the pattern A interrupt processing shown in FIG. 4 is started, and after processing A, processing B, and processing C are performed in this order, the processing returns. If the jump address is a pattern B program, pattern B interrupt processing is started, processing A and processing D are performed in this order, and the process returns. If the jump address is a pattern C program, pattern C interrupt processing is started, and after processing A is executed, the process returns. If the jump address is a pattern D program, pattern D interrupt processing is started, and the process returns without performing any processing. In other words, when the ignition switch is turned off, shutdown processing such as data backup is performed while maintaining the power supply's self-holding state. However, the crank signal is input in response to the engine being driven even during the shutdown process. For this reason, since an interrupt factor is generated in response to the input of the crank signal, the
尚、割り込み制御回路7は、CPU4に割り込み要求を出力する場合、次に実行するアドレスを中断アドレスとしてスタック領域へ退避させてから出力する。その後、CPU4は、割り込みプログラムの実行を終了すると、中断アドレスから再開するので、割り込み前に実行していた処理を再開することができる。
When the interrupt control circuit 7 outputs an interrupt request to the
このような実施形態によれば、次のような効果を奏することができる。
CPU4は、エンジンの回転状態に応じてベクタテーブルに記憶されている飛び先アドレスを書き換えるので、エンジンの回転状態により示されるCPU4の負荷状態に応じて割り込み要因Xに対する飛び先アドレスを変更可能となり、同じ割り込み要因Xに対し状況に応じて処理内容を変更することができる。これにより、CPU4の負荷状態に応じて適切な割り込み処理を実行することができるので、CPU4の処理能力をより有効に活用することができる。
According to such an embodiment, the following effects can be produced.
Since the
割り込み処理内でCPU4の負荷状態によって分岐することが無いので、割り込み処理実行時に分岐判断の処理負荷を削減することができる。
エンジンの高回転時は割り込み要求の間隔が短くなり、CPU4への処理負荷が高負荷となるため、割り込み処理内容を変更することで必要な処理だけを実施するので、特にエンジンの高回転時の効果を顕著に発揮することができる。
Since no branching occurs depending on the load state of the
When the engine is running at high speed, the interrupt request interval is shortened and the processing load on the
(第2実施形態)
第2実施形態について図5を参照して説明するに、第1実施形態と同一のステップには同一のステップ番号を付す。この第2実施形態は、複数の割り込み要因に対して割り込み処理を実行することを特徴とする。
(Second Embodiment)
The second embodiment will be described with reference to FIG. 5. The same steps as those in the first embodiment are denoted by the same step numbers. The second embodiment is characterized in that interrupt processing is executed for a plurality of interrupt factors.
割り込み制御回路7は、外部から複数の割り込み要因を入力可能であり、何れかの割り込み要因を入力すると、割り込み要求をCPU4に出力すると同時に、その入力した割り込み要因を特定可能な情報をCPU4に出力する。本実施形態では、説明の簡単化のために割り込み要因X,Yの2つの割り込み要因を説明するが、3つ以上の割り込み要因を入力可能としても良い。
The interrupt control circuit 7 can input a plurality of interrupt factors from the outside. When any interrupt factor is input, the interrupt control circuit 7 outputs an interrupt request to the
CPU4は、図5に示すようにスケジューラ処理を開始すると、第1実施形態と同様に、CPU4の負荷状態を取得してから(S101)、状態A〜Dに応じて(S102〜S104)、割り込み要因に対する割り込み処理を切り替える。即ち、状態Aの場合(S102:YES)、割り込み要因Xのベクタテーブルの飛び先アドレスをパターンAの処理内容に書き変えると共に(S105)、割り込み要因Yのベクタテーブルの飛び先アドレスをパターンAに書き換えてから(S201)、スケジューラ処理を終了する。状態Bの場合(S103:YES)、割り込み要因Xのベクタテーブルの飛び先アドレスをパターンBに書き変えると共に(S106)、割り込み要因Yのベクタテーブルの飛び先アドレスをパターンBに書き変えてから(S202)、スケジューラ処理を終了する。状態Cの場合(S104:YES)、割り込み要因Xのベクタテーブルの飛び先アドレスをパターンCに書き変えると共に(S107)、割り込み要因Yのベクタテーブルの飛び先アドレスをパターンCに書き変えてから(S203)、スケジューラ処理を終了する。状態Dの場合(S104:NO)、割り込み要因Xのベクタテーブルの飛び先アドレスをパターンDに書き変えると共に(S108)、割り込み要因Yのベクタテーブルの飛び先アドレスをパターンDに書き変えてから(S204)、スケジューラ処理を終了する。
When starting the scheduler process as shown in FIG. 5, the
このような実施形態によれば、CPU4は、複数の割り込み要因に対する飛び先アドレスをCPU4の負荷状態に応じて一括して書き換えるので、飛び先アドレスの書き換えに要する負担を抑制することができる。これにより各割り込みプログラム内で次の飛び先を判断する必要がなく、処理負荷を軽減することができる。特に割り込み要因数が多くなる程、その効果を顕著に発揮することができる。
According to such an embodiment, the
(第3実施形態)
第3実施形態について図6を参照して説明する。この第3実施形態は、CPU4の負荷状態が変化した場合のみ飛び先アドレスを変更することを特徴とする。第1実施形態及び第2実施形態では、スケジューラ処理を開始する毎にCPU4の負荷状態に応じてベクタテーブルの飛び先アドレスを書き換えたが、それではCPU4の負荷状態が変化しない場合であっても、ベクタテーブルの飛び先アドレスを同じ飛び先アドレスに書き換えることになり無駄な処理を実行することになる。
(Third embodiment)
A third embodiment will be described with reference to FIG. The third embodiment is characterized in that the jump destination address is changed only when the load state of the
そこで、CPU4は、図6に示すようにスケジューラ処理を開始すると、第1実施形態と同様の動作を実行した後、今回取得したエンジンの回転状態をRAM6上に状態値として更新記憶する(S302)。
Therefore, when starting the scheduler process as shown in FIG. 6, the
次のタイミングでスケジューラ処理を実行する場合は、上述のようにして記憶更新した前回の状態値と今回の状態値とを比較し(S301)、前回の状態値と変更が無い場合は(S301:NO)、何もすることなく終了する。これに対して、前回の状態値と変更が有る場合は(S301:YES)、状態A〜Dに対応した処理を実行した後(S102〜S108)、RAM6上に記憶した状態値を更新記憶してから(S302)、スケジューラ処理を終了する。 When the scheduler process is executed at the next timing, the previous state value stored and updated as described above is compared with the current state value (S301), and if there is no change from the previous state value (S301: NO), it ends without doing anything. On the other hand, when there is a change from the previous state value (S301: YES), after executing the processing corresponding to the states A to D (S102 to S108), the state value stored in the RAM 6 is updated and stored. (S302), the scheduler process is terminated.
このような実施形態によれば、CPU4の負荷状態が変化した場合のみベクタテーブルの飛び先アドレスを書き変えるので、CPU4の処理負荷を大幅に軽減することができる。特にCPU4の負荷状態が一定、つまりエンジンの回転状態が維持される場合に効果が顕著となる。
According to such an embodiment, since the jump address of the vector table is rewritten only when the load state of the
(その他の実施形態)
本発明は、上記実施形態に限定されることなく、次のように変形または拡張したり、各変形例を上記実施形態と組み合せたり、各変形例を組み合わせるようにしても良い。
(Other embodiments)
The present invention is not limited to the above-described embodiment, but may be modified or expanded as follows, each modified example may be combined with the above-described embodiment, or each modified example may be combined.
クランク軸の回転に同期したタイミングでスケジューラ処理を実行するのに代えて、タイマ8によるイベントの発生に同期したタイミングで実行するようにしても良い。
駆動源としてはガソリンエンジンに限定されることなくディーゼルエンジンに適用しても良いし、電気自動車やハイブリッド自動車のように駆動源となるモータに適用するようにしても良い。
Instead of executing the scheduler process at a timing synchronized with the rotation of the crankshaft, it may be executed at a timing synchronized with the occurrence of an event by the
The drive source is not limited to a gasoline engine, and may be applied to a diesel engine, or may be applied to a motor serving as a drive source such as an electric vehicle or a hybrid vehicle.
本開示は、実施例に準拠して記述されたが、本開示は当該実施例や構造に限定されるものではないと理解される。本開示は、様々な変形例や均等範囲内の変形をも包含する。加えて、様々な組み合わせや形態、さらには、それらに一要素のみ、それ以上、あるいはそれ以下、を含む他の組み合わせや形態をも、本開示の範疇や思想範囲に入るものである。 Although the present disclosure has been described with reference to the embodiments, it is understood that the present disclosure is not limited to the embodiments and structures. The present disclosure includes various modifications and modifications within the equivalent range. In addition, various combinations and forms, as well as other combinations and forms including only one element, more or less, are within the scope and spirit of the present disclosure.
図面中、1はエンジンECU(車載電子制御装置)、2はマイクロコンピュータ、4はCPU、4aは取得部、4bはスケジューラ、6は記憶部、7は割り込み制御回路(割り込み制御部)である。
In the drawings, 1 is an engine ECU (on-vehicle electronic control device), 2 is a microcomputer, 4 is a CPU, 4a is an acquisition unit, 4b is a scheduler, 6 is a storage unit, and 7 is an interrupt control circuit (interrupt control unit).
Claims (4)
前記マイクロコンピュータは、
割り込み要因が発生した場合は、前記CPUに割り込みを要求すると共に前記CPUが次に実行する予定であったアドレスを前記中断アドレスとして退避する割り込み制御部(7)と、
前記CPUの動作に影響を及ぼす負荷状態を取得する取得部(4a)と、
前記負荷状態に応じて、前記記憶部に記憶されている飛び先アドレスを前記CPUの負荷状態に応じた処理を実行する割り込みプログラムのアドレスに変更する書き換え処理を実行するスケジューラ(4b)と、
を備えた車載電子制御装置。 A storage unit (6) that stores the jump address corresponding to the interrupt factor in an updatable manner, and when an interrupt request is received, moves to the jump address stored in the storage unit and interrupts the jump address In the in-vehicle electronic control device that controls the vehicle equipment mainly by the microcomputer (2) including the CPU (4) that shifts to the interruption address when the execution of the program is finished,
The microcomputer is
When an interrupt factor occurs, an interrupt control unit (7) that requests an interrupt from the CPU and saves an address that the CPU is scheduled to execute next as the interrupt address;
An acquisition unit (4a) for acquiring a load state affecting the operation of the CPU;
A scheduler (4b) for executing a rewrite process for changing a jump destination address stored in the storage unit to an address of an interrupt program for executing a process corresponding to the load state of the CPU according to the load state;
A vehicle-mounted electronic control device comprising:
前記スケジューラは、前記CPUの動作に影響を及ぼす全ての割り込み要因に対する書き換え処理を一括して実行する請求項1または2に記載の車載電子制御装置。 Multiple interrupt factors are set,
The on-vehicle electronic control device according to claim 1, wherein the scheduler collectively executes rewrite processing for all interrupt factors affecting the operation of the CPU.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2016208589A JP2018072921A (en) | 2016-10-25 | 2016-10-25 | On-vehicle electronic control device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2016208589A JP2018072921A (en) | 2016-10-25 | 2016-10-25 | On-vehicle electronic control device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2018072921A true JP2018072921A (en) | 2018-05-10 |
Family
ID=62111600
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2016208589A Pending JP2018072921A (en) | 2016-10-25 | 2016-10-25 | On-vehicle electronic control device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2018072921A (en) |
-
2016
- 2016-10-25 JP JP2016208589A patent/JP2018072921A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP2003214233A (en) | Vehicle electronic control unit | |
| JP5664454B2 (en) | Electronic control device for vehicle | |
| JP2000020178A (en) | Electronic controller | |
| JP2013003724A (en) | In-vehicle electronic control unit | |
| JP2018072921A (en) | On-vehicle electronic control device | |
| JP3783553B2 (en) | Information processing device | |
| JP5667810B2 (en) | Control apparatus and control method | |
| US7930523B2 (en) | Inter-CPU data transfer device | |
| JP2017182627A (en) | Microcomputer | |
| JP6466269B2 (en) | Electronic control device and stack area usage monitoring method | |
| US6671565B1 (en) | Electronic control apparatus having mode check function | |
| JP3849379B2 (en) | ENGINE CONTROL DEVICE AND ENGINE CONTROL METHOD | |
| JP6183251B2 (en) | Electronic control unit | |
| JP4321472B2 (en) | Control device | |
| US7853768B2 (en) | Electronic control apparatus and method for writing backup data in electronic control apparatus | |
| CN107710162B (en) | Electronic control device and stack using method | |
| JP2021152338A (en) | Controller | |
| JP2016165912A (en) | Electronic control unit | |
| US20110251821A1 (en) | Method and device for testing a computer core in a processor having at least two computer cores | |
| JP2020052960A (en) | Vehicle control device and vehicle control method | |
| JP7676080B2 (en) | Electronic control device for vehicle and control method using electronic control device for vehicle | |
| JP5287657B2 (en) | VEHICLE CONTROL DEVICE AND ITS CONTROL METHOD | |
| JP6834671B2 (en) | Electronic control device | |
| JP2025016143A (en) | Electronic control device and control method for electronic control device | |
| JP3732064B2 (en) | Ignition timing control device |