JP2971006B2 - Serial communication method and serial communication controller - Google Patents

Serial communication method and serial communication controller

Info

Publication number
JP2971006B2
JP2971006B2 JP7063743A JP6374395A JP2971006B2 JP 2971006 B2 JP2971006 B2 JP 2971006B2 JP 7063743 A JP7063743 A JP 7063743A JP 6374395 A JP6374395 A JP 6374395A JP 2971006 B2 JP2971006 B2 JP 2971006B2
Authority
JP
Japan
Prior art keywords
transmission
reception
buffers
data
buffer
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.)
Expired - Lifetime
Application number
JP7063743A
Other languages
Japanese (ja)
Other versions
JPH08265393A (en
Inventor
木 浩 鈴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
JFE Steel Corp
Original Assignee
Kawasaki Steel 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 Kawasaki Steel Corp filed Critical Kawasaki Steel Corp
Priority to JP7063743A priority Critical patent/JP2971006B2/en
Publication of JPH08265393A publication Critical patent/JPH08265393A/en
Application granted granted Critical
Publication of JP2971006B2 publication Critical patent/JP2971006B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Bidirectional Digital Transmission (AREA)
  • Communication Control (AREA)

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、シリアル通信を制御す
るシリアル通信方法およびシリアル通信コントローラに
関し、詳しくは、半二重通信を行う際に、受信用および
送信用バッファをともに受信用または送信用バッファと
して使用することができるシリアル通信方法およびシリ
アル通信コントローラに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a serial communication method for controlling serial communication and a serial communication controller, and more particularly, to a method for controlling reception and transmission of both reception and transmission buffers when performing half-duplex communication. The present invention relates to a serial communication method and a serial communication controller that can be used as a buffer.

【0002】[0002]

【従来の技術】一般的に、シリアル通信には全二重通信
および半二重通信の2つの通信方式がある。ここで、全
二重通信とは、送信および受信を同時に行う通信方式で
あり、半二重通信とは、送信または受信のいずれか一方
だけを一時に行う通信方式である。以下に、シリアル通
信を制御するシリアル通信コントローラについて説明す
る。
2. Description of the Related Art Generally, there are two types of serial communication, full-duplex communication and half-duplex communication. Here, full-duplex communication is a communication method in which transmission and reception are performed simultaneously, and half-duplex communication is a communication method in which only one of transmission and reception is performed at a time. Hereinafter, a serial communication controller that controls serial communication will be described.

【0003】図5は、従来のシリアル通信コントローラ
の一例のブロック図である。このシリアル通信コントロ
ーラ60は、外部CPU(中央演算装置)とシリアル通
信コントローラ60の内部回路とのデータのやり取りを
制御するCPUインタフェース16と、シリアルデータ
である受信データをパラレルデータに変換する受信用シ
フトレジスタ12と、この受信用シフトレジスタ12か
ら出力されるパラレルデータを一時的に保持する受信用
バッファ14a,14b,…,14nと、CPUから入
力されるパラレルデータを一時的に保持する送信用バッ
ファ18a,18b,…,18nと、この送信用バッフ
ァ18a〜18nから読み出されるパラレルデータを変
換してシリアルデータである送信データとして出力する
送信用シフトレジスタ20とから構成されている。
FIG. 5 is a block diagram showing an example of a conventional serial communication controller. The serial communication controller 60 includes a CPU interface 16 for controlling data exchange between an external CPU (central processing unit) and an internal circuit of the serial communication controller 60, and a reception shift for converting received data, which is serial data, to parallel data. , 14n for temporarily holding parallel data output from the reception shift register 12, and a transmission buffer for temporarily holding parallel data input from the CPU. , 18n, and a transmission shift register 20 that converts parallel data read from the transmission buffers 18a to 18n and outputs the converted data as serial data.

【0004】次に、このシリアル通信コントローラ60
の動作について説明する。まず、受信において、受信用
シフトレジスタ12により、シリアルデータである受信
データはシリアル→パラレル変換されてパラレルデータ
として出力され、受信用バッファ14a〜14nに順次
保持される。ここで、受信用バッファ14a〜14nに
保持することができる最大個数、例えば4個のパラレル
データが保持された場合、CPUインタフェース16か
らCPUに対して、受信データの読み出しを要求する割
り込み要求信号INTが出力される。CPUは割り込み
要求信号INTを受け取ると、メインルーチンから割り
込みルーチンへ分岐し、読み出し信号RD_をアクティ
ブ状態にして、受信用バッファ14a〜14nに保持さ
れているパラレルデータを保持された順番に応じて、内
部データバス、CPUインタフェース16および外部デ
ータバスを通して順次読み出した後、再度メインルーチ
ンへ復帰する。このようにして受信データはCPUによ
って読み出される。
Next, the serial communication controller 60
Will be described. First, in reception, the reception shift register 12 converts received data, which is serial data, from serial to parallel and outputs it as parallel data, which are sequentially stored in the receiving buffers 14a to 14n. Here, when the maximum number, for example, four pieces of parallel data that can be held in the receiving buffers 14a to 14n is held, the interrupt request signal INT for requesting the CPU to read the received data from the CPU interface 16 is issued. Is output. Upon receiving the interrupt request signal INT, the CPU branches from the main routine to the interrupt routine, activates the read signal RD_, and sets the parallel data held in the receiving buffers 14a to 14n in accordance with the order in which the parallel data is held. After reading sequentially through the internal data bus, the CPU interface 16 and the external data bus, the process returns to the main routine again. Thus, the received data is read by the CPU.

【0005】また、送信において、CPUはメインルー
チンから割り込みルーチンへ分岐し、書き込み信号WR
_をアクティブ状態にして、外部データバス、CPUイ
ンタフェース16および内部データバスを通して、送信
用バッファ18a〜18nに保持することができる最大
個数、例えば4個のパラレルデータを順次送信用バッフ
ァ18a〜18nに書き込んだ後、再度メインルーチン
へ復帰する。送信バッファ18a〜18nに書き込まれ
たパラレルデータは、書き込まれた順番に応じて順次読
み出され、送信用シフトレジスタ20によりパラレル→
シリアル変換されてシリアルデータである送信データと
して出力される。ここで、送信用バッファ18a〜18
nに書き込まれた全てのパラレルデータが読み出された
場合、CPUインタフェース16からCPUに対して、
次のパラレルデータの書き込みを要求する割り込み要求
信号INTが出力される。このようにして送信データは
送信される。
In transmission, the CPU branches from the main routine to the interrupt routine, and writes the write signal WR.
_ To an active state, and the maximum number, for example, four parallel data that can be held in the transmission buffers 18a to 18n is sequentially transferred to the transmission buffers 18a to 18n through the external data bus, the CPU interface 16 and the internal data bus. After writing, it returns to the main routine again. The parallel data written in the transmission buffers 18a to 18n are sequentially read out in accordance with the writing order, and are read in parallel by the transmission shift register 20.
The serial data is converted and output as transmission data which is serial data. Here, the transmission buffers 18a to 18
When all the parallel data written in n is read, the CPU interface 16 sends a signal to the CPU.
An interrupt request signal INT requesting the writing of the next parallel data is output. The transmission data is transmitted in this way.

【0006】このシリアル通信コントローラ60は全二
重通信に対応して設計されているため、受信および送信
は同時に独立して動作させることができる。なお、全二
重通信において、一時に必ず送信または受信のいずれか
一方だけを行うようにすることにより、半二重通信にも
対応することが可能である。
Since the serial communication controller 60 is designed for full-duplex communication, reception and transmission can be simultaneously and independently operated. In addition, in the full-duplex communication, it is possible to cope with the half-duplex communication by always performing only one of the transmission and the reception at a time.

【0007】ところで、上述するシリアル通信コントロ
ーラ60において、受信用バッファ14a〜14nおよ
び送信用バッファ18a〜18nはそれぞれ少なくとも
1個、好ましくはそれぞれ複数個設けられる。その理由
の1つは、CPUに頻繁に割り込み要求信号INTが出
力されるのを防止するためである。
In the serial communication controller 60 described above, at least one, and preferably a plurality of, receiving buffers 14a to 14n and transmitting buffers 18a to 18n are provided. One of the reasons is to prevent the interrupt request signal INT from being frequently output to the CPU.

【0008】例えば、受信用バッファおよび送信用バッ
ファが8ビットを1つの単位とするパラレルデータを保
持するものであり、それぞれ1個の受信用バッファおよ
び送信用バッファしか備えていないと仮定する。この場
合、8ビットの受信データを受信してこれが受信用バッ
ファに保持される毎に、CPUに対して受信データの読
み出しを要求する割り込み要求信号INTが出力される
ことになる。また、CPUから1つのパラレルデータが
送信用バッファに書き込まれると、これが読み出される
毎に、CPUに対して次のパラレルデータの書き込みを
要求する割り込み要求信号INTが出力されることにな
る。
[0008] For example, it is assumed that the reception buffer and the transmission buffer hold parallel data in units of 8 bits, and each has only one reception buffer and one transmission buffer. In this case, each time 8-bit received data is received and held in the receiving buffer, an interrupt request signal INT for requesting the CPU to read the received data is output. When one piece of parallel data is written from the CPU to the transmission buffer, an interrupt request signal INT for requesting the CPU to write the next parallel data is output each time the piece of parallel data is read.

【0009】このように、受信用および送信用バッファ
の個数が少ないほど、CPUに対して頻繁に受信データ
の読み出しや送信データの書き込みを要求する割り込み
要求信号INTが出力されることになる。このため、C
PUは割り込みルーチンの処理に多くの時間を取られて
しまい、メインルーチンの処理に充分な時間が避けなく
なってしまうという問題点が発生する。
As described above, the smaller the number of receiving and transmitting buffers, the more frequently the CPU outputs the interrupt request signal INT for requesting reading of the received data and writing of the transmitted data. Therefore, C
The PU takes a lot of time for the processing of the interrupt routine, and there is a problem that a sufficient time for the processing of the main routine cannot be avoided.

【0010】これに対し、例えばそれぞれ4個の受信用
バッファおよび送信用バッファを備えていると仮定す
る。この場合、4個の受信用バッファの全てにパラレル
データが保持されるまで、即ち、32ビットの受信デー
タが受信されるまで、CPUに対して受信データの読み
出しを要求する割り込み要求信号INTが出力されな
い。また、CPUから4つのパラレルデータが送信用バ
ッファに書き込まれ、これらが全て読み出されるまで、
即ち、32ビットの送信データが読み出されるまで、C
PUに対して次のパラレルデータの書き込みを要求する
割り込み要求信号INTが出力されない。
On the other hand, it is assumed that, for example, four reception buffers and four transmission buffers are provided, respectively. In this case, the interrupt request signal INT for requesting the CPU to read the received data is output until the parallel data is held in all the four receiving buffers, that is, until the 32-bit received data is received. Not done. Further, until four parallel data are written from the CPU to the transmission buffer and all of them are read out,
That is, until the 32-bit transmission data is read, C
An interrupt request signal INT requesting the PU to write the next parallel data is not output.

【0011】このように、n個の受信用バッファおよび
n個の送信用バッファを備えることにより、CPUに対
して割り込み要求信号INTが出力される回数を1/n
にすることができる。このため、割り込みルーチンの処
理によるオーバヘッドを削減することができ、CPUを
効率良く使用することができる。
Thus, by providing n reception buffers and n transmission buffers, the number of times the interrupt request signal INT is output to the CPU can be reduced by 1 / n.
Can be For this reason, the overhead due to the processing of the interrupt routine can be reduced, and the CPU can be used efficiently.

【0012】また、複数個の受信用および送信用バッフ
ァを備えるもう1つの理由は、高速な通信レートに対応
するためである。
Another reason for providing a plurality of receiving and transmitting buffers is to cope with a high communication rate.

【0013】上述するように、受信データが受信用バッ
ファに保持され、受信データの読み出しを要求する割り
込み要求信号INTがCPUに対して出力されると、C
PUにより受信用バッファに保持されている受信データ
が読み出される。しかしながら、受信用バッファの個数
が少なくかつ通信レートが高速な場合、CPUが受信バ
ッファに保持されている受信データを読み出す前に、次
の受信データが受信用バッファに上書きされてしまい、
上書きされる前の受信データが消失してしまうという、
いわゆる受信オーバランエラーが発生する。
As described above, when the reception data is held in the reception buffer and the interrupt request signal INT requesting the reading of the reception data is output to the CPU, C
The PU reads out the reception data held in the reception buffer. However, when the number of reception buffers is small and the communication rate is high, the next reception data is overwritten in the reception buffer before the CPU reads the reception data held in the reception buffer,
Received data before being overwritten will be lost,
A so-called reception overrun error occurs.

【0014】一方、送信データを送信用バッファに書き
込む場合にも、送信用バッファの個数が少なくかつ通信
レートが高速な場合、割り込みルーチンの処理によるオ
ーバヘッドのために送信データの書き込みが間に合わな
くなり、シリアル通信コントローラから出力される送信
データが途中で途切れてしまうという、いわゆる送信ア
ンダランエラーが発生する。
On the other hand, even when the transmission data is written to the transmission buffer, if the number of transmission buffers is small and the communication rate is high, the writing of the transmission data cannot be performed in time due to the overhead due to the processing of the interrupt routine. A so-called transmission underrun error occurs in which transmission data output from the communication controller is interrupted on the way.

【0015】これらの問題を解決するためにも受信用お
よび送信用バッファの個数を多くすることが有効であ
る。このように、複数個の受信用バッファを備えること
により、高速な通信レートにも対応することができるよ
うになる。このため、できるだけ多くの受信用バッファ
および送信用バッファを備えるのが好ましいことは言う
までもないことである。
In order to solve these problems, it is effective to increase the number of reception and transmission buffers. By providing a plurality of reception buffers in this manner, it is possible to cope with a high communication rate. Therefore, it is needless to say that it is preferable to provide as many reception buffers and transmission buffers as possible.

【0016】しかしながら、複数個の受信用および送信
用バッファを備えるためには、当然のことながらハード
ウェアの規模が増大する。このため、これらの受信用お
よび送信用バッファの個数を増加させる毎にゲート数
(トランジスタ数)が増大し、そのレイアウト面積も増
大するという問題点がある。
However, the provision of a plurality of receiving and transmitting buffers naturally increases the scale of the hardware. For this reason, there is a problem that the number of gates (the number of transistors) increases each time the number of reception and transmission buffers increases, and the layout area also increases.

【0017】また、既に述べたように、シリアル通信コ
ントローラのハードウェアは全二重通信に対応している
にもかかわらず、受信データのエラー確認を行ってか
ら、送信データを出力するように設計されているものが
多い。このため、現実的には、シリアル通信コントロー
ラは半二重通信で使用されている場合がかなり多い。例
えば、モデムでは全二重通信が用いられているが、FA
XモデムやLAN(Local Area Network)全般、パーソ
ナルコンピュータと周辺機器との接続などにおいては半
二重通信が用いられている。
Further, as described above, despite the fact that the hardware of the serial communication controller supports full-duplex communication, it is designed so that the transmission data is output after checking the error of the received data. There are many things that have been done. Therefore, in reality, the serial communication controller is often used for half-duplex communication. For example, a modem uses full-duplex communication,
Half-duplex communication is used in X modems, LANs (Local Area Networks) in general, and connections between personal computers and peripheral devices.

【0018】従来より、ハードウェア的に全二重通信に
対応しているシリアル通信コントローラを、ソフトウェ
ア的に半二重通信で使用している場合が多いため、受信
の時は送信用バッファが全く使用されておらず、逆に、
送信の時は受信用バッファが全く使用されていなかっ
た。このため、受信用または送信用バッファのいずれか
全てが無駄になるという問題点もあった。
Conventionally, since a serial communication controller that supports full-duplex communication in hardware is often used for half-duplex communication in software, a transmission buffer is not used at the time of reception. Not used, conversely,
At the time of transmission, the receiving buffer was not used at all. For this reason, there is also a problem that any one of the reception buffer and the transmission buffer is wasted.

【0019】[0019]

【発明が解決しようとする課題】本発明の目的は、前記
従来技術に基づく種々の問題点をかえりみて、ハードウ
ェア規模を増大させることなく高速な通信レートに対応
することができ、比較的通信レートが低速な場合であっ
ても割り込み処理によるオーバヘッドを削減することが
できるシリアル通信方法およびシリアル通信コントロー
ラを提供することにある。
SUMMARY OF THE INVENTION It is an object of the present invention to provide a high-speed communication rate without increasing the scale of hardware in view of various problems based on the prior art. An object of the present invention is to provide a serial communication method and a serial communication controller that can reduce overhead due to interrupt processing even when the rate is low.

【0020】[0020]

【課題を解決するための手段】上記目的を達成するため
に、本発明は、少なくとも1つの受信用バッファおよび
少なくとも1つの送信用バッファを備えるシリアル通信
コントローラにおいて、全二重通信の送受信時に、前記
受信用および送信用バッファをそれぞれ受信用および送
信用バッファとして使用し、半二重通信の受信時に、前
記受信用および送信用バッファをともに受信用バッファ
として使用し、前記半二重通信の送信時に、前記受信用
および送信用バッファをともに送信用バッファとして使
用することを特徴とするシリアル通信方法を提供するも
のである。
In order to achieve the above object, the present invention provides a serial communication controller having at least one receiving buffer and at least one transmitting buffer. The reception and transmission buffers are used as reception and transmission buffers, respectively, and when receiving half-duplex communication, the reception and transmission buffers are both used as reception buffers, and when transmitting the half-duplex communication. The present invention also provides a serial communication method, wherein both the reception buffer and the transmission buffer are used as transmission buffers.

【0021】また、本発明は、少なくとも1つの受信用
バッファを有し、シリアルデータを受信してパラレルデ
ータに変換し、このパラレルデータを前記受信用バッフ
ァに保持する受信部と、少なくとも1つの送信用バッフ
ァを有し、送信しようとするパラレルデータを前記送信
用バッファに保持し、このパラレルデータをシリアルデ
ータに変換して送信する送信部と、制御信号により通信
方式を全二重通信または半二重通信に切り換え、前記全
二重通信の送受信時に、前記受信用および送信用バッフ
ァをそれぞれ受信用および送信用バッファとして使用
し、前記半二重通信の受信時に、前記受信用および送信
用バッファをともに受信用バッファとして使用し、前記
半二重通信の送信時に、前記受信用および送信用バッフ
ァをともに送信用バッファとして使用するよう設定する
切換え手段を備えることを特徴とするシリアル通信コン
トローラを提供するものである。
According to the present invention, there is provided a receiving unit having at least one receiving buffer, receiving serial data and converting the serial data into parallel data, and holding the parallel data in the receiving buffer; A transmission unit that has a trust buffer, holds parallel data to be transmitted in the transmission buffer, converts the parallel data into serial data, and transmits the serial data; Switching to duplex communication, when transmitting and receiving the full-duplex communication, the receiving and transmitting buffers are used as receiving and transmitting buffers, respectively, and when receiving the half-duplex communication, the receiving and transmitting buffers are used. Both are used as reception buffers, and during transmission of the half-duplex communication, both the reception and transmission buffers are used as transmission buffers. There is provided a serial communication controller, characterized in that it comprises a switching means configured to use as a file.

【0022】ここで、前記切換え手段を制御する制御信
号は、外部端子から入力される信号または内部制御レジ
スタから出力される信号であるのが好ましい。
Here, the control signal for controlling the switching means is preferably a signal input from an external terminal or a signal output from an internal control register.

【0023】[0023]

【発明の作用】本発明のシリアル通信コントローラは、
制御信号により、通信方式を全二重通信または半二重通
信に切り換える切換え手段を備えるものである。また、
本発明のシリアル通信方法においては、全二重通信によ
り受信および送信を同時に行う場合、受信用バッファは
受信用バッファとして使用され、同様に、送信用バッフ
ァは送信用バッファとして使用される。一方、半二重通
信により受信を行う場合、受信用バッファおよび送信用
バッファはともに受信用バッファとして使用され、同様
に、送信を行う場合、受信用バッファおよび送信用バッ
ファはともに送信用バッファとして使用される。従っ
て、本発明のシリアル通信方法およびシリアル通信コン
トローラによれば、全二重通信で使用される場合、従来
のシリアル通信コントローラと全く同様に動作すること
は勿論、半二重通信の受信または送信で使用される場
合、それぞれ受信用バッファまたは送信用バッファの個
数を倍増することができるため、より高速な通信レート
に対応することが可能になるばかりでなく、割り込み処
理によるオーバヘッドを削減してCPUを効率良く使用
することができる。
The serial communication controller according to the present invention comprises:
Switching means for switching the communication mode between full-duplex communication and half-duplex communication according to a control signal is provided. Also,
In the serial communication method of the present invention, when performing reception and transmission simultaneously by full-duplex communication, the reception buffer is used as a reception buffer, and similarly, the transmission buffer is used as a transmission buffer. On the other hand, when performing reception by half-duplex communication, both the reception buffer and the transmission buffer are used as reception buffers. Similarly, when performing transmission, both the reception buffer and the transmission buffer are used as transmission buffers. Is done. Therefore, according to the serial communication method and the serial communication controller of the present invention, when used in full-duplex communication, it operates in exactly the same manner as a conventional serial communication controller, and can also receive or transmit half-duplex communication. When used, the number of reception buffers or transmission buffers can be doubled, so that not only can a higher communication rate be supported, but also the overhead due to interrupt processing can be reduced and the CPU can be used. It can be used efficiently.

【0024】[0024]

【実施例】以下に、添付の図面に示す好適実施例に基づ
いて、本発明のシリアル通信方法およびシリアル通信コ
ントローラを詳細に説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, a serial communication method and a serial communication controller according to the present invention will be described in detail based on preferred embodiments shown in the accompanying drawings.

【0025】図1は、本発明のシリアル通信コントロー
ラの一実施例のブロック図である。このシリアル通信コ
ントローラ10は、受信部となる受信用シフトレジスタ
12および受信用バッファ14a,14b,14c,1
4dと、CPUインタフェース16と、送信部となる送
信用バッファ18a,18b,18c,18dおよび送
信用シフトレジスタ20と、切換え手段22とを有して
いる。なお、受信用バッファおよび送信用バッファの個
数は特に限定されるものではない。
FIG. 1 is a block diagram of one embodiment of the serial communication controller of the present invention. The serial communication controller 10 includes a receiving shift register 12 serving as a receiving unit and receiving buffers 14a, 14b, 14c, 1
4d, a CPU interface 16, transmission buffers 18a, 18b, 18c, 18d, transmission shift registers 20 as transmission units, and switching means 22. Note that the number of reception buffers and transmission buffers is not particularly limited.

【0026】このシリアル通信コントローラ10におい
て、受信用シフトレジスタ12は、シリアルデータを所
定ビット長のパラレルデータに変換する、いわゆるシリ
アル→パラレル変換器である。即ち、この受信用シフト
レジスタ12にはシリアルデータである受信データが入
力され、受信用シフトレジスタ12においてシリアル→
パラレル変換され、受信用シフトレジスタ12から所定
ビット長を有するパラレルデータとして出力される。
In the serial communication controller 10, the reception shift register 12 is a so-called serial-to-parallel converter for converting serial data into parallel data having a predetermined bit length. That is, the reception shift register 12 receives the reception data which is serial data, and the reception shift register 12
The data is parallel-converted and output from the reception shift register 12 as parallel data having a predetermined bit length.

【0027】また、受信用バッファ14a〜14dは、
FIFO(First-In-First-out )形式のバッファであ
る。即ち、これらの受信用バッファ14a〜14dに
は、受信用シフトレジスタ12から出力されるパラレル
データが順次入力されて一時的に保持され、受信用バッ
ファ14a〜14dからパラレルデータが読み出される
場合には、入力された順番に応じて順次読み出される。
The receiving buffers 14a to 14d are
This is a FIFO (First-In-First-out) format buffer. That is, parallel data output from the reception shift register 12 is sequentially input to these reception buffers 14a to 14d and temporarily stored therein. When the parallel data is read from the reception buffers 14a to 14d, , Are sequentially read in accordance with the input order.

【0028】また、CPUインタフェース16は、この
シリアル通信コントローラ10を制御するCPUと、こ
のシリアル通信コントローラ10の内部回路とのやり取
りを制御するものである。このCPUインタフェース1
6には、CPUから読み出し信号RD_および書き込み
信号WR_が入力され、CPUインタフェース16から
は割り込み要求信号INTがCPUに対して出力されて
いる。また、CPUとのやり取りには外部データバス信
号が双方向に用いられ、内部回路とのやり取りには内部
データバス信号が双方向に用いられる。
The CPU interface 16 controls exchange between a CPU that controls the serial communication controller 10 and an internal circuit of the serial communication controller 10. This CPU interface 1
6, a read signal RD_ and a write signal WR_ are input from the CPU, and an interrupt request signal INT is output from the CPU interface 16 to the CPU. An external data bus signal is used bidirectionally for communication with the CPU, and an internal data bus signal is used bidirectionally for communication with the internal circuit.

【0029】また、送信用バッファ18a〜18dは、
受信用バッファ14a〜14dと同様にFIFO形式の
バッファである。即ち、これらの送信用バッファ18a
〜18dには、外部データバス、CPUインタフェース
16および内部データバスを通して、CPUから入力さ
れるパラレルデータが一時的に保持され、送信用バッフ
ァ18a〜18dからパラレルデータが読み出される場
合には、入力された順番に応じて順次読み出される。
The transmission buffers 18a to 18d
It is a buffer of the FIFO format like the receiving buffers 14a to 14d. That is, these transmission buffers 18a
To 18d temporarily hold parallel data input from the CPU through the external data bus, the CPU interface 16, and the internal data bus. When parallel data is read from the transmission buffers 18a to 18d, the parallel data is input to Are sequentially read out according to the order in which they are read.

【0030】また、送信用シフトレジスタ20は、所定
ビット長のパラレルデータをシリアルデータに変換す
る、いわゆるパラレル→シリアル変換器である。即ち、
この送信用シフトレジスタ20には、保持された順番に
応じて送信用バッファ18a〜18dから読み出される
パラレルデータが順次入力され、送信用シフトレジスタ
20においてパラレル→シリアル変換され、送信用シフ
トレジスタ20からシリアルデータである送信データと
して出力される。
The transmission shift register 20 is a so-called parallel-to-serial converter for converting parallel data having a predetermined bit length into serial data. That is,
Parallel data read from the transmission buffers 18a to 18d is sequentially input to the transmission shift register 20 in accordance with the held order, and the transmission shift register 20 performs parallel-to-serial conversion. Output as transmission data which is serial data.

【0031】最後に、切換え手段22は、このシリアル
通信コントローラ10の通信方式を全二重通信、または
半二重通信のいずれかに切り換えるものである。例え
ば、切換え手段22に入力される制御信号をハイレベル
に設定することにより、このシリアル通信コントローラ
10は全二重通信で使用され、逆にローレベルに設定す
ることにより半二重通信で使用される。
Finally, the switching means 22 switches the communication system of the serial communication controller 10 to either full-duplex communication or half-duplex communication. For example, by setting the control signal input to the switching means 22 to a high level, the serial communication controller 10 is used in full-duplex communication, and conversely, by setting it to a low level, the serial communication controller 10 is used in half-duplex communication. You.

【0032】なお、切換え手段22に入力される制御信
号は、CPUから専用入力端子を通して入力される制御
信号、あるいはCPUによりCPUインタフェース16
を介してソフトウェア的に設定される内部制御レジスタ
から出力される制御信号などであるのが好ましい。
The control signal input to the switching means 22 is a control signal input from the CPU through a dedicated input terminal, or a CPU interface 16 by the CPU.
Preferably, the control signal is a control signal output from an internal control register that is set by software through the CPU.

【0033】次に、本発明のシリアル通信方法および上
述するシリアル通信コントローラ10の動作について説
明する。
Next, the serial communication method of the present invention and the operation of the serial communication controller 10 will be described.

【0034】本発明のシリアル通信コントローラ10を
全二重通信で使用するには、例えば切換え手段22に入
力される制御信号としてハイレベルを設定する。これに
より、このシリアル通信コントローラ10は全二重通信
で使用され、即ち、受信用バッファ14a〜14dは受
信用バッファとして、また、送信用バッファ18a〜1
8dは送信用バッファとして、それぞれ別々に用いられ
る。なお、本発明のシリアル通信コントローラ10を全
二重通信で使用する場合の動作は、図5に示す従来のシ
リアル通信コントローラ60の動作と同一であるため、
ここではその説明は省略する。
To use the serial communication controller 10 of the present invention in full-duplex communication, for example, a high level is set as a control signal input to the switching means 22. As a result, the serial communication controller 10 is used for full-duplex communication, that is, the receiving buffers 14a to 14d are used as receiving buffers and the transmitting buffers 18a to 18a are used.
8d are used separately as transmission buffers. The operation when the serial communication controller 10 of the present invention is used for full-duplex communication is the same as the operation of the conventional serial communication controller 60 shown in FIG.
Here, the description is omitted.

【0035】一方、本発明のシリアル通信方法を適用し
て、このシリアル通信コントローラ10を半二重通信で
使用するには、切換え手段22に入力される制御信号と
してローレベルを設定する。これにより、このシリアル
通信コントローラ10は半二重通信で使用され、即ち、
受信用バッファ14a〜14dおよび送信用バッファ1
8a〜18dは、図2に示すように、受信の場合には全
て受信用バッファとして、また、図3に示すように、送
信の場合には全て送信用バッファとして用いられる。
On the other hand, in order to use the serial communication controller 10 for half-duplex communication by applying the serial communication method of the present invention, a low level is set as a control signal input to the switching means 22. Thereby, the serial communication controller 10 is used for half-duplex communication, that is,
Reception buffers 14a to 14d and transmission buffer 1
As shown in FIG. 2, 8a to 18d are all used as reception buffers in the case of reception, and as shown in FIG. 3, all are used as transmission buffers in the case of transmission.

【0036】半二重通信の受信において、シリアルデー
タである受信データは受信用シフトレジスタ12に入力
され、シリアル→パラレル変換されて所定ビット長、例
えば8ビット長のパラレルデータに変換され、受信用バ
ッファ14a〜14dおよび送信用バッファ18a〜1
8dに順次入力されて一時的に保持される。ここで、受
信用バッファ14a〜14dおよび送信用バッファ18
a〜18dに保持することができる最大個数、例えば図
示例においては8個のパラレルデータが保持された場
合、CPUインタフェース16からCPUに対して、受
信データの読み出しを要求する割り込み要求信号INT
が出力される。CPUは割り込み要求信号INTを受け
取ると、メインルーチンから割り込みルーチンへ分岐
し、読み出し信号RD_をアクティブ状態、例えばロー
レベルとして、受信用バッファ14a〜14dおよび送
信用バッファ18a〜18dに保持されているパラレル
データを保持された順番に応じて、内部データバス、C
PUインタフェース16および外部データバスを通して
順次読み出した後、再度メインルーチンへ復帰する。こ
のようにして受信データは受信される。
In the reception of the half-duplex communication, the reception data, which is serial data, is input to the reception shift register 12 and is converted from serial data to parallel data to be converted into parallel data having a predetermined bit length, for example, 8 bits. Buffers 14a to 14d and transmission buffers 18a to 1
8d are sequentially input and temporarily stored. Here, the reception buffers 14a to 14d and the transmission buffer 18
When the maximum number of parallel data that can be stored in each of the data a to d, for example, eight parallel data in the illustrated example, an interrupt request signal INT for requesting the CPU to read the received data from the CPU interface 16,
Is output. Upon receiving the interrupt request signal INT, the CPU branches from the main routine to the interrupt routine, and sets the read signal RD_ to an active state, for example, a low level, and sets the read signal RD_ to the parallel state held in the reception buffers 14a to 14d and the transmission buffers 18a to 18d. The internal data bus, C
After sequentially reading through the PU interface 16 and the external data bus, the process returns to the main routine again. Thus, the received data is received.

【0037】また、半二重通信の送信において、CPU
はメインルーチンから割り込みルーチンへ分岐し、書き
込み信号WR_をアクティブ状態、例えばローレベルと
して、外部データバス、CPUインタフェースおよび内
部データバスを通して、送信用バッファ18a〜18d
および受信用バッファ14a〜14dに保持することが
できる最大個数、例えば図示例においては8個のパラレ
ルデータを順次送信用バッファ18a〜18dおよび受
信用バッファ14a〜14dに書き込んだ後、再度メイ
ンルーチンへ復帰する。送信用バッファ18a〜18d
および受信用バッファ14a〜14dに書き込まれたパ
ラレルデータは、書き込まれた順番に応じて順次読み出
され、送信用シフトレジスタ20により、パラレル→シ
リアル変換されてシリアルデータである送信データとし
て出力される。ここで、送信用バッファ18a〜18d
および受信用バッファ14a〜14dに書き込まれた全
てのパラレルデータが読み出された場合、CPUインタ
フェース16からCPUに対して、次のパラレルデータ
の書き込みを要求する割り込み要求信号INTが出力さ
れる。このようにして送信データは送信される。
In transmitting half-duplex communication, the CPU
Branches from the main routine to the interrupt routine, and sets the write signal WR_ to an active state, for example, a low level, through the external data bus, the CPU interface, and the internal data bus to transmit the buffers 18a to 18d.
After the maximum number of data that can be held in the receiving buffers 14a to 14d, for example, eight parallel data in the illustrated example are sequentially written to the transmitting buffers 18a to 18d and the receiving buffers 14a to 14d, the process returns to the main routine. Return. Transmission buffers 18a to 18d
The parallel data written in the receiving buffers 14a to 14d are sequentially read out in accordance with the written order, and are converted from parallel to serial by the transmission shift register 20 and output as transmission data that is serial data. . Here, the transmission buffers 18a to 18d
When all the parallel data written to the receiving buffers 14a to 14d are read, the CPU interface 16 outputs an interrupt request signal INT requesting the CPU to write the next parallel data. The transmission data is transmitted in this way.

【0038】上述するように、本発明のシリアル通信方
法を適用して、シリアル通信コントローラを半二重通信
で使用する場合には、受信の時に送信用バッファをも受
信用バッファとして、同様に、送信の時に受信用バッフ
ァをも送信用バッファとして使用することができる。こ
のため、従来と同数の受信用および送信用バッファしか
有していないにもかかわらず、従来の2倍の個数の受信
用および送信用バッファとして使用することができる。
As described above, when the serial communication method of the present invention is applied and the serial communication controller is used for half-duplex communication, the transmission buffer is also used as the reception buffer at the time of reception. At the time of transmission, a reception buffer can also be used as a transmission buffer. For this reason, it can be used as twice as many receiving and transmitting buffers as the conventional one, although it has only the same number of receiving and transmitting buffers as the conventional one.

【0039】従って、本発明のシリアル通信方法によれ
ば、新規に受信用および送信用バッファを追加するより
も少ないハードウェア規模で、高速な通信レートのシリ
アル通信に対応することができるし、逆に、通信レート
が比較的低速である場合であっても、割り込みルーチン
の処理によるオーバヘッドを削減してCPUを効率良く
使用することができる。
Therefore, according to the serial communication method of the present invention, it is possible to cope with serial communication at a high communication rate with a smaller hardware scale than adding a new reception and transmission buffer. In addition, even when the communication rate is relatively low, the overhead due to the processing of the interrupt routine can be reduced and the CPU can be used efficiently.

【0040】次に、具体例を挙げて、本発明のシリアル
通信方法およびシリアル通信コントローラをさらに具体
的に説明する。
Next, the serial communication method and the serial communication controller of the present invention will be described more specifically with reference to specific examples.

【0041】図4は、本発明のシリアル通信コントロー
ラの一実施例の構成回路図である。このシリアル通信コ
ントローラ30は、受信部となる受信用シフトレジスタ
12、受信用バッファ14a,14b,14c,14
d、受信用ライトポインタ28、受信用リードポインタ
32およびマルチプレクサ34と、送信部となる送信用
バッファ18a,18b,18c,18d、送信用シフ
トレジスタ20、送信用ライトポインタ40、送信用リ
ードポインタ42およびマルチプレクサ44と、切換え
手段となるセレクタ24a,24b,24c,24d、
セレクタ26a,26b,26c,26d、セレクタ3
6a,36b,36c,36dおよびセレクタ38a,
38b,38c,38dとから構成されている。
FIG. 4 is a circuit diagram showing an embodiment of the serial communication controller according to the present invention. The serial communication controller 30 includes a reception shift register 12 serving as a reception unit, reception buffers 14a, 14b, 14c, and 14
d, the reception write pointer 28, the reception read pointer 32, and the multiplexer 34, the transmission buffers 18a, 18b, 18c, and 18d serving as transmission units, the transmission shift register 20, the transmission write pointer 40, and the transmission read pointer 42 And multiplexers 44, and selectors 24a, 24b, 24c, 24d as switching means,
Selectors 26a, 26b, 26c, 26d, selector 3
6a, 36b, 36c, 36d and selector 38a,
38b, 38c and 38d.

【0042】ここで、シリアルデータである受信データ
は受信用シフトレジスタ12に入力され、この受信用シ
フトレジスタ12の出力信号46はセレクタ24a〜2
4dの入力端0およびセレクタ36a〜36dの入力端
1に入力されている。同様に、CPUからの入力信号4
8は、内部データバスを通してセレクタ36a〜36d
の入力端0およびセレクタ24a〜24dの入力端1に
入力されている。
Here, the received data, which is serial data, is input to the receiving shift register 12, and the output signal 46 of the receiving shift register 12 is supplied to the selectors 24a to 24a.
4d and input terminals 1 of selectors 36a-36d. Similarly, the input signal 4 from the CPU
8 are selectors 36a to 36d through an internal data bus.
And input terminals 1 of selectors 24a to 24d.

【0043】また、受信用ライトポインタ28からはラ
イトイネーブル信号R_WE0,R_WE1,R_WE
2,R_WE3,R_WE4,R_WE5,R_WE
6,R_WE7が出力され、それぞれセレクタ26a〜
26dの入力端0およびセレクタ38a〜38dの入力
端1に入力されている。同様に、送信用ライトポインタ
40からはライトイネーブル信号T_WE0,T_WE
1,T_WE2,T_WE3,T_WE4,T_WE
5,T_WE6,T_WE7が出力され、それぞれセレ
クタ38a〜38dの入力端0およびセレクタ26a〜
26dの入力端1に入力されている。
The write enable signals R_WE0, R_WE1, R_WE are received from the write pointer 28 for reception.
2, R_WE3, R_WE4, R_WE5, R_WE
6, R_WE7 are output, and selectors 26a to 26
26d and input terminals 1 of selectors 38a-38d. Similarly, the write enable signals T_WE0 and T_WE are transmitted from the transmission write pointer 40.
1, T_WE2, T_WE3, T_WE4, T_WE
5, T_WE6, T_WE7 are output, and input terminals 0 of selectors 38a to 38d and selectors 26a to 26d respectively.
26d is input to the input terminal 1.

【0044】また、セレクタ24a〜24dおよびセレ
クタ36a〜36dの出力信号は、それぞれ受信用バッ
ファ14a〜14dおよび送信用バッファ18a〜18
dのデータ入力端に入力され、同様に、セレクタ26a
〜26dおよびセレクタ38a〜38dの出力信号は、
それぞれ受信用バッファ14a〜14dおよび送信用バ
ッファ18a〜18dのライトイネーブル端WEに入力
されている。また、セレクタ24a〜24dおよびセレ
クタ26a〜26dの選択端にはともに選択信号SEL
Rが入力され、同様に、セレクタ36a〜36dおよび
セレクタ38a〜38dの選択端にはともに選択信号S
ELTが入力されている。
The output signals of the selectors 24a to 24d and the selectors 36a to 36d are respectively supplied to the receiving buffers 14a to 14d and the transmitting buffers 18a to 18d.
d to the data input terminal of the selector 26a.
To 26d and the output signals of the selectors 38a to 38d are
These are input to the write enable terminals WE of the receiving buffers 14a to 14d and the transmitting buffers 18a to 18d, respectively. The selection signals SEL are provided to the selection ends of the selectors 24a to 24d and the selectors 26a to 26d.
R is input to the selectors 36a to 36d and the selectors 38a to 38d.
ELT has been entered.

【0045】また、受信用バッファ14a〜14dから
はパラレルデータR0,R1,R2,R3が出力され、
これらのパラレルデータR0〜R3はそれぞれマルチプ
レクサ34のデータ入力端0,1,2,3およびマルチ
プレクサ44のデータ入力端4,5,6,7に入力され
ている。同様に、送信用バッファ18a〜18dからは
パラレルデータT0,T1,T2,T3が出力され、こ
れらのパラレルデータT0〜T3はそれぞれマルチプレ
クサ44のデータ入力端0,1,2,3およびマルチプ
レクサ34のデータ入力端4,5,6,7に入力されて
いる。
The receiving buffers 14a to 14d output parallel data R0, R1, R2, and R3.
These parallel data R0 to R3 are input to the data input terminals 0, 1, 2, 3 of the multiplexer 34 and the data input terminals 4, 5, 6, 7 of the multiplexer 44, respectively. Similarly, the transmission buffers 18a to 18d output parallel data T0, T1, T2, and T3. These parallel data T0 to T3 are output from the data input terminals 0, 1, 2, and 3 of the multiplexer 44 and the multiplexer 34, respectively. The data is input to data input terminals 4, 5, 6, and 7.

【0046】また、マルチプレクサ34の選択端には受
信用リードポインタ32から出力される選択信号50が
入力され、その出力信号は内部データバスに接続されて
いる。同様に、マルチプレクサ44の選択端には送信用
リードポインタ42から出力される選択信号52が入力
され、その出力信号は送信用シフトレジスタ20に入力
されている。そして、送信用シフトレジスタ20からは
シリアルデータである送信データが出力されている。
The selection signal 50 output from the reception read pointer 32 is input to the selection terminal of the multiplexer 34, and the output signal is connected to the internal data bus. Similarly, a selection signal 52 output from the transmission read pointer 42 is input to the selection end of the multiplexer 44, and the output signal is input to the transmission shift register 20. The transmission shift register 20 outputs transmission data that is serial data.

【0047】このシリアル通信コントローラ30におい
て、受信用シフトレジスタ12、受信用バッファ14a
〜14d、送信用シフトレジスタ20および送信用バッ
ファ18a〜18dは、図1に示すシリアル通信コント
ローラ10と同一のものであるから、ここではその説明
は省略する。また、受信用ライトポインタ28および受
信用リードポインタ32と、送信用ライトポインタ40
および送信用リードポインタ42とは同様の機能を有す
るものであるため、ここでは受信用ライトポインタ28
および受信用リードポインタ32についてのみ説明す
る。
In the serial communication controller 30, the reception shift register 12, the reception buffer 14a
1 to 14d, the transmission shift register 20, and the transmission buffers 18a to 18d are the same as those in the serial communication controller 10 shown in FIG. Further, the reception write pointer 28 and the reception read pointer 32, and the transmission write pointer 40
Since the transmission read pointer 42 has the same function as the transmission read pointer 42, the reception write pointer 28
Only the reception read pointer 32 will be described.

【0048】まず、受信用ライトポインタ28は、受信
用シフトレジスタ12から出力される出力信号46が保
持される受信用バッファ14a〜14dまたは送信用バ
ッファ18a〜18dを決定するライトイネーブル信号
R_WE0〜R_WE7を出力する。この受信用ライト
ポインタ28は、受信用シフトレジスタ12によりシリ
アル→パラレル変換が終了し、出力信号46が出力され
る毎にカウントアップされるカウンタを有しており、こ
のカウンタの値に応じてライトイネーブル信号R_WE
0〜R_WE7の中の1つだけがアクティブ状態にされ
る。
First, the reception write pointer 28 is provided with write enable signals R_WE0 to R_WE7 for determining the reception buffers 14a to 14d or the transmission buffers 18a to 18d in which the output signal 46 output from the reception shift register 12 is held. Is output. The reception write pointer 28 has a counter that counts up each time the output signal 46 is output after serial-to-parallel conversion has been completed by the reception shift register 12. Enable signal R_WE
Only one of 0-R_WE7 is activated.

【0049】なお、全二重通信の場合、上述するカウン
タの値は‘0’〜‘3’の範囲でカウントアップされ、
‘3’の次は‘0’に初期化される。また、このカウン
タの値‘0’〜‘3’に応じて、ライトイネーブル信号
R_WE0〜R_WE3の中の1つがアクティブ状態に
される。同様に、半二重通信の場合、上述するカウンタ
の値は‘0’〜‘7’の範囲でカウントアップされ、
‘7’の次は‘0’に初期化される。また、このカウン
タの値‘0’〜‘7’に応じて、ライトイネーブル信号
R_WE0〜R_WE7の中の1つがアクティブ状態に
される。
In the case of full-duplex communication, the value of the above-described counter is counted up in the range of '0' to '3'.
After '3', it is initialized to '0'. Also, one of the write enable signals R_WE0 to R_WE3 is activated according to the value of the counter from '0' to '3'. Similarly, in the case of half-duplex communication, the value of the above-described counter is counted up in a range of '0' to '7',
After '7', it is initialized to '0'. Also, one of the write enable signals R_WE0 to R_WE7 is activated according to the value of the counter from '0' to '7'.

【0050】また、受信用リードポインタ32は、受信
用バッファ14a〜14dから出力されるパラレルデー
タR0〜R3および送信用バッファ18a〜18dから
出力されるパラレルデータT0〜T3の中から、CPU
により読み出されるパラレルデータを選択する選択信号
50を出力するものである。この受信用リードポインタ
32は、受信用バッファ14a〜14dおよび送信用バ
ッファ18a〜18dからパラレルデータが、CPUに
より読み出される毎にカウントアップされるカウンタを
有しており、このカウンタの値‘0’〜‘7’に応じ
て、それぞれマルチプレクサ34のデータ入力端0〜7
に入力されているパラレルデータR0〜R3およびパラ
レルデータT0〜T3の中の1つが選択される。
Further, the reception read pointer 32 is used by the CPU among the parallel data R0 to R3 output from the reception buffers 14a to 14d and the parallel data T0 to T3 output from the transmission buffers 18a to 18d.
Outputs a selection signal 50 for selecting the parallel data to be read. The reception read pointer 32 has a counter which counts up each time parallel data is read out from the reception buffers 14a to 14d and the transmission buffers 18a to 18d by the CPU, and the value of this counter is "0". To '7', the data input terminals 0 to 7 of the multiplexer 34, respectively.
Is selected from among the parallel data R0 to R3 and the parallel data T0 to T3 input to the.

【0051】なお、全二重通信の場合、上述するカウン
タの値は‘0’〜‘3’の範囲でカウントアップされ、
‘3’の次は‘0’に初期化される。同様に、半二重通
信の場合、上述するカウンタの値は‘0’〜‘7’の範
囲でカウントアップされ、‘7’の次は‘0’に初期化
される。
In the case of full-duplex communication, the value of the above-described counter is counted up in the range of '0' to '3'.
After '3', it is initialized to '0'. Similarly, in the case of half-duplex communication, the value of the above-described counter is counted up in the range of '0' to '7', and is initialized to '0' after '7'.

【0052】次に、このシリアル通信コントローラ30
の動作について説明する。
Next, the serial communication controller 30
Will be described.

【0053】まず、このシリアル通信コントローラ30
を全二重通信で使用するには、制御信号SELR,SE
LTをともにローレベルに設定する。これにより、セレ
クタ24a〜24d、セレクタ26a〜26d、セレク
タ36a〜36dおよびセレクタ38a〜38dは、入
力端0に入力される信号が選択出力される。
First, the serial communication controller 30
Is used in full-duplex communication, the control signals SELR, SE
Both LT are set to low level. Thus, the selectors 24a to 24d, the selectors 26a to 26d, the selectors 36a to 36d, and the selectors 38a to 38d selectively output the signal input to the input terminal 0.

【0054】即ち、受信用バッファ14a〜14dのデ
ータ入力端にはともに受信用シフトレジスタ12の出力
信号46が入力され、そのライトイネーブル端WEには
それぞれライトイネーブル信号R_WE0〜R_WE3
が入力される。同様に、送信用バッファ18a〜18d
のデータ入力端にはともに、CPUからの入力信号48
が内部データバスを通して入力され、そのライトイネー
ブル端WEにはそれぞれライトイネーブル信号T_WE
0〜T_WE3が入力される。
That is, the output signals 46 of the receiving shift register 12 are input to the data input terminals of the receiving buffers 14a to 14d, respectively, and the write enable terminals R_WE0 to R_WE3 are respectively supplied to the write enable terminals WE.
Is entered. Similarly, transmission buffers 18a to 18d
Of the input signal 48 from the CPU.
Is input through an internal data bus, and its write enable terminal WE has a write enable signal T_WE, respectively.
0 to T_WE3 are input.

【0055】全二重通信の受信において、受信用シフト
レジスタ12により、受信データがシリアル→パラレル
変換されて出力信号46が出力される毎に、受信用ライ
トポインタ28から出力されるライトイネーブル信号R
_WE0〜R_WE3はこの順番でアクティブ状態にさ
れる。その結果、受信用シフトレジスタ12の出力信号
46は、受信用バッファ14a〜14dにこの順番で保
持される。一方、CPUが受信用バッファ14a〜14
dに保持されているパラレルデータR0〜R3を読み出
す場合、CPUによりパラレルデータR0〜R3が読み
出される毎に、受信用リードポインタ32から出力され
る選択信号50はその値が‘0’〜‘3’の順番でカウ
ントアップされる。その結果、パラレルデータR0〜R
3は、マルチプレクサ34によりこの順番で選択出力さ
れ、CPUにより内部データバスを通してこの順番で読
み出される。
In the reception of full-duplex communication, every time the reception data is converted from serial to parallel by the reception shift register 12 and the output signal 46 is output, the write enable signal R output from the reception write pointer 28 is output.
_WE0 to R_WE3 are activated in this order. As a result, the output signal 46 of the receiving shift register 12 is held in the receiving buffers 14a to 14d in this order. On the other hand, the CPU sets the reception buffers 14a to 14
When reading the parallel data R0 to R3 held in d, each time the CPU reads the parallel data R0 to R3, the selection signal 50 output from the reception read pointer 32 has a value of '0' to '3'. 'Are counted up in order. As a result, the parallel data R0-R
3 are selectively output in this order by the multiplexer 34, and are read out in this order by the CPU through the internal data bus.

【0056】また、全二重通信の送信において、CPU
からの入力信号48が入力される毎に、送信用ライトポ
インタ40から出力されるライトイネーブル信号T_W
E0〜T_WE3はこの順番でアクティブ状態にされ
る。その結果、CPUからの入力信号48は、送信用バ
ッファ18a〜18dにこの順番で保持される。一方、
送信用バッファ18a〜18dに保持されているパラレ
ルデータT0〜T3が読み出される場合、パラレルデー
タT0〜T3が読み出される毎に、送信用リードポイン
タ42から出力される選択信号52はその値が‘0’〜
‘3’の順番でカウントアップされる。その結果、パラ
レルデータT0〜T3は、マルチプレクサ44によりこ
の順番で選択出力され、この順番で送信用シフトレジス
タ20によりパラレル→シリアル変換されて送信データ
として出力される。
In the transmission of full-duplex communication, the CPU
The write enable signal T_W output from the transmission write pointer 40 every time the input signal 48
E0 to T_WE3 are activated in this order. As a result, the input signal 48 from the CPU is held in the transmission buffers 18a to 18d in this order. on the other hand,
When the parallel data T0 to T3 held in the transmission buffers 18a to 18d are read, every time the parallel data T0 to T3 is read, the value of the selection signal 52 output from the transmission read pointer 42 becomes '0'. '~
It is counted up in the order of '3'. As a result, the parallel data T0 to T3 are selected and output in this order by the multiplexer 44, and are converted from parallel to serial by the transmission shift register 20 in this order and output as transmission data.

【0057】次に、このシリアル通信コントローラ30
を半二重通信の受信で使用するには、制御信号SEL
R,SELTをそれぞれローレベルおよびハイレベルに
設定する。これにより、セレクタ24a〜24d、セレ
クタ26a〜26dは、入力端0に入力される信号が選
択出力され、逆に、セレクタ36a〜36dおよびセレ
クタ38a〜38dは、入力端1に入力される信号が選
択出力される。
Next, the serial communication controller 30
Is used for receiving half-duplex communication, the control signal SEL
R and SELT are set to a low level and a high level, respectively. As a result, the selectors 24a to 24d and the selectors 26a to 26d selectively output the signal input to the input terminal 0, and conversely, the selectors 36a to 36d and the selectors 38a to 38d output the signal input to the input terminal 1. Selected output.

【0058】即ち、受信用バッファ14a〜14dのデ
ータ入力端にはともに受信用シフトレジスタ12の出力
信号46が入力され、そのライトイネーブル端WEには
それぞれライトイネーブル信号R_WE0〜R_WE3
が入力される。同様に、送信用バッファ18a〜18d
のデータ入力端にはともに受信用シフトレジスタ12の
出力信号46が入力され、そのライトイネーブル端WE
にはそれぞれライトイネーブル信号R_WE4〜R_W
E7が入力される。
That is, the output signals 46 of the receiving shift register 12 are input to the data input terminals of the receiving buffers 14a to 14d, respectively, and the write enable signals R_WE0 to R_WE3 are respectively supplied to the write enable terminals WE.
Is entered. Similarly, transmission buffers 18a to 18d
The output signal 46 of the receiving shift register 12 is input to both data input terminals of the write enable terminal WE.
Respectively have write enable signals R_WE4 to R_W
E7 is input.

【0059】半二重通信の受信において、受信用シフト
レジスタ12により、受信データがシリアル→パラレル
変換されて出力信号46が出力される毎に、受信用ライ
トポインタ28から出力されるライトイネーブル信号R
_WE0〜R_WE7はこの順番でアクティブ状態にさ
れる。その結果、受信用シフトレジスタ12の出力信号
46は、受信用バッファ14a〜14dおよび送信用バ
ッファ18a〜18dにこの順番で保持される。一方、
CPUが受信用バッファ14a〜14dに保持されてい
るパラレルデータR0〜R3および送信用バッファ18
a〜18dに保持されているパラレルデータT0〜T3
を読み出す場合、CPUによりパラレルデータR0〜R
3およびパラレルデータT0〜T3が読み出される毎
に、受信用リードポインタ32から出力される選択信号
50はその値が‘0’〜‘7’の順番でカウントアップ
される。その結果、パラレルデータR0〜R3およびパ
ラレルデータT0〜T3は、マルチプレクサ34により
この順番で選択出力され、CPUにより内部データバス
を通してこの順番で読み出される。
In the reception of half-duplex communication, the write enable signal R output from the reception write pointer 28 every time the reception data is converted from serial to parallel by the reception shift register 12 and the output signal 46 is output.
_WE0 to R_WE7 are activated in this order. As a result, the output signal 46 of the reception shift register 12 is held in the reception buffers 14a to 14d and the transmission buffers 18a to 18d in this order. on the other hand,
The CPU controls the parallel data R0 to R3 and the transmission buffer 18 held in the reception buffers 14a to 14d.
a to 18d of parallel data T0 to T3
Is read by the CPU, the parallel data R0 to R
Every time 3 and the parallel data T0 to T3 are read, the value of the selection signal 50 output from the reception read pointer 32 is counted up in the order of '0' to '7'. As a result, the parallel data R0 to R3 and the parallel data T0 to T3 are selected and output in this order by the multiplexer 34, and are read out in this order by the CPU through the internal data bus.

【0060】次に、このシリアル通信コントローラ30
を半二重通信の送信で使用するには、制御信号SEL
R,SELTをそれぞれハイレベルおよびローレベルに
設定する。これにより、セレクタ24a〜24d、セレ
クタ26a〜26dは、入力端1に入力される信号が選
択出力され、逆に、セレクタ36a〜36dおよびセレ
クタ38a〜38dは、入力端0に入力される信号が選
択出力される。
Next, the serial communication controller 30
Is used for transmitting half-duplex communication, the control signal SEL
R and SELT are set to a high level and a low level, respectively. Thus, the selectors 24a to 24d and the selectors 26a to 26d select and output the signal input to the input terminal 1, and conversely, the selectors 36a to 36d and the selectors 38a to 38d output the signal input to the input terminal 0. Selected output.

【0061】即ち、送信用バッファ18a〜18dのデ
ータ入力端にはともにCPUからの入力信号48が入力
され、そのライトイネーブル端WEにはそれぞれライト
イネーブル信号T_WE0〜T_WE3が入力される。
同様に、受信用バッファ14a〜14dのデータ入力端
にはともにCPUからの入力信号48が入力され、その
ライトイネーブル端WEにはそれぞれライトイネーブル
信号T_WE4〜T_WE7が入力される。
That is, an input signal 48 from the CPU is input to both data input terminals of the transmission buffers 18a to 18d, and write enable signals T_WE0 to T_WE3 are input to their write enable terminals WE, respectively.
Similarly, an input signal 48 from the CPU is input to the data input terminals of the receiving buffers 14a to 14d, and write enable signals T_WE4 to T_WE7 are input to the write enable terminals WE, respectively.

【0062】半二重通信の送信において、CPUからの
入力信号48が入力される毎に、送信用ライトポインタ
40から出力されるライトイネーブル信号T_WE0〜
T_WE7はこの順番でアクティブ状態にされる。その
結果、CPUからの入力信号48は、送信用バッファ1
8a〜18dおよび受信用バッファ14a〜14dにこ
の順番で保持される。一方、送信用バッファ18a〜1
8dに保持されているパラレルデータT0〜T3および
受信用バッファ14a〜14dに保持されているパラレ
ルデータR0〜R3が読み出される場合、パラレルデー
タT0〜T3およびパラレルデータR0〜R3が読み出
される毎に、送信用リードポインタ42から出力される
選択信号52はその値が‘0’〜‘7’の順番でカウン
トアップされる。その結果、パラレルデータT0〜T3
およびパラレルデータR0〜R3は、マルチプレクサ4
4によりこの順番で選択出力され、この順番で送信用シ
フトレジスタ20によりパラレル→シリアル変換されて
送信データとして出力される。
In the transmission of half-duplex communication, every time the input signal 48 from the CPU is input, the write enable signals T_WE0 to T_WE0 output from the transmission write pointer 40
T_WE7 is activated in this order. As a result, the input signal 48 from the CPU is transmitted to the transmission buffer 1.
8a to 18d and reception buffers 14a to 14d are stored in this order. On the other hand, the transmission buffers 18a-1
When the parallel data T0 to T3 held in 8d and the parallel data R0 to R3 held in the reception buffers 14a to 14d are read, every time the parallel data T0 to T3 and the parallel data R0 to R3 are read, The value of the selection signal 52 output from the transmission read pointer 42 is counted up in the order of '0' to '7'. As a result, the parallel data T0 to T3
And the parallel data R0 to R3 are
4, the data is selectively output in this order, and is converted from parallel to serial by the transmission shift register 20 in this order and output as transmission data.

【0063】このように、シリアル通信コントローラ3
0においては、制御信号SELR,SELTを適宜設定
することにより、このシリアル通信コントローラ30の
通信方式を全二重通信または半二重通信のいずれかに切
り換えることができる。また、半二重通信で使用する場
合、受信では送信用バッファ18a〜18dをも受信用
バッファとして使用することができ、同様に、送信では
受信用バッファ14a〜14dをも送信用バッファとし
て使用することができる。
As described above, the serial communication controller 3
At 0, the communication system of the serial communication controller 30 can be switched to either full-duplex communication or half-duplex communication by appropriately setting the control signals SELR and SELT. When used in half-duplex communication, the transmission buffers 18a to 18d can also be used as reception buffers in reception, and similarly, the reception buffers 14a to 14d are also used as transmission buffers in transmission. be able to.

【0064】[0064]

【発明の効果】以上詳細に説明した様に、本発明のシリ
アル通信方法およびシリアル通信コントローラにおいて
は、シリアルデータの通信方式が全二重通信または半二
重通信のいずれかに切換えられるため、全二重通信で従
来のシリアル通信コントローラと同一動作を行うことが
できることは勿論、さらに半二重通信の受信で受信用バ
ッファおよび送信用バッファをともに受信用バッファと
して使用することができ、同様に、送信でこれらのバッ
ファをともに送信用バッファとして使用することができ
る。従って、本発明のシリアル通信方法およびシリアル
通信コントローラによれば、新規に受信用および送信用
バッファを追加するよりも少ないハードウェア規模で、
受信用および送信用バッファを増加させることができ、
より高速な通信レートに対応することが可能になるとと
もに、割り込み処理によるオーバヘッドを削減して、C
PUを効率良く使用することができる。
As described in detail above, in the serial communication method and the serial communication controller of the present invention, the serial data communication method is switched to either full-duplex communication or half-duplex communication. Of course, the same operation as the conventional serial communication controller can be performed by the duplex communication, and furthermore, the reception buffer and the transmission buffer can be used as the reception buffer in the reception of the half-duplex communication. In transmission, these buffers can be used together as transmission buffers. Therefore, according to the serial communication method and the serial communication controller of the present invention, with a smaller hardware scale than adding a new reception and transmission buffer,
It is possible to increase reception and transmission buffers,
It is possible to cope with a higher communication rate, and to reduce the overhead due to interrupt processing,
The PU can be used efficiently.

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

【図1】 本発明のシリアル通信コントローラの全二重
通信における一実施例のブロック図である。
FIG. 1 is a block diagram of an embodiment in full-duplex communication of a serial communication controller of the present invention.

【図2】 本発明のシリアル通信コントローラの半二重
通信の受信における一実施例のブロック図である。
FIG. 2 is a block diagram of an embodiment in receiving half-duplex communication by the serial communication controller of the present invention.

【図3】 本発明のシリアル通信コントローラの半二重
通信の送信における一実施例のブロック図である。
FIG. 3 is a block diagram of one embodiment of transmission of half-duplex communication by the serial communication controller of the present invention.

【図4】 本発明のシリアル通信コントローラの一実施
例の構成回路図である。
FIG. 4 is a configuration circuit diagram of an embodiment of a serial communication controller according to the present invention.

【図5】 従来のシリアル通信コントローラの一例のブ
ロック図である。
FIG. 5 is a block diagram of an example of a conventional serial communication controller.

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

10,30,60 シリアル通信コントローラ 12 受信用シフトレジスタ 14a,14b,14c,14d,…,14n 受信用
バッファ 16 CPUインタフェース 18a,18b,18c,18d,…,18n 送信用
バッファ 20 送信用シフトレジスタ 22 切換え手段 24a,24b,24c,24d,26a,26b,2
6c,26d,36a,36b,36c,36d,38
a,38b,38c,38d セレクタ 28 受信用ライトポインタ 32 受信用リードポインタ 34,44 マルチプレクサ 40 送信用ライトポインタ 42 送信用リードポインタ 46 出力信号 48 入力信号 50,52,SELR,SELT 選択信号 R_WE0,R_WE1,R_WE2,R_WE3,R
_WE4,R_WE5,R_WE6,R_WE7,T_
WE0,T_WE1,T_WE2,T_WE3,T_W
E4,T_WE5,T_WE6,T_WE7 ライトイ
ネーブル信号 R0,R1,R2,R3,T0,T1,T2,T3 パ
ラレルデータ
10, 30, 60 Serial communication controller 12 Reception shift register 14a, 14b, 14c, 14d, ..., 14n Reception buffer 16 CPU interface 18a, 18b, 18c, 18d, ..., 18n Transmission buffer 20 Transmission shift register 22 Switching means 24a, 24b, 24c, 24d, 26a, 26b, 2
6c, 26d, 36a, 36b, 36c, 36d, 38
a, 38b, 38c, 38d selector 28 reception write pointer 32 reception read pointer 34, 44 multiplexer 40 transmission write pointer 42 transmission read pointer 46 output signal 48 input signal 50, 52, SELR, SELT selection signal R_WE0, R_WE1 , R_WE2, R_WE3, R
_WE4, R_WE5, R_WE6, R_WE7, T_
WE0, T_WE1, T_WE2, T_WE3, T_W
E4, T_WE5, T_WE6, T_WE7 Write enable signal R0, R1, R2, R3, T0, T1, T2, T3 Parallel data

───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.6,DB名) H04L 29/08 H04L 5/14 ──────────────────────────────────────────────────続 き Continued on the front page (58) Field surveyed (Int. Cl. 6 , DB name) H04L 29/08 H04L 5/14

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】少なくとも1つの受信用バッファおよび少
なくとも1つの送信用バッファを備えるシリアル通信コ
ントローラにおいて、 全二重通信の送受信時に、前記受信用および送信用バッ
ファをそれぞれ受信用および送信用バッファとして使用
し、半二重通信の受信時に、前記受信用および送信用バ
ッファをともに受信用バッファとして使用し、前記半二
重通信の送信時に、前記受信用および送信用バッファを
ともに送信用バッファとして使用することを特徴とする
シリアル通信方法。
1. A serial communication controller having at least one reception buffer and at least one transmission buffer, wherein the reception and transmission buffers are used as reception and transmission buffers when transmitting and receiving full-duplex communication. When receiving the half-duplex communication, both the reception buffer and the transmission buffer are used as a reception buffer, and when transmitting the half-duplex communication, the reception and transmission buffers are both used as a transmission buffer. A serial communication method, comprising:
【請求項2】少なくとも1つの受信用バッファを有し、
シリアルデータを受信してパラレルデータに変換し、こ
のパラレルデータを前記受信用バッファに保持する受信
部と、少なくとも1つの送信用バッファを有し、送信し
ようとするパラレルデータを前記送信用バッファに保持
し、このパラレルデータをシリアルデータに変換して送
信する送信部と、制御信号により通信方式を全二重通信
または半二重通信に切り換え、前記全二重通信の送受信
時に、前記受信用および送信用バッファをそれぞれ受信
用および送信用バッファとして使用し、前記半二重通信
の受信時に、前記受信用および送信用バッファをともに
受信用バッファとして使用し、前記半二重通信の送信時
に、前記受信用および送信用バッファをともに送信用バ
ッファとして使用するよう設定する切換え手段を備える
ことを特徴とするシリアル通信コントローラ。
2. The apparatus according to claim 1, further comprising at least one receiving buffer.
A receiving unit that receives serial data, converts the data into parallel data, and stores the parallel data in the reception buffer; and at least one transmission buffer, and stores parallel data to be transmitted in the transmission buffer. A transmission unit that converts the parallel data into serial data and transmits the data; and a control signal that switches the communication method between full-duplex communication and half-duplex communication. The trust buffer is used as a reception buffer and a transmission buffer, respectively.When receiving the half-duplex communication, the reception buffer and the transmission buffer are both used as reception buffers. Switching means for setting both the transmission buffer and the transmission buffer to be used as the transmission buffer. Real communication controller.
【請求項3】前記切換え手段を制御する制御信号は、外
部端子から入力される信号または内部制御レジスタから
出力される信号である請求項2に記載のシリアル通信コ
ントローラ。
3. The serial communication controller according to claim 2, wherein the control signal for controlling the switching means is a signal input from an external terminal or a signal output from an internal control register.
JP7063743A 1995-03-23 1995-03-23 Serial communication method and serial communication controller Expired - Lifetime JP2971006B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7063743A JP2971006B2 (en) 1995-03-23 1995-03-23 Serial communication method and serial communication controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7063743A JP2971006B2 (en) 1995-03-23 1995-03-23 Serial communication method and serial communication controller

