JP2008107914A - Microcomputer, program and electronic control device for vehicle - Google Patents

Microcomputer, program and electronic control device for vehicle Download PDF

Info

Publication number
JP2008107914A
JP2008107914A JP2006287828A JP2006287828A JP2008107914A JP 2008107914 A JP2008107914 A JP 2008107914A JP 2006287828 A JP2006287828 A JP 2006287828A JP 2006287828 A JP2006287828 A JP 2006287828A JP 2008107914 A JP2008107914 A JP 2008107914A
Authority
JP
Japan
Prior art keywords
task
application
microcomputer
wake
sleep
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
JP2006287828A
Other languages
Japanese (ja)
Inventor
Koichiro Yokoyama
耕一郎 横山
Shuichi Nitta
修一 新田
Shinichi Senoo
伸一 妹尾
Masaya Hirota
雅也 廣田
Akihiro Sasaki
明博 佐々木
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 JP2006287828A priority Critical patent/JP2008107914A/en
Publication of JP2008107914A publication Critical patent/JP2008107914A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

<P>PROBLEM TO BE SOLVED: To suppress useless processing and power consumption of a microcomputer. <P>SOLUTION: The microcomputer enters a sleep mode when a plurality of application tasks are executed and all the application tasks are not needed to be executed. When the microcomputer in the sleep mode wakes up by one of plural kinds of wake-up factors, a state management task wakes up, and the current wake-up factor this time is discriminated by the state management task (S310), and only the application task to wake up by the discriminated wake-up factor, is worken up (S320). The unnecessary increase of processing load is thereby prevented, and the following problem can be solved that unnecessary application tasks cannot be executed, so that a sleepable task cannot be determined quickly. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、マイクロコンピュータの消費電力を低減するための技術に関する。   The present invention relates to a technique for reducing power consumption of a microcomputer.

従来より、例えば車両用電子制御装置に搭載されるマイクロコンピュータにおいては、OS(オペレーティングシステム)によるマルチタスクの機能を利用して、制御対象を制御するための複数のアプリケーションタスクを実行するようにしている。   2. Description of the Related Art Conventionally, for example, in a microcomputer mounted on an electronic control device for a vehicle, a plurality of application tasks for controlling an object to be controlled are executed by using a multitask function by an OS (Operating System) Yes.

そして、この種のマイクロコンピュータにおいては、処理を行わなくても良くなった場合に、例えば、CPUのクロック周波数又は電源電圧を下げたり、CPUへのクロック供給又は電源供給を停止したりして、通常動作時よりも消費電力の少ないスリープモードに移行させることが行われている(例えば、特許文献1参照)。   In this type of microcomputer, when it is not necessary to perform processing, for example, the CPU clock frequency or power supply voltage is lowered, or the clock supply or power supply to the CPU is stopped, Transition to a sleep mode, which consumes less power than during normal operation, is performed (see, for example, Patent Document 1).

次に、マイクロコンピュータをスリープモードに移行させるための手法の一具体例について、図7を用い説明する。尚、以下では、アプリケーションタスクを、略してアプリタスクともいう。また、本明細書においては、便宜上、「タスクが・・・する」といったプログラムを主体とした表現を適宜用いるが、その表現は、そのプログラムをコンピュータが実行することで実現される機能手段の動作内容(簡単に言えば、そのプログラムの機能の内容)を表している。   Next, a specific example of a method for shifting the microcomputer to the sleep mode will be described with reference to FIG. Hereinafter, the application task is also referred to as an application task for short. In addition, in this specification, for the sake of convenience, an expression based on a program such as “task is ...” is appropriately used, but the expression is an operation of a functional unit realized by the computer executing the program. Indicates the contents (or simply, the function contents of the program).

まず、図7の例では、アプリタスクとして、アプリタスク1とアプリタスク2とがあり、また、それら各アプリタスク1,2を起床させたり、スリープ/ウェイクアップの制御等を行う状態管理タスクがある。そして、この例において、状態管理タスクは一定時間毎に起床され、図7では、時刻t1,t3,t6が、状態管理タスクの起床タイミングである。また、各タスクの優先順位は、「状態管理タスク>アプリタスク1>アプリタスク2」の順になっている。そして、アプリタスク1,2は、時刻t1で起床した状態管理タスクによって起床要求されており、アプリタスク1は、状態管理タスクの実行が終了するとすぐに実行が開始されるが、アプリタスク2は、状態管理タスク及びアプリタスク1よりも優先順位が低いため、アプリタスク1の実行が終了した時刻t2から実行が開始される。更に、アプリタスク2は、次回の状態管理タスクの実行中(時刻t3〜t4)は中断され、時刻t3と時刻t6との間の時刻t5まで実行期間が伸びている。   First, in the example of FIG. 7, there are an application task 1 and an application task 2 as application tasks, and a state management task for waking up each of these application tasks 1 and 2 and controlling sleep / wakeup, etc. is there. In this example, the state management task is woken up at regular intervals. In FIG. 7, times t1, t3, and t6 are wake-up timings of the state management task. The priority order of each task is in the order of “status management task> application task 1> application task 2.” The application tasks 1 and 2 are requested to wake up by the state management task that wakes up at time t1, and the execution of the application task 1 starts as soon as the execution of the state management task ends. Since the priority is lower than that of the state management task and the application task 1, the execution is started from the time t2 when the execution of the application task 1 is completed. Further, the application task 2 is interrupted during execution of the next state management task (time t3 to t4), and the execution period extends to time t5 between time t3 and time t6.

ここで、アプリタスク1,2の各々は、自タスクが実行されなくても良い状態(以下、スリープ可能状態という)であるか否かを判定し、スリープ可能状態であると判定すると、各アプリタスク毎に設けられたスリープ可否フラグのうち、自タスクに対応するスリープ可否フラグをセットするための処理を行う。   Here, each of the application tasks 1 and 2 determines whether or not the own task does not have to be executed (hereinafter referred to as a sleep-enabled state). Of the sleep propriety flags provided for each task, a process for setting a sleep feasibility flag corresponding to the own task is performed.

そして、状態管理タスクは、起床すると、全アプリタスクのスリープ可否フラグをチェックし、それらが全てセットされていれば、アプリタスクの起床要求を行うことなく、マイクロコンピュータをスリープモードに移行させるための処理を行う。   When the state management task wakes up, it checks the sleep enable / disable flags of all the application tasks. If all of them are set, the state management task is used to shift the microcomputer to the sleep mode without making a wakeup request for the application task. Process.

このため、図7の例では、時刻t2でアプリタスク1がスリープ可能状態になったと判定し、時刻t5でアプリタスク2がスリープ可能状態になったと判定すると、その後の時刻t6で状態管理タスクが起床した際に、その状態管理タスクがマイクロコンピュータをスリープモードに移行させることとなる。   Therefore, in the example of FIG. 7, when it is determined that the application task 1 is in the sleep-capable state at time t2, and it is determined that the application task 2 is in the sleep-capable state at time t5, the state management task is performed at the subsequent time t6. When the user wakes up, the state management task shifts the microcomputer to the sleep mode.

一方、スリープモードにあるマイクロコンピュータをウェイクアップ(通常動作に復帰)させる要因(ウェイクアップ要因)は複数種類あるのが一般的である。
そして、従来のマイクロコンピュータでは、何れかのウェイクアップ要因が発生してウェイクアップすると、全てのアプリタスクが起床されるようになっていた。
On the other hand, there are generally several types of factors (wakeup factors) that cause the microcomputer in the sleep mode to wake up (return to normal operation).
In the conventional microcomputer, when any wake-up factor occurs and wakes up, all application tasks are woken up.

