JP2011091742A - Communication device - Google Patents

Communication device Download PDF

Info

Publication number
JP2011091742A
JP2011091742A JP2009245466A JP2009245466A JP2011091742A JP 2011091742 A JP2011091742 A JP 2011091742A JP 2009245466 A JP2009245466 A JP 2009245466A JP 2009245466 A JP2009245466 A JP 2009245466A JP 2011091742 A JP2011091742 A JP 2011091742A
Authority
JP
Japan
Prior art keywords
communication
baud rate
bit
start bit
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2009245466A
Other languages
Japanese (ja)
Inventor
Toru Uehara
植原  徹
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.)
Kyocera Corp
Original Assignee
Kyocera 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 Kyocera Corp filed Critical Kyocera Corp
Priority to JP2009245466A priority Critical patent/JP2011091742A/en
Publication of JP2011091742A publication Critical patent/JP2011091742A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a communication device in which calculation accuracy of a baud rate can be improved. <P>SOLUTION: The communication device includes a communication part for transmitting and receiving a serial signal containing a start bit and an end bit in one frame, a detecting part for detecting the start bit and the end bit contained in the serial signal transmitted from a communication opponent device, a time measuring part for starting time measuring operation when the start bit is detected by the detecting part and ending the time measuring operation when the end bit is detected by the detecting part, and a setting part for calculating a baud rate based on the result of time measurement of the time measuring part and setting the calculated baud rate in the communication part. <P>COPYRIGHT: (C)2011,JPO&INPIT

Description

本発明は、通信装置に関する。  The present invention relates to a communication device.

周知のように、UART(Universal Asynchronous Receiver Transmitter)インタフェースを備えるデバイス間でシリアル通信を行う場合、送信側デバイスのボーレートと同じボーレートを受信側デバイスで設定する必要がある。送信側デバイスのボーレートが既知の場合には手動操作によって受信側デバイスのボーレートを設定すれば良いが、不明の場合には受信側デバイスにおいてボーレートの自動設定を行う必要がある。   As is well known, when serial communication is performed between devices having a UART (Universal Asynchronous Receiver Transmitter) interface, it is necessary to set a baud rate that is the same as the baud rate of the transmitting device on the receiving device. When the baud rate of the transmission side device is known, the baud rate of the reception side device may be set by manual operation. When the baud rate is unknown, it is necessary to automatically set the baud rate at the reception side device.

従来では、ボーレートの自動設定を行う方法として、受信側デバイスにおいて受信可能なタイミングが見つかるまで何度もボーレートを変えることで適切なボーレートを探索する方法(下記特許文献1〜3参照)や、受信側デバイスにおいて受信したシリアル信号を測定してボーレートを算出する方法(下記特許文献4参照)などがある。   Conventionally, as a method for automatically setting a baud rate, a method for searching for an appropriate baud rate by changing the baud rate many times until a receivable timing is found at a receiving device (see Patent Documents 1 to 3 below), or reception There is a method of calculating a baud rate by measuring a serial signal received by a side device (see Patent Document 4 below).

なお、シリアル信号に含まれるスタートビットの期間を測定すればボーレートを算出することが可能であるが、転送経路の条件により、スタートビットの立下り遅延時間と立上り遅延時間の差が大きくなると、スタートビット期間の測定精度が低下し、ひいてはボーレートの算出精度が低下する虞がある。   Note that the baud rate can be calculated by measuring the start bit period included in the serial signal.However, if the difference between the start bit fall delay time and the rise delay time increases due to transfer path conditions, the start bit There is a possibility that the measurement accuracy of the bit period is lowered, and consequently the calculation accuracy of the baud rate is lowered.

