Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP7226014B2 - Controller and diagnostic program - Google Patents
[go: Go Back, main page]

JP7226014B2 - Controller and diagnostic program - Google Patents

Controller and diagnostic program Download PDF

Info

Publication number
JP7226014B2
JP7226014B2 JP2019061695A JP2019061695A JP7226014B2 JP 7226014 B2 JP7226014 B2 JP 7226014B2 JP 2019061695 A JP2019061695 A JP 2019061695A JP 2019061695 A JP2019061695 A JP 2019061695A JP 7226014 B2 JP7226014 B2 JP 7226014B2
Authority
JP
Japan
Prior art keywords
transfer
dma
ram
data
counter
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
JP2019061695A
Other languages
Japanese (ja)
Other versions
JP2020160986A (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 JP2019061695A priority Critical patent/JP7226014B2/en
Publication of JP2020160986A publication Critical patent/JP2020160986A/en
Application granted granted Critical
Publication of JP7226014B2 publication Critical patent/JP7226014B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)
  • Programmable Controllers (AREA)

Description

この明細書における開示は、コントローラとその診断プログラムに関する。 The disclosure herein relates to a controller and its diagnostic program.

マイクロコントローラにおいて、複数のメモリ間のデータ転送を、DMA(Direct Memory Access)によって行うことが従来知られている。マイクロコントローラは、マイクロコンピュータとも呼ばれる。DMAによるデータ転送は、マイクロコントローラ内で、CPUの動作とは独立して行われるので、高速なデータ転送を実現できる。 2. Description of the Related Art It is conventionally known to transfer data between a plurality of memories in a microcontroller by DMA (Direct Memory Access). Microcontrollers are also called microcomputers. Data transfer by DMA is performed within the microcontroller independently of the operation of the CPU, so high-speed data transfer can be realized.

DMAを利用するマイクロコントローラは、自動車等において、エンジン制御装置やエアバッグ制御装置等の様々な箇所に用いられている。このような装置において、マイクロコントローラ内に、動作情報データを所定期間分だけ蓄積しておくことも従来知られている。蓄積された動作情報データは、制御対象に何らかの異常が検出された場合に、故障箇所を特定するために用いられる。 Microcontrollers using DMA are used in various places such as engine control devices and airbag control devices in automobiles and the like. In such devices, it is also conventionally known to accumulate motion information data for a predetermined period in the microcontroller. The accumulated operation information data is used to specify the failure location when some abnormality is detected in the controlled object.

しかし、DMAのデータ転送遅れが生じた場合に、マイクロコントローラの制御対象に異常が生じていないにも関わらず、異常が誤検出されることがある。これは、本来メモリに転送されるべきであったデータが、DMAのデータ転送遅れによって転送されていなかったことなどの転送エラーが原因となる場合がある。 However, when a DMA data transfer delay occurs, an abnormality may be erroneously detected even though an abnormality has not occurred in the control target of the microcontroller. This may be caused by a transfer error such as data that should have been transferred to the memory not being transferred due to DMA data transfer delay.

なお、例えば特許文献1は、パリティエラーや応答時間オーバー等の転送エラーが生じていないかをチェックする手段を備えたDMAコントローラを開示している。しかし、特許文献1には、転送エラーをどのように検出するかについての具体的な開示はない。 For example, Patent Document 1 discloses a DMA controller having means for checking whether a transfer error such as a parity error or a response time over has occurred. However, Patent Document 1 does not specifically disclose how to detect a transfer error.

特開平8-202635号公報JP-A-8-202635

本開示は、制御対象に異常が検出された際に、コントローラ内のDMA転送の遅延や転送漏れなどの転送エラーに起因する誤検出であるかを早期に判断できるようにすることを目的とする。 An object of the present disclosure is to make it possible to quickly determine, when an abnormality is detected in a controlled object, whether it is an erroneous detection caused by a transfer error such as a DMA transfer delay or transfer omission in the controller. .

本発明の第1の側面は、RAM(13)と、前記RAMに対するDMA転送を制御するDMA部(12)とを備えたコントローラである。前記RAMは、所定期間内に行われたDMA転送について、転送の遅延時間と、転送漏れの回数との少なくとも一方を直接的または間接的に表す転送状況データを記憶する。前記DMA部は、前記DMA転送を所定の周期で実施する。コントローラは、前記所定の周期と同じ長さのリセット周期をカウントするとリセットされるカウンタをさらに備える。前記RAMは、前記転送の遅延時間として、前記DMA転送が完了した時点の前記カウンタのカウント値を記憶する。 A first aspect of the present invention is a controller comprising a RAM (13) and a DMA section (12) that controls DMA transfer to the RAM. The RAM stores transfer status data that directly or indirectly represents at least one of the transfer delay time and the number of transfer omissions for DMA transfers performed within a predetermined period. The DMA section performs the DMA transfer at a predetermined cycle. The controller further comprises a counter that is reset after counting a reset period having the same length as the predetermined period. The RAM stores the count value of the counter when the DMA transfer is completed as the delay time of the transfer.

本発明の第2の側面は、コントローラ(1)の制御対象の異常を判断する診断プログラムである。この診断プログラムは、センサデータに基づいて制御対象の異常が検出された場合、コンピュータのプロセッサに、コントローラのROMから読み出されたデータを入力するステップと、転送状況データを所定の閾値と対比することにより、制御対象の異常が、DMA転送によるセンサデータの不備に起因するか否かを判断するステップとを実行させる。 A second aspect of the present invention is a diagnostic program for determining an abnormality in a controlled object of the controller (1). This diagnostic program inputs data read from the ROM of the controller to the processor of the computer when an abnormality is detected in the controlled object based on the sensor data, and compares the transfer status data with a predetermined threshold value. and a step of determining whether or not the abnormality in the controlled object is caused by incomplete sensor data due to DMA transfer.

この明細書における開示された複数の態様は、それぞれの目的を達成するために、互いに異なる技術的手段を採用する。請求の範囲およびこの項に記載した括弧内の符号は、後述する実施形態の部分との対応関係を例示的に示すものであって、技術的範囲を限定することを意図するものではない。この明細書に開示される目的、特徴、および効果は、後続の詳細な説明、および添付の図面を参照することによってより明確になる。 The multiple aspects disclosed in this specification employ different technical means to achieve their respective objectives. Reference numerals in parentheses described in the claims and this section are intended to exemplify the correspondence with portions of the embodiments described later, and are not intended to limit the technical scope. Objects, features, and advantages disclosed in this specification will become clearer with reference to the following detailed description and accompanying drawings.

図1は、本発明の一実施形態に係るエンジン制御装置の概略構成を示すブロック図である。FIG. 1 is a block diagram showing a schematic configuration of an engine control system according to one embodiment of the present invention. 図2は、図1のRAMとROMに記憶されるデータの一例を示す模式図である。FIG. 2 is a schematic diagram showing an example of data stored in the RAM and ROM shown in FIG. 図3は、DMA転送の基本動作を示すタイミング図である。FIG. 3 is a timing diagram showing the basic operation of DMA transfer. 図4は、DMA転送に遅延が生じた場合のタイミング図である。FIG. 4 is a timing chart when delay occurs in DMA transfer. 図5は、DMA転送に転送漏れが生じた場合のタイミング図である。FIG. 5 is a timing chart when transfer omission occurs in DMA transfer. 図6Aは、転送漏れが無い場合にRAMに格納されるデータの模式図である。FIG. 6A is a schematic diagram of data stored in the RAM when there is no transfer omission. 図6Bは、転送漏れが生じた場合にRAMに格納されるデータの模式図である。FIG. 6B is a schematic diagram of data stored in the RAM when transfer omission occurs. 図7は、遅延計測期間の終了後の処理フローを示すフローチャートである。FIG. 7 is a flow chart showing the processing flow after the delay measurement period ends. 図8は、失火検出時の処理フローを示すフローチャートである。FIG. 8 is a flow chart showing a processing flow when a misfire is detected. 図9は、診断ツールの処理フローを示すフローチャートである。FIG. 9 is a flow chart showing the processing flow of the diagnostic tool.

図面を参照しながら、複数の実施形態を説明する。複数の実施形態において、機能的におよび/または構造的に対応する部分および/または関連付けられる部分には同一の参照符号、または百以上の位が異なる参照符号が付される場合がある。対応する部分および/または関連付けられる部分については、他の実施形態の説明を参照することができる。 A number of embodiments will be described with reference to the drawings. In several embodiments, functionally and/or structurally corresponding and/or related parts may be labeled with the same reference numerals or reference numerals differing by one hundred or more places. For corresponding and/or associated parts, reference can be made to the description of other embodiments.

