JP6642358B2 - Microcomputer and electronic control unit - Google Patents

Microcomputer and electronic control unit Download PDF

Info

Publication number
JP6642358B2
JP6642358B2 JP2016184263A JP2016184263A JP6642358B2 JP 6642358 B2 JP6642358 B2 JP 6642358B2 JP 2016184263 A JP2016184263 A JP 2016184263A JP 2016184263 A JP2016184263 A JP 2016184263A JP 6642358 B2 JP6642358 B2 JP 6642358B2
Authority
JP
Japan
Prior art keywords
interrupt
factor
counter
value
monitoring unit
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.)
Active
Application number
JP2016184263A
Other languages
Japanese (ja)
Other versions
JP2018049446A (en
Inventor
友樹 安藤
友樹 安藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP2016184263A priority Critical patent/JP6642358B2/en
Priority to DE102017215944.8A priority patent/DE102017215944A1/en
Publication of JP2018049446A publication Critical patent/JP2018049446A/en
Application granted granted Critical
Publication of JP6642358B2 publication Critical patent/JP6642358B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked
    • G06F9/4825Interrupt from clock, e.g. time of day
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/48Indexing scheme relating to G06F9/48
    • G06F2209/484Precedence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/543Local

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Microcomputers (AREA)
  • Debugging And Monitoring (AREA)

Description

本発明はマイクロコンピュータ及び電子制御装置に関する。   The present invention relates to a microcomputer and an electronic control device.

従来より、所定のプログラムにしたがって割込み処理を実行する処理部を備えたマイクロコンピュータが供されている。例えば特許文献1には、外部からの割込み要因を監視する割込み要因監視部を有する構成が開示されている。この構成では、割込み要因監視部は、割込み要因毎に個別に設定されている監視間隔で割込みの発生を監視し、割込み発生からの経過時間と割込みの発生回数とを記憶する。割込み要因監視部は、経過時間が予め設定されている所定時間を超え、発生回数が予め設定されている所定回数を超えると、異常の発生を判別する。   2. Description of the Related Art Conventionally, a microcomputer provided with a processing unit that executes an interrupt process according to a predetermined program has been provided. For example, Patent Document 1 discloses a configuration having an interrupt factor monitoring unit that monitors an external interrupt factor. In this configuration, the interrupt factor monitoring unit monitors the occurrence of an interrupt at a monitoring interval set individually for each interrupt factor, and stores the elapsed time since the interrupt occurred and the number of times the interrupt occurred. When the elapsed time exceeds a predetermined time set in advance and the number of occurrences exceeds a predetermined number of times, the interrupt factor monitoring unit determines occurrence of an abnormality.

特開2010−271993号公報JP 2010-271993 A

特許文献1に記載されている構成では、異常の発生を割込み要因監視部で判別することはできる。しかしながら、異常が発生していない正常時において、割込み要因毎の割込み発生からの経過時間を処理部で扱うことができず、その経過時間を用いた高度な割込み処理を実行することができない。例えば割込みAが連続して発生しているにも関わらず、割込みAよりも優先度が高い割込みBが発生している期間では、割込みAの割込み処理を実行することができない。その一方で、割込みAの割込み処理を実行しない状況が継続すると、異常が発生する。又、割込み要因毎の割込み発生からの経過時間を処理部で扱えるようにし、経過時間が最も長い割込み要因を処理部が判別するように構成すると、処理部の処理負荷の増大を招く。   With the configuration described in Patent Literature 1, the occurrence of an abnormality can be determined by the interrupt factor monitoring unit. However, in a normal state where no abnormality has occurred, the processing unit cannot handle the elapsed time from the occurrence of the interrupt for each interrupt factor, and cannot execute advanced interrupt processing using the elapsed time. For example, the interrupt process of the interrupt A cannot be executed during the period in which the interrupt B having a higher priority than the interrupt A occurs while the interrupt A occurs continuously. On the other hand, if the situation where the interrupt process of the interrupt A is not executed continues, an abnormality occurs. Further, if the processing unit can handle the elapsed time from the occurrence of the interrupt for each interrupt factor and the processing unit determines the interrupt factor having the longest elapsed time, the processing load on the processing unit increases.

本発明は、上記した事情に鑑みてなされたものであり、その目的は、処理部の処理負荷が増大することなく、割込み発生からの経過時間を用いた高度な割込み処理を実行することができるマイクロコンピュータ及び電子制御装置を提供することにある。   The present invention has been made in view of the above circumstances, and an object of the present invention is to execute an advanced interrupt process using an elapsed time from the occurrence of an interrupt without increasing the processing load of a processing unit. A microcomputer and an electronic control device are provided.

請求項1に記載した発明によれば、所定のプログラムにしたがって割込み処理を実行する処理部(5)を備えたマイクロコンピュータ(2)において、前記処理部とは別に設けられ、外部からの複数の割込み要因を監視する割込み要因監視部(7)を備える。割込み要因監視部は、割込み要因毎の割込み発生からの経過時間を計測するタイマカウンタ(8)と、前記割込み要因毎の割込みの発生回数を計測する回数カウンタ(9)と、複数の割込み要因の中で前記タイマカウンタの値が最大の割込み要因の要因番号、又は前記回数カウンタの値が最大の割込み要因の要因番号を記憶する最大待ち要因記憶部(11)と、を有し、前記最大待ち要因記憶部に記憶されている割込み要因の要因番号が前記回数カウンタにより更新されない場合に前記タイマカウンタの値を用いて複数の割込み要因のうち割込み発生からの経過時間が最も長い割込み要因を判別する第1の判別方法と、前記最大待ち要因記憶部に記憶されている割込み要因の要因番号が前記回数カウンタにより更新される場合に前記タイマカウンタの値と前記回数カウンタの値とを用いて複数の割込み要因のうち割込み発生からの経過時間が最も長い割込み要因を判別する第2の判別方法とのうち何れかを選択する。割込み発生からの経過時間が最も長い割込み要因を、処理部とは別の割込み要因監視部が判別することで、処理部の処理負荷が増大することなく、割込み発生からの経過時間を用いた高度な割込み処理を実行することができる。


According to the first aspect of the present invention, in the microcomputer (2) including the processing unit (5) for executing an interrupt process according to a predetermined program, the microcomputer (2) is provided separately from the processing unit and includes a plurality of external devices. An interrupt factor monitoring unit (7) for monitoring an interrupt factor is provided. The interrupt factor monitoring unit includes a timer counter (8) for measuring an elapsed time from the occurrence of an interrupt for each interrupt factor, a count counter (9) for measuring the number of times an interrupt has occurred for each interrupt factor, and a plurality of interrupt factors. A maximum wait factor storage unit (11) for storing a factor number of an interrupt factor having a maximum value of the timer counter or a factor number of an interrupt factor having a maximum value of the number counter. When the factor number of the interrupt factor stored in the factor storage unit is not updated by the number counter, the interrupt factor using the value of the timer counter is used to determine the interrupt factor having the longest elapsed time from the occurrence of the interrupt. A first determination method, and determining that the timer counter is used when the factor number of the interrupt factor stored in the maximum wait factor storage unit is updated by the number counter. Selecting one of the second determination method of the elapsed time from the interrupt generation of the plurality of interrupt source to determine the longest interrupt factor by using the values of said counter in printer. The interrupt factor monitoring unit separate from the processing unit determines the interrupt factor that has the longest elapsed time since the occurrence of the interrupt. It is possible to execute various interrupt processes.


本発明の一実施形態を示す機能ブロック図Functional block diagram showing one embodiment of the present invention フローチャートflowchart フローチャートflowchart フローチャートflowchart フローチャートflowchart フローチャートflowchart フローチャートflowchart

以下、本発明の一実施形態について図面を参照して説明する。電子制御装置1は、例えば車両用のエンジンの始動を制御する装置であり、電子制御装置1の動作を制御するマイクロコンピュータ(以下、マイコンと称する)2を有する。マイコン2は、割込み制御装置3と、情報処理装置4とを有する。割込み制御装置3は、外部から割込み要因1〜n(nは自然数)のn個の割込み要因を入力可能であり、何れかの割込み要因を入力すると、割込み要求を情報処理装置4に出力すると共に、その入力した割込み要因を特定可能な要因番号を情報処理装置4に出力する。   Hereinafter, an embodiment of the present invention will be described with reference to the drawings. The electronic control unit 1 is a device that controls, for example, the start of a vehicle engine, and includes a microcomputer (hereinafter, referred to as a microcomputer) 2 that controls the operation of the electronic control unit 1. The microcomputer 2 has an interrupt control device 3 and an information processing device 4. The interrupt control device 3 can externally input n interrupt factors 1 to n (n is a natural number), and when any of the interrupt factors is input, outputs an interrupt request to the information processing device 4 and Then, a factor number capable of specifying the input interrupt factor is output to the information processing device 4.

情報処理装置4は、処理部5と、タイマ6と、割込み要因監視部7とを有する。処理部5は所定のプログラムにしたがって割込み処理を実行する。タイマ6は、予め任意に設定されている間隔でタイミング通知を割込み要因監視部7に出力する。割込み要因監視部7は、割込み制御装置3から入力する割込み要求及び要因番号と、タイマ6から入力するタイミング通知とを用い、割込み要因の状態を監視する。   The information processing device 4 includes a processing unit 5, a timer 6, and an interrupt factor monitoring unit 7. The processing unit 5 executes an interrupt process according to a predetermined program. The timer 6 outputs a timing notification to the interrupt factor monitoring unit 7 at an interval set in advance. The interrupt factor monitoring unit 7 monitors the status of the interrupt factor using the interrupt request and the factor number input from the interrupt control device 3 and the timing notification input from the timer 6.

割込み要因監視部7は、割込み制御装置3から割込み要求を入力すると、割込みの発生を判定し、割込みの発生を示す割込み通知を処理部5に出力する。処理部5は、割込み要因監視部7から割込み通知を入力すると共に、各種要求を割込み要因監視部7に出力し、割込み処理を実行する。割込み要因監視部7は、処理部5から各種要求を入力すると、その入力した各種要求に対する各種応答を処理部5に出力する。   When receiving an interrupt request from the interrupt control device 3, the interrupt factor monitoring unit 7 determines the occurrence of an interrupt and outputs an interrupt notification indicating the occurrence of the interrupt to the processing unit 5. The processing unit 5 receives an interrupt notification from the interrupt factor monitoring unit 7, outputs various requests to the interrupt factor monitoring unit 7, and executes an interrupt process. Upon receiving various requests from the processing unit 5, the interrupt cause monitoring unit 7 outputs various responses to the input various requests to the processing unit 5.

処理部5は、割込み要因監視部7に出力する各種要求として、割込み要因クリア要求、タイマカウンタ値取得要求、回数カウンタ値取得要求、要因FIFO(First In First Out)取得要求、最大待ち要因取得要求を出力する。処理部5は、割込み要因クリア要求を割込み要因監視部7に出力することで、割込み要因監視部7で監視されている割込み要因をクリアする。   The processing unit 5 includes, as various requests output to the interrupt factor monitoring unit 7, an interrupt factor clear request, a timer counter value acquisition request, a number counter value acquisition request, a factor FIFO (First In First Out) acquisition request, and a maximum wait factor acquisition request. Is output. The processing unit 5 outputs the interrupt factor clear request to the interrupt factor monitoring unit 7, thereby clearing the interrupt factor monitored by the interrupt factor monitoring unit 7.

処理部5は、タイマカウンタ値取得要求を割込み要因監視部7に出力することで、後述するタイマカウンタ8の値を含むタイマカウンタ値取得応答を割込み要因監視部7から入力し、タイマカウンタ8の値を割込み要因監視部7から取得する。処理部5は、回数カウンタ値取得要求を割込み要因監視部7に出力することで、後述する回数カウンタ9の値を含む回数カウンタ値取得応答を割込み要因監視部7から入力し、回数カウンタ9の値を割込み要因監視部7から取得する。   The processing unit 5 outputs the timer counter value acquisition request including the value of the timer counter 8 described later from the interrupt factor monitoring unit 7 by outputting the timer counter value acquisition request to the interrupt factor monitoring unit 7. The value is obtained from the interrupt factor monitoring unit 7. The processing unit 5 outputs the number counter value acquisition request including the value of the number counter 9 described later from the interrupt factor monitoring unit 7 by outputting the number counter value acquisition request to the interrupt factor monitoring unit 7. The value is obtained from the interrupt factor monitoring unit 7.

処理部5は、要因FIFO取得要求を割込み要因監視部7に出力することで、後述する要因FIFO10の記憶内容を含む要因FIFO取得応答を割込み要因監視部7から入力し、要因FIFO10の記憶内容を割込み要因監視部7から取得する。処理部5は、最大待ち要因取得要求を割込み要因監視部7に出力することで、後述する最大待ち要因レジスタ11の記憶内容を含む最大待ち要因取得応答を割込み要因監視部7から入力し、最大待ち要因レジスタ11の記憶内容を割込み要因監視部7から取得する。   The processing unit 5 outputs the factor FIFO acquisition request to the interrupt factor monitoring unit 7 by inputting a factor FIFO acquisition response including the storage content of the factor FIFO 10 to be described later from the interrupt factor monitoring unit 7 and outputs the factor FIFO 10 Obtained from the interrupt factor monitoring unit 7. The processing unit 5 outputs the maximum wait cause acquisition request including the contents stored in the maximum wait cause register 11 to be described later from the interrupt cause monitor unit 7 by outputting the maximum wait cause acquisition request to the interrupt cause monitor unit 7. The contents stored in the wait factor register 11 are acquired from the interrupt factor monitoring unit 7.

割込み要因監視部7は、割込み要因毎のタイマカウンタ8と回数カウンタ9とを有すると共に、要因FIFO10(要因記憶部に相当する)と最大待ち要因レジスタ11(最大待ち要因記憶部に相当する)とを有する。タイマカウンタ8は、何れかの割込み要因が発生している期間において、タイマ6からタイミング通知を入力する毎に対応する値をインクリメントし、その割込み発生からの経過時間を計測する。回数カウンタ9は、割込み制御装置3から割込み要求を入力すると、その割込み要求に対応して割込み制御装置3から入力した要因番号に対応する値をインクリメントし、その割込みの発生回数を計測する。タイマカウンタ8及び回数カウンタ9は、それぞれ処理部5から割込み要因クリア要求を入力すると、割込み要因に対応する値を「0」にクリアする。   The interrupt factor monitoring unit 7 has a timer counter 8 and a number counter 9 for each interrupt factor, and has a factor FIFO 10 (corresponding to a factor storage unit) and a maximum wait factor register 11 (corresponding to a maximum wait factor storage unit). Having. The timer counter 8 increments a corresponding value each time a timing notification is input from the timer 6 during a period in which any interrupt factor occurs, and measures the elapsed time from the occurrence of the interrupt. When an interrupt request is input from the interrupt control device 3, the number counter 9 increments the value corresponding to the factor number input from the interrupt control device 3 in response to the interrupt request, and measures the number of times the interrupt has occurred. When the timer counter 8 and the frequency counter 9 each receive an interrupt factor clear request from the processing unit 5, they clear the value corresponding to the interrupt factor to “0”.

要因FIFO10は、割込み制御装置3から要因番号を入力すると、その入力した要因番号を先入れ先出し順に記憶する。要因FIFO10は、記憶可能な要因番号の個数である上限数をm(mは自然数)とし、1〜m番目のm個の記憶領域を有している。要因FIFO10は、割込み制御装置3から要因番号を入力すると、記憶している要因番号の個数がp(pは自然数、p<m)であり、上限数に達していなければ、1〜p番目の記憶領域に記憶している要因番号をそれぞれ2〜(p+1)番目の記憶領域に移動する。そして、要因FIFO10は、割込み制御装置3から入力した要因番号、即ち最新の要因番号を1番目の記憶領域に記憶する。一方、要因FIFO10は、記憶している要因番号の個数がmであり、上限数に達していれば、m番目の記憶領域に記憶している要因番号を削除する。そして、要因FIFO10は、1〜(m−1)番目の記憶領域に記憶している要因番号をそれぞれ2〜m番目の記憶領域に移動し、割込み制御装置3から入力した要因番号、即ち最新の要因番号を1番目の記憶領域に記憶する。尚、要因FIFO10は、上限数を任意に変更可能である。   When a factor number is input from the interrupt control device 3, the factor FIFO 10 stores the input factor numbers in first-in first-out order. The factor FIFO 10 has an upper limit number m (m is a natural number), which is the number of factor numbers that can be stored, and has m to m-th storage areas. When the factor number is input from the interrupt control device 3 to the factor FIFO 10, the number of stored factor numbers is p (p is a natural number, p <m). The factor numbers stored in the storage areas are respectively moved to the second to (p + 1) th storage areas. Then, the factor FIFO 10 stores the factor number input from the interrupt control device 3, that is, the latest factor number in the first storage area. On the other hand, the factor FIFO 10 deletes the factor number stored in the m-th storage area if the number of stored factor numbers is m and the number reaches the upper limit. Then, the factor FIFO 10 moves the factor numbers stored in the first to (m-1) th storage areas to the second to mth storage areas, respectively, and outputs the factor number input from the interrupt control device 3, that is, the latest factor number. The factor number is stored in the first storage area. The upper limit number of the factor FIFO 10 can be arbitrarily changed.

最大待ち要因レジスタ11は、n個の割込み要因の中でタイマカウンタ8の値が最大の割込み要因の要因番号、又は回数カウンタ9の値が最大の割込み要因の要因番号を記憶するレジスタである。即ち、最大待ち要因レジスタ11は、n個の割込み要因の中でタイマカウンタ8の値が最大の割込み要因の要因番号を記憶することで、割込み要因が発生しているにも関わらず、その割込み要因に対応する割込み処理が実行されるまでの経過時間、即ち割込み発生からの経過時間が最も長い割込み要因を記憶する。又、最大待ち要因レジスタ11は、n個の割込み要因の中で回数カウンタ9の値が最大の割込み要因の要因番号を記憶することで、割込み要因が発生しているにも関わらず、その対応する割込み処理が実行されるまでの発生回数、即ち割込みの発生回数が最も多い割込み要因を記憶する。   The maximum wait factor register 11 is a register for storing the factor number of the interrupt factor with the largest value of the timer counter 8 or the interrupt factor with the largest value of the number counter 9 among the n interrupt factors. That is, the maximum wait factor register 11 stores the factor number of the interrupt factor having the largest value of the timer counter 8 among the n interrupt factors, so that the interrupt factor is generated regardless of the occurrence of the interrupt factor. The elapsed time until the interrupt processing corresponding to the cause is executed, that is, the interrupt cause having the longest elapsed time from the occurrence of the interrupt is stored. The maximum wait cause register 11 stores the cause number of the interrupt cause having the largest value of the number of times counter 9 among the n interrupt causes. The number of occurrences until the interrupt processing to be executed is executed, that is, the interrupt factor with the largest number of occurrences of the interrupt is stored.

この場合、割込み要因監視部7は、タイマカウンタ8を用いた方式及び回数カウンタ9を用いた方式のうち何れかで最大待ち要因レジスタ11の記憶内容を更新する必要があり、何れの方式で更新するかを選択可能である。割込み要因監視部7が最大待ち要因レジスタ11の記憶内容を更新するタイミングとして以下の2つのタイミングがある。   In this case, the interrupt cause monitoring unit 7 needs to update the storage content of the maximum wait cause register 11 by one of the method using the timer counter 8 and the method using the number counter 9, You can choose to do it. There are the following two timings at which the interrupt factor monitoring unit 7 updates the contents stored in the maximum wait factor register 11.

1つ目は、割込み要因監視部7が割込み制御装置3から割込み要求を入力したタイミングである。割込み要因監視部7は、割込み制御装置3から割込み要求を入力すると、その割込み要求に対応して割込み制御装置3から入力した要因番号に対応する回数カウンタ9の値をインリメントする。そのため、回数カウンタ9の値が最大となる割込み要因が変化する可能性がある。回数カウンタ9の値が最大となる割込み要因が変化すると、それまで最大待ち要因レジスタ11が記憶している割込み要因の要因番号と、回数カウンタ9の値が最大となった割込み要因の要因番号とが合致しなくなる。よって、この場合は最大待ち要因レジスタ11の記憶内容を更新する必要がある。   The first is a timing at which the interrupt factor monitoring unit 7 inputs an interrupt request from the interrupt control device 3. When an interrupt request is input from the interrupt control device 3, the interrupt factor monitoring unit 7 increments the value of the number counter 9 corresponding to the factor number input from the interrupt control device 3 in response to the interrupt request. Therefore, there is a possibility that the interrupt factor at which the value of the number counter 9 becomes the maximum changes. When the interrupt factor at which the value of the frequency counter 9 becomes the maximum changes, the factor number of the interrupt factor stored in the maximum wait factor register 11 and the factor number of the interrupt factor at which the value of the frequency counter 9 becomes the maximum are determined. Will not match. Therefore, in this case, it is necessary to update the contents stored in the maximum wait cause register 11.

2つ目は、割込み要因監視部7が処理部5から割込み要因クリア要求を入力したタイミングである。割込み要因監視部7は、処理部5から割込み要因クリア要求を入力すると、割込み要因に対応するタイマカウンタ8の値及び回数カウンタ9の値の両方を「0」にクリアする。そのため、それまで最大待ち要因レジスタ11が記憶している割込み要因の要因番号と、割込み要因クリア要求によりタイマカウンタ8の値及び回数カウンタ9の値の両方が「0」にクリアされた割込み要因の要因番号とが合致していると、それまで最大待ち要因レジスタ11が記憶している割込み要因の要因番号と、タイマカウンタ8の値又は回数カウンタ9の値が最大となった割込み要因の要因番号とが合致しなくなる。よって、この場合も最大待ち要因レジスタ11の記憶内容を更新する必要がある。   The second is a timing at which the interrupt factor monitoring unit 7 inputs an interrupt factor clear request from the processing unit 5. Upon receiving the interrupt factor clear request from the processing unit 5, the interrupt factor monitoring unit 7 clears both the value of the timer counter 8 and the value of the number counter 9 corresponding to the interrupt factor to “0”. Therefore, the interrupt cause factor number stored in the maximum wait cause register 11 and the interrupt cause for which both the value of the timer counter 8 and the value of the number counter 9 have been cleared to “0” by the interrupt cause clear request are stored. If the cause numbers match, the cause number of the interrupt cause stored in the maximum wait cause register 11 and the cause number of the interrupt cause for which the value of the timer counter 8 or the value of the number counter 9 has become the maximum. Does not match. Therefore, also in this case, it is necessary to update the contents stored in the maximum wait cause register 11.

尚、割込み要因監視部7は、タイマ6からタイミング通知を入力すると、発生している割込み要因に対応する全てのタイマカウンタ8の値を一斉にインクリメントする。そのため、タイマカウンタ8の値が最大の割込み要因が変化することはなく、それまで最大待ち要因レジスタ11が記憶している割込み要因の要因番号と、タイマカウンタ8の値が最大の割込み要因の要因番号とが合致したままである。よって、この場合は最大待ち要因レジスタ11の記憶内容を更新する必要はない。   When a timing notification is input from the timer 6, the interrupt factor monitoring unit 7 simultaneously increments the values of all the timer counters 8 corresponding to the interrupt factor that has occurred. Therefore, the interrupt factor with the maximum value of the timer counter 8 does not change, and the factor number of the interrupt factor stored in the maximum wait factor register 11 and the factor of the interrupt factor with the maximum value of the timer counter 8 are not changed. The numbers remain consistent. Therefore, in this case, there is no need to update the stored contents of the maximum wait cause register 11.

次に、上記した構成の作用について図2から図7を参照して説明する。割込み要因監視部7は、割込み制御装置3から割込み要求を入力すると、割込み要因の監視処理を実行し、タイマ6からタイミング通知を入力すると、タイマカウンタ8の更新処理を実行する。以下、割込み要因の監視処理及びタイマカウンタ8の更新処理について順次説明する。尚、割込み要因監視部7が割込み制御装置3から割込み要求を入力するタイミングとタイマ6からタイミング通知を入力するタイミングとの間には依存関係が存在しないので、割込み要因監視部7は、割込み要因の監視処理及びタイマカウンタ8の更新処理を独立して実行する。   Next, the operation of the above configuration will be described with reference to FIGS. The interrupt factor monitoring unit 7 executes an interrupt factor monitoring process when an interrupt request is input from the interrupt control device 3, and updates a timer counter 8 when a timing notification is input from the timer 6. Hereinafter, the process of monitoring the interrupt factor and the process of updating the timer counter 8 will be sequentially described. Since there is no dependency between the timing at which the interrupt factor monitoring unit 7 inputs an interrupt request from the interrupt control device 3 and the timing at which a timing notification is input from the timer 6, the interrupt factor monitoring unit 7 And the updating process of the timer counter 8 are executed independently.

(1)割込み要因の監視処理
割込み要因監視部7は、割込み要因の監視処理を開始すると、割込み通知を処理部5に出力する(S1)。このとき、処理部5は、割込み要因監視部7から割込み通知を入力することで、割込み処理を開始する。
(1) Interrupt Factor Monitoring Process When the interrupt factor monitoring unit 7 starts the interrupt factor monitoring process, it outputs an interrupt notification to the processing unit 5 (S1). At this time, the processing unit 5 starts interrupt processing by inputting an interrupt notification from the interrupt factor monitoring unit 7.

割込み要因監視部7は、割込み通知を処理部5に出力すると、要因FIFO10の更新処理に移行する(S2)。割込み要因監視部7は、要因FIFO10の更新処理を開始すると、割込み制御装置3から入力した要因番号を取得し(S11)、記憶している要因番号の個数が上限数に達しているか否かを判定する(S12)。ここで、割込み要因監視部7は、上限数をmとすると、記憶している要因番号の個数がp(p<m)であれば、記憶している要因番号の個数が上限数に達していないと判定する(S12:NO)。割込み要因監視部7は、1〜p番目の記憶領域に記憶している要因番号をそれぞれ2〜(p+1)番目の記憶領域に移動し(S13)、その取得した要因番号を1番目の記憶領域に記憶し(S14)、要因FIFO10の更新処理を終了し、割込み要因の監視処理に戻る。   Upon outputting the interrupt notification to the processing unit 5, the interrupt factor monitoring unit 7 shifts to updating the factor FIFO 10 (S2). When starting the updating process of the factor FIFO 10, the interrupt factor monitoring unit 7 acquires the factor number input from the interrupt control device 3 (S11), and determines whether the number of stored factor numbers has reached the upper limit number. A determination is made (S12). Here, assuming that the upper limit number is m, if the number of stored factor numbers is p (p <m), the interrupt factor monitoring unit 7 has reached the upper limit number. It is determined that it does not exist (S12: NO). The interrupt factor monitoring unit 7 moves the factor numbers stored in the first to p-th storage areas to the second to (p + 1) -th storage areas, respectively (S13), and stores the acquired factor numbers in the first storage area. (S14), the updating process of the factor FIFO 10 is completed, and the process returns to the monitoring process of the interrupt factor.

一方、割込み要因監視部7は、記憶している要因番号の個数がmであれば、記憶している要因番号の個数が上限数に達していると判定する(S12:YES)。割込み要因監視部7は、m番目の記憶領域に記憶している要因番号を削除し(S15)、1〜(m−1)番目の記憶領域に記憶している要因番号をそれぞれ2〜m番目の記憶領域に移動し(S16)、その取得した要因番号を1番目の記憶領域に記憶し(S17)、要因FIFO10の更新処理を終了し、割込み要因の監視処理に戻る。割込み要因監視部7は、このようにして要因番号を先入れ先出し順に記憶することで、過去に発生した割込み要因を、その発生順序を維持したまま記憶可能となる。   On the other hand, if the number of stored factor numbers is m, the interrupt factor monitoring unit 7 determines that the stored number of factor numbers has reached the upper limit (S12: YES). The interrupt factor monitoring unit 7 deletes the factor numbers stored in the m-th storage area (S15), and replaces the factor numbers stored in the first to (m-1) -th storage areas with the second to m-th, respectively. (S16), the acquired factor number is stored in the first storage area (S17), the updating process of the factor FIFO 10 is ended, and the process returns to the interrupt factor monitoring process. By storing the factor numbers in the first-in first-out order in this manner, the interrupt factor monitoring unit 7 can store the interrupt factors that have occurred in the past while maintaining the order of occurrence.

割込み要因監視部7は、割込み要因の監視処理に戻ると、回数カウンタ9の更新処理に移行する(S3)。割込み要因監視部7は、回数カウンタ9の更新処理を開始すると、割込み制御装置3から入力して取得した要因番号を取得し(S21)、その取得した要因番号に対応する回数カウンタ9の値をインクリメントし(S22)、回数カウンタの更新処理を終了し、割込み要因の監視処理に戻る。割込み要因監視部7は、このように発生した割込み要因に対応する回数カウンタ9の値をインクリメントすることで、割込み要因毎に割込みの発生回数を記憶可能となる。尚、以上は、割込み要因監視部7は、要因FIFO10の更新処理を終了した後に回数カウンタの更新処理を実行する場合を説明したが、要因FIFO10の更新処理と回数カウンタ9の更新処理との間には依存関係が存在しないので、要因FIFO10の更新処理と回数カウンタ9の更新処理とを同時に(即ち並列に)実行しても良い。   When returning to the interrupt factor monitoring process, the interrupt factor monitoring unit 7 proceeds to an update process of the number counter 9 (S3). When the interrupt factor monitoring unit 7 starts the updating process of the number counter 9, it acquires the factor number input and acquired from the interrupt control device 3 (S <b> 21) and updates the value of the number counter 9 corresponding to the acquired factor number. The value is incremented (S22), the update process of the number counter is completed, and the process returns to the interrupt factor monitoring process. The interrupt factor monitoring unit 7 can store the number of interrupt occurrences for each interrupt factor by incrementing the value of the number counter 9 corresponding to the interrupt factor thus generated. In the above description, the case where the interrupt factor monitoring unit 7 executes the updating process of the number counter after finishing the updating process of the factor FIFO 10 has been described. Since there is no dependency relationship, the updating process of the factor FIFO 10 and the updating process of the number counter 9 may be executed simultaneously (that is, in parallel).

割込み要因監視部7は、割込み要因の監視処理に戻ると、割込み要求入力時の最大待ち要因レジスタ11の更新処理に移行する。割込み要因監視部7は、割込み要求入力時の最大待ち要因レジスタ11の更新処理を開始すると、最大待ち要因レジスタ11に記憶されている割込み要因の要因番号が回数カウンタ9で更新されるか否かを判定する(S31)。割込み要因監視部7は、最大待ち要因レジスタ11に記憶されている割込み要因の要因番号が回数カウンタ9により更新されないと判定すると(S31:NO)、最大待ち要因レジスタ11の記憶内容の更新が不要となるので、割込み要求入力時の最大待ち要因レジスタ11の更新処理を終了し、割込み要因の監視処理に戻る。   When the interrupt factor monitoring unit 7 returns to the interrupt factor monitoring process, the process shifts to updating the maximum wait factor register 11 when an interrupt request is input. When the interrupt factor monitoring unit 7 starts updating the maximum wait factor register 11 when an interrupt request is input, the interrupt factor monitor unit 7 determines whether or not the factor number of the interrupt factor stored in the maximum wait factor register 11 is updated by the number counter 9. Is determined (S31). When determining that the factor number of the interrupt factor stored in the maximum wait factor register 11 is not updated by the number counter 9 (S31: NO), the interrupt factor monitoring unit 7 does not need to update the content stored in the maximum wait factor register 11. Therefore, the update process of the maximum wait cause register 11 at the time of inputting the interrupt request is ended, and the process returns to the interrupt cause monitoring process.

一方、割込み要因監視部7は、最大待ち要因レジスタ11に記憶されている割込み要因の要因番号が回数カウンタ9により更新されると判定すると(S31:YES)、割込み制御装置3から入力して取得した要因番号と、最大待ち要因レジスタ11に記憶されている割込み要因の要因番号とが異なるか否かを判定する(S32)。割込み要因監視部7は、両者が同じであると判定すると(S32:NO)、回数カウンタ9の値を更新したとしても値が最大となる割込み要因が変化せず、最大待ち要因レジスタ11の記憶内容の更新が不要となるので、割込み要求入力時の最大待ち要因レジスタ11の更新処理を終了し、割込み要因の監視処理に戻る。   On the other hand, if the interrupt factor monitoring unit 7 determines that the factor number of the interrupt factor stored in the maximum wait factor register 11 is updated by the number counter 9 (S31: YES), the interrupt factor monitoring unit 7 inputs and obtains the interrupt number from the interrupt control device 3. It is determined whether or not the factor number thus set is different from the factor number of the interrupt factor stored in the maximum wait factor register 11 (S32). If the interrupt factor monitoring unit 7 determines that the two are the same (S32: NO), the interrupt factor having the maximum value does not change even if the value of the number counter 9 is updated, and the maximum wait factor register 11 stores the interrupt factor. Since it is not necessary to update the contents, the update processing of the maximum wait cause register 11 at the time of input of the interrupt request is ended, and the process returns to the interrupt cause monitoring processing.

一方、割込み要因監視部7は、両者が異なると判定すると(S32:YES)、回数カウンタ9の値を更新することで、値が最大となる割込み要因が変化する可能性があるので、割込み制御装置3から入力して取得した要因番号に対応する回数カウンタ9の値と最大待ち要因レジスタ11に記憶されている割込み要因の要因番号に対応する回数カウンタ9の値との大小を比較する(S33)。割込み要因監視部7は、割込み制御装置3から入力して取得した要因番号に対応する回数カウンタ9の値が、最大待ち要因レジスタ11に記憶されている割込み要因の要因番号に対応する回数カウンタ9の値よりも大きくないと判定すると(S33:NO)、最大待ち要因レジスタ11の記憶内容の更新が不要となるので、割込み要求入力時の最大待ち要因レジスタ11の更新処理を終了し、割込み要因の監視処理に戻る。   On the other hand, when determining that the two are different (S32: YES), the interrupt factor monitoring unit 7 updates the value of the number counter 9 to change the interrupt factor having the maximum value. The value of the number counter 9 corresponding to the factor number input and obtained from the device 3 is compared with the value of the number counter 9 corresponding to the factor number of the interrupt factor stored in the maximum wait factor register 11 (S33). ). The interrupt factor monitoring unit 7 determines whether the value of the number counter 9 corresponding to the factor number input and acquired from the interrupt control device 3 is the number counter 9 corresponding to the factor number of the interrupt factor stored in the maximum wait factor register 11. (S33: NO), it is not necessary to update the storage contents of the maximum wait cause register 11, so that the update processing of the maximum wait cause register 11 at the time of inputting the interrupt request is terminated, and the interrupt cause It returns to the monitoring process of.