これに対して、特許文献4の技術では、スタートビットの立下りから立上りの期間を測定するための第1のカウンタ及び第2のカウンタと、転送速度を測定するコマンドの1フレーム最後の立下り時間と立上り時間を測定するための第3のカウンタ及び第4のカウンタとを有し、スタートビットの立下りから転送データの最後の立下り、或いはスタートビットの立上りから転送データの最後の立上りの期間で転送速度(ボーレート)を算出することにより、ボーレートの算出精度の向上を図っている。   On the other hand, in the technique of Patent Document 4, the first and second counters for measuring the period from the falling edge of the start bit to the rising edge at the end of one frame of the command for measuring the transfer rate A third counter and a fourth counter for measuring the time and the rise time, from the fall of the start bit to the last fall of the transfer data, or from the rise of the start bit to the last rise of the transfer data By calculating the transfer rate (baud rate) over a period, the calculation accuracy of the baud rate is improved.

特開平10−308793号公報Japanese Patent Laid-Open No. 10-308793 特開2004−646919号公報JP 2004-646919 A 特開2005−333513号公報JP 2005-333513 A 特開平11−112599号公報Japanese Patent Laid-Open No. 11-112599

特許文献1〜3の技術では、受信可能なタイミングが見つかるまで何度もボーレートを変える必要があるため、ボーレートを設定するまでの時間が長くなるという問題があった。また、予め決められたボーレートにしか対応できず、任意のボーレート設定には対応できないという問題があった。特許文献4の技術では上述した特許文献1〜3の問題は生じないが、ボーレートを算出するための回路構成が複雑化するという問題があった。このような回路構成の複雑化を回避するために、スタートビットの期間のみ測定することでボーレートを算出する方法を採用すると、結局、ボーレートの算出精度が低下するという問題を解決することができない。   In the techniques of Patent Documents 1 to 3, since it is necessary to change the baud rate many times until a receivable timing is found, there is a problem that it takes a long time to set the baud rate. Further, there is a problem that only a predetermined baud rate can be handled, and any baud rate setting cannot be handled. The technique of Patent Document 4 does not cause the problems of Patent Documents 1 to 3 described above, but has a problem that the circuit configuration for calculating the baud rate is complicated. In order to avoid such complication of the circuit configuration, if a method of calculating the baud rate by measuring only the start bit period is employed, the problem that the baud rate calculation accuracy is lowered cannot be solved.

本発明は、上述した事情に鑑みてなされたものであり、ボーレートの算出精度を向上させることが可能な通信装置を提供することを目的とする。   The present invention has been made in view of the above-described circumstances, and an object of the present invention is to provide a communication device capable of improving the accuracy of baud rate calculation.

上記目的を達成するために、本発明に係る通信装置は、1フレーム内に開始ビット及び終了ビットを含むシリアル信号を送受信する通信部と、通信相手装置から送信される前記シリアル信号に含まれる前記開始ビット及び前記終了ビットを検出する検出部と、前記検出部にて前記開始ビットが検出された場合に計時動作を開始する一方、前記検出部にて前記終了ビットが検出された場合に前記計時動作を終了する計時部と、前記計時部の計時結果に基づいてボーレートを算出し、当該算出したボーレートを前記通信部に設定する設定部と、を備えることを特徴とする。   In order to achieve the above object, a communication device according to the present invention includes a communication unit that transmits and receives a serial signal including a start bit and an end bit in one frame, and the serial signal transmitted from a communication partner device. A detection unit for detecting a start bit and the end bit; and a timing operation when the detection unit detects the start bit, while the timing unit detects the end bit. And a setting unit configured to calculate a baud rate based on a timing result of the timing unit and to set the calculated baud rate in the communication unit.

また、上記の通信装置において、前記1フレーム内において、前記開始ビットの区間はローレベルに、前記終了ビットの区間はハイレベルに、前記開始ビットと前記終了ビットとの間の区間はローレベルに設定されたシリアル信号が前記通信相手装置から送信される場合、前記検出部は、前記シリアル信号の立下りエッジを前記開始ビットとして検出する一方、前記シリアル信号の立上がりエッジを前記終了ビットとして検出することを特徴とする。   In the communication apparatus, in the one frame, the section of the start bit is at a low level, the section of the end bit is at a high level, and the section between the start bit and the end bit is at a low level. When the set serial signal is transmitted from the communication counterpart device, the detection unit detects the falling edge of the serial signal as the start bit, and detects the rising edge of the serial signal as the end bit. It is characterized by that.

