JP2011234128A - Baud rate detecting device for serial communication, baud rate correcting device for serial communication, and baud rate detecting method for serial communication - Google Patents

Baud rate detecting device for serial communication, baud rate correcting device for serial communication, and baud rate detecting method for serial communication Download PDF

Info

Publication number
JP2011234128A
JP2011234128A JP2010102551A JP2010102551A JP2011234128A JP 2011234128 A JP2011234128 A JP 2011234128A JP 2010102551 A JP2010102551 A JP 2010102551A JP 2010102551 A JP2010102551 A JP 2010102551A JP 2011234128 A JP2011234128 A JP 2011234128A
Authority
JP
Japan
Prior art keywords
baud rate
bit
value
serial communication
time measurement
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.)
Abandoned
Application number
JP2010102551A
Other languages
Japanese (ja)
Inventor
Kazuya Tsubaki
和也 椿
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.)
Yazaki Corp
Original Assignee
Yazaki 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 Yazaki Corp filed Critical Yazaki Corp
Priority to JP2010102551A priority Critical patent/JP2011234128A/en
Publication of JP2011234128A publication Critical patent/JP2011234128A/en
Abandoned legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To maintain a baud rate within an error tolerable range, and to lower the frequency of clock pulse used for measuring time.SOLUTION: There are provided a clock generator 33 which generates a clock pulse whose cycle is constant, an edge detection circuit 41 which detects timing of a communication signal for a predetermined domain that appears on a communication line 13, and a time measurement timer 43 which counts the time period of the predetermined domain and outputs the counting result as a binary time measurement value. It further includes an adder 46 in which the binary of the time measurement value is divided into a high order bit part and a low order bit part according to a bit configuration in the predetermined domain, and a value of the highest-order bit in the low order bit part is added to a value of the lowest-order bit in the high order bit part. The range of (-1<calculation error≤0) is corrected to be (-0.5<calculation error≤+0.5).

Description

本発明は、シリアル通信システムが通信に使用するボーレート(伝送速度)を実際の通信信号に合わせて自動的に補正するために用いられるシリアル通信用ボーレート検出装置に関する。   The present invention relates to a baud rate detection device for serial communication used for automatically correcting a baud rate (transmission speed) used for communication by a serial communication system in accordance with an actual communication signal.

例えば、自動車の制御系の通信ネットワークに接続される通信機器は、通信規格としてLIN(Local Interconnect Network)やCAN(Controller Area Network)を採用している場合が多い。車両上には様々な制御系のそれぞれを制御するためにECU(Electronic Control Unit)と呼ばれる多数の電子制御装置が搭載されている。複数のECUが互いに情報を交換したり互いに制御を行うために、これらのECUは制御系の車載通信ネットワークで接続されている。この車載通信ネットワークに、LINやCANが用いられている。   For example, a communication device connected to a communication network of an automobile control system often employs LIN (Local Interconnect Network) or CAN (Controller Area Network) as a communication standard. A large number of electronic control units called ECUs (Electronic Control Units) are mounted on the vehicle to control each of various control systems. In order for a plurality of ECUs to exchange information and control each other, these ECUs are connected by an in-vehicle communication network of a control system. LIN and CAN are used for this in-vehicle communication network.

例えば、車両上で高度な機能を持つ各種センサやアクチュエータを接続したECU同士を接続する場合には、比較的低速の通信速度(伝送速度)で構わないので、LINを採用した車載通信ネットワークが用いられる場合が多い。LINの場合、最大伝送速度は20kbpsである。   For example, when connecting ECUs connected with various sensors and actuators having advanced functions on a vehicle, a relatively low communication speed (transmission speed) may be used, so an in-vehicle communication network using LIN is used. It is often done. In the case of LIN, the maximum transmission rate is 20 kbps.

LINの通信プロトコルは、UART(Universal Asynchronous Receiver Transmitter)あるいはSCI(Serial Communication Interface)と呼ぶデータ形式に基づくシリアル通信プロトコルである。そして、単一のマスタノード(マスタとなるECU)と複数のスレーブノード(スレーブとなるECU)との間を通信ネットワークで接続するために利用される。   The LIN communication protocol is a serial communication protocol based on a data format called UART (Universal Asynchronous Receiver Transmitter) or SCI (Serial Communication Interface). And it is utilized in order to connect between a single master node (ECU used as a master) and several slave nodes (ECU used as a slave) with a communication network.

LINにおけるネットワークへのアクセス制御はタイムトリガ方式である。このため、マスタタスクにはメッセージシーケンスが転送スケジュールとして予め設定されている。マスタノードはLINクラスタとしてアプリケーションを実行し、ネットワークを管理することができる。つまり、LIN内の全ての通信タスクは時間で管理されており、ノード間で送出タイミングの同期が取れている限りメッセージの衝突は起こらない。   Access control to the network in the LIN is a time trigger method. For this reason, a message sequence is preset in the master task as a transfer schedule. The master node can execute an application as a LIN cluster and manage a network. That is, all communication tasks in the LIN are managed by time, and message collision does not occur as long as the transmission timing is synchronized between nodes.

LINにおいて同期を取るとは、シリアルデータを取得又は送信するためのサンプリングクロックの周期を、基準周期に一致させるように補正することである。通常、マスタノードのボーレートと一致するようにスレーブノードのボーレートを補正することにより同期を取る。スレーブノードは、マスタノードから送信される基準クロック(シンクフィールド)の周期の長さを検出しこれに基づいて、スレーブノードのボーレートを補正する。又、このボーレートの補正はヘッダの到着毎に実行される。   Synchronizing in the LIN means correcting the sampling clock cycle for acquiring or transmitting serial data so as to match the reference cycle. Usually, synchronization is achieved by correcting the baud rate of the slave node so that it matches the baud rate of the master node. The slave node detects the length of the period of the reference clock (sink field) transmitted from the master node, and corrects the baud rate of the slave node based on this. This baud rate correction is executed every time the header arrives.

このようにスレーブノード側のボーレートをマスタノードに合わせるように自動的に補正する機能を搭載することにより、スレーブノードには高精度のクロックを生成する水晶発振回路等を設ける必要がなく、コストの低減が可能になる。   By installing a function that automatically adjusts the baud rate on the slave node side to match the master node in this way, there is no need to provide a crystal oscillation circuit or the like that generates a high-accuracy clock on the slave node. Reduction is possible.

ボーレートを自動的に補正する機能を搭載したボーレートジェネレータに関する従来技術が特許文献1に開示されている。特許文献1においては、ボーレートを補正する際のCPUの負担を軽減するための技術を提案している。   Japanese Patent Application Laid-Open No. 2004-228561 discloses a conventional technique related to a baud rate generator equipped with a function for automatically correcting a baud rate. Patent Document 1 proposes a technique for reducing the load on the CPU when correcting the baud rate.

特開2007−324679号公報JP 2007-324679 A

LINの場合、マスタノードがスレーブノードに送信する通信フレーム(メッセージフレームとも言う)は、図3に示すように構成されている。すなわち、フレームヘッダには、先頭から順にシンクブレークフィールド(ブレークフィールド)、シンクフィールド(同期バイト)、IDフィールド(保護ID)が並んで配置されている。このヘッダに続いて、最大8バイトのデータフィールドと1バイトのチェックサムを含むレスポンスが転送される。ブレークフィールドは、13ビット以上のLowレベル(ドミナントレベル)で構成される。シンクフィールドには予め規定された8ビットのデータ値「0x55(16進数表記)」、つまり「0」と「1」が交互に並んだ「01010101」が現れる。IDフィールドは、6ビットのIDと2ビットのパリティで構成される。   In the case of LIN, a communication frame (also referred to as a message frame) transmitted from the master node to the slave node is configured as shown in FIG. That is, in the frame header, a sync break field (break field), a sync field (synchronization byte), and an ID field (protection ID) are arranged in order from the top. Following this header, a response containing a data field of up to 8 bytes and a checksum of 1 byte is transferred. The break field is composed of a low level (dominant level) of 13 bits or more. A predetermined 8-bit data value “0x55 (hexadecimal notation)”, that is, “01010101” in which “0” and “1” are alternately arranged appears in the sync field. The ID field is composed of a 6-bit ID and a 2-bit parity.

