JP2003179587A - Data input equipment - Google Patents

Data input equipment

Info

Publication number
JP2003179587A
JP2003179587A JP2001376270A JP2001376270A JP2003179587A JP 2003179587 A JP2003179587 A JP 2003179587A JP 2001376270 A JP2001376270 A JP 2001376270A JP 2001376270 A JP2001376270 A JP 2001376270A JP 2003179587 A JP2003179587 A JP 2003179587A
Authority
JP
Japan
Prior art keywords
bit
flip
flop
data
start bit
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
JP2001376270A
Other languages
Japanese (ja)
Inventor
Toshiyuki Maekawa
俊行 前川
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.)
Schneider Electric Japan Holdings Ltd
Original Assignee
Digital Electronics 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 Digital Electronics Corp filed Critical Digital Electronics Corp
Priority to JP2001376270A priority Critical patent/JP2003179587A/en
Publication of JP2003179587A publication Critical patent/JP2003179587A/en
Pending legal-status Critical Current

Links

Landscapes

  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To increase the number of times of sampling without increasing a frequency of a sampling clock which is used for detecting a start bit in a data string, in data input equipment for performing serial communication. <P>SOLUTION: In first and second detecting parts 31, 32, a start bit is detected by change of output of output terminals Q of JK flip-flops 31e, 32e from '1' to '0' when change is generated from a stop bit to the start bit. In the first detecting part 31, the start bit is detected being synchronous with the rise of a sampling clock SCLK the nearest to the leading phase of the start bit. In the second detecting part 32, the start bit is detected being synchronous with the fall of the sampling clock SCLK the nearest to the leading phase. Since the number of times of sampling becomes double, error of baud rate can be restricted within an allowable range when magnification of sampling frequency to the baud rate (e.g. 12 MHz) is low. <P>COPYRIGHT: (C)2003,JPO

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、SIO規格のデー
タ入力装置に係り、より詳しくは、高いボーレートで送
信されてくるデータ例のスタートビットをサンプリング
周波数を高めずに検出するデータ入力装置に関するもの
である。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an SIO standard data input device, and more particularly to a data input device for detecting a start bit of a data example transmitted at a high baud rate without increasing a sampling frequency. Is.

【0002】[0002]

【従来の技術】コンピュータ装置やコンピュータ機能を
有する機器は、他の機器との間でデータ転送を行うため
に、I/O(入出力)装置を備えている。非同期でシリ
アル通信を行うI/O装置(SIO(Serial Input Outp
ut) )を用いたデータ通信においては、次のようなデー
タ列が送受される。
2. Description of the Related Art A computer device or a device having a computer function is equipped with an I / O (input / output) device in order to transfer data with another device. An I / O device (SIO (Serial Input Output) that performs asynchronous serial communication
In data communication using ut)), the following data strings are transmitted and received.

【0003】SIOで送受信されるデータ列において
は、例えば、図3に示すように、第1ビットに“0”
(ローレベル)のスタートビットSTRが配され、第2
ないし第10ビットにデータD0〜DPが配され、第1
1および第12ビットに“1”(ハイレベル)のストッ
プビットSTPが配されている。なお、最上位のデータ
DPはパリティビットである。上記のデータ列は、1キ
ャラクタを構成しており、これらが連続することによっ
てデータ信号が形成されている。
In a data string transmitted and received by SIO, for example, as shown in FIG. 3, the first bit is "0".
The (low level) start bit STR is arranged, and the second
Data D0 to DP are allocated to the 10th to 10th bits,
A stop bit STP of "1" (high level) is arranged in the 1st and 12th bits. The highest data DP is a parity bit. The above data string constitutes one character, and a data signal is formed by the continuation of these characters.

【0004】このようなデータ列の受信時には、1キャ
ラクタの始まりを特定するために、スタートビットを検
出する必要がある。このためには、ストップビットとス
タートビットとの状態の変化を区別できるように、スト
ップビットの後に次のキャラクタのスタートビットが続
くように配されている。
When receiving such a data string, it is necessary to detect the start bit in order to identify the start of one character. For this purpose, the stop bit is arranged so that the start bit of the next character follows after the stop bit so that the change in state between the stop bit and the start bit can be distinguished.

【0005】以下に、上記のようなスタートビットの検
出機能を有する従来のSIOの主要部として、UART
(Universal Asynchronous Receiver and Transmitter)
の受信回路について説明する。
Below, as a main part of a conventional SIO having a start bit detecting function as described above, a UART is used.
(Universal Asynchronous Receiver and Transmitter)
The receiving circuit will be described.

【0006】なお、後述のボーレートは、従来、モデム
を用いた通信での変調速度を意味しているが、現在、シ
リアル通信でのデータの伝送レートを意味するものとし
て一般的に用いられている。そこで、ここでも、ボーレ
ートを同様の意味を示すものとして用いる。
The baud rate described below conventionally means a modulation rate in communication using a modem, but is currently generally used as a data transmission rate in serial communication. . Therefore, here also, the baud rate is used to indicate the same meaning.

【0007】図5に示すように、受信回路において、上
記のデータ信号であるシリアルの受信データTDATA
INは、シフトレジスタ11でパラレルの入力データT
DATAに変換されて、データセレクタ12およびDフ
リップフロップ13を経て図示しないCPUに入力され
る。また、負論理の上記の受信データTDATAIN
は、インバータ14で反転されて、Dフリップフロップ
15に入力される。Dフリップフロップ15、Dフリッ
プフロップ16、NORゲート17、ANDゲート18
およびJKフリップフロップ19からなるスタートビッ
ト検出部では、シリアルの受信データTDATAINの
スタートビットが検出される。スタートビットが検出さ
れたときは、JKフリップフロップ19の出力端子Qが
“0”になる。
As shown in FIG. 5, in the reception circuit, the serial reception data TDATA which is the above-mentioned data signal.
IN is the parallel input data T in the shift register 11.
After being converted into DATA, it is input to a CPU (not shown) via the data selector 12 and the D flip-flop 13. In addition, the reception data TDATAIN of the negative logic
Is inverted by the inverter 14 and input to the D flip-flop 15. D flip-flop 15, D flip-flop 16, NOR gate 17, AND gate 18
The start bit detecting section including the JK flip-flop 19 detects the start bit of the serial reception data TDATAIN. When the start bit is detected, the output terminal Q of the JK flip-flop 19 becomes "0".

【0008】また、上記のスタートビット検出部におけ
る各フリップフロップ15・16・19には、リセット
信号RESET*(負論理)およびボーレート発生器2
0で得られたサンプリングクロックSCLKが供給され
ている。このサンプリングクロックSCLKは、SIO
専用発振器(図中、OSC)21で発生したクロック
が、ボーレート発生器20で分周されることで得られた
48MHz(12MHz(ボーレート)×4)のクロッ
クであり、1キャラクタの1ビット長をサンプリングク
ロックSCLKの4クロック分と規定している。
Further, the reset signal RESET * (negative logic) and the baud rate generator 2 are provided to the flip-flops 15, 16 and 19 in the start bit detecting section.
The sampling clock SCLK obtained at 0 is supplied. This sampling clock SCLK is SIO
The clock generated by the dedicated oscillator (OSC in the figure) 21 is a clock of 48 MHz (12 MHz (baud rate) x 4) obtained by dividing the frequency by the baud rate generator 20. It is defined as 4 clocks of the sampling clock SCLK.

【0009】JKフリップフロップ19の出力は、カウ
ンタ22(2ビットバイナリカウンタ)のロード端子L
*に与えられることによって、カウンタ22がロード
される。ロードによってプリセットされるデータは、
“0”レベルに固定されている(データ入力端子A・
B)。カウンタ22は、上記のサンプリングクロックS
CLKをカウントして、出力端子QA・QBからカウン
トデータを出力していく。出力端子QAからは下位ビッ
トのデータが出力され、出力端子QBからは上位ビット
のデータが出力される。また、出力端子QAは、非接続
状態(図中、NC)にある。
The output of the JK flip-flop 19 is the load terminal L of the counter 22 (2-bit binary counter).
The counter 22 is loaded by being applied to D * . The data preset by loading is
It is fixed at "0" level (data input terminal A
B). The counter 22 uses the sampling clock S
CLK is counted and count data is output from the output terminals QA and QB. The lower bit data is output from the output terminal QA, and the upper bit data is output from the output terminal QB. Further, the output terminal QA is in a non-connection state (NC in the figure).

【0010】出力端子QBからのパルスは、“0”,
“0”,“1”,“1”のように、2ビットずつ同じ値
をサンプリングクロックSCLKの4クロックの周期で
繰り返し、上記のNORゲート17およびANDゲート
18に入力される。
The pulse from the output terminal QB is "0",
Like "0", "1", and "1", the same value is repeated every 2 bits in a cycle of 4 clocks of the sampling clock SCLK and input to the NOR gate 17 and the AND gate 18.

【0011】また、全加算器23では、ストップビット
が2つであるか否かを示すストップビットデータTwo
STPと、パリティビットを含むか否かを示すパリティ
ビットデータPARITYと、データビットが8ビット
であるか否かを示す8ビットデータBit8によって、
1キャラクタのビット長が決定される。ここで、ストッ
プビットが2つである場合、ストップビットデータTw
oSTPが“1”となり、パリティビットを含む場合、
パリティビットデータPARITYが“1”となり、デ
ータビットが8ビットである場合、8ビットデータBi
t8が“1”となる。したがって、図3に示す1キャラ
クタ(12ビット長)の場合、全加算器23では、これ
らの総和である“3”(2ビット値で“11”)が演算
され、その結果として、キャリーアウト端子COUTか
ら“1”が出力され、出力端子SUMから“1”が出力
される。
In addition, in the full adder 23, stop bit data Two which indicates whether or not there are two stop bits.
By STP, parity bit data PARITY indicating whether or not a parity bit is included, and 8-bit data Bit8 indicating whether or not a data bit is 8 bits,
The bit length of one character is determined. If there are two stop bits, the stop bit data Tw
When oSTP is “1” and the parity bit is included,
If the parity bit data PARITY is "1" and the data bit is 8 bits, the 8-bit data Bi
t8 becomes “1”. Therefore, in the case of one character (12-bit length) shown in FIG. 3, the full adder 23 calculates the sum "3" (2-bit value "11"), and as a result, the carry-out terminal. "1" is output from COUT and "1" is output from the output terminal SUM.

【0012】一致検出コンパレータ24には、全加算器
23側の3つの値(1,1,1)が入力されている(最
上位ビットは“1”に固定)。したがって、一致検出コ
ンパレータ24では、カウンタ25の出力端子QA・Q
B・QDからの出力信号が(1,1,1)になったと
き、すなわちカウンタ22の出力端子QBからのパルス
の11クロックがカウントされて、ストップビットに相
当する第11ビットが検出されたとき、両入力値が一致
して、一致検出端子より“0”を出力する。
Three values (1, 1, 1) on the side of the full adder 23 are input to the coincidence detection comparator 24 (the most significant bit is fixed to "1"). Therefore, in the coincidence detection comparator 24, the output terminals QA and Q of the counter 25 are
When the output signal from B · QD becomes (1, 1, 1), that is, 11 clocks of the pulse from the output terminal QB of the counter 22 are counted, and the 11th bit corresponding to the stop bit is detected. At this time, both input values match, and "0" is output from the match detection terminal.

【0013】上記のスタートビット検出部において、各
キャラクタの最終のストップビットは、インバータ14
で反転されて“0”となってDフリップフロップ15に
入力され、保持された後、さらにDフリップフロップ1
6で保持される。また、Dフリップフロップ15の反転
出力端子からの反転データ(“1”)が、NORゲート
17に入力される。Dフリップフロップ15で保持され
た反転のストップビットは、Dフリップフロップ16で
も同様に保持されて1クロック遅延して出力される。こ
のとき、Dフリップフロップ15・16は、サンプリン
グクロックSCLKの立ち上がりに同期して出力の状態
を変化させる。
In the above start bit detector, the final stop bit of each character is the inverter 14
Is inverted to become “0”, is input to the D flip-flop 15, is held, and then is further input to the D flip-flop 1.
Holds at 6. Further, the inverted data (“1”) from the inverted output terminal of the D flip-flop 15 is input to the NOR gate 17. The inverted stop bit held in the D flip-flop 15 is also held in the D flip-flop 16 in the same manner and is delayed by one clock before being output. At this time, the D flip-flops 15 and 16 change the output state in synchronization with the rising edge of the sampling clock SCLK.