例えば、図7の例では、時刻t1で、何らかのウェイクアップ要因が発生したことにより、マイクロコンピュータがスリープモードからウェイクアップして状態管理タスクが起床され、その初回の状態管理タスクが、アプリタスク1,2の全てを起床させている。そして、発生したウェイクアップ要因が、たとえアプリタスク1にのみ関連するものであったとしても、アプリタスク1,2の全てが起床されることとなる。
特開2005−182223号公報
For example, in the example of FIG. 7, the occurrence of some wake-up factor at time t1, the microcomputer wakes up from the sleep mode and wakes up the state management task. , 2 are all awakened. And even if the generated wake-up factor is related only to the application task 1, all of the application tasks 1 and 2 are woken up.
JP 2005-182223 A

ところで、ウェイクアップ要因が発生した場合に、常に全てのアプリタスクを起床させるように構成したのでは、マイクロコンピュータの処理負荷が不必要に増加してしまう上に、次にスリープモードへ移行するまでの時間が増加してしまい、その分、マイクロコンピュータでの消費電力が増大してしまうという問題がある。   By the way, when the wake-up factor occurs, if all the app tasks are always woken up, the processing load on the microcomputer will increase unnecessarily, and until the next transition to sleep mode. There is a problem that the power consumption in the microcomputer increases accordingly.

例えば、図7において、時刻t1で発生したウェイクアップ要因がアプリタスク1にのみ関連するものであり、時刻t2でアプリタスク1がスリープ可能状態になったと判定したとすると、本当ならば、その時刻t2で、マイクロコンピュータは再びスリープモードへ移行しても良い状態となる。   For example, in FIG. 7, if it is determined that the wake-up factor generated at time t1 is related only to the application task 1 and the application task 1 is in a sleep-enabled state at time t2, At t2, the microcomputer is in a state where it may shift to the sleep mode again.

このため、その次に状態管理タスクが起床されて該状態管理タスクの実行が終了する時刻t4でマイクロコンピュータをスリープモードに移行させることができれば良いのであるが、アプリタスク2も起床されていると、スリープモードへの移行タイミングが前述の時刻t6まで伸びてしまうこととなる。よって、図7に示しているような無駄な動作期間が発生してしまい、その分、無駄な処理と消費電力が発生することとなる。   For this reason, it is sufficient that the microcomputer can be shifted to the sleep mode at time t4 when the state management task is subsequently woken up and the execution of the state management task is finished. However, the application task 2 is also woken up. Therefore, the transition timing to the sleep mode is extended to the above-described time t6. Therefore, a useless operation period as shown in FIG. 7 occurs, and useless processing and power consumption occur accordingly.

本発明は、こうした問題に鑑みなされたものであり、マイクロコンピュータの無駄な処理及び電力消費を抑制することを目的としている。   The present invention has been made in view of these problems, and an object thereof is to suppress unnecessary processing and power consumption of a microcomputer.

上記目的を達成するためになされた請求項1のマイクロコンピュータでは、複数のアプリケーションタスクが実行される。また、このマイクロコンピュータは、全てのアプリケーションタスクが実行されなくても良い状態になったか否かを判定する判定手段を備え、その判定手段により肯定判定されると、通常動作時よりも消費電力の少ないスリープモードに移行するようになっている。   In order to achieve the above object, the microcomputer according to claim 1 executes a plurality of application tasks. The microcomputer also includes a determination unit that determines whether or not all application tasks need not be executed. If the determination unit makes an affirmative determination, the microcomputer consumes less power than during normal operation. Transition to less sleep mode.

そして特に、このマイクロコンピュータには、ウェイクアップ時タスク起床制御手段が備えられている。
そのウェイクアップ時タスク起床制御手段は、当該マイクロコンピュータがスリープモードになっている場合に、複数種類のウェイクアップ要因のうちの何れかが発生して、当該マイクロコンピュータがスリープモードからウェイクアップすると、その発生したウェイクアップ要因を判別すると共に、前記複数のアプリケーションタスクのうち、その判別したウェイクアップ要因が発生した場合に起床されるべきアプリケーションタスクのみを起床させる。
In particular, this microcomputer is provided with a wake-up task wake-up control means.
When the microcomputer is in the sleep mode, the wake-up task wakeup control means generates any of a plurality of types of wake-up factors, and the microcomputer wakes up from the sleep mode. The generated wake-up factor is determined, and only the application task to be woken up when the determined wake-up factor occurs is woken up among the plurality of application tasks.

このようなマイクロコンピュータによれば、複数種類のウェイクアップ要因のうちの何れかが発生して、スリープモードからウェイクアップした際には、その発生したウェイクアップ要因に関連するアプリケーションタスク(そのウェイクアップ要因が発生した場合に起床されるべきアプリケーションタスク)のみが起床されることとなる。   According to such a microcomputer, when any of a plurality of types of wake-up factors occurs and a wake-up is performed from the sleep mode, an application task related to the generated wake-up factor (the wake-up factor) Only the application task that should be woken up when a factor occurs is woken up.

よって、ウェイクアップ要因には関係のない不要なアプリケーションタスクが起床されず、処理負荷が不必要に増加してしまうことが防止される。
更に、不要なアプリケーションタスクが起床されないため、その不要なアプリケーションタスクが実行されるために判定手段によって肯定判定(全てのアプリケーションタスクが実行されなくても良い状態になったと判定)されるのが遅れてしまう、といった不都合を回避することができる。よって、当該マイクロコンピュータを適切な時にスリープモードへ移行させることができ、従来技術で生じていた無駄な電力消費を無くすことができる。
Therefore, unnecessary application tasks not related to the wake-up factor are not woken up, and the processing load is prevented from increasing unnecessarily.
Furthermore, since unnecessary application tasks are not woken up, the unnecessary application tasks are executed, and therefore it is delayed that the determination means makes an affirmative determination (determined that all application tasks need not be executed). It is possible to avoid the inconvenience such as. Therefore, the microcomputer can be shifted to the sleep mode at an appropriate time, and wasteful power consumption that has occurred in the prior art can be eliminated.

次に、請求項2のマイクロコンピュータでは、請求項1のマイクロコンピュータにおいて、ウェイクアップ時タスク起床制御手段は、更に、以下のように構成されている。
即ち、ウェイクアップ時タスク起床制御手段は、起床されるべきアプリケーションタスクが複数あると共に、その複数のアプリケーションタスクのなかに、判定手段による判定に関係するアプリケーションタスク(以下、第1種タスクという)と、判定手段による判定に関係しないアプリケーションタスク(以下、第2種タスクという)とがあり、しかも、第2種タスクの方が第1種タスクよりも実行優先順位が高い場合には、当該マイクロコンピュータのウェイクアップ直後の1回のみ、その第1種タスクと第2種タスクとの実行優先順位を変更して、第1種タスクの方が第2種タスクよりも優先して実行されるようにする。
Next, in the microcomputer of claim 2, in the microcomputer of claim 1, the wake-up task wake-up control means is further configured as follows.
That is, the wake-up task wake-up control means includes a plurality of application tasks to be woken up, and among the plurality of application tasks, application tasks related to determination by the determination means (hereinafter referred to as first type tasks). If there is an application task not related to the determination by the determination means (hereinafter referred to as a second type task), and the second type task has a higher execution priority than the first type task, the microcomputer The execution priority order of the first type task and the second type task is changed only once immediately after the wake-up, so that the first type task is executed in preference to the second type task. To do.

尚、判定手段による判定に関係しないアプリケーションタスク(第2種タスク)とは、そのアプリケーションタスクが実行中であっても、他のアプリケーションタスクがスリープ可能状態(実行されなくても良い状態)になっていれば、判定手段によって肯定判定され得るタスクである。   Note that an application task (second type task) that is not related to the determination by the determination means is a state in which other application tasks can sleep (a state that does not have to be executed) even if the application task is being executed. If so, it is a task that can be affirmed by the determination means.