スレーブノードは、伝送路に現れた通信フレームのシンクフィールドを利用して、マスタノード(送信側)が通信に使用しているボーレートを検出することができる。すなわち、シンクフィールドの期間中に「0」と「1」が交互に現れるので、これが切り替わるのに要する時間を測定することにより、ボーレートに相当する時間を検出できる。   The slave node can detect the baud rate used for communication by the master node (transmission side) using the sync field of the communication frame that appears on the transmission path. That is, since “0” and “1” appear alternately during the sync field period, the time corresponding to the switching can be measured to detect the time corresponding to the baud rate.

この時間を検出する方法として、LINの仕様書においては、次の方法が推奨されている。すなわち、シンクフィールドにおいてスタート・ビットの立ち下がりからビット7の立ち下がりまでの8ビット分(「0x55」に相当する)の時間を計測する。そして、その結果を8で除算する。これで、1ビットのデータの長さに対応する時間が得られる。この時間の逆数がボーレートになる。   As a method for detecting this time, the following method is recommended in the LIN specification. That is, the time of 8 bits (corresponding to “0x55”) from the fall of the start bit to the fall of bit 7 is measured in the sync field. Then, the result is divided by 8. Thus, a time corresponding to the length of 1-bit data is obtained. The reciprocal of this time becomes the baud rate.

特許文献1に開示された従来技術においては、シンクフィールドの8ビット分の時間をカウンタを用いて計測し、計測により得られた時間値(2進数)を下位方向に向かって4ビットシフトする。つまり、時間値(2進数)の下位4ビットを切り捨てて残りの上位ビットだけを抽出する。このシフト動作は、時間値(2進数)を10進数の「16」で割ることを意味している。8ビットの時間長を「16」で割ることにより、(1/2)ビットのデータの長さに対応する時間がボーレートに対応する値として検出される。   In the prior art disclosed in Patent Document 1, the time of 8 bits in the sync field is measured using a counter, and the time value (binary number) obtained by the measurement is shifted by 4 bits in the lower direction. That is, the lower 4 bits of the time value (binary number) are truncated and only the remaining higher bits are extracted. This shift operation means that the time value (binary number) is divided by the decimal number “16”. By dividing the time length of 8 bits by “16”, the time corresponding to the data length of (1/2) bits is detected as a value corresponding to the baud rate.

ところで、LINの仕様では、補正されたボーレートの許容される誤差は、±2%以内である。この要求を満たすためには、上述のようなボーレート検出において、時間を高精度で測定する必要がある。具体的には、時間を計測するカウンタが計数するクロックパルスの周期を十分に短くする必要がある。つまり、1ビットのデータの時間長(T1)に対応する時間の誤差を±2%以内にするためには、前記クロックパルスの周期を最大でも(T1/50)以内にする必要がある。   Incidentally, in the LIN specification, the allowable error of the corrected baud rate is within ± 2%. In order to satisfy this requirement, it is necessary to measure the time with high accuracy in the above-described baud rate detection. Specifically, it is necessary to sufficiently shorten the cycle of the clock pulse counted by the counter that measures time. That is, in order to make the time error corresponding to the time length (T1) of 1-bit data within ± 2%, it is necessary to make the cycle of the clock pulse within (T1 / 50) at the maximum.

もしも、前記クロックパルスの周期が(T1/50)であれば、1ビットのデータの時間長(T1)をカウンタで計測する間に、「50」の値が計数されることになるが、計測時のタイミングのずれによってこの計数値には「±1」以内の計測誤差が発生する。つまり、このカウンタの計測誤差は(1/50)以内、つまり2%以内になる。   If the period of the clock pulse is (T1 / 50), the value of “50” is counted while the time length (T1) of 1-bit data is measured by the counter. A measurement error within “± 1” occurs in this count value due to a timing difference. That is, the measurement error of this counter is within (1/50), that is, within 2%.

但し、計測して得られる8ビット分の時間から1ビットのデータの時間長(T1)を除算(2進数のシフト演算)により求める際に、下位ビットの切り捨てを行うので、その計算結果には(−1<計算誤差≦0)の範囲内の計算誤差も含まれることになる。従って、この計算誤差(絶対値が最大で1以下)と計測誤差(絶対値が最大で1以下)とを考慮すると、最終的な誤差を許容範囲(±2%以内)に維持するためには、前記クロックパルスの周期を最大でも(T1/100)以内にする必要がある。   However, when the time length (T1) of 1-bit data is obtained by division (binary shift operation) from the 8-bit time obtained by measurement, the lower bits are rounded down. Calculation errors within the range of (−1 <calculation error ≦ 0) are also included. Therefore, considering this calculation error (absolute value is at most 1 or less) and measurement error (absolute value is at most 1 or less), in order to maintain the final error within the allowable range (within ± 2%) The period of the clock pulse needs to be within (T1 / 100) at the maximum.

また、現実には2進数で計数や演算を行うことになるので、前記クロックパルスの周期は(T1/128)以内にせざるを得ない。しかしながら、より周期が短い(周波数が高い)クロックパルスを扱う場合には、高速で動作する発振回路やカウンタが必要になるので、回路のコストが高くなり、消費電力の増大も避けられない。   Further, in reality, counting and computation are performed in binary numbers, so the clock pulse cycle must be within (T1 / 128). However, when handling a clock pulse having a shorter cycle (high frequency), an oscillation circuit and a counter that operate at a high speed are required. Therefore, the cost of the circuit is increased, and an increase in power consumption is inevitable.

本発明は、上述した事情に鑑みてなされたものであり、その目的は、補正後のボーレートを誤差の許容範囲内に維持可能にすると共に、時間の計測に用いるクロックパルスの周波数を低くすることが可能なシリアル通信用ボーレート検出装置およびシリアル通信用ボーレート補正装置ならびにシリアル通信用ボーレート検出方法を提供することにある。   The present invention has been made in view of the above-described circumstances, and an object thereof is to make it possible to maintain the corrected baud rate within an allowable error range and to reduce the frequency of the clock pulse used for time measurement. A serial communication baud rate detecting device, a serial communication baud rate correcting device, and a serial communication baud rate detecting method are provided.

前述した目的を達成するために、本発明に係るシリアル通信用ボーレート検出装置は、下記(1)〜(2)を特徴としている。
(1) 伝送路を伝送するシリアル通信信号の所定区間の時間長に関する計測結果を利用して送信元のボーレートを検出するシリアル通信用ボーレート検出装置であって、
周期が一定のクロックパルスを発生するクロック発生部と、
前記所定区間のタイミングを検出する区間検出部と、
前記所定区間の間に、前記クロック発生部から出力されるクロックパルスを計数し、計数結果を2進数の時間計測値として出力する時間計測カウンタ部と、
前記時間計測カウンタ部が出力する時間計測値の2進数を、前記所定区間のビット構成に応じて上位ビット部と下位ビット部とに区分し、前記下位ビット部の中の最上位ビットの値を、前記上位ビット部の中の最下位ビットの値に加算するビット加算部と
を備えること。
(2) 上記(1)に記載のシリアル通信用ボーレート検出装置であって、
前記ビット加算部は、前記時間計測カウンタ部が出力する時間計測値の2進数の下位3ビットを前記下位ビット部に区分し、それ以外を前記上位ビット部に区分する
こと。
In order to achieve the above-described object, a serial communication baud rate detection apparatus according to the present invention is characterized by the following (1) to (2).
(1) A serial communication baud rate detection device that detects a baud rate of a transmission source using a measurement result related to a time length of a predetermined section of a serial communication signal transmitted through a transmission path,
A clock generator for generating clock pulses with a constant period;
A section detector for detecting the timing of the predetermined section;
A time measurement counter unit that counts clock pulses output from the clock generation unit during the predetermined period, and outputs a count result as a binary time measurement value;
The binary value of the time measurement value output by the time measurement counter unit is divided into an upper bit part and a lower bit part according to the bit configuration of the predetermined section, and the value of the most significant bit in the lower bit part is And a bit adder for adding to the value of the least significant bit in the upper bit part.
(2) The serial communication baud rate detecting device according to (1),
The bit adder section divides the lower 3 bits of the binary number of the time measurement value output from the time measurement counter section into the lower bit section and the other bits into the upper bit section.

