JPH1065757A - Start-stop synchronous communication equipment - Google Patents

Start-stop synchronous communication equipment

Info

Publication number
JPH1065757A
JPH1065757A JP8222338A JP22233896A JPH1065757A JP H1065757 A JPH1065757 A JP H1065757A JP 8222338 A JP8222338 A JP 8222338A JP 22233896 A JP22233896 A JP 22233896A JP H1065757 A JPH1065757 A JP H1065757A
Authority
JP
Japan
Prior art keywords
transmission
reception
data
communication
error information
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.)
Granted
Application number
JP8222338A
Other languages
Japanese (ja)
Other versions
JP2834094B2 (en
Inventor
Sumiko Kanamori
寿美子 金守
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.)
NEC Kyushu Ltd
Original Assignee
NEC Kyushu Ltd
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 NEC Kyushu Ltd filed Critical NEC Kyushu Ltd
Priority to JP8222338A priority Critical patent/JP2834094B2/en
Publication of JPH1065757A publication Critical patent/JPH1065757A/en
Application granted granted Critical
Publication of JP2834094B2 publication Critical patent/JP2834094B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Detection And Prevention Of Errors In Transmission (AREA)
  • Dc Digital Transmission (AREA)
  • Communication Control (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

PROBLEM TO BE SOLVED: To reduce the load of CPU concerning communication error processing and the burden of a user with several settings and to remarkably reduce time for resending in generating a communication error. SOLUTION: UART 13A is provided with an input/output control circuit 137 switching the input of communication data DS and the output of communication error information EI in response to the supply of a reception finishing signal RE and an error information transmission shift register 136 transmitting communication error information EI to the circuit 137 by synchronizing with a reception clock CKR, and UART 23A is provided with an input/output control circuit 237 switching the output of communication data DS and the input of communication error information EI in response to the supply of a transmission finishing signal TE and an error information receiving shift register 136 retransmission request signal RT to the register 236 by synchronizing with a transmission clock CKT.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は調歩同期式通信装置
に関し、特にマイクロコンピュータ間の通信等に用いら
れる調歩同期式通信装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an asynchronous communication device, and more particularly to an asynchronous communication device used for communication between microcomputers.

【0002】[0002]

【従来の技術】調歩同期式通信(Universal
Asynchronous Receiver/Tra
nsmitter:以下UART)方式はシリアル通信
方式の1つであり、マイクロコンピュータ間の通信シス
テムに広く用いられ、高速かつ膨大なデータを確実に転
送することが重要になってきている。このため、データ
の欠落(以下フレーミングエラー)や転換(以下パリテ
ィーエラー)等の通信エラーが発生した場合、これを確
実に検出し適切に処理することが重要となる。
2. Description of the Related Art Asynchronous communication (Universal)
Asynchronous Receiver / Tra
The nsmitter (hereinafter, UART) system is one of serial communication systems, is widely used in a communication system between microcomputers, and it has become important to reliably transfer a large amount of data at high speed. For this reason, when a communication error such as data loss (hereinafter, framing error) or conversion (hereinafter, parity error) occurs, it is important to reliably detect and appropriately process the error.

【0003】従来、このようなマイクロコンピュータ間
のシリアル通信における通信エラー処理は、受信側で通
信エラーを検出した場合、通信エラー検出信号を割り込
みコントローラ(以下INTC)に生成し、INTCか
ら受信側の中央処理装置(以下CPU)に通信エラー処
理を要求する。CPUは通信エラー処理のため、汎用ポ
ート等を経由して、上記通信エラーの発生情報を送信側
に伝達する。送信側では、上記通信エラー発生情報を受
信すると、送信側CPUは予め設定されたプログラムに
より通信データの再送信などの通信エラー処理を行って
いた。
Conventionally, in such a communication error processing in serial communication between microcomputers, when a communication error is detected on the receiving side, a communication error detection signal is generated in an interrupt controller (hereinafter referred to as INTC), and the receiving side receives the communication error signal from the INTC. Requests communication error processing from a central processing unit (hereinafter, CPU). The CPU transmits the communication error occurrence information to the transmission side via a general-purpose port or the like for communication error processing. On the transmission side, upon receiving the communication error occurrence information, the transmission side CPU performs a communication error process such as retransmission of communication data by a preset program.

【0004】従来の調歩同期式通信装置(UART)を
含む従来のマイクロコンピュータ間通信システムをブロ
ックで示す図7を参照すると、この従来のマイクロコン
ピュータ間通信システムは、受信側及び送信側のマイク
ロコンピュータ1,2から成る。
FIG. 7 is a block diagram showing a conventional communication system between microcomputers including a conventional asynchronous communication device (UART). Referring to FIG. 7, the conventional communication system between microcomputers includes a microcomputer on a receiving side and a microcomputer on a transmitting side. Consists of 1 and 2.

【0005】受信側マイクロコンピュータ1は、CPU
11と、INTC12と、UART部13とを備え、通
信エラー処理に関して、これらCPU11とINTC1
2とUART部13と受信データ端子T11と、ポート
P11を使用する。
The receiving microcomputer 1 has a CPU
11, an INTC 12, and a UART unit 13. These CPUs 11 and INTC 1
2, the UART unit 13, the reception data terminal T11, and the port P11.

【0006】送信側マイクロコンピュータ2は、CPU
21と、INTC22と、UART部23とを備え、通
信エラー処理に関して、これらCPU21とINTC2
2とUART部23と送信データ端子T21と、ポート
P21を使用する。
The transmitting microcomputer 2 has a CPU
21, an INTC 22, and a UART unit 23. The CPU 21 and the INTC 2
2, a UART unit 23, a transmission data terminal T21, and a port P21.

【0007】URT部13の構成を受信制御機能につい
てブロックで示す図8(A)を参照すると、このURT
部13は、通信データをシフト入力する受信シフトレジ
スタ132と、受信シフトレジスタ132から受けたデ
ータを一時格納する受信バッファ131と、通信データ
のシフト入力や受信バッファへの格納タイミングの制御
を行う受信タイミング制御回路133と、受信したデー
タの通信エラーを検出する通信エラー検出回路134
と、通信エラーの情報を格納する通信エラーレジスタ1
35とを備える。
Referring to FIG. 8A, which shows a block diagram of the configuration of the URT section 13 for the reception control function,
The unit 13 includes a reception shift register 132 that shifts and inputs communication data, a reception buffer 131 that temporarily stores data received from the reception shift register 132, and a reception that controls shift input of communication data and storage timing to the reception buffer. A timing control circuit 133, and a communication error detection circuit 134 for detecting a communication error of the received data.
And a communication error register 1 for storing communication error information.
35.

【0008】URT部23の構成を送信制御機能につい
てブロックで示す図8(B)を参照すると、CPU21
が内部バス25を経由して書込む送信データを保持する
送信バッファ231と、送信バッファ231の送信デー
タを取り込んでシフト出力する送信シフトレジスタ23
2と、通信データのシフト出力タイミングや送信バッフ
ァから送信シフトレジスタへの転送タイミングの制御を
行う送信タイミング制御回路233とを備える。
Referring to FIG. 8B, which shows the configuration of the URT unit 23 in terms of a transmission control function in a block diagram.
A transmission buffer 231 for holding transmission data to be written via the internal bus 25, and a transmission shift register 23 for fetching transmission data from the transmission buffer 231 and shifting and outputting the transmission data.
2 and a transmission timing control circuit 233 that controls shift output timing of communication data and transfer timing from the transmission buffer to the transmission shift register.

【0009】次に、図7,図8(A),(B)及びデー
タの受信タイミングをタイムチャートで示す図9を参照
して、従来の調歩同期式通信装置の動作について説明す
ると、まず、受信側のURT部13では、受信シフトレ
ジスタ132は、受信データ端子T11から入力された
シリアルデータDSを受信タイミング制御回路133か
ら供給される受信クロックCKRに同期して入力し、受
信シフトクロックCSRに同期してシフトすることによ
りパラレルデータDPに変換する。受信シフトレジスタ
132は、所定ビット数から成る通信データ(以下1通
信データ)の受信を終了すると受信終了信号REを発生
し、受信タイミング制御回路133に受信終了を伝達す
る。受信終了を検知した受信タイミング制御回路133
は受信制御信号群RCによって受信バッファ131への
データ転送を許可し、受信バッファ131は受信クロッ
クCKRに同期してデータDPを格納する。受信バッフ
ァ131の格納データDPは内部バス15を経由してC
PU11によって読み出される。
Next, the operation of the conventional start-stop synchronous communication apparatus will be described with reference to FIGS. 7 and 8A and 9B and FIG. 9 showing a time chart of data reception timing. In the URT unit 13 on the reception side, the reception shift register 132 inputs the serial data DS input from the reception data terminal T11 in synchronization with the reception clock CKR supplied from the reception timing control circuit 133, and outputs the serial data DS to the reception shift clock CSR. The data is converted into parallel data DP by shifting in synchronization. The reception shift register 132 generates a reception end signal RE when receiving communication data having a predetermined number of bits (hereinafter referred to as one communication data), and transmits the reception end to the reception timing control circuit 133. Reception timing control circuit 133 that has detected the end of reception
Allows data transfer to the reception buffer 131 by the reception control signal group RC, and the reception buffer 131 stores the data DP in synchronization with the reception clock CKR. The data DP stored in the reception buffer 131 is stored in the C via the internal bus 15.
It is read by PU11.

【0010】同時に通信エラー検出回路134は、受信
データ端子T11から入力されたデータDSから通信上
のエラーである通信エラーを検出した場合、通信エラー
検出信号ECを発生する。
At the same time, the communication error detection circuit 134 generates a communication error detection signal EC when detecting a communication error, which is a communication error, from the data DS input from the reception data terminal T11.

【0011】通信エラーの内容は、例えば、通信の過程
でデータの欠落(以下フレーミングエラー)や転換(以
下パリティーエラー)が起きた場合、あるいは、受信側
において、CPU11が受信バッファ131の格納デー
タDPを読み出す前に次のデータの格納がなされた場合
(以下オーバーランエラー)である。フレーミングエラ
ーやパリティエラーの認識は、予め送信側と受信側とで
通信上のプロトコルを決めておき、受信側ではプロトコ
ルに従った受信データを受信できたか否かによりエラー
の検出を行う。
The content of the communication error is, for example, when data is lost (hereinafter referred to as a framing error) or conversion (hereinafter referred to as a parity error) in the course of communication, or at the receiving side, the CPU 11 stores the data DP This is a case where the next data is stored before reading the data (hereinafter, overrun error). For the recognition of the framing error and the parity error, a communication protocol is determined in advance between the transmitting side and the receiving side, and the receiving side detects the error based on whether or not received data according to the protocol has been received.

【0012】UART方式の通信プロトコルでは、通信
データDSがない場合の送信データ端子の状態を”1”
にしておき、送信開始時には、送信開始を示す1ビット
の”0”(以下スタートビットST)、続いて8ビット
分の実データ(以下データビット群0〜7)、データビ
ット群の後に8ビットの実データ中の”1”の数が偶数
個であった場合には”1”、奇数個であった場合には”
0”を示す1ビットのデータ(以下、パリティービット
P)、さらに通信終了を示す2ビットの”1”(以下ス
トップビットST)を設定している。
In the communication protocol of the UART system, the state of the transmission data terminal when there is no communication data DS is "1".
At the start of transmission, 1 bit “0” (hereinafter, start bit ST) indicating the start of transmission, 8 bits of actual data (hereinafter, data bit groups 0 to 7), and 8 bits after the data bit group Is "1" when the number of "1" in the actual data is an even number, and "1" when the number is an odd number.
1-bit data (hereinafter, parity bit P) indicating "0", and 2-bit "1" (hereinafter, stop bit ST) indicating the end of communication are set.

【0013】例えば、データビット群が”011010
01”の8ビットだったとすると、送信側は、スタート
ビットSTの”0”、データビット群の”011010
01”、パリティービットPの”1”、ストップビット
SPの”11”、すなわち、”00110100111
1”の12ビットを1通信データとして送出する。受信
側では、”01101001”をデータビット群として
受信し、受信データ中の”1”の数を計算し、計算した
パリティビットP”1”と受信したパリティビットP”
1”が一致すること、さらにその後の2ビットのストッ
プビットSP”11”を受けて、通信上のエラーが無か
ったと認識する。
For example, if the data bit group is "011010"
Assuming that the bits are 8 bits of “01”, the transmission side transmits “0” of the start bit ST and “011010”
01, the parity bit P is “1”, and the stop bit SP is “11”, that is, “00110010011”.
The transmission side transmits 12 bits of “1” as one communication data.The receiving side receives “011101001” as a data bit group, calculates the number of “1” in the received data, and calculates the calculated parity bit P “1”. Received parity bit P "
Receiving that 1 "matches and further receiving the subsequent two stop bits SP" 11 ", it recognizes that there is no communication error.

【0014】フレーミングエラーが発生した場合、例え
ばデータビット群の2ビット目が欠落したとすると、受
信データは”00101001111”の11ビットと
なる。受信側では、スタートビットSPに続く8ビッ
ト”01010011”をデータビット群として受け、
続く1ビットをパリティビットP、残る”1”をストッ
プビットSPとして受信する。ストップビットは2ビッ
トの”1”というプロトコルに反して1ビット分のスト
ップビットしか受信できていないので、フレーミングエ
ラーを検出する。パリティエラーが発生した場合、例え
ば通信データの3ビット目が転換したとすると、受信デ
ータは”001001001111”の12ビットとな
る。受信側では、スタートビットSPに続く8ビット”
01001001”をデータビット群として受け、この
データ中の1の数は奇数個なのでパリティビットPとし
ては”0”を期待するが受信パリティビットPは”1”
なので、パリティエラーを検出する。
If a framing error occurs, for example, if the second bit of the data bit group is missing, the received data will be 11 bits of "00101001111". On the receiving side, 8 bits “01010011” following the start bit SP are received as a data bit group,
The next one bit is received as a parity bit P, and the remaining “1” is received as a stop bit SP. The framing error is detected because only one stop bit has been received, contrary to the protocol of two bits "1". If a parity error occurs, for example, if the third bit of the communication data is changed, the received data will be 12 bits of “001001001111”. On the receiving side, 8 bits following the start bit SP
01001001 "is received as a data bit group, and since the number of 1s in this data is an odd number," 0 "is expected as the parity bit P, but the received parity bit P is" 1 ".
Therefore, a parity error is detected.

【0015】通信エラー検出回路134は、このように
して通信上で発生するエラーを検出し通信エラー検出信
号ECを生成する。通信エラー検出信号ECはCPU1
1に伝達され、同時に通信エラーレジスタ134に格納
される。CPU11は通信エラーレジスタ134に格納
したエラー情報を内部バス15を経由して読み出す。
The communication error detection circuit 134 detects an error occurring in communication in this way and generates a communication error detection signal EC. The communication error detection signal EC is
1 and stored in the communication error register 134 at the same time. The CPU 11 reads out the error information stored in the communication error register 134 via the internal bus 15.

【0016】次に、送信側のURT部23では、まず、
CPU21は内部バス25を経由して送信バッファ23
1に送信データを書込む。送信バッファ231への書込
みが終了すると、送信タイミング制御回路233は、送
信制御信号群151により送信バッファ231から送信
シフトレジスタ232へのデータ転送を許可する。送信
シフトレジスタ232に転送されたデータは、送信タイ
ミング制御回路233から供給される送信シフトクロッ
クCSTに同期してシフトされることによりシリアルデ
ータDSに変換され、送信クロックCKTに同期して送
信データ端子T21から出力される。1通信データ分の
送信を終了すると送信終了信号TEを発生し、送信タイ
ミング制御回路233に送信終了を伝達する。
Next, the transmitting side URT unit 23 first
The CPU 21 transmits the transmission buffer 23 via the internal bus 25.
Write the transmission data in 1. When the writing to the transmission buffer 231 is completed, the transmission timing control circuit 233 permits the data transfer from the transmission buffer 231 to the transmission shift register 232 by the transmission control signal group 151. The data transferred to the transmission shift register 232 is converted into serial data DS by being shifted in synchronization with the transmission shift clock CST supplied from the transmission timing control circuit 233, and is transmitted in synchronization with the transmission clock CKT. Output from T21. When transmission of one communication data is completed, a transmission end signal TE is generated, and the transmission end signal is transmitted to the transmission timing control circuit 233.

【0017】図9を再度参照すると、ここでは、上記通
信プロトコルにしたがい、受信クロックCKRに同期し
てデータの受信が行われ、1通信データ毎に、スタート
ビットST、データビット群0〜7、パリティビット
P、ストップビットSPのビット群で受信される場合を
示す。また、ストップビットSPの受信が終了すると、
受信終了信号REがアクティブになる。
Referring to FIG. 9 again, here, data is received in synchronization with the reception clock CKR in accordance with the above-mentioned communication protocol, and a start bit ST, data bit groups 0 to 7, This shows a case where the bits are received with a parity bit P and a stop bit SP. When the reception of the stop bit SP is completed,
The reception end signal RE becomes active.

【0018】データの送信タイミングは、図10におい
て受信クロックCKRが送信クロックCKTとなるほか
は同様である。
The data transmission timing is the same except that the reception clock CKR becomes the transmission clock CKT in FIG.

【0019】次に、従来のマイクロコンピュータにおけ
るUARTの通信処理をフローチャートで示す図10を
参照して従来のマイクロコンピュータにおけるUART
の通信処理について説明すると、ここでは、説明の便宜
上、1データフレーム分を512通信データとして通信
を行う場合について説明する。
Next, referring to FIG. 10, which is a flowchart showing a UART communication process in a conventional microcomputer, a UART in a conventional microcomputer will be described.
In the following, a description will be given of a case where communication is performed using one data frame as 512 communication data for convenience of explanation.

【0020】まず、送信側、受信側それぞれで、通信エ
ラー発生時の処理のための諸処理ステップP11,P2
1の設定を行う。次に、UART部23の送信を許可し
(ステップP22)、受信側ではUART部13の受信
を許可(ステップP12)する。次に、送信側では、送
信バッファ231へデータを書き込む(ステップP2
3)。送信バッファ231にデータが書き込まれると、
送信側では、1通信データの送信を実行(ステップP2
4)する。この時、受信側では、1通信データの受信動
作と通信エラーの判定を行う(ステップP13)。1通
信データの送受信動作は、スタートビットに始まり、指
定ビット数のデータ,パリティビット,ストップビット
で構成される。
First, on the transmitting side and the receiving side, various processing steps P11 and P2 for processing at the time of occurrence of a communication error.
1 is set. Next, the transmission of the UART unit 23 is permitted (step P22), and the reception side permits the reception of the UART unit 13 (step P12). Next, the transmission side writes data to the transmission buffer 231 (step P2).
3). When data is written to the transmission buffer 231,
The transmitting side executes transmission of one communication data (step P2
4) Yes. At this time, the receiving side determines the operation of receiving one communication data and a communication error (step P13). A transmission / reception operation of one communication data starts with a start bit, and includes data of a designated number of bits, a parity bit, and a stop bit.