また、上記の通信装置において、前記設定部は、複数のフレームの各々について得られる前記計時部の計時結果に基づいて前記ボーレートの平均値を算出し、当該算出したボーレートの平均値を前記通信部に設定することを特徴とする。
また、上記の通信装置において、前記通信部は、UART(Universal Asynchronous Receiver Transmitter)インタフェースであることを特徴とする。
Further, in the communication device, the setting unit calculates an average value of the baud rate based on a time measurement result of the time measuring unit obtained for each of a plurality of frames, and calculates the average value of the calculated baud rate as the communication unit. It is characterized by setting to.
In the communication apparatus, the communication unit is a UART (Universal Asynchronous Receiver Transmitter) interface.

本発明では、通信相手装置から送信されるシリアル信号に含まれる開始ビットから終了ビットまでの、複数ビットに亘る区間の時間測定結果(計時部の計時結果)からボーレートを算出するため、ボーレートの算出精度を向上することができる。   In the present invention, the baud rate is calculated in order to calculate the baud rate from the time measurement result (time measurement result of the time measurement unit) in a section extending over a plurality of bits from the start bit to the end bit included in the serial signal transmitted from the communication partner device. Accuracy can be improved.

本発明の一実施形態に係る通信装置1のブロック構成図である。It is a block block diagram of the communication apparatus 1 which concerns on one Embodiment of this invention. 通常通信時に通信装置1と通信相手装置2との間で送受信されるUART信号のフォーマット(a)と、通信接続の確立時に通信相手装置2から送信されるUART信号のフォーマット(b)である。The format (a) of the UART signal transmitted / received between the communication device 1 and the communication partner device 2 during normal communication and the format (b) of the UART signal transmitted from the communication partner device 2 when the communication connection is established. 通信装置1のボーレート設定動作を示すフローチャートである。4 is a flowchart showing a baud rate setting operation of the communication device 1. 通信装置1のボーレート設定動作を示すタイミングチャートである。3 is a timing chart showing a baud rate setting operation of the communication apparatus 1;

以下、本発明の一実施形態について、図面を参照しながら説明する。
図1は、本実施形態における通信装置1のブロック構成図である。本実施形態における通信装置1は、通信相手装置2(例えばパーソナルコンピュータ等)とシリアル通信を行うもの(例えばモデム等)であり、UARTインタフェース11、外部割込回路12、タイマ13及びCPU(Central Processing Unit)14を備えている。なお、図1では、説明の便宜上、通信相手装置2の内部ブロックとしてUARTインタフェース21のみを図示している。
Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
FIG. 1 is a block configuration diagram of a communication device 1 according to the present embodiment. The communication device 1 according to the present embodiment performs serial communication (for example, a modem) with a communication partner device 2 (for example, a personal computer), and includes a UART interface 11, an external interrupt circuit 12, a timer 13, and a CPU (Central Processing). Unit) 14. In FIG. 1, only the UART interface 21 is illustrated as an internal block of the communication partner device 2 for convenience of explanation.

通信装置1において、UARTインタフェース11(通信部)は、通信相手装置2のUARTインタフェース21との間で、1フレーム内にスタートビット(開始ビット)及びストップビット(終了ビット)を含むUART信号(シリアル信号)を送受信するものである。具体的には、このUARTインタフェース11は、CPU14から入力される送信データ(パラレルデータ)をシリアル変換することで送信用のUART信号を生成する一方、受信したUART信号をパラレル変換することで受信データ(パラレルデータ)を生成してCPU14へ出力する。なお、UARTインタフェース11には、シリアル通信に必要なボーレート等の設定情報を設定するための設定レジスタ11aが設けられている。   In the communication apparatus 1, the UART interface 11 (communication unit) communicates with the UART interface 21 of the communication partner apparatus 2 in a UART signal (serial bit) including a start bit (start bit) and a stop bit (end bit) in one frame. Signal). Specifically, the UART interface 11 generates transmission UART signals by serially converting transmission data (parallel data) input from the CPU 14, while receiving data by converting received UART signals in parallel. (Parallel data) is generated and output to the CPU 14. The UART interface 11 is provided with a setting register 11a for setting setting information such as a baud rate necessary for serial communication.