一方、割込み要因監視部7は、割込み制御装置3から入力して取得した要因番号に対応する回数カウンタ9の値が、最大待ち要因レジスタ11に記憶されている割込み要因の要因番号に対応する回数カウンタ9の値よりも大きいと判定すると(S33:YES)、割込み制御装置3から入力して取得した要因番号を最大待ち要因レジスタ11に記憶し(S34)、割込み要求入力時の最大待ち要因レジスタ11の更新処理を終了し、割込み要因の監視処理に戻る。   On the other hand, the interrupt factor monitoring unit 7 determines that the value of the frequency counter 9 corresponding to the factor number input and acquired from the interrupt control device 3 is the number of times corresponding to the factor number of the interrupt factor stored in the maximum wait factor register 11. If it is determined that the value is larger than the value of the counter 9 (S33: YES), the factor number input and obtained from the interrupt controller 3 is stored in the maximum wait factor register 11 (S34), and the maximum wait factor register at the time of inputting the interrupt request is stored. The update process of No. 11 ends, and the process returns to the interrupt factor monitoring process.

割込み要因監視部7は、割込み要因の監視処理に戻ると、処理部5からの割込み要因クリア要求の入力を待機する(S5)。これ以降、処理部5は、割込み処理を完了すると、割込み要因クリア処理を実行し、割込み要因クリア要求を割込み要因監視部7に出力する。割込み要因監視部7は、処理部5から割込み要因クリア要求を入力したと判定すると(S5:YES)、割込み要因クリア時の最大待ち要因レジスタ11の更新処理に移行する(S6)。   When returning to the interrupt factor monitoring process, the interrupt factor monitoring unit 7 waits for an interrupt factor clear request from the processing unit 5 (S5). Thereafter, when the interrupt processing is completed, the processing unit 5 executes the interrupt factor clearing process and outputs an interrupt factor clear request to the interrupt factor monitoring unit 7. When determining that an interrupt factor clear request has been input from the processing unit 5 (S5: YES), the interrupt factor monitoring unit 7 shifts to updating the maximum wait factor register 11 when the interrupt factor is cleared (S6).