図1に示すように、第1実施形態に係るコントローラ1は、エンジン制御装置10に設けられている。コントローラ1は、マイクロコンピュータまたはマイクロコントローラ等と称されることがある。エンジン制御装置10は、コントローラ1の他に、入力回路2と、出力回路3と、外部IC4とを備えている。エンジン制御装置10は、出力回路3から、点火モジュールや燃料噴射モジュール等のエンジン各部の動作を制御する制御信号を出力する。入力回路2は、エンジン各部の動作状況を表すセンサ信号を、エンジン各部のセンサから受け取る。センサ信号は、これらに限定されないが、例えば筒内圧センサ信号やノックセンサ信号等である。コントローラ1は、これらのセンサ信号に基づき、エンジン各部の動作を、状況に応じて制御する。外部IC4は、エンジン制御を行うために必要な他の制御回路を有する。 As shown in FIG. 1, the controller 1 according to the first embodiment is provided in an engine control device 10. As shown in FIG. The controller 1 is sometimes called a microcomputer, microcontroller, or the like. The engine control device 10 includes an input circuit 2, an output circuit 3, and an external IC 4 in addition to the controller 1. FIG. The engine control device 10 outputs from the output circuit 3 a control signal for controlling the operation of each part of the engine such as the ignition module and the fuel injection module. The input circuit 2 receives sensor signals representing operating conditions of various parts of the engine from sensors of various parts of the engine. Examples of the sensor signal include, but are not limited to, an in-cylinder pressure sensor signal and a knock sensor signal. Based on these sensor signals, the controller 1 controls the operation of each part of the engine depending on the situation. The external IC 4 has other control circuits necessary for engine control.

コントローラ1は、CPU11と、DMA部12と、RAM13と、ROM14と、AD変換部15と、タイマ部16と、通信部17とを備えている。CPU11は、コントローラ1の各部の動作を制御する。DMA部12は、CPU11とは独立して動作し、コントローラ1内のメモリ間のDMA転送を制御する。なお、コントローラ1は、図1に示していない他のモジュールを含んでいても良い。 The controller 1 includes a CPU 11 , a DMA section 12 , a RAM 13 , a ROM 14 , an AD conversion section 15 , a timer section 16 and a communication section 17 . The CPU 11 controls operations of each part of the controller 1 . The DMA unit 12 operates independently of the CPU 11 and controls DMA transfer between memories within the controller 1 . Note that the controller 1 may include other modules not shown in FIG.

コントローラ1は、1つのICとして構成されていても良いし、2つ以上のICに各部が分散配置されていても良い。コントローラ1に含まれる各部は、ハードウエア回路として実装することができる。 The controller 1 may be configured as a single IC, or may have respective units dispersedly arranged in two or more ICs. Each unit included in the controller 1 can be implemented as a hardware circuit.

コントローラ1は、入力回路2を介して受け取ったセンサ信号を、AD変換部15でデジタルのセンサデータに変換し、RAM13に記憶する。RAM13は、バッファとして機能し、ある程度の期間のセンサデータを蓄積することができる。センサデータは、エンジン各部で何らかの異常が検出された場合、RAM13から読み出され、ROM14において診断ツールが参照可能な領域に格納される。これにより、異常が検出された際に、異常が発生する直前の(さらに直後の)センサデータをROM14から取得し、診断ツールによる解析に利用できる。 The controller 1 converts the sensor signal received via the input circuit 2 into digital sensor data by the AD converter 15 and stores it in the RAM 13 . The RAM 13 functions as a buffer and can accumulate sensor data for a certain period of time. The sensor data is read from the RAM 13 and stored in an area of the ROM 14 that can be referred to by a diagnostic tool when an abnormality is detected in each part of the engine. As a result, when an abnormality is detected, the sensor data immediately before (and immediately after) the occurrence of the abnormality can be acquired from the ROM 14 and used for analysis by the diagnostic tool.

コントローラ1は、また、所定期間内における、DMA転送の状況を表す転送状況データを取得し、RAM13に格納する。転送状況データとは、DMA転送に遅延や転送漏れがあるか否かや、その程度を表すデータである。転送状況データの一例は、DMA転送要求があってから実際に転送がなされるまでの遅延時間である。転送状況データの他の例は、転送漏れが所定期間内に発生した回数(すなわち転送漏れ回数)である。転送漏れとは、DMA転送要求がなされたにも関わらず、その要求に応じたDMA転送がなされなかったことを意味する。転送状況データは、遅延時間や転送漏れ回数そのものに限定されない。転送時間や転送漏れ回数に基づいて求められる指標データも、転送状況データに含まれる。指標データは、遅延や転送漏れの程度を数値的に表すデータである。指標データの一例は、高負荷率である。高負荷率とは、所定期間内に行われたDMA転送の総回数に対して、遅延を伴って実行されたDMA転送の回数の割合である。 The controller 1 also acquires transfer status data representing the status of the DMA transfer within a predetermined period and stores it in the RAM 13 . The transfer status data is data representing whether or not there is a delay or transfer omission in the DMA transfer, and the degree thereof. An example of transfer status data is the delay time from when a DMA transfer request is made to when the transfer is actually performed. Another example of transfer status data is the number of times transfer omissions have occurred within a predetermined period (that is, the number of transfer omissions). A transfer omission means that although a DMA transfer request was made, a DMA transfer was not made in response to the request. The transfer status data is not limited to the delay time and the number of transfer omissions themselves. The transfer status data also includes index data obtained based on the transfer time and the number of transfer omissions. The index data is data that numerically represents the degree of delay or transfer omission. An example of index data is a high load factor. The high load factor is the ratio of the number of DMA transfers executed with delay to the total number of DMA transfers executed within a predetermined period.

転送状況データは、エンジンに何らかの異常が検出されたときに、RAM13から読み出され、ROM14において診断ツールが参照可能な領域へ格納される。 The transfer status data is read from the RAM 13 and stored in an area of the ROM 14 that can be referred to by a diagnostic tool when some abnormality is detected in the engine.

ここで、図2を参照し、RAM13およびROM14に格納されるデータの一例を説明する。RAM13は、センサデータを格納するセンサデータバッファ13aと、DMAの遅延時間を格納する遅延時間バッファ13bとを有する。RAM13は、さらに、DMAの最新の異常データを格納するための異常データ領域13cを有する。センサデータバッファ13aは、AD変換部15で得られたセンサデータを、順次格納する。センサデータバッファ13aにおいては、空き領域がなくなると、最も古いセンサデータが新たなセンサデータで上書きされる。遅延時間バッファ13bにおいても、空き領域がなくなると、最も古いDMA転送遅延時間が新たなDMA転送遅延時間で上書きされる。なお、図2において、センサデータバッファ13aと遅延時間バッファ13bは、データ格納領域を8つずつ有するが、領域数は任意である。異常データ領域13cは、転送漏れ回数と、高負荷率と、DMAデータ取得時刻とを記憶する領域を有する。 Here, an example of data stored in the RAM 13 and ROM 14 will be described with reference to FIG. The RAM 13 has a sensor data buffer 13a for storing sensor data and a delay time buffer 13b for storing delay time of DMA. The RAM 13 further has an error data area 13c for storing the latest error data of the DMA. The sensor data buffer 13a sequentially stores the sensor data obtained by the AD converter 15 . In the sensor data buffer 13a, when there is no free space, the oldest sensor data is overwritten with new sensor data. Also in the delay time buffer 13b, when there is no free space, the oldest DMA transfer delay time is overwritten with a new DMA transfer delay time. In FIG. 2, the sensor data buffer 13a and the delay time buffer 13b each have eight data storage areas, but the number of areas is arbitrary. The abnormal data area 13c has areas for storing the number of transfer omissions, the high load factor, and the DMA data acquisition time.