上記(1)の構成のシリアル通信用ボーレート検出装置によれば、時間の計測に用いるクロックパルスの周波数を低くすることが可能である。すなわち、前記時間計測値から上位ビット部として抽出される値に含まれる前述の計算誤差は(−1<計算誤差≦0)の範囲内であるが、前記ビット加算部の結果に含まれる計算誤差は(−0.5<計算誤差≦+0.5)の範囲に修正される。このため、ボーレートを許容範囲(−2%≦最終誤差≦+2%)に維持するために必要なクロックパルスの周波数は、前記ビット加算部が存在しない場合と比べて半分程度に低くなる。つまり、前記クロックパルスの周期は(T1/128)から(T1/64)に変更することができる。
上記(2)の構成のシリアル通信用ボーレート検出装置によれば、前記時間計測値が8ビットのデータの時間長である場合に、1ビットのデータの時間長(8で除算された結果)が前記上位ビット部として抽出され、前記下位ビット部は前記時間長の小数部になる。
According to the serial communication baud rate detection apparatus having the configuration (1), the frequency of the clock pulse used for time measurement can be lowered. That is, the calculation error included in the value extracted as the high-order bit part from the time measurement value is within the range of (−1 <calculation error ≦ 0), but the calculation error included in the result of the bit addition part. Is corrected to a range of (−0.5 <calculation error ≦ + 0.5). For this reason, the frequency of the clock pulse necessary for maintaining the baud rate within the allowable range (−2% ≦ final error ≦ + 2%) is reduced to about half compared with the case where the bit adder does not exist. That is, the cycle of the clock pulse can be changed from (T1 / 128) to (T1 / 64).
According to the serial communication baud rate detection device having the configuration (2), when the time measurement value is the time length of 8-bit data, the time length of 1-bit data (result divided by 8) is The upper bit part is extracted, and the lower bit part is a fractional part of the time length.

前述した目的を達成するために、本発明に係るシリアル通信用ボーレート補正装置は、下記(3)を特徴としている。
(3) 伝送路を伝送するシリアル通信信号の所定区間の時間長に関する計測結果を利用して送信元のボーレートを検出し、検出されたボーレートに基づいて自局が使用するボーレートを補正するシリアル通信用ボーレート補正装置であって、
周期が一定のクロックパルスを発生するクロック発生部と、
前記所定区間のタイミングを検出する区間検出部と、
前記所定区間の間に、前記クロック発生部から出力されるクロックパルスを計数し、計数結果を2進数の時間計測値として出力する時間計測カウンタ部と、
前記時間計測カウンタ部が出力する時間計測値の2進数を、前記所定区間のビット構成に応じて上位ビット部と下位ビット部とに区分し、前記下位ビット部の中の最上位ビットの値を、前記上位ビット部の中の最下位ビットの値に加算するビット加算部と
を備えること。
In order to achieve the above-described object, a serial communication baud rate correction apparatus according to the present invention is characterized by the following (3).
(3) Serial communication that detects the baud rate of the transmission source using the measurement result related to the time length of the predetermined section of the serial communication signal transmitted through the transmission path, and corrects the baud rate used by the own station based on the detected baud rate. Baud rate correction device for
A clock generator for generating clock pulses with a constant period;
A section detector for detecting the timing of the predetermined section;
A time measurement counter unit that counts clock pulses output from the clock generation unit during the predetermined period, and outputs a count result as a binary time measurement value;
The binary value of the time measurement value output by the time measurement counter unit is divided into an upper bit part and a lower bit part according to the bit configuration of the predetermined section, and the value of the most significant bit in the lower bit part is And a bit adder for adding to the value of the least significant bit in the upper bit part.

上記(3)の構成のシリアル通信用ボーレート補正装置によれば、ボーレート補正誤差を許容範囲に維持するために必要なクロックパルスの周波数を下げることができる。   According to the serial communication baud rate correction apparatus having the configuration (3), the frequency of the clock pulse necessary for maintaining the baud rate correction error in an allowable range can be lowered.

前述した目的を達成するために、本発明に係るシリアル通信用ボーレート検出方法は、下記(4)を特徴としている。
(4) 伝送路を伝送するシリアル通信信号の所定区間の時間長に関する計測結果を利用して送信元のボーレートを検出するためのシリアル通信用ボーレート検出方法であって、
周期が一定のクロックパルスを発生し、
前記所定区間のタイミングを検出し、
前記所定区間の間に前記クロックパルスを計数して計数結果を2進数の時間計測値として取得し、
前記時間計測値の2進数を、前記所定区間のビット構成に応じて上位ビット部と下位ビット部とに区分し、前記下位ビット部の中の最上位ビットの値を、前記上位ビット部の中の最下位ビットの値に加算した結果を出力する
こと。
In order to achieve the above-described object, the serial communication baud rate detection method according to the present invention is characterized by the following (4).
(4) A serial communication baud rate detection method for detecting a baud rate of a transmission source using a measurement result relating to a time length of a predetermined section of a serial communication signal transmitted through a transmission path,
Generate clock pulses with a constant period,
Detecting the timing of the predetermined section;
The clock pulse is counted during the predetermined interval, and the counting result is acquired as a binary time measurement value,
The binary number of the time measurement value is divided into an upper bit part and a lower bit part according to the bit configuration of the predetermined section, and the value of the most significant bit in the lower bit part is set in the upper bit part. Output the result of adding to the value of the least significant bit.

上記(4)の構成のシリアル通信用ボーレート検出方法によれば、時間の計測に用いるクロックパルスの周波数を低くすることが可能である。   According to the serial communication baud rate detection method having the configuration (4), the frequency of the clock pulse used for time measurement can be lowered.

本発明によれば、ボーレートに関する時間の計測に用いるクロックパルスの周波数を低くすることができる。従って、回路コストの低減が可能になり、消費電力の増大も抑制できる。   According to the present invention, the frequency of the clock pulse used for measuring the time related to the baud rate can be lowered. Therefore, the circuit cost can be reduced and the increase in power consumption can be suppressed.

以上、本発明について簡潔に説明した。更に、以下に説明される発明を実施するための形態を添付の図面を参照して通読することにより、本発明の詳細は更に明確化されるであろう。   The present invention has been briefly described above. Further, details of the present invention will be further clarified by reading through the modes for carrying out the invention described below with reference to the accompanying drawings.

通信システムの構成例を示すブロック図である。It is a block diagram which shows the structural example of a communication system. 実施形態のボーレート補正回路の構成を示すブロック図である。It is a block diagram which shows the structure of the baud rate correction circuit of embodiment. 通信ライン上に現れる通信フレームの構成を示すタイムチャートである。It is a time chart which shows the structure of the communication frame which appears on a communication line. シンクフィールドの時間を計測する動作を表すタイムチャートである。It is a time chart showing the operation | movement which measures the time of a sync field. ボーレート補正値を算出する動作を表す模式図である。It is a schematic diagram showing the operation | movement which calculates a baud rate correction value.

本発明のシリアル通信用ボーレート検出装置およびシリアル通信用ボーレート補正装置ならびにシリアル通信用ボーレート検出方法に関する具体的な実施の形態について、各図を参照しながら以下に説明する。   Specific embodiments relating to a baud rate detection device for serial communication, a baud rate correction device for serial communication, and a baud rate detection method for serial communication according to the present invention will be described below with reference to the drawings.

本発明のシリアル通信用ボーレート検出装置は、例えば図1に示すような構成の通信システムに用いられる。図1に示す通信システムは、単一のマスタノード10と2つのスレーブノード11、12を有し、これらは通信ライン13を介して互いに接続されている。マスタノード10は、システム全体の動作を統括するために配下のスレーブノード11、12を制御する。各スレーブノード11、12はマスタノード10の指示に従って制御を実施する。   The baud rate detection device for serial communication of the present invention is used in a communication system having a configuration as shown in FIG. The communication system shown in FIG. 1 has a single master node 10 and two slave nodes 11 and 12, which are connected to each other via a communication line 13. The master node 10 controls subordinate slave nodes 11 and 12 in order to control the overall operation of the system. Each slave node 11, 12 performs control according to an instruction from the master node 10.

具体的には、図1に示す通信システムは車載通信システムとして利用することを想定している。すなわち、マスタノード10、スレーブノード11、12はそれぞれが車載機器を制御するための電子制御装置(ECU)に相当し、これらはLINの通信規格に適合する通信ネットワークで、つまり通信ライン13を介して図1に示すように有線で接続されている。なお図1においては、通信関連以外の構成要素について図示を省略してある。   Specifically, the communication system shown in FIG. 1 is assumed to be used as an in-vehicle communication system. That is, each of the master node 10 and the slave nodes 11 and 12 corresponds to an electronic control unit (ECU) for controlling the in-vehicle device, and these are communication networks conforming to the LIN communication standard, that is, via the communication line 13. As shown in FIG. In FIG. 1, the components other than those related to communication are not shown.