【0021】次に、1通信データの送受信動作が終了す
ると、受信側のUART部13は通信エラーの有無をI
NTC12に伝える(ステップP14)。送信側では1
通信データの送信の終了毎に、1データフレーム分の送
信終了の判定処理を行い1データフレーム分の送信終了
するまで、前述の送信動作(ステップP23〜P24)
を反復する。受信側も同様に、1データフレーム分の受
信が終了するまで前述の受信動作(ステップP13)を
行う。受信側のINTC12は、受信中、UART部1
3から通信エラー検出信号ECにより通信エラーの有無
を受け(ステップP14)、通信エラーが検出された場
合、通信エラー割り込み処理をCPU11に要求する
(ステップP15)。通信エラー割り込み要求をうけ
て、CPU11では、予め設定(ステップP11)され
たエラー検出時の処理、すなわち、通信エラーが検出さ
れたことを所定の汎用ポートに伝える(ステップP1
6)。受信側の汎用ポートP11と接続された送信側の
汎用ポートP21を経由して通信エラー検出情報ECI
(ステップP25)を送信側のINTC22に伝える
(ステップP26)。INTC22では再送信割り込み
処理をCPU21に要求する。これらの処理(ステップ
P14〜P16,P25〜P27)は、UART部1
3,23で行う送受信と並行して行われる。送信側で
は、1データフレーム分の送信が終了すると、このデー
タフレームに関して、通信エラーの有無を判断する。通
信エラーが検出された場合、すなわち、再送信割り込み
要求がCPUに伝達されていた場合(ステップP27)
には、通信エラーが検出された1データフレームの再送
信を行う(ステップP28)。
Next, when one transmission / reception operation of communication data is completed, the UART section 13 on the receiving side determines whether there is a communication error or not.
The notification is sent to the NTC 12 (step P14). 1 on the sending side
Each time the transmission of communication data is completed, the transmission end determination processing for one data frame is performed, and the above-described transmission operation is performed until the transmission of one data frame is completed (steps P23 to P24).
Is repeated. Similarly, the receiving side performs the above-described receiving operation (step P13) until the reception of one data frame is completed. During reception, the INTC 12 on the receiving side sets the UART unit 1
3 receives a communication error from the communication error detection signal EC (step P14), and when a communication error is detected, requests the CPU 11 to perform a communication error interrupt process (step P15). In response to the communication error interrupt request, the CPU 11 performs a preset error detection process (step P11), that is, notifies a predetermined general-purpose port that a communication error has been detected (step P1).
6). Communication error detection information ECI via the transmitting-side general-purpose port P21 connected to the receiving-side general-purpose port P11
(Step P25) is transmitted to the INTC 22 on the transmission side (Step P26). The INTC 22 requests the CPU 21 to perform a retransmission interruption process. These processes (steps P14 to P16, P25 to P27) are performed by the UART 1
This is performed in parallel with the transmission and reception performed in 3 and 23. When the transmission of one data frame is completed, the transmission side determines whether there is a communication error with respect to this data frame. When a communication error is detected, that is, when a retransmission interrupt request has been transmitted to the CPU (step P27)
In step P28, one data frame in which a communication error is detected is retransmitted (step P28).