ROM14は、計測周期を記憶する領域14aと、転送回数初期値を記憶する領域14bと、故障情報データを記憶する領域14cとを有する。計測周期は、タイマ部16のカウンタ(AD変換カウンタ16a、遅延カウンタ16b)のリセット周期を規定する。転送回数初期値としては、DMA転送の遅延を計測する期間内に実行可能な転送回数を下回らない数値が設定される。転送回数初期値は、例えば、遅延計測期間の長さを計測周期の長さで除し、端数を切り捨てた整数値よりも大きな整数値とすることが好ましい。故障情報データは、エンジンに生じ得る異常のパターンごとに、異常が検出された際にROM14へ記憶すべきデータの種別をあらかじめ定めたものである。例えば、スパークプラグの失火が検出された場合は、失火検出に関わるセンサからのデータがRAM13から読み出され、ROM14へ格納される。図2では、失火が検出された際、それらのデータに加えて、失火検出時刻、DMA転送漏れ回数、高負荷率、およびDMAデータ取得時刻が、ROM14へ記憶される。ここで、DMA転送漏れ回数、高負荷率、およびDMAデータ取得時刻は、RAM13の異常データ領域13cから読み出されて、ROM14へ記憶される。なお、異常データ領域13cのデータは、失火検出時に限定されず、様々な異常の検出時に同様に利用することができる。 The ROM 14 has an area 14a for storing the measurement period, an area 14b for storing the initial value of the number of transfers, and an area 14c for storing the failure information data. The measurement cycle defines the reset cycle of the counters (the AD conversion counter 16a and the delay counter 16b) of the timer section 16. FIG. As the transfer count initial value, a value that is not less than the number of transfers that can be executed within the period for measuring the delay of DMA transfer is set. The initial value of the number of transfers is preferably an integer value larger than an integer value obtained by dividing the length of the delay measurement period by the length of the measurement cycle and truncating the fractions. The failure information data predetermines the type of data to be stored in the ROM 14 when an abnormality is detected for each abnormality pattern that can occur in the engine. For example, when a spark plug misfire is detected, data from a sensor related to misfire detection is read from the RAM 13 and stored in the ROM 14 . In FIG. 2, when a misfire is detected, the misfire detection time, the number of DMA transfer omissions, the high load factor, and the DMA data acquisition time are stored in the ROM 14 in addition to these data. Here, the number of DMA transfer omissions, the high load factor, and the DMA data acquisition time are read out from the abnormal data area 13c of the RAM 13 and stored in the ROM 14. FIG. The data in the anomaly data area 13c is not limited to misfire detection, and can be used in the same way when various anomalies are detected.

タイマ部16は、独立して動作する複数のカウンタを内蔵している。タイマ部16は、少なくとも、AD変換カウンタ16aと、遅延カウンタ16bとを有している。AD変換カウンタ16aは、AD変換部15の動作を制御するためのカウンタである。遅延カウンタ16bは、DMA転送の遅延を計測するためのカウンタである。AD変換カウンタ16aと遅延カウンタ16bは、同じ基準クロックにしたがってカウンタ値を増加させる。AD変換カウンタ16aおよび遅延カウンタ16bのそれぞれは、一定周期でリセットされる。AD変換カウンタ16aおよび遅延カウンタ16bは、コンペアマッチタイマ(compare match timer)である。AD変換カウンタ16aおよび遅延カウンタ16bは、カウンタ値が所定値に到達するとリセットされる。この所定値は、ROM14の領域14aに記憶されている計測周期である。この所定値として、AD変換カウンタ16aおよび遅延カウンタ16bの両方に、同じ値が設定されている。したがって、AD変換カウンタ16aおよび遅延カウンタ16bのリセット周期の長さは同一である。ただし、遅延カウンタ16bは、AD変換カウンタ16aよりも、少なくともAD変換部15によるAD変換処理に要する時間と、DMA部12によるAD変換結果のDMA転送に要する時間との合計時間だけ遅れて、リセット周期に達するように、それぞれの周期の位相が設定されている。ただし、この位相の関係は、多少、前後にずれても問題はない。このように、AD変換カウンタ16aと遅延カウンタ16bとは独立して動作し、リセット時点は一致しない。 The timer section 16 incorporates a plurality of independently operating counters. The timer section 16 has at least an AD conversion counter 16a and a delay counter 16b. The AD conversion counter 16 a is a counter for controlling the operation of the AD conversion section 15 . The delay counter 16b is a counter for measuring the delay of DMA transfer. The AD conversion counter 16a and the delay counter 16b increase their counter values according to the same reference clock. Each of the AD conversion counter 16a and the delay counter 16b is reset at regular intervals. The AD conversion counter 16a and the delay counter 16b are compare match timers. The AD conversion counter 16a and the delay counter 16b are reset when the counter value reaches a predetermined value. This predetermined value is the measurement period stored in the area 14 a of the ROM 14 . As this predetermined value, the same value is set in both the AD conversion counter 16a and the delay counter 16b. Therefore, the AD conversion counter 16a and the delay counter 16b have the same reset cycle length. However, the delay counter 16b is delayed from the AD conversion counter 16a by at least the sum of the time required for AD conversion processing by the AD conversion section 15 and the time required for DMA transfer of the AD conversion result by the DMA section 12, and is reset. The phase of each cycle is set to reach the cycle. However, there is no problem even if this phase relationship is slightly shifted back and forth. In this way, the AD conversion counter 16a and the delay counter 16b operate independently, and their reset points do not coincide.

DMA部12は、AD変換部15等の各部のデータをRAM13にDMA転送する。例えば、AD変換部15からRAM13へのDMA転送は以下のように行われる。AD変換部15は、変換データを格納するレジスタ15aを有する。AD変換部15は、タイマ16から、AD変換カウンタ16aのコンペアマッチを示す信号を受け取ると、入力回路2から受け取ったセンサ信号をAD変換する。AD変換によってデジタル化されたセンサ信号は、レジスタ15aに格納される。AD変換部15は、AD変換が完了したとき、AD変換の完了を示す変換完了信号をDMA部12へ送る。この変換完了信号は、DMA転送要求信号として作用する。DMA部12は、変換完了信号を受けると、AD変換部15のレジスタ15aに格納されているデータを読み取り、RAM13に書き込む。以上の一連の動作により、AD変換部15からRAM13へのDMA転送が行われる。さらに、DMA部12は、遅延カウンタ16bのカウンタ値が所定値に達すると、遅延カウンタ16bから、遅延カウンタ16bのカウント値のDMA転送要求信号を受け取る。すると、DMA部12は、AD変換部15からRAM13へのDMA転送が完了したことを条件として、遅延カウンタ16bのカウンタ値のDMA転送を実行する。具体的には、DMA部12は、DMA転送を開始する時点における遅延カウンタ16bのカウンタ値を読み取り、RAM13へ書き込む。このように、DMA部12は、タイマ部16(遅延カウンタ16b)からRAM13へのDMA転送も行う。 The DMA unit 12 DMA-transfers the data of each unit such as the AD conversion unit 15 to the RAM 13 . For example, DMA transfer from the AD converter 15 to the RAM 13 is performed as follows. The AD converter 15 has a register 15a that stores converted data. When the AD converter 15 receives from the timer 16 the signal indicating the compare match of the AD conversion counter 16 a , the AD converter 15 AD converts the sensor signal received from the input circuit 2 . The sensor signal digitized by AD conversion is stored in the register 15a. When the AD conversion is completed, the AD conversion section 15 sends a conversion completion signal indicating the completion of the AD conversion to the DMA section 12 . This conversion complete signal acts as a DMA transfer request signal. Upon receiving the conversion completion signal, the DMA section 12 reads the data stored in the register 15 a of the AD conversion section 15 and writes it to the RAM 13 . DMA transfer from the AD converter 15 to the RAM 13 is performed by the series of operations described above. Furthermore, when the counter value of the delay counter 16b reaches a predetermined value, the DMA unit 12 receives a DMA transfer request signal of the count value of the delay counter 16b from the delay counter 16b. Then, the DMA unit 12 executes DMA transfer of the counter value of the delay counter 16b on condition that the DMA transfer from the AD conversion unit 15 to the RAM 13 is completed. Specifically, the DMA unit 12 reads the counter value of the delay counter 16 b at the time of starting DMA transfer, and writes it to the RAM 13 . Thus, the DMA unit 12 also performs DMA transfer from the timer unit 16 (delay counter 16b) to the RAM 13. FIG.

DMA部12は、外部IC4とRAM13との間の通信時に、RAM13と通信部17との間でDMA転送を行う。通信部17は、送信用レジスタ17aと受信用レジスタ17bとを備えている。外部IC4へデータを送信する場合、DMA部12は、RAM13から送信データを読み出し、DMA転送により通信モジュール17の送信用レジスタ17aへ書き込む。外部IC4のデータを受信する場合、DMA部12は、外部IC4から受信用レジスタ17bに書き込まれたデータを読み出し、RAM13へDMA転送する。 The DMA section 12 performs DMA transfer between the RAM 13 and the communication section 17 during communication between the external IC 4 and the RAM 13 . The communication unit 17 includes a transmission register 17a and a reception register 17b. When transmitting data to the external IC 4, the DMA unit 12 reads transmission data from the RAM 13 and writes it to the transmission register 17a of the communication module 17 by DMA transfer. When receiving data from the external IC 4 , the DMA unit 12 reads the data written in the reception register 17 b from the external IC 4 and DMA-transfers it to the RAM 13 .

ここで、図3~図5を参照し、コントローラ1におけるDMA転送の遅延計測について説明する。まず、図3に基づき、DMA転送において遅延がない場合を説明する。 DMA transfer delay measurement in the controller 1 will now be described with reference to FIGS. 3 to 5. FIG. First, based on FIG. 3, the case where there is no delay in DMA transfer will be described.