外部割込回路12(検出部)は、通信相手装置2のUARTインタフェース21からUARTインタフェース11へ送信されるUART信号が分岐して入力されており、このUART信号に含まれるスタートビット及びストップビットを検出するものである。具体的には、この外部割込回路12は、UART信号の立下りエッジをスタートビットとして検出する一方、UART信号の立上がりエッジをストップビットとして検出する。なお、この外部割込回路12は、UART信号の立下りエッジを検出したタイミングと、立上がりエッジを検出したタイミングで、ハイレベルのパルス信号をタイマ13へ出力する。   The external interrupt circuit 12 (detection unit) branches and receives a UART signal transmitted from the UART interface 21 of the communication counterpart device 2 to the UART interface 11, and receives a start bit and a stop bit included in the UART signal. It is to detect. Specifically, the external interrupt circuit 12 detects the falling edge of the UART signal as a start bit, and detects the rising edge of the UART signal as a stop bit. The external interrupt circuit 12 outputs a high-level pulse signal to the timer 13 at the timing when the falling edge of the UART signal is detected and at the timing when the rising edge is detected.

タイマ13(計時部)は、外部割込回路12にてスタートビットが検出された場合に計時動作を開始する一方、外部割込回路12にてストップビットが検出された場合に計時動作を終了するものである。具体的には、このタイマ13は、外部割込回路12から最初のパルス信号が入力されたタイミングでタイムカウンタを起動し、次のパルス信号が入力されたタイミングでタイムカウンタを停止し、その時のタイムカウンタの値(タイムカウント値)をCPU14へ出力する。   The timer 13 (timer unit) starts a timekeeping operation when a start bit is detected by the external interrupt circuit 12, and ends a timekeeping operation when a stop bit is detected by the external interrupt circuit 12. Is. Specifically, the timer 13 starts the time counter at the timing when the first pulse signal is input from the external interrupt circuit 12, stops the time counter at the timing when the next pulse signal is input, The value of the time counter (time count value) is output to the CPU 14.

CPU14(設定部)は、通信装置1の通信動作を統括制御するものであり、具体的には送信データを生成してUARTインタフェース11へ出力したり、UARTインタフェース11から入力される受信データを基に所定の信号処理を行う。また、このCPU14は、タイマ13から入力されるタイムカウント値(計時結果)に基づいて、通信相手装置2から送信されたUART信号のボーレートを算出し、当該算出したボーレートをUARTインタフェース11の設定レジスタ11aに設定するボーレート自動設定機能を有している。   The CPU 14 (setting unit) performs overall control of communication operations of the communication device 1. Specifically, the CPU 14 generates transmission data and outputs it to the UART interface 11, or receives data input from the UART interface 11. Predetermined signal processing is performed. Further, the CPU 14 calculates the baud rate of the UART signal transmitted from the communication counterpart device 2 based on the time count value (time measurement result) input from the timer 13, and the calculated baud rate is set in the setting register of the UART interface 11. 11a has a baud rate automatic setting function set to 11a.

次に、上記のように構成された本実施形態における通信装置1の動作、特にボーレート設定動作について詳細に説明する。まず、ボーレート設定動作の説明に入る前に、その前提となるUART信号のフォーマットについて説明する。図2(a)は、通常通信時(通信接続の確立後)において、通信装置1と通信相手装置2との間で送受信されるUART信号のフォーマットを示し、図2(b)は、通信接続の確立時において、通信相手装置2から通信装置1へ送信されるUART信号のフォーマットを示している。   Next, the operation of the communication apparatus 1 in the present embodiment configured as described above, in particular, the baud rate setting operation will be described in detail. First, before starting the description of the baud rate setting operation, the format of the UART signal as a premise thereof will be described. FIG. 2A shows the format of a UART signal transmitted and received between the communication device 1 and the communication partner device 2 during normal communication (after establishing a communication connection), and FIG. 2B shows the communication connection. The format of the UART signal transmitted from the communication partner device 2 to the communication device 1 at the time of establishment is shown.