割込み要因監視部7は、割込み要因クリア時の最大待ち要因レジスタ11の更新処理を開始すると、処理部5から入力した割込み要因クリア要求により指定されているクリア対象の要因番号と最大待ち要因レジスタ11に記憶されている割込み要因の要因番号とが異なるか否かを判定する(S41)。割込み要因監視部7は、両者が異なると判定すると(S41:YES)、最大待ち要因レジスタ11に記憶されている割込み要因の要因番号が変化せず、最大待ち要因レジスタ11の記憶内容の更新が不要となるので、割込み要因クリア時の最大待ち要因レジスタ11の更新処理を終了し、割込み要因の監視処理に戻る。   When the interrupt factor monitoring unit 7 starts updating the maximum wait factor register 11 at the time of clearing the interrupt factor, the interrupt factor monitoring unit 7 and the factor number of the clear target designated by the interrupt factor clear request input from the processing unit 5 and the maximum wait factor register 11 It is determined whether or not the cause number of the interrupt cause stored in (1) is different (S41). If the interrupt factor monitoring unit 7 determines that the two are different (S41: YES), the factor number of the interrupt factor stored in the maximum wait factor register 11 does not change, and the contents stored in the maximum wait factor register 11 are updated. Since it becomes unnecessary, the update process of the maximum wait cause register 11 at the time of clearing the interrupt factor is ended, and the process returns to the interrupt factor monitoring process.

一方、割込み要因監視部7は、両者が同じであると判定すると(S41:NO)、最大待ち要因レジスタ11に記憶されている割込み要因の要因番号が回数カウンタ9により更新されるか否かを判定する(S42)。割込み要因監視部7は、最大待ち要因レジスタ11に記憶されている割込み要因の要因番号が回数カウンタ9により更新されないと判定すると(S42:NO)、タイマカウンタ8の値が最大の割込み要因が最大待ち要因レジスタ11に記憶される必要があるので、全ての割込み要因の中からタイマカウンタ8の値が最大の割込み要因を探索する(S43)。そして、割込み要因監視部7は、その探索した割込み要因の要因番号を最大待ち要因レジスタ11に記憶し(S44)、割込み要因クリア時の最大待ち要因レジスタ11の更新処理を終了し、割込み要因の監視処理に戻る。   On the other hand, when the interrupt factor monitoring unit 7 determines that the two are the same (S41: NO), the interrupt factor monitoring unit 7 determines whether the factor number of the interrupt factor stored in the maximum wait factor register 11 is updated by the number counter 9 or not. A determination is made (S42). If the interrupt factor monitoring unit 7 determines that the factor number of the interrupt factor stored in the maximum wait factor register 11 is not updated by the number-of-times counter 9 (S42: NO), the interrupt factor with the maximum value of the timer counter 8 is the maximum. Since it is necessary to store the interrupt factor in the wait factor register 11, the interrupt factor having the maximum value of the timer counter 8 is searched from all the interrupt factors (S43). Then, the interrupt factor monitoring unit 7 stores the factor number of the found interrupt factor in the maximum wait factor register 11 (S44), finishes the update process of the maximum wait factor register 11 when the interrupt factor is cleared, and returns the interrupt factor. Return to the monitoring process.

