JP2018151921A - Electronic control device - Google Patents

Electronic control device Download PDF

Info

Publication number
JP2018151921A
JP2018151921A JP2017048309A JP2017048309A JP2018151921A JP 2018151921 A JP2018151921 A JP 2018151921A JP 2017048309 A JP2017048309 A JP 2017048309A JP 2017048309 A JP2017048309 A JP 2017048309A JP 2018151921 A JP2018151921 A JP 2018151921A
Authority
JP
Japan
Prior art keywords
microcomputer
command signal
trigger
communication
signal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2017048309A
Other languages
Japanese (ja)
Inventor
勇気 田代
Yuki Tashiro
勇気 田代
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.)
Keihin Corp
Original Assignee
Keihin 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 Keihin Corp filed Critical Keihin Corp
Priority to JP2017048309A priority Critical patent/JP2018151921A/en
Publication of JP2018151921A publication Critical patent/JP2018151921A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide an electronic control device capable of detecting abnormality of communication early and re-synchronizing at an early stage even when communication fails.SOLUTION: An electronic control device 1, in which a microcomputer 11 transmits a command signal to a microcomputer 12 via a data communication line L4 and the microcomputer 12 performs predetermined processing based on a command presented by the command signal, includes a DMA transfer counter 121 that counts the number of times the microcomputer 12 has received the command signal from the microcomputer 11 and a communication trigger line L1 via which a trigger signal presenting a trigger corresponding to termination of the transmission of the command signal from the microcomputer 11 to the microcomputer 12 is transmitted from the microcomputer 11 to the microcomputer 12. The microcomputer 12 determines that the data communication having received the command signal is abnormal when the value of the number of times the DMA transfer counter 121 counted at the trigger timing does not match a predetermined value.SELECTED DRAWING: Figure 1

Description

本発明は、電子制御装置に関し、特に、複数のマイクロコンピュータを備えると共にマイクロコンピュータ間で通信を行う電子制御装置に関する。   The present invention relates to an electronic control device, and more particularly to an electronic control device that includes a plurality of microcomputers and communicates between the microcomputers.

従来、複数のマイクロコンピュータ(以下、「マイコン」と記載する)を通信線で接続して連続通信を行う電子制御装置が知られている。かかる電子制御装置では、CPUを介さずに、DMA(Direct Memory Access)方式等により連続通信を行う。   2. Description of the Related Art Conventionally, an electronic control device that performs continuous communication by connecting a plurality of microcomputers (hereinafter referred to as “microcomputers”) via communication lines is known. In such an electronic control device, continuous communication is performed by a DMA (Direct Memory Access) method or the like without using a CPU.

かかる状況下で、特許文献1は、2つのマイコン間でシリアル通信を行うようにしたシリアル通信装置を開示する。かかるシリアル通信装置では、マスタ側マイコンは点火時期制御や燃料噴射制御等の主要なエンジン制御を司り、スレーブ側マイコンはエンジン制御に必要な各種センサによるセンシングデータのA/D変換、負荷演算及びその他補助的な制御を行う。   Under such circumstances, Patent Document 1 discloses a serial communication device configured to perform serial communication between two microcomputers. In such a serial communication device, the master side microcomputer controls main engine control such as ignition timing control and fuel injection control, and the slave side microcomputer performs A / D conversion of sensing data by various sensors necessary for engine control, load calculation, and others. Provide auxiliary control.

従来、マスタ側マイコンは、一定周期でRAMに種々のコマンドを格納する処理を実行すると共に、RAMに格納した各コマンドをスレーブ側マイコンに実行させるためのコマンド信号を、スレーブ側マイコンに所定回数送信する。スレーブ側マイコンは、マスタ側マイコンより受信したコマンド信号の各コマンドに応じて所定の処理を実行する。   Conventionally, the master-side microcomputer executes processing for storing various commands in the RAM at a constant cycle, and transmits a command signal for causing the slave-side microcomputer to execute each command stored in the RAM a predetermined number of times. To do. The slave side microcomputer executes a predetermined process in accordance with each command of the command signal received from the master side microcomputer.

また、従来、マスタ側マイコンは、コマンド信号を送信する回数をDMA転送カウンタでカウントし、所定回数のコマンド信号の送信終了後にDMA転送カウンタをリセットする。スレーブ側マイコンは、コマンド信号を受信する回数をDMA転送カウンタでカウントし、コマンド信号を所定回数受信した後に割込み処理を起動して、DMA転送カウンタをリセットする。このように、マスタ側マイコンとスレーブ側マイコンとは、DMA転送カウンタを用いて同期をとりながら通信を行う。   Conventionally, the master side microcomputer counts the number of times the command signal is transmitted by the DMA transfer counter, and resets the DMA transfer counter after completion of the predetermined number of command signal transmissions. The slave microcomputer counts the number of times the command signal is received by the DMA transfer counter, starts the interrupt process after receiving the command signal a predetermined number of times, and resets the DMA transfer counter. Thus, the master side microcomputer and the slave side microcomputer communicate with each other using the DMA transfer counter in synchronization.

特開2002−183082号公報JP 2002-183082 A

しかしながら、本発明者の検討によれば、DMA方式等による連続通信中においてノイズ等の影響により通信に失敗した場合において、マスタ側マイコンのDMA転送カウンタでカウントしたコマンド信号を送信する回数と、スレーブ側マイコンのDMA転送カウンタでカウントしたコマンド信号を受信する回数と、に差異を生じた場合に、正常な通信を行うことができなくなるために、ハンドシェーク通信等を行って再同期する必要を生じる。また、異常を検出してハンドシェーク通信等の後に再同期をするため、異常を検出してから正常状態に復帰するまでに時間を要する。   However, according to the study of the present inventor, when communication fails due to the influence of noise or the like during continuous communication by the DMA method or the like, the number of times of transmitting the command signal counted by the DMA transfer counter of the master side microcomputer, If there is a difference between the number of times the command signal counted by the DMA transfer counter of the side microcomputer is received and normal communication cannot be performed, it is necessary to perform resynchronization by performing handshake communication or the like. In addition, since resynchronization is performed after detecting an abnormality and performing handshake communication or the like, it takes time to return to a normal state after detecting the abnormality.

本発明は、以上の検討を経てなされたものであり、通信に失敗した場合であっても、通信の異常を早期に検出することができると共に、再同期を早期に行うことができる電子制御装置を提供することを目的とする。   The present invention has been made after the above examination, and even when communication fails, an electronic control device that can detect communication abnormality early and can perform resynchronization early The purpose is to provide.

以上の目的を達成するべく、本発明は、第1の局面において、互いに協働して制御対象機器群を制御する第1のマイコンと第2のマイコンとを備え、前記第1のマイコンからデータ通信線を介して前記第2のマイコンへコマンド信号を送信すると共に、前記第2のマイコンは前記コマンド信号が呈するコマンドに基づいて所定の処理を行う電子制御装置において、前記第2のマイコンが前記第1のマイコンから前記コマンド信号を受信した回数を計数するカウンタと、前記第1のマイコンから前記第2のマイコンへの前記コマンド信号の送信の終了に対応したトリガを呈するトリガ信号が、前記第1のマイコンから前記第2のマイコンに流れる通信トリガ線と、を更に備え、前記第2のマイコンは、前記トリガのタイミングで前記カウンタが計数した前記回数の値が所定値と一致しないときには、前記コマンド信号を受信したデータ通信が異常であると判定する電子制御装置である。   In order to achieve the above object, according to the first aspect of the present invention, in the first aspect, the present invention includes a first microcomputer and a second microcomputer that cooperate with each other to control the control target device group, and data from the first microcomputer In an electronic control device that transmits a command signal to the second microcomputer via a communication line, and the second microcomputer performs a predetermined process based on a command presented by the command signal, the second microcomputer A counter that counts the number of times the command signal is received from the first microcomputer; and a trigger signal that exhibits a trigger corresponding to the end of transmission of the command signal from the first microcomputer to the second microcomputer. A communication trigger line that flows from one microcomputer to the second microcomputer, and the second microcomputer has the counter at the trigger timing. When the value of the number of times of the number does not match the predetermined value, the data communication that has received the command signal is determined electronic control unit is abnormal.

本発明の第1の局面にかかる電子制御装置においては、互いに協働して制御対象機器群を制御する第1のマイコンと第2のマイコンとを備え、第1のマイコンからデータ通信線を介して第2のマイコンへコマンド信号を送信すると共に、第2のマイコンはコマンド信号が呈するコマンドに基づいて所定の処理を行う電子制御装置において、第2のマイコンが第1のマイコンからコマンド信号を受信した回数を計数するカウンタと、第1のマイコンから第2のマイコンへのコマンド信号の送信の終了に対応したトリガを呈するトリガ信号が、第1のマイコンから第2のマイコンに流れる通信トリガ線と、を更に備え、第2のマイコンは、トリガのタイミングでカウンタが計数した回数の値が所定値と一致しないときには、コマンド信号を受信したデータ通信が異常であると判定することにより、通信に失敗した場合であっても、通信の異常を早期に検出することができると共に、再同期を早期に行うことができる。   An electronic control device according to a first aspect of the present invention includes a first microcomputer and a second microcomputer that cooperate with each other to control a device group to be controlled, and are connected from the first microcomputer via a data communication line. The second microcomputer receives a command signal from the first microcomputer in an electronic control device that transmits a command signal to the second microcomputer and the second microcomputer performs a predetermined process based on the command presented by the command signal. A counter that counts the number of times of transmission, and a trigger signal that triggers a trigger corresponding to the end of transmission of the command signal from the first microcomputer to the second microcomputer, and a communication trigger line that flows from the first microcomputer to the second microcomputer; The second microcomputer receives a command signal when the value counted by the counter at the trigger timing does not match the predetermined value. By determining data communication is abnormal, even if the communication fails, it is possible to detect the abnormality of communication at an early stage, it is possible to perform resynchronization promptly.