【0014】Dフリップフロップ16からNORゲート
17には、Dフリップフロップ15の反転出力端子から
の反転データ(“1”)と同じタイミングで“0”とな
るDフリップフロップ16からの出力信号が入力され
る。また、このとき、カウンタ22は、スタートビット
の検出からサンプリングクロックSCLKをカウントし
続けることで、出力端子QBから前述のパルスを出力し
ており、このパルスもNORゲート17に入力される。
したがって、JKフリップフロップ19の入力端子Jに
は、NORゲート17から“0”の信号が入力される。
From the D flip-flop 16 to the NOR gate 17, the output signal from the D flip-flop 16 which becomes "0" at the same timing as the inverted data ("1") from the inverted output terminal of the D flip-flop 15 is input. To be done. At this time, the counter 22 continues to count the sampling clock SCLK from the detection of the start bit to output the above-mentioned pulse from the output terminal QB, and this pulse is also input to the NOR gate 17.
Therefore, the signal “0” is input from the NOR gate 17 to the input terminal J of the JK flip-flop 19.

【0015】一方、このとき、ANDゲート18には、
一致検出コンパレータ24からの“1”の一致検出信号
と、セット状態にあるJKフリップフロップ19からの
“1”の信号とが入力される。また、ANDゲート18
には、カウンタ22からの“0”と“1”の信号が交互
に入力される。したがって、ANDゲート18は、全て
の入力が“1”となったときに、JKフリップフロップ
19の入力端子Kに“1”の信号を与える。
On the other hand, at this time, the AND gate 18
The "1" match detection signal from the match detection comparator 24 and the "1" signal from the JK flip-flop 19 in the set state are input. Also, the AND gate 18
A signal of "0" and a signal of "1" from the counter 22 are alternately input to the. Therefore, the AND gate 18 gives a signal of "1" to the input terminal K of the JK flip-flop 19 when all the inputs become "1".

【0016】これにより、JKフリップフロップ22
は、リセットされて、出力端子Qから“0”の信号を出
力する。
As a result, the JK flip-flop 22
Is reset and outputs a signal of "0" from the output terminal Q.

【0017】1キャラクタの入力が終了して、次のキャ
ラクタのスタートビットがスタートビット検出部に入力
されると、そのスタートビットは、インバータ14で反
転されて“1”となってDフリップフロップ15・16
で順次保持される。すると、Dフリップフロップ16か
らの保持出力(“1”)と、Dフリップフロップ15の
反転出力端子からの反転データ(“0”)とが、NOR
ゲート17に入力される。このとき、Dフリップフロッ
プ16からNORゲート17には、Dフリップフロップ
15の反転出力端子からの反転データ(“0”)と、同
じタイミングで“1”となるDフリップフロップ16か
らの出力信号が入力される。また、カウンタ22からの
前述のパルスもNORゲート17に入力される。
When the input of one character is completed and the start bit of the next character is input to the start bit detecting portion, the start bit is inverted by the inverter 14 to become "1" and becomes the D flip-flop 15.・ 16
Are held in sequence. Then, the held output (“1”) from the D flip-flop 16 and the inverted data (“0”) from the inverted output terminal of the D flip-flop 15 are NOR
It is input to the gate 17. At this time, the inverted data (“0”) from the inverted output terminal of the D flip-flop 15 and the output signal from the D flip-flop 16 which becomes “1” at the same timing are output from the D flip-flop 16 to the NOR gate 17. Is entered. The above-mentioned pulse from the counter 22 is also input to the NOR gate 17.

【0018】図6に示すように、スタートビットの先頭
位相Hの直後のクロックの立ち上がりのタイミングで
は、Dフリップフロップ15の反転出力端子からの反転
データが“0”である。また、Dフリップフロップ16
は、Dフリップフロップ15の出力端子Qからの出力信
号より1クロック遅延して出力端子Qから“1”となる
信号を出力するが、それまでは“0”を出力する。した
がって、Dフリップフロップ15の反転出力端子および
Dフリップフロップ16の出力端子Qからの信号がとも
に“0”となる期間に、カウンタ22からの出力が
“0”となれば、NORゲート17からJKフリップフ
ロップ19の入力端子Jに、“1”の信号が入力され
る。
As shown in FIG. 6, at the rising timing of the clock immediately after the start phase H of the start bit, the inverted data from the inverted output terminal of the D flip-flop 15 is "0". Also, the D flip-flop 16
Outputs a signal that becomes "1" from the output terminal Q with a delay of one clock from the output signal from the output terminal Q of the D flip-flop 15, but outputs "0" until then. Therefore, if the output from the counter 22 becomes "0" during the period in which the signals from the inverting output terminal of the D flip-flop 15 and the output terminal Q of the D flip-flop 16 both become "0", the NOR gate 17 causes the JK The signal “1” is input to the input terminal J of the flip-flop 19.

【0019】一方、このとき、ANDゲート18には、
一致検出コンパレータ24からの“0”の信号と、カウ
ンタ22からのパルスと、リセットされた状態のJKフ
リップフロップ19からの“0”の信号とが入力され
る。このため、上記と同じタイミングにおいて、AND
ゲート18は、 “0”の信号を出力してJKフリップ
フロップ19の入力端子Kに与える。
On the other hand, at this time, the AND gate 18 has
The "0" signal from the coincidence detection comparator 24, the pulse from the counter 22, and the "0" signal from the reset JK flip-flop 19 are input. Therefore, at the same timing as above, AND
The gate 18 outputs a signal of "0" and supplies it to the input terminal K of the JK flip-flop 19.

【0020】これにより、JKフリップフロップ19
は、セットされて、出力端子Qから“1”の信号を出力
する。このように、スタートビット検出部では、JKフ
リップフロップ19が1キャラクタの通過毎にリセット
されることによってスタートビットを検出している。ま
た、JKフリップフロップ19は、スタートビットの検
出時にセットされると、ストップビットの通過によって
リセットされるまで、セット状態を維持する。
As a result, the JK flip-flop 19
Is set and outputs a signal of "1" from the output terminal Q. In this way, the start bit detecting section detects the start bit by resetting the JK flip-flop 19 every time one character passes. When the JK flip-flop 19 is set when the start bit is detected, the JK flip-flop 19 maintains the set state until it is reset by passing the stop bit.

【0021】サンプリングクロックSCLKの4クロッ
ク当たりに1ビットのレートで転送されてくるデータT
DATAINは、カウンタ22からのパルスの立ち上が
りに同期して1ビットずつシフトレジスタ11において
シフトしていく。第9ビットに相当するクロックがカウ
ントされたとき、NORゲート26の入力値が全て
“1”となるので、“1”の信号がNORゲート26か
ら出力される。このとき、最終データビット(図3のD
7)がシフトレジスタ11に取り込まれている。
Data T transferred at a rate of 1 bit per 4 clocks of the sampling clock SCLK
DATAIN is shifted in the shift register 11 bit by bit in synchronization with the rising edge of the pulse from the counter 22. When the clock corresponding to the 9th bit is counted, all the input values of the NOR gate 26 become "1", so that the signal "1" is output from the NOR gate 26. At this time, the final data bit (D in FIG. 3)
7) is stored in the shift register 11.

【0022】この状態で、データセレクタ12は、シフ
トレジスタ11からの8ビットのパラレルデータをDフ
リップフロップ13に出力する。一方、データセレクタ
13は、NORゲート26からの信号が“0”のとき、
Dフリップフロップ13に保持されたパラレルデータを
Dフリップフロップ13に戻す。このようにして、入力
されたシリアルのデータTDATAINから1キャラク
タにおけるデータビットのみがパラレルに変換され、デ
ータビットの全てがシフトレジスタ11に取り込まれる
までは、Dフリップフロップ13に保持されたパラレル
データが出力される。
In this state, the data selector 12 outputs the 8-bit parallel data from the shift register 11 to the D flip-flop 13. On the other hand, when the signal from the NOR gate 26 is “0”, the data selector 13
The parallel data held in the D flip-flop 13 is returned to the D flip-flop 13. In this way, from the input serial data TDATAIN, only the data bits in one character are converted into parallel, and the parallel data held in the D flip-flop 13 is stored until all the data bits are taken into the shift register 11. Is output.

【0023】また、カウンタ22は、前述のように、サ
ンプリングクロックSCLKをカウントして、4クロッ
ク分を1周期とするパルスを出力する。したがって、こ
のパルスの1周期の前半(2クロック分)は“0”であ
り、後半(2クロック分)は“1”である。そして、カ
ウンタ25が上記のパルスをカウントすることによっ
て、2クロック後に第1ビットのカウントが始まり、そ
れ以降は4クロック毎にカウント値が更新されていく。
これにより、NORゲート26からの“1”の信号は、
各データビットのほぼ中間位置(3クロック目)で
“0”から変化する。したがって、各データビットは、
図6に示すように、それぞれほぼ中間位置となるデータ
取込タイミングTdでシフトレジスタ2aに取り込まれ
ていく。
As described above, the counter 22 counts the sampling clock SCLK and outputs a pulse having a period of 4 clocks. Therefore, the first half (2 clocks) of one cycle of this pulse is "0", and the second half (2 clocks) is "1". Then, the counter 25 counts the above-mentioned pulses, so that the counting of the first bit starts after 2 clocks, and thereafter, the count value is updated every 4 clocks.
As a result, the "1" signal from the NOR gate 26 becomes
It changes from "0" at almost the middle position (3rd clock) of each data bit. Therefore, each data bit is
As shown in FIG. 6, the data is taken into the shift register 2a at the data taking-in timing Td, which is almost at the intermediate position.

【0024】ところで、サンプリングクロックSCLK
が、ボーレート(12MHz)の16倍に設定されてい
る場合、図7に示すように、1キャラクタの1ビット長
をサンプリングクロックSCLKの16クロック分と規
定している。この場合は、スタートビットの検出タイミ
ングTsから8クロックの位置を起点として、16クロ
ック毎をデータ取込タイミングTdに設定している。
By the way, the sampling clock SCLK
However, when 16 times the baud rate (12 MHz) is set, one bit length of one character is defined as 16 sampling clocks SCLK, as shown in FIG. In this case, the data acquisition timing Td is set every 16 clocks starting from the position of 8 clocks from the start bit detection timing Ts.

【0025】[0025]

【発明が解決しようとする課題】SIOのボーレートが
高速(例えば、6MHz以上)になると、受信時にスタ
ートビットを検出するためのサンプリングクロックの周
波数(通常、図7に示すようにボーレートの16倍)も
それに比例して高速(例えば、ボーレート6MHzの場
合は96MHz)にする必要がある。しかしながら、S
IOをASICのようにゲートアレイやセルベースで構
成する場合、回路内でこのような高周波数のクロックを
供給すると、ASICの回路周波数の上限値である60
MHzを超えるため、回路動作を保証することができな
いという不都合がある。このため、ボーレートを3MH
z程度に設定して、サンプリング周波数をその16倍の
48MHz程度に抑えることが必要になる。
When the baud rate of SIO becomes high speed (for example, 6 MHz or more), the frequency of the sampling clock for detecting the start bit during reception (usually 16 times the baud rate as shown in FIG. 7). In proportion to that, it is necessary to increase the speed (for example, 96 MHz when the baud rate is 6 MHz). However, S
When the IO is composed of a gate array or a cell base like an ASIC, if such a high frequency clock is supplied in the circuit, the upper limit value of the circuit frequency of the ASIC is 60.
Since it exceeds MHz, there is an inconvenience that the circuit operation cannot be guaranteed. Therefore, the baud rate is 3 MH
It is necessary to set the sampling frequency to about z and suppress the sampling frequency to about 16 times that of 48 MHz.