一方、割込み要因監視部7は、最大待ち要因レジスタ11に記憶されている割込み要因の要因番号が回数カウンタ9により更新されると判定すると(S42:YES)、全ての割込み要因の中から回数カウンタ9の値が最大の割込み要因を探索する(S45)。割込み要因監視部7は、探索した割込み要因が複数であるか否かを判定し(S46)、その探索した割込み要因が複数でない(即ち1つである)と判定すると(S46:NO)、その探索した割込み要因の要因番号を最大待ち要因レジスタ11に記憶し(S44)、割込み要因クリア時の最大待ち要因レジスタ11の更新処理を終了し、割込み要因の監視処理に戻る。   On the other hand, if the interrupt factor monitoring unit 7 determines that the factor number of the interrupt factor stored in the maximum wait factor register 11 is updated by the count counter 9 (S42: YES), the count counter of all interrupt factors is counted. The interrupt factor having the maximum value of 9 is searched for (S45). The interrupt factor monitoring unit 7 determines whether or not the searched interrupt factor is plural (S46), and when it is determined that the searched interrupt factor is not plural (that is, one) (S46: NO), The factor number of the found interrupt factor is stored in the maximum wait factor register 11 (S44), the process of updating the maximum wait factor register 11 when the interrupt factor is cleared ends, and the process returns to the interrupt factor monitoring process.