図1に示すように、マスタノード10にはマイクロコンピュータ(CPU)21、メモリ22、クロックジェネレータ23、通信部24が備わっている。また、通信部24にはI/O(入力/出力)インタフェース25とボーレート補正回路26が備わっている。   As shown in FIG. 1, the master node 10 includes a microcomputer (CPU) 21, a memory 22, a clock generator 23, and a communication unit 24. The communication unit 24 includes an I / O (input / output) interface 25 and a baud rate correction circuit 26.

マイクロコンピュータ21は、メモリ22上に予め用意されているプログラムを実行することにより通信の制御を実施する。メモリ22上には、マスタタスクとスレーブタスクのプログラムが用意されている。   The microcomputer 21 controls communication by executing a program prepared in advance on the memory 22. On the memory 22, programs for a master task and a slave task are prepared.

クロックジェネレータ23は、通信等の動作に関する基準タイミングを決定するためのクロックパルスを生成する。システム全体の安定した動作を実現するためにマスタノード10のクロックジェネレータ23には水晶発振回路が備わっている。クロックジェネレータ23が生成するクロックパルスの周波数は、マスタノード10が通信に使用するボーレートの64倍に定めてある。   The clock generator 23 generates a clock pulse for determining a reference timing related to an operation such as communication. In order to realize stable operation of the entire system, the clock generator 23 of the master node 10 is provided with a crystal oscillation circuit. The frequency of the clock pulse generated by the clock generator 23 is set to 64 times the baud rate used by the master node 10 for communication.

ボーレート補正回路26は、クロックジェネレータ23が出力するクロックパルスに基づいてシリアル通信動作に必要なタイミング信号を生成する。なお、ボーレート補正回路26はボーレートを補正する機能(後述する)も含んでいるが、マスタの動作タイミングが基準になるので、マスタノード10内のボーレート補正回路26はボーレートの補正動作を実施しない。   The baud rate correction circuit 26 generates a timing signal necessary for the serial communication operation based on the clock pulse output from the clock generator 23. The baud rate correction circuit 26 includes a function (described later) for correcting the baud rate. However, since the master operation timing is a reference, the baud rate correction circuit 26 in the master node 10 does not perform the baud rate correction operation.

I/Oインタフェース25は、マイクロコンピュータ21の送信対象データをパラレルデータとして入力しシリアルデータに変換すると共に、決定されたボーレートと前記クロックパルスに応じたタイミングでシリアルデータを通信ライン13に送出する。また、通信ライン13から入力されるシリアルデータを前記ボーレートとクロックパルスに応じたタイミングでサンプリングし、取得したデータをパラレルデータに変換してマイクロコンピュータ21に出力する。   The I / O interface 25 inputs transmission target data of the microcomputer 21 as parallel data, converts it into serial data, and sends serial data to the communication line 13 at a timing corresponding to the determined baud rate and the clock pulse. The serial data input from the communication line 13 is sampled at a timing corresponding to the baud rate and clock pulse, and the acquired data is converted into parallel data and output to the microcomputer 21.

一方、スレーブノード11には、マイクロコンピュータ(CPU)31、メモリ32、クロックジェネレータ33、通信部34が備わっている。また、通信部34にはI/O(入力/出力)インタフェース35とボーレート補正回路36が備わっている。   On the other hand, the slave node 11 includes a microcomputer (CPU) 31, a memory 32, a clock generator 33, and a communication unit 34. The communication unit 34 includes an I / O (input / output) interface 35 and a baud rate correction circuit 36.

マイクロコンピュータ31は、メモリ32上に予め用意されているプログラムを実行することにより通信の制御を実施する。メモリ32上には、スレーブタスクのプログラムが用意されている。   The microcomputer 31 controls communication by executing a program prepared in advance on the memory 32. On the memory 32, a slave task program is prepared.

クロックジェネレータ33は、通信等の動作に関する基準タイミングを決定するためのクロックパルスを生成する。スレーブノード11のクロックジェネレータ33が出力するクロックパルスについては高い精度は要求されないので、クロックジェネレータ33は安価なCR発振回路等で構成することができる。クロックジェネレータ33が生成するクロックパルスの周波数は、通信に使用するボーレートの64倍に定めてある。   The clock generator 33 generates a clock pulse for determining a reference timing related to an operation such as communication. Since the clock pulse output from the clock generator 33 of the slave node 11 is not required to have high accuracy, the clock generator 33 can be configured with an inexpensive CR oscillation circuit or the like. The frequency of the clock pulse generated by the clock generator 33 is set to 64 times the baud rate used for communication.

ボーレート補正回路36は、クロックジェネレータ33が出力するクロックパルスに基づいてシリアル通信動作に必要なタイミング信号を生成する。ボーレート補正回路36には、スレーブノード11が使用するボーレートの誤差を許容範囲内に維持するための機能が含まれている。ボーレート補正回路36の構成および動作については後で詳細に説明する。   The baud rate correction circuit 36 generates a timing signal necessary for the serial communication operation based on the clock pulse output from the clock generator 33. The baud rate correction circuit 36 includes a function for maintaining the error of the baud rate used by the slave node 11 within an allowable range. The configuration and operation of the baud rate correction circuit 36 will be described in detail later.

I/Oインタフェース35は、マイクロコンピュータ31の送信対象データをパラレルデータとして入力しシリアルデータに変換すると共に、決定されたボーレートと前記クロックパルスに応じたタイミングでシリアルデータを通信ライン13に送出する。また、通信ライン13から入力されるシリアルデータを前記ボーレートとクロックパルスに応じたタイミングでサンプリングし、取得したデータをパラレルデータに変換してマイクロコンピュータ31に出力する。
スレーブノード12についても、上述のスレーブノード11と同様の構成要素が備わっている。
The I / O interface 35 inputs transmission target data of the microcomputer 31 as parallel data, converts it into serial data, and sends serial data to the communication line 13 at a timing corresponding to the determined baud rate and the clock pulse. The serial data input from the communication line 13 is sampled at a timing corresponding to the baud rate and clock pulse, and the acquired data is converted into parallel data and output to the microcomputer 31.
The slave node 12 also has the same components as the slave node 11 described above.

次に通信動作の概要について説明する。マスタノード10のメモリ22に備わっているマスタタスクのプログラムをマイクロコンピュータ21が実行することにより、マスタタスクの処理が行われる。このマスタタスクには、所定の通信フレームを通信ライン13を介して転送するためのメッセージシーケンスが転送スケジュールとして予め組み込まれている。   Next, an outline of the communication operation will be described. When the microcomputer 21 executes the master task program provided in the memory 22 of the master node 10, the master task is processed. In this master task, a message sequence for transferring a predetermined communication frame via the communication line 13 is incorporated in advance as a transfer schedule.

マイクロコンピュータ21がマスタタスクを処理することにより、通信フレームのフレームヘッダが生成され、このフレームヘッダがI/Oインタフェース25から通信ライン13に送出される。このフレームヘッダに対して、このフレームヘッダで指定された特定のスレーブノード(スレーブノード11又は12)からのレスポンスが通信ライン13に現れるので、マイクロコンピュータ21はレスポンスをI/Oインタフェース25を介して受信する。   When the microcomputer 21 processes the master task, a frame header of the communication frame is generated, and this frame header is sent from the I / O interface 25 to the communication line 13. In response to this frame header, a response from a specific slave node (slave node 11 or 12) designated by this frame header appears on the communication line 13, so the microcomputer 21 sends the response via the I / O interface 25. Receive.

マスタノード10のメモリ22内やスレーブノード11のメモリ32内に用意されているスレーブタスクは、通信フレーム毎に転送するデータフィールドを準備する。スレーブタスクは、レスポンスを送信する機能の他に、マスタノードや他のスレーブノードからのレスポンスを受信する機能も有している。   The slave task prepared in the memory 22 of the master node 10 or the memory 32 of the slave node 11 prepares a data field to be transferred for each communication frame. The slave task has a function of receiving a response from the master node or another slave node in addition to a function of transmitting a response.