この構成によれば、当該マイクロコンピュータがウェイクアップした後、もし、第1種タスクの実行が終了したならば判定手段が肯定判定することとなる、といった状況であれば、第2種タスクよりも先に第1種タスクが実行される分、判定手段は早期に肯定判定することとなる。よって、マイクロコンピュータをより早期に再びスリープモードへと移行させることができるようになり、無駄な処理及び消費電力を一層抑制することができる可能性を上げることができる。   According to this configuration, after the microcomputer wakes up, if the determination means makes an affirmative determination if the execution of the first type task is completed, it is more effective than the second type task. Since the first type task is executed first, the determination means makes an affirmative determination earlier. Therefore, the microcomputer can be shifted to the sleep mode again earlier, and the possibility that wasteful processing and power consumption can be further suppressed can be increased.

一方、コンピュータをウェイクアップ時タスク起床制御手段として機能させるためのプログラムによれば、ハードウェアを追加しなくても、請求項1,2のマイクロコンピュータを実現することができる。   On the other hand, according to the program for causing the computer to function as the wake-up task wake-up control means, the microcomputer according to claims 1 and 2 can be realized without adding hardware.

また、請求項1,2のマイクロコンピュータは、様々な装置に適用可能であるが、特に、消費電力の低減が望まれる車両用電子制御装置に用いれば、その車両用電子制御装置での無駄な消費電力を一層抑制することができるようになる。   Further, the microcomputer according to claims 1 and 2 can be applied to various devices. However, particularly when used in a vehicle electronic control device for which reduction of power consumption is desired, the microcomputer in the vehicle electronic control device is useless. The power consumption can be further suppressed.

以下に、本発明が適用された実施形態の車両用電子制御装置について説明する。尚、本実施形態の電子制御装置は、例えば車両のランプ類やドアロック等といったボデー系機器を制御するためのものである。また、以下では、電子制御装置のことをECUという。   Hereinafter, an electronic control device for a vehicle according to an embodiment to which the present invention is applied will be described. Note that the electronic control device of this embodiment is for controlling body-type equipment such as vehicle lamps and door locks. Hereinafter, the electronic control device is referred to as an ECU.

図1に示すように、本実施形態のECU11は、マイコン(マイクロコンピュータ)13と、センサ信号やスイッチ信号をマイコン13に入力させる入力回路14と、マイコン13からの信号に基づき各種アクチュエータへ駆動信号を出力する出力回路15と、車両に搭載された他のECU16,17と通信線18を介してマイコン13が通信するための通信回路19とを備えている。   As shown in FIG. 1, the ECU 11 according to the present embodiment includes a microcomputer 13, an input circuit 14 that inputs sensor signals and switch signals to the microcomputer 13, and drive signals to various actuators based on signals from the microcomputer 13. And a communication circuit 19 for the microcomputer 13 to communicate with the other ECUs 16 and 17 mounted on the vehicle via the communication line 18.

そして、他のECU16,17のうち、例えば、ECU16は、車両のドアに設けられたドアロックやパワーウィンドウ用のアクチュエータをECU11と連携して制御するドアECUであり、ECU17は、車両の使用者に携帯される電子キーと照合通信を行って、その照合結果をECU11に通知する照合ECUである。   Of the other ECUs 16 and 17, for example, the ECU 16 is a door ECU that controls a door lock or power window actuator provided on the door of the vehicle in cooperation with the ECU 11. The ECU 17 is a vehicle user. This is a verification ECU that performs verification communication with the electronic key carried by the mobile phone and notifies the ECU 11 of the verification result.

また、マイコン13には、周知のCPU21、ROM23、RAM25、及びI/Oポート27等が備えられている。ROM23には、CPU21によって実行されるプログラム(ソフトウェア)が予め記憶されている。また、RAM25には、プログラムの実行による演算結果(例えば、演算結果のデータやフラグ等)が一時的に記憶される。   In addition, the microcomputer 13 includes a well-known CPU 21, ROM 23, RAM 25, I / O port 27, and the like. The ROM 23 stores a program (software) executed by the CPU 21 in advance. In addition, the RAM 25 temporarily stores calculation results (for example, calculation result data and flags) obtained by executing the program.

そして、マイコン13では、OSによるマルチタスクの機能により、制御対象を制御するための複数のアプリタスク(アプリケーションタスク)が実行される。尚、アプリタスクとしては、例えば、他のECU16,17と通信するための通信処理タスクや、ボデー系の機器を制御するためのボデーメインタスクや、時間を経時するためのタイマタスク等がある。   In the microcomputer 13, a plurality of application tasks (application tasks) for controlling the controlled object are executed by the multitask function of the OS. The application tasks include, for example, a communication processing task for communicating with other ECUs 16 and 17, a body main task for controlling body-related equipment, a timer task for elapse of time, and the like.

そして更に、マイコン13のROM25に格納されたソフトウェアとしては、OSとアプリタスクの他にも、状態管理タスクMTがある。
図2に示すように、状態管理タスクMTは、複数のアプリタスクAP1〜APx(xは2以上)の各々について、そのタスクが実行されるべきタイミングが到来した時に、そのタスクの起床要求をOSに対して行う起床制御や、全てのアプリタスクAP1〜APxが実行されなくても良い状態になったことを検知して、マイコン13をスリープモードに移行させる制御を行うためのタスクである。
Further, the software stored in the ROM 25 of the microcomputer 13 includes a state management task MT in addition to the OS and application tasks.
As shown in FIG. 2, the state management task MT sends a wake-up request for the task to each of a plurality of application tasks AP1 to APx (x is 2 or more) when the timing at which the task should be executed has arrived. Is a task for performing a control for shifting the microcomputer 13 to the sleep mode upon detecting that the application does not have to be executed and all the application tasks AP1 to APx are executed.

そして、アプリタスクのなかには、定期的に実行されるべき定期アプリタスクがある。このため、状態管理タスクMTは、アプリタスクAP1〜APxよりも優先順位が高く設定されており、マイコン13が通常動作している間は、少なくとも、全定期アプリタスクの実行間隔の最小公約数の時間毎(本実施形態では、例えば1ms毎)に起床される。   Among application tasks, there is a periodic application task that should be executed periodically. For this reason, the state management task MT is set to have a higher priority than the application tasks AP1 to APx, and is at least the least common divisor of the execution intervals of all the periodic application tasks while the microcomputer 13 is operating normally. It wakes up every time (in this embodiment, for example, every 1 ms).

また、アプリタスクのなかには、不定期なイベントの発生時(例えば、特定のスイッチがオンされたときや、他のECUから特定の情報を受信した時等)に実行されるべきイベントアプリタスクもある。そして、マイコン13が通常動作している期間において、そのようなイベントアプリタスクも、該当するイベントが発生した時に状態管理タスクMTによって起床要求される。   Among application tasks, there is also an event application task that should be executed when an irregular event occurs (for example, when a specific switch is turned on or when specific information is received from another ECU). . In the period during which the microcomputer 13 is normally operating, such an event application task is also requested to wake up by the state management task MT when the corresponding event occurs.

そして更に、状態管理タスクMTは、マイコン13がスリープモードからウェイクアップすると即座に起床され、その時に実行が必要なアプリタスクの起床要求を行う。尚、ウェイクアップ要因(マイコン13をウェイクアップさせる要因)としては、例えば、特定のスイッチがオンされたことや、他のECUからの信号を受信したこと等がある。   Further, the state management task MT is woken up immediately when the microcomputer 13 wakes up from the sleep mode, and issues a wake-up request for an application task that needs to be executed at that time. Note that the wake-up factor (the factor causing the microcomputer 13 to wake up) includes, for example, that a specific switch has been turned on or that a signal from another ECU has been received.

次に、各アプリタスクの処理内容(アプリタスクによって実現される機能)を、図3のフローチャートに沿って説明する。尚、ここでは、1つのアプリタスクAPn(nは1〜xの何れか)について説明するが、他のアプリタスクについても同様である。   Next, processing contents of each application task (function realized by the application task) will be described with reference to the flowchart of FIG. Here, one application task APn (n is any one of 1 to x) will be described, but the same applies to other application tasks.