コントローラ1は、所定のタイミングで、DMA転送の遅延計測を開始する。遅延計測期間の開始時点と終了時点は、個別にかつ任意に設定することができる。例えば、自動車のイグニションがオンにされた時点から遅延計測を開始しても良い。あるいは、特定のイベントの開始と同期して、遅延計測を開始しても良い。また、自動車のイグニションがオフにされたときに遅延計測を終了しても良い。あるいは、特定のイベントの終了と同期して、遅延計測を終了しても良い。なお、コントローラ1における処理負荷などを考慮して、遅延計測期間は、エンジンの燃焼工程に合わせて間欠的に繰り返し設定されることが好ましい。 The controller 1 starts measuring the DMA transfer delay at a predetermined timing. The start time and end time of the delay measurement period can be set individually and arbitrarily. For example, the delay measurement may begin when the ignition of the automobile is turned on. Alternatively, delay measurement may be started in synchronization with the start of a specific event. Alternatively, the delay measurement may end when the vehicle ignition is turned off. Alternatively, delay measurement may end in synchronization with the end of a specific event. In consideration of the processing load on the controller 1, etc., it is preferable that the delay measurement period is intermittently and repeatedly set according to the combustion process of the engine.

図3の最上段に、AD変換カウンタ16aのカウンタ値の変遷を示す。なお、図3および他の図面において、図示の簡略化のためにカウンタ値は連続的に増加するよう示されているが、実際のカウンタ値は、離散値をとる。 The uppermost part of FIG. 3 shows changes in the counter value of the AD conversion counter 16a. In FIG. 3 and other drawings, the counter value is shown to increase continuously for simplification of illustration, but the actual counter value is a discrete value.

上述のように、AD変換カウンタ16aがコンペアマッチした時点、すなわちAD変換カウンタ16aのリセット時点で、AD変換部15がAD変換処理を開始する。AD変換が終了すると、AD変換部15からDMA部12へDMA転送要求信号S1が送られる。DMA部12は、このDMA転送要求信号S1を受けて、AD変換部15のレジスタ15aからデータを読み出し、RAM13へ転送する。図3において、AD変換部15からRAM13へのDMA転送が行われている期間をT1として図示している。 As described above, when the AD conversion counter 16a has a compare match, that is, when the AD conversion counter 16a is reset, the AD conversion section 15 starts AD conversion processing. When the AD conversion is completed, a DMA transfer request signal S1 is sent from the AD conversion section 15 to the DMA section 12 . The DMA section 12 receives the DMA transfer request signal S1, reads data from the register 15a of the AD conversion section 15, and transfers the data to the RAM 13. FIG. In FIG. 3, the period during which DMA transfer from the AD converter 15 to the RAM 13 is performed is indicated as T1.

遅延カウンタ16bは、遅延計測の開始時点からカウントアップを開始する。遅延カウンタ16bがコンペアマッチすると、遅延カウンタ16bは、DMA部12へDMA転送要求信号S2を出す。このDMA転送要求信号S2を受けて、DMA部12は、遅延カウンタ16bのカウンタ値を読み出し、RAM13へ転送する。このカウンタ値は、RAM13において、遅延時間バッファ13bに格納される。図3において、遅延カウンタ16bからRAM13へのDMA転送が行われている期間をT2として図示している。図3の例では、センサデータのDMA転送が行われた期間T1の後、遅滞なく、期間T2において、遅延カウンタ16bのカウンタ値のDMA転送が行われる。したがって、遅延時間時間バッファ13bに遅延時間として格納されるカウンタ値は、リセット直後の値である「0x0000」となる。 The delay counter 16b starts counting up from the start of delay measurement. When the delay counter 16b generates a compare match, the delay counter 16b issues a DMA transfer request signal S2 to the DMA section 12. FIG. Upon receiving this DMA transfer request signal S2, the DMA section 12 reads out the counter value of the delay counter 16b and transfers it to the RAM 13. FIG. This counter value is stored in the delay time buffer 13b in the RAM 13. FIG. In FIG. 3, the period during which the DMA transfer from the delay counter 16b to the RAM 13 is performed is indicated as T2. In the example of FIG. 3, the DMA transfer of the counter value of the delay counter 16b is performed in the period T2 without delay after the period T1 in which the DMA transfer of the sensor data is performed. Therefore, the counter value stored as the delay time in the delay time buffer 13b is "0x0000" which is the value immediately after the reset.

なお、遅延計測の開始時に、ROM14の領域14bが参照され、転送回数初期値が読み出される。図3の例では、1回の遅延計測期間内に実行されるべき、AD変換部15からのDMA転送の回数は4回である。転送回数初期値は、これよりも大きい値として、例えば「0x0005」が設定される。DMA部12は、転送残回数を記憶する残回数レジスタを有する。コントローラ1は、遅延計測期間の開始時点に、残回数レジスタに転送回数初期値を設定する。DMA部12は、AD変換部15からのDMA転送を1回完了する度に、残回数レジスタのレジスタ値を1ずつ減算する。遅延計測期間の終了後に、転送回数初期値とレジスタ値との差を求めることにより、実行されたDMA転送の回数を求めることができる。例えば、図3の例では、遅延計測期間の終了後のレジスタ値は「0x0001」である。したがって、図3の例では、遅延計測期間中に、AD変換部15から、4回のDMA転送が行われたことがわかる。 At the start of delay measurement, the area 14b of the ROM 14 is referred to, and the initial value of the number of transfers is read. In the example of FIG. 3, the number of DMA transfers from the AD converter 15 to be executed within one delay measurement period is four. For example, "0x0005" is set as the transfer count initial value as a larger value than this. The DMA unit 12 has a remaining number register for storing the number of remaining transfers. The controller 1 sets the initial value of the transfer count in the remaining count register at the start of the delay measurement period. The DMA unit 12 subtracts 1 from the register value of the remaining count register each time the DMA transfer from the AD conversion unit 15 is completed once. After the delay measurement period ends, the number of DMA transfers executed can be obtained by obtaining the difference between the transfer number initial value and the register value. For example, in the example of FIG. 3, the register value after the end of the delay measurement period is "0x0001". Therefore, in the example of FIG. 3, it can be seen that four DMA transfers were performed from the AD converter 15 during the delay measurement period.

次に、図4を参照し、DMA転送に遅延が生じた場合について説明する。図4では、遅延計測期間内に、AD変換部15から2回目の転送要求(S1の2個目のパルス)が出されたとき、他の転送要求に基づくDMA転送(T4)が実行されている。このT4のDMA転送は、例えば、コントローラ1内の他のモジュール(図1には図示せず)からのDMA転送要求に起因するものである。このため、AD変換部15からの2回目のDMA転送要求に基づく転送(T1(2))は、T4で示されているDMA転送が終了してから実行される。さらに、その後の遅延カウンタ16bからのDMA転送要求(S2の2個目のパルス)も、T4のDMA転送がまだ実行中であるため待たされる。そして、T4のDMA転送の終了後、AD変換部15からのDMA転送(T1(2))が実行される。このDMA転送が終了した後、遅延カウンタ16bからのDMA転送(T2(2))が実行される。この結果、図4の例では、遅延カウンタ16bからDMA転送要求が出されてから、転送が実行されるまでに、遅延時間d1が存在する。この遅延時間d1の間に、遅延カウンタ16bのカウンタ値はカウントアップされ続ける。したがって、図4の例では、2回目のDMA転送が実行される時点のカウンタ値である「0x0010」が、遅延時間d1の長さを表す。このカウンタ値が、遅延カウンタ16bからのDMA転送により、RAM13の遅延時間バッファ13bに記憶される。 Next, with reference to FIG. 4, a case where a delay occurs in DMA transfer will be described. In FIG. 4, when the second transfer request (the second pulse of S1) is issued from the AD converter 15 within the delay measurement period, DMA transfer (T4) based on another transfer request is executed. there is This T4 DMA transfer is due, for example, to a DMA transfer request from another module (not shown in FIG. 1) within the controller 1 . Therefore, the transfer (T1(2)) based on the second DMA transfer request from the AD converter 15 is executed after the DMA transfer indicated by T4 is completed. Further, the subsequent DMA transfer request from the delay counter 16b (the second pulse of S2) is also kept waiting because the DMA transfer of T4 is still in progress. Then, after the DMA transfer of T4 is completed, the DMA transfer (T1(2)) from the AD converter 15 is executed. After this DMA transfer is completed, the DMA transfer (T2(2)) from the delay counter 16b is executed. As a result, in the example of FIG. 4, there is a delay time d1 from when the delay counter 16b issues a DMA transfer request to when the transfer is executed. During this delay time d1, the counter value of the delay counter 16b continues to be counted up. Therefore, in the example of FIG. 4, the counter value "0x0010" when the second DMA transfer is executed represents the length of the delay time d1. This counter value is stored in the delay time buffer 13b of the RAM 13 by DMA transfer from the delay counter 16b.

