JP2011061512A - A/d conversion processing apparatus - Google Patents

A/d conversion processing apparatus Download PDF

Info

Publication number
JP2011061512A
JP2011061512A JP2009209222A JP2009209222A JP2011061512A JP 2011061512 A JP2011061512 A JP 2011061512A JP 2009209222 A JP2009209222 A JP 2009209222A JP 2009209222 A JP2009209222 A JP 2009209222A JP 2011061512 A JP2011061512 A JP 2011061512A
Authority
JP
Japan
Prior art keywords
signal
edge
conversion
circuit
converter
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.)
Granted
Application number
JP2009209222A
Other languages
Japanese (ja)
Other versions
JP5326952B2 (en
Inventor
Masayuki Kaneko
正幸 金子
Hironari Nakagawa
裕也 中川
Mitsuhiro Tani
充弘 谷
Takuya Noguchi
拓也 野口
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 JP2009209222A priority Critical patent/JP5326952B2/en
Publication of JP2011061512A publication Critical patent/JP2011061512A/en
Application granted granted Critical
Publication of JP5326952B2 publication Critical patent/JP5326952B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Combined Controls Of Internal Combustion Engines (AREA)
  • Analogue/Digital Conversion (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To store each piece of A/D converted data in a memory after performing A/D conversion, at a predetermined sampling interval, of an analog signal from a sensor without increasing a process load of a CPU, and without providing a special hardware for transferring the A/D converted data to the memory accompanied with termination of the A/D conversion. <P>SOLUTION: In a microcomputer 11 mounted on an ECU for controlling an engine, A/D conversion of injector pressure signals P1 to P4 is performed by activating an A/D converter 17 after occurrence of a trigger A (TrgA) in every occurrence of a rising edge (periodical edge) of a PWM signal from a PWM signal output circuit 21, while DMA transfer of the A/D converted data to a RAM 15 from the A/D converter 17 is performed by activating a DMA controller 19 after occurrence of a trigger B (TrgB) in every occurrence of a trailing edge (duty edge) of the PWM signal. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、センサからのアナログ信号を所定のサンプリング間隔でA/D変換すると共に、そのA/D変換後のデジタルデータであるA/D変換データの各々をメモリに格納するA/D変換処理装置に関する。   The present invention performs A / D conversion on an analog signal from a sensor at a predetermined sampling interval, and stores each A / D conversion data which is digital data after the A / D conversion in a memory. Relates to the device.

例えば、自動車のエンジンを制御する電子制御装置としては、エンジンの制御に用いる所定の物理量(例えば、気筒内の燃焼圧力や噴射する燃料の圧力等)を検出するセンサからのアナログ信号を、特定の処理対象期間において、A/D変換器により所定のサンプリング間隔でA/D変換すると共に、A/D変換後のデジタルデータであるA/D変換データの各々をRAMに順次格納し、CPUが、そのRAM内の各A/D変換データを用いて、エンジンを制御するための処理を行うものがある(例えば、特許文献1,2参照)。   For example, as an electronic control device for controlling an engine of an automobile, an analog signal from a sensor that detects a predetermined physical quantity (for example, a combustion pressure in a cylinder or a pressure of fuel to be injected) used for engine control is specified. In the processing target period, the A / D converter performs A / D conversion at a predetermined sampling interval, and each A / D conversion data that is digital data after A / D conversion is sequentially stored in the RAM. Some A / D conversion data in the RAM performs processing for controlling the engine (see, for example, Patent Documents 1 and 2).

そして、アナログ信号のA/D変換と、A/D変換データのRAMへの格納とを行う技術として、特許文献1には、CPUが、一定時間毎の割り込み処理により、A/D変換器からA/D変換データを読み出してRAMに格納する処理と、次のA/D変換のためにA/D変換器を起動する処理とを、実施することが記載されている。   As a technique for performing A / D conversion of an analog signal and storing A / D conversion data in a RAM, Japanese Patent Application Laid-Open Publication No. 2004-259542 discloses that the CPU performs an interrupt process at regular intervals from an A / D converter. It describes that a process of reading A / D conversion data and storing it in a RAM and a process of starting an A / D converter for the next A / D conversion are performed.

また、特許文献2には、<方法1>として、CPUが、タイミング発生器からタイミング信号が出力される毎に、A/D変換器を起動すると共に、A/D変換が終了したら、A/D変換器からA/D変換データを読み出してRAMに格納することが記載されている。   In Patent Document 2, as <Method 1>, the CPU starts the A / D converter every time a timing signal is output from the timing generator, and when the A / D conversion is completed, It describes that A / D conversion data is read from a D converter and stored in a RAM.

また、特許文献2には、<方法2>として、A/D変換器が上記タイミング信号の出力間隔よりも短い間隔で起動されるようにしておき、上記タイミング信号が出力される毎に、CPUが、A/D変換器から、その時点での最新のA/D変換データを読み出してRAMに格納することが記載されている。   In Patent Document 2, as <Method 2>, the A / D converter is activated at an interval shorter than the output interval of the timing signal, and the CPU is output every time the timing signal is output. However, the latest A / D conversion data at that time is read from the A / D converter and stored in the RAM.

一方、CPUによって設定される周期及びパルス幅のPWM(パルス幅変調)信号を出力するPWM信号出力回路(PWM信号生成回路)は既知である(例えば、特許文献3,4参照)。   On the other hand, a PWM signal output circuit (PWM signal generation circuit) that outputs a PWM (pulse width modulation) signal having a period and a pulse width set by the CPU is known (for example, see Patent Documents 3 and 4).

特開2002−89346号公報(特に図7のS710,S730)JP-A-2002-89346 (especially S710 and S730 in FIG. 7) 特開2005−220796号公報(特に段落[0095],[0096])Japanese Patent Laying-Open No. 2005-220796 (particularly paragraphs [0095] and [0096]) 特開平11−214970号公報JP 11-214970 A 特開平10−2248号公報Japanese Patent Laid-Open No. 10-2248

上記特許文献1の技術では、A/D変換器の起動と、A/D変換器からRAMへのA/D変換データの転送とを、CPUが行うため、そのCPUの処理負荷が大きくなってしまい、制御対象を制御するための処理を円滑に行えなくなる可能性が生じる。そして、CPUの処理負荷が大きくなるという問題は、A/D変換器の起動間隔(サンプリング間隔)を短くするほど顕著になる。   In the technique of Patent Document 1, since the CPU performs the start of the A / D converter and the transfer of A / D conversion data from the A / D converter to the RAM, the processing load on the CPU increases. Therefore, there is a possibility that the process for controlling the control target cannot be performed smoothly. The problem that the processing load on the CPU increases becomes more prominent as the activation interval (sampling interval) of the A / D converter is shortened.

また、こうした問題は、特許文献2の上記<方法1>であっても同様に生じる。
一方、特許文献2の上記<方法1>及び<方法2>において、A/D変換器の起動が、CPUの処理によらず、ハード的に実施されるよう構成されていると仮定しても、CPUが、A/D変換器からRAMへA/D変換データを転送する処理を実施しなければならないことに変わりはないため、CPUの処理負荷が大きくなるという問題を完全に解決することはできない。
Further, such a problem occurs in the same manner even in <Method 1> of Patent Document 2.
On the other hand, in the above <Method 1> and <Method 2> of Patent Document 2, it is assumed that the A / D converter is started up in hardware, regardless of the processing of the CPU. The problem that the processing load of the CPU becomes large can be completely solved because the CPU still has to execute the process of transferring the A / D conversion data from the A / D converter to the RAM. Can not.

また仮に、特許文献1,2において、A/D変換器によるA/D変換が完了したなら、CPUの処理によらず、A/D変換器からRAMへのA/D変換データの転送がハード的に実施されるように構成したとすると、そのデータ転送のためのCPUの処理負荷を無くすことができるものの、A/D変換の完了に連動してA/D変換データをRAMに転送する専用のハードウェアが必要になってしまう。   In addition, in Patent Documents 1 and 2, if A / D conversion by the A / D converter is completed, it is difficult to transfer A / D conversion data from the A / D converter to the RAM regardless of the processing of the CPU. If it is configured so as to be implemented, the CPU processing load for the data transfer can be eliminated, but the A / D conversion data is transferred to the RAM in conjunction with the completion of the A / D conversion. Of hardware will be required.

本発明は、こうした問題に鑑みなされたものであり、センサからのアナログ信号を所定のサンプリング間隔でA/D変換してA/D変換データの各々をメモリに格納することを、CPUの処理負荷を増加させずに、且つ、A/D変換の完了に連動してA/D変換データをメモリに転送する専用のハードウェアを設けることなく、実現することを目的としている。   The present invention has been made in view of these problems, and the processing load of the CPU is that A / D conversion is performed on an analog signal from a sensor at a predetermined sampling interval and each A / D conversion data is stored in a memory. It is an object of the present invention to achieve without realizing the above and without providing dedicated hardware for transferring A / D conversion data to a memory in conjunction with completion of A / D conversion.

請求項1のA/D変換処理装置は、制御対象を制御するための処理を行うCPUと共に電子制御装置に設けられ、センサから出力されるアナログ信号を所定のサンプリング間隔でA/D変換すると共に、そのA/D変換後のデジタルデータであるA/D変換データの各々をメモリに格納する。そして、この機能を実現するために、請求項1のA/D変換処理装置は、A/D変換器と、DMA(Direct Memory Access)コントローラと、A/D変換要求発生手段と、転送要求発生手段とに加え、信号発生回路を備えている。   The A / D conversion processing device according to claim 1 is provided in an electronic control device together with a CPU that performs processing for controlling a controlled object, and A / D converts an analog signal output from a sensor at a predetermined sampling interval. Each A / D conversion data which is digital data after the A / D conversion is stored in the memory. In order to realize this function, the A / D conversion processing apparatus according to claim 1 includes an A / D converter, a DMA (Direct Memory Access) controller, an A / D conversion request generation means, and a transfer request generation. In addition to the means, a signal generation circuit is provided.

A/D変換器は、前記アナログ信号が入力され、A/D変換の実施を指令するA/D変換要求信号を受けると、そのアナログ信号をA/D変換する。
また、DMAコントローラは、A/D変換器から前記メモリへのA/D変換データのDMA転送を指令するDMA転送要求信号を受けると、A/D変換器からメモリへのA/D変換データの転送を行うと共に、そのDMA転送要求信号を受ける毎に、メモリにおけるA/D変換データの転送先アドレスを変更することにより、メモリに複数のA/D変換データを記憶させる。つまり、DMAコントローラは、DMA転送要求信号を受ける毎に、A/D変換器からメモリの異なるアドレスへA/D変換データを転送する。
When the analog signal is input and the A / D converter receives an A / D conversion request signal instructing execution of A / D conversion, the A / D converter performs A / D conversion on the analog signal.
When the DMA controller receives a DMA transfer request signal for instructing DMA transfer of A / D conversion data from the A / D converter to the memory, the DMA controller transmits the A / D conversion data from the A / D converter to the memory. Along with the transfer, each time the DMA transfer request signal is received, the transfer destination address of the A / D conversion data in the memory is changed, thereby storing a plurality of A / D conversion data in the memory. That is, every time the DMA controller receives a DMA transfer request signal, the DMA controller transfers A / D conversion data from the A / D converter to a different address in the memory.

一方、A/D変換要求発生手段は、自身に入力される信号に、立ち上がりエッジと立ち下がりエッジとのうちの一方である第1の信号エッジが発生すると、A/D変換器にA/D変換要求信号を与える。すると、A/D変換器が起動してアナログ信号をA/D変換することとなる。   On the other hand, when the first signal edge, which is one of the rising edge and the falling edge, is generated in the signal input to the A / D conversion request generation means, the A / D conversion is sent to the A / D converter. A conversion request signal is given. Then, the A / D converter is activated to A / D convert the analog signal.

また、転送要求発生手段は、自身に入力される信号に、立ち上がりエッジと立ち下がりエッジとのうちの一方である第2の信号エッジが発生すると、DMAコントローラにDMA転送要求信号を与える。すると、DMAコントローラが起動してA/D変換器からメモリへのデータ転送(即ち、A/D変換データの転送)を行うこととなる。   The transfer request generating means gives a DMA transfer request signal to the DMA controller when a second signal edge, which is one of a rising edge and a falling edge, is generated in a signal input to the transfer request generating means. Then, the DMA controller is activated to perform data transfer from the A / D converter to the memory (that is, transfer of A / D conversion data).

そして、信号発生回路は、CPUとは並行して動作して、A/D変換要求発生手段と転送要求発生手段とに信号を供給するものであり、A/D変換要求発生手段への信号に、第1の信号エッジを前記サンプリング間隔毎に発生させ、転送要求発生手段への信号に、第1の信号エッジの発生タイミングから遅れたタイミングで第2の信号エッジを発生させる。   The signal generation circuit operates in parallel with the CPU and supplies signals to the A / D conversion request generation means and the transfer request generation means. The first signal edge is generated at each sampling interval, and the second signal edge is generated at a timing delayed from the generation timing of the first signal edge in the signal to the transfer request generating means.

このため、請求項1のA/D変換処理装置では、信号発生回路からA/D変換要求発生手段への信号に第1の信号エッジが発生する毎に、A/D変換器が起動して、アナログ信号のA/D変換が行われると共に、そのA/D変換器の各起動時から遅れたタイミング毎に、信号発生回路から転送要求発生手段への信号に第2の信号エッジが発生して、DMAコントローラが起動し、A/D変換器からメモリへのデータ転送が行われることとなる。   Therefore, in the A / D conversion processing device according to the first aspect, the A / D converter is activated each time the first signal edge is generated in the signal from the signal generation circuit to the A / D conversion request generation means. A / D conversion of the analog signal is performed, and a second signal edge is generated in the signal from the signal generation circuit to the transfer request generation means at each timing delayed from the activation of the A / D converter. Thus, the DMA controller is activated, and data transfer from the A / D converter to the memory is performed.

そして、こうしたアナログ信号のA/D変換と、そのA/D変換によるA/D変換データのメモリへの転送という一連の動作は、CPUの処理とは別に実施される。しかも、A/D変換の完了に連動してA/D変換データをメモリに転送する専用のハードウェアも必要ない。   A series of operations such as A / D conversion of analog signals and transfer of A / D conversion data to the memory by the A / D conversion are performed separately from the processing of the CPU. In addition, dedicated hardware for transferring A / D conversion data to the memory in conjunction with completion of A / D conversion is not required.

よって、請求項1のA/D変換処理装置によれば、センサからのアナログ信号を所定のサンプリング間隔でA/D変換してA/D変換データの各々をメモリに格納することを、CPUの処理負荷を増加させずに、且つ、A/D変換の完了に連動してA/D変換データをメモリに転送する専用のハードウェアを設けることなく、実現することができる。   Therefore, according to the A / D conversion processing apparatus of the first aspect, the analog signal from the sensor is A / D converted at a predetermined sampling interval, and each of the A / D conversion data is stored in the memory. This can be realized without increasing the processing load and without providing dedicated hardware for transferring A / D conversion data to the memory in conjunction with the completion of A / D conversion.

ところで、請求項2に記載のように、第1の信号エッジの発生タイミングから第2の信号エッジが発生するまでの遅延時間Tdelayは、A/D変換器がA/D変換要求信号を受けてからアナログ信号のA/D変換を完了するまでのA/D変換時間Tadよりも長く、且つ、第1の信号エッジの発生間隔(サンプリング間隔)Tsよりも短ければ良い。尚、「A/D変換器がA/D変換を完了する」とは、「A/D変換データが確定して、そのA/D変換データを正しく読み出すことができる状態になった」ということである。   By the way, as described in claim 2, the delay time Tdelay from the generation timing of the first signal edge to the generation of the second signal edge is determined by the A / D converter receiving the A / D conversion request signal. Is longer than the A / D conversion time Tad until the A / D conversion of the analog signal is completed, and shorter than the first signal edge generation interval (sampling interval) Ts. “A / D converter completes A / D conversion” means that “A / D conversion data is finalized and the A / D conversion data can be read correctly”. It is.

このような時間関係(Tad<Tdelay<Ts)を満たしていれば、A/D変換器がアナログ信号のA/D変換を完了して、その回のA/D変換データが確定してから、A/D変換器が次回のA/D変換を開始する前に、A/D変換器からメモリへのデータ転送を開始することができ、A/D変換の実施中の不定なA/D変換データをメモリに転送してしまうことを回避できるからである。   If such a time relationship (Tad <Tdelay <Ts) is satisfied, the A / D converter completes the A / D conversion of the analog signal and the A / D conversion data for that time is determined. Before the A / D converter starts the next A / D conversion, data transfer from the A / D converter to the memory can be started, and indefinite A / D conversion during the A / D conversion is being performed. This is because it is possible to avoid transferring data to the memory.

更に、請求項3に記載のように、上記遅延時間Tdelayは、DMAコントローラがDMA転送要求信号を受けてからメモリへのA/D変換データの転送を完了するまでのDMA転送時間Tdmaを、第1の信号エッジの発生間隔Tsから引いた時間(Ts−Tdma)よりも短いことが好ましい。   Further, as described in claim 3, the delay time Tdelay is a DMA transfer time Tdma from when the DMA controller receives the DMA transfer request signal until the transfer of A / D conversion data to the memory is completed. It is preferable that the time is less than the time (Ts−Tdma) subtracted from the generation interval Ts of one signal edge.

このような時間関係(Tad<Tdelay<Ts−Tdma)を満たしていれば、A/D変換器が次回のA/D変換を開始する前に、A/D変換器からメモリへのデータ転送を完了することができ、A/D変換データのメモリへの転送を、より確実に実施することできるからである。   If such a time relationship (Tad <Tdelay <Ts−Tdma) is satisfied, the data transfer from the A / D converter to the memory is performed before the A / D converter starts the next A / D conversion. This is because the A / D conversion data can be transferred to the memory more reliably.

次に、請求項4のA/D変換処理装置では、請求項1〜3のA/D変換処理装置において、第1の信号エッジと第2の信号エッジは、互いに反対方向のエッジである。そして、信号発生回路は、前記サンプリング間隔を周期とする所定デューティ比のハイ/ロー信号を出力する回路であると共に、その1つのハイ/ロー信号をA/D変換要求発生手段と転送要求発生手段との両方に供給する。そして更に、信号発生回路からのハイ/ロー信号の立ち上がりエッジと立ち下がりエッジとのうち、一方のエッジが第1の信号エッジとなり、他方のエッジが第2の信号エッジとなっている。尚、ハイ/ロー信号とは、矩形波信号ということである。   Next, in the A / D conversion processing device according to claim 4, in the A / D conversion processing device according to claims 1 to 3, the first signal edge and the second signal edge are edges in opposite directions. The signal generation circuit is a circuit that outputs a high / low signal having a predetermined duty ratio with the sampling interval as a cycle, and outputs the high / low signal from the A / D conversion request generation means and the transfer request generation means. And supply to both. Furthermore, one of the rising and falling edges of the high / low signal from the signal generating circuit is the first signal edge, and the other edge is the second signal edge. The high / low signal is a rectangular wave signal.

つまり、請求項4のA/D変換処理装置では、信号発生回路が出力するハイ/ロー信号に、一方のエッジが発生したタイミングでA/D変換器が起動し、他方のエッジが発生したタイミングでDMAコントローラが起動するようにしている。   That is, in the A / D conversion processing device according to claim 4, the A / D converter is activated at the timing when one edge is generated in the high / low signal output from the signal generating circuit, and the timing when the other edge is generated. In this way, the DMA controller is activated.

そして、このA/D変換処理装置によれば、信号発生回路は、1つのハイ/ロー信号を出力するだけなので、構成を簡単にすることができる。
次に、請求項5のA/D変換処理装置では、請求項4のA/D変換処理装置において、信号発生回路は、前記ハイ/ロー信号として、CPUにより設定される周期及びパルス幅のPWM信号を出力するPWM信号出力回路である。
According to this A / D conversion processing apparatus, the signal generation circuit only outputs one high / low signal, and therefore the configuration can be simplified.
Next, in the A / D conversion processing device according to claim 5, in the A / D conversion processing device according to claim 4, the signal generation circuit performs PWM with a period and a pulse width set by the CPU as the high / low signal. It is a PWM signal output circuit that outputs a signal.

この構成によれば、PWM信号の周期が第1の信号エッジの発生間隔(即ち、サンプリング間隔)となるため、そのサンプリング間隔を、CPUによりPWM信号出力回路に設定する周期の値によって任意に設定することができる。また、第1の信号エッジの発生タイミングから第2の信号エッジが発生するまでの遅延時間Tdelayを、CPUによりPWM信号出力回路に設定するパルス幅の値によって任意に設定することができる。よって、汎用性が高い。   According to this configuration, since the cycle of the PWM signal becomes the first signal edge generation interval (that is, the sampling interval), the sampling interval is arbitrarily set according to the cycle value set in the PWM signal output circuit by the CPU. can do. Further, the delay time Tdelay from the generation timing of the first signal edge to the generation of the second signal edge can be arbitrarily set by the value of the pulse width set in the PWM signal output circuit by the CPU. Therefore, versatility is high.

尚、PWM信号のエッジとしては、CPUによってPWM信号出力回路に設定される周期及びパルス幅の各値のうち、周期の値によって発生間隔が変化し、且つ、パルス幅の値によっては発生タイミングが変化しない方のエッジである周期エッジと、その周期エッジとは反対方向のエッジであって、パルス幅の値により周期エッジからの発生間隔が変化する方のデューティエッジとがある。そして、周期エッジの方を第1の信号エッジとし、デューティエッジの方を第2の信号エッジとした場合には、パルス幅の値が上記遅延時間Tdelayとなる。逆に、デューティエッジの方を第1の信号エッジとし、周期エッジの方を第2の信号エッジとした場合には、「周期−パルス幅」の値が上記遅延時間Tdelayとなる。また、デューティエッジの発生間隔も、周期エッジの発生間隔と同じであり、PWM信号出力回路に設定される周期の値によって変化するため、上記の何れの場合でも、その周期の値がサンプリング間隔となる。   As for the edge of the PWM signal, the generation interval varies depending on the period value among the period and pulse width values set in the PWM signal output circuit by the CPU, and the generation timing depends on the pulse width value. There is a periodic edge that is an edge that does not change, and a duty edge that is an edge in the opposite direction to the periodic edge and whose generation interval from the periodic edge changes depending on the value of the pulse width. When the periodic edge is the first signal edge and the duty edge is the second signal edge, the value of the pulse width is the delay time Tdelay. Conversely, when the duty edge is the first signal edge and the period edge is the second signal edge, the value of “period-pulse width” is the delay time Tdelay. Also, the generation interval of the duty edge is the same as the generation interval of the periodic edge and changes depending on the value of the period set in the PWM signal output circuit. Therefore, in any of the above cases, the value of the period is the sampling interval. Become.

次に、請求項6のA/D変換処理装置では、請求項4のA/D変換処理装置において、信号発生回路は、前記ハイ/ロー信号として、エンジンのクランク軸が所定角度回転する毎に、立ち上がりエッジと立ち下がりエッジとの一方である有効エッジが発生するクランク角信号を出力するクランク角信号出力回路である。   Next, in the A / D conversion processing device according to claim 6, in the A / D conversion processing device according to claim 4, the signal generation circuit outputs the high / low signal every time the crankshaft of the engine rotates by a predetermined angle. The crank angle signal output circuit outputs a crank angle signal at which an effective edge that is one of a rising edge and a falling edge is generated.

この構成によれば、エンジンのクランク軸が所定角度回転する毎に、A/D変換器が起動することとなる。よって、クランク軸が所定角度回転する間隔をサンプリング間隔としたい場合に有効である。   According to this configuration, every time the crankshaft of the engine rotates by a predetermined angle, the A / D converter is activated. Therefore, it is effective when the interval at which the crankshaft rotates by a predetermined angle is desired as the sampling interval.

尚、クランク角信号のエッジのうち、有効エッジの方を第1の信号エッジとし、それとは反対方向の非有効エッジを第2の信号エッジとすれば、A/D変換器を起動させる時のクランク角が明確になるため好ましいが、逆に、非有効エッジの方を第1の信号エッジとし、有効エッジの方を第2の信号エッジとすることも可能である。一般に、クランク角信号のデューティ比は変化せずにほぼ50%であるため、後者であっても、クランク軸が所定角度回転する毎にA/D変換器が起動されることに変わりはないからである。   Of the edges of the crank angle signal, if the effective edge is the first signal edge and the non-effective edge in the opposite direction is the second signal edge, the A / D converter is activated. Although it is preferable because the crank angle becomes clear, conversely, the non-effective edge can be the first signal edge, and the effective edge can be the second signal edge. In general, since the duty ratio of the crank angle signal is almost 50% without changing, the A / D converter is activated every time the crankshaft rotates by a predetermined angle even in the latter case. It is.

一方、請求項7のA/D変換処理装置は、請求項1〜3のA/D変換処理装置において、第1の信号エッジと第2の信号エッジは、互いに同じ方向のエッジである。そして、信号発生回路は、前記サンプリング間隔を周期とする所定デューティ比のハイ/ロー信号を出力する信号出力回路と、該信号出力回路から出力されるハイ/ロー信号を所定時間だけ遅延させて出力する遅延回路とからなり、前記信号出力回路からのハイ/ロー信号をA/D変換要求発生手段に供給すると共に、前記遅延回路からのハイ/ロー信号を転送要求発生手段に供給する。そして更に、前記信号出力回路から出力されるハイ/ロー信号の立ち上がりエッジと立ち下がりエッジとのうちの一方である特定方向のエッジが、第1の信号エッジとなり、前記遅延回路から出力されるハイ/ロー信号の前記特定方向のエッジが、第2の信号エッジとなっている。   On the other hand, in the A / D conversion processing device according to claim 7, in the A / D conversion processing device according to claims 1 to 3, the first signal edge and the second signal edge are edges in the same direction. The signal generation circuit outputs a high / low signal having a predetermined duty ratio with the sampling interval as a cycle, and delays the high / low signal output from the signal output circuit by a predetermined time and outputs the signal And a high / low signal from the signal output circuit to the A / D conversion request generating means, and a high / low signal from the delay circuit to the transfer request generating means. Further, an edge in a specific direction which is one of a rising edge and a falling edge of the high / low signal output from the signal output circuit becomes a first signal edge, and the high signal output from the delay circuit. / The edge in the specific direction of the low signal is the second signal edge.

つまり、請求項7のA/D変換処理装置では、信号出力回路からのハイ/ロー信号に特定方向のエッジが発生したタイミングでA/D変換器が起動し、遅延回路からのハイ/ロー信号に特定方向のエッジが発生したタイミングでDMAコントローラが起動するようにしている。   That is, in the A / D conversion processing device according to claim 7, the A / D converter is activated at the timing when the edge in the specific direction is generated in the high / low signal from the signal output circuit, and the high / low signal from the delay circuit is generated. The DMA controller is activated at the timing when an edge in a specific direction occurs.

そして、この構成によっても、請求項1〜3のA/D変換処理装置を実現することができる。また、信号出力回路が出力するハイ/ロー信号の周期によってサンプリング間隔を変えることができ、遅延回路での遅延時間(上記所定時間)によって前述の遅延時間Tdelayを変えることができる。   Also with this configuration, the A / D conversion processing device according to claims 1 to 3 can be realized. Further, the sampling interval can be changed according to the period of the high / low signal output from the signal output circuit, and the delay time Tdelay can be changed according to the delay time (the predetermined time) in the delay circuit.

第1実施形態のECU(電子制御装置)を表す構成図である。It is a block diagram showing ECU (electronic control apparatus) of 1st Embodiment. 第1実施形態のECUのマイコンにおける各部の動作を表すタイムチャートである。It is a time chart showing operation | movement of each part in the microcomputer of ECU of 1st Embodiment. PWM信号のパルス幅Tduty(=遅延時間Tdelay)を、どういう値に設定するのかを説明する説明図である。It is explanatory drawing explaining what value the pulse width Tduty (= delay time Tdelay) of a PWM signal is set to. 第2実施形態のECUを表す構成図である。It is a block diagram showing ECU of 2nd Embodiment. 第3実施形態のECUを表す構成図である。It is a block diagram showing ECU of 3rd Embodiment. 第3実施形態のECUのマイコンにおける各部の動作を表すタイムチャートである。It is a time chart showing operation of each part in a microcomputer of ECU of a 3rd embodiment. 第4実施形態のECUを表す構成図である。It is a block diagram showing ECU of 4th Embodiment.

以下に、本発明が適用された実施形態の電子制御装置について説明する。尚、本実施形態の電子制御装置は、例えば自動車のディーゼルエンジンを制御するものであるが、以下では、本発明に直接関係する部分について説明する。
[第1実施形態]
図1に示すように、第1実施形態の電子制御装置(以下、ECUという)1は、マイコン(マイクロコンピュータ)11を備えている。
Hereinafter, an electronic control device according to an embodiment to which the present invention is applied will be described. The electronic control device according to the present embodiment controls, for example, a diesel engine of an automobile, but hereinafter, a portion directly related to the present invention will be described.
[First Embodiment]
As shown in FIG. 1, the electronic control device (hereinafter referred to as ECU) 1 of the first embodiment includes a microcomputer 11.

そして、マイコン11は、プログラムが格納されたROM12と、そのROM12内のプログラムを実行することで、エンジン3を制御するための各種処理を行うCPU13と、CPU13による演算結果やCPU13がエンジン3の制御に用いるデータ等を一時的に記憶するRAM15とを備えている。   The microcomputer 11 executes the ROM 12 in which the program is stored, the CPU 13 that performs various processes for controlling the engine 3 by executing the program in the ROM 12, the calculation results by the CPU 13, and the CPU 13 controls the engine 3. And a RAM 15 for temporarily storing data and the like used for the above.

更に、マイコン11は、A/D変換器(ADC)17と、DMAコントローラ(DMAC)19と、PWM信号出力回路21と、A/D変換要求発生回路23と、DMA転送要求発生回路25とを備えている。   Further, the microcomputer 11 includes an A / D converter (ADC) 17, a DMA controller (DMAC) 19, a PWM signal output circuit 21, an A / D conversion request generation circuit 23, and a DMA transfer request generation circuit 25. I have.

A/D変換器17は、アナログ信号が入力される入力端子を複数(この例では4つ)有すると共に、A/D変換の実施を指令するA/D変換要求信号(図1におけるTrgA)を受けると、各入力端子からの複数のアナログ信号をA/D変換する。   The A / D converter 17 has a plurality of input terminals (four in this example) to which analog signals are input, and an A / D conversion request signal (TrgA in FIG. 1) for instructing execution of A / D conversion. Upon receipt, A / D conversion is performed on a plurality of analog signals from each input terminal.

尚、この例のA/D変換器17は、各入力端子のアナログ信号を順次切り替えて1つのA/D変換回路でA/D変換する多チャンネルA/D変換器であり、各入力端子はA/D変換の各チャンネルch1〜ch4になっている。また、A/D変換要求信号は、A/D変換実施のトリガであることから、以下では、そのA/D変換要求信号のことを、トリガAを意味するTrgAと言う。   The A / D converter 17 in this example is a multi-channel A / D converter that sequentially switches analog signals at each input terminal and performs A / D conversion by one A / D conversion circuit. The channels ch1 to ch4 for A / D conversion are provided. In addition, since the A / D conversion request signal is a trigger for performing A / D conversion, the A / D conversion request signal is hereinafter referred to as TrgA meaning trigger A.

DMAコントローラ19は、DMA転送を指令するDMA転送要求信号(図1におけるTrgB)を受けると、A/D変換器17のチャンネルのうち、事前にCPU13によってDMA転送の対象として設定されているチャンネル(以下、転送対象A/Dチャンネルという)のA/D変換データを、A/D変換器17からRAM15に転送(DMA転送)する。また、DMAコントローラ19は、CPU13により、A/D変換データを格納すべきRAM15の先頭アドレス(以下、格納先頭アドレスという)と、連続転送回数も、設定されるようになっている。   When the DMA controller 19 receives a DMA transfer request signal (TrgB in FIG. 1) for instructing DMA transfer, the channel (A / D converter 17 channel set by the CPU 13 in advance as a DMA transfer target ( The A / D conversion data of the transfer target A / D channel is transferred from the A / D converter 17 to the RAM 15 (DMA transfer). In the DMA controller 19, the CPU 13 is also configured to set the start address (hereinafter referred to as the storage start address) of the RAM 15 in which A / D conversion data is stored and the number of continuous transfers.

そして、DMAコントローラ19は、CPU13により、上記転送対象A/Dチャンネル、格納先頭アドレス、及び連続転送回数が設定されている状態で初期化されると、DMA転送の実施回数が連続転送回数に達するまで、DMA転送要求信号を受ける毎に、転送対象A/DチャンネルのA/D変換データをRAM15に転送すると共に、そのRAM15におけるA/D変換データの転送先アドレスを、格納先頭アドレスから1つずつ進めていく。このため、DMAコントローラ19は、DMA転送要求信号を受ける毎に、A/D変換器17における転送対象A/DチャンネルのA/D変換データを、RAM15の格納先頭アドレスから順に1つずつ格納していき、DMA転送の実施回数が連続転送回数に達したら、CPU13によって再び初期化されるまで、DMA転送の実施を停止することとなる。   When the DMA controller 19 is initialized by the CPU 13 with the transfer target A / D channel, storage head address, and continuous transfer count set, the DMA transfer execution count reaches the continuous transfer count. Until the DMA transfer request signal is received, the A / D conversion data of the transfer target A / D channel is transferred to the RAM 15, and the transfer destination address of the A / D conversion data in the RAM 15 is set to one from the storage head address. Proceed step by step. Therefore, every time the DMA controller 19 receives a DMA transfer request signal, the DMA controller 19 stores the A / D conversion data of the transfer target A / D channel in the A / D converter 17 one by one from the storage head address of the RAM 15 one by one. If the number of DMA transfer implementations reaches the number of continuous transfers, the DMA transfer implementation is stopped until the CPU 13 initializes again.

尚、CPU13が行うDMAコントローラ19の初期化とは、DMAコントローラ19にて、DMA転送の実施回数をカウントしているカウンタや、転送先アドレスの格納先頭アドレスからの進み数をカウントしているカウンタを、0にクリアするものである。一方、DMA転送要求信号は、DMA転送実施のトリガであることから、以下では、そのDMA転送要求信号のことを、トリガBを意味するTrgBと言う。   The initialization of the DMA controller 19 performed by the CPU 13 is a counter that counts the number of DMA transfers performed by the DMA controller 19 or a counter that counts the number of advances from the storage start address of the transfer destination address. Is cleared to 0. On the other hand, since the DMA transfer request signal is a trigger for implementing DMA transfer, the DMA transfer request signal is hereinafter referred to as TrgB meaning trigger B.

PWM信号出力回路21は、CPU13によってPWM信号の周期の値(周期値)とパルス幅の値(パルス幅値)とがそれぞれ書き込まれる周期値レジスタ21a及びパルス幅値レジスタ21bを備えると共に、CPU13とは並行して動作する回路である。そして、PWM信号出力回路21は、上記周期値レジスタ21aに書き込まれた値の周期を有し、且つ、上記パルス幅値レジスタ21bに書き込まれた値のパルス幅を有したPWM信号を生成して、そのPWM信号を当該マイコン11の信号出力端子J3から外部に出力する。尚、こうしたPWM信号出力回路21は、例えば前述の特許文献3に記載されており、その特許文献3では、PWM信号のパルス幅値のことを、デューティ値と称している。   The PWM signal output circuit 21 includes a period value register 21a and a pulse width value register 21b in which a period value (period value) and a pulse width value (pulse width value) of the PWM signal are written by the CPU 13, respectively. Are circuits operating in parallel. The PWM signal output circuit 21 generates a PWM signal having the period of the value written in the period value register 21a and the pulse width of the value written in the pulse width value register 21b. The PWM signal is output from the signal output terminal J3 of the microcomputer 11 to the outside. Such a PWM signal output circuit 21 is described in, for example, the above-mentioned Patent Document 3, and in Patent Document 3, the pulse width value of the PWM signal is referred to as a duty value.

また、本実施形態においては、PWM信号のエッジのうち、立ち上がりエッジが前述の周期エッジであり、立ち下がりエッジが前述のデューティエッジである。
そして、図2に示すように、本実施形態におけるPWM信号では、立ち上がりから立ち下がりまで(周期エッジからデューティエッジまで)のハイ時間が、上記パルス幅値レジスタ21bの値に該当するパルス幅Tdutyである。尚、図2において、Tpwmは、PWM信号の周期であって、周期エッジの間隔であるが、デューティエッジの間隔もTpwmと同じである。
In this embodiment, among the edges of the PWM signal, the rising edge is the above-described periodic edge, and the falling edge is the above-described duty edge.
As shown in FIG. 2, in the PWM signal in this embodiment, the high time from the rising edge to the falling edge (from the cycle edge to the duty edge) is a pulse width Tduty corresponding to the value of the pulse width value register 21b. is there. In FIG. 2, Tpwm is the period of the PWM signal and is the interval between the periodic edges, but the interval between the duty edges is also the same as Tpwm.

A/D変換要求発生回路23は、当該マイコン11の信号入力端子J1を介して入力される信号に、立ち上がりエッジと立ち下がりエッジとのうちの一方のエッジ(第1の信号エッジに相当し、本実施形態では、立ち上がりエッジ)が発生すると、A/D変換器17にTrgA(A/D変換要求信号)を与える。   The A / D conversion request generation circuit 23 adds one of a rising edge and a falling edge (corresponding to a first signal edge) to a signal input via the signal input terminal J1 of the microcomputer 11. In this embodiment, when a rising edge) occurs, TrgA (A / D conversion request signal) is given to the A / D converter 17.

また、DMA転送要求発生回路25は、当該マイコン11の信号入力端子J2を介して入力される信号に、立ち上がりエッジと立ち下がりエッジとのうちの一方のエッジ(第2の信号エッジに相当し、本実施形態では、立ち下がりエッジ)が発生すると、DMAコントローラ19にTrgB(DMA転送要求信号)を与える。   Further, the DMA transfer request generation circuit 25 corresponds to one of the rising edge and the falling edge (corresponding to the second signal edge) to the signal input via the signal input terminal J2 of the microcomputer 11. In this embodiment, when a falling edge occurs, TrgB (DMA transfer request signal) is given to the DMA controller 19.

尚、このようなA/D変換要求発生回路23とDMA転送要求発生回路25は、一般には、マイコンにおいて、フリーランタイマ回路や、タイマ割込を発生させるための回路や、インプットキャプチャ機能の回路等を有したブロックであるタイマユニット内に設けられているものである。   Such an A / D conversion request generation circuit 23 and a DMA transfer request generation circuit 25 generally include a free-run timer circuit, a circuit for generating a timer interrupt, and a circuit for an input capture function in a microcomputer. Etc. are provided in a timer unit which is a block having.

そして、上記2つの信号入力端子J1,J2は、当該マイコン11の外部の配線により、上記信号出力端子J3と共通接続されている。このため、A/D変換要求発生回路23とDMA転送要求発生回路25との両方には、PWM信号出力回路21からのPWM信号が当該マイコン11の外部の配線を介して入力される。   The two signal input terminals J1 and J2 are connected in common with the signal output terminal J3 by wiring outside the microcomputer 11. For this reason, the PWM signal from the PWM signal output circuit 21 is input to both the A / D conversion request generation circuit 23 and the DMA transfer request generation circuit 25 via the wiring outside the microcomputer 11.

よって、A/D変換要求発生回路23は、PWM信号出力回路21からのPWM信号に、立ち上がりエッジである周期エッジが生じると、A/D変換器17にTrgAを出力し、DMA転送要求発生回路25は、PWM信号出力回路21からのPWM信号に、立ち下がりエッジであるデューティエッジが生じると、DMAコントローラ19にTrgBを出力することとなる。   Therefore, the A / D conversion request generation circuit 23 outputs TrgA to the A / D converter 17 when a periodic edge which is a rising edge occurs in the PWM signal from the PWM signal output circuit 21, and the DMA transfer request generation circuit When a duty edge that is a falling edge occurs in the PWM signal from the PWM signal output circuit 21, TrgB 25 is output to the DMA controller 19.

一方、図1に示すように、ECU1の制御対象であるエンジン3では、そのエンジン3の各気筒(本実施形態では4気筒の各々)へコモンレール(図示省略)からの燃料を噴射する各インジェクタIJ1〜IJ4に、そのインジェクタIJ1〜IJ4内の燃料圧(以下、インジェクタ圧という)を検出する圧力センサS1〜S4が設けられている。   On the other hand, as shown in FIG. 1, in the engine 3 that is the control target of the ECU 1, each injector IJ <b> 1 that injects fuel from a common rail (not shown) to each cylinder (four cylinders in this embodiment) of the engine 3. ˜IJ4 are provided with pressure sensors S1 to S4 for detecting fuel pressure in the injectors IJ1 to IJ4 (hereinafter referred to as injector pressure).

そして、その各圧力センサS1〜S4から出力されるアナログ信号であるインジェクタ圧信号P1〜P4が、ECU1に設けられた入力回路5を介して、マイコン11内におけるA/D変換器17の各チャンネル(各入力端子)ch1〜ch4に入力されるようになっている。   The injector pressure signals P1 to P4, which are analog signals output from the pressure sensors S1 to S4, are input to the channels of the A / D converter 17 in the microcomputer 11 via the input circuit 5 provided in the ECU 1. (Each input terminal) It inputs into ch1-ch4.

また、エンジン3には、当該エンジン3のクランク軸が所定角度(例えば10°)回転する毎にパルスを出力する周知のクランク角センサ7が設けられている。
そして、そのクランク角センサ7からのパルス信号は、ECU1に設けられた波形整形回路9でハイ/ロー信号へと波形整形されることにより、クランク軸が上記所定角度回転する毎に立ち上がりエッジと立ち下がりエッジとのうちの一方である有効エッジ(本実施形態では、立ち上がりエッジ)が発生するクランク角信号となる。更に、その波形整形回路9からのクランク角信号が、マイコン11に入力されるようになっている。尚、マイコン11では、クランク角信号に基づいて、クランク軸の回転位置や回転速度(即ちエンジン回転数)を検出する。また、一般的なことであるが、クランク角信号のデューティ比は50%である。
The engine 3 is provided with a known crank angle sensor 7 that outputs a pulse each time the crankshaft of the engine 3 rotates by a predetermined angle (for example, 10 °).
The pulse signal from the crank angle sensor 7 is shaped into a high / low signal by the waveform shaping circuit 9 provided in the ECU 1, so that the rising edge rises and falls every time the crankshaft rotates by the predetermined angle. This is a crank angle signal in which an effective edge (rising edge in this embodiment) that is one of the falling edges is generated. Further, the crank angle signal from the waveform shaping circuit 9 is input to the microcomputer 11. The microcomputer 11 detects the rotational position and rotational speed of the crankshaft (that is, the engine speed) based on the crank angle signal. Moreover, as a general matter, the duty ratio of the crank angle signal is 50%.

次に、マイコン11における各部の動作等について説明する。
図2に示すように、マイコン11では、PWM信号出力回路21が、CPU13によって設定された周期Tpwm及びパルス幅TdutyのPWM信号を出力する。
Next, the operation of each part in the microcomputer 11 will be described.
As shown in FIG. 2, in the microcomputer 11, the PWM signal output circuit 21 outputs a PWM signal having a cycle Tpwm and a pulse width Tduty set by the CPU 13.

そして、そのPWM信号に周期エッジ(立ち上がりエッジ)が生じる毎に、A/D変換要求発生回路23からA/D変換器17へTrgAが出力されて、A/D変換器17が起動する。すると、A/D変換器17は、各チャンネルch1〜ch4のアナログ信号(即ち、各気筒のインジェクタ圧信号P1〜P4)を順次(本実施形態ではチャンネル番号が小さいものから順に)A/D変換する。   Every time a periodic edge (rising edge) occurs in the PWM signal, TrgA is output from the A / D conversion request generation circuit 23 to the A / D converter 17 and the A / D converter 17 is activated. Then, the A / D converter 17 sequentially converts the analog signals of the channels ch1 to ch4 (that is, the injector pressure signals P1 to P4 of each cylinder) in order (in order of increasing channel numbers in this embodiment). To do.

また、PWM信号にデューティエッジ(立ち下がりエッジ)が生じる毎に、DMA転送要求発生回路25からDMAコントローラ19へTrgBが出力されて、DMAコントローラ19が起動する。すると、前述したように、DMAコントローラ19は、CPU13によって設定されている転送対象A/DチャンネルのA/D変換データを、A/D変換器17からRAM15に転送(DMA転送)する。   Further, every time a duty edge (falling edge) occurs in the PWM signal, TrgB is output from the DMA transfer request generation circuit 25 to the DMA controller 19 and the DMA controller 19 is activated. Then, as described above, the DMA controller 19 transfers the A / D conversion data of the transfer target A / D channel set by the CPU 13 from the A / D converter 17 to the RAM 15 (DMA transfer).

このため、PWM信号の周期エッジの発生タイミングで、A/D変換器17が起動されて、インジェクタ圧信号P1〜P4がA/D変換され、PWM信号のデューティエッジの発生タイミング(即ち、周期エッジからパルス幅Tdutyだけ遅れたタイミング)で、DMAコントローラ19が起動されて、転送対象A/DチャンネルのA/D変換データがA/D変換器17からRAM15に転送される、という動作が繰り返されることとなる。   Therefore, the A / D converter 17 is activated at the generation timing of the periodic edge of the PWM signal, the injector pressure signals P1 to P4 are A / D converted, and the generation timing of the duty edge of the PWM signal (that is, the periodic edge) At a timing delayed by the pulse width Tduty), the DMA controller 19 is activated, and the A / D conversion data of the transfer target A / D channel is transferred from the A / D converter 17 to the RAM 15. It will be.

そして、PWM信号の周期Tpwmが、インジェクタ圧信号P1〜P4のサンプリング間隔(A/D変換間隔であり、サンプリング周期でもある)Tsとなる。また、PWM信号のパルス幅Tdutyは、周期エッジ及びTrgAが発生してからデューティエッジ及びTrgBが発生するまでの遅延時間Tdelayであり、A/D変換器17を起動してからA/D変換データのRAM15へのDMA転送を開始するまでの遅延時間Tdelayでもある。   The period Tpwm of the PWM signal is the sampling interval (A / D conversion interval, which is also the sampling period) Ts of the injector pressure signals P1 to P4. The pulse width Tduty of the PWM signal is a delay time Tdelay from the generation of the periodic edge and TrgA to the generation of the duty edge and TrgB, and the A / D conversion data after the A / D converter 17 is activated. This is also the delay time Tdelay until the DMA transfer to the RAM 15 starts.

以上のことから、本実施形態において、PWM信号の周期Tpwmは、インジェクタ圧信号P1〜P4をサンプリングすべき間隔(例えば20μs)に設定している。
また、PWM信号のパルス幅Tdutyは、「A/D変換器17でのA/D変換データが確定してからDMAコントローラ19がDMA転送を開始し、且つ、次回のA/D変換が開始されるまでにDMAコントローラ19がDMA転送を完了する」という動作条件を満たすことが可能な時間に設定している。このように設定するのは、A/D変換データのRAM15への格納を確実に行えるようにするためである。
From the above, in this embodiment, the period Tpwm of the PWM signal is set to an interval (for example, 20 μs) at which the injector pressure signals P1 to P4 should be sampled.
Also, the pulse width Tduty of the PWM signal is “the DMA controller 19 starts DMA transfer after the A / D conversion data in the A / D converter 17 is confirmed, and the next A / D conversion is started. Is set to a time during which the operation condition “DMA controller 19 completes DMA transfer by the time when it is completed” can be satisfied. The reason for setting in this way is to ensure that the A / D conversion data can be stored in the RAM 15.

そこで次に、上記動作条件を満たすために、PWM信号のパルス幅Tduty(=上記遅延時間Tdelay)を、どういう値に設定するかについて、図3に基づき更に詳しく説明する。尚、以下の図3に基づく説明では、PWM信号のパルス幅Tdutyを、遅延時間Tdelayと称し、PWM信号の周期Tpwmを、サンプリング間隔Tsと称する。   Then, in order to satisfy the above operating conditions, what value the pulse width Tduty (= the delay time Tdelay) of the PWM signal is set will be described in more detail with reference to FIG. In the following description based on FIG. 3, the pulse width Tduty of the PWM signal is referred to as a delay time Tdelay, and the period Tpwm of the PWM signal is referred to as a sampling interval Ts.

図3において、「Ts」は、インジェクタ圧信号P1〜P4のサンプリング間隔(=Tpwm)である。また、「Tad」は、A/D変換器17がTrgAを受けてからA/D変換を完了するまで(A/D変換データが確定するまで)のA/D変換時間であり、「Tdma」は、DMAコントローラ19がTrgBを受けてからRAM15へのA/D変換データの転送を完了するまでのDMA転送時間である。   In FIG. 3, “Ts” is a sampling interval (= Tpwm) of the injector pressure signals P1 to P4. “Tad” is an A / D conversion time from when the A / D converter 17 receives TrgA until A / D conversion is completed (until A / D conversion data is determined), and “Tdma”. Is the DMA transfer time from when the DMA controller 19 receives TrgB to when the transfer of A / D conversion data to the RAM 15 is completed.

そして、本実施形態では、上記動作条件を満たすために、遅延時間Tdelay(=Tduty)を、「Tad<Tdelay<Ts−Tdma」の大小関係を満たす値に設定している。つまり、遅延時間Tdelayは、A/D変換時間Tadよりも長く、且つ、サンプリング間隔TsからDMA転送時間Tdmaを引いた時間(=Ts−Tdma)よりも短い時間に設定している。   In the present embodiment, in order to satisfy the above operating conditions, the delay time Tdelay (= Tduty) is set to a value satisfying the magnitude relationship of “Tad <Tdelay <Ts−Tdma”. That is, the delay time Tdelay is set to be longer than the A / D conversion time Tad and shorter than the time obtained by subtracting the DMA transfer time Tdma from the sampling interval Ts (= Ts−Tdma).

また、このことは、遅延時間TdelayからA/D変換時間Tadを引いた時間(=Tdelay−Tad)を「T1」とすると、そのT1が「0<T1<Ts−Tad−Tdma」の大小関係を満たすように、遅延時間Tdelayを設定している、ということと同じ意味であるが、特に、T1が「(Ts−Tad−Tdma)÷2」の値となるように、遅延時間Tdelayを設定すれば、A/D変換の完了時からDMA転送の開始時(TrgBの発生時)までの余裕時間と、DMA転送の完了時から次のA/D変換の開始時(次のTrgAの発生時)までの余裕時間とが等しくなり、最も信頼性の高い動作が期待できる。   In addition, this means that when the time obtained by subtracting the A / D conversion time Tad from the delay time Tdelay (= Tdelay−Tad) is “T1”, the T1 is “0 <T1 <Ts−Tad−Tdma”. The delay time Tdelay is set so as to satisfy the condition, but in particular, the delay time Tdelay is set so that T1 becomes a value of “(Ts−Tad−Tdma) / 2”. In this case, a margin time from the completion of A / D conversion to the start of DMA transfer (when TrgB occurs) and the start of the next A / D conversion from the completion of DMA transfer (when the next TrgA occurs) ), And the most reliable operation can be expected.

尚、A/D変換器17がA/D変換を開始してから該A/D変換器17内のA/D変換データが変化するまでの最小時間よりも、DMA転送時間Tdmaの方が短いのであれば、遅延時間Tdelayは、最低でも「Tad<Tdelay<Ts」の大小関係を満たしていれば良い。この関係を満たしていさえすれば、A/D変換器17がA/D変換を完了してから次回のA/D変換を開始する前に、DMAコントローラ19がA/D変換データのDMA転送を開始することができるからである。   The DMA transfer time Tdma is shorter than the minimum time from when the A / D converter 17 starts A / D conversion until the A / D conversion data in the A / D converter 17 changes. In this case, it is sufficient that the delay time Tdelay satisfies the relationship of “Tad <Tdelay <Ts” at the minimum. As long as this relationship is satisfied, the DMA controller 19 performs the DMA transfer of the A / D conversion data before the next A / D conversion is started after the A / D converter 17 completes the A / D conversion. Because it can start.

一方、CPU13は、各気筒の燃料噴射タイミングを含む所定クランク角度分(例えば120°CA分)の処理対象期間が始まるタイミング毎に、DMAコントローラ19に設定する転送対象A/Dチャンネルを、今回の処理対象期間中に燃料噴射タイミングが到来する気筒のインジェクタ圧信号P1〜P4が入力されているチャンネルに切り替える(再設定する)と共に、DMAコントローラ19を初期化する。   On the other hand, the CPU 13 sets the transfer target A / D channel to be set in the DMA controller 19 at this time every time the processing target period for a predetermined crank angle (for example, 120 ° CA) including the fuel injection timing of each cylinder starts. The DMA controller 19 is initialized while being switched (reset) to a channel in which the injector pressure signals P1 to P4 of the cylinder at which the fuel injection timing arrives during the processing target period.

尚、CAは、エンジン3のクランク軸の回転角度(クランク角)を意味する慣用語である。また、本実施形態において、CPU13は、格納先頭アドレスと連続転送回数については、例えば、動作開始直後の処理でDMAコントローラ19に初期値を設定して、その後は変更しないが、格納先頭アドレスと連続転送回数との両方又は一方についても、処理対象期間毎に異なる値へと再設定しても良い。   CA is an idiomatic term meaning the rotation angle (crank angle) of the crankshaft of the engine 3. In the present embodiment, the CPU 13 sets the initial values for the storage head address and the number of continuous transfers, for example, in the DMA controller 19 in the process immediately after the start of the operation, and does not change thereafter, but continues with the storage head address. Both or one of the transfer counts may be reset to a different value for each processing target period.

このため、気筒毎の処理対象期間のうち、例えば、第3気筒の燃料噴射タイミングを含む処理対象期間においては、図2に示すように、A/D変換器17のチャンネルch1〜ch4のうち、第3気筒のインジェクタ圧信号P3が入力されるチャンネルch3が、転送対象A/Dチャンネルとして設定される。そして、DMAコントローラ19は、TrgBを受ける毎に、チャンネルch3のA/D変換データ(即ち、第3気筒のインジェクタ圧信号P3のA/D変換データ)をRAM15にDMA転送することとなる。   Therefore, in the processing target period for each cylinder, for example, in the processing target period including the fuel injection timing of the third cylinder, as shown in FIG. 2, among the channels ch1 to ch4 of the A / D converter 17, The channel ch3 to which the injector pressure signal P3 for the third cylinder is input is set as the transfer target A / D channel. The DMA controller 19 DMA-transfers the A / D conversion data of the channel ch3 (that is, the A / D conversion data of the injector pressure signal P3 of the third cylinder) to the RAM 15 every time TrgB is received.

このように、本実施形態では、燃料噴射が行われる噴射対象気筒のインジェクタ圧信号のA/D変換データを、A/D変換間隔と同じ間隔でRAM15にDMA転送している。
そして、CPU13は、処理対象期間が終了する毎に、RAM15に記憶されているA/D変換データを解析する(例えば積分する)ことで、実際の燃料噴射量を計算し、エンジン3への燃料噴射量を高精度に制御する。例えば、実際の燃料噴射量の計算結果に応じて、その後の燃料噴射量を補正したりする。
Thus, in this embodiment, the A / D conversion data of the injector pressure signal of the injection target cylinder where fuel injection is performed is DMA-transferred to the RAM 15 at the same interval as the A / D conversion interval.
Then, every time the processing target period ends, the CPU 13 analyzes (for example, integrates) the A / D conversion data stored in the RAM 15 to calculate the actual fuel injection amount, and the fuel to the engine 3 is calculated. The injection amount is controlled with high accuracy. For example, the subsequent fuel injection amount is corrected according to the calculation result of the actual fuel injection amount.

以上のような第1実施形態のECU1によれば、マイコン11において、PWM信号出力回路21からのPWM信号に周期エッジが発生する毎に、TrgAが発生してA/D変換器17が起動することにより、インジェクタ圧信号P1〜P4のA/D変換が行われ、PWM信号にデューティエッジが発生する毎に、TrgBが発生してDMAコントローラ19が起動することにより、A/D変換器17からRAM15へのA/D変換データのDMA転送が行われる。   According to the ECU 1 of the first embodiment as described above, every time a periodic edge occurs in the PWM signal from the PWM signal output circuit 21 in the microcomputer 11, TrgA is generated and the A / D converter 17 is activated. As a result, the A / D conversion of the injector pressure signals P1 to P4 is performed, and whenever the duty edge is generated in the PWM signal, TrgB is generated and the DMA controller 19 is started, whereby the A / D converter 17 DMA transfer of A / D conversion data to the RAM 15 is performed.

そして、こうしたA/D変換と、A/D変換データのRAM15への転送という一連の動作が、CPU13の処理とは別に実施される。しかも、A/D変換の完了に連動してA/D変換データをRAM15に転送する専用のハードウェアも必要ない。   A series of operations such as A / D conversion and transfer of A / D conversion data to the RAM 15 are performed separately from the processing of the CPU 13. In addition, dedicated hardware for transferring A / D conversion data to the RAM 15 in conjunction with completion of A / D conversion is not required.

よって、本願の課題を解決することができる。即ち、所定のサンプリング間隔でインジェクタ圧信号をA/D変換してA/D変換データをRAM15に格納することを、CPU13の処理負荷を増加させずに、且つ、A/D変換の完了に連動してA/D変換データをRAM15に転送する専用のハードウェアを設けることなく、実現することができる。   Therefore, the subject of this application can be solved. That is, A / D conversion of the injector pressure signal at a predetermined sampling interval and storing the A / D conversion data in the RAM 15 are linked to completion of the A / D conversion without increasing the processing load on the CPU 13. This can be realized without providing dedicated hardware for transferring the A / D conversion data to the RAM 15.

また、PWM信号出力回路21が1つのPWM信号を出力するだけで済むことと、そのPWM信号出力回路21は、元々マイコン11に備えられている回路であるため、装置構成の大型化を招くことはない。   In addition, the PWM signal output circuit 21 only needs to output one PWM signal, and the PWM signal output circuit 21 is a circuit originally provided in the microcomputer 11, which increases the size of the apparatus configuration. There is no.

更に、CPU13によりPWM信号出力回路21に設定する周期値によって、サンプリング間隔(A/D変換間隔)を任意に設定することができ、また、CPU13によりPWM信号出力回路21に設定するパルス幅値によって、前述の遅延時間Tdelayを任意に設定することができるため、汎用性が非常に高い。   Further, the sampling interval (A / D conversion interval) can be arbitrarily set by the period value set in the PWM signal output circuit 21 by the CPU 13, and the pulse width value set in the PWM signal output circuit 21 by the CPU 13 can be set. Since the delay time Tdelay can be arbitrarily set, the versatility is very high.

尚、本実施形態では、図4のマイコン11におけるCPU13及びROM12以外の部分が、A/D変換処理装置に相当している。そして、RAM15がメモリに相当し、A/D変換要求発生回路23がA/D変換要求発生手段に相当し、DMA転送要求発生回路25が転送要求発生手段に相当し、PWM信号出力回路21が信号発生回路に相当している。   In this embodiment, the part other than the CPU 13 and the ROM 12 in the microcomputer 11 in FIG. 4 corresponds to an A / D conversion processing device. The RAM 15 corresponds to a memory, the A / D conversion request generation circuit 23 corresponds to an A / D conversion request generation means, the DMA transfer request generation circuit 25 corresponds to a transfer request generation means, and the PWM signal output circuit 21 This corresponds to a signal generation circuit.

一方、上記実施形態では、PWM信号のエッジのうち、周期エッジの方を第1の信号エッジ(即ち、A/D変換要求発生回路23がTrgAを発生させる方のエッジ)とし、デューティエッジの方を第2の信号エッジ(即ち、DMA転送要求発生回路25がTrgBを発生させる方のエッジ)としたが、逆に、デューティエッジの方を第1の信号エッジとし、周期エッジの方を第2の信号エッジとしても良い。その場合、「周期Tpwm−パルス幅Tduty」の値が、TrgAが発生してからTrgBが発生するまでの遅延時間Tdelayとなり、その遅延時間Tdelayが前述の大小関係を満たすように、PWM信号のパルス幅Tdutyを設定すれば良い。   On the other hand, in the above embodiment, among the edges of the PWM signal, the periodic edge is the first signal edge (that is, the edge on which the A / D conversion request generation circuit 23 generates TrgA), and the duty edge is Is the second signal edge (that is, the edge on which the DMA transfer request generation circuit 25 generates TrgB). Conversely, the duty edge is the first signal edge, and the periodic edge is the second edge. The signal edge may be used. In that case, the value of “period Tpwm−pulse width Tduty” becomes a delay time Tdelay from the occurrence of TrgA to the occurrence of TrgB, and the pulse of the PWM signal so that the delay time Tdelay satisfies the above magnitude relationship. The width Tduty may be set.

また、第1の信号エッジが立ち下がりエッジで、第2の信号エッジが立ち上がりエッジであっても良い。また、PWM信号の周期エッジが立ち下がりエッジで、デューティエッジが立ち上がりエッジであっても良い。   Further, the first signal edge may be a falling edge and the second signal edge may be a rising edge. Further, the periodic edge of the PWM signal may be a falling edge and the duty edge may be a rising edge.

また、汎用性は劣るものの、PWM信号出力回路21の代わりに、固定デューティ比のハイ/ロー信号を出力するクロック発生回路を用いることも可能である。
[第2実施形態]
図4に示す第2実施形態のECU31は、第1実施形態と比較すると、以下の点が異なっている。
Although not versatile, a clock generation circuit that outputs a high / low signal with a fixed duty ratio can be used instead of the PWM signal output circuit 21.
[Second Embodiment]
The ECU 31 of the second embodiment shown in FIG. 4 differs from the first embodiment in the following points.

即ち、マイコン11内のA/D変換要求発生回路23とDMA転送要求発生回路25との両方には、2つの信号入力端子J1,J2介して、PWM信号ではなく、波形整形回路9からのクランク角信号が入力されるようになっている。尚、本第2実施形態のマイコン11には、PWM信号出力回路21が備えられていても、備えられていなくても、どちらでも良い。   That is, both the A / D conversion request generation circuit 23 and the DMA transfer request generation circuit 25 in the microcomputer 11 are connected to the crank signal from the waveform shaping circuit 9 instead of the PWM signal via the two signal input terminals J1 and J2. An angular signal is input. Note that the microcomputer 11 according to the second embodiment may or may not include the PWM signal output circuit 21.

よって、第2実施形態のECU31では、図2における「PWM信号」を、「クランク角信号」に置き換えた動作が行われることとなる。
つまり、クランク角信号の有効エッジ(立ち上がりエッジ)の発生タイミングで、A/D変換器17が起動されて、インジェクタ圧信号P1〜P4がA/D変換され、クランク角信号の非有効エッジ(立ち下がりエッジ)の発生タイミングで、DMAコントローラ19が起動されて、転送対象A/DチャンネルのA/D変換データがA/D変換器17からRAM15に転送される、という動作が繰り返される。そして、クランク角信号の周期が、インジェクタ圧信号P1〜P4のサンプリング間隔(A/D変換間隔)Tsとなる。
Therefore, the ECU 31 of the second embodiment performs an operation in which the “PWM signal” in FIG. 2 is replaced with the “crank angle signal”.
That is, the A / D converter 17 is activated at the timing of occurrence of the valid edge (rising edge) of the crank angle signal, the injector pressure signals P1 to P4 are A / D converted, and the ineffective edge (rising edge) of the crank angle signal is generated. The DMA controller 19 is activated at the occurrence timing of the falling edge), and the operation of transferring the A / D conversion data of the transfer target A / D channel from the A / D converter 17 to the RAM 15 is repeated. The cycle of the crank angle signal becomes the sampling interval (A / D conversion interval) Ts of the injector pressure signals P1 to P4.