図1は、本発明の実施形態における電子制御装置の構成を示すブロック図である。FIG. 1 is a block diagram showing a configuration of an electronic control device according to an embodiment of the present invention. 図2は、本実施形態における電子制御装置が実行するデータ通信処理の流れを説明するためのタイミングチャートである。FIG. 2 is a timing chart for explaining the flow of data communication processing executed by the electronic control unit according to this embodiment.

以下、図面を適宜参照して、本発明の実施形態における電子装置につき、詳細に説明する。   Hereinafter, an electronic device according to an embodiment of the present invention will be described in detail with reference to the drawings as appropriate.

<電子制御装置の構成>
図1を参照して、本実施形態における電子制御装置の構成について説明する。
<Configuration of electronic control device>
With reference to FIG. 1, the structure of the electronic control apparatus in this embodiment is demonstrated.

図1は、本発明の実施形態における電子制御装置の構成を示すブロック図である。   FIG. 1 is a block diagram showing a configuration of an electronic control device according to an embodiment of the present invention.

本実施形態における電子制御装置1は、典型的には自動二輪車等の車両に搭載される。   The electronic control device 1 in this embodiment is typically mounted on a vehicle such as a motorcycle.

電子制御装置1は、マイコン11と、マイコン12と、を備えている。マイコン11とマイコン12とは、トリガ信号を伝送するための通信トリガ線L1と、チップセレクタ信号を伝送するための信号線L2と、クロック信号を伝送するための信号線L3と、コマンド信号を伝送するためのデータ通信線L4と、転送データを伝送するためのデータ通信線L5と、により互いに接続され、互いに協働して燃料噴射装置等の制御対象機器群を制御する。   The electronic control device 1 includes a microcomputer 11 and a microcomputer 12. The microcomputer 11 and the microcomputer 12 transmit a communication trigger line L1 for transmitting a trigger signal, a signal line L2 for transmitting a chip selector signal, a signal line L3 for transmitting a clock signal, and a command signal. Are connected to each other by a data communication line L4 for transmitting data and a data communication line L5 for transmitting transfer data, and cooperate with each other to control a device group to be controlled such as a fuel injection device.

マイコン11及びマイコン12は、データ通信処理を実行して所定のデータ通信を行う。データ通信処理は、定周期で実行される。また、所定のデータ通信は、典型的にはDMA機能を活用したSPI(Serial Peripheral Interface)方式による通信である。   The microcomputer 11 and the microcomputer 12 perform data communication processing and perform predetermined data communication. Data communication processing is executed at regular intervals. Further, the predetermined data communication is typically communication by an SPI (Serial Peripheral Interface) method using a DMA function.

マイコン11は、信号線L2によりチップセレクト信号をマイコン12に送信する制御、及び信号線L3によりクロック信号をマイコン12に送信する制御を行う。   The microcomputer 11 performs control to transmit a chip select signal to the microcomputer 12 through the signal line L2 and control to transmit a clock signal to the microcomputer 12 through the signal line L3.

マイコン11は、図示しないRAMに種々のコマンドを格納する定周期処理を実行すると共に、RAMに格納した各コマンドをマイコン12に実行させるためのコマンド信号を、データ通信線L4によりマイコン12に所定の回数送信する制御を行う。マイコン11は、コマンド信号を送信する回数を計数するDMA転送カウンタ111を備えている。   The microcomputer 11 executes a periodic processing for storing various commands in a RAM (not shown), and sends a command signal for causing the microcomputer 12 to execute each command stored in the RAM to the microcomputer 12 through the data communication line L4. Control to send the number of times. The microcomputer 11 includes a DMA transfer counter 111 that counts the number of times the command signal is transmitted.

マイコン11は、コマンド信号の送信の開始に対応したトリガを呈すると共に、コマンド信号の送信の終了に対応したトリガを呈するトリガ信号を、通信トリガ線L1によりマイコン12に送信する制御を行う。マイコン11は、典型的にはマスタ側マイコンである。   The microcomputer 11 controls to transmit a trigger signal indicating a trigger corresponding to the end of transmission of the command signal to the microcomputer 12 via the communication trigger line L1 while presenting a trigger corresponding to the start of transmission of the command signal. The microcomputer 11 is typically a master side microcomputer.