同様に、AD変換部15から3回目のDMA転送要求(S1の3個目のパルス)が出されたときも、他の転送要求に基づくDMA転送(T5)が実行されている。このため、遅延カウンタ16bからの3回目のDMA転送(T2(3))は、遅延時間d2だけ遅れて実行される。3回目のDMA転送が実行される時点の、遅延カウンタ16bのカウンタ値は「0x0008」である。このカウンタ値が、遅延カウンタ16bからのDMA転送により、RAM13の遅延時間バッファ13bに記憶される。 Similarly, when the AD converter 15 issues a third DMA transfer request (the third pulse of S1), DMA transfer (T5) based on another transfer request is being executed. Therefore, the third DMA transfer (T2(3)) from the delay counter 16b is delayed by the delay time d2. The counter value of the delay counter 16b is "0x0008" when the third DMA transfer is executed. This counter value is stored in the delay time buffer 13b of the RAM 13 by DMA transfer from the delay counter 16b.

以上のように、図4の例では、遅延計測期間内に実行されるべき、AD変換部15からの4回のDMA転送は、遅延計測期間内に全て実行されている。しかし、2回目と3回目のDMA転送が、遅れて実行されている。そして、RAM13の遅延時間バッファ13bに、2回目と3回目のDMA転送の遅延時間が格納されている。これにより、遅延時間バッファ13bのデータを解析することによって、DMA転送に遅延が生じていたことがわかる。 As described above, in the example of FIG. 4, the four DMA transfers from the AD converter 15 that should be executed within the delay measurement period are all executed within the delay measurement period. However, the second and third DMA transfers are delayed. The delay times of the second and third DMA transfers are stored in the delay time buffer 13b of the RAM 13. FIG. Therefore, by analyzing the data in the delay time buffer 13b, it can be found that the DMA transfer was delayed.

図4の例では、3回目のDMA転送要求(S1の3個目のパルス)が出される前に、2回目のDMA転送(T1(2)およびT2(2))が完了している。したがって、遅延を伴っているが、要求されたDMA転送は全て実行される。しかし、先のDMA転送の実行を待っている間に、次のDMA転送要求が出されると、転送漏れが生じることがある。コントローラ1は、転送漏れの回数を検出することができる。 In the example of FIG. 4, the second DMA transfer (T1(2) and T2(2)) is completed before the third DMA transfer request (the third pulse of S1) is issued. Therefore, all requested DMA transfers are performed, albeit with a delay. However, if a next DMA transfer request is issued while waiting for execution of a previous DMA transfer, a transfer leak may occur. The controller 1 can detect the number of transfer omissions.

次に、図5を参照し、コントローラ1において、転送漏れの回数を検出する仕組みについて説明する。図5では、遅延計測期間内に、AD変換部15から1回目の転送要求(S1の1個目のパルス)が出されたとき、他の転送要求に基づくDMA転送(T4)が実行されている。このため、AD変換部15からの1回目のDMA転送要求は処理待ち状態となる。しかし、T4のDMA転送が終了する前に、AD変換部15から2回目の転送要求(S1の2個目のパルス)が出される。この場合、1回目の転送要求は、2回目の転送要求によって上書きされてしまう。その後、T4のDMA転送が終了したときに、2回目の転送要求に基づいて、AD変換部15からのDMA転送(T1(2))が行われる。このとき、T1(2)のDMA転送によって転送されるのは、時刻t1においてAD変換されたデータ(図5のC1)ではなく、時刻t2のデータ(C2)である。したがって、図5に示した例では、RAM13のセンサデータバッファ13aにおいて、時刻t1におけるAD変換部15のセンサデータ(C1)が欠落した状態となる。このように、本来取得されるべきセンサデータが欠落すると、異常が正しく検出できないことがある。また、センサデータの欠落によって、異常が無いにも関わらず、異常が誤検出されることもある。 Next, with reference to FIG. 5, a mechanism for detecting the number of transfer omissions in the controller 1 will be described. In FIG. 5, when the first transfer request (the first pulse of S1) is issued from the AD converter 15 within the delay measurement period, DMA transfer (T4) based on another transfer request is executed. there is Therefore, the first DMA transfer request from the AD converter 15 is in a waiting state. However, before the DMA transfer of T4 ends, the AD converter 15 issues a second transfer request (the second pulse of S1). In this case, the first transfer request will be overwritten by the second transfer request. After that, when the DMA transfer of T4 ends, the DMA transfer (T1(2)) from the AD converter 15 is performed based on the second transfer request. At this time, what is transferred by the DMA transfer of T1(2) is not the data AD-converted at time t1 (C1 in FIG. 5), but the data at time t2 (C2). Therefore, in the example shown in FIG. 5, the sensor data (C1) of the AD converter 15 at time t1 is missing in the sensor data buffer 13a of the RAM 13. FIG. In this way, when sensor data that should be acquired is missing, an abnormality may not be detected correctly. Moreover, due to lack of sensor data, an abnormality may be erroneously detected even though there is no abnormality.

また、センサデータバッファ13aにおいて、センサデータが転送された順に連続して格納されていく場合、次のような問題も生じ得る。特に、図6Aに示すように、タイマ時刻(図5のt1~t4)に応じてセンサデータが順次格納されていく場合、データ取得時刻とデータの不一致が起こり得る。図6Aに示す例では、タイマ時刻(t1~t4)に応じてバッファ領域が割り当てられている。そして、転送漏れがないとすれば、図5のセンサデータC1~C4は、転送された順にバッファ領域に格納される。しかし、図5の例のように時刻t1のセンサデータ(C1)の転送漏れが生じた場合、図6Bに示すように、時刻t1の領域に時刻t2のセンサデータ(C2)が格納される。以降、時刻t2の領域に時刻t3のセンサデータ(C3)、時刻t3の領域に時刻t4のセンサデータ(C4)が、それぞれ格納される。したがって、時刻t2~t4のセンサデータが、時刻t1~t3に取得されたセンサデータとして処理されることとなる。この結果、データの取得時刻とセンサデータとの関係がずれてしまい、例えば失火が発生していないのに失火があったとの誤検出がなされる場合もある。 Moreover, in the sensor data buffer 13a, if the sensor data are stored continuously in the order in which they were transferred, the following problem may occur. In particular, as shown in FIG. 6A, when sensor data is stored sequentially according to timer times (t1 to t4 in FIG. 5), a mismatch between the data acquisition time and the data may occur. In the example shown in FIG. 6A, buffer areas are allocated according to timer times (t1 to t4). Assuming that there is no transfer omission, the sensor data C1 to C4 in FIG. 5 are stored in the buffer area in the order of transfer. However, when the transfer omission of the sensor data (C1) at time t1 occurs as in the example of FIG. 5, the sensor data (C2) at time t2 is stored in the area at time t1 as shown in FIG. 6B. After that, the sensor data (C3) at time t3 are stored in the area of time t2, and the sensor data (C4) at time t4 are stored in the area of time t3. Therefore, the sensor data from times t2 to t4 are processed as the sensor data acquired from times t1 to t3. As a result, the relationship between the data acquisition time and the sensor data is deviated, and for example, misfire may be detected erroneously even though no misfire has occurred.

しかし、コントローラ1においては、転送漏れがあった場合は、DMA部12の残回数レジスタのレジスタ値が更新されない。このため、図5に示すように、遅延計測期間の終了後の転送残回数は「0x0002」を示している。これにより、遅延計測期間に3回しかDMA転送が実行されず、転送漏れが1回あったことがわかる。なお、転送漏れ回数は、RAM13の異常データ領域13cに記憶される。エンジンの異常が検出された場合に、転送漏れ回数を見ることにより、その異常が、センサデータの転送漏れに起因した誤検出である、と判断することが可能となる。 However, in the controller 1, the register value of the remaining count register of the DMA unit 12 is not updated when there is a transfer omission. Therefore, as shown in FIG. 5, the number of remaining transfers after the end of the delay measurement period indicates "0x0002". As a result, it can be seen that the DMA transfer was executed only three times during the delay measurement period, and there was one transfer omission. The number of transfer omissions is stored in the abnormal data area 13c of the RAM 13. FIG. When an abnormality of the engine is detected, it is possible to judge that the abnormality is an erroneous detection caused by the omission of transfer of sensor data by looking at the number of transfer omissions.

ここで、図7を参照し、遅延計測期間の終了時の処理フローについて説明する。ここでは、CPU11がこの処理を行うものとして説明するが、外部の診断ツール等が行っても良い。まず、現在時刻が設定される(ステップS1)。現在時刻は、例えば、タイマ部16から取得することができる。 Here, the processing flow at the end of the delay measurement period will be described with reference to FIG. Here, it is assumed that the CPU 11 performs this processing, but an external diagnostic tool or the like may perform this processing. First, the current time is set (step S1). The current time can be obtained from the timer unit 16, for example.

