[go: up one dir, main page]

JP2018072921A - On-vehicle electronic control device - Google Patents

On-vehicle electronic control device Download PDF

Info

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
Application number
JP2016208589A
Other languages
Japanese (ja)
Inventor
悠 村西
Yu Muranishi
悠 村西
勇 水野
Isamu Mizuno
勇 水野
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Denso Corp
Original Assignee
Denso Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Denso Corp filed Critical Denso Corp
Priority to JP2016208589A priority Critical patent/JP2018072921A/en
Publication of JP2018072921A publication Critical patent/JP2018072921A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

PROBLEM TO BE SOLVED: To execute interruption processing corresponding to a load state of a CPU.SOLUTION: As a CPU 4 rewrites a jump destination address stored in a vector table according to a rotational state of an engine, the jump destination address for an interruption factor can be changed according to a load state of the CPU 4 indicated with the rotational state of the engine, and then processing details can be changed according to a situation for the same interruption factor. Consequently, proper interruption processing can be performed according to the load state of the CPU 4, so processing capability of the CPU 4 can be utilized more effectively.SELECTED DRAWING: Figure 1

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.

特開平4−296938号公報Japanese Patent Laid-Open No. 4-29638

上記技術の割り込み制御機能は、スタートアップ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の構成を示す機能ブロック図Functional block diagram showing the configuration of the engine ECU in the first embodiment 割り込みベクタテーブルの飛び先アドレスとプログラムとの関係を示す図Diagram showing the relationship between the jump address of the interrupt vector table and the program CPUによるスケジューラ処理を示すフローチャートFlow chart showing scheduler processing by CPU CPUによる割り込み処理を示すフローチャートFlow chart showing interrupt processing by CPU 第2実施形態におけるCPUによるスケジューラ処理を示すフローチャートThe flowchart which shows the scheduler process by CPU in 2nd Embodiment. 第3実施形態におけるCPUによるスケジューラ処理を示すフローチャートThe flowchart which shows the scheduler process by CPU in 3rd Embodiment.