通信フレーム(メッセージフレームとも言う)は、図3に示すように構成されている。すなわち、フレームヘッダには、先頭から順にシンクブレークフィールド(ブレークフィールド)、シンクフィールド(同期バイト)、IDフィールド(保護ID)が並んで配置されている。このヘッダに続いて、最大8バイトのデータフィールドと1バイトのチェックサムを含むレスポンスが転送される。ブレークフィールドは、13ビット以上のLowレベル(ドミナントレベル)で構成される。シンクフィールドには予め規定された8ビットのデータ値「0x55(16進数表記)」、つまり「0」と「1」が交互に並んだ「01010101」が現れる。IDフィールドは、6ビットのIDと2ビットのパリティで構成される。   The communication frame (also referred to as a message frame) is configured as shown in FIG. That is, in the frame header, a sync break field (break field), a sync field (synchronization byte), and an ID field (protection ID) are arranged in order from the top. Following this header, a response containing a data field of up to 8 bytes and a checksum of 1 byte is transferred. The break field is composed of a low level (dominant level) of 13 bits or more. A predetermined 8-bit data value “0x55 (hexadecimal notation)”, that is, “01010101” in which “0” and “1” are alternately arranged appears in the sync field. The ID field is composed of a 6-bit ID and a 2-bit parity.

スレーブノードは、伝送路に現れた通信フレームのシンクフィールドを利用して、マスタノード(送信側)が通信に使用しているボーレートを検出することができる。すなわち、シンクフィールドの期間中に「0」と「1」が交互に現れるので、これが切り替わるのに要する時間を測定することにより、ボーレートに相当する時間を検出できる。   The slave node can detect the baud rate used for communication by the master node (transmission side) using the sync field of the communication frame that appears on the transmission path. That is, since “0” and “1” appear alternately during the sync field period, the time corresponding to the switching can be measured to detect the time corresponding to the baud rate.

本実施形態におけるボーレート補正回路36の具体的な構成が図2に示されている。図2に示すように、ボーレート補正回路36はボーレート検出回路40、ボーレート初期値レジスタ51、データセレクタ52、カウンタ53、一致検出回路54を備えている。また、ボーレート検出回路40にはエッジ検出回路41、エッジカウンタ42、時間計測タイマ43、計測値保持部44、計測値保持部45、加算器46、ボーレート補正値レジスタ47が備わっている。   A specific configuration of the baud rate correction circuit 36 in the present embodiment is shown in FIG. As shown in FIG. 2, the baud rate correction circuit 36 includes a baud rate detection circuit 40, a baud rate initial value register 51, a data selector 52, a counter 53, and a coincidence detection circuit 54. The baud rate detection circuit 40 includes an edge detection circuit 41, an edge counter 42, a time measurement timer 43, a measurement value holding unit 44, a measurement value holding unit 45, an adder 46, and a baud rate correction value register 47.

通信ライン13の通信信号(図3に示すようなシリアル信号)にシンクフィールド(11ビット以上のLレベル)が現れると、図示しない回路からエッジ検出回路41に対しシンクフィールド検出信号が入力される。エッジ検出回路41は、このシンクフィールド検出信号に応答して、シリアル信号の立下りエッジ検出動作を開始する。すなわち、エッジ検出回路41は、シンクフィールドのスタートビットの立下りエッジを検出した時に、シンクフィールド開始信号(計測開始信号)をエッジカウンタ42及び時間計測タイマ43に出力する。また、エッジ検出回路41はシンクフィールド内で立下りエッジを検出する毎にエッジ検出信号をエッジカウンタ42に出力する。エッジ検出回路41の検出動作は、クロックジェネレータ33から出力されるクロックパルスに同期して実施される。   When a sync field (L level of 11 bits or more) appears in a communication signal (serial signal as shown in FIG. 3) on the communication line 13, a sync field detection signal is input to the edge detection circuit 41 from a circuit not shown. In response to the sync field detection signal, the edge detection circuit 41 starts the falling edge detection operation of the serial signal. That is, the edge detection circuit 41 outputs a sync field start signal (measurement start signal) to the edge counter 42 and the time measurement timer 43 when detecting the falling edge of the start bit of the sync field. The edge detection circuit 41 outputs an edge detection signal to the edge counter 42 every time a falling edge is detected in the sync field. The detection operation of the edge detection circuit 41 is performed in synchronization with the clock pulse output from the clock generator 33.

エッジカウンタ42は、エッジ検出回路41から出力される前記シンクフィールド開始信号に応答して動作を開始し、前記エッジ検出信号をカウントする。つまり、エッジカウンタ42はシンクフィールドにおける立下りエッジの数を計数する。エッジカウンタ42は、シンクフィールド開始信号(図4中の計測開始信号)を受信してから所定の回数までエッジ検出信号を計数すると、時間計測タイマ43及びボーレート補正値レジスタ47に対し、シンクフィールド終了信号(図4中の計測終了信号)を出力する。   The edge counter 42 starts operation in response to the sync field start signal output from the edge detection circuit 41 and counts the edge detection signal. That is, the edge counter 42 counts the number of falling edges in the sync field. When the edge counter 42 counts the edge detection signal up to a predetermined number of times after receiving the sync field start signal (measurement start signal in FIG. 4), the sync counter ends with respect to the time measurement timer 43 and the baud rate correction value register 47. A signal (measurement end signal in FIG. 4) is output.

時間計測タイマ43は、クロックジェネレータ33が出力する周期が一定のクロックパルスを計数することにより時間を測定する。具体的には、時間計測タイマ43は、エッジ検出回路41が出力する前記シンクフィールド開始信号(計測開始信号)が現れてからエッジカウンタ42が出力するシンクフィールド終了信号(計測終了信号)が現れるまでの時間長をクロックパルスの数で計測する。従って、図4に示す「計測時間」の長さに対応する値を時間計測タイマ43が出力する。   The time measurement timer 43 measures time by counting clock pulses having a constant cycle output from the clock generator 33. Specifically, the time measurement timer 43 starts from the time when the sync field start signal (measurement start signal) output from the edge detection circuit 41 appears until the time when the sync field end signal (measurement end signal) output from the edge counter 42 appears. Is measured by the number of clock pulses. Accordingly, the time measurement timer 43 outputs a value corresponding to the length of the “measurement time” shown in FIG.

時間計測タイマ43は、計測結果である前記「計測時間」を、図5に示すカウント値D1のようなビットB1、B2、B3、B4、B5、B6、B7、B8、B9、B10で構成される10ビットのデータとして出力する。ここで、10ビットのカウント値D1においては最下位ビット(LSB)がB1、最上位ビット(MSB)がB10である。   The time measurement timer 43 is composed of the “measurement time”, which is a measurement result, by bits B1, B2, B3, B4, B5, B6, B7, B8, B9, and B10 such as the count value D1 shown in FIG. Output as 10-bit data. Here, in the 10-bit count value D1, the least significant bit (LSB) is B1, and the most significant bit (MSB) is B10.

ところで、前記「計測時間」はシンクフィールドにおいて8ビットのシリアルデータが現れるのに要した時間に相当する。従って、ボーレートの逆数である1ビットあたりのデータの時間長を得るには、前記「計測時間」を「8」で除算すればよい。2進数の計算においては、データの下位の3ビットを切り捨てることが「8」で除算することを意味する。つまり、図5に示すカウント値D1において、「B1、B2、B3」を下位ビット部、「B4、B5、B6、B7、B8、B9、B10」を上位ビット部として区分した場合に、上位ビット部だけを抽出することで、1ビットあたりのデータの時間長が得られる。   By the way, the “measurement time” corresponds to the time required for 8-bit serial data to appear in the sync field. Therefore, in order to obtain the time length of data per bit that is the reciprocal of the baud rate, the “measurement time” may be divided by “8”. In the calculation of binary numbers, truncating the lower 3 bits of data means dividing by “8”. That is, in the count value D1 shown in FIG. 5, when “B1, B2, B3” is classified as the lower bit part and “B4, B5, B6, B7, B8, B9, B10” is divided as the upper bit part, By extracting only the part, the time length of data per bit can be obtained.

但し、切り捨てた下位ビット部については計算誤差になる。この場合の計算誤差の範囲は、除算後に抽出される上位ビット部の値を10進数の整数として考えると、(−1<計算誤差≦0)になる。つまり、マイナス方向にのみ偏って計算誤差が生じる。この計算誤差は、ボーレートの誤差を許容範囲内に維持するための制御において重要な意味を持つ。   However, a calculation error occurs for the lower-order bit portion that is discarded. The range of the calculation error in this case is (−1 <calculation error ≦ 0) when the value of the upper bit part extracted after division is considered as an integer in decimal. That is, a calculation error occurs only in the minus direction. This calculation error has an important meaning in the control for maintaining the baud rate error within an allowable range.