マイコン12は、マイコン11より送信されたチップセレクト信号を信号線L2を介して受信し、マイコン11より送信されたクロック信号を信号線L3を介して受信する。   The microcomputer 12 receives the chip select signal transmitted from the microcomputer 11 via the signal line L2, and receives the clock signal transmitted from the microcomputer 11 via the signal line L3.

マイコン12は、マイコン11より送信されたコマンド信号をデータ通信線L4を介して受信し、受信したコマンド信号が呈するコマンドに基づいて所定の処理を行う。所定の処理は、マイコン11が実行する処理の補助的な処理であり、典型的にはセンシングデータのA/D変換又は信号出力である。   The microcomputer 12 receives the command signal transmitted from the microcomputer 11 via the data communication line L4, and performs a predetermined process based on the command presented by the received command signal. The predetermined process is an auxiliary process of the process executed by the microcomputer 11 and is typically A / D conversion or signal output of sensing data.

マイコン12は、マイコン11からコマンド信号を受信した回数を計数するDMA転送カウンタ121を備えている。マイコン12は、通信トリガ線L1を介して受信したトリガ信号におけるコマンド信号の送信の終了に対応したトリガのタイミングで割込み処理を実行し、DMA転送カウンタ121が計数した回数の値が所定値と一致しないときには、コマンド信号を受信したデータ通信が異常であると判定する。マイコン12は、典型的にはスレーブ側マイコンである。   The microcomputer 12 includes a DMA transfer counter 121 that counts the number of times the command signal is received from the microcomputer 11. The microcomputer 12 executes interrupt processing at the trigger timing corresponding to the end of transmission of the command signal in the trigger signal received via the communication trigger line L1, and the value of the number of times counted by the DMA transfer counter 121 matches the predetermined value. If not, it is determined that the data communication that received the command signal is abnormal. The microcomputer 12 is typically a slave-side microcomputer.

マイコン11がコマンド信号を送信する回数及びマイコン12がコマンド信号を受信する回数は、予め設定されている。   The number of times that the microcomputer 11 transmits the command signal and the number of times that the microcomputer 12 receives the command signal are set in advance.

以上のような構成を有する電子制御装置1は、以下に示すデータ通信処理を行う。   The electronic control device 1 having the above configuration performs the data communication process shown below.

<データ通信処理>
図2を参照して、本実施形態におけるデータ通信処理の具体的な流れについて詳しく説明する。
<Data communication processing>
With reference to FIG. 2, the specific flow of the data communication processing in this embodiment will be described in detail.

図2は、本実施形態における電子制御装置が実行するデータ通信処理の流れを説明するためのタイミングチャートである。   FIG. 2 is a timing chart for explaining the flow of data communication processing executed by the electronic control unit according to this embodiment.

本実施形態におけるデータ通信処理は、電子制御装置1に電力が供給されて電子制御装置1が起動したタイミングで開始となる。かかるデータ通信処理は、電子制御装置1が起動している間に、一定周期毎に繰り返し実行される。   The data communication process in the present embodiment starts at the timing when power is supplied to the electronic control device 1 and the electronic control device 1 is activated. Such data communication processing is repeatedly executed at regular intervals while the electronic control device 1 is activated.

最初に、データ通信処理において通信に成功した場合について説明する。   First, a case where communication is successful in the data communication process will be described.

まず、マイコン11は、マイコン12に所望の処理を実行させるためのコマンドを図示しないRAMに格納する定周期処理S1を実行する(図2(a))。   First, the microcomputer 11 executes a periodic process S1 for storing a command for causing the microcomputer 12 to execute a desired process in a RAM (not shown) (FIG. 2A).

マイコン11は、定周期処理S1中に、コマンド信号の送信の開始に対応したトリガを呈するトリガ信号をトリガ通信線L1により送信する(図2(c))。マイコン11は、典型的にはトリガ信号をローレベルからハイレベルにレベル反転(論理反転)させることにより、コマンド信号の送信の開始に対応したトリガとする。   The microcomputer 11 transmits a trigger signal that exhibits a trigger corresponding to the start of transmission of the command signal through the trigger communication line L1 during the periodic processing S1 (FIG. 2C). The microcomputer 11 typically sets the trigger corresponding to the start of transmission of the command signal by inverting the level of the trigger signal from low level to high level (logic inversion).