【0022】以上のように、従来のUARTでは、通信
エラー処理にCPUの介在によるソフトウェア対応を必
要とし、CPUの負担となっていた。またエラー発生時
に1通信データ毎の再送信を行うなどのエラー処理対応
が難しく、1データフレームを全て再送する必要があ
り、非効率であった。
As described above, in the conventional UART, communication error processing requires software intervention through the intervention of the CPU, which is a burden on the CPU. In addition, it is difficult to cope with error processing such as retransmission for each communication data when an error occurs, and it is necessary to retransmit all one data frame, which is inefficient.

【0023】[0023]

【発明が解決しようとする課題】上述した従来の調歩同
期式通信装置は、通信エラーの処理にCPUの介在を必
要としていたため通信エラー処理がCPUの大きな負担
となり、性能の大幅な低下要因となるという欠点があっ
た。
In the above-mentioned conventional start-stop synchronous communication apparatus, the processing of the communication error requires the intervention of the CPU, so that the communication error processing imposes a heavy burden on the CPU, and the performance is greatly reduced. There was a disadvantage of becoming.

【0024】また、エラー発生時に1通信データ毎に再
送信を行うなどのエラー処理対応が困難であるため、1
データフレーム毎にエラー処理を行っていたので、エラ
ー処理が非効率であるという欠点があった。
Also, it is difficult to cope with error processing such as retransmission for each communication data when an error occurs.
Since error processing is performed for each data frame, there is a disadvantage that error processing is inefficient.

【0025】さらに、予め通信エラー発生時の処理をユ
ーザーがソフトウェアで設定し、実行するしかなかった
ので、通信エラー検出・処理のためのソフトウェア処理
の諸設定が増大し、ユーザーの負担になるという欠点が
あった。
Further, since the user has to set and execute the processing when a communication error occurs in advance by software, various settings of software processing for detecting and processing the communication error increase, and the burden on the user increases. There were drawbacks.

【0026】本発明の目的は、通信エラー検出時の処理
におけるCPUの介在を不要としてCPUの負担を軽減
し、1通信データ毎のエラー処理を実現することにより
エラー発生時の処理の効率向上を図るとともに、ソフト
ウェア処理のための諸設定を低減してユーザーの負担を
軽減できる調歩同期式通信装置を提供することにある。
An object of the present invention is to reduce the load on the CPU by eliminating the intervention of the CPU in processing when a communication error is detected, and to improve the efficiency of processing when an error occurs by implementing error processing for each communication data. It is another object of the present invention to provide a start-stop synchronous communication device that can reduce various settings for software processing and reduce a burden on a user.

【0027】[0027]