すなわち、LINの仕様では、ボーレートの許容される誤差が(−2%≦誤差≦+2%)の範囲内であるのに対し、ボーレートの検出誤差にマイナス方向にのみ偏っている計算誤差が含まれることになるので、時間計測の際に発生する誤差をより大きく減らす必要がある。そのためには、クロックジェネレータ33が出力するクロックパルスの周波数を十分に高くしなければならない。   That is, in the LIN specification, the allowable error of the baud rate is in the range of (−2% ≦ error ≦ + 2%), whereas the detection error of the baud rate includes a calculation error that is biased only in the negative direction. Therefore, it is necessary to greatly reduce errors that occur during time measurement. For this purpose, the frequency of the clock pulse output from the clock generator 33 must be sufficiently high.

図2に示したボーレート検出回路40においては、クロックジェネレータ33が出力するクロックパルスの周波数が比較的低い(周期が長い)場合であっても、ボーレートを許容範囲(−2%≦誤差≦+2%)に維持できるように特別な工夫が施されている。   In the baud rate detection circuit 40 shown in FIG. 2, the baud rate is within an allowable range (−2% ≦ error ≦ + 2%) even when the frequency of the clock pulse output from the clock generator 33 is relatively low (the cycle is long). ) Is specially devised so that it can be maintained.

計測値保持部44は、時間計測タイマ43が計測を完了した時に、時間計測タイマ43から出力される「計測時間(図5中のD1)」の上位ビット部(B4〜B10)を入力して保持する。計測値保持部45は、時間計測タイマ43が計測を完了した時に、時間計測タイマ43から出力される「計測時間(図5中のD1)」の下位ビット部(B1〜B3)のうち最上位のビット(B3)を入力して保持する。   The measurement value holding unit 44 inputs the upper bit part (B4 to B10) of “measurement time (D1 in FIG. 5)” output from the time measurement timer 43 when the time measurement timer 43 completes the measurement. Hold. The measurement value holding unit 45 is the highest bit among the lower-order bits (B1 to B3) of “measurement time (D1 in FIG. 5)” output from the time measurement timer 43 when the time measurement timer 43 completes the measurement. The bit (B3) is input and held.

加算器46は、計測値保持部44が保持している7ビットの値(B4〜B10)と、計測値保持部45が保持している1ビットの値(B3)とを入力してそれらを2進数として加算する。加算器46の加算の結果がボーレート補正値レジスタ47に保持される。   The adder 46 inputs the 7-bit value (B4 to B10) held by the measurement value holding unit 44 and the 1-bit value (B3) held by the measurement value holding unit 45 and inputs them. Add as a binary number. The addition result of the adder 46 is held in the baud rate correction value register 47.

例えば、図5の左側(プラス補正)に示すように、下位ビット部(B1〜B3)の最上位のビット(B3)が「1」の場合には、これと上位ビット部(B4〜B10)とが加算器46で加算されるので、ビット(B3)の影響が結果(ボーレート補正値)に反映される。一方、図5の右側(マイナス補正)に示すように、下位ビット部(B1〜B3)の最上位のビット(B3)が「0」の場合には、これと上位ビット部(B4〜B10)とが加算器46で加算された結果(ボーレート補正値)には下位ビット部(B1〜B3)の影響が現れない。   For example, as shown on the left side of FIG. 5 (plus correction), when the most significant bit (B3) of the lower bit part (B1 to B3) is “1”, this and the upper bit part (B4 to B10) Are added by the adder 46, and the influence of the bit (B3) is reflected in the result (baud rate correction value). On the other hand, as shown on the right side of FIG. 5 (minus correction), when the most significant bit (B3) of the lower bit portion (B1 to B3) is “0”, this and the upper bit portion (B4 to B10). Are added by the adder 46 (baud rate correction value), and the influence of the lower bits (B1 to B3) does not appear.

つまり、加算器46における加算処理では、図5に示すように下位ビット部(B1〜B3)の最上位のビット(B3)だけを上位ビット部(B4〜B10)に加算することになる。これは、前述の(−1<計算誤差≦0)の範囲を(−0.5<計算誤差≦+0.5)に修正することを意味している。   That is, in the addition process in the adder 46, only the most significant bit (B3) of the lower bit part (B1 to B3) is added to the upper bit part (B4 to B10) as shown in FIG. This means that the above-mentioned range of (−1 <calculation error ≦ 0) is corrected to (−0.5 <calculation error ≦ + 0.5).

これにより、時間計測タイマ43が計数するクロックパルスの周波数が比較的低い場合でも、前記計算誤差によって生じるボーレートのずれを許容範囲(−2%≦誤差≦+2%)内に維持することが可能になる。具体的には、加算器46で図5に示す加算処理を行わない場合には、ボーレートのずれを許容範囲に維持するために、クロックパルスの周波数をボーレートの128倍以上にせざるを得ない。しかし、加算器46で加算処理を行うことにより、クロックパルスの周波数がボーレートの64倍であってもボーレートのずれを許容範囲に維持できる。   Thereby, even when the frequency of the clock pulse counted by the time measurement timer 43 is relatively low, it is possible to maintain the deviation of the baud rate caused by the calculation error within an allowable range (−2% ≦ error ≦ + 2%). Become. Specifically, when the addition process shown in FIG. 5 is not performed by the adder 46, the clock pulse frequency must be set to 128 times the baud rate or more in order to maintain the deviation of the baud rate within an allowable range. However, by performing addition processing by the adder 46, even if the frequency of the clock pulse is 64 times the baud rate, the deviation of the baud rate can be maintained within an allowable range.

ボーレート初期値レジスタ51は、予め定めたボーレートの初期値を定数として保持している。マイクロコンピュータ31は、実際のボーレートが不明の初期状態においては、ボーレート初期値レジスタ51が保持しているボーレートの初期値をデータセレクタ52を介して一致検出回路54に印加する。そして、ボーレート検出回路40が上述の動作を完了し、ボーレート補正値レジスタ47に計測値であるボーレート補正値が保持された後で、マイクロコンピュータ31はデータセレクタ52を切り替えて、ボーレート補正値レジスタ47のボーレート補正値を一致検出回路54に印加する。   The baud rate initial value register 51 holds an initial value of a predetermined baud rate as a constant. In the initial state where the actual baud rate is unknown, the microcomputer 31 applies the initial value of the baud rate held in the baud rate initial value register 51 to the coincidence detection circuit 54 via the data selector 52. Then, after the baud rate detection circuit 40 completes the above-described operation and the baud rate correction value, which is a measured value, is held in the baud rate correction value register 47, the microcomputer 31 switches the data selector 52 to change the baud rate correction value register 47. The baud rate correction value is applied to the coincidence detection circuit 54.

カウンタ53は、クロックジェネレータ33が出力するクロックパルスを計数する。一致検出回路54は、カウンタ53の計数値と、ボーレート初期値レジスタ51のボーレート初期値、又はボーレート補正値レジスタ47のボーレート補正値とを比較してそれらの一致の有無を識別し、一致検出信号を出力する。この一致検出信号は、I/Oインタフェース35に入力され、通信ライン13上に現れるシリアルデータから情報を取得するためのサンプリングクロック信号や、シリアルデータを送信するためのシフトクロック信号を生成するためのタイミング信号として利用される。   The counter 53 counts clock pulses output from the clock generator 33. The coincidence detection circuit 54 compares the count value of the counter 53 with the baud rate initial value of the baud rate initial value register 51 or the baud rate correction value of the baud rate correction value register 47 to identify the presence or absence of the coincidence, and the coincidence detection signal Is output. The coincidence detection signal is input to the I / O interface 35 and generates a sampling clock signal for acquiring information from serial data appearing on the communication line 13 and a shift clock signal for transmitting serial data. Used as a timing signal.

I/Oインタフェース35は、前記サンプリングクロック信号に応じたタイミングで、通信ライン13から入力されるシリアルデータを取得し、パラレルデータに変換する。変換されたデータはマイクロコンピュータ31により読み出される。また、マイクロコンピュータ31から送信用に出力されたパラレルデータの各ビットを前記シフトクロック信号に応じたタイミングでシリアルデータとして順次に通信ライン13に出力する。   The I / O interface 35 acquires serial data input from the communication line 13 at a timing according to the sampling clock signal, and converts it into parallel data. The converted data is read by the microcomputer 31. Further, each bit of the parallel data output for transmission from the microcomputer 31 is sequentially output to the communication line 13 as serial data at a timing according to the shift clock signal.