マイコン11は、コマンド信号の送信の開始に対応したトリガ信号のトリガのタイミングに同期して、チップセレクト信号をハイレベルからローレベルにレベル反転させる(図2(d))。かかるチップセレクト信号は、ローレベルの場合には通信中であることを示し、ハイレベルの場合には通信停止中であることを示すものであり、信号線L2により送信される。また、マイコン11は、コマンド信号の送信の開始に対応したトリガ信号のトリガのタイミングに同期して、クロック信号の送信を開始する(図2(e))。かかるクロック信号は、送信するデータが何ビット目であるかを示すものであり、信号線L3による送信される。更に、マイコン11は、コマンド信号の送信の開始に対応したトリガ信号のトリガのタイミングに同期して、1回目のコマンド信号の送信を開始する(図2(f))。かかるコマンド信号は、データ通信線L4により送信される。コマンド信号を送信する回数は、典型的には5回である。   The microcomputer 11 inverts the chip select signal from the high level to the low level in synchronization with the trigger timing of the trigger signal corresponding to the start of transmission of the command signal (FIG. 2D). When the chip select signal is at a low level, it indicates that communication is in progress, and when it is at a high level, it indicates that communication is stopped, and is transmitted through the signal line L2. Further, the microcomputer 11 starts transmission of the clock signal in synchronization with the trigger timing of the trigger signal corresponding to the start of transmission of the command signal (FIG. 2 (e)). Such a clock signal indicates the number of bits of data to be transmitted, and is transmitted through the signal line L3. Further, the microcomputer 11 starts transmission of the first command signal in synchronization with the trigger timing of the trigger signal corresponding to the start of transmission of the command signal (FIG. 2 (f)). Such a command signal is transmitted through the data communication line L4. The number of times the command signal is transmitted is typically five.

次に、マイコン12は、トリガ通信線L1を介して図2(c)に示すトリガ信号を受信し、受信したトリガ信号の立ち上がりエッジを検出することによりデータ通信の開始を認識する。   Next, the microcomputer 12 receives the trigger signal shown in FIG. 2C via the trigger communication line L1, and recognizes the start of data communication by detecting the rising edge of the received trigger signal.

マイコン12は、信号線L2を介してローレベルのチップセレクト信号を受信することにより通信中であることを認識し、信号線L3を介してクロック信号を受信することにより何ビット目のデータが送信されたのかを認識する。また、マイコン12は、データ通信線L4を介してコマンド信号を受信し、受信したコマンド信号を図示しないRAMに格納すると共に、DMA転送カウンタ121の予め設定しておいたカウント値5をデクリメントしてカウント値4とする(図2(h))。コマンド信号を受信する回数は、典型的には5回である。   The microcomputer 12 recognizes that communication is in progress by receiving a low-level chip select signal via the signal line L2, and transmits what bit data by receiving the clock signal via the signal line L3. Recognize what was done. The microcomputer 12 receives a command signal via the data communication line L4, stores the received command signal in a RAM (not shown), and decrements the preset count value 5 of the DMA transfer counter 121. The count value is 4 (FIG. 2 (h)). The number of times the command signal is received is typically five.

マイコン12は、前回のデータ通信処理でRAMに記憶した1回目のコマンド信号のコマンドが呈する所定の処理を実行して、1回目の転送データをデータ通信線L5を介して送信する(図2(g))。   The microcomputer 12 executes a predetermined process indicated by the command of the first command signal stored in the RAM in the previous data communication process, and transmits the first transfer data via the data communication line L5 (FIG. 2 ( g)).

次に、マイコン11及びマイコン12は、設定されている回数になるまで上記の処理を繰り返す。これにより、コマンド信号がデータ通信線L4を介してマイコン11から順次送信されると共にマイコン12により順次受信され、転送データがデータ通信線L5を介してマイコン12から順次送信されると共にマイコン11により順次受信される。また、DMA転送カウンタ111のカウント値は、コマンド信号の送信を終了する毎に順次デクリメントされて4、3、2、1となる(図2(b))。更に、DMA転送カウンタ121のカウント値は、コマンド信号を受信する毎に順次デクリメントされて4、3、2、1、0となる(図2(h))。   Next, the microcomputer 11 and the microcomputer 12 repeat the above processing until the set number of times is reached. Thereby, the command signal is sequentially transmitted from the microcomputer 11 through the data communication line L4 and is sequentially received by the microcomputer 12, and the transfer data is sequentially transmitted from the microcomputer 12 through the data communication line L5 and is sequentially transmitted by the microcomputer 11. Received. The count value of the DMA transfer counter 111 is sequentially decremented to 4, 3, 2, 1 every time the transmission of the command signal is finished (FIG. 2B). Further, the count value of the DMA transfer counter 121 is decremented sequentially every time a command signal is received, and becomes 4, 3, 2, 1, 0 (FIG. 2 (h)).

そして、マイコン11は、最後のコマンド信号の送信を終了した後に、DMA転送カウンタ111をリセットしてカウント値を「0」に設定し、コマンド信号の送信の終了に対応したトリガを呈するトリガ信号をトリガ通信線L1により送信する(図2(c))。マイコン11は、典型的にはトリガ信号をハイレベルからローレベルにレベル反転させることにより、コマンド信号の送信の終了に対応したトリガとする。   Then, after completing the transmission of the last command signal, the microcomputer 11 resets the DMA transfer counter 111 to set the count value to “0”, and generates a trigger signal indicating a trigger corresponding to the end of the transmission of the command signal. Transmission is performed by the trigger communication line L1 (FIG. 2C). The microcomputer 11 typically sets the trigger corresponding to the end of transmission of the command signal by inverting the level of the trigger signal from the high level to the low level.

