JP5598441B2 - Communication device - Google Patents
Communication device Download PDFInfo
- Publication number
- JP5598441B2 JP5598441B2 JP2011164702A JP2011164702A JP5598441B2 JP 5598441 B2 JP5598441 B2 JP 5598441B2 JP 2011164702 A JP2011164702 A JP 2011164702A JP 2011164702 A JP2011164702 A JP 2011164702A JP 5598441 B2 JP5598441 B2 JP 5598441B2
- Authority
- JP
- Japan
- Prior art keywords
- reception
- frame
- received
- information
- register
- 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
Links
Images
Landscapes
- Small-Scale Networks (AREA)
- Communication Control (AREA)
Description
本発明は、共通のバス通信路に接続され、当該バス通信路を介して相互に通信を行う通信装置に関する。 The present invention relates to a communication apparatus that is connected to a common bus communication path and communicates with each other via the bus communication path.
従来、ローカルエリアネットワーク(LAN)、特に車内LANに多用されている通信プロトコルとして、CSMA/CA方式のCAN(Controller Area Network )プロトコルが知られている(特許文献1参照)。 Conventionally, a CSMA / CA CAN (Controller Area Network) protocol is known as a communication protocol widely used for a local area network (LAN), particularly an in-vehicle LAN (see Patent Document 1).
CANプロトコルで規定されたフレームの先頭部分には、後続のデータ領域にどのようなメッセージが割り付けられたフレームであるかを識別するための識別コード(ID)が含まれており、通信システムを構成する通信装置は、受信したフレームの種別を、そのフレームに含まれているIDに基づき識別する。 An identification code (ID) for identifying what kind of message is assigned to the subsequent data area is included in the head part of the frame defined by the CAN protocol, and constitutes a communication system. The communication device that performs identification identifies the type of the received frame based on the ID included in the frame.
また、複数の通信装置が共通のバス通信路を介して通信を行うため、送信すべきフレームを有する通信装置は、バス通信路が使用中でなければ直ちにフレームの送信を開始し、バス通信路が使用中であればバス通信路が解放(フレームの送信が終了)されてからフレームの送信を開始する。このため、送信すべきフレームを有する通信装置が複数存在すると、複数の通信装置が同時にフレームの送信を開始することがあり、この場合、バス通信路上でフレームの衝突が発生する。このようなフレームの衝突が発生した場合、CANプロトコルでは、どのフレームを優先的に処理するかを決定する調停処理を、前述のIDを用いて行うように規定されている。 In addition, since a plurality of communication devices communicate via a common bus communication path, a communication apparatus having a frame to be transmitted immediately starts transmitting a frame unless the bus communication path is in use. If the bus is in use, frame transmission starts after the bus communication path is released (frame transmission is completed). For this reason, if there are a plurality of communication devices having a frame to be transmitted, the plurality of communication devices may start transmitting frames at the same time. In this case, a frame collision occurs on the bus communication path. When such a frame collision occurs, the CAN protocol stipulates that an arbitration process for determining which frame is preferentially processed is performed using the above-described ID.
ところで、送信側の通信装置から受信側の通信装置へのフレームの正常な到達を判断するための情報としてACKと呼ばれる情報を返すことが行われている。具体的に、CANプロトコルでは、フレームを正常に受信したことを示すACK情報が、例えばフレームの特定ビット(ACKスロット)に割り当てられている。このとき送信側の通信装置は、フレームの送信中にフレームの信号レベルとバス通信路上の信号レベルとをビットごとに比較しているため、フレームの正常な受信が行われなかった場合に受信側の通信装置がフレームの特定ビットを書き換えることで、送信側の通信装置へACK情報を返すことができる。 Incidentally, information called ACK is returned as information for determining the normal arrival of a frame from the transmitting communication device to the receiving communication device. Specifically, in the CAN protocol, ACK information indicating that a frame has been normally received is assigned to a specific bit (ACK slot) of the frame, for example. At this time, since the communication device on the transmission side compares the signal level of the frame with the signal level on the bus communication channel for each bit during frame transmission, if the frame is not normally received, ACK information can be returned to the communication device on the transmission side by rewriting the specific bit of the frame.
しかしながら、汎用非同期送受信回路を有する信号処理部を用いて通信を行うことを考えた場合、汎用非同期送受信回路がいわゆる調歩同期であるため、CANプロトコルと同様の方式でACK情報を返すことはできない。これを実現するためには、マイコンとバス通信路とに介在するトランシーバにACKを返す機能を持たせる必要があり、結果として、トランシーバの規模が大きくなってしまう。 However, when communication is performed using a signal processing unit having a general-purpose asynchronous transmission / reception circuit, the general-purpose asynchronous transmission / reception circuit is so-called start-stop synchronization, and therefore ACK information cannot be returned in the same manner as the CAN protocol. In order to realize this, it is necessary to provide the transceiver interposed between the microcomputer and the bus communication path with a function of returning ACK, and as a result, the scale of the transceiver increases.
本発明は、上述した課題を解決するためになされたものであり、その目的は、汎用非同期送受信回路を有する信号処理部を用いて通信を行う場合に、トランシーバの規模を大きくすることなく、フレームの到達を通知可能な通信装置を提供することにある。 The present invention has been made in order to solve the above-described problems, and an object of the present invention is to perform frame communication without increasing the scale of a transceiver when performing communication using a signal processing unit having a general-purpose asynchronous transmission / reception circuit. It is to provide a communication device capable of notifying the arrival of.
上述の目的を達成するためになされた通信装置は、共通のバス通信路に接続され、当該バス通信路を介して相互に通信を行うものである。
本発明の通信装置は、信号処理部と、トランシーバとを備えている。信号処理部は、汎用非同期送受信回路を有している。また、トランシーバは、汎用非同期送受信回路からのフレームをバス通信路へ出力すると共にバス通信路を介して受信したフレームを汎用非同期送受信回路へ出力する。
Communication apparatus has been made in order to achieve the object described above, are connected to a common bus communication line, and performs communication with each other via the bus communication line.
The communication apparatus of the present invention includes a signal processing unit and a transceiver. The signal processing unit has a general-purpose asynchronous transmission / reception circuit. The transceiver outputs a frame from the general-purpose asynchronous transmission / reception circuit to the bus communication path and outputs a frame received via the bus communication path to the general-purpose asynchronous transmission / reception circuit.
ここで特に本発明では、信号処理部によって、受信側処理が実行される。この受信側処理では、バス通信路を介して受信したフレームに基づく受信情報がフレーム送信時におけるレスポンスに含まれるよう受信情報が格納される。 Here, particularly in the present invention, the reception side processing is executed by the signal processing unit. In this reception side processing, the reception information is stored so that the reception information based on the frame received via the bus communication path is included in the response at the time of frame transmission.
つまり、信号処理部には受信したフレームに基づく受信情報を格納するようにしたため、この受信情報をフレーム送信時にレスポンスに含めるようにすれば、過去に受信したフレームの情報を、他の通信装置へ通知することができる。このようにすれば、汎用非同期送受信回路を有する信号処理部を用いて通信を行う場合に、トランシーバの規模を大きくすることなく、フレームの到達を通知することができる。 That is, since the reception information based on the received frame is stored in the signal processing unit, if this reception information is included in the response at the time of frame transmission, the information of the frame received in the past is transmitted to other communication devices. You can be notified. In this way, when communication is performed using a signal processing unit having a general-purpose asynchronous transmission / reception circuit, arrival of a frame can be notified without increasing the size of the transceiver.
なお、信号処理部は、マイコンで構成してもよいし、例えばスレーブとして動作する通信装置であれば、汎用非同期送受信回路に相当する機能を少なくとも備えたシーケンサで構成してもよい。 Note that the signal processing unit may be configured by a microcomputer, or may be configured by a sequencer having at least a function corresponding to a general-purpose asynchronous transmission / reception circuit, for example, if the communication device operates as a slave.
受信側処理では、前記受信情報がフレーム送信時におけるレスポンスに含まれるようレスポンスを構成するデータの指定バイトに受信情報を格納することが考えられる。このようにすれば、フレーム送信時にはレスポンスを構成するデータの指定バイトが受信情報となるため、フレームの到達を比較的簡単に通知することができる。 In receiving side processing, the received information is considered to store the received information in the specified byte data constituting the response to include the response at the time of frame transmission. In this way, when the frame is transmitted, the designated byte of the data constituting the response becomes the reception information, so that the arrival of the frame can be notified relatively easily.
受信情報は、受信したフレームのヘッダに含まれるID値に基づく情報とすることが考えられる。このとき受信側処理では、過去の受信情報と受信したフレームのID値との演算結果を新たな受信情報として格納する。このようにすれば、受信情報は受信したフレームのID値で更新されていくため、過去のフレームの受信状況を把握することができる。すなわち、過去に送信されたフレームのうちどのフレームが受信されているのかを、受信情報に基づいて判定できる可能性が高くなる。 Receiving information, it is considered to be information based on the ID value included in the header of the received frame. At this time, in the receiving process, the calculation result of the past received information and the ID value of the received frame is stored as new received information. In this way, since the reception information is updated with the ID value of the received frame, it is possible to grasp the reception status of the past frame. That is, there is a high possibility that it can be determined based on the received information which frame has been received among frames transmitted in the past.
具体的に、受信情報となる演算結果は、過去の受信情報と受信したフレームのID値との論理和であることが考えられる。このようにすれば、受信情報としてフレームのID値が加算されていくため、過去のフレームの受信状況を把握することができる。 Specifically, the operation result of the received information, it is considered to be a logical sum of the ID value of the received frame and the reception information in the past. In this way, since the frame ID value is added as the reception information, it is possible to grasp the reception status of the past frame.
受信情報は、受信したフレーム数とすることが考えられる。このとき受信側処理では、フレームを受信した際に過去の受信情報をインクリメントし新たな受信情報として格納する。このようにすれば、受信情報は受信したフレームの数に対応したものとなるため、過去のフレームの受信状況を把握することができる。すなわち、カウント開始から現在までフレームが残らず受信されているか否かを、受信情報に基づいて判定できる。 Receiving information, it is conceivable that a number of frames received. At this time, in the receiving side processing, when receiving the frame, the past received information is incremented and stored as new received information. In this way, since the reception information corresponds to the number of received frames, it is possible to grasp the reception status of past frames. That is, it can be determined based on the reception information whether or not all frames have been received from the start of counting to the present.
なお、上記構成において、受信側処理では、バス通信路を介して受信したフレームのヘッダに含まれるID値に基づき、特定のフレームについてのみ前記受信情報を格納することとしてもよい。例えば、予め決められた範囲のID値を有するフレーム数のみをカウントして受信情報にするという具合である。このようにすれば、特定のフレームの到達を通知することが可能となる。 In the above configuration, in the receiving side processing, based on the ID value included in the header of the frame received via the bus communication line, it is also possible to store the received information only about the particular frame. For example, only the number of frames having an ID value in a predetermined range is counted and used as reception information. In this way, it is possible to notify the arrival of a specific frame.
また、受信側処理では、所定条件の成立時に、受信情報をクリアすることとしてもよい。「所定条件の成立時」は、一定期間の経過、一定数のフレーム送信後、あるいは、記憶される受信情報が桁溢れ(オーバーフロー)を生じない程度のタイミングであることが考えられる。「受信情報をクリアする」とは、受信情報のリセットを意味し、一例として「0」にすることが考えられる。このようにすれば、過去のフレームの受信状況を、受信情報のクリアのタイミングから把握することができる。 Further, in the receiving side processing, during the establishment of a predetermined condition, it is also possible to clear the received information. “When the predetermined condition is satisfied” is considered to be a timing at which a certain period of time has elapsed, a certain number of frames have been transmitted, or the received information stored does not overflow (overflow). “Clearing received information” means resetting received information. As an example, “clearing received information” can be considered. In this way, the reception status of the past frame can be grasped from the timing of clearing the reception information.
以下に本発明の実施形態を図面と共に説明する。
[第1実施形態]
図1は、車両に搭載される通信システムの概略構成を示すブロック図である。
Embodiments of the present invention will be described below with reference to the drawings.
[First Embodiment]
FIG. 1 is a block diagram showing a schematic configuration of a communication system mounted on a vehicle.
通信システムは、複数の通信装置(以下「ECU」という)10を備えている。これらのECU10は、バス通信路40を介して相互に接続されている。
通信システムを構成するECU10は、例えばボデー系ECUであることが考えられる。具体的には、ボデー・ワイパECU,シートECU,スライドドアECU,ミラーECU,バックドアECU,ライトECU,チルテレ(電動ステアリング位置調整装置)ECU等がある。なお、ここではECU10が相互に接続される態様を示したが、ボデー系ECUと共に、関連機器としてのライトSW,ワイパSW,ライトセンサ,レインセンサ等を通信装置として接続することも考えられる。
The communication system includes a plurality of communication devices (hereinafter referred to as “ECUs”) 10. These
The ECU 10 constituting the communication system may be a body system ECU, for example. Specifically, there are a body wiper ECU, a seat ECU, a slide door ECU, a mirror ECU, a back door ECU, a light ECU, a tilt tele (electric steering position adjustment device) ECU, and the like. In addition, although the aspect in which ECU10 was mutually connected was shown here, it is also considered that light SW, wiper SW, a light sensor, a rain sensor, etc. as a related apparatus are connected as a communication apparatus with body system ECU.
バス通信路40は、異なるECU10からハイレベルの信号とロウレベルの信号とが同時に出力されると、バス通信路40上の信号レベルがロウレベルとなるように構成されており、この機能を利用してバス調停を実現する。
The
ここで図2(a)は、バス通信路40で使用する伝送路符号を示す説明図である。
図2(a)に示すように、バス通信路40では、伝送路符号として、ビットの途中で信号レベルがロウレベルからハイレベルに変化するPWM符号が用いられ、ドミナント(本実施形態では0に対応)およびレセッシブ(本実施形態では1に対応)からなる二値の信号を2種類のデューティ比で表現する。
Here, FIG. 2A is an explanatory diagram showing transmission path codes used in the
As shown in FIG. 2A, in the
具体的には、ドミナントの方がレセッシブよりロウレベルの比率が長くなるよう(本実施形態では、ドミナントが1ビットの2/3の期間、レセッシブが1ビットの1/3の期間)に設定され、バス通信路40上でドミナントとレセッシブとが衝突すると、ドミナントが調停勝ちするようにされている。
Specifically, the dominant is set so that the ratio of the low level is longer than the recessive (in this embodiment, the dominant is a 2/3 period of 1 bit and the recessive is a 1/3 period of 1 bit) When a dominant and recessive collision occurs on the
そして、通信システムでは、調停負けしたECU10は送信を直ちに停止し、調停勝ちしたECU10のみが送信を継続する、いわゆるCSMA/CA方式のアクセス制御方式が用いられている。
In the communication system, a so-called CSMA / CA access control method is used in which the
また、図2(b)はECU10間の通信に使用するレームの構成を示す説明図である。
図2(b)に示すように、フレームは、送信を許可するデータを指定するためのヘッダと、ヘッダによって指定されたデータを送信するための可変長のレスポンスからなる。
FIG. 2B is an explanatory diagram showing the configuration of the ram used for communication between the
As shown in FIG. 2B, the frame includes a header for designating data permitted to be transmitted and a variable length response for transmitting the data designated by the header.
このうち、ヘッダは、識別子(ID)を含み、IDの値が小さいほど、バス調停で勝ち残るように設定されている。一方、レスポンスは、データ以外に、データ(レスポンス)のサイズを示すサイズ情報、エラーの有無をチェックするためのCRC符号が少なくとも含まれている。 Among these, the header includes an identifier (ID), and is set so that the smaller the ID value, the longer the bus arbitration is won. On the other hand, the response includes at least size information indicating the size of the data (response) and a CRC code for checking the presence / absence of an error in addition to the data.
また、ECU10の一つをマスタ、他のECU10をスレーブとして、マスタがヘッダを送信することによって、送信を許可するデータ(ひいてはデータの送信元となるスレーブ)を順次指定し、ヘッダによって指定されたデータの送信元となるスレーブがレスポンス(データ)を送信するポーリング(定期通信)と、マスタからの指示によらずスレーブが自律的に通信を制御するイベント通信とを実行する。
In addition, one of the
次にECU10の構成を説明する。
図1に示したように、ECU10は、マイコン20と、トランシーバ30とを備えている。
Next, the configuration of the
As shown in FIG. 1, the
マイコン20は、バス通信路40を介した他ECU10との通信によって得られた情報等に基づき、自ECU10に割り当てられた各種処理を実行する。したがって、マイコン20は、CPU、ROM、RAM、I/Oポート等からなる周知のマイクロコンピュータを中心に構成されている。
The
また、マイコン20は、UART(汎用非同期送受信回路:Universal Asynchronous Receiver Transmitter )21、及び、発振子22を有している。このUART21により、調歩同期(非同期)方式のシリアル通信が実現される。また、発振子22は、マイコン20を動作させるための動作クロック及び、トランシーバ30へ供給される内部クロックを発生させる。この内部クロックは、UART21の通信速度と同じ速度(本実施形態では20Kbps)に設定されている。
The
但し、スレーブノードは、必ずしもマイコン20によって構成する必要はなく、UART11に相当する機能を少なくとも備えたシーケンサと、そのシーケンサを動作させる動作クロックを生成する発振回路とによって構成してもよい。
However, the slave node is not necessarily configured by the
図2(c)は、UART21が送受信するデータの構成を示す説明図である。図2(c)に示すように、UART21は、データの開始を示す1ビット長のスタートビット(ロウレベル)と、データの終了を示すストップビット(ハイレベル)と、これらスタートビット,ストップビットに挟まれた8ビットのデータとで構成された合計10ビットのブロック単位のデータを送受信する。 FIG. 2C is an explanatory diagram showing a configuration of data transmitted / received by the UART 21. As shown in FIG. 2C, the UART 21 is sandwiched between a start bit (low level) indicating the start of data, a stop bit (high level) indicating the end of data, and the start bit and stop bit. A total 10-bit block unit data composed of the 8-bit data is transmitted and received.
なお、前述のフレーム(図2(b)参照)を構成するヘッダは、単一のブロックデータで構成され、スタートビット,ストップビットを除く8ビットのデータのうち、7ビットはIDとして用いられ、1ビットはパリティビットとして用いられる。また、レスポンスは、1ないし複数個のブロックデータで構成され、最初のブロックに、サイズ情報が設定される。なお、本実施形態では、レスポンスのデータの指定バイトにID情報が格納される。例えばデータの最終バイトにID情報が格納されるものとする。 The header constituting the above-mentioned frame (see FIG. 2B) is composed of a single block data, and 7 bits are used as an ID among 8 bits data excluding the start bit and stop bit. One bit is used as a parity bit. The response is composed of one or a plurality of block data, and size information is set in the first block. In this embodiment, ID information is stored in a designated byte of response data. For example, it is assumed that ID information is stored in the last byte of data.
一方、トランシーバ30は、マイコン20から供給される送信データを符号化してバス通信路40に出力すると共に、バス通信路40から取り込んだPWM符号の受信データを復号化してマイコン20に供給する。
On the other hand, the
次に、ECU10のマイコン20にて実行される受信側処理を図3に基づき説明する。この受信側処理は、他ECU10からの送信データの受信に際し実行される。
最初のS100では、フレーム受信完了か否かを判断する。ここでフレームの受信が完了したと判断された場合(S100:YES)、S110へ移行する。一方、フレームの受信が完了していないうちは(S100:NO)、S100の判断処理を繰り返す。
Next, the receiving side process executed by the
In first S100, it is determined whether or not frame reception is completed. If it is determined that the reception of the frame is completed (S100: YES), the process proceeds to S110. On the other hand, while the reception of the frame is not completed (S100: NO), the determination process of S100 is repeated.
S110では、受信IDレジスタのクリア条件が成立したか否かを判断する。受信IDレジスタは、受信情報を格納するためにマイコン20に設けられるレジスタである。なお、受信IDレジスタは、定期的にクリアしてもよいし、一定数のフレームが送信されたときにクリアしてもよいし、レジスタがオーバーフローしないようにクリアしてもよい。ここで受信IDレジスタのクリア条件が成立したと判断された場合(S110:YES)、S130にて受信IDレジスタをクリアして「0x00」とし、その後、S140へ移行する。一方、受信IDレジスタのクリア条件が成立していないと判断された場合(S110:NO)、S120にて受信IDレジスタに受信したIDを加算し、その後、S140へ移行する。詳しくは、受信IDレジスタの値と受信IDの値との論理和(OR)を取り、当該論理和を受信IDレジスタに格納する。
In S110, it is determined whether a condition for clearing the reception ID register is satisfied. The reception ID register is a register provided in the
S140では、データの指定位置に、受信IDレジスタの値を格納する。この処理は、レスポンスのデータの指定バイトに、受信IDレジスタの値を格納しておくものである。本実施形態では、データの最終バイトに受信IDレジスタの値が格納されるものとする。これにより、フレーム送信時に、レスポンスのデータの最終バイトに、受信IDレジスタの値が格納されて送信されることになる。 In S140, the value of the reception ID register is stored at the designated position of the data. In this process, the value of the reception ID register is stored in the designated byte of the response data. In the present embodiment, it is assumed that the value of the reception ID register is stored in the last byte of data. Thus, at the time of frame transmission, the value of the reception ID register is stored in the last byte of the response data and transmitted.
具体的には、図4に示すように、ID「0x10」のヘッダとレスポンスとからなるフレームが最初に送信されたものとする。このとき、受信IDレジスタの値「0x00」がデータの最終バイトに格納されたレスポンスが送信される(図中の記号A)。 Specifically, as shown in FIG. 4, it is assumed that a frame including a header having an ID “0x10” and a response is transmitted first. At this time, a response in which the value “0x00” of the reception ID register is stored in the last byte of the data is transmitted (symbol A in the figure).
このフレームを受信したECU10は(S100:YES)、受信IDレジスタのクリア条件が成立していなければ(S110:NO)、受信IDレジスタの値「0x00」に受信したID「0x10」を加算する(S120)。したがって、受信IDレジスタの値が「0x10」となり、データの指定位置に「0x10」が格納される(S140)。
The
これにより、次にECU10がID「0x15」のヘッダとレスポンスとからなるフレームを送信した場合、レスポンスのデータの最終バイトは「0x10」となる(図中の記号B)。
As a result, when the
同様に、このフレームを受信したECU10は、受信IDレジスタの値「0x10」に受信したID「0x15」を加算する(S120)。この場合、2進数の「00010000」と2進数の「00010101」のORをとるため、2進数で「00010101」となる。すなわち、16進数では「0x15」となる。
Similarly, the
これにより、次にECU10がID「0x20」のヘッダとレスポンスとからなるフレームを送信した場合、レスポンスのデータの最終バイトは「0x15」となる(図中の記号C)。
As a result, when the
以上詳述したように、本実施形態によれば、フレームの受信を判断し(図3中のS100)、フレームの受信が完了すると(S100:YES)、受信IDレジスタに受信したIDを加算し(S120)、データの指定位置に受信IDレジスタの値を格納する(S140)。これにより、汎用非同期送受信回路を有するマイコン20を用いて通信を行う場合に、トランシーバ30の規模を大きくすることなく、フレームの到達を通知することができる。
As described in detail above, according to the present embodiment, reception of a frame is determined (S100 in FIG. 3), and when reception of the frame is completed (S100: YES), the received ID is added to the reception ID register. (S120), the value of the reception ID register is stored in the designated position of the data (S140). Thus, when communication is performed using the
特に受信側処理においてデータの指定位置に受信IDレジスタの値を格納することで(図3中のS140)、フレーム送信時にはレスポンスを構成するデータの指定位置が受信情報となり、フレームの到達を比較的簡単に通知することができる。 In particular, by storing the value of the reception ID register at the data specified position in the processing on the receiving side (S140 in FIG. 3), the data specified position constituting the response becomes reception information at the time of frame transmission, and the arrival of the frame is relatively Can be easily notified.
また、本実施形態では、受信IDレジスタに受信したIDを加算したもの(図3中のS120)、具体的には、受信IDレジスタの値と受信したID値との論理和を受信情報として受信IDレジスタに格納する。これにより、過去に送信されたフレームのうちどのフレームが受信されているのかを、受信情報に基づいて判定できる可能性が高くなる。その結果、過去のフレームの受信状況を把握することができる。 In this embodiment, the received ID is added to the received ID register (S120 in FIG. 3), specifically, the logical sum of the received ID register value and the received ID value is received as received information. Store in ID register. This increases the possibility that it can be determined based on the received information which frame has been received among frames transmitted in the past. As a result, it is possible to grasp the reception status of past frames.
さらにまた、本実施形態では、受信IDレジスタのクリア条件が成立したか否かを判断し(図3中のS110)、クリア条件が成立した場合には(S110:YES)、受信IDレジスタをクリアして「0x00」とする(S130)。これにより、過去のフレームの受信状況を、受信IDレジスタのクリアのタイミングから把握することができる。 Furthermore, in this embodiment, it is determined whether or not the clear condition of the reception ID register is satisfied (S110 in FIG. 3). If the clear condition is satisfied (S110: YES), the reception ID register is cleared. Then, “0x00” is set (S130). Thereby, the reception status of the past frame can be grasped from the timing of clearing the reception ID register.
なお、本実施形態におけるECU10が「通信装置」を構成し、UART21が「汎用非同期送受信回路」を構成し、マイコン20が「信号処理部」を構成し、トランシーバ30が「トランシーバ」を構成し、バス通信路40が「バス通信路」を構成する。また、図3に示した受信側処理が「受信側処理」に相当する。
In this embodiment, the
[第2実施形態]
上記第1実施形態は、受信したIDを受信IDレジスタに加算する構成であった。これに対し、第2実施形態では、フレーム受信の回数を記憶することを特徴とする。そのため、上記第1実施形態と異なるのは、受信側処理の一部の処理となっている。
[Second Embodiment]
In the first embodiment, the received ID is added to the reception ID register. In contrast, the second embodiment is characterized in that the number of frame receptions is stored. Therefore, what is different from the first embodiment is a part of the processing on the receiving side.
そこで次に、ECU10のマイコン20にて実行される受信側処理を図5に基づき説明する。この受信側処理は、他ECU10からの送信データの受信に際し実行される。
最初のS200では、フレーム受信完了か否かを判断する。ここでフレームの受信が完了したと判断された場合(S200:YES)、S210へ移行する。一方、フレームの受信が完了していないうちは(S200:NO)、S200の判断処理を繰り返す。
Then, the receiving side process executed by the
In first S200, it is determined whether or not the frame reception is completed. Here, when it is determined that the reception of the frame is completed (S200: YES), the process proceeds to S210. On the other hand, while the reception of the frame is not completed (S200: NO), the determination process of S200 is repeated.
S210では、受信IDレジスタのクリア条件が成立したか否かを判断する。受信IDレジスタは、ID情報を格納するためにマイコン20に設けられるレジスタである。なお、受信IDレジスタは、定期的にクリアしてもよいし、一定数のフレームが送信されたときにクリアしてもよいし、レジスタがオーバーフローしないようにクリアしてもよい。ここで受信IDレジスタのクリア条件が成立したと判断された場合(S210:YES)、S230にて受信IDレジスタをクリアして「0x00」とし、その後、S240へ移行する。一方、受信IDレジスタのクリア条件が成立していないと判断された場合(S210:NO)、S220にて受信IDレジスタをインクリメントし、その後、S240へ移行する。
In S210, it is determined whether a clear condition of the reception ID register is satisfied. The reception ID register is a register provided in the
S240では、データの指定位置に、受信IDレジスタの値を格納する。この処理は、レスポンスのデータの指定バイトに、受信IDレジスタの値を格納しておくものである。本実施形態では、データの最終バイトに受信IDレジスタの値が格納されるものとする。これにより、フレーム送信時に、レスポンスのデータの指定バイトに、受信IDレジスタの値が格納されて送信されることになる。 In S240, the value of the reception ID register is stored at the designated position of the data. In this process, the value of the reception ID register is stored in the designated byte of the response data. In the present embodiment, it is assumed that the value of the reception ID register is stored in the last byte of data. Thus, at the time of frame transmission, the value of the reception ID register is stored in the designated byte of the response data and transmitted.
具体的には、図6に示すように、ID「0x10」のヘッダとレスポンスとからなるフレームが最初に送信されたものとする。このとき、受信IDレジスタの値「0x00」がデータの最終バイトに格納されたレスポンスが送信される(図中の記号A)。 Specifically, as shown in FIG. 6, it is assumed that a frame including a header having an ID “0x10” and a response is transmitted first. At this time, a response in which the value “0x00” of the reception ID register is stored in the last byte of the data is transmitted (symbol A in the figure).
このフレームを受信したECU10は(S200:YES)、受信IDレジスタのクリア条件が成立していなければ(S210:NO)、受信IDレジスタの値「0x00」をインクリメントして「0x01」とする(S220)。したがって、受信IDレジスタの値が「0x01」となり、データの指定位置に「0x01」が格納される(S240)。 Upon receiving this frame (S200: YES), if the clear condition of the reception ID register is not satisfied (S210: NO), the value “0x00” of the reception ID register is incremented to “0x01” (S220). ). Therefore, the value of the reception ID register becomes “0x01”, and “0x01” is stored at the designated position of the data (S240).
これにより、次にECU10がID「0x15」のヘッダとレスポンスとからなるフレームを送信した場合、レスポンスのデータの最終バイトは「0x01」となる(図中の記号B)。
As a result, when the
同様に、このフレームを受信したECU10は、受信IDレジスタの値「0x01」をインクリメントして「0x02」とする(S220)。
これにより、次にECU10がID「0x20」のヘッダとレスポンスとからなるフレームを送信した場合、レスポンスのデータの最終バイトは「0x02」となる(図中の記号C)。
Similarly, the
As a result, when the
以上詳述したように、本実施形態によれば、フレームの受信を判断し(図5中のS200)、フレームの受信が完了すると(S200:YES)、受信IDレジスタの値をインクリメントし(S220)、データの指定位置に受信IDレジスタの値を格納する(S240)。これにより、汎用非同期送受信回路を有するマイコン20を用いて通信を行う場合に、トランシーバ30の規模を大きくすることなく、フレームの到達を通知することができる。
As described above in detail, according to the present embodiment, reception of a frame is determined (S200 in FIG. 5), and when reception of the frame is completed (S200: YES), the value of the reception ID register is incremented (S220). ), The value of the reception ID register is stored in the designated position of the data (S240). Thus, when communication is performed using the
特に受信側処理においてデータの指定位置に受信IDレジスタの値を格納することで(図5中のS240)、フレーム送信時にはレスポンスを構成するデータの指定位置が受信情報となり、フレームの到達を比較的簡単に通知することができる。 In particular, by storing the value of the reception ID register at the data specified position in the reception side processing (S240 in FIG. 5), the data specified position constituting the response becomes reception information at the time of frame transmission, and the arrival of the frame is relatively Can be easily notified.
また、本実施形態では、受信IDレジスタの値をインクリメントすることで(図5中のS220)、受信したフレーム数を受信情報として受信IDレジスタに格納する。これにより、カウント開始から現在までフレームが残らず受信されているか否かを、受信情報に基づいて判定できる。その結果、過去のフレームの受信状況を把握することができる。 In this embodiment, by incrementing the value of the reception ID register (S220 in FIG. 5), the number of received frames is stored in the reception ID register as reception information. Thereby, it can be determined based on the reception information whether or not all frames are received from the start of counting until the present. As a result, it is possible to grasp the reception status of past frames.
さらにまた、本実施形態では、受信IDレジスタのクリア条件が成立したか否かを判断し(図5中のS210)、クリア条件が成立した場合には(S210:YES)、受信IDレジスタをクリアして「0x00」とする(S230)。これにより、過去のフレームの受信状況を、受信IDレジスタのクリアのタイミングから把握することができる。 Furthermore, in this embodiment, it is determined whether or not a clear condition for the reception ID register is satisfied (S210 in FIG. 5). If the clear condition is satisfied (S210: YES), the reception ID register is cleared. Then, “0x00” is set (S230). Thereby, the reception status of the past frame can be grasped from the timing of clearing the reception ID register.
なお、本実施形態におけるECU10が「通信装置」を構成し、UART21が「汎用非同期送受信回路」を構成し、マイコン20が「信号処理部」を構成し、トランシーバ30が「トランシーバ」を構成し、バス通信路40が「バス通信路」を構成する。また、図5に示した受信側処理が「受信側処理」に相当する。
In this embodiment, the
以上本発明は、上述した実施形態に何ら限定されるものではなく、その要旨を逸脱しない範囲において種々なる形態で実施可能である。
(イ)上記実施形態では受信した全てのフレームを対象として受信情報を作成していたが、特定のフレームについてのみ受信情報を格納することとしてもよい。例えば、予め決められた範囲のID値を有するフレームについてのみ、図3中のS120において受信したIDを加算したり、図5中のS220において受信IDレジスタをインクリメントしたりするという具合である。このようにすれば、特定のフレームの到達を通知することが可能となる。
As described above, the present invention is not limited to the above-described embodiments, and can be implemented in various forms without departing from the scope of the invention.
(A) In the above embodiment, reception information is created for all received frames. However, reception information may be stored only for specific frames. For example, only for frames having ID values in a predetermined range, the ID received in S120 in FIG. 3 is added, or the reception ID register is incremented in S220 in FIG. In this way, it is possible to notify the arrival of a specific frame.
(ロ)上記実施形態では、クリア条件が成立していない場合にだけ(図3中のS110:NO,図5中のS210:NO)、受信IDを加算したり(図3中のS120)、受信IDレジスタをインクリメントしたりしている(図5中のS220)。 (B) In the above embodiment, only when the clear condition is not satisfied (S110: NO in FIG. 3, S210: NO in FIG. 5), the reception ID is added (S120 in FIG. 3), The reception ID register is incremented (S220 in FIG. 5).
これに対し、クリア条件が成立した場合に(図3中のS110:YES,図5中のS210:YES)受信IDレジスタをクリアした後(図3中のS130,図5中のS230)、受信IDの加算(図3中のS120)や受信IDレジスタのインクリメント(図5中のS220)を実行し、その後、図3中のS140あるいは図5中のS240へ移行するようにしてもよい。 On the other hand, when the clear condition is satisfied (S110 in FIG. 3: YES, S210: YES in FIG. 5), the reception ID register is cleared (S130 in FIG. 3, S230 in FIG. 5) and then received. ID addition (S120 in FIG. 3) or reception ID register increment (S220 in FIG. 5) may be executed, and then the process may proceed to S140 in FIG. 3 or S240 in FIG.
(ハ)上記第1実施形態では受信IDレジスタの値と受信したID値との論理和をとって受信情報としていたが、他の演算による結果を受信情報としてもよい。例えば、受信IDレジスタに受信したID値を単純に加算するようにしてもよい。 (C) In the first embodiment, the reception information is obtained by taking the logical sum of the value of the reception ID register and the received ID value, but the result of another calculation may be used as the reception information. For example, the received ID value may be simply added to the reception ID register.
(ニ)図1に示す通信システムにおいて、特定のECU10のマイコン20のみが受信側処理を実行可能な構成としてもよい。この場合、特定のECU10のみが受信情報を格納し、受信情報がデータに含まれるフレームを送信することになる。
(D) The communication system shown in FIG. 1 may be configured such that only the
10:通信装置(ECU)、20:マイコン、21:UART(汎用非同期送受信回路)、22:発振子、30:トランシーバ、40:バス通信路 10: communication device (ECU), 20: microcomputer, 21: UART (general purpose asynchronous transmission / reception circuit), 22: oscillator, 30: transceiver, 40: bus communication path
Claims (7)
汎用非同期送受信回路を有する信号処理部と、
前記汎用非同期送受信回路からのフレームを前記バス通信路へ出力すると共に前記バス通信路を介して受信したフレームを前記汎用非同期送受信回路へ出力するトランシーバと、を備え、
前記信号処理部は、前記バス通信路を介して受信したフレームに基づく受信情報がフレーム送信時におけるレスポンスに含まれるよう前記受信情報を格納する受信側処理を実行可能であり、
前記受信情報の基となる前記受信したフレームは、前記バス通信路に接続されている当該通信装置及び他の通信装置をレスポンスの送信元とするフレームである
ことを特徴とする通信装置。 A communication device connected to a common bus communication path and communicating with each other via the bus communication path,
A signal processing unit having a general-purpose asynchronous transceiver circuit;
A transceiver that outputs a frame received from the general-purpose asynchronous transmission / reception circuit to the bus communication path and outputs a frame received via the bus communication path to the general-purpose asynchronous transmission / reception circuit,
The signal processing unit is capable of executing a reception-side process for storing the reception information so that reception information based on a frame received via the bus communication path is included in a response at the time of frame transmission ,
The received frame that is the basis of the reception information is a frame that uses the communication device connected to the bus communication path and another communication device as a response transmission source.
Communication and wherein the.
前記受信側処理では、前記受信情報がフレーム送信時におけるレスポンスに含まれるよう前記レスポンスを構成するデータの指定バイトに前記受信情報を格納すること
を特徴とする通信装置。 The communication device according to claim 1,
In the reception side process, the reception information is stored in a designated byte of data constituting the response so that the reception information is included in a response at the time of frame transmission.
前記受信情報は、受信したフレームのヘッダに含まれるID値に基づく情報であり、
前記受信側処理では、過去の受信情報と受信したフレームのID値との演算結果を新たな受信情報として格納すること
を特徴とする通信装置。 The communication device according to claim 1 or 2,
The reception information is information based on an ID value included in the header of the received frame;
In the receiving side process, a calculation result of past received information and an ID value of a received frame is stored as new received information.
前記演算結果は、過去の受信情報と受信したフレームのID値との論理和であること
を特徴とする通信装置。 The communication device according to claim 3.
The calculation result is a logical sum of past received information and an ID value of a received frame.
前記受信情報は、受信したフレーム数であり、
前記受信側処理では、フレームを受信した際に過去の受信情報をインクリメントし新たな受信情報として格納すること
を特徴とする通信装置。 The communication device according to claim 1 or 2,
The received information is the number of received frames,
In the receiving side process, when a frame is received, past received information is incremented and stored as new received information.
前記受信側処理では、前記バス通信路を介して受信したフレームのうち当該フレームのヘッダに含まれるID値に基づき、特定のフレームについてのみ前記受信情報を格納すること
を特徴とする通信装置。 In the communication apparatus as described in any one of Claims 1-5,
The reception apparatus stores the reception information only for a specific frame based on an ID value included in a header of the frame among frames received via the bus communication path.
前記受信側処理では、所定条件の成立時に、前記受信情報をクリアすること
を特徴とする通信装置。 In the communication apparatus as described in any one of Claims 1-6,
In the reception side process, the reception information is cleared when a predetermined condition is satisfied.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011164702A JP5598441B2 (en) | 2011-07-27 | 2011-07-27 | Communication device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011164702A JP5598441B2 (en) | 2011-07-27 | 2011-07-27 | Communication device |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2013030930A JP2013030930A (en) | 2013-02-07 |
JP5598441B2 true JP5598441B2 (en) | 2014-10-01 |
Family
ID=47787562
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2011164702A Active JP5598441B2 (en) | 2011-07-27 | 2011-07-27 | Communication device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5598441B2 (en) |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH09149060A (en) * | 1995-11-27 | 1997-06-06 | Mitsubishi Electric Corp | Multiple address communication system in multi-distribution connection network |
JPH11355331A (en) * | 1998-06-12 | 1999-12-24 | Nec Eng Ltd | Data communication control method for remote measurement system |
DE10147445A1 (en) * | 2001-09-26 | 2003-04-17 | Bosch Gmbh Robert | Method and device for transmitting information on a bus system and bus system |
JP2003224548A (en) * | 2002-01-29 | 2003-08-08 | Nec Commun Syst Ltd | System and method for automatically setting number of waiting frames in automatic retransmission control protocol |
JP2006306290A (en) * | 2005-04-28 | 2006-11-09 | Suzuki Motor Corp | Control device for vehicle |
JP4905808B2 (en) * | 2008-08-07 | 2012-03-28 | 株式会社デンソー | Serial communication network system |
-
2011
- 2011-07-27 JP JP2011164702A patent/JP5598441B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2013030930A (en) | 2013-02-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8719477B2 (en) | Communication system, master node, and slave node | |
US8868807B2 (en) | Communication system, master node, and slave node | |
JP2012080360A (en) | Communication system, master node and solve node | |
US10153825B2 (en) | Vehicle-mounted control device | |
JP2007324679A (en) | Baud rate generator for serial communication | |
US20150237174A1 (en) | Multi-frame and frame streaming in a controller area network (can) with flexible data- rate (fd) | |
JP5050653B2 (en) | Electronic control device | |
JP6547719B2 (en) | In-vehicle communication network | |
US10776307B2 (en) | Subscriber station for a serial bus system, and method for transmitting a message in a serial bus system | |
JP5637193B2 (en) | Communications system | |
JP2013062722A (en) | Communication system and slave node constituting the communication system | |
CN104995874B (en) | Data Transport Protocol with protocol anomaly state | |
JP7006335B2 (en) | In-vehicle communication system, in-vehicle communication method, and program | |
JP2013038465A (en) | Transceiver | |
JP5977152B2 (en) | Communication device | |
KR101334017B1 (en) | Apparatus of checking a validity of message on network for a vehicle and method of thereof | |
JP5644725B2 (en) | Transceiver | |
JP2021078087A5 (en) | ||
JP5598441B2 (en) | Communication device | |
JP5892890B2 (en) | Communication control device | |
JP2013062723A (en) | Communication system, and master node and slave node forming such communication system | |
JP2009161076A (en) | In-vehicle system | |
JP2007104232A (en) | Communication network system and communication terminal device | |
JP5892889B2 (en) | Communication control device | |
JP2013026835A (en) | Communication device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20130821 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20140418 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20140507 |
|
A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20140701 |
|
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: 20140715 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20140728 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 5598441 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 |