アプリタスクAPnの実行が開始されると、そのアプリタスクAPnを成す各アプリモジュールの処理が行われる(S110)。アプリモジュールとは、アプリタスクの役割を更に細分化したプログラムモジュールであり、アプリタスクAP1〜APxの各々は、1個以上のアプリモジュールからなっている。   When the execution of the application task APn is started, the processing of each application module that forms the application task APn is performed (S110). An application module is a program module that further subdivides the roles of application tasks, and each of the application tasks AP1 to APx includes one or more application modules.

そして、全アプリモジュールの処理が終了すると(S120:YES)、その全アプリモジュールの各々について、実行されなくても良いスリープ可能状態になったか否かの状態判定を行う(S130)。   Then, when the processing of all application modules is completed (S120: YES), it is determined whether or not each of the application modules is in a sleep-enabled state that does not need to be executed (S130).

ここで、アプリモジュールにとって、スリープ可能状態とは、そのアプリモジュールによって実現される制御が完了しており、且つ、その制御を行う必要もない状態である。
例えば、車室内照明の制御を行うためのアプリモジュールであれば、そのアプリモジュールが一定時間毎に複数回実行されることにより、車室内照明に関する一連の制御が実現されることとなるため、その一連の制御が完了しており、且つ、新たな制御要求もなくて制御の実施が不要になった状態である。また、アプリモジュールによっては、一連の制御がなく、そのアプリモジュールの実行が終了すると、いつでもスリープ可能状態になるものもある。
Here, for an application module, the sleep enabled state is a state in which the control realized by the application module is complete and it is not necessary to perform the control.
For example, in the case of an application module for controlling vehicle interior lighting, a series of controls related to vehicle interior lighting are realized by executing the application module a plurality of times at regular intervals. This is a state in which a series of controls have been completed, and there is no new control request, so that it is not necessary to perform the control. Some application modules do not have a series of controls, and when the execution of the application module is completed, the application module may be in a sleep-enabled state at any time.

そして、全アプリモジュールの各々についてスリープ可能状態になったか否かの判定が終わると、その判定結果に基づいて、当該アプリタスクAPnがスリープ可能状態であるか否かを判定する(S140)。具体的には、全アプリモジュールがスリープ可能状態になっているか否かを判定し、全アプリモジュールがスリープ可能状態であれば、当該アプリタスクAPnがスリープ可能状態であると判定する。   Then, when it is determined whether or not all the application modules are in the sleep-enabled state, it is determined whether or not the application task APn is in the sleep-enabled state based on the determination result (S140). Specifically, it is determined whether or not all application modules are in a sleep-enabled state. If all application modules are in a sleep-enabled state, it is determined that the application task APn is in a sleep-enabled state.

ここで、当該アプリタスクAPnがスリープ可能状態ではないと判定したならば(S140:NO)、そのまま当該アプリタスクAPnが終了する。
これに対して、当該アプリタスクAPnがスリープ可能状態であると判定した場合には(S140:YES)、当該アプリタスクAPnがスリープ可能状態であることを状態管理タスクMTに通知するための通知処理を行い(S150)、その後、当該アプリタスクAPnが終了する。本実施形態では、通知処理として、「Flag(n)」というフラグ(以下、スリープ可能フラグという)をセットするための処理を行う。尚、スリープ可能フラグにおける()内のnは、当該アプリタスクの識別子である。また、「実行完了=スリープ可能状態」というようなアプリタスクであれば、S130及びS140のような判定処理を省略し、そのアプリタスクの最後で、常にS150の処理を行うようにしても良い。
If it is determined that the application task APn is not in a sleep-capable state (S140: NO), the application task APn ends as it is.
On the other hand, when it is determined that the application task APn is in a sleepable state (S140: YES), a notification process for notifying the state management task MT that the application task APn is in a sleepable state. (S150), and then the application task APn ends. In the present embodiment, as the notification process, a process for setting a flag “Flag (n)” (hereinafter referred to as a sleep enable flag) is performed. Note that n in parentheses in the sleep enable flag is an identifier of the application task. Further, if the application task is “execution completed = sleeping possible state”, the determination process such as S130 and S140 may be omitted, and the process of S150 may be always performed at the end of the application task.

次に、状態管理タスクMTの処理内容(状態管理タスクMTによって実現される機能)を、図4のフローチャートに沿って説明する。
前述したように、状態管理タスクMTは、マイコン13が通常動作している間、少なくとも一定時間毎に起床される。そして、状態管理タスクMTでは、マイコン13がウェイクアップしてから2回目以降の実行時毎に、図4(A)のスリープ制御処理が行われる。
Next, processing contents of the state management task MT (functions realized by the state management task MT) will be described with reference to the flowchart of FIG.
As described above, the state management task MT is woken up at least at regular intervals while the microcomputer 13 is operating normally. In the state management task MT, the sleep control process in FIG. 4A is performed every time the microcomputer 13 wakes up and after the second execution.

即ち、まず、全アプリタスクAP1〜APxのスリープ可能フラグ(Flag(1)〜Flag(x))が全てセットされているか否かを判定する(S210)。
そして、全アプリタスクAP1〜APxのスリープ可能フラグがセットされていれば(S210:YES)、全てのアプリタスクAP1〜APxが実行されなくても良い状態になっていてスリープ可能と判断し、アプリタスクの起床要求を行うことなく、当該マイコン13を通常動作時よりも消費電力の少ないスリープモードに移行させるための処理を行う(S220)。例えば、CPU21へクロックを供給している発振回路の動作を停止させたり、当該マイコン13へ電源を供給している電源回路の動作を停止させたりする。このため、S220の処理が行われると、当該マイコン13が動作を停止することとなる。また、S220では、CPU21のクロック周波数又は電源電圧を下げるような処理を行うようにしても良い。
That is, first, it is determined whether or not all sleep possible flags (Flag (1) to Flag (x)) of all the application tasks AP1 to APx are set (S210).
If the sleep possible flags of all the application tasks AP1 to APx are set (S210: YES), it is determined that it is not necessary to execute all the application tasks AP1 to APx and the sleep is possible. A process for shifting the microcomputer 13 to the sleep mode, which consumes less power than during normal operation, is performed without making a task wake-up request (S220). For example, the operation of an oscillation circuit that supplies a clock to the CPU 21 is stopped, or the operation of a power supply circuit that supplies power to the microcomputer 13 is stopped. For this reason, when the process of S220 is performed, the microcomputer 13 stops its operation. In S220, a process for lowering the clock frequency or power supply voltage of the CPU 21 may be performed.

一方、上記S210で否定判定した場合(即ち、何れか1つでもスリープ可能フラグがセットされていない場合)には、そのまま当該状態管理タスクMTの処理が終了するか、或いは他の処理が行われた後、当該状態管理タスクMTの処理が終了する。   On the other hand, when a negative determination is made in S210 (that is, when any one of the sleep enable flags is not set), the processing of the state management task MT is finished as it is or other processing is performed. After that, the processing of the state management task MT ends.

尚、アプリタスクによっては、そのアプリタスクの実行中にマイコン13をスリープモードに移行させても問題が無いものであって、スリープモードへ移行しても良いか否かのスリープ判定に関係しないアプリタスクもある。そして、そのスリープ判定に関係しないアプリタスクに関しては、スリープ可能フラグが常時セット状態に固定されている。また、スリープ判定に関係しないアプリタスク以外のアプリタスク(スリープ判定に関係するアプリタスク)のスリープ可能フラグは、そのアプリタスクが起床要求された際にリセットされる。   Depending on the application task, there is no problem even if the microcomputer 13 is shifted to the sleep mode during execution of the application task, and the application is not related to the sleep determination as to whether or not the sleep mode can be shifted. There are also tasks. And about the application task which is not related to the sleep determination, the sleep possible flag is always fixed to the set state. Further, the sleep enable flag of an application task other than an application task not related to sleep determination (an application task related to sleep determination) is reset when the application task is requested to wake up.

一方また、前述したように、状態管理タスクMTは、マイコン13がスリープモードからウェイクアップすると即座に起床される。
そして、そのウェイクアップ直後の状態管理タスクMTでは、図4(B)のウェイクアップ時処理が行われる。
On the other hand, as described above, the state management task MT is woken up immediately when the microcomputer 13 wakes up from the sleep mode.
Then, in the state management task MT immediately after the wake-up, the wake-up process of FIG. 4B is performed.