次に、CPU11は、転送回数初期値を、ROM14の領域14bから取得する(ステップS2)。次に、CPU11は、DMA部12の転送残回数レジスタから、転送残回数を取得する(ステップS3)。そして、CPU11は、ステップS2で取得した転送回数初期値から、ステップS3で取得した転送残回数を引くことにより、実行された転送回数を求める(ステップS4)。また、CPU11は、転送回数初期値から、実行された転送回数を引くことにより、転送漏れ回数を求める(ステップS5)。 Next, the CPU 11 acquires the initial value of the number of transfers from the area 14b of the ROM 14 (step S2). Next, the CPU 11 acquires the remaining number of transfers from the remaining number of transfers register of the DMA unit 12 (step S3). Then, the CPU 11 subtracts the remaining number of transfers obtained in step S3 from the initial value of the number of transfers obtained in step S2, thereby obtaining the number of transfers performed (step S4). Further, the CPU 11 obtains the number of transfer omissions by subtracting the number of transfers that have been executed from the initial value of the number of transfers (step S5).

次に、CPU11は、変数iに初期値0を設定する(ステップS6)。CPU11は、また、ステップS6において、高負荷回数を表す変数Thに初期値0を設定する。次に、CPU11は、遅延時間バッファ13b内の遅延時間データの1つを遅延時間Diとして選択し、遅延時間Diが所定の閾値より大きいか判断する(ステップS7)。この所定の閾値より遅延時間Diが大きい場合、その遅延時間Diが取得されたときにDMA部12が高負荷状態にあったと判断される。ステップS7の判断結果がYesの場合、ステップS8へ進み、変数Thの値を1だけ増加させる。ステップS7の判断結果がNoの場合、ステップS9へ進み、変数iの値を1だけ増加させる。 Next, the CPU 11 sets the initial value 0 to the variable i (step S6). In step S6, the CPU 11 also sets the initial value 0 to the variable Th representing the number of times of high load. Next, the CPU 11 selects one piece of delay time data in the delay time buffer 13b as the delay time Di, and determines whether the delay time Di is greater than a predetermined threshold (step S7). If the delay time Di is greater than this predetermined threshold, it is determined that the DMA unit 12 was in a high load state when the delay time Di was acquired. If the determination result of step S7 is Yes, the process proceeds to step S8 to increase the value of variable Th by one. If the determination result in step S7 is No, the process proceeds to step S9 to increase the value of variable i by one.

次に、CPU11は、変数iの値が、実行された転送回数に等しいか否かを判断する(ステップS10)。ステップS10の判断結果がNoの場合、ステップS7へ戻る。ステップS10の判断結果がYesの場合は、ステップS11へ進み、高負荷率を求める。高負荷率は、ステップS8で求めた高負荷回数Thを、実行された転送回数で除することで求められる。次に、CPU11は、RAM13の異常データ領域13cのデータ取得時刻を現在時刻に更新する(ステップS12)。また、CPU11は、異常データ領域13cのデータを、ステップS5で求めた転送漏れ回数と、ステップS12で求めた高負荷率とで更新する(ステップS13)。 Next, the CPU 11 determines whether or not the value of the variable i is equal to the number of transfers that have been executed (step S10). If the determination result in step S10 is No, the process returns to step S7. If the determination result in step S10 is Yes, the process proceeds to step S11 to obtain a high load factor. The high load factor is obtained by dividing the high load count Th obtained in step S8 by the number of transfers performed. Next, the CPU 11 updates the data acquisition time in the abnormal data area 13c of the RAM 13 to the current time (step S12). In addition, the CPU 11 updates the data in the abnormal data area 13c with the number of transfer failures obtained in step S5 and the high load factor obtained in step S12 (step S13).

以上のように、コントローラ1では、遅延計測期間が終了する度に、RAM13の異常データ領域13cのデータを更新する。上述したように、異常データ領域13cのデータは、異常が検出された際に、故障情報データとしてROM14に格納され、診断ツール等で解析される As described above, the controller 1 updates the data in the abnormal data area 13c of the RAM 13 each time the delay measurement period ends. As described above, the data in the abnormality data area 13c is stored in the ROM 14 as failure information data when an abnormality is detected, and is analyzed by a diagnostic tool or the like.

ここで、図8を参照し、異常が検出された際の処理フローについて説明する。この処理は、CPU11によって実行される。図8においては、異常としてスパークプラグの失火が検出された場合を例示する。ただし、異常の種類は失火に限定されない。まず、CPU11は、タイマ部18から現在時刻を取得し、異常の検出時刻としてROM14に格納する(ステップS21)。次に、CPU11は、RAM13の異常データ領域13cのデータを読み出し、失火検出時データとしてROM14に格納する(ステップS22)。 Here, a processing flow when an abnormality is detected will be described with reference to FIG. This processing is executed by the CPU 11 . FIG. 8 illustrates a case where a spark plug misfire is detected as an abnormality. However, the type of abnormality is not limited to misfiring. First, the CPU 11 acquires the current time from the timer unit 18 and stores it in the ROM 14 as the abnormality detection time (step S21). Next, the CPU 11 reads the data in the abnormal data area 13c of the RAM 13, and stores it in the ROM 14 as misfire detection data (step S22).

スパークプラグの失火は、筒内圧センサやノックセンサのセンサデータに基づいて検出される。例えば、筒内圧センサのセンサデータの値が正常値ではないときに、スパークプラグの失火が発生したものと判定される。したがって、失火が検出された際に、本当にスパークプラグの失火が生じているのか、センサデータの不備に起因して失火が誤検出されているのかを、早期に判断できることが望ましい。コントローラ1によれば、DMA転送の遅延や転送漏れの有無に基づき、センサデータの不備の有無を検証することができる。 A misfire of a spark plug is detected based on sensor data from an in-cylinder pressure sensor and a knock sensor. For example, when the value of the sensor data of the in-cylinder pressure sensor is not a normal value, it is determined that the spark plug has misfired. Therefore, when a misfire is detected, it is desirable to be able to quickly determine whether the spark plug has actually misfired or whether the misfire has been erroneously detected due to insufficient sensor data. According to the controller 1, it is possible to verify the presence or absence of defects in the sensor data based on the presence or absence of DMA transfer delays and transfer omissions.

上述のように、本実施形態のコントローラ1によれば、DMA転送の遅延時間をRAM13の遅延時間バッファ13aに記録する。診断ツール等によって遅延状況を解析することで、異常が検出された際に、本当の異常なのか、DMA負荷によるセンサデータの不備が原因なのかを、早期に判別できる。 As described above, according to the controller 1 of the present embodiment, the delay time of DMA transfer is recorded in the delay time buffer 13 a of the RAM 13 . By analyzing the delay situation using a diagnostic tool or the like, when an abnormality is detected, it is possible to quickly determine whether it is a true abnormality or whether the cause is an incomplete sensor data due to a DMA load.

さらに、コントローラ1は、遅延計測期間にDMA転送に漏れがあったか否かを判断し、転送漏れ回数をRAM13に記録する。これにより、異常が検出された際に、診断ツール等によって、本当の異常なのか、転送漏れによるセンサデータの不備が原因なのかを、早期に判別できる。 Further, the controller 1 determines whether or not there is any omission in the DMA transfer during the delay measurement period, and records the number of transfer omissions in the RAM 13 . As a result, when an abnormality is detected, it can be quickly determined by a diagnostic tool or the like whether the abnormality is real or is caused by insufficient sensor data due to omission of transfer.

図9に、診断ツールの処理フローの一例を示す。診断ツールは、例えば、パーソナルコンピュータやタブレット等に実装されるソフトウエアである。したがって、図9の処理フローは、パーソナルコンピュータ等のプロセッサによって実行される。診断ツールは、まず、コントローラ1のROM14において、故障情報データが記憶されている領域14cにアクセスし、故障情報データを読み出す(ステップS31)。なお、ここでは、診断ツールがROM14にアクセスするものとした。しかし、ROM14から読み出した故障情報データを、記録媒体または通信媒体を介して、診断ツールに読み込ませても良い。 FIG. 9 shows an example of the processing flow of the diagnostic tool. A diagnostic tool is, for example, software installed in a personal computer, a tablet, or the like. Therefore, the processing flow of FIG. 9 is executed by a processor such as a personal computer. The diagnostic tool first accesses the area 14c in which failure information data is stored in the ROM 14 of the controller 1, and reads out the failure information data (step S31). Here, it is assumed that the diagnostic tool accesses the ROM 14 . However, the failure information data read from the ROM 14 may be read into the diagnostic tool via a recording medium or communication medium.