一方、割込み要因監視部7は、その探索した割込み要因が複数であると判定すると(S46:YES)、その複数の割込み要因の中からタイマカウンタ8の値が最大の割込み要因を探索する(S47)。そして、割込み要因監視部7は、その探索した割込み要因の要因番号を最大待ち要因レジスタ11に記憶し(S44)、割込み要因クリア時の最大待ち要因レジスタ11の更新処理を終了し、割込み要因の監視処理に戻る。   On the other hand, if the interrupt factor monitoring unit 7 determines that the searched interrupt factors are plural (S46: YES), the interrupt factor monitoring unit 7 searches for the interrupt factor with the maximum value of the timer counter 8 from among the plural interrupt factors (S47). ). Then, the interrupt factor monitoring unit 7 stores the factor number of the found interrupt factor in the maximum wait factor register 11 (S44), finishes the update process of the maximum wait factor register 11 when the interrupt factor is cleared, and returns the interrupt factor. Return to the monitoring process.

(2)タイマカウンタ8の更新処理
割込み要因監視部7は、タイマカウンタ8の更新処理を開始すると、回数カウンタ9の値が「0」でない割込み要因が存在するか否かを判定する(S51)。割込み要因監視部7は、回数カウンタ9の値が「0」でない割込み要因が存在していないと判定すると(S51:NO)、割込み要因が発生していないと判定し、タイマカウンタ8の値をインクリメントせず、タイマカウンタ8の更新処理を終了する。一方、割込み要因監視部7は、回数カウンタ9の値が「0」でない割込み要因が存在していると判定すると(S51:YES)、割込み要因が発生していると判定し、その割込み要因に対応するタイマカウンタ8の値をインクリメントし(S52)、タイマカウンタ8の更新処理を終了する。
(2) Update process of timer counter 8 When the update process of the timer counter 8 starts, the interrupt factor monitoring unit 7 determines whether there is an interrupt factor whose value of the number counter 9 is not “0” (S51). . When determining that there is no interrupt factor whose value of the number counter 9 is not “0” (S51: NO), the interrupt factor monitoring unit 7 determines that no interrupt factor has occurred, and changes the value of the timer counter 8. The process of updating the timer counter 8 ends without incrementing. On the other hand, when determining that there is an interrupt factor whose value of the number counter 9 is not “0” (S51: YES), the interrupt factor monitoring unit 7 determines that the interrupt factor has occurred, and determines that the interrupt factor has occurred. The value of the corresponding timer counter 8 is incremented (S52), and the updating process of the timer counter 8 ends.