マイコン12は、トリガ信号の立ち下りエッジを検出した際に、割込み処理S11を実行すると共に(図2(i))、DMA転送カンタ121のカウント値をリセットして5に設定する(図2(h))。かかる割込み処理S11において、マイコン12は、トリガ信号の立ち下がりエッジを検出したタイミングで、DMA転送カウンタ121のカウント値が所定値としての0に一致するため、コマンド信号を受信したデータ通信が正常であると判定する。   When the microcomputer 12 detects the falling edge of the trigger signal, it executes the interrupt processing S11 (FIG. 2 (i)), and resets the count value of the DMA transfer counter 121 to 5 (FIG. 2 (FIG. 2). h)). In the interrupt process S11, the microcomputer 12 detects that the falling edge of the trigger signal is detected, and the count value of the DMA transfer counter 121 matches 0 as a predetermined value. Therefore, the data communication that has received the command signal is normal. Judge that there is.

続いて、データ通信処理において通信に失敗した場合について説明する。   Next, a case where communication fails in the data communication process will be described.

マイコン11が定周期処理S2の実行を開始し、上記と同様の手順によるデータ通信中において、例えば、ローレベルのチップセレクト信号を3回目に送信する処理においてノイズを生じた場合には、マイコン12は、ノイズの乗ったハイレベルのチップセレクト信号を受信することとなり、通信停止中であるものと認識する。このため、マイコン12は、マイコン11から3回目に送信されたコマンド信号を正常に受信することができず、DMA転送カウンタ121のカウント値をデクリメントしない。この場合には、DMA転送カウンタ121のカウント値は3のままとなる。   If the microcomputer 11 starts executing the periodic processing S2 and noise is generated in the process of transmitting the low-level chip select signal for the third time during data communication according to the same procedure as described above, the microcomputer 12 Receives a high-level chip select signal with noise and recognizes that communication is stopped. For this reason, the microcomputer 12 cannot normally receive the command signal transmitted from the microcomputer 11 for the third time, and does not decrement the count value of the DMA transfer counter 121. In this case, the count value of the DMA transfer counter 121 remains 3.

そして、マイコン11は、ノイズの発生に気が付くことなく、コマンド信号の送信を継続し、DMA転送カウンタ111のカウント値をコマンド信号の送信を終了する毎に順次デクリメントする。   Then, the microcomputer 11 continues to transmit the command signal without noticing the occurrence of noise, and sequentially decrements the count value of the DMA transfer counter 111 every time the transmission of the command signal is completed.

また、マイコン12は、DMA転送カウンタ121のカウント値を、コマンド信号を受信する毎に順次デクリメントする。これにより、データ通信処理が終了した際には、DMA転送カウンタ121のカウント値は1となる。即ち、DMA転送カウント121のカウント値は、1回不足した回数の値になる。   Further, the microcomputer 12 sequentially decrements the count value of the DMA transfer counter 121 every time a command signal is received. Thereby, when the data communication process is completed, the count value of the DMA transfer counter 121 becomes 1. That is, the count value of the DMA transfer count 121 becomes the value of the number of times deficient once.

マイコン12は、DMA転送カウンタ121のカウント値が1の状態で、トリガ信号の立ち下りエッジを検出した際に、割込み処理S12を実行すると共にDMA転送カンタ121のカウント値をリセットして5にする。かかる割込み処理S12において、マイコン12は、トリガ信号の立ち下がりエッジを検出したタイミングで、DMA転送カウンタ121のカウント値が所定値としての0に一致しないため、コマンド信号を受信したデータ通信が異常であると判定する。   When the microcomputer 12 detects the falling edge of the trigger signal while the count value of the DMA transfer counter 121 is 1, the microcomputer 12 executes the interrupt processing S12 and resets the count value of the DMA transfer counter 121 to 5. . In the interrupt processing S12, the microcomputer 12 detects the falling edge of the trigger signal, and the count value of the DMA transfer counter 121 does not coincide with 0 as the predetermined value. Therefore, the data communication that received the command signal is abnormal. Judge that there is.

マイコン12は、データ通信が異常であると判定した場合には、フェールセーフアクションをとることができる。フェールセーフアクションは、典型的には、前回受信したコマンド信号を保持する処理の実行、又は受信したコマンド信号を代替信号に置き換える処理の実行である。   If the microcomputer 12 determines that the data communication is abnormal, it can take a fail-safe action. The fail-safe action is typically execution of processing for holding the previously received command signal, or execution of processing for replacing the received command signal with an alternative signal.