このような第2実施形態によっても、第1実施形態と同様に、本願の課題を解決することができる。また特に、エンジン3のクランク軸が所定角度(本実施形態では10°)回転する間隔をサンプリング間隔としたい場合に有効である。   According to such a second embodiment, the problem of the present application can be solved as in the first embodiment. In particular, it is effective when the interval at which the crankshaft of the engine 3 rotates by a predetermined angle (10 ° in this embodiment) is set as the sampling interval.

ところで、クランク角信号のデューティ比は、PWM信号出力回路21からのPWM信号とは違って固定であり、一般には50%であるが、支障はない。
なぜなら、例えばエンジン回転数が非常に高い6000rpmの場合であっても、クランク角信号の1周期(=Ts)である10°CA分の時間は、約280μsになり、図3における遅延時間Tdelay(即ち、クランク角信号の有効エッジから非有効エッジまでのハイ時間)は、約140μsになる。そして、図3におけるA/D変換時間TadとDMA転送時間Tdmaとの各々は、一般には数μsである。よって、クランク角信号のデューティ比が50%であっても、前述した「Tad<Tdelay<Ts−Tdma」の大小関係を十分満たすことができる。また、更に条件を厳しくして、クランク角信号の1周期が1°CA分の時間であり、「Ts=28μs、Tdelay=14μs」であったとしても、TadとTdmaとが数μsであれば、上記大小関係を満たすことができる。
Incidentally, the duty ratio of the crank angle signal is fixed unlike the PWM signal from the PWM signal output circuit 21 and is generally 50%, but there is no problem.
For example, even when the engine speed is 6000 rpm, the time for 10 ° CA, which is one cycle (= Ts) of the crank angle signal, is about 280 μs, and the delay time Tdelay ( That is, the high time from the effective edge to the non-effective edge of the crank angle signal is about 140 μs. Each of the A / D conversion time Tad and the DMA transfer time Tdma in FIG. 3 is generally several μs. Therefore, even when the duty ratio of the crank angle signal is 50%, the above-described magnitude relationship of “Tad <Tdelay <Ts−Tdma” can be sufficiently satisfied. Further, even if the conditions are further strict, even if one cycle of the crank angle signal is a time of 1 ° CA and “Ts = 28 μs, Tdelay = 14 μs”, if Tad and Tdma are several μs, The above-mentioned magnitude relationship can be satisfied.

一方、上記実施形態では、クランク角信号のエッジのうち、有効エッジの方を第1の信号エッジ(即ち、A/D変換要求発生回路23がTrgAを発生させる方のエッジ)とし、非有効エッジの方を第2の信号エッジ(即ち、DMA転送要求発生回路25がTrgBを発生させる方のエッジ)としたが、逆に、非有効エッジの方を第1の信号エッジとし、有効エッジの方を第2の信号エッジとしても良い。   On the other hand, in the above-described embodiment, the effective edge of the crank angle signal edges is the first signal edge (that is, the edge on which the A / D conversion request generation circuit 23 generates TrgA), and the ineffective edge. Is the second signal edge (that is, the edge on which the DMA transfer request generation circuit 25 generates TrgB), but the non-effective edge is the first signal edge and the effective edge is May be the second signal edge.

また、第1実施形態の変形例としても述べたが、第1の信号エッジが立ち下がりエッジで、第2の信号エッジが立ち上がりエッジであっても良い。また、クランク角信号の有効エッジが立ち下がりエッジで、非有効エッジが立ち上がりエッジであっても良い。   Although described as a modification of the first embodiment, the first signal edge may be a falling edge and the second signal edge may be a rising edge. The effective edge of the crank angle signal may be a falling edge, and the ineffective edge may be a rising edge.

尚、本第2実施形態では、波形整形回路9が、信号出力回路及びクランク角信号出力回路に相当している。
また、エンジン制御用のECUでは、波形整形回路9によって波形整形された後のクランク角信号から、上記所定角度(10°)よりも更に小さい一定のクランク角(例えば1°CA)毎に有効エッジが発生するクランク角信号を生成して出力するクランク角信号処理回路が設けられる場合がある。そこで、そのようなクランク角信号処理回路からのクランク角信号が、A/D変換要求発生回路23とDMA転送要求発生回路25との両方に入力されるように構成しても良い。この場合、そのクランク角信号処理回路が、信号出力回路及びクランク角信号出力回路に相当することとなる。
[第3実施形態]
図5に示す第3実施形態のECU33は、第1実施形態と比較すると、下記(1)及び(2)の点が異なっている。
In the second embodiment, the waveform shaping circuit 9 corresponds to a signal output circuit and a crank angle signal output circuit.
Further, in the engine control ECU, an effective edge is obtained for each constant crank angle (for example, 1 ° CA) smaller than the predetermined angle (10 °) from the crank angle signal after waveform shaping by the waveform shaping circuit 9. There is a case where a crank angle signal processing circuit for generating and outputting a crank angle signal for generating the. Therefore, the crank angle signal from such a crank angle signal processing circuit may be input to both the A / D conversion request generation circuit 23 and the DMA transfer request generation circuit 25. In this case, the crank angle signal processing circuit corresponds to a signal output circuit and a crank angle signal output circuit.
[Third Embodiment]
The ECU 33 of the third embodiment shown in FIG. 5 differs from the first embodiment in the following points (1) and (2).

(1)DMA転送要求発生回路25は、信号入力端子J2を介して入力される信号に立ち上がりエッジが発生すると、DMAコントローラ19にTrgBを与える。つまり、TrgBを発生させる第2の信号エッジが、TrgAを発生させる第1の信号エッジと同じ方向のエッジになっている。   (1) The DMA transfer request generation circuit 25 gives TrgB to the DMA controller 19 when a rising edge occurs in the signal input via the signal input terminal J2. That is, the second signal edge that generates TrgB is an edge in the same direction as the first signal edge that generates TrgA.

(2)ECU33において、マイコン11の外部に遅延回路27が備えられており、その遅延回路27には、PWM信号出力回路21から信号出力端子J3を経由してマイコン11の外部に出力されるPWM信号が入力される。そして、遅延回路27は、そのPWM信号出力回路21からのPWM信号を所定時間だけ遅延させて、マイコン11の信号入力端子J2に出力する。   (2) In the ECU 33, a delay circuit 27 is provided outside the microcomputer 11, and the delay circuit 27 outputs a PWM output from the PWM signal output circuit 21 to the outside of the microcomputer 11 via the signal output terminal J3. A signal is input. The delay circuit 27 delays the PWM signal from the PWM signal output circuit 21 by a predetermined time and outputs the delayed signal to the signal input terminal J2 of the microcomputer 11.

このため、A/D変換要求発生回路23には、PWM信号出力回路21からのPWM信号(以下の本第3実施形態の説明において、信号Aという)がそのまま入力されるが、DMA転送要求発生回路25には、遅延回路27からのPWM信号であって、信号Aを所定時間だけ遅延させたPWM信号(以下の本第3実施形態の説明において、信号Bという)が入力される。   For this reason, the PWM signal from the PWM signal output circuit 21 (referred to as signal A in the following description of the third embodiment) is directly input to the A / D conversion request generation circuit 23, but a DMA transfer request is generated. The circuit 25 is supplied with a PWM signal from the delay circuit 27, which is obtained by delaying the signal A by a predetermined time (referred to as signal B in the following description of the third embodiment).

このような第3実施形態のECU33では、図6に示すように、信号Aの立ち上がりエッジの発生タイミングで、A/D変換器17が起動されて、インジェクタ圧信号P1〜P4がA/D変換され、信号Bの立ち上がりエッジの発生タイミングで、DMAコントローラ19が起動されて、転送対象A/DチャンネルのA/D変換データがA/D変換器17からRAM15に転送される、という動作が繰り返される。   In the ECU 33 of the third embodiment, as shown in FIG. 6, the A / D converter 17 is activated at the timing of the rising edge of the signal A, and the injector pressure signals P1 to P4 are A / D converted. Then, the DMA controller 19 is activated at the timing of occurrence of the rising edge of the signal B, and the operation in which the A / D conversion data of the transfer target A / D channel is transferred from the A / D converter 17 to the RAM 15 is repeated. It is.

そして、本第3実施形態では、遅延回路27が信号Aを遅延させる上記所定時間であって、図6におけるTdelayが、図3における遅延時間Tdelayに該当し、その図6におけるTdelayは、前述した「Tad<Tdelay<Ts−Tdma」の大小関係を満たす値に設定されている。尚、本第3実施形態においても、信号A(PWM信号)の周期が、インジェクタ圧信号P1〜P4のサンプリング間隔Tsとなる。   In the third embodiment, the delay circuit 27 delays the signal A, and the delay time Tdelay in FIG. 6 corresponds to the delay time Tdelay in FIG. 3. The delay time Tdelay in FIG. It is set to a value satisfying the magnitude relationship of “Tad <Tdelay <Ts−Tdma”. In the third embodiment, the period of the signal A (PWM signal) is the sampling interval Ts of the injector pressure signals P1 to P4.

このような第3実施形態によっても、第1実施形態と同様に、本願の課題を解決することができる。また、PWM信号出力回路21の代わりに、固定デューティ比のハイ/ロー信号を出力するクロック発生回路を用いても、遅延回路27での遅延時間によって、TrgAからTrgBまでの上記遅延時間Tdelayを調節することができる。   According to the third embodiment, the problem of the present application can be solved as in the first embodiment. Even if a clock generation circuit that outputs a high / low signal with a fixed duty ratio is used instead of the PWM signal output circuit 21, the delay time Tdelay from TrgA to TrgB is adjusted by the delay time in the delay circuit 27. can do.

尚、本実施形態では、PWM信号出力回路21と遅延回路27とが、信号出力回路に相当している。そして、信号A,Bの立ち上がりエッジが、請求項7記載の特定方向のエッジに相当している。   In the present embodiment, the PWM signal output circuit 21 and the delay circuit 27 correspond to a signal output circuit. The rising edges of the signals A and B correspond to edges in a specific direction according to claim 7.

一方、TrgAを発生させる第1の信号エッジと、TrgBを発生させる第2の信号エッジは、両方ともに立ち下がりエッジであっても良い。その場合、信号Aの立ち下がりエッジの発生タイミングでA/D変換器17が起動し、信号Bの立ち下がりエッジの発生タイミングでDMAコントローラ19が起動することとなる。
[第4実施形態]
図7に示す第4実施形態のECU35は、第3実施形態と比較すると、以下の点が異なっている。
On the other hand, both the first signal edge for generating TrgA and the second signal edge for generating TrgB may be falling edges. In this case, the A / D converter 17 is activated at the occurrence timing of the falling edge of the signal A, and the DMA controller 19 is activated at the occurrence timing of the falling edge of the signal B.
[Fourth Embodiment]
The ECU 35 of the fourth embodiment shown in FIG. 7 differs from the third embodiment in the following points.

即ち、PWM信号出力回路21から信号出力端子J3を経由してマイコン11の外部に出力されるPWM信号が、マイコン11の信号入力端子J2にそのまま入力され、マイコン11内において、信号入力端子J2から入力されるPWM信号が、遅延回路29で所定時間だけ遅延されて、DMA転送要求発生回路25に入力される。   That is, the PWM signal output from the PWM signal output circuit 21 to the outside of the microcomputer 11 via the signal output terminal J3 is directly input to the signal input terminal J2 of the microcomputer 11, and the signal is input from the signal input terminal J2 in the microcomputer 11. The input PWM signal is delayed by a predetermined time by the delay circuit 29 and input to the DMA transfer request generation circuit 25.

つまり、本第4実施形態では、図5における遅延回路27と同じ役割の遅延回路29が、マイコン11内に設けられている。尚、遅延回路29としては、マイコン11内で信号を遅延させる回路ならば良く、例えば、入力信号をクロックに同期してサンプリングすると共に、サンプリング結果が所定回数以上連続して同じになったレベルを出力信号のレベルにする、といった回路を用いることができる。この回路の場合、入力信号がレベル変化してから、上記所定回数のサンプリングが行われた時点で、出力信号が入力信号と同じレベルに変化することとなる。このため、上記所定回数によって遅延時間を変更することができる。   That is, in the fourth embodiment, the delay circuit 29 having the same role as the delay circuit 27 in FIG. The delay circuit 29 may be any circuit that delays the signal in the microcomputer 11. For example, the delay circuit 29 samples the input signal in synchronization with the clock, and the level at which the sampling result is the same continuously for a predetermined number of times or more. A circuit such as an output signal level can be used. In the case of this circuit, the output signal changes to the same level as the input signal when the predetermined number of times of sampling is performed after the input signal has changed in level. For this reason, the delay time can be changed by the predetermined number of times.

そして、このような第4実施形態によっても、第3実施形態と同じ作用及び効果が得られる。また、第3実施形態と比較すると、ECU35の構成部品を少なくすることができる利点がある。   And also by such 4th Embodiment, the same effect | action and effect as 3rd Embodiment are acquired. Moreover, compared with 3rd Embodiment, there exists an advantage which can reduce the component of ECU35.

以上、本発明の一実施形態について説明したが、本発明はこうした実施形態に何等限定されるものではなく、本発明の要旨を逸脱しない範囲において、種々なる態様で実施し得ることは勿論である。   As mentioned above, although one Embodiment of this invention was described, this invention is not limited to such Embodiment at all, Of course, in the range which does not deviate from the summary of this invention, it can implement in a various aspect. .

例えば、センサは、前述の圧力センサS1〜S4に限らず、気筒内の燃焼圧力を検出するセンサ等でも良い。また、制御対象は、エンジン以外でも良い。   For example, the sensor is not limited to the pressure sensors S1 to S4 described above, and may be a sensor that detects the combustion pressure in the cylinder. Further, the control target may be other than the engine.

1,31,33,35…ECU(電子制御装置)、3…エンジン、5…入力回路、7…クランク角センサ、9…波形整形回路、11…マイコン、12…ROM、13…CPU、15…RAM、17…A/D変換器、19…DMAコントローラ、21…PWM信号出力回路、21a…周期値レジスタ、21b…パルス幅値レジスタ、23…A/D変換要求発生回路、25…DMA転送要求発生回路、27,29…遅延回路   DESCRIPTION OF SYMBOLS 1,31,33,35 ... ECU (electronic control unit), 3 ... Engine, 5 ... Input circuit, 7 ... Crank angle sensor, 9 ... Waveform shaping circuit, 11 ... Microcomputer, 12 ... ROM, 13 ... CPU, 15 ... RAM, 17 ... A / D converter, 19 ... DMA controller, 21 ... PWM signal output circuit, 21a ... period value register, 21b ... pulse width value register, 23 ... A / D conversion request generation circuit, 25 ... DMA transfer request Generation circuit, 27, 29 ... delay circuit

Claims (7)

制御対象を制御するための処理を行うCPUと共に電子制御装置に設けられ、
センサから出力されるアナログ信号を所定のサンプリング間隔でA/D変換すると共に、そのA/D変換後のデジタルデータであるA/D変換データの各々をメモリに格納するA/D変換処理装置であって、
前記アナログ信号が入力され、A/D変換の実施を指令するA/D変換要求信号を受けると、前記アナログ信号をA/D変換するA/D変換器と、
前記A/D変換器から前記メモリへの前記A/D変換データのDMA転送を指令するDMA転送要求信号を受けると、前記A/D変換器から前記メモリへの前記A/D変換データの転送を行うと共に、前記DMA転送要求信号を受ける毎に、前記メモリにおける前記A/D変換データの転送先アドレスを変更することにより、前記メモリに複数の前記A/D変換データを記憶させるDMAコントローラと、
入力される信号に立ち上がりエッジと立ち下がりエッジとのうちの一方である第1の信号エッジが発生すると、前記A/D変換器に前記A/D変換要求信号を与えるA/D変換要求発生手段と、
入力される信号に立ち上がりエッジと立ち下がりエッジとのうちの一方である第2の信号エッジが発生すると、前記DMAコントローラに前記DMA転送要求信号を与える転送要求発生手段と、
前記CPUとは並行して動作して、前記A/D変換要求発生手段と前記転送要求発生手段とに信号を供給する回路であり、前記A/D変換要求発生手段への信号に、前記第1の信号エッジを前記サンプリング間隔毎に発生させ、前記転送要求発生手段への信号に、前記第1の信号エッジの発生タイミングから遅れたタイミングで前記第2の信号エッジを発生させる信号発生回路と、
を備えていることを特徴とするA/D変換処理装置。
Provided in the electronic control unit together with a CPU that performs processing for controlling the controlled object,
An A / D conversion processing apparatus that performs A / D conversion on an analog signal output from a sensor at a predetermined sampling interval and stores each A / D conversion data that is digital data after the A / D conversion in a memory. There,
When the analog signal is input and an A / D conversion request signal instructing execution of A / D conversion is received, an A / D converter that A / D converts the analog signal;
When receiving a DMA transfer request signal for instructing DMA transfer of the A / D conversion data from the A / D converter to the memory, the A / D conversion data is transferred from the A / D converter to the memory. A DMA controller that stores a plurality of the A / D conversion data in the memory by changing a transfer destination address of the A / D conversion data in the memory each time the DMA transfer request signal is received; ,
A / D conversion request generating means for providing the A / D conversion request signal to the A / D converter when a first signal edge, which is one of a rising edge and a falling edge, is generated in the input signal. When,
When a second signal edge that is one of a rising edge and a falling edge occurs in the input signal, transfer request generating means for supplying the DMA transfer request signal to the DMA controller;
A circuit that operates in parallel with the CPU and supplies a signal to the A / D conversion request generation means and the transfer request generation means; and the signal to the A / D conversion request generation means A signal generation circuit for generating one signal edge at each sampling interval and generating the second signal edge at a timing delayed from the generation timing of the first signal edge in the signal to the transfer request generation means; ,
An A / D conversion processing apparatus comprising:
請求項1に記載のA/D変換処理装置において、
前記第1の信号エッジの発生タイミングから第2の信号エッジが発生するまでの遅延時間は、前記A/D変換器が前記A/D変換要求信号を受けてから前記アナログ信号のA/D変換を完了するまでのA/D変換時間よりも長く、且つ、前記第1の信号エッジの発生間隔よりも短いこと、
を特徴とするA/D変換処理装置。
The A / D conversion processing device according to claim 1,
The delay time from the generation timing of the first signal edge to the generation of the second signal edge is the A / D conversion of the analog signal after the A / D converter receives the A / D conversion request signal. Longer than the A / D conversion time until the completion of, and shorter than the generation interval of the first signal edge,
A / D conversion processing device characterized by the above.
請求項2に記載のA/D変換処理装置において、
前記遅延時間は、前記DMAコントローラが前記DMA転送要求信号を受けてから前記メモリへの前記A/D変換データの転送を完了するまでのDMA転送時間を、前記第1の信号エッジの発生間隔から引いた時間よりも短いこと、
を特徴とするA/D変換処理装置。
The A / D conversion processing device according to claim 2,
The delay time is defined as the DMA transfer time from when the DMA controller receives the DMA transfer request signal until the transfer of the A / D conversion data to the memory is completed, from the generation interval of the first signal edge. Less than the time you subtract,
A / D conversion processing device characterized by the above.
請求項1ないし請求項3の何れか1項に記載のA/D変換処理装置において、
前記第1の信号エッジと前記第2の信号エッジは、互いに反対方向のエッジであり、
前記信号発生回路は、前記サンプリング間隔を周期とする所定デューティ比のハイ/ロー信号を出力する回路であると共に、その1つのハイ/ロー信号を前記A/D変換要求発生手段と前記転送要求発生手段との両方に供給し、
前記ハイ/ロー信号の立ち上がりエッジと立ち下がりエッジとのうち、一方のエッジが前記第1の信号エッジとなり、他方のエッジが前記第2の信号エッジとなっていること、
を特徴とするA/D変換処理装置。
In the A / D conversion processing device according to any one of claims 1 to 3,
The first signal edge and the second signal edge are edges in opposite directions;
The signal generation circuit is a circuit that outputs a high / low signal having a predetermined duty ratio with the sampling interval as a cycle, and the A / D conversion request generation means and the transfer request generation of the one high / low signal. Supply both with the means,
Of the rising and falling edges of the high / low signal, one edge is the first signal edge and the other edge is the second signal edge,
A / D conversion processing device characterized by the above.
請求項4に記載のA/D変換処理装置において、
前記信号発生回路は、前記ハイ/ロー信号として、前記CPUにより設定される周期及びパルス幅のPWM信号を出力するPWM信号出力回路であること、
を特徴とするA/D変換処理装置。
The A / D conversion processing device according to claim 4,
The signal generation circuit is a PWM signal output circuit that outputs a PWM signal having a period and a pulse width set by the CPU as the high / low signal;
A / D conversion processing device characterized by the above.
請求項4に記載のA/D変換処理装置において、
前記信号発生回路は、前記ハイ/ロー信号として、エンジンのクランク軸が所定角度回転する毎に、立ち上がりエッジと立ち下がりエッジとの一方である有効エッジが発生するクランク角信号を出力するクランク角信号出力回路であること、
を特徴とするA/D変換処理装置。
The A / D conversion processing device according to claim 4,
The signal generation circuit outputs, as the high / low signal, a crank angle signal for generating an effective edge that is one of a rising edge and a falling edge each time the crankshaft of the engine rotates by a predetermined angle. Output circuit,
A / D conversion processing device characterized by the above.
請求項1ないし請求項3の何れか1項に記載のA/D変換処理装置において、
前記第1の信号エッジと前記第2の信号エッジは、互いに同じ方向のエッジであり、
前記信号発生回路は、前記サンプリング間隔を周期とする所定デューティ比のハイ/ロー信号を出力する信号出力回路と、該信号出力回路から出力されるハイ/ロー信号を所定時間だけ遅延させて出力する遅延回路とからなり、前記信号出力回路からのハイ/ロー信号を前記A/D変換要求発生手段に供給すると共に、前記遅延回路からのハイ/ロー信号を前記転送要求発生手段に供給し、
前記信号出力回路から出力されるハイ/ロー信号の立ち上がりエッジと立ち下がりエッジとのうちの一方である特定方向のエッジが、前記第1の信号エッジとなり、前記遅延回路から出力されるハイ/ロー信号の前記特定方向のエッジが、前記第2の信号エッジとなっていること、
を特徴とするA/D変換処理装置。
In the A / D conversion processing device according to any one of claims 1 to 3,
The first signal edge and the second signal edge are edges in the same direction,
The signal generation circuit outputs a high / low signal having a predetermined duty ratio with the sampling interval as a cycle, and delays and outputs the high / low signal output from the signal output circuit by a predetermined time. Comprising a delay circuit, supplying a high / low signal from the signal output circuit to the A / D conversion request generating means, and supplying a high / low signal from the delay circuit to the transfer request generating means,
An edge in a specific direction which is one of a rising edge and a falling edge of the high / low signal output from the signal output circuit becomes the first signal edge, and the high / low signal output from the delay circuit. The edge in the specific direction of the signal is the second signal edge;
A / D conversion processing device characterized by the above.
JP2009209222A 2009-09-10 2009-09-10 A / D conversion processor Expired - Fee Related JP5326952B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009209222A JP5326952B2 (en) 2009-09-10 2009-09-10 A / D conversion processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009209222A JP5326952B2 (en) 2009-09-10 2009-09-10 A / D conversion processor

Publications (2)

Publication Number Publication Date
JP2011061512A true JP2011061512A (en) 2011-03-24
JP5326952B2 JP5326952B2 (en) 2013-10-30

Family

ID=43948642

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009209222A Expired - Fee Related JP5326952B2 (en) 2009-09-10 2009-09-10 A / D conversion processor

Country Status (1)

Country Link
JP (1) JP5326952B2 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016142597A (en) * 2015-01-30 2016-08-08 富士通テン株式会社 Power supply voltage monitoring circuit and power supply circuit including the same
JP2021173168A (en) * 2020-04-20 2021-11-01 株式会社デンソー Engine control device
DE102018111260B4 (en) 2017-05-15 2022-08-25 GM Global Technology Operations LLC COMPUTER ASSISTED METHOD AND ENGINE CONTROL UNIT FOR MEASURING THE INJECTED FUEL INTO AN ENGINE
JP7443677B2 (en) 2019-05-29 2024-03-06 日本精工株式会社 Bearings with sensors and synchronous measurement systems
JP7447770B2 (en) 2020-11-20 2024-03-12 株式会社デンソー Control device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04288727A (en) * 1991-02-07 1992-10-13 Mitsubishi Electric Corp A/d converter
JPH04287747A (en) * 1991-03-13 1992-10-13 Zexel Corp Signal processing system
JP2005142670A (en) * 2003-11-04 2005-06-02 Hitachi Ltd Electronic control apparatus
JP2005190195A (en) * 2003-12-25 2005-07-14 Renesas Technology Corp Microcontroller

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04288727A (en) * 1991-02-07 1992-10-13 Mitsubishi Electric Corp A/d converter
JPH04287747A (en) * 1991-03-13 1992-10-13 Zexel Corp Signal processing system
JP2005142670A (en) * 2003-11-04 2005-06-02 Hitachi Ltd Electronic control apparatus
JP2005190195A (en) * 2003-12-25 2005-07-14 Renesas Technology Corp Microcontroller

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016142597A (en) * 2015-01-30 2016-08-08 富士通テン株式会社 Power supply voltage monitoring circuit and power supply circuit including the same
DE102018111260B4 (en) 2017-05-15 2022-08-25 GM Global Technology Operations LLC COMPUTER ASSISTED METHOD AND ENGINE CONTROL UNIT FOR MEASURING THE INJECTED FUEL INTO AN ENGINE
JP7443677B2 (en) 2019-05-29 2024-03-06 日本精工株式会社 Bearings with sensors and synchronous measurement systems
JP2021173168A (en) * 2020-04-20 2021-11-01 株式会社デンソー Engine control device
JP7314854B2 (en) 2020-04-20 2023-07-26 株式会社デンソー engine controller
JP7447770B2 (en) 2020-11-20 2024-03-12 株式会社デンソー Control device

Also Published As

Publication number Publication date
JP5326952B2 (en) 2013-10-30

Similar Documents

Publication Publication Date Title
JP5326952B2 (en) A / D conversion processor
JP4924668B2 (en) Fuel injection control device
JP5163475B2 (en) Signal processing device
US6493628B2 (en) Engine control unit having frequency-multiplied signal generating function
CN104813585B (en) For handling method and the corresponding device by the signal of bilateral transducer supply
JP2011153596A (en) Internal combustion engine control device
JP2001200747A (en) Engine control device
JP5327085B2 (en) A / D conversion processor
JP5304724B2 (en) Engine control device
JP4462147B2 (en) Signal output device and electronic control device
JP6911627B2 (en) AD conversion processing device
JP2005248721A (en) Fuel injection controller for internal combustion engine
JP5888290B2 (en) Electronic control device for internal combustion engine
EP2667199B1 (en) Semiconductor data processing apparatus and engine control apparatus
KR102463459B1 (en) Method for Improving Engine Start Performance of Vehicle
JP5849994B2 (en) Actuator drive
JP6801523B2 (en) Electronic control device
JP2016130452A (en) Control device for internal combustion engine
JP6904054B2 (en) Fuel injection control device
JP2015214938A (en) Electronic control unit
JP3539336B2 (en) Engine control device
JP2001248493A (en) Pulse output control device
JP5578158B2 (en) Signal processing device
JP2005315169A (en) Crankshaft rotation synchronous processing system and engine control device
JP2023003171A (en) Vehicle electronic control unit

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120403

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130416

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130423

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130529

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130708

R151 Written notification of patent or utility model registration

Ref document number: 5326952

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

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees