JP5704506B2 - Communication device and field device system - Google Patents

Communication device and field device system Download PDF

Info

Publication number
JP5704506B2
JP5704506B2 JP2011060681A JP2011060681A JP5704506B2 JP 5704506 B2 JP5704506 B2 JP 5704506B2 JP 2011060681 A JP2011060681 A JP 2011060681A JP 2011060681 A JP2011060681 A JP 2011060681A JP 5704506 B2 JP5704506 B2 JP 5704506B2
Authority
JP
Japan
Prior art keywords
signal
logic
frequency
edge
period
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2011060681A
Other languages
Japanese (ja)
Other versions
JP2012199616A (en
Inventor
清水 一弘
一弘 清水
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yokogawa Electric Corp
Original Assignee
Yokogawa Electric 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 Yokogawa Electric Corp filed Critical Yokogawa Electric Corp
Priority to JP2011060681A priority Critical patent/JP5704506B2/en
Publication of JP2012199616A publication Critical patent/JP2012199616A/en
Application granted granted Critical
Publication of JP5704506B2 publication Critical patent/JP5704506B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Digital Transmission Methods That Use Modulated Carrier Waves (AREA)
  • Dc Digital Transmission (AREA)

Description

本発明は、2つの異なる周波数を用いて二値の信号の通信を行う通信装置およびこの通信システムを適用したフィールド機器システムに関するものである。   The present invention relates to a communication apparatus that performs binary signal communication using two different frequencies, and a field device system to which the communication system is applied.

2つの異なる装置間で信号を通信する方式の1つとしてHART(Highway Addressable Remote Transducer)通信を用いることができる。HART通信では信号の論理を異なる周波数で表現している。一般的な規格としては、論理「0」を示すときには2200Hzの周波数とし、論理「1」を示すときには1200Hzの周波数としている。よって、送信側装置は、論理が「0」であるときには2200Hz、論理が「1」のときには1200Hzの信号に変調して信号を送信する。   HART (Highway Addressable Remote Transducer) communication can be used as one of methods for communicating signals between two different devices. In HART communication, signal logic is expressed by different frequencies. As a general standard, when logic “0” is indicated, the frequency is 2200 Hz, and when logic “1” is indicated, the frequency is 1200 Hz. Therefore, the transmission side apparatus modulates the signal to 2200 Hz when the logic is “0”, and transmits the signal after being modulated to 1200 Hz when the logic is “1”.

受信側装置では、送信側装置から送信された信号を受信して、この信号の周波数に基づいて信号を復調する。つまり、信号の周波数が2200Hzのときには論理「0」とし、1200Hzのときには論理「1」として復調する。これにより、HART通信が行われる。この種の技術としては、特許文献1に開示されている技術がある。   The receiving device receives the signal transmitted from the transmitting device and demodulates the signal based on the frequency of this signal. That is, the signal is demodulated as logic "0" when the frequency of the signal is 2200 Hz, and as logic "1" when the signal frequency is 1200 Hz. Thereby, HART communication is performed. As this type of technology, there is a technology disclosed in Patent Document 1.

図7は受信側装置を構成する復調部100の一例を示している。復調部100は受信側装置から送信された信号を入力信号rxdとして入力している。この入力信号rxdを復調して論理を判定し、出力信号sigとして出力している。同図に示すように、復調部100はライズエッジ検出回路101(図中ではRエッジ検出回路)とフォールエッジ検出回路102(図中ではFエッジ検出回路)と第1の論理和回路103とタイマ回路104と第2の論理和回路105とフリップフロップ106と第1比較器107と第2比較器108と第3の論理和回路109とを備えている。   FIG. 7 shows an example of the demodulator 100 that constitutes the receiving apparatus. The demodulator 100 receives a signal transmitted from the receiving apparatus as an input signal rxd. The input signal rxd is demodulated to determine the logic and output as the output signal sig. As shown in the figure, the demodulator 100 includes a rise edge detection circuit 101 (R edge detection circuit in the figure), a fall edge detection circuit 102 (F edge detection circuit in the figure), a first OR circuit 103, and a timer. A circuit 104, a second OR circuit 105, a flip-flop 106, a first comparator 107, a second comparator 108, and a third OR circuit 109 are provided.

ライズエッジ検出回路101は入力信号rxdの立ち上がりエッジ(ライズエッジ)を検出しており、フォールエッジ検出回路102は入力信号rxdの立ち下りエッジ(フォールエッジ)を検出している。第1の論理和回路103はライズエッジ検出回路101が出力するライズエッジ信号rxdrとフォールエッジ検出回路102が出力するフォールエッジ信号rxdfとの論理和の演算を行っている。   The rise edge detection circuit 101 detects the rising edge (rise edge) of the input signal rxd, and the fall edge detection circuit 102 detects the falling edge (fall edge) of the input signal rxd. The first OR circuit 103 performs an OR operation between the rise edge signal rxdr output from the rise edge detection circuit 101 and the fall edge signal rxdf output from the fall edge detection circuit 102.

タイマ回路104は9ビット(図中data)のカウンタであり、「0」から開始して「511」までカウントを行う。「511」までカウントされたときには、9ビットの値は全て「1」になっている。タイマ回路104は所定のクロック周波数(ここでは、1.2288MHz)で動作を行っており、この1クロックの間にカウント値をインクリメントする。そして、タイマ回路104のカウント値が「511」に到達した後には、「511」を固定して出力する(ラップアラウンドしない)。   The timer circuit 104 is a 9-bit counter (data in the figure) and starts from “0” and counts up to “511”. When counting up to “511”, all the 9-bit values are “1”. The timer circuit 104 operates at a predetermined clock frequency (here, 1.2288 MHz), and increments the count value during this one clock. Then, after the count value of the timer circuit 104 reaches “511”, “511” is fixed and output (does not wrap around).

タイマ回路104は第1の論理和回路103の出力(図中のtrig)を入力して、これをトリガとして、カウントを開始する。つまり、入力信号rxdが変化したエッジのタイミングでカウントを開始する。このときには、カウント値をリセット(値を「0」にする)してからカウントを開始する。   The timer circuit 104 receives the output (trig in the figure) of the first OR circuit 103 and starts counting using this as a trigger. That is, counting starts at the edge timing when the input signal rxd changes. At this time, the count value is reset (the value is set to “0”), and then the count is started.

タイマ回路104はカウントした値をカウント値prdpreとして出力する。また、タイマ回路104はカウント値が「511」まで到達したときには、その旨を示すパルスをキャリアウト信号carryとして出力する。第2の論理和回路105は第1の論理和回路103の出力trigとキャリアウト信号carryとの論理和の演算を行って、イネーブル信号としてフリップフロップ106に出力する。   The timer circuit 104 outputs the counted value as the count value prdpre. When the count value reaches “511”, the timer circuit 104 outputs a pulse indicating that as a carry-out signal carry. The second OR circuit 105 performs an OR operation between the output trig of the first OR circuit 103 and the carryout signal carry and outputs the result to the flip-flop 106 as an enable signal.

フリップフロップ106はタイマ回路104からのカウント値prdpreを入力して、その値を保持する。このとき、第2の論理和回路105からイネーブル信号を入力したときに値を保持するようにする。そして、保持した値は次のタイミングでカウント値prdとして第1比較器107に出力される。   The flip-flop 106 receives the count value prdpre from the timer circuit 104 and holds the value. At this time, the value is held when the enable signal is input from the second OR circuit 105. The held value is output to the first comparator 107 as the count value prd at the next timing.

第1比較器107はフリップフロップ106から出力されたカウント値prdの比較を行って、第1出力信号prdhを出力する。カウント値prdが「361」以上であれば、第1出力信号prdhをハイ(High)として出力し、「361」未満であればロー(Low)として出力する。同様に、第2比較器108はタイマ回路104が出力したカウント値prdpreを比較して、第2出力信号prdprehを出力する。この第2出力信号prdprehは、カウント値が「361」以上のときにハイとなり、「361」未満のときにローとなる。   The first comparator 107 compares the count value prd output from the flip-flop 106 and outputs the first output signal prdh. If the count value prd is “361” or more, the first output signal prdh is output as High, and if it is less than “361”, it is output as Low. Similarly, the second comparator 108 compares the count value prdpre output from the timer circuit 104 and outputs a second output signal prdpreh. The second output signal prdpreh becomes high when the count value is “361” or more, and becomes low when the count value is less than “361”.

第1出力信号prdhはフリップフロップ106を経由した信号であり、第2出力信号prdprehはフリップフロップ106を経由していない信号である。よって、もともとは同じカウント値prdpreである。このため、第1出力信号prdhと第2出力信号prdprehは同じ信号であり、且つタイミングがずれたものになる。   The first output signal prdh is a signal that passes through the flip-flop 106, and the second output signal prdpreh is a signal that does not pass through the flip-flop 106. Therefore, the count value prdpre is originally the same. For this reason, the first output signal prdh and the second output signal prdpreh are the same signal and are out of timing.

第3の論理和回路109は第1出力信号prdhと第2出力信号prdprehとの論理和の演算を行っている。そして、出力信号sigとして後段の信号処理回路に出力している。この出力信号sigは送信側装置から送信された信号を復調した信号になる。以上により、HART通信による通信が行われて、論理が復元される。   The third OR circuit 109 performs an OR operation between the first output signal prdh and the second output signal prdpreh. The output signal sig is output to the subsequent signal processing circuit. The output signal sig is a signal obtained by demodulating the signal transmitted from the transmission side device. As described above, communication by HART communication is performed and the logic is restored.

次に、図8のタイミングチャートを用いて動作について説明する。ライズエッジ検出回路101、フォールエッジ検出回路102で入力信号rxdのエッジが検出される。タイマ回路104はエッジを検出したタイミングでカウント値をゼロから開始し、次にエッジを検出するまでカウントアップを行う。そして、エッジを検出したときにはカウント値をゼロに戻す。   Next, the operation will be described with reference to the timing chart of FIG. The rise edge detection circuit 101 and the fall edge detection circuit 102 detect the edge of the input signal rxd. The timer circuit 104 starts the count value from zero at the timing when the edge is detected, and counts up until the next edge is detected. When the edge is detected, the count value is returned to zero.

入力信号rxdは異なる論理を表現するために、1200Hzの周波数または2200Hzの周波数になっている。入力信号rxdが1200Hzの場合と2200Hzの場合とでカウント値が異なる。つまり、タイマ回路104はエッジとエッジとの間の時間的な間隔を計測しており、入力信号rxdの周波数によってカウント値は異なる。これにより、論理を表現している。   The input signal rxd has a frequency of 1200 Hz or 2200 Hz in order to express different logic. The count value differs depending on whether the input signal rxd is 1200 Hz or 2200 Hz. That is, the timer circuit 104 measures a time interval between edges, and the count value varies depending on the frequency of the input signal rxd. This expresses logic.

第1比較器107および第2比較器108が比較を行う基準となる値「361」は入力信号rxdの周波数の判定の基準となっている。周波数1200Hzと2200Hzとの中間値は1700Hzであり、これを復調部100のクロック周波数である1.2288MHzを基準とすると、そのカウント値は「722」となる。つまり、カウント値「722=1.2288MHz/1700Hz」となる。   A value “361” serving as a reference for comparison between the first comparator 107 and the second comparator 108 is a reference for determining the frequency of the input signal rxd. An intermediate value between the frequencies of 1200 Hz and 2200 Hz is 1700 Hz. If this is based on 1.2288 MHz which is the clock frequency of the demodulator 100, the count value is “722”. That is, the count value is “722 = 1.2288 MHz / 1700 Hz”.

入力信号rxdは1周期の間に1回の立ち上がりと1回の立ち下りとがある。よって、エッジ(ライズエッジまたはフォールエッジ)とエッジ(フォールエッジまたはライズエッジ)との間隔は1周期の半分となる。このため、閾値を「722」の半分の「361」としている。この「361」以上となっているか否かを第1比較器107および第2比較器108は判定している。   The input signal rxd has one rise and one fall during one period. Therefore, the interval between the edge (rise edge or fall edge) and the edge (fall edge or rise edge) is half of one period. For this reason, the threshold value is set to “361” which is half of “722”. The first comparator 107 and the second comparator 108 determine whether or not “361” or more.

「361」未満になっているときは、入力信号rxdの周波数は高いことが認識される。よって、論理を「0」(つまり、入力信号rxdの周波数が2200Hz)として判定する。一方、「361」以上になっているときには、入力信号rxdの周波数が低いことが認識される。よって、論理を「1」(つまり、入力信号rxdの周波数が1200Hz)として判定する。   When it is less than “361”, it is recognized that the frequency of the input signal rxd is high. Therefore, the logic is determined as “0” (that is, the frequency of the input signal rxd is 2200 Hz). On the other hand, when the frequency is “361” or more, it is recognized that the frequency of the input signal rxd is low. Therefore, the logic is determined as “1” (that is, the frequency of the input signal rxd is 1200 Hz).

従って、「361」を閾値として、入力信号rxdのエッジとエッジとの間の時間をタイマ回路104が計測することで、論理の判定を行っている。これにより、入力信号rxdの論理を判定して復調することができ、出力信号sigを出力することができるようになる。   Accordingly, the logic is determined by the timer circuit 104 measuring the time between the edges of the input signal rxd using “361” as a threshold value. Thereby, the logic of the input signal rxd can be determined and demodulated, and the output signal sig can be output.

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

従って、論理の判定は、エッジとエッジとの間の間隔(時間:パルス幅)を基準として検出するようにしている。この点は、図7に示した技術でも前述した特許文献1の技術でも同様である。そして、このエッジとエッジとの間隔は、入力信号rxdの論理が「0」であるか「1」であるかによって異なる。   Therefore, the logical determination is performed based on the interval (time: pulse width) between the edges. This point is the same for the technique shown in FIG. 7 and the technique of Patent Document 1 described above. The interval between the edges differs depending on whether the logic of the input signal rxd is “0” or “1”.

つまり、HART通信では、入力信号rxdを1200Hzと2200Hzとで周波数を異ならせることにより、論理を表現している。このため、エッジが出現するタイミングは論理が「0」(=2200Hz)であるか、論理が「1」(=1200Hz)であるかによって時間軸方向に変化する。従って、信号の論理が変化するタイミングは不定になる。   That is, in the HART communication, the logic is expressed by changing the frequency of the input signal rxd between 1200 Hz and 2200 Hz. For this reason, the timing at which the edge appears changes in the time axis direction depending on whether the logic is “0” (= 2200 Hz) or the logic is “1” (= 1200 Hz). Therefore, the timing at which the logic of the signal changes is indefinite.

一方、復調部100は一定の周波数(レート周期CTの周波数)で出力信号sigを生成しており、復調部100に接続される出力信号sigを処理する回路においてレート周期CTの周波数で出力信号sigを取得して所定の処理が行われる。このときのレート周期CTはあくまでも復調部100および後段の回路が動作する一定の周期であり、入力信号rxdの論理とは無関係になる。   On the other hand, the demodulator 100 generates the output signal sig at a constant frequency (the frequency of the rate period CT), and in the circuit that processes the output signal sig connected to the demodulator 100, the output signal sig at the frequency of the rate period CT. And a predetermined process is performed. The rate cycle CT at this time is a fixed cycle in which the demodulator 100 and the subsequent circuit operate, and is independent of the logic of the input signal rxd.

つまり、レート周期CTの周波数と入力信号rxdの周波数とは同期がされていないことになる。このため、レート周期CTのタイミングと入力信号rxdの論理が変化するタイミングとが近接すると、レート周期CTの間に本来であれば検出されるエッジが検出されず、或いは本来であれば検出されないエッジが検出されることがある。このため、タイマ回路104のカウント値が本来の入力信号rxdの値と異なるようになり、エッジとエッジとの間隔を正確に検出できなくなる。これにより、入力信号rxdが示す論理を正確に復調できなくなり、正しい通信を行うことができなくなる。   That is, the frequency of the rate period CT and the frequency of the input signal rxd are not synchronized. For this reason, when the timing of the rate period CT and the timing at which the logic of the input signal rxd changes are close, an edge that is originally detected is not detected during the rate period CT, or an edge that is not detected otherwise May be detected. For this reason, the count value of the timer circuit 104 becomes different from the original value of the input signal rxd, and the interval between the edges cannot be accurately detected. As a result, the logic indicated by the input signal rxd cannot be accurately demodulated, and correct communication cannot be performed.

また、論理を正確に復調できないために、通信の開始を検出することができない。送信側装置から受信側装置に向けて信号の送信を開始したときに、通信の開始が検出されるが、この通信の開始は入力信号rxdの論理が「0」であることを検出したときに、通信開始を検出する。このときに、前述したように、レート周期CTの周波数と入力信号rxdの周波数とが同期していないために論理を正確に復調できないとすると、通信の開始も正確に検出することができなくなる。   In addition, since the logic cannot be accurately demodulated, the start of communication cannot be detected. The start of communication is detected when transmission of a signal from the transmission side device to the reception side device is started. This communication start is detected when the logic of the input signal rxd is detected as “0”. , Detecting the start of communication. At this time, as described above, if the logic cannot be accurately demodulated because the frequency of the rate period CT and the frequency of the input signal rxd are not synchronized, the start of communication cannot be detected accurately.

そこで、本発明は、異なる周波数を用いて信号の値を表現して通信するときに、正確な通信を行うことを目的とする。   Therefore, an object of the present invention is to perform accurate communication when communicating by expressing signal values using different frequencies.

以上の課題を解決するため、本発明の通信装置は、異なる周波数を用いて二値の信号を通信する通信装置であって、一定のレート周期を規定する第1のタイマと、前記レート周期に同期した期間として個々の前記レート周期内に設けられる、前記レート周期よりも短い期間を規定する第2のタイマと、前記第2のタイマにより規定される前記期間内における前記信号のエッジ数をカウントするエッジカウンタと、前記エッジカウンタがカウントした前記エッジ数に基づいて前記信号の論理を判定する論理判定回路と、を備え、前記論理判定回路は、前記第1のタイマにより規定される前記レート周期ごとに前記信号の論理を判定し、前記レート周期の周波数は前記周波数のうち低い周波数に一致していることを特徴とする
この通信装置によれば、エッジ間隔ではなく、一定の時間ごとに検出されるエッジ数に基づいて論理を判定しているため、正確な通信を行うことができる。



In order to solve the above problems, a communication device of the present invention is a communication device that communicates binary signals using different frequencies, and includes a first timer that defines a constant rate period, and the rate period. A second timer that is provided within each of the rate periods as a synchronized period and that defines a period shorter than the rate period, and counts the number of edges of the signal within the period that is defined by the second timer And a logic determination circuit that determines the logic of the signal based on the number of edges counted by the edge counter, and the logic determination circuit includes the rate period defined by the first timer. According to this communication apparatus, the logic of the signal is determined every time, and the frequency of the rate period coincides with a lower frequency among the frequencies. For example, since the logic is determined based on the number of edges detected at regular intervals rather than the edge interval, accurate communication can be performed.



また、前記第1のタイマおよび前記第2のタイマは、一定周期のクロック信号をカウントする一のタイマ回路を共用して構成されることを特徴とする。
The first timer and the second timer, characterized in that constructed by sharing one of the timer circuit for counting a clock signal having a constant period.

また、前記第2のタイマは、第1の周波数の1周期分よりも短く、この第1の周波数よりも高い第2の周波数の1.5周期分よりも長い期間を前記期間として規定し、前記論理判定回路は、前記エッジ数が3つ以上であるか否かに基づいて論理の判定を行うことを特徴とする。これにより、第1の周波数と第2の周波数とで必ずエッジ数を異ならせることができるため、論理の判定を確実に行うことができ、正確な通信を実現することができる。
The second timer defines a period shorter than one period of the first frequency and longer than 1.5 periods of the second frequency higher than the first frequency as the period, The logic determination circuit performs logic determination based on whether or not the number of edges is three or more. As a result, the number of edges can always be made different between the first frequency and the second frequency, so that the logic can be determined reliably and accurate communication can be realized.

また、前記論理判定回路は、前記第1の周波数を1200Hz、第2の周波数を2200Hzとしたときに、前記エッジ数が3つ以上の場合は論理「0」であると判定し、3つ未満の場合には論理「1」であると判定することを特徴とする。これにより、1200Hzと2200Hzとの周波数を用いたHART通信を行うときに、正確に通信を行うことができるようになる。   The logic determination circuit determines that the logic is “0” when the number of edges is 3 or more when the first frequency is 1200 Hz and the second frequency is 2200 Hz, and less than 3. In this case, it is determined that the logic is “1”. As a result, when performing HART communication using frequencies of 1200 Hz and 2200 Hz, communication can be accurately performed.

また、前記論理判定回路は、前記エッジ数が「0」のときには前記信号が通信されていないと判定し、前記エッジ数が「0」から「3」に変化したときに前記信号の通信が開始されたと判定することを特徴とする。これにより、通信の開始を検出することができるようになる。   The logic determination circuit determines that the signal is not communicated when the number of edges is “0”, and communication of the signal starts when the number of edges changes from “0” to “3”. It is characterized by determining that it was done. Thereby, the start of communication can be detected.

また、前記論理判定回路は、前記第1のタイマにより規定される前記レート周期ごとに前記信号の論理を出力することを特徴とする。

The logic determination circuit outputs the logic of the signal at each rate period defined by the first timer .

また、本発明のフィールド機器システムは、前記何れかの通信装置を備えたことを特徴とする。通信装置はフィールド機器システムの上位制御装置とフィールド機器との間の通信に適用することができる。   A field device system according to the present invention includes any one of the communication devices. The communication device can be applied to communication between the host controller of the field device system and the field device.

本発明は、異なる2つの周波数により論理を表現する通信を行うときに、信号のエッジ間隔ではなく、一定の判定周期ごとのエッジ数に基づいて論理を判定している。これにより、信号の論理によらず、常に正しい論理を復調でき、正確な通信を行うことができるようになる。   The present invention determines the logic based on the number of edges per fixed determination period, not the signal edge interval, when performing communication expressing the logic with two different frequencies. As a result, the correct logic can always be demodulated regardless of the signal logic, and accurate communication can be performed.

通信装置の構成を示すブロック図である。It is a block diagram which shows the structure of a communication apparatus. 復調部の構成を示すブロック図である。It is a block diagram which shows the structure of a demodulation part. 実施形態の復調部の動作を示すフローチャートである。It is a flowchart which shows operation | movement of the demodulation part of embodiment. 図3の続きのフローチャートである。FIG. 4 is a continuation flowchart of FIG. 3. 実施形態の動作のタイミングを示すタイミングチャートである。It is a timing chart which shows the timing of operation of an embodiment. パルスを喪失した場合のタイミングチャートである。It is a timing chart at the time of losing a pulse. 従来の復調部の構成を示すブロックである。It is a block which shows the structure of the conventional demodulation part. 従来の復調部の動作のタイミングを示すタイミングチャートである。It is a timing chart which shows the timing of operation | movement of the conventional demodulation part.

以下、図面を参照して、本発明の実施形態について説明する。本実施形態の通信装置は、例えばフィールド機器システムに適用することができる。フィールド機器システムは、差圧計や流量計、温度計等のセンサ、アクチュエータ、コントローラ等の各種フィールド機器と上位制御装置とを接続する。このときの、フィールド機器と上位制御装置との間で通信を行うときに、以下の通信装置を適用することができる。勿論、フィールド機器システム以外にも任意のシステムに適用してもよい。   Embodiments of the present invention will be described below with reference to the drawings. The communication apparatus of this embodiment can be applied to, for example, a field device system. The field device system connects various field devices such as sensors, actuators, controllers and the like such as a differential pressure meter, a flow meter, and a thermometer, and a host control device. At this time, the following communication device can be applied when performing communication between the field device and the host control device. Of course, the present invention may be applied to any system other than the field device system.

また、本実施形態ではHART(Highway Addressable Remote Transducer)通信により通信を行っている。HART通信は、信号の周波数を1200Hzまたは2200Hzとすることにより、論理を表現している。以下では、周波数が1200Hzの場合は論理「1」を示し、2200Hzの場合は論理「0」を示すものとする。勿論、周波数に対応する論理を逆にしてもよく、また論理を示す周波数を任意に設定してもよい。なお、本実施形態の通信装置であれば、HART通信という名称には限定されない。   In this embodiment, communication is performed by HART (Highway Addressable Remote Transducer) communication. In HART communication, logic is expressed by setting the frequency of a signal to 1200 Hz or 2200 Hz. Hereinafter, when the frequency is 1200 Hz, a logic “1” is indicated, and when the frequency is 2200 Hz, a logic “0” is indicated. Of course, the logic corresponding to the frequency may be reversed, and the frequency indicating the logic may be arbitrarily set. In addition, if it is a communication apparatus of this embodiment, it will not be limited to the name of HART communication.

図1は通信装置1を示している。この通信装置1はUART送信部2と変調部3とアナログ波形送信回路4とアナログ波形受信回路5と復調部6とUART受信部7とを備えている。UART送信部2は送信する信号(論理が「0」または「1」の信号)を生成して、変調部3に出力する。図1の実施形態において、UART送信部2と変調部3とアナログ波形送信回路4とアナログ波形受信回路5と復調部6とでHART通信を行う。   FIG. 1 shows a communication device 1. The communication apparatus 1 includes a UART transmission unit 2, a modulation unit 3, an analog waveform transmission circuit 4, an analog waveform reception circuit 5, a demodulation unit 6, and a UART reception unit 7. The UART transmission unit 2 generates a signal to be transmitted (a signal whose logic is “0” or “1”) and outputs the signal to the modulation unit 3. In the embodiment of FIG. 1, the UART transmission unit 2, the modulation unit 3, the analog waveform transmission circuit 4, the analog waveform reception circuit 5 and the demodulation unit 6 perform HART communication.

変調部3は入力した信号の論理によって、送信する信号の周波数を第1の周波数FLと第2の周波数FH(FH>FL)とに変調する。ここでは、論理が「1」のときには第1の周波数FL(=1200Hz)に変調し、「0」のときには第2の周波数FH(=2200Hz)に変調する。   The modulation unit 3 modulates the frequency of the signal to be transmitted to the first frequency FL and the second frequency FH (FH> FL) according to the logic of the input signal. Here, when the logic is “1”, it is modulated to the first frequency FL (= 1200 Hz), and when it is “0”, it is modulated to the second frequency FH (= 2200 Hz).

アナログ波形送信回路4は変調部3が変調した後の信号をデジタル信号からアナログ信号に変換する。そして、このアナログ信号を送信する。UART送信部2からアナログ波形送信回路4までが送信側回路を構成する。送信側回路としては例えばフィールド機器に設けることができる。   The analog waveform transmission circuit 4 converts the signal after modulation by the modulation unit 3 from a digital signal to an analog signal. Then, this analog signal is transmitted. The UART transmitter 2 to the analog waveform transmitter circuit 4 constitute a transmitter circuit. The transmission circuit can be provided in a field device, for example.

アナログ波形受信回路5はアナログ波形送信回路4が送信したアナログ信号を受信する。そして、受信したアナログ信号をデジタル信号に変換する。このデジタル信号を入力信号rxdとして復調部6に入力し、復調部6は入力信号rxdから論理を復元する復調を行う。そして、UART受信部7に復調後の信号を出力信号sigとして出力する。   The analog waveform receiving circuit 5 receives the analog signal transmitted by the analog waveform transmitting circuit 4. The received analog signal is converted into a digital signal. This digital signal is input to the demodulator 6 as an input signal rxd, and the demodulator 6 performs demodulation to restore the logic from the input signal rxd. Then, the demodulated signal is output to the UART receiver 7 as an output signal sig.

UART受信部7は一定の周期(レート周期CT)のタイミングで入力される出力信号sigを取得して、所定の信号処理を行う。以上のアナログ波形受信回路5からUART受信部7までが受信側回路を構成する。例えば、フィールド機器システムにおける上位制御装置に受信側回路を設けることができる。   The UART receiver 7 acquires an output signal sig input at a constant cycle (rate cycle CT) and performs predetermined signal processing. The analog waveform receiving circuit 5 to the UART receiving unit 7 constitute a receiving side circuit. For example, a reception-side circuit can be provided in the host controller in the field device system.

次に、図2を用いて復調部6について説明する。この復調部6は出力信号sigを生成する信号生成部になる。復調部6は、ライズエッジ検出回路11とフォールエッジ検出回路12と論理和回路13と状態判定回路14とタイマ回路15とエッジ数カウンタ16と論理判定回路17とスタートビット検出回路18とを備えて構成している。   Next, the demodulator 6 will be described with reference to FIG. The demodulator 6 is a signal generator that generates the output signal sig. The demodulator 6 includes a rise edge detection circuit 11, a fall edge detection circuit 12, a logical sum circuit 13, a state determination circuit 14, a timer circuit 15, an edge number counter 16, a logical determination circuit 17, and a start bit detection circuit 18. It is composed.

復調部6は所定のクロック周波数CLKに基づいて動作を行っている。ここでは、クロック周波数CLKの周波数は1.2288MHzとする。勿論、クロック周波数CLKの値はこれに限定されず、任意の周波数とすることができる。   The demodulator 6 operates based on a predetermined clock frequency CLK. Here, the frequency of the clock frequency CLK is 1.2288 MHz. Of course, the value of the clock frequency CLK is not limited to this, and can be an arbitrary frequency.

ライズエッジ検出回路(図中ではRエッジ検出回路)11はクロック周波数CLKで動作を行っており、入力信号rxdの立ち上がりエッジ(ライズエッジ)を検出する。フォールエッジ検出回路(図中ではFエッジ検出回路)12はクロック周波数CLKで動作を行っており、入力信号rxdの立ち下りエッジ(フォールエッジ)を検出している。   The rise edge detection circuit (R edge detection circuit in the figure) 11 operates at the clock frequency CLK and detects the rising edge (rise edge) of the input signal rxd. The fall edge detection circuit (F edge detection circuit in the figure) 12 operates at the clock frequency CLK and detects the falling edge (fall edge) of the input signal rxd.

論理和回路13は、ライズエッジ検出回路11がライズエッジを検出したことを示すライズエッジ信号rxdrおよびフォールエッジ検出回路12がフォールエッジを検出したことを示すフォールエッジ信号rxdfの論理和の演算を行っている。つまり、論理和回路13は入力信号rxdのエッジ(ライズエッジおよびフォールエッジ)を検出していることになる。論理和回路13が出力する信号をエッジ信号rxdrfとする。   The OR circuit 13 performs a logical OR operation of the rise edge signal rxdr indicating that the rise edge detection circuit 11 has detected the rise edge and the fall edge signal rxdf indicating that the fall edge detection circuit 12 has detected the fall edge. ing. That is, the OR circuit 13 detects the edges (rise edge and fall edge) of the input signal rxd. A signal output from the OR circuit 13 is defined as an edge signal rxdrf.

状態判定回路14は入力信号rxdを受信した受信状態であるか、入力信号rxdを受信していないアイドル状態であるかを判定している。このために、ライズエッジ信号rxdrを入力している。このライズエッジ信号rxdrを入力したときに、アイドル状態から受信状態に切り替わったと判定する。そして、受信状態であることを示す状態信号statを出力する。   The state determination circuit 14 determines whether the reception state has received the input signal rxd or the idle state in which the input signal rxd has not been received. For this purpose, a rise edge signal rxdr is input. When the rise edge signal rxdr is input, it is determined that the idle state is switched to the reception state. Then, a state signal stat indicating the reception state is output.

タイマ回路15はクロック周波数CLKで動作を行うカウンタである。このタイマ回路15は10ビットカウンタ(図中のdata)としており、カウント値が「0」から「1023」までカウントアップ(カウント値のインクリメント)を行う。このタイマ回路15は状態信号statを入力しているとき、つまり受信状態であるときに動作を行う。   The timer circuit 15 is a counter that operates at the clock frequency CLK. This timer circuit 15 is a 10-bit counter (data in the figure), and counts up from “0” to “1023” (increments the count value). The timer circuit 15 operates when a state signal stat is input, that is, when it is in a receiving state.

タイマ回路15がカウントするカウント値が「0」から開始して、「1023」に到達したタイミングでキャリアウト信号carryを出力する。そして、キャリアウト信号carryを出力するタイミング、つまりカウント値が「1023」に到達したタイミングで、タイマ回路15はカウント値のリセットを行う(カウント値を「0」に戻す)。   The count value counted by the timer circuit 15 starts from “0”, and the carry-out signal carry is output at the timing when it reaches “1023”. The timer circuit 15 resets the count value (returns the count value to “0”) at the timing when the carry-out signal carry is output, that is, when the count value reaches “1023”.

このキャリアウト信号carryはレート周期CTのタイミングを規定している。このレート周期CTは出力信号sigを出力するタイミング、つまりUART受信部7が出力信号sigを取得するタイミングになる。また、タイマ回路15は制御信号ctrを出力する。この制御信号ctrはタイマ回路15のカウント値が所定の閾値th(ここでは、837としている)に到達した時点で、その旨を示す信号になる。   The carry-out signal carry defines the timing of the rate period CT. This rate period CT is the timing at which the output signal sig is output, that is, the timing at which the UART receiver 7 acquires the output signal sig. The timer circuit 15 outputs a control signal ctr. This control signal ctr becomes a signal indicating that when the count value of the timer circuit 15 reaches a predetermined threshold th (here, 837).

エッジ数カウンタ16は論理和回路13が出力したエッジ信号rxdrfを入力した回数を計測して、計測した回数をエッジ数として検出する。エッジ数カウンタ16は初期値を「0」としており、エッジ信号rxdrfを入力するたびに値のインクリメントを行う。このエッジ数カウンタ16にはキャリアウト信号carryが入力されており、キャリアウト信号carryを入力したタイミング、つまりレート周期CTのタイミングごとに値のリセットを行う(カウント値を「0」に戻す)。   The edge number counter 16 measures the number of times the edge signal rxdrf output from the OR circuit 13 is input, and detects the measured number as the number of edges. The edge number counter 16 has an initial value “0”, and increments the value every time the edge signal rxdrf is input. The edge number counter 16 receives the carry-out signal carry, and resets the value at each timing when the carry-out signal carry is inputted, that is, at the timing of the rate period CT (returns the count value to “0”).

エッジ数カウンタ16は計測したエッジ数(カウント値)をエッジ信号edgとして出力する。なお、エッジ数カウンタ16には状態信号statが入力されており、受信状態のときにエッジ数カウンタ16は動作を行う。   The edge number counter 16 outputs the measured edge number (count value) as an edge signal edg. The edge number counter 16 is input with a status signal stat, and the edge number counter 16 operates in the reception state.

論理判定回路17は入力信号rxdの論理を判定している。論理の判定はエッジ数カウンタ16が出力するエッジ信号edgに基づいて行う。論理判定回路17は制御信号ctrを入力しており、制御信号ctrのタイミング、つまり閾値thに到達したタイミングでエッジ信号edgに基づいて論理の判定を行う。   The logic determination circuit 17 determines the logic of the input signal rxd. The logic is determined based on the edge signal edg output from the edge number counter 16. The logic determination circuit 17 receives the control signal ctr and determines the logic based on the edge signal edg at the timing of the control signal ctr, that is, the timing at which the threshold th is reached.

このときに、エッジ信号edgが「3」のときには論理が「0」であると判定し、「3」未満のときには論理が「1」であると判定する。判定した論理はレート周期CTごとに出力信号sigとしてUART受信部7に出力する。このため、タイマ回路15からキャリアウト信号carryを入力して、この信号のタイミング(レート周期CTのタイミング)で出力信号sigを出力している。これにより、信号を復元する復調を行う。   At this time, when the edge signal edg is “3”, it is determined that the logic is “0”, and when it is less than “3”, it is determined that the logic is “1”. The determined logic is output to the UART receiver 7 as an output signal sig for each rate period CT. For this reason, the carry-out signal carry is input from the timer circuit 15 and the output signal sig is output at the timing of this signal (the timing of the rate period CT). Thus, demodulation for restoring the signal is performed.

スタートビット検出回路18は通信の開始を検出する。ここでは、入力信号rxdの論理が最初に「0」を示したときに、通信の開始を検出している。なお、論理が「1」のときに通信の開始を検出してもよい。このために、エッジ数カウンタ16からエッジ信号edgを入力する。そして、制御信号ctrを入力するタイミング、つまりタイマ回路15がカウントするカウント値が閾値thに到達したタイミングでエッジ信号edgを入力する。このときに入力したエッジ信号edgが「3」のときに、論理が「0」であることを認識して、通信の開始を検出する。   The start bit detection circuit 18 detects the start of communication. Here, the start of communication is detected when the logic of the input signal rxd initially indicates “0”. The start of communication may be detected when the logic is “1”. For this purpose, the edge signal edg is input from the edge number counter 16. The edge signal edg is input at the timing when the control signal ctr is input, that is, when the count value counted by the timer circuit 15 reaches the threshold th. When the edge signal edg input at this time is “3”, it recognizes that the logic is “0” and detects the start of communication.

以上の構成における動作について図3、図4のフローチャート並びに図5のタイミングチャートを用いて説明する。まず、状態判定回路14はライズエッジ信号rxdrに基づいて通信状態を検出する(ステップS11)。そして、ライズエッジが検出されているか否かの判定を行う(ステップS12)。   The operation in the above configuration will be described with reference to the flowcharts of FIGS. 3 and 4 and the timing chart of FIG. First, the state determination circuit 14 detects a communication state based on the rise edge signal rxdr (step S11). Then, it is determined whether or not a rise edge has been detected (step S12).

ライズエッジが検出されなければ、アイドル状態となる。よって、ステップS11に戻る動作を繰り返す。一方、ライズエッジが検出されたときには、状態判定回路14は受信状態となったことを示す状態信号statを出力する。この状態信号statを入力することにより、タイマ回路15は自身のカウント値をリセットして、値を「0」に戻す(ステップS13)。また、エッジ数カウンタ16の値もリセットして、値を「0」にする(ステップS14)。   If the rising edge is not detected, the idle state is entered. Therefore, the operation of returning to step S11 is repeated. On the other hand, when the rising edge is detected, the state determination circuit 14 outputs a state signal stat indicating that the reception state has been established. By inputting the status signal stat, the timer circuit 15 resets its count value and returns the value to “0” (step S13). Further, the value of the edge number counter 16 is also reset to set the value to “0” (step S14).

そして、タイマ回路15はカウントアップを開始する(ステップS15)。タイマ回路15はクロック周波数CLKに同期したタイミングで動作を行っており、「0」から「1023」までカウントを行う。このときのカウントの最大値である「1023」はクロック周波数CLK(=1.2288MHz)をレート周期CTの周波数(=1200Hz)で除算した値(=1024=1.2288MHz/1200Hz)になる。   Then, the timer circuit 15 starts counting up (step S15). The timer circuit 15 operates at a timing synchronized with the clock frequency CLK, and counts from “0” to “1023”. The maximum count value “1023” at this time is a value (= 1024 = 1.2288 MHz / 1200 Hz) obtained by dividing the clock frequency CLK (= 1.2288 MHz) by the frequency (= 1200 Hz) of the rate period CT.

ここでは、第1の周波数FLと第2の周波数FHとのうち低い周波数である第1の周波数FL(=1200Hz)とレート周期CTの周波数とを一致させている。これにより、第1の周波数FLのタイミングで出力信号sigを生成して出力している。このレート周期CTの周波数は第1の周波数FL以外の周波数に設定してもよい。   Here, the first frequency FL (= 1200 Hz), which is the lower frequency of the first frequency FL and the second frequency FH, is matched with the frequency of the rate period CT. Thus, the output signal sig is generated and output at the timing of the first frequency FL. The frequency of the rate period CT may be set to a frequency other than the first frequency FL.

従って、タイマ回路15はクロック周波数CLKの1クロックごとにカウントアップを行う。タイマ回路15には閾値thが設定されており、カウント値が閾値thに到達したか否かを判定する(ステップS16)。到達していない場合には、ステップS15に戻ってカウントアップを続行する。   Therefore, the timer circuit 15 counts up every clock of the clock frequency CLK. A threshold value th is set in the timer circuit 15, and it is determined whether or not the count value has reached the threshold value th (step S16). If not, the process returns to step S15 to continue counting up.

閾値thはエッジ数カウンタ16がエッジ数をカウントするタイミングであり、ここでは閾値thを「837」としている。タイマ回路15はカウント値が「0」から「837」になるまでの間を判定周期JTとして計測している。この判定周期JTはエッジ数カウンタ16がエッジ数をカウントする周期(つまり、論理を判定するタイミング)を規定している。ここでは、判定周期JTを第2の周波数FH(=2200Hz)の1.5周期分としている。   The threshold value th is the timing at which the edge number counter 16 counts the number of edges. Here, the threshold value th is “837”. The timer circuit 15 measures the period from when the count value becomes “0” to “837” as the determination cycle JT. This determination cycle JT defines the cycle (that is, the timing for determining logic) in which the edge number counter 16 counts the number of edges. Here, the determination period JT is set to 1.5 periods of the second frequency FH (= 2200 Hz).

レート周期CTの周波数は1200Hzになっており、タイマ回路15が「1024」カウントすることで、レート周期CTの1周期分を検出している。よって、第2の周波数FH(=2200Hz)の1.5周期分である判定周期JTを規定する閾値thは「th=(1200/2200)×1024×1.5=837」となる。なお、判定周期JTは第2の周波数FHの1.5周期分としなくても、所定条件を満たすことで、任意の値に設定することができる。この点は後述する。タイマ回路15のカウント値が閾値thに到達したときには、その旨を制御信号ctrとして出力する。   The frequency of the rate cycle CT is 1200 Hz, and the timer circuit 15 counts “1024” to detect one cycle of the rate cycle CT. Therefore, the threshold th that defines the determination cycle JT corresponding to 1.5 cycles of the second frequency FH (= 2200 Hz) is “th = (1200/2200) × 1024 × 1.5 = 837”. Note that the determination period JT can be set to an arbitrary value by satisfying the predetermined condition, even if the determination period JT is not 1.5 periods of the second frequency FH. This point will be described later. When the count value of the timer circuit 15 reaches the threshold value th, the fact is output as a control signal ctr.

エッジ数カウンタ16は制御信号ctrを入力するまでにカウントしたエッジ数を検出する(ステップS17)。エッジ数カウンタ16は初期値としては「0」になっており、論理和回路13が出力するエッジ信号rxdrfを入力するごとに、その回数を計測している。そして、制御信号ctrを入力したタイミングのカウント値をエッジ信号edgとして出力する。なお、制御信号ctrを入力したときには、エッジ数カウンタ16は自身のカウント値を「0」に戻す。   The edge number counter 16 detects the number of edges counted until the control signal ctr is input (step S17). The edge number counter 16 is “0” as an initial value, and each time the edge signal rxdrf output from the OR circuit 13 is input, the number of times is measured. Then, the count value at the timing when the control signal ctr is input is output as the edge signal edg. When the control signal ctr is input, the edge number counter 16 returns its count value to “0”.

このときのエッジ信号edgは入力信号rxdの論理を示している。図5のタイミングチャートにも示すように、入力信号rxdが第1の周波数FLであるか第2の周波数FHであるかによって、判定周期JTの間に検出するエッジ数が異なってくる。つまり、第2の周波数FH(=2200Hz)のときには、判定周期JTの間に検出するエッジ数は「3」になり、第1の周波数FL(=1200Hz)のときには、判定周期JTの間に検出するエッジ数は「2」(つまり、「3」未満)になる。これは、所定の判定周期JTの時間のエッジ数が高い周波数では多くなり、低い周波数では少なくなるためである。   The edge signal edg at this time indicates the logic of the input signal rxd. As also shown in the timing chart of FIG. 5, the number of edges detected during the determination period JT varies depending on whether the input signal rxd is the first frequency FL or the second frequency FH. That is, at the second frequency FH (= 2200 Hz), the number of edges detected during the determination period JT is “3”, and at the first frequency FL (= 1200 Hz), it is detected during the determination period JT. The number of edges to be performed is “2” (that is, less than “3”). This is because the number of edges in the time of the predetermined determination cycle JT increases at a high frequency and decreases at a low frequency.

ここでは、第1の周波数FLと第2の周波数FHとを明確に識別するために、閾値thを第2の周波数FHの1.5周期分としている。入力信号rxdが第2の周波数FHであれば、第2の周波数FHの1.5周期の間のエッジ数は3つ(ライズ、フォール、ライズまたはフォール、ライズ、フォール)になる。   Here, in order to clearly distinguish the first frequency FL and the second frequency FH, the threshold th is set to 1.5 periods of the second frequency FH. If the input signal rxd is the second frequency FH, the number of edges during the 1.5 period of the second frequency FH is three (rise, fall, rise or fall, rise, fall).

一方、第2の周波数FHの1.5周期分は第1の周波数FLの1周期分(カウント値が「1024」)よりは少なくなっている。よって、入力信号rxdが第1の周波数FLであれば、第2の周波数FHの1.5周期分の間にエッジ数は2つ(ライズ、フォールまたはフォール、ライズ)になる。これにより、判定周期JTが第2の周波数FHの1.5周期分となるように閾値thを設定することにより、第1の周波数FLと第2の周波数FHとで必ずエッジ数が異なるようになる。つまり、論理を確実に判定することができる。   On the other hand, 1.5 periods of the second frequency FH are smaller than one period of the first frequency FL (count value is “1024”). Therefore, if the input signal rxd is the first frequency FL, the number of edges becomes two (rise, fall or fall, rise) during 1.5 periods of the second frequency FH. Thereby, by setting the threshold th so that the determination period JT is 1.5 periods of the second frequency FH, the number of edges is always different between the first frequency FL and the second frequency FH. Become. That is, the logic can be reliably determined.

スタートビット検出回路18は通信の開始を検出したか否かを判定する(ステップS18)。このために、スタートビット検出回路18はエッジ数カウンタ16からエッジ信号edgを入力している。エッジ信号edgが「3」のときには第2の周波数FHであることを示しており、つまり論理が「0」であることが認識される。   The start bit detection circuit 18 determines whether or not the start of communication is detected (step S18). For this purpose, the start bit detection circuit 18 inputs the edge signal edg from the edge number counter 16. When the edge signal edg is “3”, it indicates that the frequency is the second frequency FH, that is, it is recognized that the logic is “0”.

よって、スタートビット検出回路18はエッジ信号edgが「3」のときには通信の開始を検出する。一方、エッジ信号edgが「3」未満のときには通信の開始を検出しない。この場合には、ステップS13のタイマ回路15をリセットする処理に戻り、当該処理からフローを開始する。   Therefore, the start bit detection circuit 18 detects the start of communication when the edge signal edg is “3”. On the other hand, when the edge signal edg is less than “3”, the start of communication is not detected. In this case, the process returns to the process of resetting the timer circuit 15 in step S13, and the flow starts from this process.

状態判定回路14がアイドル状態と判定しているときには、入力信号rxdのエッジは変化をしていない。つまり、通信を行っていない状態では検出するエッジ信号edgが「0」になる。よって、スタートビット検出回路18はエッジ信号edgが「0」から「3」に変化したときに、通信の開始を検出する。   When the state determination circuit 14 determines that the state is the idle state, the edge of the input signal rxd has not changed. That is, the edge signal edg to be detected is “0” in a state where communication is not performed. Therefore, the start bit detection circuit 18 detects the start of communication when the edge signal edg changes from “0” to “3”.

ステップS18において通信の開始を検出したときには、タイマ回路15はそのままカウントを続行する(タイマフリーラン:ステップS19)。これにより、タイマ回路15のカウント値が「837」に到達した後も、続けて「838」からカウントアップを行う。そして、タイマ回路15はカウント値が「1023」に到達したか否か、つまりレート周期CTが終了したか否かを判定する(ステップS20)。カウント値が「1023」に到達するまでは、タイマ回路15はカウントアップを行う。   When the start of communication is detected in step S18, the timer circuit 15 continues counting as it is (timer free run: step S19). Thereby, even after the count value of the timer circuit 15 reaches “837”, the count-up is continued from “838”. Then, the timer circuit 15 determines whether or not the count value has reached “1023”, that is, whether or not the rate cycle CT has ended (step S20). Until the count value reaches “1023”, the timer circuit 15 counts up.

タイマ回路15のカウント値が「1023」になったときには、1レート周期CTが終了したとして、キャリアウト信号carryを出力する。図4に示すように、このキャリアウト信号carryを出力したタイミングでタイマ回路15はカウント値のリセットを行う(ステップS21)。また、エッジ数カウンタ16はカウント値をリセットする(ステップS22)。   When the count value of the timer circuit 15 reaches “1023”, the carrier-out signal carry is output on the assumption that the one-rate period CT has ended. As shown in FIG. 4, the timer circuit 15 resets the count value at the timing when the carry-out signal carry is output (step S21). The edge number counter 16 resets the count value (step S22).

そして、タイマ回路15はカウントアップを行う(ステップS23)。タイマ回路15はカウント値が閾値th(=837)に到達したか否かの判定を行い(ステップS24)、到達していないと判定した場合には、ステップS23に戻ってカウントアップを続行する。   The timer circuit 15 counts up (step S23). The timer circuit 15 determines whether or not the count value has reached the threshold th (= 837) (step S24). If it is determined that the count value has not reached, the process returns to step S23 to continue counting up.

一方、閾値thに到達したと判定したときには、タイマ回路15が制御信号ctrを出力する。そして、この制御信号ctrに基づいて、エッジ数カウンタ16は計測したエッジ数をエッジ信号edgとして出力する(ステップS25)。このエッジ信号edgが論理判定回路17に入力される。   On the other hand, when it is determined that the threshold value th has been reached, the timer circuit 15 outputs a control signal ctr. Based on the control signal ctr, the edge number counter 16 outputs the measured edge number as the edge signal edg (step S25). This edge signal edg is input to the logic determination circuit 17.

論理判定回路17は入力したエッジ信号edgの判定を行う(ステップS26)。エッジ信号edgが「3」を示しているときには、前述したように入力信号rxdが第2の周波数FHであることを認識する。これにより、論理が「0」であることを判定する(ステップS27)。一方、エッジ信号edgが「2」であるとき(「3」未満であるとき)には、前述したように入力信号rxdが第1の周波数FLであることを認識する。これにより、論理が「1」であることを判定する(ステップS28)   The logic determination circuit 17 determines the input edge signal edg (step S26). When the edge signal edg indicates “3”, it is recognized that the input signal rxd is the second frequency FH as described above. Thereby, it is determined that the logic is “0” (step S27). On the other hand, when the edge signal edg is “2” (less than “3”), it is recognized that the input signal rxd has the first frequency FL as described above. Thereby, it is determined that the logic is “1” (step S28).

閾値thに到達したタイミング、つまり制御信号ctrを入力して論理判定回路17が論理の判定を行うタイミングは、未だレート周期CTが終了していない。よって、タイマ回路15は閾値th(=837)の続きである「838」からカウントアップを行う(タイマフリーラン:ステップS29)。   The timing at which the threshold value th is reached, that is, the timing at which the logic determination circuit 17 determines the logic by inputting the control signal ctr, has not yet ended the rate period CT. Therefore, the timer circuit 15 counts up from “838” which is a continuation of the threshold th (= 837) (timer free run: step S29).

そして、タイマ回路15のカウント値が「1023」に到達したか否か、つまり1レート周期CTが終了したか否かを判定する(ステップS30)。カウント値が「1024」に到達していなければ、引き続きステップS29のタイマフリーランを行う。一方、レート周期CTが終了したときには、論理判定回路17は判定した論理を出力信号sigとしてUART受信部7に出力する。   Then, it is determined whether or not the count value of the timer circuit 15 has reached “1023”, that is, whether or not the 1-rate period CT has ended (step S30). If the count value has not reached “1024”, the timer free run in step S29 is continued. On the other hand, when the rate cycle CT ends, the logic determination circuit 17 outputs the determined logic to the UART reception unit 7 as an output signal sig.

UART受信部7はこのレート周期CTのタイミングごとに出力信号sigを入力して、所定の信号処理を行う。このときのUART受信部7が出力信号sigを取得するタイミングは常に一定の周期(レート周期CT)になっている。このために、論理判定回路17はキャリアウト信号carryを入力したタイミングごとに出力信号sigを出力する。そして、全ての通信が終了したか否かを判定し(ステップS31)、終了していないと判定されれば再びステップS21に戻り、終了したと判定されれば処理を終了する。   The UART receiver 7 receives the output signal sig at every timing of the rate period CT and performs predetermined signal processing. At this time, the timing at which the UART receiver 7 acquires the output signal sig is always a constant cycle (rate cycle CT). For this purpose, the logic determination circuit 17 outputs the output signal sig at every timing when the carry-out signal carry is input. Then, it is determined whether or not all communication has been completed (step S31). If it is determined that the communication has not ended, the process returns to step S21 again, and if it is determined that the communication has ended, the process ends.

従って、タイマ回路15が一定の判定周期JTごとに入力信号rxdのエッジ数を検出して、このエッジ数に基づいて論理を判定している。つまり、一定の時間を区切って、この時間内における入力信号rxdのエッジ数に基づいて論理を判定している。   Therefore, the timer circuit 15 detects the number of edges of the input signal rxd every fixed determination period JT, and determines the logic based on the number of edges. That is, the logic is determined based on the number of edges of the input signal rxd within a certain time interval.

入力信号rxdの論理は第1の周波数FLと第2の周波数FHとで周波数を異ならせることにより表現している。エッジとエッジとの間隔(時間:パルス幅)を計測して論理を判定する場合には、レート周期CTの間に本来検出されるべきエッジを検出せず、或いは本来検出されるべきではないエッジが検出されることがある。このために、通信された信号の正確性が損なわれる。   The logic of the input signal rxd is expressed by making the frequency different between the first frequency FL and the second frequency FH. When measuring the interval between edges (time: pulse width) to determine logic, an edge that should not be detected during the rate period CT or an edge that should not be detected should be detected May be detected. This impairs the accuracy of the communicated signal.

この点、本実施形態では、エッジの間隔ではなく一定時間(判定周期JT)の間のエッジ数を検出して論理の判定を行っている。このため、入力信号rxdの論理が「0」、「1」の何れであるかによってタイミングが左右されることはなく、一定のレート周期CTの間に常に正しい論理の判定を行うことができる。これにより、正確な通信を行うことができるようになる。   In this regard, in this embodiment, the logic is determined by detecting the number of edges during a certain time (determination period JT), not the interval between edges. For this reason, the timing is not affected by whether the logic of the input signal rxd is “0” or “1”, and the correct logic can always be determined during a certain rate period CT. As a result, accurate communication can be performed.

また、本実施形態の動作を実現するために、判定周期JTとレート周期CTとの2つの時間を検出する必要がある。この点、図2に示したように、判定周期JTもレート周期CTも1つのタイマ回路15がカウントを行っている。つまり、判定周期JTを検出するためのカウンタとレート周期CTを検出するためのカウンタとを別個に設けないで、1つのタイマ回路で実現しているため、回路の単純化を図ることができる。   Further, in order to realize the operation of the present embodiment, it is necessary to detect two times of the determination cycle JT and the rate cycle CT. In this regard, as shown in FIG. 2, one timer circuit 15 counts both the determination cycle JT and the rate cycle CT. That is, since the counter for detecting the judgment cycle JT and the counter for detecting the rate cycle CT are not provided separately and are realized by one timer circuit, the circuit can be simplified.

以上において、通信の開始を行うときには、プリアンブルデータを送信することが望ましい。プリアンブルデータは最初の1ビット目の論理が「0」であり、その後の数ビットは「1」のデータが複数回繰り返されたデータになる(つまり、0111101111のようなデータ)。このプリアンブルデータは通信の開始を示すデータになる。   In the above, when starting communication, it is desirable to transmit preamble data. In the preamble data, the logic of the first bit is “0”, and the subsequent bits are data in which the data of “1” is repeated a plurality of times (that is, data such as 0111101111). This preamble data is data indicating the start of communication.

図6は図5のタイミングチャートについて、最初のパルスを喪失(エッジが出現しない)したものを示している。通信の開始時にはノイズ等により最初のパルスを喪失することがある。このため、図6のように最初の判定周期JTで、本来であればエッジ数は「3」であることを検出すべきであるが、パルスの喪失によりエッジ数は「2」として検出することになる。   FIG. 6 shows the timing chart of FIG. 5 in which the first pulse is lost (no edge appears). At the start of communication, the first pulse may be lost due to noise or the like. For this reason, it should be detected that the number of edges is originally “3” in the first determination period JT as shown in FIG. 6, but the number of edges is detected as “2” due to the loss of the pulse. become.

この場合には、論理「0」を検出すべきであるが、論理「1」を検出する。よって、通信の開始を検出することができない。このときに、プリアンブルデータを送信するようにする。これにより、最初のパルスを喪失したとしても、次に論理が「0」となるときには、エッジ数は「3」になり、スターとビットとして通信の開始を検出することができるようになる。いずれにしても、エッジ数カウンタ16が検出するエッジ数が「0」から最初に「3」になったときに、通信の開始を検出する。   In this case, logic “0” should be detected, but logic “1” is detected. Therefore, the start of communication cannot be detected. At this time, preamble data is transmitted. As a result, even if the first pulse is lost, when the logic next becomes “0”, the number of edges becomes “3”, and the start of communication can be detected as a star and a bit. In any case, when the number of edges detected by the edge number counter 16 first changes from “0” to “3”, the start of communication is detected.

また、判定周期JTは第2の周波数FHの1.5周期分としており、これに対応するタイマ回路15の閾値を「837」としているが、判定周期JTは第2の周波数FHの1.5周期分以外の値として設定してもよい。判定周期JTとしては、第2の周波数FH(=2200Hz)の1.5周期分以上であり、且つ第1の周波数FL(=1200Hz)の1周期分以下であれば、任意の値としてもよい。例えば、閾値thを「837」ではなく「900」のように設定してもよい。   The determination cycle JT is 1.5 cycles of the second frequency FH, and the corresponding threshold value of the timer circuit 15 is “837”, but the determination cycle JT is 1.5 cycles of the second frequency FH. It may be set as a value other than the period. The determination cycle JT may be an arbitrary value as long as it is 1.5 cycles or more of the second frequency FH (= 2200 Hz) and 1 cycle or less of the first frequency FL (= 1200 Hz). . For example, the threshold th may be set to “900” instead of “837”.

これは、判定周期JTの間に、入力信号rxdが第2の周波数FH(つまり、論理が「0」)のときにはエッジ数が「3」となるように、且つ入力信号rxdが第1の周波数FL(つまり、論理が「1」)のときにはエッジ数が「2」(「3」未満)となるようにしているためである。このため、第2の周波数FHと第1の周波数FLとで、判定周期JTの間に検出するエッジ数が必ず異なるのであれば、判定周期JT(つまり、閾値th)は任意に設定することができる。また、論理「0」のときにはエッジ数が「4」になり、論理「1」のときには「4」未満となるようにしてもよい。   This is because, during the determination period JT, when the input signal rxd is the second frequency FH (that is, the logic is “0”), the number of edges is “3” and the input signal rxd is the first frequency. This is because the number of edges is set to “2” (less than “3”) when FL (that is, logic is “1”). For this reason, if the number of edges detected during the determination period JT is always different between the second frequency FH and the first frequency FL, the determination period JT (that is, the threshold th) can be arbitrarily set. it can. Alternatively, the number of edges may be “4” when the logic is “0”, and may be less than “4” when the logic is “1”.

また、レート周期CTの周波数は第1の周波数FLと一致させているが、第1の周波数FLと一致させなくてもよい。ただし、UART受信部7が第1の周波数FLに同期したタイミングで出力信号sigを取得する場合には、レート周期CTを第1の周波数FLに一致させる。   Further, although the frequency of the rate period CT is matched with the first frequency FL, it may not be matched with the first frequency FL. However, when the UART receiver 7 acquires the output signal sig at the timing synchronized with the first frequency FL, the rate period CT is made to coincide with the first frequency FL.

1 通信装置
6 復調部
7 UART受信部
11 ライズエッジ検出回路
12 フォールエッジ検出回路
13 論理和回路
14 状態判定回路
15 タイマ回路
16 エッジ数カウンタ
17 論理判定回路
18 スタートビット検出回路
DESCRIPTION OF SYMBOLS 1 Communication apparatus 6 Demodulation part 7 UART receiving part 11 Rise edge detection circuit 12 Fall edge detection circuit 13 OR circuit 14 State determination circuit 15 Timer circuit 16 Edge number counter 17 Logic determination circuit 18 Start bit detection circuit

Claims (7)

異なる周波数を用いて二値の信号を通信する通信装置であって、
一定のレート周期を規定する第1のタイマと、
前記レート周期に同期した期間として個々の前記レート周期内に設けられる、前記レート周期よりも短い期間を規定する第2のタイマと、
前記第2のタイマにより規定される前記期間内における前記信号のエッジ数をカウントするエッジカウンタと、
前記エッジカウンタがカウントした前記エッジ数に基づいて前記信号の論理を判定する論理判定回路と、
を備え、
前記論理判定回路は、前記第1のタイマにより規定される前記レート周期ごとに前記信号の論理を判定し、
前記レート周期の周波数は前記周波数のうち低い周波数に一致していることを特徴とする通信装置。
A communication device that communicates binary signals using different frequencies,
A first timer defining a constant rate period;
A second timer defining a period shorter than the rate period provided in each of the rate periods as a period synchronized with the rate period;
An edge counter that counts the number of edges of the signal within the period defined by the second timer;
A logic determination circuit that determines the logic of the signal based on the number of edges counted by the edge counter;
With
The logic determination circuit determines the logic of the signal for each rate period defined by the first timer ;
The frequency of the said rate period corresponds with the low frequency among the said frequencies .
前記第1のタイマおよび前記第2のタイマは、一定周期のクロック信号をカウントする一のタイマ回路を共用して構成されることを特徴とする請求項1記載の通信装置。   2. The communication apparatus according to claim 1, wherein the first timer and the second timer are configured to share a timer circuit that counts a clock signal having a constant period. 前記第2のタイマは、第1の周波数の1周期分よりも短く、この第1の周波数よりも高い第2の周波数の1.5周期分よりも長い期間を前記期間として規定し、
前記論理判定回路は、前記エッジ数が3つ以上であるか否かに基づいて論理の判定を行うことを特徴とする請求項2記載の通信装置。
The second timer defines a period shorter than one period of the first frequency and longer than 1.5 periods of the second frequency higher than the first frequency as the period.
The communication apparatus according to claim 2, wherein the logic determination circuit determines a logic based on whether or not the number of edges is three or more.
前記論理判定回路は、前記第1の周波数を1200Hz、第2の周波数を2200Hzとしたときに、前記エッジ数が3つ以上の場合は論理「0」であると判定し、3つ未満の場合には論理「1」であると判定することを特徴とする請求項3記載の通信装置。   When the first frequency is 1200 Hz and the second frequency is 2200 Hz, the logic determination circuit determines that the number of edges is 3 or more and is logic “0”, and the number is less than 3 4. The communication device according to claim 3, wherein the communication device is determined to be logic “1”. 前記論理判定回路は、前記エッジ数が「0」のときには前記信号が通信されていないと判定し、前記エッジ数が「0」から「3」に変化したときに前記信号の通信が開始されたと判定することを特徴とする請求項4記載の通信装置。   The logic determination circuit determines that the signal is not communicated when the number of edges is “0”, and communication of the signal is started when the number of edges changes from “0” to “3”. The communication apparatus according to claim 4, wherein the determination is made. 前記論理判定回路は、前記第1のタイマにより規定される前記レート周期ごとに前記信号の論理を出力することを特徴とする請求項1乃至〜4の何れか1項に記載の通信装置。   5. The communication apparatus according to claim 1, wherein the logic determination circuit outputs the logic of the signal for each rate period defined by the first timer. 6. 請求項1乃至6の何れか1項に記載の通信装置を備えたことを特徴とするフィールド機器システム。   A field device system comprising the communication device according to claim 1.
JP2011060681A 2011-03-18 2011-03-18 Communication device and field device system Active JP5704506B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011060681A JP5704506B2 (en) 2011-03-18 2011-03-18 Communication device and field device system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011060681A JP5704506B2 (en) 2011-03-18 2011-03-18 Communication device and field device system

Publications (2)

Publication Number Publication Date
JP2012199616A JP2012199616A (en) 2012-10-18
JP5704506B2 true JP5704506B2 (en) 2015-04-22

Family

ID=47181446

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011060681A Active JP5704506B2 (en) 2011-03-18 2011-03-18 Communication device and field device system

Country Status (1)

Country Link
JP (1) JP5704506B2 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3277948B2 (en) * 1992-09-24 2002-04-22 横河電機株式会社 Digital signal receiver
US5550505A (en) * 1994-12-30 1996-08-27 General Electric Company Frequency shift keying (FSK) demodulator for use in low signal-to-noise ratio environments
JP4840078B2 (en) * 2006-10-26 2011-12-21 パナソニック電工株式会社 FSK receiver

Also Published As

Publication number Publication date
JP2012199616A (en) 2012-10-18

Similar Documents

Publication Publication Date Title
JP5794352B2 (en) Receiving device and method for detecting number of same-value bits in received bit string
RU2019115832A (en) OPTIMIZED COMBINATION OF PREAMBLE AND DATA FIELDS FOR SENSOR NETWORKS WITH LOW ELECTRICITY CONSUMPTION BASED ON TELEGRAM SEPARATION METHOD
CN102183695A (en) Methods and receiver for measuring data pulses
CN108023846B (en) Method, circuit, device and computer program product for detecting FSK modulation signal
TWI602046B (en) Dithering circuit for serial data transmission
JP5218535B2 (en) Pulse signal receiving apparatus and transmission system
CN102546084A (en) Anti-interference error-correcting and sampling system and method in process of receiving asynchronous serial communication data
US8213809B2 (en) Universal systems and methods for determining an incoming carrier frequency and decoding an incoming signal
JP4840078B2 (en) FSK receiver
JP5704506B2 (en) Communication device and field device system
US10462268B2 (en) Data transmitting/receiving apparatus and data transmitting/receiving method
KR102189511B1 (en) Method and apparatus for transmitting data, method and apparatus for receiving data
JP5326759B2 (en) FSK receiving apparatus, FSK receiving method, and program
KR102097367B1 (en) Independent packet detection method using orthogonal synchronization words and receiver thereof
US20140029935A1 (en) Indicating a synchronization point between a transmitter and a receiver of an optical link
WO2016140076A1 (en) Transmission device, reception device, and transmission/reception system
JP6163895B2 (en) Receive clock extraction circuit
JP2018152643A (en) Data receiving circuit of start-stop synchronization serial data communication device
JP4586492B2 (en) One-wire data communication method and one-wire data transmitter / receiver using this communication method
US20070189422A1 (en) Radio demodulation circuit
JP2007251930A (en) Wireless demodulation circuit and remote controller
KR100438980B1 (en) Automatic baud rate detection apparatus and method of asynchronous communication
JP4609038B2 (en) Reception synchronization signal generator
CN105243043B (en) The method for realizing high speed serial communication data filtering
KR101040270B1 (en) Apparatus for preventing reception error of data in rs-422 serial communication and method thereof

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140106

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140501

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140507

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140620

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20141017

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20141212

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: 20150202

R150 Certificate of patent or registration of utility model

Ref document number: 5704506

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20150215