【課題を解決するための手段】本発明の調歩同期式通信
装置は、受信制御手段が、受信したシリアル通信データ
を受信クロックに同期してシフト入力し受信データを生
成する受信シフトレジスタと、前記受信シフトレジスタ
から供給を受けた前記受信データを一時格納する受信バ
ッファと、前記受信クロックの発生と前記シリアル通信
データのシフト入力と前記受信データの格納タイミング
の制御を行う受信タイミング制御回路と、前記受信デー
タの通信エラーを検出し通信エラー情報を出力する通信
エラー検出回路と、前記通信エラー情報を格納する通信
エラーレジスタとを備え、送信制御手段が、送信データ
を保持する送信バッファと、前記送信バッファから出力
される前記送信データを取込み送信クロックと同期して
シフト出力してシリアル通信データを出力する送信シフ
トレジスタと、前記送信クロックの発生と前記シリアル
通信データのシフト出力タイミングと前記送信データの
前記送信シフトレジスタへの転送タイミングの制御を行
う送信タイミング制御回路とを備え、前記受信制御手段
を含む第1のマイクロコンピュータと前記送信制御手段
を含む第2のマイクロコンピュータとの間で調歩同期式
のシリアル通信を行う調歩同期式通信装置において、前
記受信制御手段が、第1の制御信号の供給に応答して前
記シリアル通信データの入力と前記通信エラー情報の出
力とを切替る第1の入出力制御回路と、前記通信エラー
検出回路の出力する前記通信エラー情報を前記受信クロ
ックに同期して前記第1の入出力制御回路に伝達するエ
ラー情報送信シフトレジスタとを備え、前記送信制御手
段が、第2の制御信号の供給に応答して前記シリアル通
信データの出力と前記通信エラー情報の入力とを切替る
第2の入出力制御回路と、前記第2の入出力制御回路か
ら入力した前記通信エラー情報を前記送信クロックに同
期して取込み前記送信データの再送信を要求する再送信
要求信号を前記送信タイミング回路に伝達するエラー情
報受信シフトレジスタとを備えて構成されている。
According to a first aspect of the present invention, there is provided an asynchronous communication apparatus, wherein a reception control means shifts and inputs received serial communication data in synchronization with a reception clock to generate reception data; A reception buffer that temporarily stores the reception data supplied from a reception shift register, a reception timing control circuit that controls generation of the reception clock, shift input of the serial communication data, and storage timing of the reception data, A communication error detection circuit that detects a communication error of the received data and outputs communication error information; and a communication error register that stores the communication error information. The transmission data output from the buffer is fetched and shifted and output in synchronization with the transmission clock. A transmission shift register that outputs communication data, a transmission timing control circuit that controls generation of the transmission clock, shift output timing of the serial communication data, and transfer timing of the transmission data to the transmission shift register, In a start-stop synchronous communication device that performs start-stop synchronous serial communication between a first microcomputer including the reception control unit and a second microcomputer including the transmission control unit, the reception control unit may include a first microcomputer. A first input / output control circuit for switching between input of the serial communication data and output of the communication error information in response to the supply of the control signal, and receiving the communication error information output from the communication error detection circuit. An error information transmission shift register for transmitting the error information to the first input / output control circuit in synchronization with a clock. A second input / output control circuit that switches between output of the serial communication data and input of the communication error information in response to the supply of a second control signal; An error information reception shift register that takes in the communication error information input from the control circuit in synchronization with the transmission clock and transmits a retransmission request signal for requesting retransmission of the transmission data to the transmission timing circuit. ing.

【0028】[0028]

【発明の実施の形態】次に、本発明の実施の形態の調歩
同期式通信装置を特徴づける受信側及び送信側の各々の
UART部13A,23Bを図8と共通の構成要素には
共通の参照文字/数字を付して同様にブロックで示す図
1(A),(B)を参照すると、この図に示す本実施の
形態のUART部13Aは、従来と共通の受信シフトレ
ジスタ132と、受信バッファ131と、受信タイミン
グ制御回路133と、通信エラー検出回路134と、通
信エラーレジスタ134とに加えて、受信データ端子T
11の入出力制御回路137と、通信エラー検出回路1
34から通信エラー検出信号ECを取り込み受信クロッ
クCKRに同期して入出力制御回路137に伝達するエ
ラー情報送信シフトレジスタ136とを備える。
Next, the UART sections 13A and 23B on the receiving side and the transmitting side, which characterize the start-stop synchronous communication apparatus according to the embodiment of the present invention, are common to the components shown in FIG. Referring to FIGS. 1A and 1B, which are similarly indicated by blocks with reference characters / numerals, the UART section 13A of the present embodiment shown in FIG. In addition to the reception buffer 131, the reception timing control circuit 133, the communication error detection circuit 134, and the communication error register 134, the reception data terminal T
11 input / output control circuit 137 and communication error detection circuit 1
And an error information transmission shift register 136 which takes in the communication error detection signal EC from 34 and transmits it to the input / output control circuit 137 in synchronization with the reception clock CKR.

【0029】入出力制御回路137は、受信シフトレジ
スタ132から入力される受信終了信号REを入出力切
替信号として受信中は受信データ端子T11から通信デ
ータを入力し、受信後はエラー情報送信シフトレジスタ
136から出力されるエラー情報信号EIを受信データ
端子T11に出力するように切替を行う。
The input / output control circuit 137 inputs communication data from the reception data terminal T11 during reception of the reception end signal RE input from the reception shift register 132 as an input / output switching signal. Switching is performed so that the error information signal EI output from 136 is output to the reception data terminal T11.

【0030】図1(B)を参照すると、この図に示す本
実施の形態のUART部23Aは、従来と共通の送信バ
ッファ231と、送信シフトレジスタ232と、送信タ
イミング制御回路233とに加えて、送信データ端子T
21の入出力制御回路137と、送信データ端子T21
から入力されるエラー情報信号EIを入出力制御回路1
37を介し送信クロックCKTに同期して取り込み再送
信要求信号RTを送信タイミング制御回路233に伝え
るエラー情報受信シフトレジスタ236とを備える。
Referring to FIG. 1B, the UART section 23A of the present embodiment shown in this figure includes a transmission buffer 231, a transmission shift register 232, and a transmission timing control circuit 233 which are common with those of the related art. , Transmission data terminal T
21, an input / output control circuit 137 and a transmission data terminal T21.
The error information signal EI input from the input / output control circuit 1
37, an error information reception shift register 236 for transmitting a retransmission request signal RT to the transmission timing control circuit 233 in synchronization with the transmission clock CKT via the transmission clock CKT 37.

【0031】入出力制御回路137は、送信シフトレジ
スタ232から出力される送信終了信号TEを入出力切
替信号として、送信中は送信シフトレジスタ232から
の送信データを送信データ端子T21に出力し、送信後
には送信データ端子T21から入力されるエラー情報E
Iを取り込みエラー情報受信シフトレジスタ236に伝
えるように切替を行う。
The input / output control circuit 137 uses the transmission end signal TE output from the transmission shift register 232 as an input / output switching signal, outputs transmission data from the transmission shift register 232 to the transmission data terminal T21 during transmission, and transmits the data. Later, the error information E input from the transmission data terminal T21
Switching is performed so as to transfer I to the error information reception shift register 236.

【0032】次に、図1(A),(B)及びデータの受
信/送信タイミングをタイムチャートで示す図2を参照
して本実施の形態の動作について説明すると、本実施の
形態では、説明の便宜上、従来の通信プロトコルと共通
の受信/送信各クロックCKR/CKTに同期してスタ
ートビットST、データビット群0〜7、パリティービ
ットP、ストップビットSPを受信/送信するものと
し、さらにストップビットSPの後にエラー情報ビット
EIを送信/受信する。通信エラーが発生すると、受信
側のURT部13Aでは、1通信データ毎にストップビ
ットSPの受信終了後、受信終了信号REに同期して受
信データ端子T11からエラー情報EIを出力する。送
信側のUART部23Aは、ストップビットSPの送信
終了後、送信終了信号TEに同期して送信データ端子T
21からエラー情報EIを取り込み、このエラー情報E
Iからエラー発生を検出すると再送信を実行する。
Next, the operation of the present embodiment will be described with reference to FIGS. 1A and 1B and FIG. 2 showing a timing chart of data reception / transmission in a time chart. For convenience, it is assumed that a start bit ST, data bit groups 0 to 7, a parity bit P, and a stop bit SP are received / transmitted in synchronization with each reception / transmission clock CKR / CKT common to the conventional communication protocol, and a stop bit An error information bit EI is transmitted / received after the bit SP. When a communication error occurs, the reception-side URT unit 13A outputs error information EI from the reception data terminal T11 in synchronization with the reception end signal RE after the reception of the stop bit SP for each communication data. After the transmission of the stop bit SP is completed, the UART section 23A on the transmission side synchronously transmits the transmission data terminal T
The error information EI is taken in from the
When an error occurrence is detected from I, retransmission is executed.