【0026】ところで、SIOのボーレートは、通常、
SIOが組み込まれているシステムのクロック等の要因
によって、必ずしも正規のボーレートであるとは限らな
い。送信側または受信側のいずれか一方のボーレートが
正規のボーレートであれば、他方のボーレートが±3%
以下の誤差を含んでいても、問題なく通信することが可
能である。逆に、他方のボーレートの誤差が±3%を超
えると、正しく通信することができなくなる。
By the way, the baud rate of SIO is usually
The baud rate is not always the normal baud rate due to factors such as the clock of the system in which the SIO is incorporated. If the baud rate of either the transmitting side or the receiving side is the normal baud rate, the other baud rate is ± 3%.
Even if the following error is included, it is possible to communicate without problems. On the contrary, if the error of the other baud rate exceeds ± 3%, correct communication cannot be performed.

【0027】シリアル通信では、受信側において、正規
のボーレートの例えば16倍の周波数を有するサンプリ
ングクロックでデータをサンプリングするとき、前述の
ようにデータのほぼ中央でサンプリングするため、サン
プリングのタイミングが、サンプリングクロックの8ク
ロック目の位置に設定されている。しかしながら、実際
のサンプリングにおいては、ボーレートの誤差によるサ
ンプリング誤差が生じており、データを1ビットサンプ
リングする毎にサンプリング誤差が累積していく。ま
た、通信時に配線から受ける波形歪による誤差も生じる
ことがあり、その誤差が加われば、さらに大きな誤差が
累積していくことになる。
In serial communication, when data is sampled at the receiving side with a sampling clock having a frequency of, for example, 16 times the normal baud rate, it is sampled at approximately the center of the data as described above. It is set at the position of the eighth clock of the clock. However, in the actual sampling, a sampling error occurs due to the error of the baud rate, and the sampling error is accumulated every time the data is sampled by 1 bit. Further, an error may occur due to the waveform distortion received from the wiring during communication, and if the error is added, a larger error will be accumulated.

【0028】例えば、送信側でのボーレートの誤差が3
%である場合、12ビット長の1キャラクタでは、各ビ
ットに累積する誤差が36%になる。これに、受信側の
サンプリング誤差が加われば、累積誤差が約45%にな
り、さらに、波形歪が加われば、累積誤差が50%に近
くなる。そして、その累積誤差が、サンプリング位置
(ビットの中央)から50%を超えると、データを正し
くサンプリングすることができなくなり、フレーミング
エラーやパリティエラーなどの通信エラーが発生する。
For example, the error of the baud rate on the transmitting side is 3
%, The error accumulated in each bit is 36% for one character having a 12-bit length. If the sampling error on the receiving side is added to this, the cumulative error becomes about 45%, and if the waveform distortion is added, the cumulative error becomes close to 50%. When the cumulative error exceeds 50% from the sampling position (the center of the bit), data cannot be sampled correctly, and communication errors such as framing error and parity error occur.

【0029】一部のアプリケーションプログラムには、
データの通信に6MHzや12MHzのボーレート周波
数を必要とするものがある。このようなアプリケーショ
ンプログラムで用いる通信には、ボーレートの16倍の
サンプリング周波数ではなく、ボーレートの4倍のサン
プリング周波数が要求されることがある。このように、
ボーレートの倍率の低いサンプリング周波数を用いる場
合、16倍のように倍率の高いサンプリング周波数を用
いる場合よりも、通信の相手側とのボーレートの誤差の
許容範囲が狭い。
Some application programs include
Some require baud rate frequencies of 6 MHz and 12 MHz for data communication. Communication used in such an application program may require a sampling frequency of four times the baud rate instead of the sampling frequency of 16 times the baud rate. in this way,
When using a sampling frequency with a low baud rate scaling factor, the allowable range of the baud rate error with the other party of communication is narrower than when using a sampling frequency with a high scaling factor of 16 times.

【0030】したがって、上記のようなアプリケーショ
ンプログラムを用いてデータ通信を行う場合、前述のよ
うにサンプリング周波数を48MHz程度に設定して
も、上記のボーレートの誤差が許容範囲を超える虞があ
る。
Therefore, when data communication is performed using the application program as described above, the baud rate error may exceed the allowable range even if the sampling frequency is set to about 48 MHz as described above.

【0031】本発明は、上記の事情に鑑みてなされたも
のであって、スタートビットの検出に用いるサンプリン
グクロックの周波数を高めることなく、サンプリング回
数を増加させることを目的としている。
The present invention has been made in view of the above circumstances, and an object thereof is to increase the number of times of sampling without increasing the frequency of the sampling clock used for detecting the start bit.

【0032】[0032]

【課題を解決するための手段】本発明のデータ入力装置
は、受信したデータ列のスタートビットをサンプリング
クロックのタイミングでスタートビット検出手段によっ
て検出し、サンプリングクロックのタイミングでデータ
列のデータビットを取り込む位相をスタートビットの検
出位相に基づいて決定するデータ入力装置において、上
記の課題を解決するために、上記スタートビット検出手
段が、スタートビットの先頭位相に続く最も近いサンプ
リングクロックの立ち上がり位相または立ち下がり位相
でスタートビットを検出することを特徴とするデータ入
力装置。
In the data input device of the present invention, the start bit of the received data string is detected by the start bit detecting means at the timing of the sampling clock, and the data bit of the data string is fetched at the timing of the sampling clock. In a data input device for determining a phase based on a detected phase of a start bit, in order to solve the above-mentioned problems, the start bit detection means is configured to detect a rising phase or a falling phase of a sampling clock closest to a leading phase of the start bit. A data input device characterized by detecting a start bit in phase.

【0033】上記の構成では、データ列が入力される
と、データ列におけるスタートビットは、その先頭位相
に続く最も近いサンプリングクロックの立ち上がり位相
または立ち下がり位相のいずれかで検出される。具体的
には、そのときのサンプリングクロックの立ち上がりま
たは立ち下がりのエッジでスタートビットの状態をとら
えることによって、スタートビットが検出される。スタ
ートビットの検出以降は、その検出位相を基準としてデ
ータ列の各ビットを取り込むタイミングが決定され、各
ビットの取り込みは、スタートビットを検出したサンプ
リングクロックの立ち上がり位相または立ち下がり位相
で行われる。
In the above configuration, when the data string is input, the start bit in the data string is detected at either the rising phase or the falling phase of the nearest sampling clock following the leading phase. Specifically, the start bit is detected by capturing the state of the start bit at the rising or falling edge of the sampling clock at that time. After the start bit is detected, the timing of loading each bit of the data string is determined based on the detected phase, and each bit is loaded at the rising phase or the falling phase of the sampling clock that detected the start bit.

【0034】このように、サンプリングクロックの立ち
上がり位相または立ち下がり位相でスタートビットを検
出することによって、スタートビットのサンプリング回
数をサンプリングクロックの周波数を高めることなく増
加させることができる。
As described above, by detecting the start bit at the rising phase or the falling phase of the sampling clock, the number of times of sampling the start bit can be increased without increasing the frequency of the sampling clock.

【0035】上記のデータ入力装置において、上記スタ
ートビット検出手段は、スタートビットをサンプリング
クロックの立ち上がり位相と立ち下がり位相とでそれぞ
れ検出する2つの検出部を有し、一方の検出部がスター
トビットを検出すると、他方の検出部によるスタートビ
ットの検出を阻止することが好ましい。
In the above data input device, the start bit detecting means has two detecting sections for detecting the start bit at the rising phase and the falling phase of the sampling clock, and one detecting section detects the start bit. If detected, it is preferable to prevent the detection of the start bit by the other detector.

【0036】このような構成では、サンプリングクロッ
クの立ち上がり位相と立ち下がり位相とで異なる検出部
がスタートビットを検出する。このとき、一方の検出部
がスタートビットを検出すると、他方の検出部がスター
トビットの検出を阻止されるので、一方の検出部がスタ
ートビットを検出したのに、さらに他方の検出部がスタ
ートビットを検出することを防止する。
In such a configuration, the detection section that detects the rising phase and the falling phase of the sampling clock detects the start bit. At this time, when one of the detection units detects the start bit, the other detection unit is prevented from detecting the start bit. Therefore, even if the one detection unit detects the start bit, the other detection unit further detects the start bit. To detect.

【0037】[0037]

【発明の実施の形態】本発明の実施の一形態について図
1ないし図4に基づいて説明すれば、以下の通りであ
る。
BEST MODE FOR CARRYING OUT THE INVENTION An embodiment of the present invention will be described below with reference to FIGS.

【0038】本実施の形態に係るデータ入力装置は、U
ARTを含んでおり、このUARTは、図1に示す受信
回路を含んでいる。
The data input device according to this embodiment is U
The UART includes the receiving circuit shown in FIG. 1.

【0039】本受信回路で受信されるデータ列は、図3
に示す前述の構造になっているので、ここでは、そのデ
ータ列についての説明を省略する。
The data string received by this receiving circuit is shown in FIG.
Since it has the above-mentioned structure shown in, the description of the data string is omitted here.

【0040】図1に示すように、受信回路は、サンプリ
ングクロック発生部1、シリアル/パラレル変換部2、
スタートビット検出部3、キャラクタ終了検出部4およ
びビット位置検出部5を備えている。
As shown in FIG. 1, the receiving circuit includes a sampling clock generator 1, a serial / parallel converter 2,
A start bit detector 3, a character end detector 4, and a bit position detector 5 are provided.

【0041】分周クロック発生部1は、SIO専用発振
器(図中、OSC)1aと、ボーレート発生器1bとを
有している。
The divided clock generator 1 has an SIO dedicated oscillator (OSC in the figure) 1a and a baud rate generator 1b.

【0042】SIO専用発振器1aは、UARTに専用
に設けられた発振器であり、固有のクロックを発生す
る。ボーレート発生器1bは、ボーレートの整数倍の周
波数のクロックを発生するために、上記のクロックを所
定の分周比で分周して、サンプリングクロックSCLK
を出力する。例えば、本データ入力装置においては、正
規のボーレートを12MHzとすると、その4倍の周波
数48MHzのサンプリングクロックSCLKを用い
る。この場合、1ビットをサンプリングクロックSCL
Kの4クロックで転送する。
The SIO dedicated oscillator 1a is an oscillator provided exclusively for the UART and generates a unique clock. The baud rate generator 1b divides the clock into a sampling clock SCLK by dividing the clock with a predetermined division ratio in order to generate a clock having a frequency that is an integral multiple of the baud rate.
Is output. For example, in the present data input device, assuming that the regular baud rate is 12 MHz, the sampling clock SCLK having a frequency of 48 MHz, which is four times that of the regular baud rate, is used. In this case, 1 bit is the sampling clock SCL
Transfer in 4 clocks of K.

【0043】シリアル/パラレル変換部2は、シフトレ
ジスタ2aと、データセレクタ2bと、Dフリップフロ
ップ2cとを有している。
The serial / parallel converter 2 has a shift register 2a, a data selector 2b, and a D flip-flop 2c.

【0044】シフトレジスタ2aは、後述するスタート
ビット検出部3におけるORゲート35からのパルスを
入力クロックとして用い、この入力クロックに同期し
て、受信データTDATAINを順次シフトさせてい
く。
The shift register 2a uses the pulse from the OR gate 35 in the start bit detecting section 3 to be described later as an input clock, and sequentially shifts the reception data TDATAIN in synchronization with this input clock.

【0045】データセレクタ2bは、シフトレジスタ2
aから出力された各データビットが入力される入力端子
“1”と、Dフリップフロップ2cの出力端子Qと接続
される入力端子“0”と、制御端子Sと、出力端子Yと
を有している。このデータセレクタ2bは、後述するビ
ット位置検出部5のNORゲート5bからの“1”の信
号が制御端子Sに入力されると、シフトレジスタ2aか
らの各データビットを出力端子Yから出力する一方、N
ORゲート5bからの“0”の信号が制御端子Sに入力
されると、Dフリップフロップ2cからのデータビット
を出力する。
The data selector 2b is the shift register 2
It has an input terminal "1" to which each data bit output from a is input, an input terminal "0" connected to the output terminal Q of the D flip-flop 2c, a control terminal S, and an output terminal Y. ing. The data selector 2b outputs each data bit from the shift register 2a from the output terminal Y when a "1" signal from the NOR gate 5b of the bit position detection unit 5 described later is input to the control terminal S. , N
When the "0" signal from the OR gate 5b is input to the control terminal S, the data bit is output from the D flip-flop 2c.

【0046】Dフリップフロップ2cは、シフトレジス
タ2aと同様、サンプリングクロックSCLKを入力ク
ロックとして用い、この入力クロックに同期して、デー
タセレクタ2bからのデータビットを保持して、図示し
ないCPUに出力する。
Like the shift register 2a, the D flip-flop 2c uses the sampling clock SCLK as an input clock, holds the data bit from the data selector 2b in synchronization with this input clock, and outputs it to a CPU (not shown). .

【0047】スタートビット検出部3は、第1検出部3
1、第2検出部32、インバータ33、NORゲート3
4およびORゲート35を備えている。第1検出部31
は、スタートビットの立ち上がりエッジから最も近いサ
ンプリングクロックSCLKの立ち上がりエッジに同期
してスタートビットを検出する。第2検出部32は、ス
タートビットの立ち下がりエッジから最も近いサンプリ
ングクロックSCLKの立ち下がりエッジに同期してス
タートビットを検出する。
The start bit detecting section 3 includes the first detecting section 3
1, second detector 32, inverter 33, NOR gate 3
4 and an OR gate 35. First detection unit 31
Detects the start bit in synchronization with the closest rising edge of the sampling clock SCLK from the rising edge of the start bit. The second detection unit 32 detects the start bit in synchronization with the closest falling edge of the sampling clock SCLK from the falling edge of the start bit.

【0048】第1検出部31は、Dフリップフロップ3
1a・31bと、NORゲート31cと、ANDゲート
31dと、JKフリップフロップ31eと、カウンタ3
1fとを有している。
The first detection section 31 includes a D flip-flop 3
1a · 31b, NOR gate 31c, AND gate 31d, JK flip-flop 31e, counter 3
1f and.

【0049】Dフリップフロップ31aの入力端子Dに
は、インバータ33によって反転された受信データTD
ATAINが入力される。Dフリップフロップ31a
は、サンプリングクロックSCLKの立ち上がりエッジ
に同期して反転入力データを保持する。Dフリップフロ
ップ31bの入力端子Dには、Dフリップフロップ31
aの出力端子Qから出力された反転入力データが入力さ
れる。Dフリップフロップ31bは、サンプリングクロ
ックSCLKの立ち上がりエッジに同期してDフリップ
フロップ31aからの反転入力データを保持する。
At the input terminal D of the D flip-flop 31a, the received data TD inverted by the inverter 33 is received.
ATAIN is input. D flip-flop 31a
Holds inverted input data in synchronization with the rising edge of the sampling clock SCLK. The input terminal D of the D flip-flop 31b is connected to the D flip-flop 31
The inverted input data output from the output terminal Q of a is input. The D flip-flop 31b holds the inverted input data from the D flip-flop 31a in synchronization with the rising edge of the sampling clock SCLK.

【0050】NORゲート31cは、Dフリップフロッ
プ31aの反転出力端子からの反転データ、Dフリップ
フロップ31bの出力端子Qからのデータ、ORゲート
35からの出力信号、および後述する第2検出部32に
おけるJKフリップフロップ32eの出力端子Qからの
出力信号が入力される。このNORゲート31cは、こ
れらの論理和否定をとってJKフリップフロップ31e
の一方の入力端子Jに与える。また、ANDゲート31
dは、後述するキャラクタ終了検出部4における一致検
出コンパレータ4bの一致検出信号、ORゲート35か
らの出力信号、およびJKフリップフロップ31eの出
力端子Qからの出力信号が入力される。このANDゲー
ト31dは、これらの論理積をとってJKフリップフロ
ップ31eの他方の入力端子Kに与える。JKフリップ
フロップ31eは、1キャラクタのストップビットから
次のキャラクタのスタートビットへの変化時に出力端子
Qから“0”の信号を出力することでスタートビットを
検出する。
The NOR gate 31c has the inverted data from the inverted output terminal of the D flip-flop 31a, the data from the output terminal Q of the D flip-flop 31b, the output signal from the OR gate 35, and the second detection section 32 described later. The output signal from the output terminal Q of the JK flip-flop 32e is input. The NOR gate 31c takes the logical sum negation of these and outputs the JK flip-flop 31e.
To one input terminal J. Also, the AND gate 31
To d, a match detection signal of the match detection comparator 4b in the character end detection unit 4 described later, an output signal from the OR gate 35, and an output signal from the output terminal Q of the JK flip-flop 31e are input. The AND gate 31d takes the logical product of these and applies it to the other input terminal K of the JK flip-flop 31e. The JK flip-flop 31e detects the start bit by outputting a signal of "0" from the output terminal Q when the stop bit of one character changes to the start bit of the next character.

【0051】2ビットのバイナリカウンタであるカウン
タ31fは、プリセットデータを入力するためのデータ
入力端子A・Bが“0”に固定されており、JKフリッ
プフロップ31eの出力端子Qからロード端子LD*
“0”のロード信号が与えられることによってプリセッ
トデータをロードして、そのプリセットデータからサン
プリングクロックSCLKをカウントする。カウンタ3
1fの下位ビットの出力端子QAは非接続状態(NC)
にあり、上位ビットの出力端子QBはORゲート35の
一方の入力端子に接続されている。このカウンタ31f
は、出力端子QBから、サンプリングクロックSCLK
の4クロックを1周期として2クロックの間隔で“0”
と“1”とを繰り返すパルスを出力する。
In the counter 31f which is a 2-bit binary counter, the data input terminals A and B for inputting preset data are fixed to "0", and the output terminal Q to the load terminal LD * of the JK flip-flop 31e . The preset data is loaded when the load signal of "0" is given to and the sampling clock SCLK is counted from the preset data. Counter 3
The output terminal QA of the lower bit of 1f is not connected (NC)
, And the output terminal QB of the upper bit is connected to one input terminal of the OR gate 35. This counter 31f
Is the sampling clock SCLK from the output terminal QB.
"0" at intervals of 2 clocks with 4 cycles of 1 cycle as 1 cycle
And a pulse that repeats "1" is output.

【0052】第2検出部32は、Dフリップフロップ3
2a・32bと、NORゲート32cと、ANDゲート
32dと、JKフリップフロップ32eと、カウンタ3
2fと、インバータ32gとを有している。
The second detecting section 32 includes a D flip-flop 3
2a and 32b, NOR gate 32c, AND gate 32d, JK flip-flop 32e, and counter 3
It has 2f and the inverter 32g.

【0053】Dフリップフロップ32aの入力端子Dに
は、インバータ33によって反転された受信データTD
ATAINが入力される。Dフリップフロップ32a
は、サンプリングクロックSCLKの立ち下がりエッジ
に同期して反転入力データを保持する。Dフリップフロ
ップ32bの入力端子Dには、Dフリップフロップ32
aの出力端子Qから出力された反転入力データが入力さ
れる。Dフリップフロップ32bは、サンプリングクロ
ックSCLKの立ち下がりエッジに同期してDフリップ
フロップ32aからの反転入力データを保持する。
The received data TD inverted by the inverter 33 is applied to the input terminal D of the D flip-flop 32a.
ATAIN is input. D flip-flop 32a
Holds inverted input data in synchronization with the falling edge of the sampling clock SCLK. The input terminal D of the D flip-flop 32b is connected to the D flip-flop 32
The inverted input data output from the output terminal Q of a is input. The D flip-flop 32b holds the inverted input data from the D flip-flop 32a in synchronization with the falling edge of the sampling clock SCLK.

【0054】NORゲート32cは、Dフリップフロッ
プ32aの反転出力端子からの反転データ、Dフリップ
フロップ32bの出力端子Qからのデータ、JKフリッ
プフロップ32eの出力端子Qからの出力信号、および
前述した第1検出部32におけるJKフリップフロップ
31eの出力端子Qからの出力信号が入力される。この
NORゲート32cは、これらの論理和否定をとってJ
Kフリップフロップ32eの一方の入力端子Jに与え
る。また、ANDゲート32dは、一致検出コンパレー
タ4bの一致検出信号、ORゲート35からの出力信
号、およびJKフリップフロップ32eの出力端子Qか
らの出力信号が入力される。このANDゲート32d
は、これらの論理積をとってJKフリップフロップ32
eの他方の入力端子Kに与える。JKフリップフロップ
32eは、1キャラクタのストップビットから次のキャ
ラクタのスタートビットへの変化時に出力端子Qから
“0”の信号を出力することでスタートビットを検出す
る。
The NOR gate 32c includes the inverted data from the inverted output terminal of the D flip-flop 32a, the data from the output terminal Q of the D flip-flop 32b, the output signal from the output terminal Q of the JK flip-flop 32e, and the above-mentioned first signal. The output signal from the output terminal Q of the JK flip-flop 31e in the 1 detection unit 32 is input. The NOR gate 32c takes the logical sum of these and negates J
It is applied to one input terminal J of the K flip-flop 32e. The AND gate 32d receives the match detection signal from the match detection comparator 4b, the output signal from the OR gate 35, and the output signal from the output terminal Q of the JK flip-flop 32e. This AND gate 32d
Is ANDed to obtain the JK flip-flop 32
It is applied to the other input terminal K of e. The JK flip-flop 32e detects the start bit by outputting a signal of "0" from the output terminal Q when the stop bit of one character changes to the start bit of the next character.

【0055】2ビットのバイナリカウンタであるカウン
タ32fは、プリセットデータを入力するためのデータ
入力端子A・Bが“0”に固定されており、JKフリッ
プフロップ32eの出力端子Qからロード端子LD*
ロード信号が与えられることによってプリセットデータ
をロードして、そのプリセットデータからサンプリング
クロックSCLKをカウントする。カウンタ32fの下
位ビットの出力端子QAは非接続状態(NC)にあり、
上位ビットの出力端子QBはORゲート35の他方の入
力端子に接続されている。このカウンタ32fは、出力
端子QBから、サンプリングクロックSCLKの4クロ
ックを1周期として2クロックの間隔で“0”と“1”
とを繰り返すパルスを出力する。
The counter 32f, which is a 2-bit binary counter, has data input terminals A and B for inputting preset data fixed to "0", and the output terminal Q to the load terminal LD * of the JK flip-flop 32e . Is loaded with preset data, and the sampling clock SCLK is counted from the preset data. The output terminal QA of the lower bit of the counter 32f is in the non-connection state (NC),
The output terminal QB of the upper bit is connected to the other input terminal of the OR gate 35. The counter 32f has "0" and "1" at intervals of 2 clocks from the output terminal QB with 4 clocks of the sampling clock SCLK as one cycle.
A pulse that repeats and is output.

【0056】ORゲート35は、カウンタ31f・32
fの両出力端子QBからのビットデータの論理和をと
る。また、NORゲート34は、JKフリップフロップ
31e・32eの反転出力端子からの出力信号の論理和
否定をとる。
The OR gate 35 includes counters 31f and 32.
The bit data from both output terminals QB of f are ORed. Further, the NOR gate 34 takes the logical sum of the output signals from the inverting output terminals of the JK flip-flops 31e and 32e.

【0057】また、Dフリップフロップ31a・31b
・32a・32bおよびJKフリップフロップ31e・
32eは、それぞれのクリア端子Rにリセット信号RE
SET*が与えられることによってクリアされる。リセ
ット信号RESET*は、本データ入力装置を搭載した
システムで用いられるリセット信号であり、パワーオン
時などに発生する。
Also, the D flip-flops 31a and 31b
32a and 32b and JK flip-flop 31e
32e is a reset signal RE to each clear terminal R
Cleared by giving SET * . The reset signal RESET * is a reset signal used in a system equipped with this data input device, and is generated at the time of power-on.

【0058】上記のスタートビット検出部3は、前のキ
ャラクタのストップビットから次のキャラクタのスター
トビットへの変化をとらえて、スタートビットを検出す
る。JKフリップフロップ31e・32eは、出力端子
Qからの出力を、ストップビットの終了時に“0”に変
化させ、スタートビットの検出時に“1”に変化させた
後はストップビットの終了まで“1”に維持する。
The start bit detecting section 3 detects the start bit by catching the change from the stop bit of the previous character to the start bit of the next character. The JK flip-flops 31e and 32e change the output from the output terminal Q to "0" at the end of the stop bit and to "1" at the detection of the start bit, and then to "1" until the end of the stop bit. To maintain.

【0059】キャラクタ終了検出部4は、全加算器4a
と、一致検出コンパレータ4bとを有している。
The character end detection unit 4 uses the full adder 4a.
And a coincidence detection comparator 4b.

【0060】全加算器4aは、入力端子Aに入力される
パリティビットデータPARITYと、入力端子Bに入
力されるストップビットデータTwoSTPと、キャリ
ーイン端子に入力される8ビットデータBit8とを加
算する回路である。全加算器4aは、その和の下位ビッ
トを出力端子SUMから出力する一方、その和の上位ビ
ットをキャリーアウト端子COUTから出力する。
The full adder 4a adds the parity bit data PARITY input to the input terminal A, the stop bit data TwoSTP input to the input terminal B, and the 8-bit data Bit8 input to the carry-in terminal. Circuit. The full adder 4a outputs the lower bit of the sum from the output terminal SUM, and outputs the upper bit of the sum from the carry-out terminal COUT.

【0061】上記のパリティビットデータPARITY
は、キャラクタがパリティビットを含むときに“1”で
あり、キャラクタがパリティビットを含まないときに
“0”である。上記のストップビットデータTwoST
Pは、キャラクタに含まれるストップビットが2つであ
るときに“1”であり、キャラクタに含まれるストップ
ビットが1つであるときに“0”である。上記の8ビッ
トデータBit8は、キャラクタに含まれるデータビッ
トが8ビットであるときに“1”であり、キャラクタに
含まれるデータビットが7ビットであるときに“0”で
ある。これらのデータは、図示しないレジスタに格納さ
れており、そこから全加算器4aに与えられている。
Parity bit data PARITY
Is "1" when the character includes a parity bit, and "0" when the character does not include a parity bit. Stop bit data TwoST above
P is "1" when the character has two stop bits and is "0" when the character has one stop bit. The 8-bit data Bit8 is "1" when the data bit included in the character is 8 bits and "0" when the data bit included in the character is 7 bits. These data are stored in a register (not shown) and are given to the full adder 4a from there.

【0062】全加算器4aは、各入力データの値の総和
を演算することによって、1キャラクタのビット長を決
定する。ここで、図3に示す1キャラクタ(12ビット
長)の場合、全加算器4aでは、これらの総和である
“3”(2ビットで“11”)が演算され、その結果と
して、キャリーアウト端子COUTから“1”が出力さ
れ、出力端子SUMから“1”が出力される。
The full adder 4a determines the bit length of one character by calculating the sum of the values of each input data. Here, in the case of 1 character (12-bit length) shown in FIG. 3, the full adder 4a calculates the sum "3" (2 bits "11"), and as a result, the carry-out terminal "1" is output from COUT and "1" is output from the output terminal SUM.

【0063】一致検出コンパレータ4bは、一方の比較
入力として、全加算器4aの上記の2値が下位の2ビッ
トとして入力され、さらに最上位ビットの入力値が
“1”に固定されている。また、他方の比較入力とし
て、後述するビット位置検出部5のカウンタ5aの出力
端子QA・QB・QDからの出力信号が、それぞれ最下
位ビット、中位ビット、最上位ビットとして入力されて
いる。カウンタ5aからのこれらの出力信号は、後述す
るように、1キャラクタの各ビットを検出した結果を示
している。したがって、一致検出コンパレータ4bは、
カウンタ5aからの上記の出力信号が(1,1,1)に
なったとき、1キャラクタの第12ビットが検出され
て、両比較入力が一致すると、一致検出端子より“1”
を出力し、両比較入力が一致しないと、一致検出端子よ
り“0”を出力する。
The coincidence detection comparator 4b receives the above two values of the full adder 4a as lower two bits as one comparison input, and the input value of the most significant bit is fixed to "1". Further, as the other comparison input, output signals from output terminals QA, QB, QD of a counter 5a of a bit position detection unit 5 which will be described later are input as the least significant bit, the middle significant bit, and the most significant bit, respectively. These output signals from the counter 5a indicate the result of detecting each bit of one character, as described later. Therefore, the match detection comparator 4b
When the output signal from the counter 5a becomes (1,1,1), the 12th bit of one character is detected, and when both comparison inputs match, "1" is output from the match detection terminal.
When both comparison inputs do not match, "0" is output from the match detection terminal.

【0064】ビット位置検出部5は、カウンタ5aと、
NORゲート5bと、インバータ5c・5dとを有して
いる。
The bit position detector 5 includes a counter 5a,
It has a NOR gate 5b and inverters 5c and 5d.

【0065】4ビットのバイナリカウンタであるカウン
タ5aにおいて、プリセットデータを入力するためのデ
ータ入力端子A〜Dが“0”に固定されている。カウン
タ5aは、前述のリセット信号RESET*によってク
リアされる。また、カウンタ5aには、前述のスタート
ビット検出部3におけるNORゲート34からロード端
子LD*にロード信号が与えられることによってプリセ
ットデータをロードして、そのプリセットデータから前
述のORゲート35から出力されるパルスをカウントす
る。このパルスは、前述のように、サンプリングクロッ
クSCLKの4クロック分を1周期とするクロックであ
る。
In the counter 5a which is a 4-bit binary counter, the data input terminals A to D for inputting preset data are fixed to "0". The counter 5a is cleared by the above-mentioned reset signal RESET * . Further, the preset data is loaded into the counter 5a by applying a load signal to the load terminal LD * from the NOR gate 34 in the start bit detection unit 3 described above, and the preset data is output from the OR gate 35 described above. Pulse counts. As described above, this pulse is a clock whose period is four clocks of the sampling clock SCLK.

【0066】NORゲート5bには、カウンタ5aの出
力端子QA・QDからの出力信号がそれぞれインバータ
5c・5dによって反転されて入力されるとともに、出
力端子QB・QCからの出力信号が入力されている。こ
のNORゲート5bは、カウンタ5aのカウント値が
“9”になって、4つの入力値が全て“0”になると、
“1”の信号を出力し、カウンタ5aのカウント値がそ
れ以外のときには“0”の信号を出力する。
To the NOR gate 5b, the output signals from the output terminals QA and QD of the counter 5a are inverted and input by the inverters 5c and 5d, respectively, and the output signals from the output terminals QB and QC are input. . In the NOR gate 5b, when the count value of the counter 5a becomes "9" and all four input values become "0",
A signal of "1" is output, and a signal of "0" is output when the count value of the counter 5a is other than that.

【0067】上記のカウンタ5aは、前述のリセット信
号RESET*によってクリアされる。
The counter 5a is cleared by the reset signal RESET * described above.

【0068】ここで、上記のように構成される受信回路
の動作について説明する。
Now, the operation of the receiving circuit configured as described above will be described.

【0069】まず、スタートビット検出部3において、
入力されてきたデータTDATAINのスタートビット
が検出される。図2(a)に示すように、入力されてき
たデータTDATAINの先頭位相Hがサンプリングク
ロックSCLKの立ち下がりエッジとそれに続く立ち上
がりエッジとの間にあれば(または、その立ち下がりエ
ッジと同期していれば)、第1検出部31によってスタ
ートビットを検出し、図2(b)に示すように、上記の
先頭位相HがサンプリングクロックSCLKの立ち上が
りエッジとそれに続く立ち下がりエッジとの間にあれば
(または、その立ち上がりエッジと同期していれば)、
第2検出部32によってスタートビットを検出する。
First, in the start bit detecting section 3,
The start bit of the input data TDATAIN is detected. As shown in FIG. 2A, if the leading phase H of the input data TDATAIN is between the trailing edge and the trailing rising edge of the sampling clock SCLK (or in synchronization with the trailing edge). Then, the start bit is detected by the first detector 31, and if the leading phase H is between the rising edge of the sampling clock SCLK and the trailing edge thereof as shown in FIG. (Or if it is synchronized with its rising edge),
The second detector 32 detects the start bit.

【0070】まず、第1検出部31によってスタートビ
ットを検出する場合について説明する。
First, the case where the first detection section 31 detects the start bit will be described.

【0071】第1検出部31において、各キャラクタの
最終のストップビットは、インバータ33で反転されて
“0”となってDフリップフロップ31aに入力され、
保持された後、Dフリップフロップ31bに入力され
る。また、Dフリップフロップ31aの反転出力端子か
らの反転データ(“1”)が、NORゲート31cに入
力される。Dフリップフロップ31aで保持された反転
のストップビットは、Dフリップフロップ31bでも同
様に保持されて1クロック遅延して出力される。このと
き、Dフリップフロップ31a・31bは、サンプリン
グクロックSCLKの立ち上がりに同期して出力の状態
を変化させる。
In the first detection section 31, the final stop bit of each character is inverted by the inverter 33 and becomes "0", which is input to the D flip-flop 31a.
After being held, it is input to the D flip-flop 31b. The inverted data (“1”) from the inverted output terminal of the D flip-flop 31a is input to the NOR gate 31c. The inverted stop bit held in the D flip-flop 31a is also held in the D flip-flop 31b in the same manner and is delayed by one clock and output. At this time, the D flip-flops 31a and 31b change the output state in synchronization with the rising of the sampling clock SCLK.

【0072】Dフリップフロップ31bからNORゲー
ト31cには、Dフリップフロップ31aの反転出力端
子からの反転データ(“1”)と、同じタイミングで
“0”となるDフリップフロップ31bからの出力信号
が入力される。また、このとき、カウンタ31fは、ス
タートビットの検出からサンプリングクロックSCLK
をカウントし続けて、出力端子QBから前述のパルスを
出力しており、このパルスもNORゲート31cに入力
される。しかしながら、このとき、第2検出部32にお
けるJKフリップフロップ32eはセット状態を維持し
ており、出力端子Qからの信号が“1”である。したが
って、NORゲート31cからJKフリップフロップ3
1eの入力端子Jには、“0”の信号が入力される。
From the D flip-flop 31b to the NOR gate 31c, the inverted data ("1") from the inversion output terminal of the D flip-flop 31a and the output signal from the D flip-flop 31b which becomes "0" at the same timing. Is entered. Further, at this time, the counter 31f detects the start bit and then starts sampling clock SCLK.
The pulse is continuously output from the output terminal QB, and this pulse is also input to the NOR gate 31c. However, at this time, the JK flip-flop 32e in the second detection unit 32 maintains the set state, and the signal from the output terminal Q is "1". Therefore, from the NOR gate 31c to the JK flip-flop 3
A signal "0" is input to the input terminal J of 1e.

【0073】一方、このとき、ANDゲート31dに
は、一致検出コンパレータ4bからの“1”の一致検出
信号が入力される。また、ANDゲート31dには、カ
ウンタ31fからの“0”と“1”の信号が交互に入力
される。したがって、ANDゲート31dは、全ての入
力が“1”となったときに、JKフリップフロップ31
eの入力端子Kに“1”の信号を与える。
On the other hand, at this time, the coincidence detection signal of "1" from the coincidence detection comparator 4b is input to the AND gate 31d. Further, the AND gate 31d is alternately input with the signals "0" and "1" from the counter 31f. Therefore, the AND gate 31d, when all the inputs become "1", the JK flip-flop 31d.
A signal of "1" is applied to the input terminal K of e.

【0074】これにより、JKフリップフロップ32e
は、出力端子Qから“1”を出力して、前の状態(セッ
ト状態)からリセット状態に変化する。
As a result, the JK flip-flop 32e
Outputs "1" from the output terminal Q and changes from the previous state (set state) to the reset state.