因みに、従来のDMA方式等によるデータ通信処理では、データ通信に失敗した場合に、スレーブ側のマイコンのDMA転送カウンタのカウント値は、データ通信に失敗した通信の次の通信が開始された際に所定値である0となる。これにより、スレーブ側のマイコンは、割込み処理を実行する。従って、従来のデータ通信処理は、本実施形態と比較して、通信が異常であることの検出が遅れると共に再同期が遅れる。   Incidentally, in the data communication processing by the conventional DMA method or the like, when the data communication fails, the count value of the DMA transfer counter of the slave microcomputer is the value when the communication next to the communication that failed in the data communication is started. The predetermined value is 0. As a result, the microcomputer on the slave side executes interrupt processing. Therefore, in the conventional data communication process, detection of an abnormal communication is delayed and resynchronization is delayed as compared with the present embodiment.

なお、図2ではチップセレクト信号にノイズが乗った場合にデータ通信が異常であると判定したが、クロック信号にノイズが乗った場合にも、マイコン12は、コマンド信号を正しく受信できずDMA転送カウンタ121のカウント値をデクリメントできないため、データ通信が異常であると判定することができる。   In FIG. 2, it is determined that the data communication is abnormal when noise is added to the chip select signal. However, even when noise is added to the clock signal, the microcomputer 12 cannot correctly receive the command signal and perform DMA transfer. Since the count value of the counter 121 cannot be decremented, it can be determined that the data communication is abnormal.

以上の本実施形態における電子制御装置では、マイコン12がマイコン11からコマンド信号を受信した回数を計数するDMA転送カウンタ121と、マイコン11からマイコン12へのコマンド信号の送信の終了に対応したトリガを呈するトリガ信号が、マイコン11からマイコン12に送信される通信トリガ線L1と、を有し、トリガのタイミングでDMA転送カウンタ121が計数した回数の値が所定値と一致しないときには、コマンド信号を受信したデータ通信が異常であると判定することにより、通信に失敗した場合であっても、通信の異常を早期に検出することができると共に、再同期を早期に行うことができる。   In the electronic control device in the present embodiment described above, the DMA transfer counter 121 that counts the number of times that the microcomputer 12 receives the command signal from the microcomputer 11 and the trigger corresponding to the end of transmission of the command signal from the microcomputer 11 to the microcomputer 12 are provided. When the present trigger signal has the communication trigger line L1 transmitted from the microcomputer 11 to the microcomputer 12, and the value of the number of times counted by the DMA transfer counter 121 at the trigger timing does not match the predetermined value, the command signal is received. By determining that the data communication is abnormal, even if the communication fails, the communication abnormality can be detected early and resynchronization can be performed early.

本発明は、部材の種類、形状、配置、個数等は前述の実施形態に限定されるものではなく、その構成要素を同等の作用効果を奏するものに適宜置換する等、発明の要旨を逸脱しない範2囲で適宜変更可能であることはもちろんである。   In the present invention, the type, shape, arrangement, number, etc. of the members are not limited to the above-described embodiments, and the constituent elements thereof are appropriately replaced with those having the same operational effects, etc. Of course, it can be changed as appropriate within range 2.

具体的には、本実施形態において、DMA方式又はSPI方式によるデータ通信を行ったが、DMA方式及びSPI方式以外の方式でマイコン間で連続通信するようにしてもよい。   Specifically, in this embodiment, data communication by the DMA method or the SPI method is performed, but continuous communication may be performed between the microcomputers by a method other than the DMA method and the SPI method.

また、本実施形態において、DMA転送カウンタ111及びDMA転送カウンタ121でカウントするカウント値を用いて、設定された回数より少ない回数の通信が行われたことを判定したが、DMA転送カウンタ121でカウントするカウント値を、設定された回数よりも多い回数をカウント可能な値に設定して、設定された回数よりも多い回数の通信が行われたことを判定するようにしてもよい。   In this embodiment, it is determined that the communication is performed less than the set number using the count values counted by the DMA transfer counter 111 and the DMA transfer counter 121. The count value to be set may be set to a value that can count the number of times greater than the set number of times, and it may be determined that the number of times of communication greater than the set number of times has been performed.

また、本実施形態において、DMA転送カウンタ111及びDMA転送カウンタ121をデクリメントしたがインクリメントしてもよく、また、カウントを開始するカウント値も任意の値に設定することができる。   In this embodiment, the DMA transfer counter 111 and the DMA transfer counter 121 are decremented, but may be incremented, and the count value for starting the count can be set to an arbitrary value.