Publications (2)

Publication Number Publication Date
JPH08265393A JPH08265393A (en) 1996-10-11
JP2971006B2 true JP2971006B2 (en) 1999-11-02

Family

ID=13238199

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7063743A Expired - Lifetime JP2971006B2 (en) 1995-03-23 1995-03-23 Serial communication method and serial communication controller

Country Status (1)

Country Link
JP (1) JP2971006B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7149932B2 (en) 2000-10-11 2006-12-12 Nec Corporation Serial communication device and method of carrying out serial communication

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7149932B2 (en) 2000-10-11 2006-12-12 Nec Corporation Serial communication device and method of carrying out serial communication

Also Published As

Publication number Publication date
JPH08265393A (en) 1996-10-11

Similar Documents

Publication Publication Date Title
US5602780A (en) Serial to parallel and parallel to serial architecture for a RAM based FIFO memory
US5812774A (en) System for transmitting data packet from buffer by reading buffer descriptor from descriptor memory of network adapter without accessing buffer descriptor in shared memory
US6920510B2 (en) Time sharing a single port memory among a plurality of ports
US7035956B2 (en) Transmission control circuit, reception control circuit, communications control circuit, and communications control unit
US6487617B1 (en) Source-destination re-timed cooperative communication bus
US7409486B2 (en) Storage system, and storage control method
GB2377138A (en) Ring Bus Structure For System On Chip Integrated Circuits
US6584512B1 (en) Communication DMA device for freeing the data bus from the CPU and outputting divided data
JP2971006B2 (en) Serial communication method and serial communication controller
US5379395A (en) Semiconductor integrated circuit for central processor interfacing which enables random and serial access to single port memories
JP3202648B2 (en) Data transfer device and data transfer system
KR100361511B1 (en) Multi-Function Serial Communication Interface Device
US7099964B2 (en) High speed processor
EP0789363B1 (en) Memory system and data communications system
JP2664208B2 (en) Direct memory access control device and direct memory access control method
KR100219045B1 (en) Fifo circuit having dual channel
JP3436984B2 (en) Traffic shaping device for ATM communication system
JPH05324529A (en) Method and device for data transfer
KR100233100B1 (en) Time division accessing data communicaton device in multiple processor
US20070061661A1 (en) Bit rate adaptation in a data processing flow
JP2001134514A (en) Data communication system
JP2752834B2 (en) Data transfer device
JPH10207762A (en) Memory and electronic equipment
KR100289578B1 (en) Mediation Device of Packet Memory in High-capacity Communication Processing System
KR100192960B1 (en) Dma interface having channel link function

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

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080827

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090827

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090827

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100827

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110827

Year of fee payment: 12

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110827

Year of fee payment: 12

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120827

Year of fee payment: 13

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120827

Year of fee payment: 13

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130827

Year of fee payment: 14

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R360 Written notification for declining of transfer of rights

Free format text: JAPANESE INTERMEDIATE CODE: R360

R360 Written notification for declining of transfer of rights

Free format text: JAPANESE INTERMEDIATE CODE: R360

R371 Transfer withdrawn

Free format text: JAPANESE INTERMEDIATE CODE: R371

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

EXPY Cancellation because of completion of term