【0075】1キャラクタの入力が終了して、次のキャ
ラクタが入力されると、その第1ビットとしてスタート
ビットがスタートビット検出部3に入力される。スター
トビットは、インバータ33で反転されて“1”となっ
てDフリップフロップ31aに入力され、保持された
後、Dフリップフロップ31bに入力される。また、D
フリップフロップ31aの反転出力端子からの反転デー
タ(“0”)が、NORゲート31cに入力される。D
フリップフロップ31aで保持された反転のスタートビ
ットは、Dフリップフロップ31bでも同様に保持され
て1クロック遅延して出力される。
When the input of one character is completed and the next character is input, the start bit is input to the start bit detector 3 as the first bit. The start bit is inverted by the inverter 33 and becomes "1", which is input to the D flip-flop 31a, held, and then input to the D flip-flop 31b. Also, D
The inverted data (“0”) from the inverted output terminal of the flip-flop 31a is input to the NOR gate 31c. D
The inverted start bit held in the flip-flop 31a is also held in the D flip-flop 31b and delayed by one clock before being output.

【0076】このため、Dフリップフロップ31bから
NORゲート31cには、Dフリップフロップ31aの
反転出力端子からの反転データ(“0”)と、同じタイ
ミングで“0”となるDフリップフロップ31bからの
出力信号が入力される。また、このとき、カウンタ31
fは、前のストップビットの終了からサンプリングクロ
ックSCLKをカウントし続けており、出力端子QBか
ら前述のパルスを出力している。しかしながら、このと
き、第2検出部32のJKフリップフロップ32eが、
JKフリップフロップ31eから半クロック遅れたタイ
ミングでストップビットの終了時に出力端子Qから
“0”の信号を出力する。したがって、NORゲート3
1cは、その他の入力値が“0”となったときにJKフ
リップフロップ31eの入力端子Jに“1”の信号を出
力する。
Therefore, from the D flip-flop 31b to the NOR gate 31c, the inverted data ("0") from the inverted output terminal of the D flip-flop 31a and the D flip-flop 31b which becomes "0" at the same timing. The output signal is input. At this time, the counter 31
f continues counting the sampling clock SCLK from the end of the previous stop bit, and outputs the above-mentioned pulse from the output terminal QB. However, at this time, the JK flip-flop 32e of the second detector 32 is
The signal "0" is output from the output terminal Q at the end of the stop bit at a timing delayed by a half clock from the JK flip-flop 31e. Therefore, NOR gate 3
1c outputs a signal of "1" to the input terminal J of the JK flip-flop 31e when the other input values become "0".

【0077】一方、このとき、ANDゲート31dに
は、一致検出コンパレータ4bからの“0”の信号と、
ORゲート35からのパルスと、“0”となるJKフリ
ップフロップ31eの出力端子Qからの出力信号とが入
力される。このため、ANDゲート31dは、“0”の
信号を出力し、JKフリップフロップ31eの入力端子
Kに与える。
On the other hand, at this time, the AND gate 31d outputs the signal "0" from the coincidence detection comparator 4b,
The pulse from the OR gate 35 and the output signal from the output terminal Q of the JK flip-flop 31e which becomes "0" are input. Therefore, the AND gate 31d outputs a signal of "0" and supplies it to the input terminal K of the JK flip-flop 31e.

【0078】これにより、JKフリップフロップ31e
は、出力端子Qから“1”を出力してセット状態とな
る。このとき、スタートビットは、図2(a)に示すよ
うに、検出タイミングTs(検出位相)で検出される。
As a result, the JK flip-flop 31e
Outputs "1" from the output terminal Q and enters the set state. At this time, the start bit is detected at the detection timing Ts (detection phase) as shown in FIG.

【0079】続いて、第2検出部32によってスタート
ビットを検出する場合について説明する。
Next, the case where the start bit is detected by the second detector 32 will be described.

【0080】第2検出部32において、各キャラクタの
最終のストップビットは、インバータ33で反転されて
“0”となってDフリップフロップ32aに入力され、
保持された後、Dフリップフロップ32bに入力され
る。また、Dフリップフロップ32aの反転出力端子か
らの反転データ(“1”)が、NORゲート32cに入
力される。Dフリップフロップ31aで保持された反転
のストップビットは、Dフリップフロップ31bでも同
様に保持されて1クロック遅延して出力される。このと
き、Dフリップフロップ32a・32bは、サンプリン
グクロックSCLKの立ち下がりに同期して出力の状態
を変化させる。
In the second detection section 32, the final stop bit of each character is inverted by the inverter 33 and becomes "0", which is input to the D flip-flop 32a.
After being held, it is input to the D flip-flop 32b. The inverted data (“1”) from the inverted output terminal of the D flip-flop 32a is input to the NOR gate 32c. The inverted stop bit held in the D flip-flop 31a is also held in the D flip-flop 31b in the same manner and is delayed by one clock and output. At this time, the D flip-flops 32a and 32b change the output state in synchronization with the fall of the sampling clock SCLK.

【0081】Dフリップフロップ32bからNORゲー
ト32cには、Dフリップフロップ32aの反転出力端
子からの反転データ(“1”)と、同じタイミングで
“0”となるDフリップフロップ32bからの出力信号
が入力される。また、このとき、JKフリップフロップ
32eは、前述のJKフリップフロップ32eと同様、
ストップビットの終了まではセット状態を維持するの
で、NORゲート31cに“1”の信号を与える。さら
に、第1検出部31のJKフリップフロップ31eがセ
ット状態にあるために、出力端子Qから“1”の信号を
出力している。したがって、NORゲート32cからJ
Kフリップフロップ32eの入力端子Jには、“0”の
信号が入力される。
From the D flip-flop 32b to the NOR gate 32c, the inverted data ("1") from the inverted output terminal of the D flip-flop 32a and the output signal from the D flip-flop 32b which becomes "0" at the same timing. Is entered. At this time, the JK flip-flop 32e is similar to the JK flip-flop 32e described above.
Since the set state is maintained until the end of the stop bit, the NOR gate 31c is supplied with the signal "1". Further, since the JK flip-flop 31e of the first detector 31 is in the set state, the output terminal Q outputs a signal of "1". Therefore, NOR gates 32c to J
The signal “0” is input to the input terminal J of the K flip-flop 32e.

【0082】一方、このとき、ANDゲート32dに
は、一致検出コンパレータ4bからの“1”の一致検出
信号が入力される。また、ANDゲート32dには、カ
ウンタ32fからちの“0”と“1”の信号が交互に入
力される。したがって、ANDゲート32dは、全ての
入力が“1”となったときに、JKフリップフロップ3
2eの入力端子Kに“1”の信号を与える。
On the other hand, at this time, the coincidence detection signal of "1" from the coincidence detection comparator 4b is input to the AND gate 32d. Further, the "0" and "1" signals from the counter 32f are alternately input to the AND gate 32d. Therefore, the AND gate 32d, when all the inputs become "1", the JK flip-flop 3
A signal of "1" is given to the input terminal K of 2e.

【0083】これにより、JKフリップフロップ32e
は、出力端子Qから“1”を出力して前の状態(セット
状態)からリセット状態に変化する。
As a result, the JK flip-flop 32e
Outputs "1" from the output terminal Q and changes from the previous state (set state) to the reset state.

【0084】1キャラクタの入力が終了して、次のキャ
ラクタが入力されると、その第1ビットとしてスタート
ビットがスタートビット検出部3に入力される。スター
トビットは、インバータ33で反転されて“1”となっ
てDフリップフロップ32aに入力され、保持された
後、Dフリップフロップ32bに入力される。また、D
フリップフロップ32aの反転出力端子からの反転デー
タ(“0”)が、NORゲート32cに入力される。D
フリップフロップ32aで保持された反転のスタートビ
ットは、Dフリップフロップ32bでも同様に保持され
て1クロック遅延して出力される。
When the input of one character is completed and the next character is input, the start bit is input to the start bit detector 3 as the first bit. The start bit is inverted by the inverter 33 and becomes "1", which is input to the D flip-flop 32a, held, and then input to the D flip-flop 32b. Also, D
The inverted data (“0”) from the inverted output terminal of the flip-flop 32a is input to the NOR gate 32c. D
The inverted start bit held in the flip-flop 32a is also held in the D flip-flop 32b and delayed by one clock before being output.

【0085】このため、Dフリップフロップ32bから
NORゲート32cには、Dフリップフロップ32aの
反転出力端子からの反転データ(“0”)と、同じタイ
ミングで“0”となるDフリップフロップ32bからの
出力信号が入力される。また、このとき、第1検出部3
1のJKフリップフロップ31eが、JKフリップフロ
ップ32eより半クロック進んだタイミングでストップ
ビットの終了時に出力端子Qから“0”の信号を出力す
る。また、このとき、JKフリップフロップ32eが、
前述のJKフリップフロップ31eから半クロック遅れ
たタイミングでストップビットの終了時に出力端子Qか
ら“0”の信号を出力する。したがって、NORゲート
31cは、JKフリップフロップ32eの入力端子Jに
“1”の信号を出力する。
Therefore, from the D flip-flop 32b to the NOR gate 32c, the inverted data ("0") from the inverted output terminal of the D flip-flop 32a and the D flip-flop 32b which becomes "0" at the same timing. The output signal is input. At this time, the first detection unit 3
The JK flip-flop 31e of 1 outputs the signal of “0” from the output terminal Q at the end of the stop bit at the timing half clock advanced from the JK flip-flop 32e. At this time, the JK flip-flop 32e
A signal of "0" is output from the output terminal Q at the end of the stop bit at a timing delayed by a half clock from the JK flip-flop 31e. Therefore, the NOR gate 31c outputs the signal "1" to the input terminal J of the JK flip-flop 32e.

【0086】一方、このとき、ANDゲート32dに
は、一致検出コンパレータ4bからの“0”の信号と、
ORゲート35からのパルスと、“0”となるJKフリ
ップフロップ32eの出力端子Qからの出力信号とが入
力される。このため、ANDゲート32dは、“0”の
信号を出力し、JKフリップフロップ32eの入力端子
Kに与える。
On the other hand, at this time, the AND gate 32d receives the signal "0" from the coincidence detection comparator 4b,
The pulse from the OR gate 35 and the output signal from the output terminal Q of the JK flip-flop 32e which becomes "0" are input. Therefore, the AND gate 32d outputs a signal of "0" and supplies it to the input terminal K of the JK flip-flop 32e.

【0087】これにより、JKフリップフロップ32e
は、出力端子Qから“1”を出力し、セット状態とな
る。このとき、スタートビットは、図2(b)に示すよ
うに、検出タイミングTs(検出位相)で検出される。
As a result, the JK flip-flop 32e
Outputs "1" from the output terminal Q and enters the set state. At this time, the start bit is detected at the detection timing Ts (detection phase) as shown in FIG.

【0088】このように、第1および第2検出部31・
32においては、前のキャラクタのストップビットから
次のキャラクタのスタートビットへの変化をとらえるこ
とによって、スタートビットが検出される。また、スタ
ートビットの位相に応じて、サンプリングクロックSC
LKのクロックの立ち上がりエッジまたは立ち下がりエ
ッジのうち、スタートビットの開始位置(先頭位相)か
ら最も近い方に同期してスタートビットの検出が行われ
る。
In this way, the first and second detection parts 31
At 32, the start bit is detected by capturing the change from the stop bit of the previous character to the start bit of the next character. In addition, depending on the phase of the start bit, the sampling clock SC
The start bit is detected in synchronization with the rising edge or the falling edge of the LK clock that is closest to the start position (start phase) of the start bit.

【0089】第1検出部31がスタートビットを検出す
ると、JKフリップフロップ31eの出力端子Qから出
力される“1”の信号が第2検出部32のNORゲート
ゲート32cに与えられる。これは、第1検出部31で
同じキャラクタのストップビットの終了が検出されるま
で維持される。したがって、JKフリップフロップ32
eは、ストップビットの終了時にリセットされても、次
のキャラクタのスタートビット入力時にJKフリップフ
ロップ31eのセット状態が維持されるため、リセット
状態に移行することかできない。
When the first detector 31 detects the start bit, the signal "1" output from the output terminal Q of the JK flip-flop 31e is given to the NOR gate gate 32c of the second detector 32. This is maintained until the first detection unit 31 detects the end of the stop bit of the same character. Therefore, the JK flip-flop 32
Even if e is reset at the end of the stop bit, the set state of the JK flip-flop 31e is maintained when the start bit of the next character is input, so that the reset state cannot be entered.