上述のように、スレーブノード11、12に備わっているボーレート補正回路36は、マスタノード10が通信ライン13に送出した通信信号の実際のボーレートを検出し、この検出値に追従するようなボーレート補正値を生成して通信のタイミングを自動的に補正する。従って、クロックジェネレータ33が生成するクロックパルスについては、高い精度や安定度を要求されない。そのため、CR発振回路のような安価な回路をクロックジェネレータ33が採用しても問題は生じない。   As described above, the baud rate correction circuit 36 provided in the slave nodes 11 and 12 detects the actual baud rate of the communication signal sent from the master node 10 to the communication line 13, and corrects the baud rate so as to follow the detected value. A value is generated to automatically correct the communication timing. Therefore, high accuracy and stability are not required for the clock pulse generated by the clock generator 33. Therefore, there is no problem even if the clock generator 33 employs an inexpensive circuit such as a CR oscillation circuit.

また、ボーレートのずれを許容範囲(−2%≦誤差≦+2%)内に維持するためには、ボーレートに比べて十分に周波数の高いクロックパルスを用いて時間計測タイマ43で時間長の計測を行う必要がある。しかし、ボーレート検出回路40内の加算器46が前述のような処理を行うので、クロックパルスの周波数をボーレートの64倍程度まで下げてもボーレートのずれを許容範囲に維持できる。   In order to maintain the deviation of the baud rate within an allowable range (−2% ≦ error ≦ + 2%), the time measurement timer 43 measures the time length using a clock pulse having a frequency sufficiently higher than the baud rate. There is a need to do. However, since the adder 46 in the baud rate detection circuit 40 performs the above-described processing, even if the clock pulse frequency is lowered to about 64 times the baud rate, the deviation of the baud rate can be maintained within an allowable range.

クロックパルスの周波数を下げることにより、クロックジェネレータ33自体やこれが出力するクロックパルスを処理する回路のコストを低減することができ、これらの回路が消費する電力を低減することも可能になる。   By reducing the frequency of the clock pulse, the cost of the clock generator 33 itself and the circuit for processing the clock pulse output from the clock generator 33 itself can be reduced, and the power consumed by these circuits can also be reduced.

なお、図2に示した回路構成のように、ボーレート補正回路として専用のハードウェアを搭載することにより、マイクロコンピュータ31が実行する処理の負担を軽減することができる。しかし、マイクロコンピュータ31の処理能力に十分に余裕があるような場合には、ボーレート検出回路40などの処理をマイクロコンピュータ31の内部処理、すなわちプログラムの実行により実現することができるので、専用のハードウェアの搭載を部分的に省略することもできる。   Note that, as in the circuit configuration shown in FIG. 2, by installing dedicated hardware as a baud rate correction circuit, the burden of processing executed by the microcomputer 31 can be reduced. However, when the processing capability of the microcomputer 31 is sufficient, the processing of the baud rate detection circuit 40 and the like can be realized by the internal processing of the microcomputer 31, that is, the execution of the program. The mounting of the wear can be partially omitted.

以上のように、本発明のシリアル通信用ボーレート検出装置およびシリアル通信用ボーレート補正装置ならびにシリアル通信用ボーレート検出方法は、例えば車載制御システムのように、LINなどの規格に従って複数ユニット間でデータ通信を行う通信システムに適用することができる。そして、本発明の実施により、ボーレート検出等の際に利用するクロックパルスの周波数を下げることが可能になり、回路コストの低減や、消費電力の低減が実現する。   As described above, the serial communication baud rate detection device, serial communication baud rate correction device, and serial communication baud rate detection method of the present invention perform data communication between a plurality of units in accordance with a standard such as LIN, for example, as in an in-vehicle control system. The present invention can be applied to a communication system. By implementing the present invention, it is possible to reduce the frequency of the clock pulse used when detecting the baud rate and the like, thereby realizing a reduction in circuit cost and power consumption.

10 マスタノード
11,12 スレーブノード
13 通信ライン
21,31 マイクロコンピュータ(CPU)
22,32 メモリ
23,33 クロックジェネレータ
24,34 通信部
25,35 I/Oインタフェース
26,36 ボーレート補正回路(シリアル通信用ボーレート補正装置)
40 ボーレート検出回路(シリアル通信用ボーレート検出装置)
41 エッジ検出回路
42 エッジカウンタ
43 時間計測タイマ
44,45 計測値保持部
46 加算器
47 ボーレート補正値レジスタ
51 ボーレート初期値レジスタ
52 データセレクタ
53 カウンタ
54 一致検出回路
10 Master node 11, 12 Slave node 13 Communication line 21, 31 Microcomputer (CPU)
22, 32 Memory 23, 33 Clock generator 24, 34 Communication unit 25, 35 I / O interface 26, 36 Baud rate correction circuit (baud rate correction device for serial communication)
40 Baud rate detection circuit (Baud rate detection device for serial communication)
41 Edge detection circuit 42 Edge counter 43 Time measurement timer 44, 45 Measurement value holding unit 46 Adder 47 Baud rate correction value register 51 Baud rate initial value register 52 Data selector 53 Counter 54 Match detection circuit

Claims (4)

伝送路を伝送するシリアル通信信号の所定区間の時間長に関する計測結果を利用して送信元のボーレートを検出するシリアル通信用ボーレート検出装置であって、
周期が一定のクロックパルスを発生するクロック発生部と、
前記所定区間のタイミングを検出する区間検出部と、
前記所定区間の間に、前記クロック発生部から出力されるクロックパルスを計数し、計数結果を2進数の時間計測値として出力する時間計測カウンタ部と、
前記時間計測カウンタ部が出力する時間計測値の2進数を、前記所定区間のビット構成に応じて上位ビット部と下位ビット部とに区分し、前記下位ビット部の中の最上位ビットの値を、前記上位ビット部の中の最下位ビットの値に加算するビット加算部と
を備えることを特徴とするシリアル通信用ボーレート検出装置。
A serial communication baud rate detection device that detects a baud rate of a transmission source using a measurement result relating to a time length of a predetermined section of a serial communication signal transmitted through a transmission path,
A clock generator for generating clock pulses with a constant period;
A section detector for detecting the timing of the predetermined section;
A time measurement counter unit that counts clock pulses output from the clock generation unit during the predetermined period, and outputs a count result as a binary time measurement value;
The binary value of the time measurement value output by the time measurement counter unit is divided into an upper bit part and a lower bit part according to the bit configuration of the predetermined section, and the value of the most significant bit in the lower bit part is A baud rate detecting device for serial communication, comprising: a bit adding unit that adds to a value of the least significant bit in the upper bit unit.
前記ビット加算部は、前記時間計測カウンタ部が出力する時間計測値の2進数の下位3ビットを前記下位ビット部に区分し、それ以外を前記上位ビット部に区分する
ことを特徴とする請求項1に記載のシリアル通信用ボーレート検出装置。
The bit addition unit divides the lower 3 bits of the binary number of the time measurement value output from the time measurement counter unit into the lower bit unit and the other bits into the upper bit unit. The baud rate detection device for serial communication according to 1.
伝送路を伝送するシリアル通信信号の所定区間の時間長に関する計測結果を利用して送信元のボーレートを検出し、検出されたボーレートに基づいて自局が使用するボーレートを補正するシリアル通信用ボーレート補正装置であって、
周期が一定のクロックパルスを発生するクロック発生部と、
前記所定区間のタイミングを検出する区間検出部と、
前記所定区間の間に、前記クロック発生部から出力されるクロックパルスを計数し、計数結果を2進数の時間計測値として出力する時間計測カウンタ部と、
前記時間計測カウンタ部が出力する時間計測値の2進数を、前記所定区間のビット構成に応じて上位ビット部と下位ビット部とに区分し、前記下位ビット部の中の最上位ビットの値を、前記上位ビット部の中の最下位ビットの値に加算するビット加算部と
を備えることを特徴とするシリアル通信用ボーレート補正装置。
Baud rate correction for serial communication that detects the baud rate of the transmission source using the measurement result related to the time length of a predetermined section of the serial communication signal transmitted through the transmission path, and corrects the baud rate used by the own station based on the detected baud rate A device,
A clock generator for generating clock pulses with a constant period;
A section detector for detecting the timing of the predetermined section;
A time measurement counter unit that counts clock pulses output from the clock generation unit during the predetermined period, and outputs a count result as a binary time measurement value;
The binary value of the time measurement value output by the time measurement counter unit is divided into an upper bit part and a lower bit part according to the bit configuration of the predetermined section, and the value of the most significant bit in the lower bit part is A baud rate correction device for serial communication, comprising: a bit addition unit that adds to a value of the least significant bit in the upper bit unit.
伝送路を伝送するシリアル通信信号の所定区間の時間長に関する計測結果を利用して送信元のボーレートを検出するためのシリアル通信用ボーレート検出方法であって、
周期が一定のクロックパルスを発生し、
前記所定区間のタイミングを検出し、
前記所定区間の間に前記クロックパルスを計数して計数結果を2進数の時間計測値として取得し、
前記時間計測値の2進数を、前記所定区間のビット構成に応じて上位ビット部と下位ビット部とに区分し、前記下位ビット部の中の最上位ビットの値を、前記上位ビット部の中の最下位ビットの値に加算した結果を出力する
ことを特徴とするシリアル通信用ボーレート検出方法。
A serial communication baud rate detection method for detecting a baud rate of a transmission source using a measurement result related to a time length of a predetermined section of a serial communication signal transmitted through a transmission path,
Generate clock pulses with a constant period,
Detecting the timing of the predetermined section;
The clock pulse is counted during the predetermined interval, and the counting result is acquired as a binary time measurement value,
The binary number of the time measurement value is divided into an upper bit part and a lower bit part according to the bit configuration of the predetermined section, and the value of the most significant bit in the lower bit part is set in the upper bit part. A baud rate detection method for serial communication, characterized in that the result of adding to the value of the least significant bit is output.
JP2010102551A 2010-04-27 2010-04-27 Baud rate detecting device for serial communication, baud rate correcting device for serial communication, and baud rate detecting method for serial communication Abandoned JP2011234128A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010102551A JP2011234128A (en) 2010-04-27 2010-04-27 Baud rate detecting device for serial communication, baud rate correcting device for serial communication, and baud rate detecting method for serial communication

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010102551A JP2011234128A (en) 2010-04-27 2010-04-27 Baud rate detecting device for serial communication, baud rate correcting device for serial communication, and baud rate detecting method for serial communication