【0033】本実施の形態の動作の詳細について説明す
ると、まず、通常時の受信時には、受信側のURT部1
3Aでは、受信シフトレジスタ132の出力する受信終
了信号REがインアクティブであり、入出力制御回路1
37は受信データ端子T11を入力状態に切替え、従来
と同様にデータ端子T11から入力した受信シリアルデ
ータDSを受信シフトレジスタ132に供給する。受信
シフトレジスタ132は、供給されたシリアルデータD
Sを受信クロックCKRに同期して入力し、受信シフト
クロックCSRに同期してパラレルデータDPに変換す
る。このとき、まず、スタートビットST、続いて、8
ビットのデータビット群0〜7、パリティビットP、ス
トップビットSPが入力される。ストップビットSPが
受信されると受信終了信号REがアクティブになり、入
出力制御回路137は受信データ端子T11を出力状態
に切替え、1ビットのエラー情報EIを出力する。エラ
ー情報EIの出力が終了すると、入出力制御回路137
は受信データ端子T11を入力状態に復帰させ、通常の
受信動作を行う。
The operation of this embodiment will be described in detail. First, at the time of normal reception, the URT unit 1 on the receiving side is used.
3A, the reception end signal RE output from the reception shift register 132 is inactive, and the input / output control circuit 1
37 switches the reception data terminal T11 to the input state, and supplies the reception serial data DS input from the data terminal T11 to the reception shift register 132 in the same manner as in the related art. The reception shift register 132 stores the supplied serial data D
S is input in synchronization with the reception clock CKR, and is converted into parallel data DP in synchronization with the reception shift clock CSR. At this time, first, the start bit ST, and then 8
Data bit groups 0 to 7, a parity bit P, and a stop bit SP are input. When the stop bit SP is received, the reception end signal RE becomes active, the input / output control circuit 137 switches the reception data terminal T11 to the output state, and outputs 1-bit error information EI. When the output of the error information EI is completed, the input / output control circuit 137
Returns the reception data terminal T11 to the input state, and performs a normal reception operation.

【0034】入出力制御回路137の切替タイミングを
タイムチャートで示す図3(A)を併せて参照すると、
通常の受信は、受信データ端子T11からのストップビ
ットSP受信により終了する。すなわち、受信データ端
子T11からストップビットSPが入力され、受信シフ
トクロックCSRの立ち上がり、すなわちtAのタイミ
ングで受信シフトレジスタ132にシフト入力されると
受信が終了する。ここで、受信したシリアルデータDS
中に通信エラーを検出した場合、この通信エラーは通信
エラー検出信号ECの立ち上がり、すなわちtBのタイ
ミングでアクティブとなり、エラー情報EIとしてエラ
ー情報送信シフトレジスタ135に取り込まれる。受信
シフトレジスタ132は、tCのタイミングで受信終了
信号REをアクティブ化し、入出力制御回路137は受
信終了信号REのアクティブ化に応答して受信データ端
子T11を出力状態に切替え、エラー情報EIを受信デ
ータ端子T11から出力する。エラー情報出力後、tE
のタイミングで受信終了信号REをインアクティブ化
し、入出力制御回路137は受信終了信号REのインア
クティブ化に応答して受信データ端子T11を入力状態
に切替え、通常の受信動作を行う。
Referring also to FIG. 3A which shows a switching timing of the input / output control circuit 137 in a time chart,
Normal reception ends when the stop bit SP is received from the reception data terminal T11. That is, the reception ends when the stop bit SP is input from the reception data terminal T11 and shifted to the reception shift register 132 at the rise of the reception shift clock CSR, that is, at the timing of tA. Here, the received serial data DS
If a communication error is detected during this time, this communication error becomes active at the rising edge of the communication error detection signal EC, that is, at the timing of tB, and is taken into the error information transmission shift register 135 as error information EI. The reception shift register 132 activates the reception end signal RE at the timing of tC, and the input / output control circuit 137 switches the reception data terminal T11 to the output state in response to the activation of the reception end signal RE, and receives the error information EI. Output from the data terminal T11. After the error information is output, tE
The input / output control circuit 137 switches the reception data terminal T11 to the input state in response to the deactivation of the reception end signal RE, and performs a normal reception operation at the timing shown in FIG.

【0035】次に、送信側のUART23Aの入出力制
御回路237の切替タイミングをタイムチャートで示す
図3(B)を併せて参照してUART23Aの動作につ
いて説明すると、通常の送信は、送信データ端子T21
からのストップビットSP出力により終了する。すなわ
ち、tFのタイミングで、送信シフトレジスタ232の
データをシフト出力する。次にtGのタイミングで送信
終了信号TEがアクティブになり、送信終了信号TEの
アクティブ化に応答して入出力制御回路237は送信デ
ータ端子21を入力状態に切替える。送信データ端子T
21から入力されるエラー情報EIは、次の送信シフト
クロックCSTに同期、すなわちtHのタイミングでエ
ラー情報受信シフトレジスタ236に取り込まれる。エ
ラー情報EI受信後、tIのタイミングで、送信終了信
号TEをインアクティブ化し、入出力制御回路237は
送信終了信号TEのアクティブ化に応答して送信データ
端子T21を出力状態に切替え、通常の送信動作を行
う。
Next, the operation of the UART 23A will be described with reference to FIG. 3B which is a timing chart showing the switching timing of the input / output control circuit 237 of the UART 23A on the transmitting side. T21
Is terminated by the output of the stop bit SP from. That is, the data of the transmission shift register 232 is shifted and output at the timing of tF. Next, at time tG, the transmission end signal TE becomes active, and the input / output control circuit 237 switches the transmission data terminal 21 to the input state in response to the activation of the transmission end signal TE. Transmission data terminal T
The error information EI input from 21 is taken into the error information reception shift register 236 in synchronization with the next transmission shift clock CST, that is, at the timing of tH. After receiving the error information EI, at the timing of tI, the transmission end signal TE is deactivated, and the input / output control circuit 237 switches the transmission data terminal T21 to the output state in response to the activation of the transmission end signal TE, thereby performing normal transmission. Perform the operation.

【0036】上述したように、受信側UART13Aで
は、エラーを検出した場合通信エラー検出信号ECがア
クティブとなり、通信エラー情報EIとしてエラー情報
送信シフトレジスタ135に格納する。1通信データの
終了毎にこのエラー情報EIを受信データ端子T11か
ら出力する。送信側のUART23Aでは、1通信デー
タの終了毎にエラー情報EIを送信データ端子T21を
経由してエラー情報受信シフトレジスタ236に取込
む。エラー情報受信シフトレジスタ236に格納された
エラー情報EIは、再送信要求信号RTとして送信タイ
ミング制御回路233に伝えられる。再送信要求信号R
Tがアクティブ化された場合、送信タイミング制御回路
233は再送信処理の実行、すなわち、送信バッファ2
31のデータを送信シフトレジスタ232へ転送し、同
一データを再度送信する。従来の技術において説明した
ように通信エラーの種類は複数あるが、ここではエラー
の種類は問題とならない。
As described above, in the receiving UART 13A, when an error is detected, the communication error detection signal EC becomes active, and stores it in the error information transmission shift register 135 as communication error information EI. Each time one communication data ends, the error information EI is output from the reception data terminal T11. The UART 23A on the transmission side takes in the error information EI into the error information reception shift register 236 via the transmission data terminal T21 every time one communication data ends. The error information EI stored in the error information reception shift register 236 is transmitted to the transmission timing control circuit 233 as a retransmission request signal RT. Retransmission request signal R
When T is activated, the transmission timing control circuit 233 executes retransmission processing, that is, the transmission buffer 2
The data of No. 31 is transferred to the transmission shift register 232, and the same data is transmitted again. As described in the related art, there are a plurality of types of communication errors, but the types of errors do not matter here.