図2(a)に示すように、通常通信時では、1フレーム内にスタートビット(1ビット)、データビット(8ビット)、ストップビット(1ビット)を含むUART信号が通信装置1と通信相手装置2との間で送受信される。なお、UART通信では、スタートビットの区間をローレベル(「0」)に、ストップビットの区間をハイレベル(「1」)に設定するように規定されている。   As shown in FIG. 2A, during normal communication, a UART signal including a start bit (1 bit), a data bit (8 bits), and a stop bit (1 bit) in one frame is transmitted to the communication apparatus 1 and a communication partner. It is transmitted to and received from the device 2. In the UART communication, it is defined that the start bit section is set to a low level (“0”) and the stop bit section is set to a high level (“1”).

一方、図2(b)に示すように、通信接続の確立時では、「パリティ無し、データ=00hex」という条件で生成されたUART信号、つまり、1フレーム内において、スタートビットの区間はローレベルに、ストップビットの区間はハイレベルに、スタートビットとストップビットとの間の区間はローレベルに設定されたUART信号が通信相手装置2から送信される。この場合、1フレーム中、9ビットがローレベルの区間となる。   On the other hand, as shown in FIG. 2B, at the time of establishing the communication connection, the UART signal generated under the condition of “no parity, data = 00 hex”, that is, the start bit section is low level in one frame. The communication partner apparatus 2 transmits a UART signal in which the stop bit interval is set to a high level and the interval between the start bit and the stop bit is set to a low level. In this case, 9 bits are a low level section in one frame.

通信装置1は、図2(b)に示したように、通信接続の確立時に通信相手装置2から送信されるUART信号の1フレーム内のローレベル区間の時間を測定し、その測定結果に基づいてボーレートを算出する。図3は、通信接続の確立時における通信装置1のボーレート設定動作を示すフローチャートである。   As shown in FIG. 2B, the communication device 1 measures the time of the low level section in one frame of the UART signal transmitted from the communication partner device 2 when the communication connection is established, and based on the measurement result. To calculate the baud rate. FIG. 3 is a flowchart showing the baud rate setting operation of the communication device 1 when establishing a communication connection.

図3に示すように、まず、通信装置1の外部割込回路12は、通信相手装置2から送信されるUART信号を監視し、立下りエッジを検出したか否かを判定する(ステップS1)。このステップS1において、「Yes」の場合、外部割込回路12は、立下りエッジを検出したタイミングで、ハイレベルのパルス信号をタイマ13へ出力し、タイマ13はパルス信号が入力されたタイミングでタイムカウンタを起動する(ステップS2)。  As shown in FIG. 3, first, the external interrupt circuit 12 of the communication device 1 monitors the UART signal transmitted from the communication partner device 2 and determines whether or not a falling edge has been detected (step S1). . In this step S1, if “Yes”, the external interrupt circuit 12 outputs a high-level pulse signal to the timer 13 at the timing when the falling edge is detected, and the timer 13 at the timing when the pulse signal is input. The time counter is activated (step S2).

そして、外部割込回路12は、通信相手装置2から送信されるUART信号を引き続き監視し、立上がりエッジを検出したか否かを判定する(ステップS3)。このステップS3において、「Yes」の場合、外部割込回路12は、立上がりエッジを検出したタイミングで、ハイレベルのパルス信号をタイマ13へ出力し、タイマ13はパルス信号が入力されたタイミングでタイムカウンタを停止する(ステップS4)。ここで、タイマ13は、その時のタイムカウント値をCPU14へ出力する。   Then, the external interrupt circuit 12 continues to monitor the UART signal transmitted from the communication counterpart device 2 and determines whether or not a rising edge has been detected (step S3). In the case of “Yes” in step S3, the external interrupt circuit 12 outputs a high level pulse signal to the timer 13 at the timing when the rising edge is detected, and the timer 13 times at the timing when the pulse signal is input. The counter is stopped (step S4). Here, the timer 13 outputs the time count value at that time to the CPU 14.