次に、診断ツールは、読み出した故障情報データから、DMA転送に関する転送状況データを抽出する(ステップS32)。例えば、図2の例では、転送漏れ回数および高負荷率が抽出される。ただし、DMA転送に関する転送状況データは、転送漏れ回数および高負荷率に制限されない。例えば、失火検出時に、遅延時間バッファ13bに記憶された各遅延時間も、転送状況データとしてROM14に格納してもよい。 Next, the diagnostic tool extracts transfer status data relating to DMA transfer from the read failure information data (step S32). For example, in the example of FIG. 2, the number of transfer omissions and the high load factor are extracted. However, the transfer status data regarding DMA transfer is not limited to the number of transfer omissions and the high load factor. For example, each delay time stored in the delay time buffer 13b at the time of misfire detection may also be stored in the ROM 14 as transfer status data.

次に、抽出した転送状況データと所定の閾値とを比較することにより、異常検出が、DMA転送の高負荷によるセンサデータの不備に起因するものかを判断する(ステップS33)。例えば、高負荷率が所定の閾値(ゼロを含む)よりも高い場合、センサデータの転送に遅れが発生していたことや、その発生の頻度を把握することができる。また、転送状況データに遅延時間データを含む場合、遅延時間と所定の閾値とを比較し、その閾値を上回った遅延時間データの数が多いほど、DMA負荷が高かったと推定できる。また、遅延時間の閾値を上回る程度が非常に大きい遅延時間データが存在した場合も、DMA負荷が高かったと推定できる。これらの場合、異常検出は、DMA負荷によるセンサデータの不備が原因である可能性が高いと判断することができる。 Next, by comparing the extracted transfer status data with a predetermined threshold value, it is determined whether the abnormality detection is caused by insufficient sensor data due to a high load of DMA transfer (step S33). For example, when the high load factor is higher than a predetermined threshold value (including zero), it is possible to grasp that there was a delay in transferring sensor data and the frequency of this occurrence. Also, when delay time data is included in the transfer status data, the delay time is compared with a predetermined threshold, and the larger the number of delay time data exceeding the threshold, the higher the DMA load can be estimated. Also, when there is delay time data exceeding the delay time threshold, it can be estimated that the DMA load was high. In these cases, it can be determined that the abnormality detection is likely caused by insufficient sensor data due to the DMA load.

また、例えば、診断ツールによって、転送漏れ回数を所定の閾値と比較し、転送漏れ回数が閾値を上回り、かつ、閾値との差が大きいほど、DMA負荷が高かったと推定できる。この場合、異常検出は、DMA負荷によるセンサデータの不備が原因である可能性が高いと判断することができる。 Also, for example, a diagnostic tool compares the number of transfer omissions with a predetermined threshold, and it can be estimated that the DMA load is higher as the number of transfer omissions exceeds the threshold and the difference between the threshold and the threshold is larger. In this case, it can be determined that the abnormality detection is likely caused by incomplete sensor data due to the DMA load.

この明細書および図面等における開示は、例示された実施形態に制限されない。開示は、例示された実施形態と、それらに基づく当業者による変形態様を包含する。例えば、開示は、実施形態において示された部品および/または要素の組み合わせに限定されない。開示は、多様な組み合わせによって実施可能である。開示は、実施形態に追加可能な追加的な部分をもつことができる。開示は、実施形態の部品および/または要素が省略されたものを包含する。開示は、ひとつの実施形態と他の実施形態との間における部品および/または要素の置き換え、または組み合わせを包含する。開示される技術的範囲は、実施形態の記載に限定されない。開示されるいくつかの技術的範囲は、請求の範囲の記載によって示され、さらに請求の範囲の記載と均等の意味及び範囲内での全ての変更を含むものと解されるべきである。 The disclosure in this specification, drawings, etc. is not limited to the illustrated embodiments. The disclosure encompasses the illustrated embodiments and variations thereon by those skilled in the art. For example, the disclosure is not limited to the combinations of parts and/or elements shown in the embodiments. The disclosure can be implemented in various combinations. The disclosure can have additional parts that can be added to the embodiments. The disclosure encompasses omitting parts and/or elements of the embodiments. The disclosure encompasses permutations or combinations of parts and/or elements between one embodiment and another. The disclosed technical scope is not limited to the description of the embodiments. The disclosed technical scope is indicated by the description of the claims, and should be understood to include all modifications within the meaning and range of equivalents to the description of the claims.

例えば、上記の実施形態においては、遅延時間と転送漏れ回数との両方をRAM13に記憶する構成を例示した。しかし、遅延時間と転送漏れ回数とのいずれか一方のみをRAM13に記憶する構成としても良い。 For example, in the above-described embodiment, the RAM 13 stores both the delay time and the number of transfer omissions. However, it is also possible to store in the RAM 13 only one of the delay time and the number of transfer omissions.

また、上記の実施形態においては、コントローラ1は、遅延時間に基づいて高負荷率を求め、RAM13に記憶する。しかし、遅延時間そのものに限らず、遅延時間に基づいてDMA転送の状況を表す指標データを求め、その指標データを解析に用いるようにしても良い。このような指標データとしては、上記の高負荷率以外に、様々な指標を用いることができる。例えば、実行されたDMA転送の回数に対する、転送漏れの回数の割合を指標データとして用いても良い。あるいは、遅延計測期間内に遅延時間が閾値を上回った回数を、指標データとして用いても良い。 Also, in the above embodiment, the controller 1 obtains the high load factor based on the delay time and stores it in the RAM 13 . However, not only the delay time itself, but also index data representing the state of DMA transfer may be obtained based on the delay time, and the index data may be used for the analysis. As such index data, various indexes can be used in addition to the above-described high load factor. For example, the ratio of the number of transfer omissions to the number of executed DMA transfers may be used as index data. Alternatively, the number of times the delay time exceeds the threshold within the delay measurement period may be used as index data.

上記の実施形態においては、遅延時間がゼロ(0x0000)である場合も、遅延時間をRAM13に記憶する構成を例示した。しかし、実質的な遅延時間が生じた場合にのみ、遅延の発生時点の情報と共に、遅延時間をRAM13に記憶する構成としても良い。この構成によれば、RAM13の記憶容量を有効利用できる。
また、上記の実施形態においては、遅延カウンタ16bのカウント値が所定値に到達することをもって、遅延カウンタ16bのカウント値のDMA転送要求信号を作成する例について説明した。しかし、遅延カウンタ16bのカウント値のDMA転送要求は、DMA部12において、AD変換部15からRAM13へのDMA転送が完了したことに応じて作成されてもよい。この場合、AD変換カウンタ16aが遅延カウンタ16bとしての役割を兼ねることも可能となり、DMA部12は、AD変換結果のDMA転送が完了した時点のAD変換カウンタ16aのカウンタ値を読み出して、遅延時間データとして、RAM13へ転送してもよい。
In the above-described embodiment, the configuration is illustrated in which the delay time is stored in the RAM 13 even when the delay time is zero (0x0000). However, it is also possible to store the delay time in the RAM 13 together with the information on the time of occurrence of the delay only when a substantial delay time occurs. With this configuration, the storage capacity of the RAM 13 can be effectively used.
Further, in the above embodiment, an example has been described in which a DMA transfer request signal for the count value of the delay counter 16b is generated when the count value of the delay counter 16b reaches a predetermined value. However, the DMA transfer request for the count value of the delay counter 16b may be generated in the DMA section 12 in response to completion of the DMA transfer from the AD conversion section 15 to the RAM 13 . In this case, the AD conversion counter 16a can also serve as the delay counter 16b, and the DMA unit 12 reads out the counter value of the AD conversion counter 16a at the time when the DMA transfer of the AD conversion result is completed, and calculates the delay time. It may be transferred to the RAM 13 as data.

上記の実施形態においては、自動車のエンジン制御装置のコントローラを例示した。しかし、本開示のコントローラは、自動車のエンジン制御装置に限らず、様々な制御装置に適用することができる。 In the above embodiment, the controller of the engine control system of the automobile was exemplified. However, the controller of the present disclosure can be applied not only to an automobile engine control device but also to various control devices.

1:コントローラ、12:DMA部、13:RAM
1: controller, 12: DMA unit, 13: RAM

Claims (6)