【0037】以上の本実施の形態のUART部13A,
23Aを備える複数のマイクロコンピュータ間のシリア
ル通信動作について説明すると、まず、送信側ではUA
RT部23Aの送信を許可し、受信側ではUART部1
3Aの受信を許可する。次に、UART部23Aでは、
送信バッファ231へ送信データを書き込む。送信バッ
ファ231に送信データが書き込まれると、UART部
23Aは、1通信データ分の送信を実行する。この時、
受信側のUART部13Aでは、1通信データ分の受信
動作と通信エラーの検出を行う。1通信データの送受信
動作は、スタートビットSTに始まり、指定ビット数の
データビット群、パリティビットP、ストップビットS
Pで構成され、従来技術の動作となんら変りはない。
The UART 13A of the present embodiment described above,
The serial communication operation between a plurality of microcomputers provided with the A.23A will be described first.
The transmission of the RT unit 23A is permitted, and the UART unit 1 is
3A reception is permitted. Next, in the UART unit 23A,
The transmission data is written to the transmission buffer 231. When the transmission data is written into the transmission buffer 231, the UART unit 23A executes transmission for one communication data. At this time,
The UART section 13A on the receiving side performs a receiving operation for one communication data and detects a communication error. The transmission / reception operation of one communication data starts with a start bit ST, a data bit group of a designated number of bits, a parity bit P, and a stop bit S.
P, which is no different from the operation of the prior art.

【0038】次に、1通信データ分の送受信動作が終了
すると、受信側のUART部13Aでは受信データ端子
T11を出力状態に切替え、通信エラーの有無を示すエ
ラー情報EIを受信データ端子T11を経由して送信す
る。送信側のUART部23Aは、1通信データ分の送
信の終了後、送信データ端子T21を入力状態に切替
え、送信データ端子T21を経由してエラー情報EIを
受信する。UART部23Aは受信したエラー情報EI
の判定を行う。エラー情報が”0”、すなわち通信が正
常に行われたことを示している場合には、次の1通信デ
ータの送信動作を開始する。エラー情報が”1”、すな
わち通信エラーが発生したことを示している場合には、
タイミング制御回路に再送信を要求し、通信エラーが発
生したデータを再度送信する。このようにして、送受信
は、例えば、512通信データを1ブロックとした所望
のデータフレーム分の送受信が終了するまでデータの送
受信を連続して行う。
Next, when the transmission / reception operation for one communication data is completed, the reception-side UART section 13A switches the reception data terminal T11 to the output state, and transmits error information EI indicating the presence or absence of a communication error via the reception data terminal T11. And send. After the transmission of one communication data is completed, the UART unit 23A on the transmission side switches the transmission data terminal T21 to the input state, and receives the error information EI via the transmission data terminal T21. The UART unit 23A receives the received error information EI.
Is determined. If the error information is "0", that is, it indicates that the communication has been normally performed, the transmission operation of the next one communication data is started. If the error information is “1”, that is, it indicates that a communication error has occurred,
Request retransmission to the timing control circuit, and retransmit the data in which the communication error has occurred. In this way, transmission and reception are performed continuously, for example, until transmission and reception of a desired data frame with 512 communication data as one block is completed.

【0039】このように、本実施の形態では、UART
部自体に通信エラー処理機能を持たせたことにより、マ
イクロコンピュータ間の通信エラー発生時の処理におい
て、通信エラー処理に関するCPUの介在を不要とし、
ユーザーはエラー処理を意識することなく通信を実行で
きる。
As described above, in the present embodiment, the UART
By having a communication error processing function in the unit itself, in the processing when a communication error occurs between the microcomputers, there is no need for the intervention of the CPU relating to the communication error processing,
The user can execute communication without being aware of error processing.

【0040】また、従来のUART部を用いたマイクロ
コンピュータ間通信では、1データフレーム毎に通信エ
ラー発生の有無を確認し、エラー発生時には1データフ
レーム毎に再送信するような必要があったが、本発明で
は、1通信データ毎に再送信が可能なため、再送するデ
ータ数が大幅に削減できる。一例として、1データフレ
ームを512通信データ、ボーレートを2400bps
とし、12個の通信データを送受信中に1つの通信エラ
ーが発生するものとすると、従来の処理における再送時
間は1.706秒であったのが、本実施の形態の処理で
は0.006秒に削減され、すなわち99.6%の短縮
を図ることができる。
In the conventional communication between microcomputers using the UART unit, it is necessary to confirm whether or not a communication error has occurred for each data frame, and to retransmit every data frame when an error occurs. According to the present invention, since retransmission can be performed for each communication data, the number of retransmitted data can be greatly reduced. As an example, one data frame is 512 communication data, and the baud rate is 2400 bps.
Assuming that one communication error occurs during transmission and reception of twelve pieces of communication data, the retransmission time in the conventional processing is 1.706 seconds, but is 0.006 seconds in the processing of the present embodiment. , That is, 99.6% reduction.

【0041】さらに、通信エラー処理をハードウェアで
実現することにより、通信上のエラー処理を自動的に行
うことができ、通信エラー検出時の処理のためのソフト
ウェア諸設定を一切無くすことが可能となる。
Further, by realizing communication error processing by hardware, error processing on communication can be automatically performed, and all software settings for processing upon detection of a communication error can be eliminated. Become.

【0042】次に、本発明の第2の実施の形態の受信側
UART部13B及び送信側UART部23Bを図1と
共通の構成要素には共通の文字/数字を用いてブロック
で示す図4(A),(B)を参照すると、この図に示す
本実施の形態の第1の実施の形態との相違点は、受信側
UART部13Bが複数の通信エラーの内容を2ビット
の通信エラー情報EIにエンコードするエラー情報エン
コード回路138と、これに関連して2ビットに拡張し
たエラー情報送信シフトレジスタ136Aとを備え、送
信側UART部23Bが2ビットの通信エラー情報EI
を格納するため2ビットに拡張したエラー情報受信シフ
トレジスタ236Aと通信エラー情報をデコードするエ
ラー情報デコード回路238とを備え、第1の実施の形
態ではエラー情報としてエラーの有無を示す1ビットの
エラー情報を伝達していたのに対して、本実施の形態で
はエラー内容を示す2ビットのエラー情報を伝達するこ
とである。
Next, a receiving UART section 13B and a transmitting UART section 23B according to a second embodiment of the present invention are shown by blocks using common characters / numerals for common components as in FIG. Referring to (A) and (B), the difference between this embodiment and the first embodiment shown in this figure is that the reception-side UART unit 13B converts the contents of a plurality of communication errors into two-bit communication errors. An error information encoding circuit 138 for encoding information EI and an error information transmission shift register 136A expanded to 2 bits in association with the error information encoding circuit 138.
An error information reception shift register 236A expanded to 2 bits to store the error information and an error information decoding circuit 238 for decoding communication error information. In the first embodiment, a 1-bit error indicating the presence or absence of an error as error information is provided. In contrast to the information transmission, this embodiment transmits 2-bit error information indicating the error content.

【0043】エラー情報エンコード回路138は、従来
の技術において説明したような通信上の複数のエラー内
容をエンコードする機能を有する。ここではエラーの種
類は問題としないので、説明の便宜上、3つの通信エラ
ー、ERR0,ERR1,ERR2を検出する場合のエ
ラー内容とエラー情報データとの組み合わせ例を表1に
示す。
The error information encoding circuit 138 has a function of encoding a plurality of communication errors as described in the background art. Here, since the type of error does not matter, for convenience of description, Table 1 shows an example of a combination of error contents and error information data when detecting three communication errors, ERR0, ERR1, and ERR2.

【0044】[0044]

【表1】 [Table 1]

【0045】本実施の形態のデータの受信/送信タイミ
ングをタイムチャートで示す図5を併せて参照すると、
本実施の形態のエラー情報の受信側UART13Bの送
信タイミングは、ストップビットSPの受信信終了後、
受信終了信号REに同期して受信データ端子T11から
表1組み合わせにしたがった2ビットのエラー情報EI
1,EI2を出力する。
Referring also to FIG. 5 showing a timing chart of data reception / transmission timing of the present embodiment,
The transmission timing of the error information receiving side UART 13B according to the present embodiment is such that after the reception of the stop bit SP is completed,
2-bit error information EI according to the combination of Table 1 from the reception data terminal T11 in synchronization with the reception end signal RE
1, EI2.

【0046】受信側UART13Bの入出力制御回路1
37の切替タイミングをタイムチャートで示す図6
(A)を併せて参照して第1の実施の形態との相違点に
ついて動作を説明すると、tCのタイミングで受信終了
信号REをアクティブ化し、受信終了信号REのアクテ
ィブ化に応答して受信データ端子T11を出力状態に切
替えると、エラー情報EI1,EI2の順序でを受信デ
ータ端子T11から出力する。エラー情報EI2の出力
後、tEのタイミングで受信終了信号REをインアクテ
ィブ化し、入出力制御回路137は受信終了信号REの
インアクティブ化に応答して受信データ端子T11を入
力状態に切替え、通常の受信動作を行う。
Input / output control circuit 1 of receiving UART 13B
FIG. 6 is a timing chart showing the switching timing of 37.
The operation of the third embodiment will be described with reference to (A). The reception end signal RE is activated at the timing tC, and the reception data is transmitted in response to the activation of the reception end signal RE. When the terminal T11 is switched to the output state, the error information EI1 and EI2 are output from the reception data terminal T11 in this order. After the output of the error information EI2, the reception end signal RE is deactivated at the timing of tE, and the input / output control circuit 137 switches the reception data terminal T11 to the input state in response to the deactivation of the reception end signal RE. Perform the receiving operation.