このようにして割込み要因監視部7が割込み要因の監視処理及びタイマカウンタ8の更新処理を実行することで、割込み発生からの経過時間が最も長い割込み要因を判別する処理を処理部5が実行しなくとも、その経過時間が最も長い割込み要因を割込み要因監視部7で判別可能となる。加えて、割込みの発生回数が最も多い割込み要因を処理部5が実行しなくとも、その発生回数が最も多い割込み要因を発生順序にしたがって割込み要因監視部7で判別可能となる。これにより、処理部5は、経過時間が最も長い割込み要因や発生回数が最も多い割込み要因を割込み要因監視部7から取得することで、その取得した経過時間や発生回数に応じて割込み処理の実行順序を変更する等の高度な割込み処理を実行可能となる。尚、タイマカウンタ8の値を用いて割込み発生からの経過時間が最も長い割込み要因を判別する判別方法と、タイマカウンタ8の値と回数カウンタ9の値とを用いて割込み発生からの経過時間が最も長い割込み要因を判別する判別方法とのうち何れかを選択可能としても良い。   As described above, the interrupt factor monitoring unit 7 executes the monitoring process of the interrupt factor and the updating process of the timer counter 8, so that the processing unit 5 executes the process of determining the interrupt factor having the longest elapsed time from the occurrence of the interrupt. If not, the interrupt factor monitoring unit 7 can determine the interrupt factor whose elapsed time is the longest. In addition, even if the processing unit 5 does not execute the interrupt factor with the largest number of occurrences of the interrupt, the interrupt factor monitoring unit 7 can determine the interrupt factor with the largest number of occurrences in the order of occurrence. Thereby, the processing unit 5 acquires the interrupt factor having the longest elapsed time and the interrupt factor having the largest number of occurrences from the interrupt factor monitoring unit 7, and executes the interrupt processing according to the acquired elapsed time and the number of occurrences. Advanced interrupt processing such as changing the order can be performed. A method of determining the interrupt factor having the longest elapsed time since the occurrence of the interrupt using the value of the timer counter 8, and a method of determining the elapsed time from the occurrence of the interrupt using the value of the timer counter 8 and the value of the number counter 9. Any one of the longest interrupt factor determination method and the determination method may be made selectable.

以上に説明したように本実施形態によれば、次に示す効果を得ることができる。
マイコン2において、最大待ち要因レジスタ11に記憶されている記憶内容により、複数の割込み要因のうち割込み発生からの経過時間が最も長い割込み要因を割込み要因監視部7が判別するようにした。経過時間が最も長い割込み要因を判別する処理を処理部5が実行しなくとも、経過時間が最も長い割込み要因を割込み要因監視部7が判別することで、処理部5の処理負荷が増大することなく、割込み発生からの経過時間を用いた高度な割込み処理を実行することができる。又、複数の割込み要因を監視することで、複数の割込み要因に対応することができ、電子制御装置1を含めたシステムの柔軟な開発を実現することができる。
According to the present embodiment as described above, the following effects can be obtained.
In the microcomputer 2, the interrupt factor monitoring unit 7 determines the interrupt factor having the longest elapsed time from the occurrence of the interrupt among the plurality of interrupt factors, based on the contents stored in the maximum wait factor register 11. Even if the processing unit 5 does not execute the process of determining the interrupt factor with the longest elapsed time, the interrupt factor monitoring unit 7 determines the interrupt factor with the longest elapsed time, so that the processing load on the processing unit 5 increases. Instead, it is possible to execute an advanced interrupt process using the elapsed time from the occurrence of the interrupt. Further, by monitoring a plurality of interrupt factors, it is possible to cope with the plurality of interrupt factors, thereby realizing a flexible development of a system including the electronic control unit 1.

又、マイコン2において、要因FIFO10に記憶されている記憶内容により、複数の割込み要因のうち割込みの発生回数が最も多い割込み要因を割込み要因監視部7が判別するようにした。発生回数が最も多い割込み要因を判別する処理を処理部5が実行しなくとも、発生回数が最も多い割込み要要因を割込み要因監視部7が判別することで、処理部5の処理負荷が増大することなく、割込み発生からの経過時間に加えて割込みの発生回数を用いた高度な割込み処理を実行することができる。又、過去に発生した割込み要因の発生順序を維持したまま記憶することで、デバッグを容易に行うことができる。   Further, in the microcomputer 2, the interrupt factor monitoring unit 7 determines the interrupt factor with the largest number of interrupt occurrences among a plurality of interrupt factors, based on the stored contents stored in the factor FIFO 10. Even if the processing unit 5 does not execute the process of determining the interrupt factor with the largest number of occurrences, the interrupt factor monitoring unit 7 determines the interrupt required factor with the largest number of occurrences, so that the processing load on the processing unit 5 increases. Without interruption, it is possible to execute an advanced interrupt process using the number of times an interrupt has occurred in addition to the elapsed time from the occurrence of the interrupt. Debugging can be easily performed by storing while maintaining the order of occurrence of interrupt factors that occurred in the past.

又、マイコン2において、タイマカウンタ8の値を用いて割込み発生からの経過時間が最も長い割込み要因を判別する判別方法と、タイマカウンタ8の値と回数カウンタ9の値とを用いて割込み発生からの経過時間が最も長い割込み要因を判別する判別方法とのうち何れかを選択するようにした。何れかの判別方法を、電子制御装置1を含めたシステムに応じて選択することで、システムの柔軟な開発を実現することができる。   The microcomputer 2 uses the value of the timer counter 8 to determine the cause of the interrupt that has the longest elapsed time since the occurrence of the interrupt. The microcomputer 2 uses the value of the timer counter 8 and the value of the number counter 9 to determine the cause of the interrupt. One of the determination methods for determining the interrupt factor having the longest elapsed time is selected. By selecting one of the determination methods according to the system including the electronic control unit 1, flexible development of the system can be realized.

又、マイコン2において、タイマ6からタイミング通知を入力することで、タイマカウンタの値を更新するようにした。タイマカウンタの値を定期的に更新し、割込み発生からの経過時間を適切に計測することができる。   Further, the microcomputer 2 updates the value of the timer counter by inputting a timing notification from the timer 6. It is possible to periodically update the value of the timer counter and appropriately measure the elapsed time from the occurrence of the interrupt.

又、マイコン2において、タイマカウンタ8の値、回数カウンタ9の値、要因FIFO10の記憶内容、最大待ち要因記憶部11の記憶内容を処理部5が割込み要因監視部7から取得するようにした。タイマカウンタ8の値、回数カウンタ9の値、要因FIFO10の記憶内容、最大待ち要因記憶部11の記憶内容を処理部5が任意のタイミングで取得することができる。   Further, in the microcomputer 2, the processing unit 5 acquires the value of the timer counter 8, the value of the number counter 9, the storage content of the factor FIFO 10, and the storage content of the maximum wait factor storage unit 11 from the interrupt factor monitoring unit 7. The processing unit 5 can acquire the value of the timer counter 8, the value of the number counter 9, the storage contents of the factor FIFO 10, and the storage contents of the maximum wait factor storage unit 11 at any timing.

又、マイコン2において、処理部5が割込み要因クリアを割込み要因監視部7に出力すると、タイマカウンタ8の値、回数カウンタ9の値、要因FIFO10の記憶内容、最大待ち要因記憶部11の記憶内容をクリアするようにした。タイマカウンタ8の値、回数カウンタ9の値、要因FIFO10の記憶内容、最大待ち要因記憶部11の記憶内容を処理部5が任意のタイミングでクリアすることができる。   Also, in the microcomputer 2, when the processing unit 5 outputs the interrupt factor clear to the interrupt factor monitoring unit 7, the value of the timer counter 8, the value of the number counter 9, the content of the factor FIFO 10, and the content of the maximum waiting factor storage unit 11 Was cleared. The processing unit 5 can clear the value of the timer counter 8, the value of the number counter 9, the storage contents of the factor FIFO 10, and the storage contents of the maximum wait factor storage unit 11 at any timing.

本発明は、上記した実施形態で例示したものに限定されることなく、その範囲を逸脱しない範囲で任意に変形又は拡張することができる。
電子制御装置1は、車両用のエンジンの始動を制御する装置に限らず、どのような電子制御装置に適用しても良い。
The present invention can be arbitrarily modified or expanded without departing from the scope thereof, without being limited to those exemplified in the above embodiments.
The electronic control device 1 is not limited to a device that controls the start of a vehicle engine, and may be applied to any electronic control device.