RAM(13)と、
前記RAMに対するDMA転送を制御するDMA部(12)と、
を備え、
前記RAMは、所定期間内に行われた前記DMA転送について、転送の遅延時間と、転送漏れの回数との少なくとも一方を直接的または間接的に表す転送状況データを記憶するものであり、
前記DMA部は、前記DMA転送を所定の周期で実施するものであり、
前記所定の周期と同じ長さのリセット周期をカウントするとリセットされるカウンタをさらに備え、
前記RAMは、前記転送の遅延時間として、前記DMA転送が完了した時点の前記カウンタのカウント値を記憶する、コントローラ。
a RAM (13);
a DMA unit (12) for controlling DMA transfer to the RAM;
with
The RAM stores transfer status data that directly or indirectly represents at least one of a transfer delay time and the number of transfer omissions for the DMA transfer performed within a predetermined period ,
The DMA unit performs the DMA transfer at a predetermined cycle,
further comprising a counter that is reset when counting a reset period having the same length as the predetermined period;
The controller, wherein the RAM stores a count value of the counter when the DMA transfer is completed as the delay time of the transfer .
前記カウンタは、前記DMA転送の完了する時点に対応して前記リセット周期に達してリセットされる遅延カウンタ(16b)であり、
前記遅延カウンタは、前記リセット周期に相当する所定値にコンペアマッチしたときに、当該遅延カウンタのカウンタ値を前記RAMへDMA転送することを要求する、請求項に記載のコントローラ。
the counter is a delay counter (16b) that is reset when the reset cycle is reached corresponding to the point in time when the DMA transfer is completed;
2. The controller according to claim 1 , wherein said delay counter requests DMA transfer of the counter value of said delay counter to said RAM when a compare match occurs with a predetermined value corresponding to said reset period.
RAM(13)と、
前記RAMに対するDMA転送を制御するDMA部(12)と、
を備え、
前記RAMは、所定期間内に行われた前記DMA転送について、転送の遅延時間と、転送漏れの回数との少なくとも一方を直接的または間接的に表す転送状況データを記憶するものであり、
前記転送状況データが、前記所定期間内に行われた前記DMA転送のうち、前記転送の遅延時間が所定の閾値を超える前記DMA転送の割合を表す高負荷率を含む、コントローラ。
a RAM (13);
a DMA unit (12) for controlling DMA transfer to the RAM;
with
The RAM stores transfer status data that directly or indirectly represents at least one of a transfer delay time and the number of transfer omissions for the DMA transfer performed within a predetermined period,
The controller, wherein the transfer status data includes a high load rate representing a ratio of the DMA transfers, among the DMA transfers performed within the predetermined period, for which the delay time of the transfer exceeds a predetermined threshold.
RAM(13)と、
前記RAMに対するDMA転送を制御するDMA部(12)と、
を備え、
前記RAMは、所定期間内に行われた前記DMA転送について、転送の遅延時間と、転送漏れの回数との少なくとも一方を直接的または間接的に表す転送状況データを記憶するものであり、
前記転送漏れの回数が、前記所定期間内に実行可能な前記DMA転送の回数と、前記所定期間内に実行された前記DMA転送の回数との比較から求められる、コントローラ。
a RAM (13);
a DMA unit (12) for controlling DMA transfer to the RAM;
with
The RAM stores transfer status data that directly or indirectly represents at least one of a transfer delay time and the number of transfer omissions for the DMA transfer performed within a predetermined period,
The controller, wherein the number of transfer omissions is obtained from a comparison between the number of DMA transfers that can be performed within the predetermined period and the number of DMA transfers that have been performed within the predetermined period.
RAM(13)と、
前記RAMに対するDMA転送を制御するDMA部(12)と、
を備え、
前記RAMは、所定期間内に行われた前記DMA転送について、転送の遅延時間と、転送漏れの回数との少なくとも一方を直接的または間接的に表す転送状況データを記憶するものであり、
書き込み可能なROM(14)と、
制御対象からセンサ信号を入力し、AD変換してセンサデータを生成するAD変換部(15)と、をさらに備え、
前記DMA部が、前記AD変換部から前記RAMへ、前記センサデータをDMA転送し、
前記センサデータに基づいて前記制御対象の異常が検出された場合、前記RAMから、前記転送状況データの少なくとも一部に加えて、前記センサデータの少なくとも一部を読み出して、前記ROMに記憶する、コントローラ。
a RAM (13);
a DMA unit (12) for controlling DMA transfer to the RAM;
with
The RAM stores transfer status data that directly or indirectly represents at least one of a transfer delay time and the number of transfer omissions for the DMA transfer performed within a predetermined period,
a writable ROM (14);
An AD conversion unit (15) that receives a sensor signal from a controlled object and AD converts it to generate sensor data,
the DMA unit DMA-transfers the sensor data from the AD conversion unit to the RAM;
reading at least part of the sensor data from the RAM in addition to at least part of the transfer status data when an abnormality of the controlled object is detected based on the sensor data, and storing the data in the ROM ; controller .
請求項に記載のコントローラ(1)の制御対象の異常を判断する診断プログラムであって、
前記センサデータに基づいて前記制御対象の異常が検出された場合、
コンピュータのプロセッサに、
前記コントローラのROMから読み出されたデータを入力するステップと、
前記転送状況データを所定の閾値と対比することにより、前記制御対象の異常が、前記DMA転送による前記センサデータの不備に起因するか否かを判断するステップとを実行させる、診断プログラム。
A diagnostic program for determining an abnormality in the controlled object of the controller (1) according to claim 5 ,
When an abnormality in the controlled object is detected based on the sensor data,
computer processor,
inputting data read from the ROM of the controller;
and comparing the transfer status data with a predetermined threshold value to determine whether or not the abnormality in the controlled object is caused by the deficiency of the sensor data due to the DMA transfer.
JP2019061695A 2019-03-27 2019-03-27 Controller and diagnostic program Active JP7226014B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019061695A JP7226014B2 (en) 2019-03-27 2019-03-27 Controller and diagnostic program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019061695A JP7226014B2 (en) 2019-03-27 2019-03-27 Controller and diagnostic program

Publications (2)

Publication Number Publication Date
JP2020160986A JP2020160986A (en) 2020-10-01
JP7226014B2 true JP7226014B2 (en) 2023-02-21

Family

ID=72639530

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019061695A Active JP7226014B2 (en) 2019-03-27 2019-03-27 Controller and diagnostic program

Country Status (1)

Country Link
JP (1) JP7226014B2 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005339372A (en) 2004-05-28 2005-12-08 Hitachi Ltd Direct memory access transfer control device, system using the same, and debugging support method and system thereof
US20110191507A1 (en) 2008-08-07 2011-08-04 Andrew Bond Dma engine
JP2016130927A (en) 2015-01-14 2016-07-21 Necエンジニアリング株式会社 Dma controller and inter-bus data transfer method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04235656A (en) * 1991-01-10 1992-08-24 Fujitsu Ltd Channel device control system
JPH08202635A (en) * 1995-01-30 1996-08-09 Toshiba Corp DMA controller

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005339372A (en) 2004-05-28 2005-12-08 Hitachi Ltd Direct memory access transfer control device, system using the same, and debugging support method and system thereof
US20110191507A1 (en) 2008-08-07 2011-08-04 Andrew Bond Dma engine
JP2016130927A (en) 2015-01-14 2016-07-21 Necエンジニアリング株式会社 Dma controller and inter-bus data transfer method

Also Published As

Publication number Publication date
JP2020160986A (en) 2020-10-01

Similar Documents

Publication Publication Date Title
US7578282B2 (en) Apparatus for processing sensor signal from knock sensor of internal combustion engine
KR101940906B1 (en) Register abnormality detection apparatus
US20160097799A1 (en) Method for detecting a wiring fault in a capacitive sensor
EP3118749B1 (en) System and method of monitoring a serial bus
US7904771B2 (en) Self-diagnostic circuit and self-diagnostic method for detecting errors
JP7226014B2 (en) Controller and diagnostic program
CN112362194B (en) Sensor detection method and device
TW201419921A (en) Judging method and system
US20210148978A1 (en) Joint test action group transmission system capable of transmitting data continuously
JP5982845B2 (en) Trace control apparatus and trace control method
US8738881B2 (en) Performance optimization system, method and program
US6216189B1 (en) Error master detector
US8489828B2 (en) Control apparatus having non-volatile RAM, protection apparatus and method applied thereto
CN121072424B (en) Verification device and verification method for background mechanism cyclic redundancy check algorithm
JP2007328403A (en) Bus monitoring circuit and information processing inspection system
JP7375903B2 (en) Abnormality detection circuit and abnormality detection method
JP7832139B2 (en) control device
JP2018151921A (en) Electronic control unit
JP5673197B2 (en) Test program and test method
JP3576978B2 (en) Memory port, storage device, information processing system
JP2009282849A (en) Microcomputer
CN119960348A (en) A frequency quantity acquisition system and method based on timer
JP5874568B2 (en) Arithmetic processing unit
CN120652956A (en) Abnormality detection method and device for double-chip control system
JP2011128780A (en) Ram diagnostic device and its program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20210716

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20220627

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20220726

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20220916

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: 20230110

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20230123

R151 Written notification of patent or utility model registration

Ref document number: 7226014

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250