【0047】次に、送信側のUART23Bの入出力制
御回路237の切替タイミングをタイムチャートで示す
図6(B)を併せて参照して第1の実施の形態との相違
点について動作を説明すると、tGのタイミングで送信
終了信号TEがアクティブ化し、送信データ端子21を
入力状態に切替える。送信データ端子T21から入力さ
れるエラー情報EI1,EI2は、tHのタイミングで
エラー情報受信シフトレジスタ236Aに取り込まれ、
tIのタイミングで、送信終了信号TEをインアクティ
ブ化し、入出力制御回路237は送信終了信号TEのイ
ンアクティブ化に応答して送信データ端子T21を出力
状態に切替え、通常の送信動作を行う。
Next, the operation of the input / output control circuit 237 of the UART 23B on the transmission side will be described with reference to FIG. , TG, the transmission end signal TE is activated, and the transmission data terminal 21 is switched to the input state. The error information EI1 and EI2 input from the transmission data terminal T21 are taken into the error information reception shift register 236A at the timing of tH,
At the timing of tI, the transmission end signal TE is deactivated, and the input / output control circuit 237 switches the transmission data terminal T21 to the output state in response to the deactivation of the transmission end signal TE, and performs a normal transmission operation.

【0048】本実施の形態では、エラー内容が3種類の
場合について示したが、この方法がエラー内容の種類数
に依存しないことは云うまでもない。
In this embodiment, the case where there are three types of error contents has been described. However, it goes without saying that this method does not depend on the number of types of error contents.

【0049】このように、本実施例では、種類の異なる
複数の通信エラーに対応することができる。第1の実施
の形態の場合に加えて、エラーの内容をも伝達すること
ができ、予め決めておけば、エラーの内容によってエラ
ー発生対応の処理方法を変えることもできる。
As described above, this embodiment can cope with a plurality of different types of communication errors. In addition to the case of the first embodiment, the content of the error can be transmitted, and if determined in advance, the processing method for the error occurrence can be changed depending on the content of the error.

【0050】[0050]

【発明の効果】以上説明したように、本発明の調歩同期
式通信装置は、受信UART部が、受信終了信号の供給
に応答してシリアル通信データの入力と通信エラー情報
の出力とを切替る第1の入出力制御回路と、上記通信エ
ラー情報を受信クロックに同期して上記第1の入出力制
御回路に伝達するエラー情報送信シフトレジスタとを備
え、送信UART部が、送信終了信号の供給に応答して
シリアル通信データの出力と上記通信エラー情報の入力
とを切替る第2の入出力制御回路と、入力した上記通信
エラー情報を送信クロックに同期して取込み再送信要求
信号を送信タイミング回路に伝達するエラー情報受信シ
フトレジスタとを備え、UART部自体に通信エラー処
理機能を持たせることにより、マイクロコンピュータ間
のシリアル通信における通信エラー発生時の処理を、C
PUに負担をかけずに行えるという効果がある。
As described above, in the start-stop synchronous communication apparatus according to the present invention, the reception UART section switches between input of serial communication data and output of communication error information in response to the supply of the reception end signal. A first input / output control circuit; and an error information transmission shift register for transmitting the communication error information to the first input / output control circuit in synchronization with a reception clock. The transmission UART unit supplies a transmission end signal. A second input / output control circuit for switching the output of serial communication data and the input of the communication error information in response to the control signal, and taking the input communication error information in synchronization with a transmission clock and transmitting a retransmission request signal. A shift register for transmitting error information to be transmitted to the circuit, and the UART unit itself has a communication error processing function so that serial communication between microcomputers can be performed. It takes the processing when a communication error occurs, C
There is an effect that the operation can be performed without imposing a load on the PU.

【0051】また、1通信データ毎にハードウェアでエ
ラー処理を行うことにより、通信エラー発生時の再送デ
ータ数を大幅に削減できることにより、通信エラー発生
時の処理の効率を大幅に向上できるという効果がある。
Further, by performing error processing by hardware for each communication data, the number of retransmitted data when a communication error occurs can be greatly reduced, so that the efficiency of processing when a communication error occurs can be greatly improved. There is.

【0052】さらに、通信エラー処理をハードウェアで
実行することによりCPUによるソフトウェア処理のた
めの諸設定を低減でき、ユーザーの負担を軽くすること
ができるという効果がある。
Further, by executing the communication error processing by hardware, various settings for software processing by the CPU can be reduced, and the burden on the user can be reduced.

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

【図1】本発明の調歩同期式通信装置の第1の実施の形
態を示すブロック図である。
FIG. 1 is a block diagram showing a first embodiment of a start-stop synchronous communication device according to the present invention.

【図2】本実施の形態の調歩同期式通信装置におけるデ
ータの受信/送信タイミングを示すタイムチャートであ
る。
FIG. 2 is a time chart showing data reception / transmission timing in the start-stop synchronous communication device of the present embodiment.

【図3】本実施の形態の調歩同期式通信装置における受
信側及び送信側の各々のUART部の入出力制御回路の
切替タイミングをを示すタイムチャートである。
FIG. 3 is a time chart showing switching timing of an input / output control circuit of each of the UART units on the reception side and the transmission side in the start-stop synchronous communication device of the present embodiment.

【図4】本発明の調歩同期式通信装置の第2の実施の形
態を示すブロック図である。
FIG. 4 is a block diagram showing a second embodiment of the start-stop synchronous communication apparatus according to the present invention.

【図5】本実施の形態の調歩同期式通信装置におけるデ
ータの受信/送信タイミングを示すタイムチャートであ
る。
FIG. 5 is a time chart showing data reception / transmission timing in the start-stop synchronous communication device of the present embodiment.

【図6】本実施の形態の調歩同期式通信装置における受
信側及び送信側の各々のUART部の入出力制御回路の
切替タイミングをを示すタイムチャートである。
FIG. 6 is a time chart showing switching timings of the input / output control circuits of the UART units on the receiving side and the transmitting side in the start-stop synchronous communication device of the present embodiment.

【図7】調歩同期式のマイクロコンピュータ間通信シス
テムの一例を示すブロック図である。
FIG. 7 is a block diagram showing an example of a start-stop synchronous communication system between microcomputers.

【図8】従来の調歩同期式通信装置の一例を示すブロッ
ク図である。
FIG. 8 is a block diagram showing an example of a conventional start-stop synchronous communication device.

【図9】従来の調歩同期式通信装置におけるデータの受
信/送信タイミングを示すタイムチャートである。
FIG. 9 is a time chart showing data reception / transmission timing in a conventional start-stop synchronous communication device.

【図10】従来の調歩同期式通信装置における通信エラ
ー処理の一例を示すフローチャートである。
FIG. 10 is a flowchart showing an example of a communication error process in a conventional start-stop synchronous communication device.

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