即ち、まず、今回のウェイクアップ要因が何であるか判別する(S310)。
具体的に説明すると、マイコン13がスリープモードになっている状態で、ウェイクアップ要因が発生すると、ハードウェア的に、その要因の発生を示す情報がマイコン13の内部レジスタ(図示省略)に記憶されると共に、マイコン13が通常動作に復帰(即ち、ウェイクアップ)する。
That is, first, it is determined what is the current wake-up factor (S310).
More specifically, when a wake-up factor occurs while the microcomputer 13 is in the sleep mode, information indicating the occurrence of the factor is stored in an internal register (not shown) of the microcomputer 13 in hardware. At the same time, the microcomputer 13 returns to normal operation (that is, wakes up).

例えば、ウェイクアップ要因となる特定のスイッチがオンして、そのスイッチ信号のレベル変化が入力回路14を介してマイコン13に入力されると、マイコン13がウェイクアップすると共に、そのスイッチ信号に該当する内部レジスタのビットに1がセットされる。また例えば、他のECU16,17が通信線18に通信開始を示す通信開始信号を送出し、その通信開始信号が通信回路19によって検知されると、そのことを示す信号が通信回路19からマイコン13に入力されて、マイコン13がウェイクアップすると共に、通信開始信号に該当する内部レジスタのビットに1がセットされる。このため、S310では、内部レジスタの各ビットのうち、1になっているビットを調べることにより、ウェイクアップ要因を判別して特定する。   For example, when a specific switch that becomes a wake-up factor is turned on and a level change of the switch signal is input to the microcomputer 13 via the input circuit 14, the microcomputer 13 wakes up and corresponds to the switch signal. 1 is set to the bit of the internal register. Further, for example, when the other ECUs 16 and 17 send a communication start signal indicating the start of communication to the communication line 18 and the communication start signal is detected by the communication circuit 19, a signal indicating that is sent from the communication circuit 19 to the microcomputer 13. The microcomputer 13 wakes up and 1 is set in the bit of the internal register corresponding to the communication start signal. For this reason, in S310, the wake-up factor is determined and specified by examining the bit that is 1 among the bits of the internal register.

そして、このようにしてウェイクアップ要因を特定すると、アプリタスクAP1〜APxのうち、今回特定したウェイクアップ要因に関連したアプリタスク(即ち、その特定したウェイクアップ要因が発生した場合に起床されるべきアプリタスク)のみについて、起床要求を行う(S320)。そして、その後、当該状態管理タスクMTの処理が終了する。尚、例えば、ROM23には、ウェイクアップ要因の各々と、そのウェイクアップ要因に関連するアプリタスクとを示すテーブル等のデータが記憶されており、S320では、そのデータに基づいて、今回発生したウェイクアップ要因に関連するアプリタスク(即ち、起床要求すべきアプリタスク)を特定する。また、発生したウェイクアップ要因に関連するアプリタスクが複数ある場合、その各アプリタスクの起床要求が行われる。   When the wake-up factor is specified in this way, among the application tasks AP1 to APx, the application task related to the wake-up factor specified this time (that is, should be woken up when the specified wake-up factor occurs). A wake-up request is issued only for the application task (S320). Thereafter, the processing of the state management task MT ends. For example, the ROM 23 stores data such as a table indicating each wake-up factor and an application task related to the wake-up factor. In S320, based on the data, the wake-up factor generated this time is stored. An application task related to the up factor (that is, an application task to be requested to wake up) is specified. When there are a plurality of application tasks related to the generated wake-up factor, a wake-up request is made for each application task.

次に、上記各処理の作用について、図5を用い説明する。尚、ここでは、アプリタスクとして、アプリタスク1とアプリタスク2とがあるものとする。
図5において、マイコン13は、時刻t1以前ではスリープモードになっている。
Next, the effect | action of said each process is demonstrated using FIG. Here, it is assumed that there are an application task 1 and an application task 2 as application tasks.
In FIG. 5, the microcomputer 13 is in the sleep mode before time t1.

そして、時刻t1で、アプリタスク1,2のうち、アプリタスク1のみが関連するウェイクアップ要因が発生したとする。
すると、マイコン13がウェイクアップして、状態管理タスクMTが起床し、図4(B)の処理により、アプリタスク1,2のうち、今回発生したウェイクアップ要因に関連するアプリタスク1のみが起床要求されることとなる(S310,S320)。
Then, it is assumed that a wake-up factor related only to application task 1 among application tasks 1 and 2 occurs at time t1.
Then, the microcomputer 13 wakes up and the state management task MT wakes up, and only the application task 1 related to the wake-up factor that has occurred this time is woken up by the processing of FIG. 4B. It will be requested (S310, S320).

例えば、アプリタスク1,2の一方が前述の通信処理タスクで、他方が前述のボデーメインタスクであり、発生したウェイクアップ要因が他のECU16,17からの通信開始信号であったならば、通信処理タスクとボデーメインタスクとのうち、通信処理タスクのみが起床要求されることとなる。また例えば、発生したウェイクアップ要因が、車室内照明の制御開始のトリガとなるドア開検知スイッチのオンであったならば、通信処理タスクとボデーメインタスクとのうち、車室内照明を制御する方のボデーメインタスクのみが起床要求されることとなる。   For example, if one of the application tasks 1 and 2 is the above-described communication processing task and the other is the above-described body main task, and the generated wake-up factor is a communication start signal from the other ECUs 16 and 17, the communication Of the processing task and the body main task, only the communication processing task is requested to wake up. Also, for example, if the generated wake-up factor is a door open detection switch that is a trigger for starting the control of the interior lighting of the vehicle, one of the communication processing task and the main body task that controls the interior lighting of the vehicle Only the main body task will be requested to wake up.

図5に戻り、その後、状態管理タスクMTの実行が終了すると、アプリタスク1が実行されるが、そのアプリタスク1の最後(時刻t2)で、図3におけるS150の通知処理が行われたとする。   Returning to FIG. 5, after that, when the execution of the state management task MT is completed, the application task 1 is executed. At the end of the application task 1 (time t2), the notification process of S150 in FIG. 3 is performed. .

この場合、時刻t1から一定時間後の時刻t3にて、再び状態管理タスクMTが起床し、図4(A)のスリープ制御処理が行われるが、そのスリープ制御処理では、S210で「YES」と判定されてS220の処理が行われることとなる。よって、その回の状態管理タスクMTの実行が終了する時刻t4にて、マイコン13は再びスリープモードに入ることとなる。   In this case, the state management task MT wakes up again at time t3 after a certain time from time t1, and the sleep control process of FIG. 4A is performed. In the sleep control process, “YES” is determined in S210. As a result, the process of S220 is performed. Therefore, the microcomputer 13 enters the sleep mode again at the time t4 when the execution of the current state management task MT ends.

以上のように本実施形態のマイコン13では、複数種類のウェイクアップ要因のうちの何れかが発生して、スリープモードからウェイクアップした際には、その発生したウェイクアップ要因に関連するアプリタスクのみが起床される。よって、処理負荷が不必要に増加してしまうことが防止される。   As described above, in the microcomputer 13 according to the present embodiment, when any one of a plurality of types of wakeup factors occurs and the wakeup is performed from the sleep mode, only the application task related to the generated wakeup factor is generated. Gets up. Therefore, the processing load is prevented from increasing unnecessarily.

そして更に、不要なアプリタスクが実行されるために状態管理タスクMTのスリープ制御処理(図4(A))でスリープ可能と判定されるのが遅れてしまう、といった不都合を回避することができる。よって、当該マイコン13を適切な時にスリープモードへ移行させることができ、図7に例示したような無駄な動作期間及び電力消費を無くすことができる。   Furthermore, it is possible to avoid the inconvenience that an unnecessary application task is executed and that it is delayed in the sleep control processing (FIG. 4A) of the state management task MT that it is determined that sleep is possible. Therefore, the microcomputer 13 can be shifted to the sleep mode at an appropriate time, and the useless operation period and power consumption as illustrated in FIG. 7 can be eliminated.