そして、CPU14は、タイマ13から入力されるタイムカウント値に基づいて、通信相手装置2から送信されたUART信号のボーレートを算出する(ステップS5)。具体的には、タイムカウント値は、図2(b)に示すUART信号における1フレーム内のローレベル区間(9ビット分の区間)の時間を示す値であるため、そのローレベル区間の時間の逆数を9で割ることでボーレートを算出することができる。CPU14は、このように算出したボーレートをUARTインタフェース11の設定レジスタ11aに設定する(ステップS6)。   Then, the CPU 14 calculates the baud rate of the UART signal transmitted from the communication counterpart device 2 based on the time count value input from the timer 13 (step S5). Specifically, the time count value is a value indicating the time of a low level section (9 bits section) in one frame in the UART signal shown in FIG. The baud rate can be calculated by dividing the reciprocal by 9. The CPU 14 sets the baud rate calculated in this way in the setting register 11a of the UART interface 11 (step S6).

図4は、上述した通信装置1のボーレート設定動作をタイミングチャートで表したものである。この図4に示すように、UART信号の立下りエッジが検出されたタイミングで、パルス信号が外部割込回路12からタイマ13へ出力されてタイムカウンタが起動し、その後、UART信号の立上がりエッジが検出されたタイミングで、再度、パルス信号が外部割込回路12からタイマ13へ出力されてタイムカウンタが停止し、CPU14によってボーレートが算出されて、設定レジスタ11aにボーレートが設定される。   FIG. 4 is a timing chart showing the baud rate setting operation of the communication apparatus 1 described above. As shown in FIG. 4, at the timing when the falling edge of the UART signal is detected, a pulse signal is output from the external interrupt circuit 12 to the timer 13 to start the time counter, and thereafter, the rising edge of the UART signal At the detected timing, the pulse signal is output again from the external interrupt circuit 12 to the timer 13, the time counter is stopped, the baud rate is calculated by the CPU 14, and the baud rate is set in the setting register 11a.

以上説明したように、本実施形態の通信装置1では、従来のようなスタートビットの区間だけでなく、複数ビットに亘る区間の時間測定結果からボーレートを算出するため、ボーレートの算出精度を向上することができる。また、その区間の時間を測定するために、UART信号の立下りエッジ及び立上がりエッジを検出する外部割込回路12と、計時動作を行うタイマ13とを設けるだけで良いので、回路構成を単純化することができる。すなわち、本実施形態の通信装置1によれば、ボーレートの算出精度の向上と、回路構成の単純化とを両立することが可能となる。   As described above, in the communication apparatus 1 of the present embodiment, the baud rate calculation accuracy is improved because the baud rate is calculated not only from the conventional start bit section but also from the time measurement result of the section over a plurality of bits. be able to. Further, in order to measure the time of the section, it is only necessary to provide the external interrupt circuit 12 for detecting the falling edge and the rising edge of the UART signal and the timer 13 for performing the time measuring operation, so that the circuit configuration is simplified. can do. That is, according to the communication apparatus 1 of the present embodiment, it is possible to achieve both improvement in baud rate calculation accuracy and simplification of the circuit configuration.

なお、本発明は上記実施形態に限定されず、以下のような変形例が挙げられる。
(1)上記実施形態では、通信相手装置2から送信されるUART信号に含まれる1フレーム内のローレベル区間のみを測定して得られるタイムカウント値を基にボーレートを算出する場合を例示したが、複数のフレームの各々について得られるタイムカウント値に基づいてボーレートの平均値を算出し、当該算出したボーレートの平均値をUARTインタフェース11に設定する機能をCPU14に設けても良い。これにより、ボーレートの算出精度をさらに向上することができる。
In addition, this invention is not limited to the said embodiment, The following modifications are mentioned.
(1) In the above embodiment, the case where the baud rate is calculated based on the time count value obtained by measuring only the low level section in one frame included in the UART signal transmitted from the communication partner apparatus 2 is exemplified. The CPU 14 may be provided with a function of calculating an average value of the baud rate based on the time count value obtained for each of the plurality of frames and setting the calculated average value of the baud rate in the UART interface 11. Thereby, the calculation accuracy of the baud rate can be further improved.