本開示は、実施例に準拠して記述されたが、当該実施例や構造に限定されるものではないと理解される。本開示は、様々な変形例や均等範囲内の変形をも包含する。加えて、様々な組み合わせや形態、更には、それらに一要素のみ、それ以上、或いはそれ以下を含む他の組み合わせや形態をも、本開示の範疇や思想範囲に入るものである。   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 the structures. The present disclosure also encompasses various modifications and variations within an equivalent range. In addition, various combinations and forms, and other combinations and forms including one element, more elements, or less elements are also included in the scope and spirit of the present disclosure.

図面中、1は電子制御装置、2はマイコン、5は処理部、7は割込み要因監視部、8はタイマカウンタ、9は回数カウンタ、10は要因FIFO(要因記憶部)、11は最大待ち要因レジスタ(最大待ち要因記憶部)である。   In the drawings, 1 is an electronic control unit, 2 is a microcomputer, 5 is a processing unit, 7 is an interrupt factor monitoring unit, 8 is a timer counter, 9 is a counter, 10 is a FIFO (factor storage), and 11 is a maximum wait factor. This is a register (maximum wait factor storage unit).

Claims (5)

所定のプログラムにしたがって割込み処理を実行する処理部(5)を備えたマイクロコンピュータ(2)において、
前記処理部とは別に設けられ、外部からの複数の割込み要因を監視する割込み要因監視部(7)を備え、
前記割込み要因監視部は、割込み要因毎の割込み発生からの経過時間を計測するタイマカウンタ(8)と、前記割込み要因毎の割込みの発生回数を計測する回数カウンタ(9)と、複数の割込み要因の中で前記タイマカウンタの値が最大の割込み要因の要因番号、又は前記回数カウンタの値が最大の割込み要因の要因番号を記憶する最大待ち要因記憶部(11)と、を有し、前記最大待ち要因記憶部に記憶されている割込み要因の要因番号が前記回数カウンタにより更新されない場合に前記タイマカウンタの値を用いて複数の割込み要因のうち割込み発生からの経過時間が最も長い割込み要因を判別する第1の判別方法と、前記最大待ち要因記憶部に記憶されている割込み要因の要因番号が前記回数カウンタにより更新される場合に前記タイマカウンタの値と前記回数カウンタの値とを用いて複数の割込み要因のうち割込み発生からの経過時間が最も長い割込み要因を判別する第2の判別方法とのうち何れかを選択するマイクロコンピュータ。
In a microcomputer (2) including a processing unit (5) for executing an interrupt process according to a predetermined program,
An interrupt factor monitoring unit (7) provided separately from the processing unit and monitoring a plurality of external interrupt factors;
The interrupt factor monitoring unit includes a timer counter (8) for measuring an elapsed time from occurrence of an interrupt for each interrupt factor, a count counter (9) for measuring the number of times an interrupt has occurred for each interrupt factor, and a plurality of interrupt factors. And a maximum wait factor storage unit (11) for storing the factor number of the interrupt factor with the largest value of the timer counter or the factor number of the interrupt factor with the largest value of the number counter. If the factor number of the interrupt factor stored in the wait factor storage unit is not updated by the number counter, the value of the timer counter is used to determine the interrupt factor having the longest elapsed time from the occurrence of the interrupt among the plurality of interrupt factors. A first discrimination method for determining whether or not the cause number of the interrupt cause stored in the maximum wait cause storage unit is updated by the number counter. Counter value and the counter value and a microcomputer for selecting one of the second determination method of the elapsed time from the interrupt generation of the plurality of interrupt source to determine the longest interrupt factor with.
請求項1に記載したマイクロコンピュータにおいて、
前記タイマカウンタは、タイマ(6)からタイミング通知を入力することで、その値を更新するマイクロコンピュータ。
The microcomputer according to claim 1,
The microcomputer updates the value of the timer counter by inputting a timing notification from a timer (6) .
請求項1又は2に記載したマイクロコンピュータにおいて、
前記割込み要因監視部は、現在から遡って過去所定回数分の割込み要因を記憶する要因記憶部(10)を有するマイクロコンピュータ。
The microcomputer according to claim 1 or 2,
The microcomputer includes a factor storage unit (10) for storing a predetermined number of past interrupt factors retroactively from the present .
請求項3に記載したマイクロコンピュータにおいて、
前記要因記憶部は、前記過去所定回数分の割込み要因を先入れ先出し順にしたがって記憶するマイクロコンピュータ。
The microcomputer according to claim 3 ,
The microcomputer stores the cause of interruption for the predetermined number of times in the past in a first-in first-out order .
請求項1からの何れか一項に記載したマイクロコンピュータを備えた電子制御装置 An electronic control device comprising the microcomputer according to any one of claims 1 to 4 .
JP2016184263A 2016-09-21 2016-09-21 Microcomputer and electronic control unit Active JP6642358B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2016184263A JP6642358B2 (en) 2016-09-21 2016-09-21 Microcomputer and electronic control unit
DE102017215944.8A DE102017215944A1 (en) 2016-09-21 2017-09-11 Microcomputer and electronic control unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016184263A JP6642358B2 (en) 2016-09-21 2016-09-21 Microcomputer and electronic control unit

Publications (2)

Publication Number Publication Date
JP2018049446A JP2018049446A (en) 2018-03-29
JP6642358B2 true JP6642358B2 (en) 2020-02-05

Family

ID=61302607

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016184263A Active JP6642358B2 (en) 2016-09-21 2016-09-21 Microcomputer and electronic control unit

Country Status (2)

Country Link
JP (1) JP6642358B2 (en)
DE (1) DE102017215944A1 (en)

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010271993A (en) 2009-05-22 2010-12-02 Renesas Electronics Corp Interrupt processing apparatus and method

Also Published As

Publication number Publication date
DE102017215944A1 (en) 2018-03-22
JP2018049446A (en) 2018-03-29

Similar Documents

Publication Publication Date Title
CN111008072A (en) Task scheduling method and device, storage medium and electronic equipment
CA2965283A1 (en) Systems and methods of subject state change notification
EP2996039B1 (en) Adaptive scheduling jobs of a virus detection batch according to cpu performance
JP6642358B2 (en) Microcomputer and electronic control unit
JP5864032B1 (en) Programmable logic controller
US10156992B2 (en) Method for data reduction of items of sensor data information
TWI833975B (en) Status management system and status management method
JP6338923B2 (en) Programmable controller and control program
CN107615205B (en) Clock diagnosis device and clock diagnosis method
JP2015156104A (en) Self-controlling system, self-controlling device, self-controlling method, and program
JP2009026035A (en) Interrupt processing synchronizing device, interrupt processing synchronizing method, and program
JP6580287B2 (en) Display, display method and display system
US8527743B2 (en) Simultaneous checking of plural exit conditions loaded in table subsequent to execution of wait instruction for jitter free exit
JP6648663B2 (en) Arithmetic unit, electronic control unit, and arithmetic method
CN110764609B (en) Method and device for data synchronization and computing equipment
JP2002006944A (en) Indicator with control function
JP4516898B2 (en) Task controller
KR101989337B1 (en) Method and Apparatus for Displaying Real Time Wake Information in Radar System
JP4006648B2 (en) Input module
EP3048481A1 (en) Electronic device, method for controlling electronic device, and storage medium
JP6162491B2 (en) Processing device, processing method, and program
JP6201921B2 (en) Microcomputer
JP6613873B2 (en) Data processing apparatus and program
JP2016177564A (en) Debug control circuit and debug control method
JP2010009434A (en) Load distribution method in collection of monitor and control information

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20181102

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20190723

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20190820

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20191001

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20191203

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20191216

R151 Written notification of patent or utility model registration

Ref document number: 6642358

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250