また、本実施形態では、図4(B)のウェイクアップ時処理をプログラムによって実現しているため、ハードウェアを追加しなくても上記効果を得ることができる。
そして、このようなマイコン13を備えたECU11によれば、動作しなくても良い場合の消費電力を従来よりも抑制することができる。
In the present embodiment, since the wake-up process in FIG. 4B is realized by a program, the above effect can be obtained without adding hardware.
And according to ECU11 provided with such a microcomputer 13, the power consumption when it does not need to operate can be controlled more than before.

尚、本実施形態では、状態管理タスクMTの処理のうち、図4(A)のS210の処理が判定手段に相当しており、図4(B)の処理がウェイクアップ時タスク起床制御手段に相当している。   In the present embodiment, among the processes of the state management task MT, the process of S210 in FIG. 4A corresponds to the determining means, and the process of FIG. 4B is used as the wake-up task wake-up control means. It corresponds.

次に、第2実施形態について説明する。尚、ここでは、先に説明した実施形態(第1実施形態)と異なる部分を説明する。
前述したように、マイコン13では、図4(B)のS320にて、ウェイクアップ要因に関連するアプリタスクが複数あった場合、その各アプリタスクの起床要求を行うこととなるが、第1実施形態では、その各アプリタスクが通常時と同じ設定の優先順位で実行されることとなる。
Next, a second embodiment will be described. Here, a different part from the previously described embodiment (first embodiment) will be described.
As described above, when there are a plurality of application tasks related to the wake-up factor in S320 of FIG. 4B, the microcomputer 13 issues a wake-up request for each application task. In the form, each application task is executed in the same priority order as in the normal state.

これに対して、第2実施形態のマイコン13では、図4(B)のS320にて、ウェイクアップ要因に関連するアプリタスク(以下、起床要求対象タスクという)が複数あった場合、更に以下の処理を行う。   On the other hand, in the microcomputer 13 of the second embodiment, when there are a plurality of application tasks (hereinafter referred to as wake-up request target tasks) related to the wake-up factor in S320 of FIG. Process.

まず、複数の起床要求対象タスクのなかに、スリープ判定に関係するアプリケーションタスクと、スリープ判定に関係しないアプリタスクとがあり、しかも、スリープ判定に関係しないアプリタスクの方が、スリープ判定に関係するアプリタスクよりも実行優先順位が高いか否かを判定する。   First, among a plurality of wake-up request target tasks, there are application tasks related to sleep determination and application tasks not related to sleep determination, and application tasks not related to sleep determination are more related to sleep determination. It is determined whether or not the execution priority is higher than the application task.

そして、その判定で肯定判定した場合には、当該マイコン13のウェイクアップ直後の1回のみ、そのスリープ判定に関係するアプリタスクと、スリープ判定に関係しないアプリタスクとの実行優先順位を変更して、スリープ判定に関係するアプリタスクの方が、スリープ判定に関係しないアプリタスクよりも優先して実行されるように設定変更し、その上で、各アプリタスクの起床要求を行う。   If the determination is affirmative, the execution priority of the application task related to the sleep determination and the application task not related to the sleep determination is changed only once immediately after the wake-up of the microcomputer 13. Then, the setting is changed so that the application task related to the sleep determination is executed in preference to the application task not related to the sleep determination, and then a wake-up request is made for each application task.

このような第2実施形態によれば、マイコン13がウェイクアップした後、もし、スリープ判定に関係するアプリタスクの実行が終了したならば図4(A)のS210でスリープ可能と判定されることとなる、といった状況であれば、優先順位を変更しない場合よりも、スリープ判定に関係するアプリタスクが先に実行される分、早期にスリープ可能と判定されることとなる。よって、マイコン13をより早期に再びスリープモードへと移行させることができるようになり、無駄な処理及び消費電力を一層抑制することができる可能性を上げることができる。   According to the second embodiment, after the microcomputer 13 wakes up, if the execution of the application task related to the sleep determination is completed, it is determined that the sleep is possible in S210 of FIG. If the situation is such that the application task related to sleep determination is executed earlier than when the priority order is not changed, it is determined that sleep is possible earlier. Therefore, the microcomputer 13 can be shifted to the sleep mode again earlier, and the possibility that wasteful processing and power consumption can be further suppressed can be increased.

図6に具体例を示す。
図6において、アプリタスクaは、アプリタスクbよりも優先順位が高いものの、処理の内容はアプリタスクbに依存しており、スリープ判定には関係がないタスク(スリープ可能フラグがセット状態に固定されたタスク)である。つまり、アプリタスクaは、アプリタスクbがスリープ可能状態ならば、実行されなくても支障がないタスクであり、この例では、アプリタスクbからの処理依頼を受けると、他のECU16,17へ情報を送信する処理を行うタスクである。
A specific example is shown in FIG.
In FIG. 6, although the application task a has a higher priority than the application task b, the processing contents depend on the application task b and are not related to sleep determination (the sleep enable flag is fixed to the set state). Task). In other words, the application task a is a task that does not have any trouble if it is not executed if the application task b is in a sleepable state. In this example, upon receiving a processing request from the application task b, the application task a is sent to the other ECUs 16 and 17. It is a task that performs processing for transmitting information.

また、アプリタスクbは、時間を計測するためのタイマタスクであり、マイコン13が外部タイマ回路(図示省略)からの定期起動信号によってウェイクアップした回数をカウントして、そのカウント値が規定値Nになっていなければ、そのまま自タスクのスリープ可能フラグをセットするが、カウント値が規定値Nになったら、スリープ可能フラグをセットせずに、アプリタスクaに処理依頼を行うタスクである。   The application task b is a timer task for measuring time. The application task b counts the number of times the microcomputer 13 has woken up by a periodic activation signal from an external timer circuit (not shown), and the count value is a specified value N. If it is not set, the sleep enable flag of the own task is set as it is, but when the count value reaches the specified value N, the task is a task for requesting the application task a without setting the sleep enable flag.

例えば、マイコン13は、外部タイマ回路からの定期起動信号によって、一定時間T1(例えば10秒)毎にウェイクアップされるようになっている。そして、その外部タイマ回路によるウェイクアップ毎にアプリタスクbが起床され、そのアプリタスクbにより、外部タイマ回路によるウェイクアップ回数が上記カウント値として計数される。そして更に、アプリタスクbでは、カウント値が規定値Nになると、「T1×N」の時間が経過したと判断して、アプリタスクaに処理依頼を行う。すると、アプリタスクaは、他のECU16,17へ情報を送信する処理を行うようになっている。   For example, the microcomputer 13 is woken up every predetermined time T1 (for example, 10 seconds) by a periodic activation signal from an external timer circuit. Then, the application task b is woken up every time the external timer circuit wakes up, and the application task b counts the number of wake-ups by the external timer circuit as the count value. Further, in the application task b, when the count value reaches the specified value N, it is determined that the time “T1 × N” has elapsed, and a processing request is made to the application task a. Then, the application task a performs a process of transmitting information to the other ECUs 16 and 17.

ここで、図6の時刻t1にて、マイコン13が外部タイマ回路からの定期起動信号によりウェイクアップし、状態管理タスクMTが、図4(B)の処理により、その定期起動信号というウェイクアップ要因に関連するアプリタスクa,bについて、起床要求を行ったとする。また、アプリタスクbがこの回に上記カウント値をカウントアップさせても、そのカウント値は未だ規定値Nに達しないものとする。   Here, at time t1 in FIG. 6, the microcomputer 13 wakes up by the periodic activation signal from the external timer circuit, and the state management task MT performs the wakeup factor of the periodic activation signal by the processing in FIG. 4B. Assume that a wake-up request is made for the application tasks a and b related to. Further, even if the application task b counts up the count value at this time, the count value has not yet reached the specified value N.