(2)上記実施形態では、1フレーム内に開始ビット及び終了ビットを含むシリアル信号を送受信する通信部としてUARTインタフェース11を備える通信装置1を例示したが、1フレーム内に開始ビット及び終了ビットを含むようなシリアル信号を送受信するものであれば、他のインタフェースを用いても良い。また、UART信号のフォーマットは、図2に限定されるものではない。特に、通信接続の確立時に、通信相手装置2から通信装置1へ送信するUART信号における1フレーム内のローレベル区間は長い方が望ましい。 (2) In the above embodiment, the communication device 1 including the UART interface 11 as a communication unit that transmits and receives a serial signal including a start bit and an end bit in one frame is illustrated. However, a start bit and an end bit are included in one frame. Other interfaces may be used as long as they can transmit and receive serial signals. Further, the format of the UART signal is not limited to that shown in FIG. In particular, it is desirable that the low level section in one frame in the UART signal transmitted from the communication partner apparatus 2 to the communication apparatus 1 is longer when establishing the communication connection.

1…通信装置、11…UARTインタフェース(通信部)、11a…設定レジスタ、12…外部割込回路(検出部)、13…タイマ(計時部)、14…CPU(Central Processing Unit:設定部)、2…通信相手装置、21…UARTインタフェース   DESCRIPTION OF SYMBOLS 1 ... Communication apparatus, 11 ... UART interface (communication part), 11a ... Setting register, 12 ... External interrupt circuit (detection part), 13 ... Timer (time measuring part), 14 ... CPU (Central Processing Unit: Setting part), 2 ... Communication partner device, 21 ... UART interface

Claims (4)

1フレーム内に開始ビット及び終了ビットを含むシリアル信号を送受信する通信部と、
通信相手装置から送信される前記シリアル信号に含まれる前記開始ビット及び前記終了ビットを検出する検出部と、
前記検出部にて前記開始ビットが検出された場合に計時動作を開始する一方、前記検出部にて前記終了ビットが検出された場合に前記計時動作を終了する計時部と、
前記計時部の計時結果に基づいてボーレートを算出し、当該算出したボーレートを前記通信部に設定する設定部と、
を備えることを特徴とする通信装置。
A communication unit for transmitting and receiving a serial signal including a start bit and an end bit in one frame;
A detection unit for detecting the start bit and the end bit included in the serial signal transmitted from a communication partner device;
A timing unit that starts a timing operation when the detection unit detects the start bit, and ends the timing operation when the detection unit detects the end bit;
A baud rate is calculated based on the time measurement result of the time measuring unit, and a setting unit that sets the calculated baud rate in the communication unit;
A communication apparatus comprising:
前記1フレーム内において、前記開始ビットの区間はローレベルに、前記終了ビットの区間はハイレベルに、前記開始ビットと前記終了ビットとの間の区間はローレベルに設定されたシリアル信号が前記通信相手装置から送信される場合、
前記検出部は、前記シリアル信号の立下りエッジを前記開始ビットとして検出する一方、前記シリアル信号の立上がりエッジを前記終了ビットとして検出することを特徴とする請求項1記載の通信装置。
Within the one frame, the start bit interval is set to low level, the end bit interval is set to high level, and the interval between the start bit and the end bit is set to low level. When sent from the other device,
The communication device according to claim 1, wherein the detection unit detects a falling edge of the serial signal as the start bit, and detects a rising edge of the serial signal as the end bit.
前記設定部は、複数のフレームの各々について得られる前記計時部の計時結果に基づいて前記ボーレートの平均値を算出し、当該算出したボーレートの平均値を前記通信部に設定することを特徴とする請求項1または2に記載の通信装置。   The setting unit calculates an average value of the baud rate based on a timing result of the timing unit obtained for each of a plurality of frames, and sets the calculated average value of the baud rate in the communication unit. The communication device according to claim 1 or 2. 前記通信部は、UART(Universal Asynchronous Receiver Transmitter)インタフェースであることを特徴とする請求項1〜3のいずれか一項に記載の通信装置。   The communication apparatus according to claim 1, wherein the communication unit is a UART (Universal Asynchronous Receiver Transmitter) interface.
JP2009245466A 2009-10-26 2009-10-26 Communication device Pending JP2011091742A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009245466A JP2011091742A (en) 2009-10-26 2009-10-26 Communication device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009245466A JP2011091742A (en) 2009-10-26 2009-10-26 Communication device

