[go: up one dir, main page]

JP7528875B2 - Vehicle Electronic Control Unit - Google Patents

Vehicle Electronic Control Unit Download PDF

Info

Publication number
JP7528875B2
JP7528875B2 JP2021104184A JP2021104184A JP7528875B2 JP 7528875 B2 JP7528875 B2 JP 7528875B2 JP 2021104184 A JP2021104184 A JP 2021104184A JP 2021104184 A JP2021104184 A JP 2021104184A JP 7528875 B2 JP7528875 B2 JP 7528875B2
Authority
JP
Japan
Prior art keywords
data
timer
cpu
ram
data transfer
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
JP2021104184A
Other languages
Japanese (ja)
Other versions
JP2023003171A (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 JP2021104184A priority Critical patent/JP7528875B2/en
Publication of JP2023003171A publication Critical patent/JP2023003171A/en
Application granted granted Critical
Publication of JP7528875B2 publication Critical patent/JP7528875B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Bus Control (AREA)
  • Information Transfer Systems (AREA)

Description

本開示は、車両に搭載された機器を制御する車両用電子制御装置に関する。 This disclosure relates to an electronic control device for a vehicle that controls devices mounted on the vehicle.

特許文献1には、CPU、RAM、DMAコントローラ、等を備え、DMAコントローラが、パルス信号のパルス幅を計測するタイマから起動信号を受けると、タイマによる計測結果をRAMに転送するよう構成された電子装置が開示されている。 Patent document 1 discloses an electronic device that includes a CPU, RAM, DMA controller, etc., and is configured so that when the DMA controller receives a start signal from a timer that measures the pulse width of a pulse signal, the timer transfers the measurement result to the RAM.

この電子装置において、DMAコントローラは、起動信号が所定回数入力されると、パルス幅の計測結果を転送した後、CPUに割り込み信号を出力する。すると、CPUは、その割り込み信号にて、DMAコントローラからの転送データをバッファに退避させ、RAMの異常診断を実施する。 In this electronic device, when the start signal is input a predetermined number of times, the DMA controller transfers the pulse width measurement results and then outputs an interrupt signal to the CPU. The CPU then uses the interrupt signal to save the data transferred from the DMA controller to a buffer and diagnoses the RAM for abnormalities.

特許第5924195号公報Patent No. 5924195

ところで、上記電子装置において、特定期間内の複数の起動信号に対応したデータをDMAコントローラから転送させたい場合、DMAコントローラ若しくはタイマから、特定期間の開始及び終了タイミングでCPUに割り込み信号を入力するようにするとよい。つまり、CPUは、割り込み信号により割り込み処理を実行することができるので、この割り込み処理により、開始タイミングでDMAコントローラからデータ転送を開始させ、終了タイミングでそのデータ転送を停止させるようにするのである。 In the above electronic device, if you want to transfer data corresponding to multiple activation signals within a specific period from the DMA controller, it is a good idea to input an interrupt signal to the CPU from the DMA controller or a timer at the start and end of the specific period. In other words, the CPU can execute interrupt processing in response to the interrupt signal, and this interrupt processing will start data transfer from the DMA controller at the start timing and stop the data transfer at the end timing.

しかし、CPUにて実行される処理は、優先度の高い他の割り込み処理により遅れることがあるので、DMAコントローラを上記のように動作させると、DMAコントローラからデータ転送される期間が、所望のデータ転送期間からずれる場合がある。その結果、転送すべきデータの一部が欠けるとか、転送データの一部に不要データが混ざる、という問題が発生する。 However, because the processing executed by the CPU may be delayed by other interrupt processing with a higher priority, if the DMA controller is operated as described above, the period during which data is transferred from the DMA controller may deviate from the desired data transfer period. As a result, problems may occur in which some of the data to be transferred is missing, or unnecessary data may be mixed into some of the transferred data.

本開示の1つの局面は、DMAコントローラを備えた車両用電子制御装置において、CPUが、所望の期間のデータを、DMAコントローラを介して正確に取得できるようにすることを目的とする。 One aspect of the present disclosure is to enable a CPU in a vehicle electronic control device equipped with a DMA controller to accurately obtain data for a desired period via the DMA controller.

本開示の1つの態様による車両用電子制御装置は、マイコン内にCPU(12)と、DMAコントローラ(20)と、RAM(16)と、タイマ(18)と、データ入力部(22)と、を備える。 An electronic control device for a vehicle according to one aspect of the present disclosure includes a CPU (12), a DMA controller (20), a RAM (16), a timer (18), and a data input unit (22) within a microcomputer.

CPUは、データ入力部がデータ転送を開始する開始タイミングをタイマにセットして、タイマから開始タイミングで第1割り込み信号を出力させる。また、CPUは、タイマから出力される第1割り込み信号を受けると、データの転送を終了する終了タイミングをタイマにセットして、タイマから終了タイミングで第2割り込み信号を出力させる。 The CPU sets the start timing for the data input unit to start data transfer in the timer, and causes the timer to output a first interrupt signal at the start timing. In addition, when the CPU receives the first interrupt signal output from the timer, it sets the end timing for ending data transfer in the timer, and causes the timer to output a second interrupt signal at the end timing.

一方、DMAコントローラは、タイマに同期した第1の出力に同期して、データ入力部からRAMへのデータの転送を開始し、タイマに同期した第2の出力に同期して、そのデータ転送を終了する。 Meanwhile, the DMA controller starts transferring data from the data input unit to the RAM in synchronization with the first output synchronized with the timer, and ends the data transfer in synchronization with the second output synchronized with the timer.

このように本開示の車両用電子制御装置によれば、DMAコントローラは、タイマからの出力に同期してデータ転送を開始し、タイマからの出力に同期してデータ転送を終了する。 In this manner, according to the vehicle electronic control device disclosed herein, the DMA controller starts data transfer in synchronization with the output from the timer, and ends data transfer in synchronization with the output from the timer.

従って、データ入力部からRAMには、開始タイミングと終了タイミングとで規定されるデータ転送期間の間、データが遅延なく転送されることになる。そして、RAMに転送されたデータは、割り込み処理の遅れの影響なく転送されたデータであるため、CPUは、そのデータを使って車両制御を適正に実施することができる。 Therefore, data is transferred from the data input unit to the RAM without delay during the data transfer period defined by the start and end timings. And because the data transferred to the RAM is data that is transferred without being affected by delays in interrupt processing, the CPU can use that data to properly control the vehicle.

次に、本開示の他の態様による車両電子制御装置は、上記と同様、CPUと、DMAコントローラと、RAMと、タイマと、データ入力部と、を備える。
そして、CPUは、データ入力部からデータの転送を開始する開始タイミングをタイマにセットして、タイマから開始タイミングで割り込み信号を出力させる。
Next, a vehicle electronic control device according to another aspect of the present disclosure includes a CPU, a DMA controller, a RAM, a timer, and a data input unit, similar to the above.
Then, the CPU sets the start timing for starting data transfer from the data input unit in a timer, and causes the timer to output an interrupt signal at the start timing.

また、DMAコントローラは、タイマに同期した出力に同期して、データ入力部からRAMへのデータの転送を開始する。
従って、この車両用電子制御装置においても、割り込み処理の遅れの影響なくデータ転送を開始することができる。
Moreover, the DMA controller starts transferring data from the data input section to the RAM in synchronization with the output synchronized with the timer.
Therefore, in this vehicle electronic control unit as well, data transfer can be started without being affected by delays in interrupt processing.

また、CPUは、タイマから出力された割り込み信号を受けると、周期処理にて、データ入力部からRAMに転送されたデータの数が、予め設定された設定数に達したか否かを判断する。そして、そのデータの数が設定数に達すると、DMAコントローラによるデータの転送を終了させる。 When the CPU receives an interrupt signal output from the timer, it periodically determines whether the amount of data transferred from the data input unit to the RAM has reached a preset number. When the amount of data reaches the preset number, it ends the data transfer by the DMA controller.

従って、データ転送の終了タイミングは、割り込み処理の遅れの影響を受けることになるが、CPUは、設定数以上のデータを取得しないため、割り込み処理の遅れの影響なく所望の期間のデータを取得することができる。 Thus, the end timing of the data transfer will be affected by delays in interrupt processing, but because the CPU does not acquire more than the set amount of data, it can acquire data for the desired period without being affected by delays in interrupt processing.

第1実施形態の車両用電子制御装置全体の構成を表すブロック図である。1 is a block diagram showing an overall configuration of a vehicle electronic control device according to a first embodiment; CPUにおける割り込み処理の遅延によって生じる問題点を説明する説明図である。FIG. 1 is an explanatory diagram illustrating a problem caused by a delay in interrupt processing in a CPU. センサからA/D変換器にアナログ波形が入力され、RAMにデータが転送されるまでの流れを説明する説明図である。1 is an explanatory diagram illustrating a flow in which an analog waveform is input from a sensor to an A/D converter and the data is transferred to a RAM; DMAコントローラによるデータ転送動作を説明するタイムチャートである。4 is a time chart illustrating a data transfer operation by a DMA controller. CPU及びDMAコントローラの処理手順を表すフローチャートである。4 is a flowchart showing a processing procedure of a CPU and a DMA controller. 第2実施形態のCPU及びDMAコントローラの処理手順を表すフローチャートである。10 is a flowchart showing a processing procedure of a CPU and a DMA controller according to a second embodiment. 第2実施形態のDMAコントローラによるデータ転送動作を説明するタイムチャートである。10 is a time chart illustrating a data transfer operation by a DMA controller according to a second embodiment. CPUがA/D変換器で生じる遅延時間を考慮してデータを取得するように構成された変形例の説明図である。FIG. 13 is an explanatory diagram of a modified example in which a CPU is configured to acquire data taking into account a delay time caused by an A/D converter.

以下、図面を参照しながら、本開示の実施形態を説明する。
[第1実施形態]
図1に示すように、本実施形態の車両用電子制御装置(以下、ECU)4は、車両に搭載されたエンジン2の燃料噴射量や点火時期等を制御する装置である。
Hereinafter, embodiments of the present disclosure will be described with reference to the drawings.
[First embodiment]
As shown in FIG. 1, a vehicle electronic control unit (hereinafter, referred to as ECU) 4 of this embodiment is a device that controls the fuel injection amount, ignition timing, etc. of an engine 2 mounted on a vehicle.

ECU4は、エンジン2を制御するための処理を行う制御部として、マイクロコンピュータ(以下、マイコン)10を備える。マイコン10は、CPU12,ROM14,RAM16,タイマ18,及び、DMAコントローラ(以下、DMAC)20を備えている。 The ECU 4 includes a microcomputer (hereinafter, MCU) 10 as a control unit that performs processing to control the engine 2. The MCU 10 includes a CPU 12, a ROM 14, a RAM 16, a timer 18, and a DMA controller (hereinafter, DMAC) 20.

また、マイコン10には、エンジン2に設けられた各種センサからの検出信号を取り込む入力部22、及び、エンジン2の燃料噴射装置や点火装置に制御信号を出力する出力部24も備えられている。そして、マイコン10内の上記各部は、バス26を介して互いに接続されている。 The microcomputer 10 also includes an input section 22 that receives detection signals from various sensors provided in the engine 2, and an output section 24 that outputs control signals to the fuel injection device and ignition device of the engine 2. The above-mentioned sections within the microcomputer 10 are connected to each other via a bus 26.

入力部22には、A/D変換器30が設けられている。
A/D変換器30は、センサからの入力信号(すなわち、アナログ電圧)をA/D変換するためのものであり、本実施形態では、エンジン2の振動を検出するノックセンサからの検出信号をデジタルデータに変換するものとする。
The input section 22 is provided with an A/D converter 30 .
The A/D converter 30 is used for A/D conversion of input signals (i.e., analog voltages) from sensors, and in this embodiment, converts detection signals from a knock sensor that detects vibrations of the engine 2 into digital data.

なお、A/D変換器30は、エンジン2や吸入空気の温度を検出する温度センサ、吸入空気の圧力を検出する吸気圧センサ等、検出信号としてアナログ電圧を出力するセンサからの出力をA/D変換するものであってもよい。 The A/D converter 30 may also perform A/D conversion of the output from a sensor that outputs an analog voltage as a detection signal, such as a temperature sensor that detects the temperature of the engine 2 or the intake air, or an intake air pressure sensor that detects the pressure of the intake air.

A/D変換器30は、例えば、回転センサからエンジン2の所定回転角度毎に出力される回転信号に同期して、ノックセンサからの検出信号を繰り返しA/D変換するように構成されている。そして、DMAC20は、A/D変換器30にてA/D変換されたデータを、RAM16に転送する。なお、A/D変換器30は、一定時間毎に検出信号をA/D変換するように構成されていてもよい。 The A/D converter 30 is configured to repeatedly A/D convert the detection signal from the knock sensor, for example, in synchronization with the rotation signal output from the rotation sensor at each predetermined rotation angle of the engine 2. Then, the DMAC 20 transfers the data A/D converted by the A/D converter 30 to the RAM 16. The A/D converter 30 may be configured to A/D convert the detection signal at regular intervals.

DMAC20は、CPU12によりエンジン2の回転に同期して設定されるデータ転送期間の間、A/D変換器30にてA/D変換された複数のデータを、順次、RAM16に転送する。 During the data transfer period set by the CPU 12 in synchronization with the rotation of the engine 2, the DMAC 20 sequentially transfers the multiple pieces of data A/D converted by the A/D converter 30 to the RAM 16.

なお、データ転送期間には、ノックセンサからの検出信号に基づきノック判定を実施できるように、エンジン2のクランク角度で、例えば、BTDC60°CAからATDC60°CAまでの期間が予め設定されている。 The data transfer period is preset to a period from BTDC 60° CA to ATDC 60° CA in terms of the crank angle of the engine 2, for example, so that knock determination can be performed based on the detection signal from the knock sensor.

ところで、データ転送期間の間、DMAC20にデータ転送を実施させるには、CPU12からタイマ18に転送期間をセットして、転送開始、または転送終了タイミングでタイマ18からCPU12に割り込みを発生させる。 In order to have the DMAC 20 perform data transfer during the data transfer period, the CPU 12 sets the transfer period in the timer 18, and the timer 18 generates an interrupt to the CPU 12 at the start or end of the transfer.

そして、CPU12の割り込み処理内でDMAC20に転送の開始と終了を指令する。DMAC20は、CPU12から出力される指令に従い、データ転送期間の間、A/D変換器30からRAM16へのデータ転送を実施することができる。 Then, during the interrupt processing of the CPU 12, it instructs the DMAC 20 to start and end the transfer. The DMAC 20 can transfer data from the A/D converter 30 to the RAM 16 during the data transfer period according to the instructions output from the CPU 12.

しかしながら、このようにすると、図2に示すように、CPU12でデータ転送期間の開始タイミング及び終了タイミングで実行される割り込み処理が、優先度の高い他の割り込み処理によって遅延されることがある。 However, in this case, as shown in FIG. 2, the interrupt processing executed by the CPU 12 at the start and end of the data transfer period may be delayed by other interrupt processing with a higher priority.

そして、この割り込み処理の遅延によって、DMAC20へのデータ転送の開始の指令が遅れて、データ転送期間の最初のデータが欠落したり、DMAC20へのデータ転送の終了の指令が遅れて、転送データの最後に不要なデータが混ざったりすることがある。 This interrupt processing delay may result in a delay in the command to DMAC20 to start the data transfer, causing the first data in the data transfer period to be missing, or a delay in the command to DMAC20 to end the data transfer, causing unnecessary data to be mixed in at the end of the transferred data.

そこで、本実施形態では、図3,図4に示すように、CPU12が、データ転送期間の開始タイミング及び終了タイミングを、順次タイマ18にセットし、タイマ18から、これら各タイミングで第1割り込み信号及び第2割り込み信号を発生させる。 Therefore, in this embodiment, as shown in Figures 3 and 4, the CPU 12 sequentially sets the start timing and end timing of the data transfer period in the timer 18, and causes the timer 18 to generate a first interrupt signal and a second interrupt signal at each of these timings.

なお,タイマ18は、例えば、パルス発生器から一定周期で出力されるパルス信号をカウントすることで、時間を計時するカウンタであってもよい。本実施形態では、転送データが、A/D変換器30にて、制御対象であるエンジン2の所定回転角度毎にA/D変化されるデータであることから、タイマ18には、エンジン2の所定回転角度毎にカウントアップするカウンタが用いられる。 The timer 18 may be, for example, a counter that measures time by counting pulse signals output at regular intervals from a pulse generator. In this embodiment, since the transferred data is A/D converted by the A/D converter 30 for each predetermined rotation angle of the engine 2, which is the object of control, a counter that counts up for each predetermined rotation angle of the engine 2 is used for the timer 18.

次に、DMAC20は、タイマ18に同期した出力(以下、同期出力)に同期して、A/D変換器30のレジスタ32からRAM16へのデータ転送を開始し、次のタイマ18からの同期出力に同期して、そのデータ転送を終了する。 Next, the DMAC 20 starts transferring data from the register 32 of the A/D converter 30 to the RAM 16 in synchronization with an output synchronized with the timer 18 (hereinafter, the synchronous output), and ends the data transfer in synchronization with the next synchronous output from the timer 18.

つまり、図4に示すように、タイマ18からは、カウンタのアウトプットコンペア機能により、設定されたタイミングでレベルが反転する信号が、タイマ18に同期した信号として出力される。そして、DMAC20は、この出力信号のレベル変化により、データ転送を開始し、終了する。 In other words, as shown in FIG. 4, the timer 18 outputs a signal whose level is inverted at a set timing by the counter's output compare function as a signal synchronized with the timer 18. Then, the DMAC 20 starts and ends data transfer according to the change in the level of this output signal.

従って、DMAC20によるデータ転送が、CPU12が実行する割り込み処理の遅延によって遅れることはなく、DMAC20は、所望のデータ転送期間の間、A/D変換器30でA/D変換されたデータをRAM16に転送することができる。 Therefore, data transfer by the DMAC 20 is not delayed by delays in interrupt processing executed by the CPU 12, and the DMAC 20 can transfer data A/D converted by the A/D converter 30 to the RAM 16 for the desired data transfer period.

なお、レジスタ32は、A/D変換器30によるA/D変換結果を一時的に保持するものである。つまり、A/D変換器30は、センサ40からの検出信号をA/D変換する度に、A/D変換結果をレジスタ32に書き込むようにされている。そして、DMAC20は、データ転送期間の間、レジスタ32に書き込まれたデータを、順次、RAM16に転送する。 The register 32 temporarily holds the A/D conversion result by the A/D converter 30. In other words, the A/D converter 30 writes the A/D conversion result to the register 32 every time it A/D converts the detection signal from the sensor 40. During the data transfer period, the DMAC 20 sequentially transfers the data written to the register 32 to the RAM 16.

一方、CPU12は、データ転送開始タイミングでタイマ18から出力される第1割り込み信号を受けると、割り込み処理により、終了タイミングをタイマ18にセットする。また、CPU12は、タイマ18からデータ転送終了タイミングで出力される第2割り込み信号を受けると、割り込み処理により、転送されたデータを使って処理を実施する。 On the other hand, when the CPU 12 receives a first interrupt signal output from the timer 18 at the timing of starting the data transfer, the CPU 12 sets the end timing in the timer 18 through interrupt processing. Also, when the CPU 12 receives a second interrupt signal output from the timer 18 at the timing of ending the data transfer, the CPU 12 uses the interrupt processing to carry out processing using the transferred data.

この結果、CPU12は、データ転送期間にDMAC20からRAM16に転送されてきた全データを、正確な期間の間、取得することができるようになる。また、RAM16のバッファ領域には、DMAC20から次のデータ転送期間に転送されてくるデータを書き込むことができるようになる。 As a result, the CPU 12 can obtain all data transferred from the DMAC 20 to the RAM 16 during the data transfer period for the correct period. In addition, the data transferred from the DMAC 20 during the next data transfer period can be written to the buffer area of the RAM 16.

次に、上述したCPU12の動作、及び、DMAC20の動作を、図5に示すフローチャートに沿って説明する。
図5に示すように、CPU12は、S100にて、データ転送期間の開始タイミング、詳しくは開始タイミングまでのカウント値、をタイマ18にセットし、DMAC20がタイマ18からの同期出力に同期してデータ転送を開始するのを許可する。
Next, the above-mentioned operation of the CPU 12 and the operation of the DMAC 20 will be described with reference to the flowchart shown in FIG.
As shown in FIG. 5, in S100, the CPU 12 sets the start timing of the data transfer period, more specifically, the count value until the start timing, in the timer 18, and permits the DMAC 20 to start the data transfer in synchronization with the synchronous output from the timer 18.

S100にて、データ転送期間の開始タイミングがタイマ18にセットされると、タイマ18は、開始タイミングになるまでエンジン2の回転に同期したパルス出力をカウントする。そして、図4に示すように、タイマ18のカウント値が開始タイミングのカウント値と一致すると、出力信号を反転させて、第1割り込み信号を発生する。 In S100, when the start timing of the data transfer period is set in the timer 18, the timer 18 counts the pulse output synchronized with the rotation of the engine 2 until the start timing is reached. Then, as shown in FIG. 4, when the count value of the timer 18 matches the count value of the start timing, the output signal is inverted and a first interrupt signal is generated.

この第1割り込み信号により、CPU12は、S110の割り込み処理を実行する。そして、S110の割り込み処理では、データ転送期間の終了タイミングを、タイマ18にセットする。 This first interrupt signal causes the CPU 12 to execute the interrupt process of S110. In the interrupt process of S110, the end timing of the data transfer period is set in the timer 18.

一方、DMAC20は、S200にて、CPU12から許可信号を受けることで、タイマ18からの同期出力に同期してデータ転送を開始することができるようになる。そして、その後は、タイマ18からの同期出力がOFFからONに反転するのを待ち、タイマ18からの同期出力がOFFからONに反転すると、S210にて、レジスタ32に保存されたA/D変換結果をRAM16に転送する、データ転送を開始する。 Meanwhile, in S200, the DMAC 20 receives an enable signal from the CPU 12, enabling it to start data transfer in synchronization with the synchronous output from the timer 18. Then, it waits for the synchronous output from the timer 18 to change from OFF to ON, and when the synchronous output from the timer 18 changes from OFF to ON, in S210 it starts data transfer by transferring the A/D conversion result stored in the register 32 to the RAM 16.

次に、CPU12がS110にて、データ転送期間の終了タイミングをタイマ18にセットすると、タイマ18は、終了タイミングになるまでエンジン2の回転角度をカウントし、終了タイミングに達すると、同期出力を反転させて、第2割り込み信号を発生する。 Next, in S110, the CPU 12 sets the end timing of the data transfer period in the timer 18. The timer 18 counts the rotation angle of the engine 2 until the end timing is reached, and when the end timing is reached, it inverts the synchronous output and generates a second interrupt signal.

この第2割り込み信号により、CPU12は、S120の割り込み処理を実行する。
S120の割り込み処理では、データ転送期間中にレジスタ32から転送され、RAM16のバッファ領域に保存されているデータを使用して処理を実施する。
In response to this second interrupt signal, the CPU 12 executes the interrupt process of S120.
In the interrupt process of S120, the process is carried out using the data that has been transferred from the register 32 during the data transfer period and that has been stored in the buffer area of the RAM 16.

また、S120の割り込み処理では、DMAC20がタイマ18からの同期出力に同期してデータ転送を開始するのを禁止する。
なお、レジスタ32から転送され、RAM16に保存されたデータは、エンジン2の所定回転角度範囲内にノックセンサから得られた振動データであるため、CPU12は、そのデータを利用してエンジン2のノック判定を行い、エンジン2の点火時期を制御する。
In addition, in the interrupt process of S 120 , the DMAC 20 is prohibited from starting a data transfer in synchronization with the synchronous output from the timer 18 .
In addition, since the data transferred from the register 32 and stored in the RAM 16 is vibration data obtained from the knock sensor within a specified rotation angle range of the engine 2, the CPU 12 uses that data to make a knock judgment on the engine 2 and control the ignition timing of the engine 2.

一方、DMAC20は、S210にて、A/D変換結果のデータ転送を開始すると、タイマ18からの同期出力がONからOFFに反転するのを待機する。そして、タイマ18からの同期出力がONからOFFに反転すると、S220にて、A/D変換結果のデータ転送を停止し、S230に移行する。 Meanwhile, when DMAC 20 starts data transfer of the A/D conversion result in S210, it waits for the synchronous output from timer 18 to change from ON to OFF. Then, when the synchronous output from timer 18 changes from ON to OFF, it stops data transfer of the A/D conversion result in S220 and proceeds to S230.

S230では、CPU12が、S120の割り込み処理にて、タイマ18からの同期出力に同期してデータ転送を開始するのを禁止する指令を送信してくるので、その禁止指令に従い、タイマ18からの同期出力に同期してデータ転送を開始するのを禁止する。 In S230, the CPU 12 sends a command in the interrupt process of S120 to prohibit the start of data transfer in synchronization with the synchronous output from the timer 18, and in accordance with the prohibition command, prohibits the start of data transfer in synchronization with the synchronous output from the timer 18.

以上説明したように、本実施形態のECU4においては、マイコン10に設けられたDMAC20が、タイマ18からの第1の同期出力に同期して、データ転送を開始し、タイマ18からの第2の同期出力に同期して、データ転送を終了する。 As described above, in the ECU 4 of this embodiment, the DMAC 20 provided in the microcontroller 10 starts data transfer in synchronization with the first synchronous output from the timer 18, and ends data transfer in synchronization with the second synchronous output from the timer 18.

このため、A/D変換器30のレジスタ32からRAM16には、データ転送期間の間、A/D変換器30にてA/D変換された全てのデータが転送されることになり、CPU12は、割り込み処理の遅延の影響を受けることなく、データを取得することができる。 As a result, during the data transfer period, all data A/D converted by the A/D converter 30 is transferred from the register 32 of the A/D converter 30 to the RAM 16, and the CPU 12 can obtain the data without being affected by delays in interrupt processing.

よって、CPU12の割り込み処理の遅延によって、CPU12がエンジン制御に用いるデータの一部が欠けたり、不要データが混ざったりすることがなく、CPU12は、DMAC20から取得したデータに基づき、エンジン2を適正に制御することができる。 Therefore, delays in the interrupt processing of the CPU 12 do not result in some of the data used by the CPU 12 for engine control being lost or unnecessary data being mixed in, and the CPU 12 can appropriately control the engine 2 based on the data obtained from the DMAC 20.

[第2実施形態]
第1実施形態では、DMAC20にデータ転送させる期間は予め設定されており、CPU12は、データ転送期間の開始タイミングと終了タイミングの両方で、タイマ18から割り込み信号を発生させるようにしている。
[Second embodiment]
In the first embodiment, the period during which the DMAC 20 transfers data is set in advance, and the CPU 12 causes the timer 18 to generate an interrupt signal at both the start and end of the data transfer period.

しかし、データ転送の終了タイミングは、必ずしも規定する必要はなく、例えば、DMAC20がデータ転送を開始してから、CPU12が取得したデータの数を検出して、その数が予め設定された設定数に達したときに、データ転送を終了するようにしてもよい。 However, the timing for ending the data transfer does not necessarily need to be specified. For example, the data transfer may be ended when the CPU 12 detects the number of pieces of data acquired after the DMAC 20 starts the data transfer and the number reaches a preset number.

以下、このように動作するよう構成された車両用電子制御装置について、本開示の第2実施形態として説明する。
なお、本実施形態の車両用電子制御装置は、第1実施形態のECU4と同様に構成されており、第1実施形態と異なる点は、マイコン10のCPU12及びDMAC20の動作だけである。このため、本実施形態では、CPU12及びDMAC20の動作について説明し、第1実施形態と共通する部分については、説明を省略する。
Hereinafter, a vehicle electronic control device configured to operate in this manner will be described as a second embodiment of the present disclosure.
The vehicle electronic control device of this embodiment is configured similarly to the ECU 4 of the first embodiment, and differs from the first embodiment only in the operations of the CPU 12 and the DMAC 20 of the microcomputer 10. Therefore, in this embodiment, the operations of the CPU 12 and the DMAC 20 will be described, and descriptions of parts common to the first embodiment will be omitted.

図6に示すように、CPU12は、第1実施形態と同様、S100にて、データ転送期間の開始タイミングをタイマ18にセットし、DMAC20がタイマ18からの同期出力に同期してデータ転送を開始するのを許可する。そして、その後、タイマ18から割り込み信号が出力されると、S130にて、DMAC20がタイマ18からの出力に同期してデータ転送を開始するのを禁止する。 As shown in FIG. 6, in the same manner as in the first embodiment, in S100, the CPU 12 sets the start timing of the data transfer period in the timer 18 and permits the DMAC 20 to start data transfer in synchronization with the synchronous output from the timer 18. Then, when an interrupt signal is output from the timer 18, in S130, the DMAC 20 is prohibited from starting data transfer in synchronization with the output from the timer 18.

一方、DMAC20は、S200にてCPU12から許可を受けることで、タイマ18からの同期出力に同期してデータ転送を開始することができるようになる。このため、DMAC20は、タイマ18からの同期出力が反転するのを待ち、タイマ18からの同期出力が反転すると、S230にて、レジスタ32に保存されたA/D変換結果をRAM16に転送する、データ転送を開始する。 Meanwhile, by receiving permission from the CPU 12 in S200, the DMAC 20 becomes able to start data transfer in synchronization with the synchronous output from the timer 18. Therefore, the DMAC 20 waits for the synchronous output from the timer 18 to invert, and when the synchronous output from the timer 18 is inverted, in S230, the DMAC 20 starts data transfer by transferring the A/D conversion result stored in the register 32 to the RAM 16.

このようにDMAC20がデータ転送を開始すると、CPU12から、S130の処理によって、タイマ18からの同期出力に同期してデータ転送を開始するのを禁止する指令が送信されてくる。 When the DMAC 20 starts data transfer in this way, the CPU 12 sends a command in the process of S130 to prohibit the start of data transfer in synchronization with the synchronous output from the timer 18.

このため、DMAC20は、S230にてデータ転送を開始すると、S240にて、CPU12からデータ転送開始の禁止指令が送信されてくるのを待ち、禁止指令が送信されてくると、タイマ18からの同期出力に同期してデータ転送を開始するのを禁止する。 Therefore, when the DMAC 20 starts data transfer in S230, it waits in S240 for a command to prohibit the start of data transfer to be sent from the CPU 12, and when the command is sent, it prohibits the start of data transfer in synchronization with the synchronous output from the timer 18.

S240の処理は、S230にてデータ転送を開始した後に実行されることから、DMAC20からのデータ転送は、続くS250にて、CPU12からデータ転送の停止指令を受けるまで継続される。そして、DMAC20は、S250にて、CPU12からのデータ転送の停止指令を受けると、データ転送を停止する。 The process of S240 is executed after the data transfer is started in S230, so the data transfer from the DMAC 20 continues until a command to stop the data transfer is received from the CPU 12 in the following S250. Then, when the DMAC 20 receives a command to stop the data transfer from the CPU 12 in S250, it stops the data transfer.

次に、CPU12は、S130の処理実行後は、S140に移行し、図7に示すように所定周期で実行される周期処理にて、DMAC20によりレジスタ32からRAM16へ転送されたデータの数が、予め設定された設定数に到達したか否かを判定する。 Next, after executing the process of S130, the CPU 12 proceeds to S140, and in the periodic process executed at a predetermined interval as shown in FIG. 7, it determines whether the amount of data transferred from the register 32 to the RAM 16 by the DMAC 20 has reached a preset number.

そして、S140の周期処理にて、レジスタ32からRAM16へ転送されたデータの数が設定数に到達していないと判定されると、S140に戻り、次の周期処理にて、再びデータ数の判定を実施する。 Then, if it is determined in the periodic processing of S140 that the amount of data transferred from register 32 to RAM 16 has not reached the set amount, the process returns to S140 and the amount of data is determined again in the next periodic processing.

一方、S140にて、レジスタ32からRAM16へ転送されたデータの数が設定数に到達していると判定されると、CPU12は、S150に移行して、DMAC20にデータ転送の停止指令を出力する。この結果、DMAC20によるRAM16へのデータ転送が停止される。 On the other hand, if it is determined in S140 that the amount of data transferred from the register 32 to the RAM 16 has reached the set amount, the CPU 12 proceeds to S150 and outputs a data transfer stop command to the DMAC 20. As a result, data transfer to the RAM 16 by the DMAC 20 is stopped.

このように、本実施形態では、DMAC20によるレジスタ32からRAM16へのデータ転送は、データ転送期間の開始タイミングから、転送されたデータの数が設定数に到達するまで継続される。従って、データ転送期間は、レジスタ32からRAM16に転送されたデータの数によって規定されることになる。 In this manner, in this embodiment, the data transfer by the DMAC 20 from the register 32 to the RAM 16 continues from the start of the data transfer period until the number of transferred data reaches the set number. Therefore, the data transfer period is determined by the number of data transferred from the register 32 to the RAM 16.

しかし、このようにしても、DMAC20によるデータ転送は、開始タイミングから遅れることなく開始され、CPU12は、データ転送開始後、設定数にて規定される所望の数だけ、データを取得することができる。
このため、CPU12は、第1実施形態と同様、所望のデータ転送期間の間にA/D変換器30でA/D変換されたデータを、正確な期間の間取得し、そのデータを使ってエンジン制御を適正に実施することができるようになる。
However, even in this case, the data transfer by the DMAC 20 is started without delay from the start timing, and the CPU 12 can obtain the desired number of data, as specified by the set number, after the data transfer starts.
Therefore, similar to the first embodiment, the CPU 12 can acquire the data A/D converted by the A/D converter 30 during the desired data transfer period for an accurate period of time, and use that data to properly perform engine control.

[変形例]
次に、上記実施形態では、CPU12は、データ転送期間中にDMAC20から転送されてきたデータを、全て、RAM16の所定の記憶領域に保存するものとして説明した。
[Modification]
Next, in the above embodiment, the CPU 12 is described as saving all data transferred from the DMAC 20 during a data transfer period in a predetermined storage area of the RAM 16 .

しかし、A/D変換器30において、検出信号がA/D変換されるまでに時間がかかることから、DMAC20からは、センサの実際の検出タイミングからこの時間(以下、A/D変換遅れ時間)分遅れて、検出信号のA/D変換結果が転送されることになる。 However, since it takes time for the detection signal to be A/D converted in the A/D converter 30, the A/D conversion result of the detection signal is transferred from the DMAC 20 with a delay of this time (hereinafter, A/D conversion delay time) from the actual detection timing of the sensor.

そこで、本変形例では、CPU12が、このA/D変換遅れ時間を考慮して、レジスタ32からRAM16へデータ転送するようにしている。
具体的には、CPU12は、図8に示すように、レジスタ32からRAM16に転送されたデータのうち、データ転送期間の開始タイミングからA/D変換遅れ時間が経過する間に転送されたデータを破棄する。また、CPU12は、データ転送期間を、A/D変換遅れ時間分延長する。
Therefore, in this modified example, the CPU 12 transfers data from the register 32 to the RAM 16, taking into account this A/D conversion delay time.
8, the CPU 12 discards data transferred from the register 32 to the RAM 16 during the A/D conversion delay time from the start timing of the data transfer period. Also, the CPU 12 extends the data transfer period by the A/D conversion delay time.

この結果、本変形例によれば、A/D変換器30においてA/D変換に要する遅れ時間の影響を受けることなく、所望のデータ転送期間内にセンサにて検出された検出信号のデータを取得することができるようになる。 As a result, according to this modified example, it becomes possible to obtain the detection signal data detected by the sensor within the desired data transfer period without being affected by the delay time required for A/D conversion in the A/D converter 30.

なお、第1実施形態において、データ転送期間をA/D変換の遅れ時間分延長するには、データ転送期間がA/D変換遅れ時間を含むように設定して、終了タイミングを決定するようにすればよい。 In the first embodiment, to extend the data transfer period by the delay time of the A/D conversion, the data transfer period is set to include the A/D conversion delay time, and the end timing is determined.

また、第2実施形態において、データ転送期間をA/D変換遅れ時間分延長するには、図6のS150にて判定に用いる設定数として、本来取得すべきデータの数にA/D変換遅れ時間に相当するデータの数を加えた数を設定するようにすればよい。 In addition, in the second embodiment, to extend the data transfer period by the A/D conversion delay time, the number used for the determination in S150 of FIG. 6 can be set to the number of data that should have been acquired plus the number of data that corresponds to the A/D conversion delay time.

以上、本開示の実施形態及び変形例について説明したが、本開示は上述の実施形態及び変形例に限定されることなく、種々変形して実施することができる。
例えば、上記実施形態では、ECU4は、車両に搭載されたエンジン2を制御するものとして説明したが、本開示の車両用電子制御装置は、自動変速機等、車両の駆動系に設けられたエンジン以外の機器を制御するものであってもよい。
Although the embodiments and modifications of the present disclosure have been described above, the present disclosure is not limited to the above-described embodiments and modifications, and can be implemented in various forms.
For example, in the above embodiment, the ECU 4 has been described as controlling the engine 2 mounted on the vehicle, but the vehicle electronic control device of the present disclosure may also control equipment other than the engine provided in the vehicle's drive system, such as an automatic transmission.

また、本開示の車両用電子制御装置は、制動装置等、車両の制動系に設けられた機器を制御するものであってもよく、空調装置等、車両の駆動・制動系以外の車載機器を制御するものであってもよい。 The electronic control device for a vehicle disclosed herein may also control devices installed in the braking system of the vehicle, such as a braking device, or may control on-board equipment other than the drive and braking system of the vehicle, such as an air conditioning device.

また、上記実施形態では、DMAC20は、データ入力部としてのA/D変換器30にてA/D変換されたデータを、RAM16に転送するものとして説明したが、DMACが転送するデータは、A/D変換されたデータに限定されるものではない。つまり、DMACがRAMに転送するデータは、例えば、他の電子制御装置や通信装置等から入力されるデータ等、車両用電子制御装置で利用されるデータであればよい。 In the above embodiment, the DMAC 20 has been described as transferring data that has been A/D converted by the A/D converter 30 as a data input unit to the RAM 16, but the data transferred by the DMAC is not limited to A/D converted data. In other words, the data that the DMAC transfers to the RAM may be any data used by the vehicle electronic control unit, such as data input from another electronic control unit or a communication device.

また、上記実施形態における1つの構成要素が有する複数の機能を、複数の構成要素によって実現したり、1つの構成要素が有する1つの機能を、複数の構成要素によって実現したりしてもよい。また、複数の構成要素が有する複数の機能を、1つの構成要素によって実現したり、複数の構成要素によって実現される1つの機能を、1つの構成要素によって実現したりしてもよい。また、上記実施形態の構成の一部を省略してもよい。また、上記実施形態の構成の少なくとも一部を、他の上記実施形態の構成に対して付加又は置換してもよい。 Furthermore, multiple functions possessed by one component in the above embodiments may be realized by multiple components, or one function possessed by one component may be realized by multiple components. Further, multiple functions possessed by multiple components may be realized by one component, or one function realized by multiple components may be realized by one component. Further, part of the configuration of the above embodiments may be omitted. Further, at least part of the configuration of the above embodiments may be added to or substituted for the configuration of another of the above embodiments.

2…ECU、10…マイコン、12…CPU、16…RAM、18…タイマ、20…DMAC、22…入力部。 2...ECU, 10...microcomputer, 12...CPU, 16...RAM, 18...timer, 20...DMAC, 22...input section.

Claims (5)

CPU(12)と、DMAコントローラ(20)と、RAM(16)と、タイマ(18)と、データ入力部(22)と、を備え、
前記CPUは、前記データ入力部に入力されたデータの転送を開始する開始タイミングを前記タイマにセットして、前記タイマから前記開始タイミングで第1割り込み信号を出力させ、前記タイマから出力される前記第1割り込み信号を受けると、前記データの転送を終了する終了タイミングを前記タイマにセットする割り込み処理を実施して、前記タイマから前記終了タイミングで第2割り込み信号を出力させる、ように構成され、
前記DMAコントローラは、前記タイマに同期した第1の出力に同期して、前記データ入力部から前記RAMへの前記データの転送を開始し、前記タイマに同期した第2の出力に同期して、前記データの転送を終了する、ように構成されている、車両用電子制御装置。
The device comprises a CPU (12), a DMA controller (20), a RAM (16), a timer (18), and a data input unit (22);
the CPU is configured to set a start timing for starting transfer of data input to the data input unit in the timer, and cause the timer to output a first interrupt signal at the start timing, and upon receiving the first interrupt signal output from the timer, execute an interrupt process for setting an end timing for ending the data transfer in the timer, and cause the timer to output a second interrupt signal at the end timing;
The DMA controller is configured to start a transfer of the data from the data input unit to the RAM in synchronization with a first output synchronized with the timer, and to end the transfer of the data in synchronization with a second output synchronized with the timer.
CPU(12)と、DMAコントローラ(20)と、RAM(16)と、タイマ(18)と、データ入力部(22)と、を備え、
前記CPUは、前記データ入力部に入力されたデータの転送を開始する開始タイミングを前記タイマにセットして、前記タイマから前記開始タイミングで割り込み信号を出力させるよう構成され、
前記DMAコントローラは、前記タイマに同期した出力に同期して、前記データ入力部から前記RAMへの前記データの転送を開始するよう構成され、
更に、前記CPUは、前記タイマから出力される前記割り込み信号を受けると、周期処理にて、前記データ入力部から前記RAMに転送された前記データの数が予め設定された設定数に達したか否かを判断し、前記データの数が前記設定数に達すると、前記DMAコントローラによる前記データの転送を終了させる、ように構成されている、車両用電子制御装置。
The device comprises a CPU (12), a DMA controller (20), a RAM (16), a timer (18), and a data input unit (22);
the CPU is configured to set a start timing for starting transfer of data input to the data input unit in the timer and to cause the timer to output an interrupt signal at the start timing;
the DMA controller is configured to initiate a transfer of the data from the data input to the RAM in synchronization with an output synchronized with the timer;
Furthermore, when the CPU receives the interrupt signal output from the timer, it determines in a periodic process whether the number of data transferred from the data input unit to the RAM has reached a preset number, and when the number of data has reached the preset number, it terminates the data transfer by the DMA controller.
請求項1又は請求項2に記載の車両用電子制御装置であって、
前記タイマは、制御対象の回転に同期してカウントするカウンタである、車両用電子制御装置。
3. The vehicle electronic control device according to claim 1,
The timer is a counter that counts in synchronization with the rotation of a controlled object.
請求項1~請求項3の何れか1項に記載の車両用電子制御装置であって、
前記データ入力部は、所定周期で入力信号をデジタルデータに変換するA/D変換器(30)を備え、前記DMAコントローラは、該A/D変換器によるA/D変換結果であるデータを記憶するレジスタ(32)から、該データを前記RAMに転送するよう構成されている、車両用電子制御装置。
The vehicle electronic control device according to any one of claims 1 to 3,
The data input unit includes an A/D converter (30) that converts an input signal into digital data at a predetermined period, and the DMA controller is configured to transfer data resulting from the A/D conversion by the A/D converter from a register (32) that stores the data to the RAM.
請求項4に記載の車両用電子制御装置であって、
前記CPUは、前記データの転送期間の間、前記RAMに転送された前記データのうち、前記A/D変換器によるA/D変換の遅れ時間が経過する間に転送された前記データを破棄し、前記データ転送期間を、前記遅れ時間分延長する、ように構成されている、車両用電子制御装置。
5. The vehicle electronic control device according to claim 4,
The CPU is configured to discard, during the data transfer period, the data transferred to the RAM during a delay time of A/D conversion by the A/D converter, and to extend the data transfer period by the delay time.
JP2021104184A 2021-06-23 2021-06-23 Vehicle Electronic Control Unit Active JP7528875B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2021104184A JP7528875B2 (en) 2021-06-23 2021-06-23 Vehicle Electronic Control Unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2021104184A JP7528875B2 (en) 2021-06-23 2021-06-23 Vehicle Electronic Control Unit

Publications (2)

Publication Number Publication Date
JP2023003171A JP2023003171A (en) 2023-01-11
JP7528875B2 true JP7528875B2 (en) 2024-08-06

Family

ID=84817279

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2021104184A Active JP7528875B2 (en) 2021-06-23 2021-06-23 Vehicle Electronic Control Unit

Country Status (1)

Country Link
JP (1) JP7528875B2 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000148663A (en) 1998-11-09 2000-05-30 Seiko Epson Corp DMA apparatus and image forming apparatus using the same
JP2005182505A (en) 2003-12-19 2005-07-07 Kyocera Mita Corp Data transfer controller and image forming apparatus
JP2005190195A (en) 2003-12-25 2005-07-14 Renesas Technology Corp Microcontroller
JP2010146258A (en) 2008-12-18 2010-07-01 Denso Corp Signal processing device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000148663A (en) 1998-11-09 2000-05-30 Seiko Epson Corp DMA apparatus and image forming apparatus using the same
JP2005182505A (en) 2003-12-19 2005-07-07 Kyocera Mita Corp Data transfer controller and image forming apparatus
JP2005190195A (en) 2003-12-25 2005-07-14 Renesas Technology Corp Microcontroller
JP2010146258A (en) 2008-12-18 2010-07-01 Denso Corp Signal processing device

Also Published As

Publication number Publication date
JP2023003171A (en) 2023-01-11

Similar Documents

Publication Publication Date Title
US7996732B2 (en) Program-execution monitoring method, system, and program
JP3791139B2 (en) Vehicle control device
JP5861718B2 (en) Electronic control device for vehicle and data receiving method
US6445998B2 (en) Engine control unit using pulses of different frequencies
JP7528875B2 (en) Vehicle Electronic Control Unit
JPH0427387B2 (en)
JP2006161645A (en) Sensor signal processing device for power train control
US7230526B2 (en) Device and method for synchronizing a flasher frequency with a central flashing frequency
JP7435182B2 (en) electronic control unit
JP2018155105A (en) Engine control device and electronic control device
US8131455B2 (en) Engine control apparatus including computing section and A/D converting section
JPH0610818A (en) Knocking control device for internal combustion engine
CN111176150B (en) Electronic control device and emergency interrupt method for micro-beat generation
JP6981512B2 (en) Electronic control device
US12158390B2 (en) Method and computing device for operating a control unit for an exhaust gas sensor
JPH0719104A (en) Input/output processing ic and input/output processing method
JP2615559B2 (en) Difference processing device for non-time synchronous AD conversion processing
JP2024140614A5 (en)
JP2001273152A (en) Electronic controller
JP4265026B2 (en) Serial communication controller
JPH0713897A (en) Serial communication device for data
JP2914775B2 (en) Engine ignition timing control device
JP2013161363A (en) Electronic control device and method for executing program
JPH05173935A (en) Data transfer method
JPH04362275A (en) Ignition controller for internal combustion engine

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20231009

TRDD Decision of grant or rejection written
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20240619

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20240625

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20240708

R150 Certificate of patent or registration of utility model

Ref document number: 7528875

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150