【0090】一方、第2検出部32がスタートビットを
検出すると、JKフリップフロップ32eの出力端子Q
から出力される“1”の信号が第1検出部31のNOR
ゲートゲート31cに与えられる。これは、第2検出部
32で同じキャラクタのストップビットの終了が検出さ
れるまで維持される。したがって、JKフリップフロッ
プ31eは、ストップビットの終了時にリセットされて
も、次のキャラクタのスタートビット入力時にJKフリ
ップフロップ32eのセット状態が維持されるため、リ
セット状態に移行することかできない。
On the other hand, when the second detector 32 detects the start bit, the output terminal Q of the JK flip-flop 32e.
The signal of “1” output from the NOR of the first detection unit 31
It is given to the gate 31c. This is maintained until the second detector 32 detects the end of the stop bit of the same character. Therefore, even if the JK flip-flop 31e is reset at the end of the stop bit, the set state of the JK flip-flop 32e is maintained when the start bit of the next character is input, and thus the JK flip-flop 31e cannot shift to the reset state.

【0091】このように、第1または第2検出部31・
32のいずれか一方がスタートビットを検出すれば、他
方でのスタートビットの検出を阻止するようにJKフリ
ップフロップをリセットする。これにより、上記のよう
に、データTDATAINの位相に応じて、第1または
第2検出部31・32のいずれか一方でスタートビット
の検出が行われるときに、他方のスタートビットの検出
機能が停止するので、第1および第2検出部31・32
がともにスタートビットを検出するという不都合はな
い。
As described above, the first or second detector 31.
If either one of the 32 detects a start bit, the JK flip-flop is reset so as to prevent the other start bit from being detected. As a result, as described above, when the start bit is detected by one of the first and second detectors 31 and 32 according to the phase of the data TDATAIN, the detection function of the other start bit is stopped. Therefore, the first and second detectors 31 and 32 are
Both have no inconvenience of detecting the start bit.

【0092】上記のようにして行われるスタートビット
検出部3によるスタートビット(第1ビット)が検出さ
れるときには、JKフリップフロップ31e・32eの
いずれかの反転出力端子から“1”の信号が出力され
る。このとき、NORゲート34は、いずれか一方の入
力が“1”となったとき、“0”の信号を出力する。こ
の信号は、カウンタ5aのロード端子LD*に入力され
る。
When the start bit (first bit) is detected by the start bit detector 3 performed as described above, a signal of "1" is output from any of the inverting output terminals of the JK flip-flops 31e and 32e. To be done. At this time, the NOR gate 34 outputs a signal of "0" when one of the inputs becomes "1". This signal is input to the load terminal LD * of the counter 5a.

【0093】ビット位置検出部5において、カウンタ5
aは、上記の信号がロード端子LD *に入力されること
によって、4ビットのプリセット値(0,0,0,0)
をロードして、その値からカウントを開始する。カウン
タ5aの出力端子QA・QB・QDからの値がすべて
“1”となるとき、すなわち第11ビットに対応する値
となるとき、前述のように、一致検出コンパレータ4b
がストップビットを“0”の一致検出信号によって検出
する。
In the bit position detector 5, the counter 5
In the case of a, the above signal is the load terminal LD. *Be entered in
4-bit preset value (0,0,0,0)
Load and start counting from that value. Coun
The values from the output terminals QA, QB, QD of the controller 5a are all
When it becomes "1", that is, the value corresponding to the 11th bit
Then, as described above, the coincidence detection comparator 4b
Detects the stop bit by the match detection signal of "0"
To do.

【0094】また、出力端子QA〜QDからの値によっ
て構成される4ビットのカウント値がデータ列の第9ビ
ットに対応する(1,0,0,1)となるとき、出力端
子QA・QDからの値がそれぞれインバータ5c・5d
によって反転する。これにより、NORゲート5bに入
力される値が全て“0”となるので、NORゲート5b
からは“1”の信号が出力される。これにより、最終デ
ータのビット位置(第9ビット)が検出される。また、
それ以外の期間では、NORゲート5bからは、“0”
の信号が出力される。
Further, when the 4-bit count value formed by the values from the output terminals QA to QD becomes (1, 0, 0, 1) corresponding to the 9th bit of the data string, the output terminals QA and QD The values from are inverters 5c and 5d, respectively.
Flip by. As a result, all the values input to the NOR gate 5b become "0", so the NOR gate 5b
Outputs a signal of "1". As a result, the bit position (9th bit) of the final data is detected. Also,
In the other periods, the NOR gate 5b outputs "0".
Signal is output.

【0095】シリアル/パラレル変換部2において、サ
ンプリングクロックSCLKの4クロック当たりに1ビ
ットのレートで転送されてくるデータTDATAIN
は、ORゲート35からのパルスのタイミングに同期し
て1ビットずつシフトレジスタ2aにおいてシフトして
いく。“1”の信号がNORゲート5bから出力される
とき、最終データビット(図3のD7)がシフトレジス
タ2aに取り込まれている。
In the serial / parallel converter 2, data TDATAIN transferred at a rate of 1 bit per 4 clocks of the sampling clock SCLK.
Shifts bit by bit in the shift register 2a in synchronization with the timing of the pulse from the OR gate 35. When the "1" signal is output from the NOR gate 5b, the final data bit (D7 in FIG. 3) is captured in the shift register 2a.

【0096】この状態で、データセレクタ2bは、シフ
トレジスタ2aからのパラレルデータをDフリップフロ
ップ2cに出力する。一方、データセレクタ2bは、N
ORゲート5bからの信号が“0”のとき、Dフリップ
フロップ2cに保持されたパラレルデータから戻されて
きたパラレルデータをDフリップフロップ2cに出力す
る。このようにして、シリアル/パラレル変換部2は、
入力されたシリアルのデータTDATAINから1キャ
ラクタにおけるデータビットのみをパラレルに変換して
出力し、データビットの全てがシフトレジスタ2aに取
り込まれるまでは、Dフリップフロップ2cに保持され
たパラレルデータを出力し続ける。
In this state, the data selector 2b outputs the parallel data from the shift register 2a to the D flip-flop 2c. On the other hand, the data selector 2b has N
When the signal from the OR gate 5b is "0", the parallel data returned from the parallel data held in the D flip-flop 2c is output to the D flip-flop 2c. In this way, the serial / parallel converter 2
From the input serial data TDATAIN, only the data bit in one character is converted to parallel and output, and the parallel data held in the D flip-flop 2c is output until all the data bits are captured in the shift register 2a. to continue.

【0097】ここで、前述のように、2ビットバイナリ
カウンタであるカウンタ31f・32fは、サンプリン
グクロックSCLKをカウントして、4クロック分を1
周期とするパルスを出力端子QBから出力する。したが
って、このパルスの1周期の前半(2クロック分)は
“0”であり、後半(2クロック分)は“1”である。
そして、カウンタ5aが上記のパルスをカウントするこ
とによって、2クロック後に第1ビットのカウントが始
まり、それ以降は4クロック毎にカウント値が更新され
ていく。これにより、NORゲート5bからの“1”の
信号は、各データビットのほぼ中央位置(3クロック
目)で“0”から変化する。したがって、シフトレジス
タ2aからのパラレルデータの各データビットは、図2
(a)および(b)に示すように、それぞれほぼ中央位
置となるデータ取込タイミングTd(取込位相)でCP
Uに取り込まれていく。
Here, as described above, the counters 31f and 32f, which are 2-bit binary counters, count the sampling clock SCLK and count four clocks as one.
A pulse having a cycle is output from the output terminal QB. Therefore, the first half (2 clocks) of one cycle of this pulse is "0", and the second half (2 clocks) is "1".
Then, the counter 5a counts the above-mentioned pulse, so that counting of the first bit starts after two clocks, and thereafter, the count value is updated every four clocks. As a result, the "1" signal from the NOR gate 5b changes from "0" at approximately the central position (third clock) of each data bit. Therefore, each data bit of the parallel data from the shift register 2a is
As shown in (a) and (b), the CP is acquired at the data acquisition timing Td (acquisition phase), which is approximately at the center position.
It is taken in by U.

【0098】以上に述べたように、本実施の形態のデー
タ入力装置では、スタートビット検出部3において、第
1検出部31を備えることによって、スタートビットを
その先頭位相から最も近いサンプリングクロックSCL
Kの立ち上がりエッジ(立ち上がり位相)でとらえて検
出する一方、第2検出部32を備えることによって、ス
タートビットをその先頭位相から最も近いサンプリング
クロックSCLKの立ち下がりエッジ(立ち下がり位
相)でとらえて検出する。
As described above, in the data input device according to the present embodiment, the start bit detecting section 3 is provided with the first detecting section 31, so that the start bit is closest to the sampling clock SCL.
While detecting by detecting the rising edge (rising phase) of K, by including the second detection unit 32, the start bit is detected by detecting the falling edge (falling phase) of the sampling clock SCLK closest to the leading phase thereof. To do.

【0099】これにより、データTDATAINの先頭
位相がクロックの立ち上がりエッジの直前にあれば、第
1検出部31によってスタートビットを検出し、上記の
先頭位相がクロックの立ち下がりエッジの直前にあれ
ば、第2検出部32によってスタートビットを検出す
る。このように、サンプリングクロックの立ち上がりエ
ッジまたは立ち下がりエッジによってスタートビットを
検出することによって、サンプリングクロックSCLK
の周波数を高めることなく、サンプリング回数を2倍に
増加させることができる。
Accordingly, if the leading phase of the data TDATAIN is immediately before the rising edge of the clock, the first detecting section 31 detects the start bit, and if the leading phase is immediately before the falling edge of the clock, The second detector 32 detects the start bit. Thus, by detecting the start bit by the rising edge or falling edge of the sampling clock, the sampling clock SCLK
The number of times of sampling can be doubled without increasing the frequency of.