以上のように、本発明においては、通信に失敗した場合であっても、通信の異常を早期に検出することができると共に、再同期を早期に行うことができる電子制御装置を提供することができ、その汎用普遍的な性格から自動二輪車等の電子制御装置に広範に適用され得るものと期待される。   As described above, according to the present invention, it is possible to provide an electronic control device capable of detecting a communication abnormality early and performing resynchronization early even if communication fails. It is expected that it can be widely applied to electronic control devices such as motorcycles because of its universality.

1…電子制御装置
11…マイコン
12…マイコン
111…DMA転送カウンタ
121…DMA転送カウンタ
L1…通信トリガ線
L2…信号線
L3…信号線
L4…データ通信線
L5…データ通信線
DESCRIPTION OF SYMBOLS 1 ... Electronic control unit 11 ... Microcomputer 12 ... Microcomputer 111 ... DMA transfer counter 121 ... DMA transfer counter L1 ... Communication trigger line L2 ... Signal line L3 ... Signal line L4 ... Data communication line L5 ... Data communication line

Claims (1)

互いに協働して制御対象機器群を制御する第1のマイコンと第2のマイコンとを備え、前記第1のマイコンからデータ通信線を介して前記第2のマイコンへコマンド信号を送信すると共に、前記第2のマイコンは前記コマンド信号が呈するコマンドに基づいて所定の処理を行う電子制御装置において、
前記第2のマイコンが前記第1のマイコンから前記コマンド信号を受信した回数を計数するカウンタと、
前記第1のマイコンから前記第2のマイコンへの前記コマンド信号の送信の終了に対応したトリガを呈するトリガ信号が、前記第1のマイコンから前記第2のマイコンに送信される通信トリガ線と、
を更に備え、
前記第2のマイコンは、
前記トリガのタイミングで前記カウンタが計数した前記回数の値が所定値と一致しないときには、前記コマンド信号を受信したデータ通信が異常であると判定する、
ことを特徴とする電子制御装置。
A first microcomputer and a second microcomputer that control the control target device group in cooperation with each other, transmit a command signal from the first microcomputer to the second microcomputer via a data communication line, and The second microcomputer is an electronic control device that performs predetermined processing based on a command presented by the command signal.
A counter for counting the number of times the second microcomputer has received the command signal from the first microcomputer;
A communication trigger line that transmits a trigger signal corresponding to the end of transmission of the command signal from the first microcomputer to the second microcomputer, and is transmitted from the first microcomputer to the second microcomputer;
Further comprising
The second microcomputer is
When the number of times counted by the counter at the timing of the trigger does not match a predetermined value, it is determined that the data communication that has received the command signal is abnormal.
An electronic control device characterized by that.
JP2017048309A 2017-03-14 2017-03-14 Electronic control device Pending JP2018151921A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017048309A JP2018151921A (en) 2017-03-14 2017-03-14 Electronic control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017048309A JP2018151921A (en) 2017-03-14 2017-03-14 Electronic control device

Publications (1)

Publication Number Publication Date
JP2018151921A true JP2018151921A (en) 2018-09-27

Family

ID=63679526

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017048309A Pending JP2018151921A (en) 2017-03-14 2017-03-14 Electronic control device

Country Status (1)

Country Link
JP (1) JP2018151921A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020077171A (en) * 2018-11-07 2020-05-21 株式会社デンソー Electronic control device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020077171A (en) * 2018-11-07 2020-05-21 株式会社デンソー Electronic control device
JP7155892B2 (en) 2018-11-07 2022-10-19 株式会社デンソー electronic controller

Similar Documents

Publication Publication Date Title
US10432421B2 (en) Communication control device and communication system
US10491530B2 (en) Communication system and communication device
EP2797263A1 (en) Communication system and communication method
JP5671388B2 (en) Communication system and communication apparatus
CN102541048A (en) Controller area network message transmission disable testing systems and methods
CN103416035A (en) Microcontroller with can bus module and auto speed detect
JP6207987B2 (en) In-vehicle electronic control unit
JP2018151921A (en) Electronic control device
JP4465905B2 (en) Electronic control unit
KR20150004232A (en) Watchdog apparatus and the controlling method thereof
JP2014524692A (en) Measurement value transmitter
WO2014147705A1 (en) Control/supervisory signal transmission system
US7848856B2 (en) Communication system and electronic control unit including communication system for vehicle control
CN114896110A (en) Link detection method, device, equipment and storage medium
JP6597325B2 (en) Electronic control unit
JP2014092047A (en) Counter device
JP6379925B2 (en) Communication waveform generator
JP2002033754A (en) Serial data transfer system, its control method, and communication system
JP5268791B2 (en) Control system
JP2007243747A (en) Transmission timing setting method of on-vehicle lan and electronic control unit
JP6492885B2 (en) Diagnostic equipment
JP2014105590A (en) Control device
JP2018067827A (en) Pulse signal communication system
JP5803853B2 (en) Electronic control unit
US20160150100A1 (en) Image forming apparatus, communication monitoring system, and communication monitoring circuit