Publications (1)

Publication Number Publication Date
JP2011091742A true JP2011091742A (en) 2011-05-06

Family

ID=44109548

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009245466A Pending JP2011091742A (en) 2009-10-26 2009-10-26 Communication device

Country Status (1)

Country Link
JP (1) JP2011091742A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015064355A (en) * 2013-09-25 2015-04-09 ドクトル・ヨハネス・ハイデンハイン・ゲゼルシヤフト・ミツト・ベシユレンクテル・ハフツングDr. Johannes Heidenhain Gesellschaft Mitbeschrankter Haftung Position measuring device, and method of inspecting operation clock signal
US10673478B2 (en) 2018-07-25 2020-06-02 Kabushiki Kaisha Toshiba Asynchronous communication device
JP2020198514A (en) * 2019-05-31 2020-12-10 株式会社富士通ゼネラル Communication device, baud rate automatic setting method and communication system
CN113557688A (en) * 2019-04-24 2021-10-26 欧姆龙株式会社 Serial data communication device

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015064355A (en) * 2013-09-25 2015-04-09 ドクトル・ヨハネス・ハイデンハイン・ゲゼルシヤフト・ミツト・ベシユレンクテル・ハフツングDr. Johannes Heidenhain Gesellschaft Mitbeschrankter Haftung Position measuring device, and method of inspecting operation clock signal
US10673478B2 (en) 2018-07-25 2020-06-02 Kabushiki Kaisha Toshiba Asynchronous communication device
CN113557688A (en) * 2019-04-24 2021-10-26 欧姆龙株式会社 Serial data communication device
US11960432B2 (en) 2019-04-24 2024-04-16 Omron Corporation Serial data communication device and serial data communication method
JP2020198514A (en) * 2019-05-31 2020-12-10 株式会社富士通ゼネラル Communication device, baud rate automatic setting method and communication system
JP7251324B2 (en) 2019-05-31 2023-04-04 株式会社富士通ゼネラル Communication device, automatic baud rate setting method, and communication system

Similar Documents

Publication Publication Date Title
KR102374869B1 (en) Method and device for sensor synchronization
JP2015018564A5 (en)
JP2017514230A5 (en)
JP2011091742A (en) Communication device
WO2014138581A1 (en) Dynamic pause period calculation for serial data transmission
JP2011035473A (en) Baud rate error detection circuit and baud rate error detection method
KR20150128658A (en) Dithering circuit for serial data transmission
JP2009303178A (en) Data receiver, method of receiving data, and data receiving program
CN103559164A (en) Method and device for identifying serial port baud rate
CN110535621B (en) Serial port communication baud rate correction device and correction method thereof
JP2007259233A (en) Ber monitoring circuit
TWI581104B (en) Host devices and methods for transmitting data
TWI782634B (en) Chip baud rate detecting method and electronic device
JP2009118315A (en) Communication system, transmitting device, receiving device, communication apparatus, semiconductor device, and communication scheme
JP2009130923A (en) Packet communication system
JP2007259094A (en) Serial communication device
CN107810495B (en) UART with wire activity detector
JP2005333513A (en) Communication system
JP2004328103A (en) Error detector circuit
JP6163895B2 (en) Receive clock extraction circuit
JP4157064B2 (en) Synchronization start signal detection device, detection method thereof, and program thereof
JP2006332984A (en) Communication system and communication method
JP2018152643A (en) Data receiving circuit of start-stop synchronization serial data communication device
JP2005234943A (en) Communication apparatus
JP4899884B2 (en) Device having communication function and adjustment program