【0100】したがって、6MHzや12MHzといっ
たボーレートを必要とする一部のアプリケーションプロ
グラムを用いてデータ通信を行う際に、サンプリング周
波数に対するボーレートの倍率が低い場合(例えば4
倍)、通信の相手となる送信側とのボーレートの誤差を
許容範囲内に抑えることができる。以下に、ボーレート
の誤差について説明する。
Therefore, when data communication is performed using some application programs that require a baud rate of 6 MHz or 12 MHz, when the multiplication rate of the baud rate with respect to the sampling frequency is low (for example, 4
It is possible to suppress the error of the baud rate with the transmitting side which is the communication partner within the allowable range. The error of the baud rate will be described below.

【0101】ここで、図4に示すように、1キャラクタ
は、スタートビットSTR、データビットD0〜D7、
パリティビットDPおよび1つのストップビットSTP
の11ビットによって構成されるものとする。このよう
なキャラクタの受信時のボーレート誤差をEbとし、受
信時のサンプリング誤差をEsとし、誤差の総和Emと
すると、従来の技術で述べたように、誤差の総和Emが
50%を超えると通信エラーが生じるので、これを回避
するには、 Em=11(ビット)×Eb+Es≦50(%) という条件を満たす必要がある。上式から、ボーレート
誤差については、次式 Eb≦(50−Es)/11 を満たす必要がある。したがって、ボーレート誤差の上
限値、すなわちボーレート許容誤差は、 Eb=(50−Es)/11 となる。
Here, as shown in FIG. 4, one character includes a start bit STR, data bits D0 to D7,
Parity bit DP and one stop bit STP
11 bits. Assuming that the baud rate error at the time of receiving such a character is Eb, the sampling error at the time of receiving is Es, and the total error Em is Em, communication is performed when the total error Em exceeds 50% as described in the related art. Since an error occurs, in order to avoid this, the condition Em = 11 (bits) × Eb + Es ≦ 50 (%) must be satisfied. From the above equation, it is necessary for the baud rate error to satisfy the following equation Eb ≦ (50−Es) / 11. Therefore, the upper limit value of the baud rate error, that is, the baud rate allowable error is Eb = (50−Es) / 11.

【0102】また、図2(a)および(b)に示すよう
に、1ビットの時間の1/4の時間Tのさらに1/2
(1クロックで2回サンプリング可能であるため)、す
なわち1ビットの時間の1/8がサンプリング誤差とな
る。そこで、ボーレートの4倍の周波数を有するサンプ
リングクロックSCLKの立ち上がりおよび立ち下がり
でサンプリングする前述の方法によるボーレート許容誤
差は、1ビットを100%とすると、 Eb=(50−100/8)11=3.41% となり、前述の3%より大きくなる。また、ボーレート
の8倍の周波数を有するサンプリングクロックSCLK
を用いる場合、1ビットの時間の1/8の時間のさらに
1/2、すなわち1ビットの時間の1/16がサンプリ
ング誤差となるので、ボーレート許容誤差は、 Eb=(50−100/16)11=3.97% となり、より増大する。
Further, as shown in FIGS. 2 (a) and 2 (b), one-fourth of the 1-bit time is 1/2 of the time T.
(Because sampling can be performed twice with one clock), that is, 1/8 of the time of 1 bit becomes a sampling error. Therefore, the baud rate tolerance by the above-described method of sampling at the rising and falling edges of the sampling clock SCLK having a frequency four times the baud rate is Eb = (50-100 / 8) 11 = 3 when 1 bit is 100%. This is 0.41%, which is larger than the above-mentioned 3%. In addition, a sampling clock SCLK having a frequency eight times the baud rate
When using, the sampling error is 1/2 of 1/8 of the 1-bit time, that is, 1/16 of the 1-bit time. Therefore, the baud rate error is Eb = (50-100 / 16) 11 = 3.97%, which is an increase.

【0103】ここで、比較のために、サンプリングクロ
ックの立ち上がりのみでサンプリングする従来の方法に
よるボーレート許容誤差を求める。
Here, for comparison, the baud rate allowable error by the conventional method of sampling only at the rising edge of the sampling clock is obtained.

【0104】サンプリングクロックがボーレートの4倍
の周波数の場合のボーレート許容誤差は、1ビットの時
間の1/4がサンプリング誤差となるので、 Eb=(50−100/4)11=2.27% であり、3%よりも小さい。また、サンプリングクロッ
クがボーレートの16倍の周波数の場合のボーレート許
容誤差は、 Eb=(50−100/16)11=3.97% となる。この場合、ボーレートの8倍の周波数を有する
サンプリングクロックSCLKを用いる前述の場合と同
じボーレート許容誤差が得られるが、従来の技術で述べ
たように、サンプリング周波数が高すぎるという不都合
がある。
When the sampling clock has a frequency four times as high as the baud rate, the baud rate allowable error is 1/4 of the 1-bit time, so the sampling error is: Eb = (50-100 / 4) 11 = 2.27% Which is smaller than 3%. When the sampling clock has a frequency 16 times the baud rate, the allowable baud rate error is Eb = (50-100 / 16) 11 = 3.97%. In this case, the same baud rate tolerance as in the above case using the sampling clock SCLK having a frequency eight times the baud rate can be obtained, but the sampling frequency is too high as described in the related art.

【0105】このように、本実施の形態のデータ入力装
置で用いる前述のサンプリング方法を用いることによっ
て、ボーレート許容誤差を大きくすることができ、通信
エラーをより生じにくくさせるさせることが可能にな
る。
As described above, by using the above-described sampling method used in the data input device according to the present embodiment, the baud rate allowable error can be increased and the communication error can be made less likely to occur.

【0106】[0106]

【発明の効果】以上のように、本発明のデータ入力装置
は、受信したデータ列のスタートビットをサンプリング
クロックのタイミング、より具体的には、スタートビッ
トの先頭位相に続く最も近いサンプリングクロックの立
ち上がり位相または立ち下がり位相でスタートビット検
出手段によって検出し、サンプリングクロックのタイミ
ングでデータ列のデータビットを取り込む位相をスター
トビットの検出位相に基づいて決定する構成である。
As described above, according to the data input device of the present invention, the start bit of the received data string is set to the timing of the sampling clock, more specifically, the rising edge of the nearest sampling clock following the start phase of the start bit. The start bit detecting means detects the phase or the falling phase, and the phase for fetching the data bit of the data string at the timing of the sampling clock is determined based on the detected phase of the start bit.

【0107】このように、サンプリングクロックの立ち
上がりまたは立ち下がり時にスタートビットを検出する
ことによって、スタートビットのサンプリング回数をサ
ンプリングクロックの周波数を高めることなく増加させ
ることができる。この結果、48MHzのような比較的
周波数の低いサンプリングクロックの、ボーレート(例
えば12MHz)に対する倍率が低い場合でも、ボーレ
ートの誤差を許容範囲に納めることがきるという効果を
奏する。
As described above, by detecting the start bit at the rising or falling edge of the sampling clock, the number of times of sampling the start bit can be increased without increasing the frequency of the sampling clock. As a result, even if the sampling clock having a relatively low frequency such as 48 MHz has a low multiplication rate with respect to the baud rate (for example, 12 MHz), the error of the baud rate can be kept within the allowable range.

【0108】上記のデータ入力装置において、上記スタ
ートビット検出手段は、スタートビットをサンプリング
クロックの立ち上がり位相と立ち下がり位相とでそれぞ
れ検出する2つの検出部を有し、一方の検出部がスター
トビットを検出すると、他方の検出部によるスタートビ
ットの検出を阻止することで、両検出部がスタートビッ
トを検出することが防止される。したがって、両検出部
を用いても正確にスタートビットを検出することができ
るという効果を奏する。
In the above data input device, the start bit detecting means has two detecting sections for detecting the start bit at the rising phase and the falling phase of the sampling clock, and one detecting section detects the start bit. When detected, the detection of the start bit by the other detection unit is blocked, so that both detection units are prevented from detecting the start bit. Therefore, there is an effect that the start bit can be accurately detected even when using both detection units.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の実施の一形態に係るデータ入力装置に
おける受信回路の構成を示す論理回路図である。
FIG. 1 is a logic circuit diagram showing a configuration of a receiving circuit in a data input device according to an embodiment of the present invention.

【図2】(a)は上記受信回路におけるスタートビット
検出部の第1検出部によるスタートビットの検出動作を
示すタイミングチャートであり、(b)は上記スタート
ビット検出部の第2検出部によるスタートビットの検出
動作を示すタイミングチャートである。
FIG. 2 (a) is a timing chart showing a start bit detection operation by a first detection unit of the start bit detection unit in the reception circuit, and FIG. 2 (b) is a start chart by a second detection unit of the start bit detection unit. 6 is a timing chart showing a bit detection operation.

【図3】本発明の実施の一形態および従来のデータ入力
装置に入力されるキャラクタの構成を示す説明図であ
る。
FIG. 3 is an explanatory diagram showing a configuration of a character input to an embodiment of the present invention and a conventional data input device.

【図4】ボーレートの許容誤差を説明するために用いる
データ列の構成を示す図面である。
FIG. 4 is a diagram showing a structure of a data string used for explaining a baud rate allowable error.

【図5】従来のデータ入力装置における受信回路の構成
を示す論理回路図である。
FIG. 5 is a logic circuit diagram showing a configuration of a receiving circuit in a conventional data input device.

【図6】図5の受信回路におけるスタートビット検出部
によるスタートビットの検出動作を示すタイミングチャ
ートである。
6 is a timing chart showing a start bit detecting operation by a start bit detecting unit in the receiving circuit of FIG.

【図7】ボーレートの16倍の周波数を有するサンプリ
ングクロックによるスタートビットの検出動作を示すタ
イミングチャートである。
FIG. 7 is a timing chart showing a start bit detection operation using a sampling clock having a frequency 16 times the baud rate.

【符号の説明】[Explanation of symbols]

2 シリアル/パラレル変換部 3 スタートビット検出部 5 ビット位置検出部 31 第1検出部(検出部) 32 第2検出部(検出部) 2 Serial / parallel converter 3 Start bit detector 5-bit position detector 31 First Detection Unit (Detection Unit) 32 Second Detection Unit (Detection Unit)

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】受信したデータ列のスタートビットをサン
プリングクロックのタイミングでスタートビット検出手
段によって検出し、サンプリングクロックのタイミング
でデータ列のデータビットを取り込む位相をスタートビ
ットの検出位相に基づいて決定するデータ入力装置にお
いて、 上記スタートビット検出手段は、スタートビットの先頭
位相に続く最も近いサンプリングクロックの立ち上がり
位相または立ち下がり位相でスタートビットを検出する
ことを特徴とするデータ入力装置。
1. A start bit of a received data string is detected by a start bit detecting means at the timing of a sampling clock, and a phase for fetching a data bit of the data string at the timing of a sampling clock is determined based on the detection phase of the start bit. In the data input device, the start bit detecting means detects the start bit at a rising phase or a falling phase of the nearest sampling clock following the leading phase of the start bit.
【請求項2】上記スタートビット検出手段は、スタート
ビットをサンプリングクロックの立ち上がり位相と立ち
下がり位相とでそれぞれ検出する2つの検出部を有し、
一方の検出部がスタートビットを検出すると、他方の検
出部によるスタートビットの検出を阻止することを特徴
とする請求項1に記載のデータ入力装置。
2. The start bit detecting means has two detecting sections for detecting the start bit at a rising phase and a falling phase of a sampling clock, respectively.
The data input device according to claim 1, wherein when one of the detection units detects a start bit, the detection of the start bit by the other detection unit is blocked.
JP2001376270A 2001-12-10 2001-12-10 Data input equipment Pending JP2003179587A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001376270A JP2003179587A (en) 2001-12-10 2001-12-10 Data input equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001376270A JP2003179587A (en) 2001-12-10 2001-12-10 Data input equipment

Publications (1)

Publication Number Publication Date
JP2003179587A true JP2003179587A (en) 2003-06-27

Family

ID=19184498

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001376270A Pending JP2003179587A (en) 2001-12-10 2001-12-10 Data input equipment

Country Status (1)

Country Link
JP (1) JP2003179587A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023178846A1 (en) * 2022-03-23 2023-09-28 长鑫存储技术有限公司 Signal sampling circuit and semiconductor memory

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023178846A1 (en) * 2022-03-23 2023-09-28 长鑫存储技术有限公司 Signal sampling circuit and semiconductor memory

Similar Documents

Publication Publication Date Title
JPH04320109A (en) Circuit for discriminating transition phase of data edge
US20020133762A1 (en) Method and apparatus for sliding window link physical error detection
US6469544B2 (en) Device for detecting abnormality of clock signal
JP2003179587A (en) Data input equipment
US20040015734A1 (en) Automatic output delay timing adjustment for programmable glitch filter
JP2003134098A (en) Serial receiver
JPH0644756B2 (en) Synchronous clock generation circuit
US6545617B1 (en) Asynchronous serial data receiving device and asynchronous serial data transmitting device
US11341015B2 (en) UART receiver with adaptive sample timing control using a numerically-controlled oscillator
JP2523820B2 (en) Phase synchronization circuit
JPH0316054B2 (en)
JPS61158232A (en) Sequential preamble signal detecting circuit
JP3341544B2 (en) Signal period measurement device
CN117792344A (en) UART sampling pulse generation circuit and method with decimal frequency division function
JP2681922B2 (en) Bit synchronizer
JPH07212413A (en) Reception circuit for asynchronous data
JP2609888B2 (en) Signal transmission system and its equipment
JPH11127145A (en) Frame synchronization system and frame synchronization method
JPH0514443A (en) Consecutive pattern number detection circuit
JPS62281534A (en) Circuit for detecting correlation between frame synchronizing patterns circuit
JP2003078513A (en) Data inputting device and data outputting device
JPH0537573A (en) Data interruption detection circuit
JPH114148A (en) Phase difference detecting circuit
JPS62242435A (en) Asynchronous data reader
JPH08204692A (en) Clock timing extract method for transmission signal

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040826

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040831

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20050104