この場合、図6(A)に示すように、もし、アプリタスクa,bの優先順位を変更しないとすると、アプリタスクbよりもアプリタスクaの方が先に実行されることとなり、その分、マイコン13がウェイクアップしてからアプリタスクbにてスリープ可能フラグがセットされるまでの時間が長くなり、その結果、状態管理タスクMTでスリープ可能と判定されるまで(即ち、マイコン13が再びスリープモードに入るまで)の時間が長くなる。尚、図6(A)の例では、アプリタスクaの後に実行されたアプリタスクbの実行中に、次回の状態管理タスクMTが時刻t2で割り込み、更にその次の状態管理タスクMTが時刻t3で実行された際に、スリープ可能と判定されてマイコン13がスリープモードに移行している。   In this case, as shown in FIG. 6A, if the priority order of the application tasks a and b is not changed, the application task a is executed before the application task b. The time from when the microcomputer 13 wakes up until the sleep enable flag is set in the application task b becomes longer, and as a result, until the state management task MT determines that sleep is possible (that is, the microcomputer 13 is again connected). It takes longer time to enter sleep mode. In the example of FIG. 6A, during the execution of the application task b executed after the application task a, the next state management task MT is interrupted at time t2, and the next state management task MT is further processed at time t3. Is executed, the microcomputer 13 is determined to be able to sleep, and the microcomputer 13 has shifted to the sleep mode.

これに対して、本第2実施形態では、図6(B)に示すように、ウェイクアップ直後の1回のみ、アプリタスクa,bの優先順位を逆にすることとなる。このため、アプリタスクaよりもアプリタスクbの方が先に実行され、その結果、マイコン13がウェイクアップしてからアプリタスクbにてスリープ可能フラグがセットされるまでの時間が短くなる。よって、マイコン13がウェイクアップしてから状態管理タスクMTでスリープ可能と判定されて再びスリープモードに入るまでの時間が短くなり、消費電力が低減される。尚、図6(B)の例では、マイコン13がウェイクアップしてから2回目の状態管理タスクMTが実行される時刻t2よりも前に、アプリタスクbがスリープ可能フラグをセットしたため、時刻t2で状態管理タスクMTが実行された際に、スリープ可能と判定されてマイコン13がスリープモードに移行している。   On the other hand, in the second embodiment, as shown in FIG. 6B, the priority order of the application tasks a and b is reversed only once immediately after wakeup. For this reason, the application task b is executed before the application task a. As a result, the time from when the microcomputer 13 wakes up until the sleep enable flag is set in the application task b is shortened. Therefore, the time from when the microcomputer 13 wakes up to the state management task MT is determined to be sleepable until the sleep mode is entered again is shortened, and power consumption is reduced. In the example of FIG. 6B, since the application task b sets the sleep enable flag before the time t2 when the second state management task MT is executed after the microcomputer 13 wakes up, the time t2 When the state management task MT is executed, it is determined that sleep is possible, and the microcomputer 13 shifts to the sleep mode.

このように、本第2実施形態によれば、スリープモードへの再移行を早めることができ、無駄な処理及び消費電力を一層抑制することが可能となる。
以上、本発明の一実施形態について説明したが、本発明はこうした実施形態に何等限定されるものではなく、本発明の要旨を逸脱しない範囲において、種々なる態様で実施し得ることは勿論である。
As described above, according to the second embodiment, it is possible to speed up the transition to the sleep mode, and it is possible to further suppress unnecessary processing and power consumption.
As mentioned above, although one Embodiment of this invention was described, this invention is not limited to such Embodiment at all, Of course, in the range which does not deviate from the summary of this invention, it can implement in a various aspect. .

例えば、状態管理タスクMTの機能は、OSに持たせるようにしても良い。
また、状態管理タスクMTの処理は、何れかのアプリタスク内で実行されるようにしてもよい。つまり、あるアプリタスクが状態管理タスクMTの代わりにタスク起床等の制御を行っても良い。
For example, the OS may have a function of the state management task MT.
Further, the state management task MT may be executed in any application task. In other words, a certain application task may control task wakeup or the like instead of the state management task MT.

一方、本発明は、前述したようなボデー系の機能を制御するECUに限らず、例えばエンジンやトランスミッション等のパワートレイン系を制御するECU等にも適用することができ、また、車両用以外のECUに対しても同様に適用することができる。   On the other hand, the present invention is not limited to the ECU that controls the functions of the body system as described above, but can be applied to, for example, an ECU that controls a powertrain system such as an engine or a transmission. The same applies to the ECU.

実施形態の車両用電子制御装置(ECU)の構成を表す図である。It is a figure showing the structure of the electronic controller for vehicles (ECU) of embodiment. マイコンで実行されるソフトウェア構成を表す図である。It is a figure showing the software configuration performed with a microcomputer. 各アプリケーションタスクの処理内容を表すフローチャートである。It is a flowchart showing the processing content of each application task. 状態管理タスクの処理内容を表すフローチャートである。It is a flowchart showing the processing content of a state management task. 図3及び図4の処理による作用を説明する説明図である。It is explanatory drawing explaining the effect | action by the process of FIG.3 and FIG.4. 第2実施形態の具体例を説明する説明図である。It is explanatory drawing explaining the specific example of 2nd Embodiment. 従来技術及びその問題を説明する説明図である。It is explanatory drawing explaining a prior art and its problem.

符号の説明Explanation of symbols

11,16,17…ECU、13…マイコン、14…入力回路、15…出力回路、18…通信線、19…通信回路、21…CPU、23…ROM、25…RAM、27…I/Oポート、AP1〜APx…アプリタスク、MT…状態管理タスク   DESCRIPTION OF SYMBOLS 11, 16, 17 ... ECU, 13 ... Microcomputer, 14 ... Input circuit, 15 ... Output circuit, 18 ... Communication line, 19 ... Communication circuit, 21 ... CPU, 23 ... ROM, 25 ... RAM, 27 ... I / O port , AP1 to APx ... application task, MT ... state management task

Claims (4)

複数のアプリケーションタスクが実行されると共に、全てのアプリケーションタスクが実行されなくても良い状態になったか否かを判定する判定手段を備え、その判定手段により肯定判定されると、通常動作時よりも消費電力の少ないスリープモードに移行するマイクロコンピュータにおいて、
当該マイクロコンピュータがスリープモードになっている場合に、複数種類のウェイクアップ要因のうちの何れかが発生して、当該マイクロコンピュータがスリープモードからウェイクアップすると、その発生したウェイクアップ要因を判別すると共に、前記複数のアプリケーションタスクのうち、その判別したウェイクアップ要因が発生した場合に起床されるべきアプリケーションタスクのみを起床させるウェイクアップ時タスク起床制御手段を備えていること、
を特徴とするマイクロコンピュータ。
A plurality of application tasks are executed, and a determination means for determining whether or not all application tasks need not be executed is provided. When the determination means makes an affirmative determination, In a microcomputer that shifts to sleep mode with low power consumption,
When the microcomputer is in the sleep mode, if any of a plurality of types of wake-up factors occurs and the microcomputer wakes up from the sleep mode, the generated wake-up factor is determined. A wake-up task wake-up control means for waking up only the application task to be woken up when the determined wake-up factor occurs among the plurality of application tasks,
A microcomputer characterized by.
請求項1に記載のマイクロコンピュータにおいて、
前記ウェイクアップ時タスク起床制御手段は、
前記起床されるべきアプリケーションタスクが複数あると共に、その複数のアプリケーションタスクのなかに、前記判定手段による判定に関係するアプリケーションタスク(以下、第1種タスクという)と、前記判定手段による判定に関係しないアプリケーションタスク(以下、第2種タスクという)とがあり、しかも、前記第2種タスクの方が前記第1種タスクよりも実行優先順位が高い場合には、当該マイクロコンピュータのウェイクアップ直後の1回のみ、前記第1種タスクと前記第2種タスクとの実行優先順位を変更して、前記第1種タスクの方が前記第2種タスクよりも優先して実行されるようにすること、
を特徴とするマイクロコンピュータ。
The microcomputer according to claim 1,
The wake-up task wake-up control means includes:
There are a plurality of application tasks to be woken up, and among the plurality of application tasks, an application task related to the determination by the determination unit (hereinafter referred to as a first type task) and not determined by the determination unit If there is an application task (hereinafter referred to as a second type task) and the execution priority of the second type task is higher than that of the first type task, 1 immediately after the microcomputer wakes up. Changing the execution priority of the first type task and the second type task only once, so that the first type task is executed in preference to the second type task,
A microcomputer characterized by.
コンピュータを請求項1又は2に記載のウェイクアップ時タスク起床制御手段として機能させるためのプログラム。   The program for functioning a computer as a wake-up task wake-up control means according to claim 1 or 2. 請求項1又は請求項2に記載のマイクロコンピュータを備えた車両用電子制御装置。   An electronic control device for a vehicle comprising the microcomputer according to claim 1.
JP2006287828A 2006-10-23 2006-10-23 Microcomputer, program and electronic control device for vehicle Pending JP2008107914A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006287828A JP2008107914A (en) 2006-10-23 2006-10-23 Microcomputer, program and electronic control device for vehicle

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006287828A JP2008107914A (en) 2006-10-23 2006-10-23 Microcomputer, program and electronic control device for vehicle