1 受信側マイクロコンピュータ 2 送信側マイクロコンピュータ 11,21 CPU 12,22 INTC 13,23,13A,23A,13B,23B UA
RT部 15 内部バス 131 受信バッファ 132 受信シフトレジスタ 133 受信タイミング制御回路 124 通信エラー検出回路 135 通信エラーレジスタ 136,136A エラー情報送信シフトレジスタ 137,237 入出力制御回路 138 エラー情報エンコード回路 231 送信バッファ 232 送信シフトレジスタ 233 送信タイミング制御回路 236,236A エラー情報受信シフトレジスタ 238 エラー情報デコード回路 T11 受信データ端子 T21 送信データ端子 P11 ポート
DESCRIPTION OF SYMBOLS 1 Receiving microcomputer 2 Sending microcomputer 11 and 21 CPU 12,22 INTC 13,23,13A, 23A, 13B, 23B UA
RT unit 15 internal bus 131 reception buffer 132 reception shift register 133 reception timing control circuit 124 communication error detection circuit 135 communication error register 136, 136A error information transmission shift register 137, 237 input / output control circuit 138 error information encoding circuit 231 transmission buffer 232 Transmission shift register 233 Transmission timing control circuit 236, 236A Error information reception shift register 238 Error information decoding circuit T11 Reception data terminal T21 Transmission data terminal P11 Port

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 受信制御手段が、受信したシリアル通信
データを受信クロックに同期してシフト入力し受信デー
タを生成する受信シフトレジスタと、前記受信シフトレ
ジスタから供給を受けた前記受信データを一時格納する
受信バッファと、前記受信クロックの発生と前記シリア
ル通信データのシフト入力と前記受信データの格納タイ
ミングの制御を行う受信タイミング制御回路と、前記受
信データの通信エラーを検出し通信エラー情報を出力す
る通信エラー検出回路と、前記通信エラー情報を格納す
る通信エラーレジスタとを備え、送信制御手段が、送信
データを保持する送信バッファと、前記送信バッファか
ら出力される前記送信データを取込み送信クロックと同
期してシフト出力してシリアル通信データを出力する送
信シフトレジスタと、前記送信クロックの発生と前記シ
リアル通信データのシフト出力タイミングと前記送信デ
ータの前記送信シフトレジスタへの転送タイミングの制
御を行う送信タイミング制御回路とを備え、前記受信制
御手段を含む第1のマイクロコンピュータと前記送信制
御手段を含む第2のマイクロコンピュータとの間で調歩
同期式のシリアル通信を行う調歩同期式通信装置におい
て、 前記受信制御手段が、第1の制御信号の供給に応答して
前記シリアル通信データの入力と前記通信エラー情報の
出力とを切替る第1の入出力制御回路と、 前記通信エラー検出回路の出力する前記通信エラー情報
を前記受信クロックに同期して前記第1の入出力制御回
路に伝達するエラー情報送信シフトレジスタとを備え、 前記送信制御手段が、第2の制御信号の供給に応答して
前記シリアル通信データの出力と前記通信エラー情報の
入力とを切替る第2の入出力制御回路と、 前記第2の入出力制御回路から入力した前記通信エラー
情報を前記送信クロックに同期して取込み前記送信デー
タの再送信を要求する再送信要求信号を前記送信タイミ
ング回路に伝達するエラー情報受信シフトレジスタとを
備えることを特徴とする調歩同期式通信装置。
1. A reception control means shift-inputs received serial communication data in synchronization with a reception clock to generate reception data, and temporarily stores the reception data supplied from the reception shift register. A reception buffer, a reception timing control circuit for controlling generation of the reception clock, shift input of the serial communication data, and storage timing of the reception data, and detects a communication error of the reception data and outputs communication error information. A communication error detection circuit, and a communication error register for storing the communication error information, wherein a transmission control means synchronizes a transmission buffer holding transmission data, the transmission data output from the transmission buffer, and a transmission clock. And a transmission shift register that shifts out and outputs serial communication data. A transmission timing control circuit that controls generation of the transmission clock, shift output timing of the serial communication data, and transfer timing of the transmission data to the transmission shift register, and includes a first microcontroller including the reception control unit. In a start-stop synchronous communication device that performs start-stop synchronous serial communication between a computer and a second microcomputer including the transmission control unit, the reception control unit responds to a supply of a first control signal, A first input / output control circuit that switches between input of serial communication data and output of the communication error information; and a first input / output control circuit that synchronizes the communication error information output by the communication error detection circuit with the reception clock. An error information transmission shift register for transmitting to an output control circuit, wherein the transmission control means supplies a second control signal. A second input / output control circuit that switches between output of the serial communication data and input of the communication error information in response to the communication error information, and synchronization of the communication error information input from the second input / output control circuit with the transmission clock And an error information reception shift register for transmitting a retransmission request signal for requesting retransmission of the transmission data to the transmission timing circuit.
【請求項2】 前記受信制御手段が、複数の種類の前記
通信エラー情報を予め定めた符号で符号化して符号化通
信エラー情報を生成するエラー情報エンコード回路をさ
らに備え、 前記送信制御手段が、前記符号化エラー情報をデコード
して前記複数の種類の通信エラー情報を出力するエラー
情報デコード回路をさらに備えることを特徴とする請求
項1記載の調歩同期式通信装置。
2. The reception control unit further includes an error information encoding circuit that encodes a plurality of types of the communication error information with a predetermined code to generate encoded communication error information. 2. The start-stop synchronous communication device according to claim 1, further comprising an error information decoding circuit that decodes the encoded error information and outputs the plurality of types of communication error information.
【請求項3】 前記第1の制御信号が、受信した前記シ
リアル通信データの1フレーム分の最終を示すストップ
パルスの検出に応答して生成される受信終了信号であ
り、前記第2の制御信号が、送信した前記シリアル通信
データの1フレーム分の最終を示すストップパルスの出
力に応答して生成される送信終了信号であることを特徴
とする請求項1記載の調歩同期式通信装置。
3. The second control signal, wherein the first control signal is a reception end signal generated in response to detection of a stop pulse indicating the end of one frame of the received serial communication data. 2. The start-stop synchronous communication device according to claim 1, wherein: is a transmission end signal generated in response to the output of a stop pulse indicating the end of one frame of the transmitted serial communication data.
JP8222338A 1996-08-23 1996-08-23 Asynchronous communication device Expired - Lifetime JP2834094B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8222338A JP2834094B2 (en) 1996-08-23 1996-08-23 Asynchronous communication device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8222338A JP2834094B2 (en) 1996-08-23 1996-08-23 Asynchronous communication device

Publications (2)

Publication Number Publication Date
JPH1065757A true JPH1065757A (en) 1998-03-06
JP2834094B2 JP2834094B2 (en) 1998-12-09

Family

ID=16780786

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8222338A Expired - Lifetime JP2834094B2 (en) 1996-08-23 1996-08-23 Asynchronous communication device

Country Status (1)

Country Link
JP (1) JP2834094B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100470827B1 (en) * 1999-05-07 2005-03-07 윈본드 일렉트로닉스 코포레이션 Method of generating a clock signal for universal asynchronous receiver-transmitter
JP2006325103A (en) * 2005-05-20 2006-11-30 Nippon Hoso Kyokai <Nhk> Content transmitter, program thereof, content receiver and program thereof
US9135531B2 (en) 2010-12-28 2015-09-15 Brother Kogyo Kabushiki Kaisha Image forming apparatus and computer readable medium therefor

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100470827B1 (en) * 1999-05-07 2005-03-07 윈본드 일렉트로닉스 코포레이션 Method of generating a clock signal for universal asynchronous receiver-transmitter
JP2006325103A (en) * 2005-05-20 2006-11-30 Nippon Hoso Kyokai <Nhk> Content transmitter, program thereof, content receiver and program thereof
JP4580277B2 (en) * 2005-05-20 2010-11-10 日本放送協会 CONTENT TRANSMITTING DEVICE AND ITS PROGRAM, CONTENT RECEIVING DEVICE AND ITS PROGRAM
US9135531B2 (en) 2010-12-28 2015-09-15 Brother Kogyo Kabushiki Kaisha Image forming apparatus and computer readable medium therefor

Also Published As

Publication number Publication date
JP2834094B2 (en) 1998-12-09

Similar Documents

Publication Publication Date Title
JP2707529B2 (en) Data communication system
US20080263243A1 (en) Specialized universal serial bus controller
JPH0771125B2 (en) Data communication method and data communication system
JPH01198130A (en) Method of reducing the number of check point frames
JPH06324977A (en) Data transfer method
CN103650401A (en) Internal communication method for mobile terminal
JP2834094B2 (en) Asynchronous communication device
JP2003069603A (en) Packet communication controller
JP2000513516A (en) Multiplex communication interface circuit and method
JP2016111672A (en) Communication method, communication system, and communication device
US8880972B2 (en) Serial transmission apparatus, information processing apparatus, and serial transmission method
CN112187408A (en) Data processing method, system, device, storage medium and processor
JPS5853249A (en) Data transmitter and receiver
AU609791B2 (en) Improvements in or relating to data communication systems
JP2013131836A (en) Serial communication method, communication device, and serial communication system
JP2776274B2 (en) Virtual buffer control system in relay computer
JP3137092B2 (en) Data transmission method and transmission / reception device
JP2001094438A (en) Serial interface circuit
JP4290067B2 (en) Data synchronization method and program for serial communication system
JPH0973373A (en) Parallel interface
JPH01305745A (en) Transmission retrial system
CN116938428A (en) Method and communication system for synchronizing data frames
JPH06164647A (en) Data transmission controller
JP2000148666A (en) Processor system bus
JP2007102493A (en) Serial interrupt resuming circuit

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 19980901