Publications (1)

Publication Number Publication Date
JP2011234128A true JP2011234128A (en) 2011-11-17

Family

ID=45323002

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010102551A Abandoned JP2011234128A (en) 2010-04-27 2010-04-27 Baud rate detecting device for serial communication, baud rate correcting device for serial communication, and baud rate detecting method for serial communication

Country Status (1)

Country Link
JP (1) JP2011234128A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014082696A (en) * 2012-10-18 2014-05-08 New Japan Radio Co Ltd Serial communication apparatus
CN103970698A (en) * 2014-02-28 2014-08-06 北京经纬恒润科技有限公司 Serial communication baud rate identification method and device, microcontroller and system
JP2014187633A (en) * 2013-03-25 2014-10-02 Spansion Llc Serial communication system, receiver and serial communication method
CN108694435A (en) * 2017-03-30 2018-10-23 拉碧斯半导体株式会社 Semiconductor device, contactless electronic device and periodicity detection methods
CN110581814A (en) * 2019-09-06 2019-12-17 惠州志顺电子实业有限公司 Baud rate adjusting method of communication equipment and communication equipment
CN113014372A (en) * 2021-03-05 2021-06-22 海速芯(无锡)科技有限公司 Baud rate correction hardware device for serial data transmission and design method
CN113810154A (en) * 2020-06-17 2021-12-17 国网信息通信产业集团有限公司 Serial port communication self-adaption method and device and remote communication module
CN114006842A (en) * 2021-10-29 2022-02-01 北京中科昊芯科技有限公司 Method, device, equipment and medium for detecting baud rate
CN114338476A (en) * 2022-03-15 2022-04-12 北京金橙子科技股份有限公司 Communication baud rate detection and address allocation method based on pulse code measurement
CN115412469A (en) * 2022-11-01 2022-11-29 深圳市航顺芯片技术研发有限公司 Tolerance detection method, computer device and readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007166179A (en) * 2005-12-13 2007-06-28 Denso Corp Serial communication apparatus
JP2007324679A (en) * 2006-05-30 2007-12-13 Nec Electronics Corp Baud rate generator for serial communication

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007166179A (en) * 2005-12-13 2007-06-28 Denso Corp Serial communication apparatus
JP2007324679A (en) * 2006-05-30 2007-12-13 Nec Electronics Corp Baud rate generator for serial communication

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014082696A (en) * 2012-10-18 2014-05-08 New Japan Radio Co Ltd Serial communication apparatus
JP2014187633A (en) * 2013-03-25 2014-10-02 Spansion Llc Serial communication system, receiver and serial communication method
CN103970698A (en) * 2014-02-28 2014-08-06 北京经纬恒润科技有限公司 Serial communication baud rate identification method and device, microcontroller and system
CN108694435A (en) * 2017-03-30 2018-10-23 拉碧斯半导体株式会社 Semiconductor device, contactless electronic device and periodicity detection methods
CN108694435B (en) * 2017-03-30 2023-06-27 拉碧斯半导体株式会社 Semiconductor device, non-contact electronic device, and cycle detection method
CN110581814B (en) * 2019-09-06 2022-03-29 惠州志顺电子实业有限公司 Baud rate adjusting method of communication equipment and communication equipment
CN110581814A (en) * 2019-09-06 2019-12-17 惠州志顺电子实业有限公司 Baud rate adjusting method of communication equipment and communication equipment
CN113810154A (en) * 2020-06-17 2021-12-17 国网信息通信产业集团有限公司 Serial port communication self-adaption method and device and remote communication module
CN113014372B (en) * 2021-03-05 2022-08-09 海速芯(杭州)科技有限公司 Baud rate correction hardware device for serial data transmission and design method
CN113014372A (en) * 2021-03-05 2021-06-22 海速芯(无锡)科技有限公司 Baud rate correction hardware device for serial data transmission and design method
CN114006842A (en) * 2021-10-29 2022-02-01 北京中科昊芯科技有限公司 Method, device, equipment and medium for detecting baud rate
CN114006842B (en) * 2021-10-29 2023-03-10 北京中科昊芯科技有限公司 Method, device, equipment and medium for detecting baud rate
CN114338476A (en) * 2022-03-15 2022-04-12 北京金橙子科技股份有限公司 Communication baud rate detection and address allocation method based on pulse code measurement
CN114338476B (en) * 2022-03-15 2022-06-03 北京金橙子科技股份有限公司 Communication baud rate detection and address allocation method based on pulse code measurement
CN115412469A (en) * 2022-11-01 2022-11-29 深圳市航顺芯片技术研发有限公司 Tolerance detection method, computer device and readable storage medium

Similar Documents

Publication Publication Date Title
JP2011234128A (en) Baud rate detecting device for serial communication, baud rate correcting device for serial communication, and baud rate detecting method for serial communication
US7620075B2 (en) Serial communication system with baud rate generator
JP4767178B2 (en) System and method for maintaining a common sense of time on a network segment
US11552871B2 (en) Receive-side timestamp accuracy
US20110035511A1 (en) Remote Hardware Timestamp-Based Clock Synchronization
EP2738971A1 (en) Mehtod and device for clock synchronization
KR100909296B1 (en) Method and apparatus for synchronizing at least one user of a bus system and a corresponding bus system
JP2007060400A (en) Method and system for controlling communication timing
JP2011035473A (en) Baud rate error detection circuit and baud rate error detection method
JP2011172144A (en) Synchronous signal detection apparatus
CN104144047A (en) Synchronization method of communication network system, intermediate node and slave node
JP2007282093A (en) Apparatus and method for clock signal generation
JP4582932B2 (en) Synchronous correction circuit
US20200073838A1 (en) Bus system
CN113056881A (en) Method for operating a network participant in an automation communication network
JP3523238B2 (en) Audio data synchronization correction circuit
US11451410B2 (en) Subscriber in a bus system, method for operation and a bus system
JP7328064B2 (en) Synchronization method and control device
JP6205152B2 (en) Serial communication system, receiving apparatus and serial communication method
EP2106052A2 (en) Communication system, transmitting apparatus, receiving apparatus, communication method and record medium for transferring a clock in a packet network
JP2005184092A (en) Clock synchronization system and clock synchronization method
JP6871073B2 (en) Electronic control device
JP4274469B2 (en) Data capture clock correction circuit
JP2014082697A (en) Serial communication apparatus
US20240126629A1 (en) Semiconductor device and serial communication interface control method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20130313

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140130

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140204

A762 Written abandonment of application

Free format text: JAPANESE INTERMEDIATE CODE: A762

Effective date: 20140328