Publications (1)

Publication Number Publication Date
JP2008107914A true JP2008107914A (en) 2008-05-08

Family

ID=39441243

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006287828A Pending JP2008107914A (en) 2006-10-23 2006-10-23 Microcomputer, program and electronic control device for vehicle

Country Status (1)

Country Link
JP (1) JP2008107914A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010013458A1 (en) * 2008-07-30 2010-02-04 株式会社オートネットワーク技術研究所 Control device, control system, and computer program
JP2010266986A (en) * 2009-05-13 2010-11-25 Oki Data Corp Data processing apparatus and method of processing data
KR20140067072A (en) * 2011-09-30 2014-06-03 인텔 코포레이션 Priority based application event control (paec) to reduce power consumption
CN103853609A (en) * 2012-12-03 2014-06-11 联想(北京)有限公司 Signal processing method and device
JP2014526732A (en) * 2011-09-12 2014-10-06 マイクロソフト コーポレーション Process management in suspended and running states
CN107749797A (en) * 2011-09-09 2018-03-02 微软技术许可有限责任公司 Awakening mode management
US10007323B2 (en) 2012-12-26 2018-06-26 Intel Corporation Platform power consumption reduction via power state switching
US11181968B2 (en) 2014-09-19 2021-11-23 Huawei Technologies Co., Ltd. Method and apparatus for running application program

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000235432A (en) * 1999-02-16 2000-08-29 Toshiba Corp Computer system and stand-by state switching method for computer
JP2002055830A (en) * 2000-05-29 2002-02-20 Seiko Epson Corp Interruption signal generation device and its method
JP2003029886A (en) * 2001-07-12 2003-01-31 Denso Corp Operating system, program and electronic controller for vehicle
JP2006172044A (en) * 2004-12-15 2006-06-29 Canon Inc Electronic device and image forming device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000235432A (en) * 1999-02-16 2000-08-29 Toshiba Corp Computer system and stand-by state switching method for computer
JP2002055830A (en) * 2000-05-29 2002-02-20 Seiko Epson Corp Interruption signal generation device and its method
JP2003029886A (en) * 2001-07-12 2003-01-31 Denso Corp Operating system, program and electronic controller for vehicle
JP2006172044A (en) * 2004-12-15 2006-06-29 Canon Inc Electronic device and image forming device

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010013458A1 (en) * 2008-07-30 2010-02-04 株式会社オートネットワーク技術研究所 Control device, control system, and computer program
JP2010030506A (en) * 2008-07-30 2010-02-12 Autonetworks Technologies Ltd Control device, control system and computer program
JP4624448B2 (en) * 2008-07-30 2011-02-02 株式会社オートネットワーク技術研究所 Control device, control system, and computer program
US8776072B2 (en) 2008-07-30 2014-07-08 Autonetworks Technologies, Ltd. Control apparatus, control system and computer program
JP2010266986A (en) * 2009-05-13 2010-11-25 Oki Data Corp Data processing apparatus and method of processing data
US8301926B2 (en) 2009-05-13 2012-10-30 Oki Data Corporation Data processing apparatus, image processing apparatus, and method of processing data
CN107749797B (en) * 2011-09-09 2021-01-01 微软技术许可有限责任公司 Computing equipment and implementation method thereof
CN107749797A (en) * 2011-09-09 2018-03-02 微软技术许可有限责任公司 Awakening mode management
JP2014526732A (en) * 2011-09-12 2014-10-06 マイクロソフト コーポレーション Process management in suspended and running states
KR101597167B1 (en) * 2011-09-30 2016-02-24 인텔 코포레이션 Priority based application event control (paec) to reduce power consumption
JP2015507771A (en) * 2011-09-30 2015-03-12 インテル コーポレイション Application event control (PAEC) based on priority to reduce power consumption
US9383803B2 (en) 2011-09-30 2016-07-05 Intel Corporation Priority based application event control (PAEC) to reduce power consumption
US10254818B2 (en) 2011-09-30 2019-04-09 Intel Corporation Priority based application event control (PAEC) to reduce power consumption
KR20140067072A (en) * 2011-09-30 2014-06-03 인텔 코포레이션 Priority based application event control (paec) to reduce power consumption
US11112853B2 (en) 2011-09-30 2021-09-07 Intel Corporation Priority based application event control (PAEC) to reduce power consumption
CN103853609A (en) * 2012-12-03 2014-06-11 联想(北京)有限公司 Signal processing method and device
US10007323B2 (en) 2012-12-26 2018-06-26 Intel Corporation Platform power consumption reduction via power state switching
US10564705B2 (en) 2012-12-26 2020-02-18 Intel Corporation Platform power consumption reduction via power state switching
US11422615B2 (en) 2012-12-26 2022-08-23 Intel Corporation Platform power consumption reduction via power state switching
US11768533B2 (en) 2012-12-26 2023-09-26 Tahoe Research, Ltd. Platform power consumption reduction via power state switching
US11181968B2 (en) 2014-09-19 2021-11-23 Huawei Technologies Co., Ltd. Method and apparatus for running application program

Similar Documents

Publication Publication Date Title
JP2008107914A (en) Microcomputer, program and electronic control device for vehicle
EP2573683A1 (en) Data processor and electronic control unit
JP5626266B2 (en) Communications system
CN110830267A (en) State control method and device of network node and gateway
JP2008102830A (en) Microcomputer, program and electronic control device for vehicle
CN105353864A (en) Static power consumption management method and system for electronic device
CN104156223A (en) Application program control method and device for mobile terminal
US20230113657A1 (en) Preemptive wakeup circuit for wakeup from low power modes
JP4715760B2 (en) Microcomputer and control system
JP2007022355A (en) Control unit for automobile
JP2011070309A (en) Switch state detection device and processing system
JP5324340B2 (en) Microcomputer
JP2014146131A (en) Information processing apparatus, monitoring device, and control device
JP4083598B2 (en) Network system
JP2009248711A (en) On-vehicle communication system
JP4446169B2 (en) Automotive control device
US9465655B2 (en) Method for managing threads using executing time scheduling technique and electronic device using the same method
WO2018116450A1 (en) Wireless communication device and control program
JP5434833B2 (en) Communication system and node
JP3711849B2 (en) Microcomputer
JP2008222051A (en) Microcomputer, program, electronic control device, and communication system
JP6402798B2 (en) Control device for vehicle power window device
JP4076876B2 (en) Network system
JP2005186770A (en) On-vehicular device and its power source control method
JP2002229791A (en) Interface generating device, program, and storage medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090518

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100824

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100914

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20110201