(第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 CPU 4, a ROM 5, a RAM 6 (corresponding to a storage unit), an interrupt control circuit 7, a timer 8, and an input / output port 9, and performs various processes for controlling an engine (not shown). The external input / output circuit 3 performs signal input / output processing with an external device for controlling the engine ECU 1.

ROM5にはエンジンを制御するための各種プログラムが格納されており、CPU4は、ROM5に格納された各種プログラムを実行することでエンジンを制御する。タイマ8は、エンジンを制御するのに必要な各種パルス信号を出力するタイミングを決定するために設けられている。RAM6には各種プログラムが処理に用いる演算データを一時的に格納する領域が確保されている。尚、ROM5やRAM6に代えて、ハードディスクドライブやフラッシュメモリに代表される半導体メモリのような非遷移的実体的記録媒体を設けるようにしても良い。   Various programs for controlling the engine are stored in the ROM 5, and the CPU 4 controls the engine by executing the various programs stored in the ROM 5. The timer 8 is provided for determining the timing for outputting various pulse signals necessary for controlling the engine. The RAM 6 has an area for temporarily storing operation data used by various programs for processing. In place of the ROM 5 and the RAM 6, a non-transitional tangible recording medium such as a semiconductor memory represented by a hard disk drive or a flash memory may be provided.

外部入出力回路3には、インジェクタ10、イグナイタ11、電子スロットル12、クランクセンサ13、水温センサ14、スロットルセンサ15などエンジンを制御するための各種アクチュエータやエンジンの状態を検出するための各種センサが接続されている。インジェクタ10は、エンジンの吸気通路に燃料を噴射する。電子スロットル12は、エンジンの吸気通路を流れる空気量を調節する。イグナイタ11は、エンジンの点火プラグ(図示せず)に着火させる。   The external input / output circuit 3 includes various actuators for controlling the engine, such as an injector 10, an igniter 11, an electronic throttle 12, a crank sensor 13, a water temperature sensor 14, and a throttle sensor 15, and various sensors for detecting the state of the engine. It is connected. The injector 10 injects fuel into the intake passage of the engine. The electronic throttle 12 adjusts the amount of air flowing through the intake passage of the engine. The igniter 11 ignites an ignition plug (not shown) of the engine.

クランクセンサ13は、エンジンのクランク軸の回転に応じて所定角度毎(例えば30゜CA毎)にエッジをクランク信号として出力する。水温センサ14は、エンジンの冷却水の温度を検出する。スロットルセンサ15は、電子スロットル12の開度を検出する。   The crank sensor 13 outputs an edge as a crank signal at every predetermined angle (for example, every 30 ° CA) according to the rotation of the crankshaft of the engine. The water temperature sensor 14 detects the temperature of engine cooling water. The throttle sensor 15 detects the opening degree of the electronic throttle 12.

外部入出力回路3は、入力した各種信号をデジタル信号に波形整形しマイコン2に出力する。また、外部入出力回路3はA/D変換器(図示せず)を内蔵しており、水温センサ14やスロットルセンサ15によるアナログセンサ信号を入力し、A/D変換器を用いてデジタル信号に変換してマイコン2に出力する。   The external input / output circuit 3 shapes the various input signals into digital signals and outputs them to the microcomputer 2. Further, the external input / output circuit 3 has a built-in A / D converter (not shown), inputs analog sensor signals from the water temperature sensor 14 and the throttle sensor 15 and converts them into digital signals using the A / D converter. The data is converted and output to the microcomputer 2.

割り込み制御回路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 crank sensor 13 as an interrupt factor, and outputs an interrupt request to the CPU 4 when the crank signal is input.
As shown in FIG. 2, the ROM 5 stores a scheduler program and pattern A to D programs. When the CPU 4 executes the scheduler program, the operations of the acquisition unit 4a and the scheduler 4b shown in FIG. 1 are realized. As will be described later, the scheduler program performs processing (rewriting processing) for rewriting destination addresses stored in the interrupt vector table (hereinafter referred to as vector table) of the RAM 6 to the addresses of the patterns A to D in accordance with the engine rotation state. It is something to execute. In the present embodiment, the patterns A to D are shown as programs for controlling the engine for the sake of simplicity of explanation, but in reality, the engine is controlled by a number of programs.

図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 CPU 4, and the CPU 4 can indirectly determine the load state of the CPU 4 by acquiring the state value from the peripheral IC when executing the interrupt program. It becomes. The state of the microcomputer is a state value indicating a state that affects the load on the CPU 4, and the CPU 4 can directly determine the load state of the CPU 4 by acquiring the state value from the state of the microcomputer when the interrupt program is executed. Become. In this embodiment, the rotational state of the engine is stored in the RAM 6, and the load state of the CPU 4 is directly determined based on the rotational state. The rotation state is a low rotation, normal rotation, or high rotation of the engine. Therefore, in this embodiment, the state value stored as the state of the microcomputer is directly used to determine the load state of the CPU 4.

さて、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 CPU 4 repeatedly executes the scheduler process by the scheduler program stored in the ROM 5. This scheduler program changes the jump destination address of the vector table of the interrupt factor X stored in the vector table based on the state of the microcomputer. That is, as shown in FIG. 3, when the scheduler process is started, the status of peripheral ICs and microcomputers is acquired (S101). Thereafter, the CPU 4 switches the interrupt process for the interrupt factor according to the acquired state. Specifically, it is determined whether the state is A (S102: NO), B (S103: NO), C (104: YES), or D (S104: NO). States A, B, and C correspond to engine low speed, normal speed, and high speed. State D is a state in which shutdown processing such as data backup is being executed and processing related to engine control is stopped in response to the ignition switch being turned off. Note that the engine rotation state may be further classified.

ここで、クランク軸が所定角度回転する毎にクランクセンサ13からクランク信号が出力されるので、割り込み制御回路7は、クランク信号を入力したタイミングでCPU4に対して割り込み要求を出力し、それに応じてCPU4が割り込み処理を実行する。   Here, since the crank signal is output from the crank sensor 13 every time the crankshaft rotates by a predetermined angle, the interrupt control circuit 7 outputs an interrupt request to the CPU 4 at the timing when the crank signal is input, and accordingly The CPU 4 executes interrupt processing.

ところで、割り込み処理は、エンジンの低回転時は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 CPU 4 is small when the engine is running at a low speed. However, the interruption process is necessary because the load on the CPU 4 is relatively large at normal times. Since the load on the CPU 4 is very high during high rotation, only the minimum necessary processing is executed, so that the interrupt program for the interrupt factor X can be optimally executed according to the situation. Conventionally, it was not possible to cope with a change in the load state of the CPU 4 after rewriting the jump address, but in the present embodiment, the CPU 4 executes the schedule program to manage the schedule, so that the correspondence can be made. .

具体的には、状態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 CPU 4, one of the patterns A to D is started when an interrupt occurs, and processing corresponding to the load state of the CPU 4 is performed according to each program. become.

具体的には、飛び先アドレスがパターン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 CPU 4 is in a state of executing the interrupt program unnecessarily, so even if the interrupt program is executed, the processing load on the CPU 4 is reduced. It is a device to reduce.

尚、割り込み制御回路7は、CPU4に割り込み要求を出力する場合、次に実行するアドレスを中断アドレスとしてスタック領域へ退避させてから出力する。その後、CPU4は、割り込みプログラムの実行を終了すると、中断アドレスから再開するので、割り込み前に実行していた処理を再開することができる。   When the interrupt control circuit 7 outputs an interrupt request to the CPU 4, the interrupt control circuit 7 saves the next execution address as an interruption address in the stack area and outputs it. Thereafter, when the CPU 4 finishes executing the interrupt program, the CPU 4 restarts from the interrupt address, so that the processing executed before the interrupt can be restarted.

このような実施形態によれば、次のような効果を奏することができる。
CPU4は、エンジンの回転状態に応じてベクタテーブルに記憶されている飛び先アドレスを書き換えるので、エンジンの回転状態により示されるCPU4の負荷状態に応じて割り込み要因Xに対する飛び先アドレスを変更可能となり、同じ割り込み要因Xに対し状況に応じて処理内容を変更することができる。これにより、CPU4の負荷状態に応じて適切な割り込み処理を実行することができるので、CPU4の処理能力をより有効に活用することができる。
According to such an embodiment, the following effects can be produced.
Since the CPU 4 rewrites the jump address stored in the vector table according to the engine rotation state, the jump address for the interrupt factor X can be changed according to the load state of the CPU 4 indicated by the engine rotation state. The processing content can be changed according to the situation for the same interrupt factor X. As a result, appropriate interrupt processing can be executed in accordance with the load state of the CPU 4, so that the processing capability of the CPU 4 can be utilized more effectively.

割り込み処理内でCPU4の負荷状態によって分岐することが無いので、割り込み処理実行時に分岐判断の処理負荷を削減することができる。
エンジンの高回転時は割り込み要求の間隔が短くなり、CPU4への処理負荷が高負荷となるため、割り込み処理内容を変更することで必要な処理だけを実施するので、特にエンジンの高回転時の効果を顕著に発揮することができる。
Since no branching occurs depending on the load state of the CPU 4 in the interrupt process, the processing load for branch determination can be reduced when the interrupt process is executed.
When the engine is running at high speed, the interrupt request interval is shortened and the processing load on the CPU 4 is high. Therefore, only necessary processing is performed by changing the interrupt processing content, especially when the engine is running at high speed. The effect can be exhibited remarkably.

(第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 CPU 4 and at the same time outputs information that can identify the input interrupt factor to the CPU 4. To do. In the present embodiment, two interrupt factors, interrupt factors X and Y, will be described for the sake of simplicity of explanation, but three or more interrupt factors may be input.

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 CPU 4 acquires the load state of the CPU 4 (S101) and interrupts according to the states A to D (S102 to S104), as in the first embodiment. Switch the interrupt processing for the cause. That is, in the state A (S102: YES), the jump destination address of the vector table of the interrupt factor X is rewritten to the processing contents of the pattern A (S105), and the jump destination address of the vector table of the interrupt factor Y is changed to the pattern A. After rewriting (S201), the scheduler process is terminated. In the case of state B (S103: YES), the jump destination address of the vector table for interrupt factor X is rewritten to pattern B (S106), and the jump destination address of the vector table for interrupt factor Y is rewritten to pattern B ( S202), the scheduler process is terminated. In the case of the state C (S104: YES), the jump destination address of the interrupt factor X vector table is rewritten to the pattern C (S107), and the jump destination address of the interrupt factor Y vector table is rewritten to the pattern C ( S203), the scheduler process is terminated. In the state D (S104: NO), the jump destination address of the interrupt factor X vector table is rewritten to the pattern D (S108), and the jump destination address of the interrupt factor Y vector table is rewritten to the pattern D ( S204), the scheduler process is terminated.

このような実施形態によれば、CPU4は、複数の割り込み要因に対する飛び先アドレスをCPU4の負荷状態に応じて一括して書き換えるので、飛び先アドレスの書き換えに要する負担を抑制することができる。これにより各割り込みプログラム内で次の飛び先を判断する必要がなく、処理負荷を軽減することができる。特に割り込み要因数が多くなる程、その効果を顕著に発揮することができる。   According to such an embodiment, the CPU 4 collectively rewrites the jump destination addresses for a plurality of interrupt factors in accordance with the load state of the CPU 4, so that the burden required for rewriting the jump destination address can be suppressed. Thus, it is not necessary to determine the next jump destination in each interrupt program, and the processing load can be reduced. In particular, as the number of interrupt factors increases, the effect can be remarkably exhibited.

(第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 CPU 4 changes. In the first embodiment and the second embodiment, the jump destination address of the vector table is rewritten according to the load state of the CPU 4 every time the scheduler process is started, but even if the load state of the CPU 4 does not change, Since the jump destination address of the vector table is rewritten to the same jump destination address, useless processing is executed.

そこで、CPU4は、図6に示すようにスケジューラ処理を開始すると、第1実施形態と同様の動作を実行した後、今回取得したエンジンの回転状態をRAM6上に状態値として更新記憶する(S302)。   Therefore, when starting the scheduler process as shown in FIG. 6, the CPU 4 executes the same operation as in the first embodiment, and then updates and stores the currently acquired engine rotation state as a state value in the RAM 6 (S302). .

次のタイミングでスケジューラ処理を実行する場合は、上述のようにして記憶更新した前回の状態値と今回の状態値とを比較し(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 CPU 4 changes, the processing load on the CPU 4 can be greatly reduced. In particular, the effect is remarkable when the load state of the CPU 4 is constant, that is, when the engine rotation state is maintained.

(その他の実施形態)
本発明は、上記実施形態に限定されることなく、次のように変形または拡張したり、各変形例を上記実施形態と組み合せたり、各変形例を組み合わせるようにしても良い。
(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 timer 8.
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)

割り込み要因に対応する飛び先アドレスを更新可能に記憶する記憶部(6)と、割り込み要求を受けた場合は、前記記憶部に記憶されている飛び先アドレスに移行し、当該飛び先アドレスの割り込みプログラムの実行が終了した場合は、中断アドレスに移行するCPU(4)と、を備えたマイクロコンピュータ(2)を主体として車両機器を制御する車載電子制御装置において、
前記マイクロコンピュータは、
割り込み要因が発生した場合は、前記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に記載の車載電子制御装置。   The in-vehicle electronic control device according to claim 1, wherein at least one of processing reduction, processing change, and processing stop when the CPU executes the interrupt program is executed as the processing according to the load state. 割り込み要因は複数設定されており、
前記スケジューラは、前記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.
前記スケジューラは、前記取得部が取得した前記負荷状態が変化した場合に前記書き換え処理を実行する請求項1から3の何れか一項に記載の車載電子制御装置。   The in-vehicle electronic control device according to any one of claims 1 to 3, wherein the scheduler executes the rewriting process when the load state acquired by the acquisition unit changes.
JP2016208589A 2016-10-25 2016-10-25 On-vehicle electronic control device Pending JP2018072921A (en)

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)

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