JP5804930B2 - Serial communication method, communication apparatus, and serial communication system - Google Patents
Serial communication method, communication apparatus, and serial communication system Download PDFInfo
- Publication number
- JP5804930B2 JP5804930B2 JP2011278587A JP2011278587A JP5804930B2 JP 5804930 B2 JP5804930 B2 JP 5804930B2 JP 2011278587 A JP2011278587 A JP 2011278587A JP 2011278587 A JP2011278587 A JP 2011278587A JP 5804930 B2 JP5804930 B2 JP 5804930B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- phase
- communication
- bits
- master
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Information Transfer Systems (AREA)
- Communication Control (AREA)
Description
この発明は、マスタ側とスレーブ側との間でデータの読み書きを行うシリアル通信方法、通信装置、およびシリアル通信システムに関するものである。 The present invention relates to a serial communication method, a communication device, and a serial communication system for reading and writing data between a master side and a slave side.
組み込み機器用のマイクロコンピュータ(以下、マイコン)などの半導体デバイス同士でシリアル通信を行う場合、そのシリアル通信単位(フレーム)が8ビットまたは16ビットという比較的小さな通信単位で行われるケースが多い。また、通信単位のビット数がマイコンの扱うデータビット数と一致するケースが多い。例えば、8ビットマイコンの場合、1フレームも通常8ビットである。 When serial communication is performed between semiconductor devices such as microcomputers (hereinafter referred to as microcomputers) for embedded devices, the serial communication unit (frame) is often performed in a relatively small communication unit of 8 bits or 16 bits. In many cases, the number of bits in the communication unit matches the number of data bits handled by the microcomputer. For example, in the case of an 8-bit microcomputer, one frame is usually 8 bits.
このような1フレーム8ビットで構成される全二重同期通信を行う半導体デバイスにおいて、8ビットのデータを読み出す場合は、従来、以下のような手順となる。
第1フレームにて、マスタ側デバイスからスレーブ側デバイスへ、アドレスデータを送信し、第2フレームにて、スレーブ側からマスタ側へ、受信したアドレスのリードデータを送信する。
なお、アドレスデータは、最大7ビットのアドレスと、読み出し(R)か書き込み(W)かを制御する1ビットのR/W制御情報とから構成されることを前提としているが、これより大きいビット数のアドレスの場合にはフレームを追加することになる。
In the case of reading out 8-bit data in such a semiconductor device that performs full-duplex synchronous communication composed of 8 bits per frame, conventionally, the procedure is as follows.
In the first frame, address data is transmitted from the master side device to the slave side device, and in the second frame, read data of the received address is transmitted from the slave side to the master side.
The address data is assumed to be composed of a maximum 7-bit address and 1-bit R / W control information for controlling read (R) or write (W). In the case of a number of addresses, a frame is added.
これに加え、通信品質の向上を実現するためにエラー検出・訂正処理を行う場合には、マスタ側は、リードデータのエラー検出・訂正処理に必要なパリティやCRC(Cyclic Redundancy Check)などのエラー検出・訂正情報を取得する必要がある。ただし、1フレーム≦データビット数のため、第2フレーム中にエラー検出・訂正情報を混在させることはできないので、新たに追加する第3フレームにて、スレーブ側からマスタ側へ、エラー検出・訂正情報を別途送信することになる。 In addition to this, when performing error detection / correction processing in order to improve communication quality, the master side requires errors such as parity and CRC (Cyclic Redundancy Check) necessary for error detection / correction processing of read data. It is necessary to obtain detection / correction information. However, since 1 frame ≤ number of data bits, error detection / correction information cannot be mixed in the second frame, so error detection / correction is performed from the slave side to the master side in the newly added third frame. Information will be sent separately.
このように、エラー検出・訂正処理を行う場合には、エラー検出・訂正情報を送信するために1フレーム分余計な通信が必要となり、読み出し要求から通信完了までの時間が最大1.5倍になってしまう問題があった。この問題を解決するために、従来よりエラー検査・訂正処理を行う場合の通信時間短縮の方法が試行錯誤されており、例えば特許文献1では、全二重非同期通信において要求のためのパリティ信号とデータ信号とを重畳して送信するようにしていた。ただし、特許文献1の通信方式は非同期式であり、また重畳による多値処理が必要なため、従来の同期式の通信方式を、ローコストな(2値の)デジタル専用回路で実現するためにはそのまま適用することができない。
As described above, when performing error detection / correction processing, an extra communication for one frame is required to transmit error detection / correction information, and the time from the read request to the completion of communication is increased up to 1.5 times. There was a problem that would become. In order to solve this problem, a method for shortening the communication time when performing error checking / correction processing has been trial and error. For example, in
以上のように、従来の全二重同期通信システムはエラー検出・訂正情報を通信するために追加されたフレーム分、通信時間が長くなるという課題があった。特に通信速度が遅い場合、無駄なフレームの追加がミリ秒単位で通信時間が増加してしまうため、少しでも少ないフレームで通信が完結することが望まれている。 As described above, the conventional full-duplex synchronous communication system has a problem that the communication time is increased by the number of frames added for communicating error detection / correction information. In particular, when the communication speed is slow, the addition of useless frames increases the communication time in milliseconds, so it is desired that the communication be completed with as few frames as possible.
この発明は、上記のような課題を解決するためになされたもので、2フレームの通信時間でエラー検出情報を含んだ通信を完了させることにより、従来の3フレームから2フレームに削減して1フレーム分の通信レイテンシの短縮および通信帯域の増強を可能とした、通信信頼性の高いシリアル通信方法、通信装置、およびシリアル通信システムを提供することを目的とする。 The present invention has been made to solve the above-described problems. By completing communication including error detection information in a communication time of 2 frames, the conventional 3 frames can be reduced to 2 frames. An object of the present invention is to provide a serial communication method, a communication apparatus, and a serial communication system with high communication reliability capable of shortening communication latency for a frame and increasing a communication band.
この発明に係るシリアル通信方法は、データ信号を送受信するシリアルデータラインにより接続され、全二重通信を行う通信装置のシリアル通信方法であって、通信単位であるフレームのビット数が、マスタ側およびスレーブ側の各通信装置のデータビット数と一致する場合、または当該データビット数より少ない場合に、マスタ側からスレーブ側へリードデータのアドレス情報を含めたフレームを送信し、かつ、スレーブ側ではアドレス情報を受信した時点でリードデータを読み出してエラー検出または訂正のための情報を求めて同一フレーム中に前記マスタ側へ返送する第1フェーズと、スレーブ側からマスタ側へ、第1フェーズで読み出した当該リードデータを含めたフレームを送信する第2フェーズとを備えるようにしたものである。 The serial communication method according to the present invention is a serial communication method of a communication device connected by serial data lines for transmitting and receiving data signals and performing full-duplex communication, wherein the number of bits of a frame as a communication unit is the master side and If the number of data bits of each communication device on the slave side matches or is smaller than the number of data bits, a frame including the address information of the read data is transmitted from the master side to the slave side, and the address on the slave side At the time when the information is received, the read data is read to obtain information for error detection or correction and returned to the master side in the same frame, and read from the slave side to the master side in the first phase And a second phase for transmitting a frame including the read data.
この発明に係るシリアル通信方法は、データ信号を送受信するシリアルデータラインにより接続されてシリアル通信を行う通信装置のシリアル通信方法であって、通信単位であるフレームのビット数が、マスタ側およびスレーブ側の各通信装置のデータビット数と一致する場合、または当該データビット数より少ない場合に、マスタ側からスレーブ側へライトデータのアドレス情報と、当該ライトデータのエラー検出または訂正のための情報とを含めたフレームを送信する第1フェーズと、マスタ側からスレーブ側へ当該ライトデータを含めたフレームを送信する第2フェーズとを備えるようにしたものである。 A serial communication method according to the present invention is a serial communication method of a communication device connected by a serial data line for transmitting and receiving data signals to perform serial communication, wherein the number of bits of a frame as a communication unit is set on the master side and the slave side When the number of data bits of each communication device is equal to or smaller than the number of data bits, write data address information from the master side to the slave side and information for error detection or correction of the write data are displayed. The first phase for transmitting the included frame and the second phase for transmitting the frame including the write data from the master side to the slave side are provided.
この発明に係る通信装置は、データ信号を送受信するシリアルデータラインにより接続され、全二重通信を行う通信装置であって、通信単位であるフレームのビット数が、マスタ側およびスレーブ側の各通信装置のデータビット数と一致する場合、または当該データビット数より少ない場合に、マスタ側の通信装置が、第1フェーズにおいて、リードデータのアドレス情報を含めたフレームをスレーブ側へ送信し、かつ、スレーブ側より当該リードデータのエラー検出または訂正のための情報を含むフレームを受信し、第2フェーズにおいて、スレーブ側より当該リードデータを含むフレームを受信するものである。 The communication device according to the present invention is a communication device that is connected by a serial data line that transmits and receives data signals and performs full-duplex communication, and the number of bits of a frame as a communication unit is different between each communication on the master side and the slave side. When the number of data bits matches the number of data bits of the device, or when the number of data bits is smaller than the number of data bits, the master side communication device transmits a frame including address information of read data to the slave side in the first phase, and A frame including information for error detection or correction of the read data is received from the slave side, and a frame including the read data is received from the slave side in the second phase.
この発明に係る通信装置は、データ信号を送受信するシリアルデータラインにより接続されてシリアル通信を行う通信装置であって、通信単位であるフレームのビット数が、マスタ側およびスレーブ側の各通信装置のデータビット数と一致する場合、または当該データビット数より少ない場合に、マスタ側の通信装置が、第1フェーズにおいて、ライトデータのアドレス情報と、当該ライトデータのエラー検出または訂正のための情報とを含むフレームをスレーブ側へ送信し、第2フェーズにおいて、当該ライトデータを含むフレームをスレーブ側へ送信するものである。 The communication device according to the present invention is a communication device that performs serial communication by being connected by a serial data line that transmits and receives data signals, and the number of bits of a frame that is a communication unit of each of the communication devices on the master side and the slave side If the number of data bits matches or is less than the number of data bits, the master side communication device, in the first phase, writes the address information of the write data and information for error detection or correction of the write data. Is transmitted to the slave side, and in the second phase, the frame including the write data is transmitted to the slave side.
この発明に係る通信装置は、データ信号を送受信するシリアルデータラインにより接続され、全二重通信を行う通信装置であって、通信単位であるフレームのビット数が、マスタ側およびスレーブ側の各通信装置のデータビット数と一致する場合、または当該データビット数より少ない場合に、スレーブ側の通信装置が、第1フェーズにおいて、マスタ側よりリードデータのアドレス情報を含むフレームを受信し、かつ、当該アドレス情報を受信した時点で当該リードデータを読み出してエラー検出または訂正のための情報を求めて同一フレーム中にマスタ側へ送信し、第2フェーズにおいて、第1フェーズで読み出した当該リードデータを含めたフレームをマスタ側へ送信するものである。 The communication device according to the present invention is a communication device that is connected by a serial data line that transmits and receives data signals and performs full-duplex communication, and the number of bits of a frame as a communication unit is different between each communication on the master side and the slave side. When the number of data bits matches the number of data bits of the device, or when the number of data bits is smaller than the number of data bits, the communication device on the slave side receives a frame including address information of read data from the master side in the first phase, and When the address information is received, the read data is read and information for error detection or correction is obtained and transmitted to the master side in the same frame. In the second phase, the read data read in the first phase is included. The transmitted frame is transmitted to the master side.
この発明に係る通信装置は、データ信号を送受信するシリアルデータラインにより接続されてシリアル通信を行う通信装置であって、通信単位であるフレームのビット数が、マスタ側およびスレーブ側の各通信装置のデータビット数と一致する場合、または当該データビット数より少ない場合に、スレーブ側の通信装置が、第1フェーズにおいて、マスタ側よりライトデータのアドレス情報と、当該ライトデータのエラー検出または訂正のための情報とを含むフレームを受信し、第2フェーズにおいて、マスタ側より当該ライトデータを含むフレームを受信するものである。 The communication device according to the present invention is a communication device that performs serial communication by being connected by a serial data line that transmits and receives data signals, and the number of bits of a frame that is a communication unit of each of the communication devices on the master side and the slave side If the number of data bits matches or is less than the number of data bits, the slave side communication device detects the address information of the write data and the error detection or correction of the write data from the master side in the first phase. In the second phase, a frame including the write data is received from the master side.
この発明に係るシリアル通信システムは、上記マスタ側の通信装置と、上記スレーブ側の通信装置との間でシリアル通信を行うものである。 The serial communication system according to the present invention performs serial communication between the communication device on the master side and the communication device on the slave side.
この発明によれば、リード動作時、マスタ側からアドレスの情報を送出し、スレーブ側でそのアドレスからの読み出し処理をこのフレームの最終ビットまでに行ったうえエラー検出または訂正のための情報を求め、全二重通信を活用して同一フレーム中にマスタ側に返送し、次のフレームにて先に読み出したデータをマスタ側に送出するようにしたので、2フレームの通信時間でリードデータのエラー検出・訂正情報を含んだ通信を完了させることができる。従って、従来の3フレームから2フレームに削減して1フレーム分の通信レイテンシの短縮および通信帯域の増強を可能とした、通信信頼性の高いシリアル通信方法、通信装置、およびシリアル通信システムを提供することができる。 According to the present invention, at the time of a read operation, the address information is transmitted from the master side, and the slave side performs read processing from the address up to the last bit of this frame and obtains information for error detection or correction. Because full-duplex communication was used, data was returned to the master during the same frame, and the data read earlier in the next frame was sent to the master. Communication including detection / correction information can be completed. Accordingly, there are provided a serial communication method, a communication apparatus, and a serial communication system with high communication reliability that can reduce the communication latency for one frame and increase the communication band by reducing the conventional three frames to two frames. be able to.
また、この発明によれば、ライト動作時、マスタ側からライトデータのアドレスとエラー検出または訂正のための情報とを先に送出し次のフレームでライトデータを送出するようにしたので、スレーブ側ではライトデータを受信すると受信済みのエラー検出または訂正のための情報を用いてエラー検出処理を行ってその結果を同一フレーム中にマスタ側に返送することができるようになり、2フレームの通信時間でライトデータのエラー検出・訂正情報を含んだ通信を完了させることができる。従って、従来の3フレームから2フレームに削減して1フレーム分の通信レイテンシの短縮および通信帯域の増強を可能とした、通信信頼性の高いシリアル通信方法、通信装置、およびシリアル通信システムを提供することができる。 Also, according to the present invention, during the write operation, the master side sends the write data address and information for error detection or correction first, and sends the write data in the next frame. Then, when write data is received, error detection processing can be performed using the received error detection or correction information, and the result can be returned to the master side in the same frame. The communication including the error detection / correction information of the write data can be completed. Accordingly, there are provided a serial communication method, a communication apparatus, and a serial communication system with high communication reliability that can reduce the communication latency for one frame and increase the communication band by reducing the conventional three frames to two frames. be able to.
実施の形態1.
図1は、本実施の形態1に係るシリアル通信システムの構成を示すブロック図である。図示例のシリアル通信システムは、マスタ装置100とスレーブ装置200を備え、これらマスタ装置100とスレーブ装置200との間がシリアルクロック入力用のシリアルクロックライン(SCLK端子)および2本のシリアルデータライン(データ入力用のSDI端子とデータ出力用のSDO端子)の合計3ラインで接続されて、SPI(Serial Prepheral Interface)を利用した全二重通信を行う。
FIG. 1 is a block diagram showing the configuration of the serial communication system according to the first embodiment. The serial communication system of the illustrated example includes a
以下では、マスタ装置100に8ビットマイコンを用い、この仕様に合わせて通信単位(フレーム)も8ビットとする。スレーブ装置200は、ASIC(Application Specific Integrated Circuit)、FPGA(Field−Programmable Gate Array)などの周辺デバイスとする。
また、1通信単位(1フレーム)で構成された、以下の3つのフェーズを定義する。各フェーズの詳細は後述する。
(1)Address set phase(ASフェーズ)
(2)Write data phase(WDフェーズ)
(3)Read data phase(RDフェーズ)
また、マスタ装置100からスレーブ装置200のレジスタ(不図示)へのリード/ライト動作は、ASフェーズ+RDフェーズの2フェーズ動作、またはASフェーズ+WDフェーズの2フェーズ動作によって実現する。よって、2フェーズ動作には、8ビットの通信2回分(即ち、2フレーム分)の通信時間を要することになる。
In the following, an 8-bit microcomputer is used for the
In addition, the following three phases, which are configured by one communication unit (one frame), are defined. Details of each phase will be described later.
(1) Address set phase (AS phase)
(2) Write data phase (WD phase)
(3) Read data phase (RD phase)
The read / write operation from the
マスタ装置100は、スレーブ装置200との間でシリアル通信を行うシリアル通信部110と、マイコンコアであるマスタ装置主要処理部120と、スレーブ装置200との間で通信を同期するためのクロック信号を生成するクロック生成部130とを備える。マスタ側のシリアル通信部110は、SPIの全二重通信を行う通信回路であり、クロック生成部130から出力されるクロック信号に同期したタイミングで動作するシフトレジスタ111を備える。なお、シリアル通信部110とマスタ装置主要処理部120との間のデータのやり取りは、内部バスインタフェース(不図示)を介して行ってもよい。
The
シフトレジスタ111は、マスタ装置主要処理部120側から入力されるパラレルデータ(アドレス、R/W制御情報、ライトデータなど)を格納し、シリアルデータに変換して、SDO端子から1ビットずつ出力する。また、シフトレジスタ111は、SDI端子から入力されるシリアルデータ(リードデータなど)を格納して、パラレルデータに変換して、マスタ装置主要処理部120へ出力する。
マスタ装置主要処理部120は、スレーブ装置200へ送信するデータのパリティを計算してシフトレジスタ111へ出力すると共に、スレーブ装置200から受信したデータに含まれるパリティを取得してパリティチェックを行う。
The
The master device
スレーブ装置200は、マスタ装置100との間でシリアル通信を行うシリアル通信部210と、マイコンコアであるスレーブ装置主要処理部220とを備える。スレーブ側のシリアル通信部210は、SPIの全二重通信を行う通信回路であり、マスタ側のシリアル通信部110から入力されるクロック信号に同期したタイミングで動作する受信シフトレジスタ211、送信データセレクタ212および状態遷移制御部213を備える。なお、シリアル通信部210とスレーブ装置主要処理部220との間のデータのやり取りは、内部バスインタフェース(不図示)を介して行ってもよい。
The
受信シフトレジスタ211は、SDI端子から入力されるシリアルデータ(アドレス、R/W制御情報、ライトデータ、パリティなど)を格納し、パラレルデータに変換して、スレーブ装置主要処理部220へ出力する。送信データセレクタ212は、スレーブ装置主要処理部220から入力されるパラレルデータ(リードデータなど)、受信シフトレジスタ211の格納するデータ、およびスレーブ装置主要処理部220から入力されるパリティチェック結果のうちから、状態遷移制御部213の選択信号に従ったデータを選択取得し、シリアルデータに変換して、SDO端子から1ビットずつ出力する。
スレーブ装置主要処理部220は、マスタ装置100へ送信するデータのパリティを計算して送信データセレクタ212へ出力すると共に、マスタ装置100から受信したデータに含まれるパリティを取得してパリティチェックを行う。
状態遷移制御部213は、SDI端子から入力される各ビットのデータに基づいて、リード/ライト動作およびフェーズ種別を判定して、各ビットについて予め定められた選択信号(アドレス情報またはライト情報)を送信データセレクタ212およびスレーブ装置主要処理部220に出力する。
The
The slave device
The state
(1)ASフェーズ
図2(a)は、ASフェーズのフレーム構成を説明する図である。また、図3および図4は、スレーブ装置200のタイミングチャートであり、図3はライト動作時のASフェーズとWDフェーズ、図4はリード動作時のASフェーズとRDフェーズを示す。なお、図3に示すように、スレーブ装置200は、SCLK端子から入力されるクロック信号に同期し、SDI端子の信号をクロック信号の立下りで検出し、かつ、クロック信号の立下りでSDO端子から出力する。一方、マスタ装置100はSDI端子の信号を、図3および図4に破線で示すタイミングで検出する。
(1) AS Phase FIG. 2A is a diagram illustrating the frame configuration of the AS phase. 3 and 4 are timing charts of the
ASフェーズにおいて、マスタ側のSDO端子からスレーブ側のSDI端子へビット0〜7の順にデータが送信される。ビット0はスタートビット(値は0とする)である。ビット1〜4は、リード/ライト動作対象のレジスタのアドレス(4ビット)である。ビット5は、リード/ライト動作のいずれかを指定するR/W制御情報であり、リード動作なら1、ライト動作なら0とする。ビット6は、ASフェーズの上位5ビット(アドレス4ビットとR/W制御情報1ビット)のAS用パリティ(ここではoddにする)であり、アドレス要求が正しいかどうかスレーブ側でチェックするために用いる情報である。ビット7は、ライト動作時にWDフェーズで送信するライトデータ(8ビット)のWD用パリティ(ここではoddにする)であり、スレーブ側で受信したライトデータが正しいかどうかチェックするために用いる情報である。なお、本実施の形態1では、WDフェーズに先行するASフェーズでWD用パリティを事前送信する。一方、リード動作時のASフェーズではパリティの送信は不要である。
In the AS phase, data is transmitted in the order of
マスタ側からスレーブ側への送信と同時に、スレーブ側のSDO端子からマスタ側のSDI端子へもビット0〜7の順にデータが送信される。ビット0〜5は、どのような値であってもよく、例えばダミーデータとして前フェーズでスレーブ側が受信した上位6ビットをそのまま返送する。ビット6は、リード動作時にRDフェーズで送信するリードデータ(8ビット)のRD用パリティであり、このASフェーズのビット5のサイクルでリードデータを読み出して求めたものである。なお、本実施の形態1では、RDフェーズに先行するASフェーズでRD用パリティを事前送信する。一方、ライト動作時のASフェーズではパリティの送信は不要である。ビット7は、スレーブ側で受信したアドレスのパリティチェック結果を示す情報であり、このASフェーズで受信したアドレスとR/W制御情報を、同じくこのASフェーズで受信したAS用パリティを用いて、ビット5のサイクルでパリティチェック(エラーがなければ1)したものである。
Simultaneously with the transmission from the master side to the slave side, data is transmitted in the order of
なお、ASフェーズにおいてマスタ側からスレーブ側へアドレス等を送信し、スレーブ側でこのアドレス等のパリティチェックを行って返送することになるが、アドレス等はフレームの先頭ビット側に詰めておくので、スレーブ側ではアドレスを受信完了した時点でそのアドレスのデータをスレーブ装置主要処理部220から先行して読み出し(図4に実線の矢印で示したタイミング)、パリティチェックして同じフェーズ内で結果を返送することが可能となる。詳細は後述する。
In the AS phase, an address etc. is transmitted from the master side to the slave side, and a parity check of this address etc. is performed on the slave side and returned, but the address etc. is packed on the first bit side of the frame, On the slave side, when reception of the address is completed, the data at that address is read from the slave device
(2)WDフェーズ
図2(b)は、WDフェーズのフレーム構成を説明する図である。
ASフェーズに続くWDフェーズにおいて、マスタ側のSDO端子からスレーブ側のSDI端子へビット0〜7の順にデータが送信される。ビット0〜7は、先のASフェーズで指定したアドレスに書き込むためのライトデータ(8ビット)である。
マスタ側からスレーブ側への送信と同時に、スレーブ側のSDO端子からマスタ側のSDI端子へもビット0〜7の順にデータが送信される。ただし、ビット0〜5はどのような値であってもよく、例えばダミーデータとして前フェーズでスレーブ側が受信した上位7ビットをそのまま返送する。ビット7は、スレーブ側で受信したライトデータのパリティチェック結果を示す情報であり、このWDフェーズで受信したライトデータを、先のASフェーズで受信したWD用パリティを用いて、ビット7のサイクルでパリティチェック(エラーがなければ1)したものである。
(2) WD Phase FIG. 2B is a diagram for explaining a frame configuration of the WD phase.
In the WD phase following the AS phase, data is transmitted in the order of
Simultaneously with the transmission from the master side to the slave side, data is transmitted in the order of
(3)RDフェーズ
図2(c)は、RDフェーズのフレーム構成を説明する図である。
ASフェーズに続くRDフェーズにおいて、マスタ側のSDO端子からスレーブ側のSDI端子へビット0〜7の順にデータが送信される。ただし、ビット0〜7は、どのような値であってもよい。
マスタ側からスレーブ側への送信と同時に、スレーブ側のSDO端子からマスタ側のSDI端子へもビット0〜7の順にデータが送信される。ビット0〜7は、先のASフェーズで指定されたアドレスのレジスタから読み出したリードデータ(8ビット)である。
(3) RD Phase FIG. 2C is a diagram for explaining the frame configuration of the RD phase.
In the RD phase following the AS phase, data is transmitted in the order of
Simultaneously with the transmission from the master side to the slave side, data is transmitted in the order of
図1に示すマスタ装置100において、シリアル通信部110は、従来のSPI通信に必要なハードウェア構成と同じでよい。ただし、従来のSPI通信とはソフトウェア上の処理が異なる。従来のSPI通信では、先立って説明したように最初のフレームでアドレスとR/W制御情報を送信するのに対し、本実施の形態1ではAS用パリティとWD用パリティを求めて、最初のフレーム(ASフェーズ)でアドレスとR/W制御情報に加えてAS用パリティとWD用パリティも送信する。
In the
他方のスレーブ装置200において、シリアル通信部210は、従来のSPI通信に必要なハードウェア構成に加え、新たに送信データセレクタ212と状態遷移制御部213とを備えている。
以下、これら送信データセレクタ212と状態遷移制御部213を備えたスレーブ装置200の動作を中心にして、マスタ装置100を含めたシリアル通信システム全体の動作を説明する。
In the
Hereinafter, the operation of the entire serial communication system including the
先ずライト動作を説明し、続いてリード動作を説明する。
ライト動作時のASフェーズにおいて、マスタ装置100では、マスタ装置主要処理部120においてライトデータのアドレスとR/W制御情報とからAS用パリティを計算して、シフトレジスタ111へ出力すると共に、ライトデータからWD用パリティを計算してシフトレジスタ111へ出力する。
シフトレジスタ111は、マスタ装置主要処理部120から出力されたアドレスおよびR/W制御情報、ならびにAS用パリティおよびWD用パリティをビット1〜7に格納する。ビット0はスタートビットである。
そして、シリアル通信部110は、クロック生成部130が生成するクロック信号をSCLK端子から出力すると共に、シフトレジスタ111に格納された8ビットデータをクロック信号に同期してSDO端子から出力する(ASフェーズ)。
First, the write operation will be described, and then the read operation will be described.
In the AS phase during the write operation, in the
The
The
図5は、スレーブ装置200の動作を示すフローチャートである。ステップST1〜ST8は受信側の処理、ステップST11〜ST18は送信側の処理であり、マスタ装置100とスレーブ装置200の送受信はSCLK端子のクロック信号に同期して行われる。また、ステップST21〜ST24の処理は各種の内部処理であり、状態遷移制御部213の指示で行われる。
FIG. 5 is a flowchart showing the operation of the
スレーブ装置200のシリアル通信部210では、状態遷移制御部213がSDI端子から入力されるビット0のスタートビットを検出し(ステップST1“YES”)、ASフェーズの開始を判定する。そして、受信したビット0のデータは受信シフトレジスタ211に格納する。
他方、スタートビットを検出した状態遷移制御部213は、送信データセレクタ212へ選択信号を出力し、送信データセレクタ212が受信シフトレジスタ211に格納されていた前回受信データの上位1ビットを選択して、ダミーデータとしてSDO端子からマスタ装置100へ送信する(ステップST11)。
In the
On the other hand, the state
シリアル通信部210は、マスタ装置100からビット1〜4のアドレスとビット5のR/W制御情報を受信して、受信シフトレジスタ211に格納する(ステップST2,ST3)。
他方、状態遷移制御部213が引き続き送信データセレクタ212へ選択信号を出力し、送信データセレクタ212が受信シフトレジスタ211に格納されていた前回受信データのビット1〜5を選択して、ダミーデータとしてSDO端子からマスタ装置100へ送信する(ステップST12)。
さらに、状態遷移制御部213は、受信シフトレジスタ211に格納されたビット1〜4のアドレスを、先行してスレーブ装置主要処理部220へ通知し、スレーブ装置主要処理部220はASフェーズ中にリードデータを読み出してRD用パリティを計算する(ステップTT21,ST22)。
The
On the other hand, the state
Further, the state
シリアル通信部210は、マスタ装置100からビット6のAS用パリティを受信して、受信シフトレジスタ211に格納する(ステップST4)。
他方、状態遷移制御部213はR/W制御情報に従ってライトかリードかを判定し、ライトの場合は引き続き送信データセレクタ212へ選択信号を出力し、送信データセレクタ212が受信シフトレジスタ211に格納されていた前回受信データのビット6を選択して、ダミーデータとしてSDO端子からマスタ装置100へ送信する(ステップST13)。リードの場合の処理は後述する。なお、ライトの場合はステップST22で求めたRD用パリティは不要となる。
また、スレーブ装置主要処理部220が、受信シフトレジスタ211からデータを取得し、AS用パリティを用いて、アドレスとR/W制御情報のパリティチェックを行う(ステップST23)。
The
On the other hand, the state
Further, the slave device
シリアル通信部210は、マスタ装置100からビット7のWD用パリティを受信して、受信シフトレジスタ211に格納する(ステップST5)。
他方、状態遷移制御部213は送信データセレクタ212に対してスレーブ装置主要処理部220からアドレスのパリティチェック結果を取得するよう選択信号を出力する。送信データセレクタ212は、ステップST23でスレーブ装置主要処理部220の計算したアドレスのパリティチェック結果を取得して、ビット7としてSDO端子からマスタ装置100へ送信する(ステップST14)。
The
On the other hand, the state
一方、マスタ装置100では、シフトレジスタ111からSDO端子へ、アドレス等のデータを送信すると共に、SDI端子から上位7ビットのダミーデータと、アドレスのパリティチェック結果とを受信して、シフトレジスタ111へ格納していく(ASフェーズ)。格納された8ビットデータはマスタ装置主要処理部120へ出力される。
続いてマスタ装置主要処理部120からシフトレジスタ111へ8ビットのライトデータが出力され、シフトレジスタ111がSDO端子から出力する(WDフェーズ)。
On the other hand, the
Subsequently, 8-bit write data is output from the master device
RDフェーズにおいて、スレーブ装置200では、状態遷移制御部213が受信シフトレジスタ211に格納されたR/W制御情報に従ってリードかライトかを判定し、判定結果をマスタ装置主要処理部120へ出力する(ステップST6)。今回はライトのため(ステップST6“Write”)、SDI端子からライトデータを受信して受信シフトレジスタ211へ格納していき、8ビットのライトデータをスレーブ装置主要処理部220へ出力する。スレーブ装置主要処理部220はASフェーズで指定されたアドレスにライトデータを書き込む(ステップST7)。
また、スレーブ装置主要処理部220は、受信シフトレジスタ211に既に格納された7ビット分とこのクロックで受信した1ビット分の計8ビットのライトデータについて、ASフェーズのステップST5にて取得しておいたWD用パリティを用いてパリティチェックする(ステップST24)。
In the RD phase, in the
Also, the slave device
なお、シリアル通信部210は、ステップST23のパリティチェック結果がエラーであって正しいアドレス要求を受信できなかったと判断した場合、および、ステップST24のパリティチェック結果がエラーであって正しいライトデータを受信できなかったと判断した場合のいずれか一方、または両方において、スレーブ装置主要処理部220への書き込み要求を中止して、レジスタのデータを保護する構成にしてもよい。
The
また、状態遷移制御部213はASフェーズからWDフェーズに遷移したことを判定して(ステップST15“Write”)、送信データセレクタ212へ選択信号を出力し、送信データセレクタ212が受信シフトレジスタ211に格納されていた前回受信データの上位7ビットを選択して、ダミーデータとしてSDO端子からマスタ装置100へ送信する(ステップST16)。さらに状態遷移制御部213は、送信データセレクタ212に対してスレーブ装置主要処理部220からライトデータのパリティチェック結果を取得するよう選択信号を出力する。送信データセレクタ212は、ステップST24でスレーブ装置主要処理部220が計算したライトデータのパリティチェック結果を取得して、ビット7としてSDO端子からマスタ装置100へ送信する(ステップST17)。
Further, the state
一方、マスタ装置100では、シフトレジスタ111からSDO端子へ、ライトデータを送信すると共に、SDI端子から上位7ビットのダミーデータと、ライトデータのパリティチェック結果とを受信して、シフトレジスタ111へ格納していく(WDフェーズ)。なお、マスタ装置100はパリティチェック結果に応じて、ライト動作を繰り返すなど所定の対応を行う。
On the other hand, the
次に、リード動作を説明する。
リード動作時のASフェーズにおいて、マスタ装置100では、マスタ装置主要処理部120においてリードデータのアドレスとR/W制御情報とから、ライト動作のASフェーズと同様にAS用パリティを計算してシフトレジスタ111へ出力する。
シフトレジスタ111は、マスタ装置主要処理部120から出力されたアドレスおよびR/W制御情報、ならびにAS用パリティをビット1〜6に格納する。ビット0はスタートビット、ビット7は不要である。
そして、シリアル通信部110は、クロック信号に同期して、シフトレジスタ111に格納されたASフェーズのフレームを出力する。
Next, the read operation will be described.
In the AS phase during the read operation, in the
The
The
スレーブ装置200のシリアル通信部210は、上記同様にステップST1〜ST5,ST11,ST12,ST23を行う。ここではライト動作時とは処理の異なるステップを中心に説明する。
リード動作時のASフェーズでは、ステップST2においてビット1〜4のアドレスを受信すると、続くR/W制御情報およびAS用パリティを受信する間に、状態遷移制御部213の通知を受けてスレーブ装置主要処理部220がこのアドレスのリードデータ取得し(ステップST21)、パリティを計算する(ステップST22)。
The
In the AS phase during the read operation, when the address of
続くステップST13において、状態遷移制御部213はR/W制御情報がリードなので、リードの場合は送信データセレクタ212に対してスレーブ装置主要処理部220からRD用パリティを取得するよう選択信号を出力する。そして、送信データセレクタ212が、ステップST22でスレーブ装置主要処理部220が計算したRD用パリティを取得して、ビット6としてSDO端子からマスタ装置100へ送信する。
In subsequent step ST13, since the R / W control information is read, the state
一方、マスタ装置100では、シフトレジスタ111からSDO端子へ、アドレス等のデータを送信すると共に、SDI端子からシフトレジスタ111へ上位6ビットのダミーデータと、RD用パリティと、アドレスのパリティチェック結果とを受信して格納していく。格納された8ビットデータはマスタ装置主要処理部120へ出力される。
続いてシフトレジスタ111は、クロック信号に同期してSDO端子からダミーデータを出力する(RDフェーズ)。
On the other hand, in the
Subsequently, the
RDフェーズにおいて、スレーブ装置200では、状態遷移制御部213が受信シフトレジスタ211に格納されたR/W制御情報に従ってリードかライトかを判定する(ステップST6)。今回はリードのため(ステップST6“Read”)、SDI端子からダミーデータを受信して受信シフトレジスタ211へ格納していく(ステップST8)。
また、状態遷移制御部213はASフェーズからRDフェーズに遷移したことを判定して(ステップST15“Read”)、送信データセレクタ212へ選択信号を出力し、送信データセレクタ212がスレーブ装置主要処理部220から出力されるリードデータをSDO端子からマスタ装置100へ送信する(ステップST18)。
In the RD phase, in the
Further, the state
一方、マスタ装置100のマスタ装置主要処理部120は、先のASフェーズで事前入手していたRD用パリティを用いて、今回のRDフェーズでSDI端子から入力されシフトレジスタ111に格納された8ビットのリードデータをパリティチェックする(RDフェーズ)。なお、マスタ装置100はパリティチェック結果に応じて、リード動作を繰り返すなど所定の対応を行う。
On the other hand, the master device
以上より、実施の形態1によれば、同期式の全二重シリアル通信を行うシリアル通信システムのリード動作時は、ASフェーズにおいて、マスタ装置100からスレーブ装置200へリードデータのアドレスを含めたフレームを送信し、かつ、スレーブ装置200ではアドレスを受信した時点でリードデータを読み出してRD用パリティを求めて同一フレーム中にマスタ装置100へ返送し、続くRDフェーズにおいて、スレーブ装置200からマスタ装置100へASフェーズで読み出したリードデータを含めたフレームを送信するように構成した。このため、RDフェーズより先にRD用パリティを送出するようにして、ASフェーズとRDフェーズの2フレームの通信時間でRD用パリティ(エラー検出のための情報)を含んだ通信を完了させることができる。よって、パリティだけのフレームを別途通信することなくマスタ側で即座にパリティチェックを開始することができる。また、通信信頼性も高めることができる。従って、従来の3フレームから2フレームに削減して1フレーム分の通信レイテンシの短縮(最大約3割の短縮)および通信帯域の増強が可能となり、さらに、リアルタイム処理が重要となるアプリケーションで求められる応答時間を短縮することができる。
即ち、仮に通信速度が9600bps、マイコンコアの動作周波数が4MHzと仮定すれば、1ビットの通信パルス幅は1sec/9600=約104μsecであり、マイコンコアの動作周期は1sec/4,000,000=250nsec(0.25μsec)である。
1バイト=8ビットのデータフレームを送受信するにあたって、従来手法によれば、その通信時間は104μsec×8ビット×3フレーム=2496μsecと求めることができるが、本発明での通信時間は104μsec×8ビット×2フレーム=1664μsecとなるため、差し引き2496−1664=832μsecの通信レイテンシの短縮が可能となる。
動作周波数4MHzのマイコンコアにおいて、この差は832μsec/250nsec=3328サイクルに相当することになる。
つまり、本発明により、従来方式に比較して、通信レイテンシの短縮により、通信完了後に実行すべき最大3328命令分もの処理を先行して実行可能となる。
As described above, according to the first embodiment, during the read operation of the serial communication system that performs the synchronous full-duplex serial communication, the frame including the read data address from the
That is, assuming that the communication speed is 9600 bps and the operation frequency of the microcomputer core is 4 MHz, the communication pulse width of 1 bit is 1 sec / 9600 = about 104 μsec, and the operation cycle of the microcomputer core is 1 sec / 4,000,000 = 250 nsec (0.25 μsec).
When transmitting / receiving a data frame of 1 byte = 8 bits, according to the conventional method, the communication time can be obtained as 104 μsec × 8 bits × 3 frames = 2696 μsec, but the communication time in the present invention is 104 μsec × 8 bits. Since × 2 frames = 1664 μsec, it is possible to reduce the communication latency by subtracting 2496-1664 = 832 μsec.
In a microcomputer core with an operating frequency of 4 MHz, this difference corresponds to 832 μsec / 250 nsec = 3328 cycles.
In other words, according to the present invention, processing of up to 3328 instructions to be executed after completion of communication can be executed in advance by reducing communication latency as compared with the conventional method.
また、実施の形態1によれば、マスタ装置100からスレーブ装置200へ送信するASフェーズにおいて、パリティより先出側にアドレスを詰めたフレームを送信するようにしたので、このASフェーズ中に、スレーブ装置200でアドレスを受信した時点でスレーブ装置主要処理部220がリードデータを先行して読み出してRD用パリティを求めて返送することができる。
Further, according to the first embodiment, in the AS phase that is transmitted from the
また、実施の形態1によれば、同期式の全二重シリアル通信を行うシリアル通信システムのライト動作時は、ASフェーズにおいて、マスタ装置100からスレーブ装置200へライトデータのアドレスと、WD用パリティとを含めたフレームを送信し、続くWDフェーズにおいて、マスタ装置100からスレーブ装置200へライトデータを含めたフレームを送信するように構成した。このため、ライト動作においてもマスタ側からWDフェーズより先のASフェーズでWD用パリティ(エラー検出のための情報)を送出し、続くWDフェーズでライトデータを送出して同一フレーム中にパリティチェック結果を受け取るようにして、ASフェーズとWDフェーズの2フレームの通信時間でWD用パリティのパリティチェック結果を含んだ通信を完了させることができる。よって、通信信頼性を高めることができる。また、従来の3フレームから2フレームに削減して1フレーム分の通信レイテンシの短縮および通信帯域の増強が可能となり、さらに、リアルタイム処理が重要となるアプリケーションで求められる応答時間を短縮することができる。
Further, according to the first embodiment, during the write operation of the serial communication system that performs synchronous full-duplex serial communication, in the AS phase, the address of the write data from the
なお、リード動作時およびライト動作時とも、通信単位であるフレームのビット数は、マスタ装置100およびスレーブ装置200のデータビット数と一致するか、またはデータビット数より少ないものとする。
ここで、マスタ装置100およびスレーブ装置200のデータビット数というのは、各装置の内部で、1度に処理できるデータの幅をビット数で表したものであり、例えば一度に8ビットのみ演算できるものはデータビット数8ビット、32ビットの演算ができるものについてはデータビット数32ビットとなる。
なお、外部データ・バス幅が16ビットの32ビット・マイコンなど、入出力ビット数が内部データ・バス幅より少ない製品も存在するが、これらデータビット数については一般に用いられる概念に過ぎないため、説明の詳細は割愛する。
Note that the number of bits of a frame, which is a communication unit, is the same as the number of data bits of the
Here, the number of data bits of the
There are products such as 32-bit microcomputers with an external data bus width of 16 bits, such as a 32-bit microcomputer with fewer input / output bits than the internal data bus width. The details of explanation are omitted.
また、ライト動作時は、リード動作時のようなリードデータを先行して読み込み処理する必要がないので、送信データセレクタ212および状態遷移制御部213を省略することも可能である。その場合、受信シフトレジスタ211をシフトレジスタ111と同じように使用し、受信したデータをシリアル/パラレル変換してスレーブ装置主要処理部220へ出力すると共に、スレーブ装置主要処理部220から出力されたデータをパラレル/シリアル変換してマスタ装置100へ送信すればよい。
Further, during the write operation, it is not necessary to read the read data in advance as in the read operation, so that the
なお、ライト動作時は、全二重シリアル通信に限定されるものではなく、半二重または単向のシリアル通信であってもよい。
また、ASフェーズとWDフェーズは順番が逆であってもよい。即ち、ライト動作時のマスタ装置100は、先ずWDフェーズにおいて、スレーブ装置200へ書き込むためのライトデータをマスタ装置主要処理部120から受け付けてシフトレジスタ111からスレーブ装置200へ送信し、続くASフェーズにおいて、このライトデータのアドレス、およびマスタ装置主要処理部120で求めたWD用パリティを含めたフレームをシフトレジスタ111からスレーブ装置200へ送信するように構成する。他方のスレーブ装置200は、先ずWDフェーズにおいて、スレーブ装置主要処理部220に書き込むためのライトデータを含むフレームをマスタ装置100より受信し、続くASフェーズにおいて、マスタ装置100よりライトデータのアドレスおよびWD用パリティを含むフレームを受信し、かつ、スレーブ装置主要処理部220が、ASフェーズで受信したWD用パリティを用いてWDフェーズで受信したライトデータのエラー検出処理を行い、パリティチェック結果を含めたフレームをマスタ装置100へ送信するように構成する。この場合であっても、2フレームの通信時間でWD用パリティを含んだ信頼性の高い通信を完了させることができる。
なお、通信単位であるフレームのビット数は、マスタ装置100およびスレーブ装置200のデータビット数と一致するか、またはデータビット数より少ないものとする。
Note that the write operation is not limited to full-duplex serial communication, but may be half-duplex or unidirectional serial communication.
Further, the order of the AS phase and the WD phase may be reversed. That is, the
It is assumed that the number of bits of a frame that is a communication unit matches the number of data bits of
また、実施の形態1によれば、マスタ装置100からスレーブ装置200へ送信するASフェーズにおいて、マスタ装置100がアドレスと、R/W制御情報と、AS用パリティとを含めたフレームを生成するようにし、特にアドレスはシフトレジスタ111の先頭ビット側に詰めるように構成した。このため、このASフレーズ中に、スレーブ装置200がAS用パリティを用いてアドレスのパリティチェックを行いチェック結果を返送することができる。従って、2フレームの通信時間で、リードデータまたはライトデータのパリティだけでなく、アドレスのパリティを含んだ通信を完了させることができる。これにより、通信時間短縮に加え、通信信頼性の更なる向上を図ることもできる。
Further, according to the first embodiment, in the AS phase transmitted from the
また、実施の形態1によれば、スレーブ装置200は、AS用パリティを用いたアドレスとR/W制御情報のエラー検出処理においてエラーが検出された場合、およびWD用パリティを用いたライトデータのエラー検出処理においてエラーが検出された場合のいずれか一方、または両方において、このライトデータの書き込みを中止するように構成した。このため、スレーブ装置200側で誤って受信したライトデータ値の書き込みを防止することにより、誤った設定・制御の発生による、誤動作の発生を防ぐことができる。
Also, according to the first embodiment, the
なお、本発明の実施形態を図面を参照して詳述してきたが、具体的な構成は、上述した実施の形態の構成に限られるものではなく、本発明の要旨を逸脱しない範囲の設計の変更などがあっても本発明に含まれることは言うまでもない。
例えば、上記実施の形態1では1台のマスタ装置100と1台のスレーブ装置200を用いたが、スレーブ装置200を複数台用いても構わない。
また例えば、マスタ装置100として汎用マイコンを用いたが、これに限定されるものではなく、スレーブ装置200をマスタ装置100として利用してもよい。この構成の場合、クロック生成部130を具備したスレーブ装置200を複数台用意し、そのうちの1台のクロック生成部130をアクティブにして他のスレーブ装置200へクロック信号を送信する等すればよい。
また例えば、アドレス、リードデータおよびライトデータそれぞれのエラー検出処理を行う構成にしたが、これに限定されるものではなく、エラー検出に加えエラー訂正を行う構成にしてもよい。
Although the embodiment of the present invention has been described in detail with reference to the drawings, the specific configuration is not limited to the configuration of the above-described embodiment, and the design does not depart from the gist of the present invention. Needless to say, changes and the like are included in the present invention.
For example, in the first embodiment, one
For example, although a general-purpose microcomputer is used as the
Further, for example, the error detection process for each of the address, read data, and write data is performed. However, the present invention is not limited to this, and an error correction may be performed in addition to error detection.
また、上記実施の形態1では、物理的に実存するクロック信号を伝送するシリアルクロックライン、および当該クロック信号に同期したデータ信号を送受信するシリアルデータラインを用いるものとして説明したが、シリアルクロックラインを通じてクロックの同期を図る必要はなく、送信側のクロックに同期してデータを符号化し、受信側でクロックリカバリ回路などによりデータ信号からクロックを再生して、内部的に同期を図る構成にしても構わない。
また、シリアルデータラインはデータ入力用のSDI端子とデータ出力用のSDO端子の2本として説明したが、例えば通信高速化等の目的のため、2本以上のデータラインを用いても同様の技術的思想により本発明を適用しうることを言うまでも無い。
In the first embodiment, a serial clock line that transmits a physically existing clock signal and a serial data line that transmits and receives a data signal synchronized with the clock signal are used. There is no need to synchronize the clock, and the data may be encoded in synchronization with the clock on the transmission side, and the clock may be regenerated from the data signal on the reception side by a clock recovery circuit or the like, thereby internally synchronizing. Absent.
Further, the serial data line has been described as two data input SDI terminal and data output SDO terminal, but for the purpose of speeding up communication, for example, the same technology can be used even if two or more data lines are used. Needless to say, the present invention can be applied according to a specific idea.
100 マスタ装置
110,210 シリアル通信部
111 シフトレジスタ
120 マスタ装置主要処理部
130 クロック生成部
200 スレーブ装置
211 受信シフトレジスタ
212 送信データセレクタ
213 状態遷移制御部
220 スレーブ装置主要処理部
DESCRIPTION OF
Claims (13)
通信単位であるフレームのビット数が、マスタ側およびスレーブ側の各通信装置のデータビット数と一致する場合、または当該データビット数より少ない場合に、
前記マスタ側から前記スレーブ側へリードデータのアドレス情報を含めたフレームを送信し、かつ、前記スレーブ側では前記アドレス情報を受信した時点で前記リードデータを読み出してエラー検出または訂正のための情報を求めて同一フレーム中に前記マスタ側へ返送する第1フェーズと、
前記スレーブ側から前記マスタ側へ、前記第1フェーズで読み出した当該リードデータを含めたフレームを送信する第2フェーズとを備えることを特徴とするシリアル通信方法。 In a serial communication method of a communication device connected by a serial data line for transmitting and receiving data signals and performing full duplex communication,
When the number of bits of a frame that is a communication unit matches the number of data bits of each communication device on the master side and the slave side, or less than the number of data bits,
Sending a frame including address information of read data from the master side to the slave side, and reading the read data at the time of receiving the address information on the slave side, information for error detection or correction A first phase for seeking and returning to the master in the same frame;
A serial communication method comprising: a second phase for transmitting a frame including the read data read in the first phase from the slave side to the master side.
通信単位であるフレームのビット数が、マスタ側およびスレーブ側の各通信装置のデータビット数と一致する場合、または当該データビット数より少ない場合に、
前記マスタ側から前記スレーブ側へライトデータのアドレス情報と、当該ライトデータのエラー検出または訂正のための情報とを含めたフレームを送信する第1フェーズと、
前記マスタ側から前記スレーブ側へ当該ライトデータを含めたフレームを送信する第2フェーズとを備えることを特徴とするシリアル通信方法。 In a serial communication method of a communication device that performs serial communication connected by a serial data line that transmits and receives data signals,
When the number of bits of a frame that is a communication unit matches the number of data bits of each communication device on the master side and the slave side, or less than the number of data bits,
A first phase for transmitting a frame including address information of write data from the master side to the slave side and information for error detection or correction of the write data;
And a second phase for transmitting a frame including the write data from the master side to the slave side.
通信単位であるフレームのビット数が、マスタ側およびスレーブ側の各通信装置のデータビット数と一致する場合、または当該データビット数より少ない場合に、
マスタ側の通信装置は、
第1フェーズにおいて、リードデータのアドレス情報を含めたフレームをスレーブ側へ送信し、かつ、前記スレーブ側より当該リードデータのエラー検出または訂正のための情報を含むフレームを受信し、
第2フェーズにおいて、前記スレーブ側より当該リードデータを含むフレームを受信することを特徴とする通信装置。 In a communication device that is connected by a serial data line that transmits and receives data signals and performs full-duplex communication,
When the number of bits of a frame that is a communication unit matches the number of data bits of each communication device on the master side and the slave side, or less than the number of data bits,
The communication device on the master side
In the first phase, a frame including address information of read data is transmitted to the slave side, and a frame including information for error detection or correction of the read data is received from the slave side,
In the second phase, the communication apparatus receives a frame including the read data from the slave side.
通信単位であるフレームのビット数が、マスタ側およびスレーブ側の各通信装置のデータビット数と一致する場合、または当該データビット数より少ない場合に、
前記マスタ側の通信装置は、
第1フェーズにおいて、ライトデータのアドレス情報と、当該ライトデータのエラー検出または訂正のための情報とを含むフレームを前記スレーブ側へ送信し、
第2フェーズにおいて、当該ライトデータを含むフレームを前記スレーブ側へ送信することを特徴とする通信装置。 In a communication device that performs serial communication connected by a serial data line that transmits and receives data signals,
When the number of bits of a frame that is a communication unit matches the number of data bits of each communication device on the master side and the slave side, or less than the number of data bits,
The master side communication device is:
In the first phase, a frame including address information of write data and information for error detection or correction of the write data is transmitted to the slave side,
In the second phase, the communication apparatus transmits a frame including the write data to the slave side.
通信単位であるフレームのビット数が、マスタ側およびスレーブ側の各通信装置のデータビット数と一致する場合、または当該データビット数より少ない場合に、
スレーブ側の通信装置は、
第1フェーズにおいて、前記マスタ側よりリードデータのアドレス情報を含むフレームを受信し、かつ、当該アドレス情報を受信した時点で当該リードデータを読み出してエラー検出または訂正のための情報を求めて同一フレーム中に前記マスタ側へ送信し、
第2フェーズにおいて、前記第1フェーズで読み出した当該リードデータを含めたフレームを前記マスタ側へ送信することを特徴とする通信装置。 In a communication device that is connected by a serial data line that transmits and receives data signals and performs full-duplex communication,
When the number of bits of a frame that is a communication unit matches the number of data bits of each communication device on the master side and the slave side, or less than the number of data bits,
The communication device on the slave side
In the first phase, a frame including read data address information is received from the master side, and when the address information is received, the read data is read to obtain information for error detection or correction. To the master side during
In the second phase, a frame including the read data read in the first phase is transmitted to the master side.
通信単位であるフレームのビット数が、マスタ側およびスレーブ側の各通信装置のデータビット数と一致する場合、または当該データビット数より少ない場合に、
前記スレーブ側の通信装置は、
第1フェーズにおいて、前記マスタ側よりライトデータのアドレス情報と、当該ライトデータのエラー検出または訂正のための情報とを含むフレームを受信し、
第2フェーズにおいて、前記マスタ側より当該ライトデータを含むフレームを受信することを特徴とする通信装置。 In a communication device that performs serial communication connected by a serial data line that transmits and receives data signals,
When the number of bits of a frame that is a communication unit matches the number of data bits of each communication device on the master side and the slave side, or less than the number of data bits,
The slave side communication device is:
In the first phase, a frame including address information of write data and information for error detection or correction of the write data is received from the master side,
In the second phase, the communication apparatus receives a frame including the write data from the master side.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011278587A JP5804930B2 (en) | 2011-12-20 | 2011-12-20 | Serial communication method, communication apparatus, and serial communication system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011278587A JP5804930B2 (en) | 2011-12-20 | 2011-12-20 | Serial communication method, communication apparatus, and serial communication system |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2013131836A JP2013131836A (en) | 2013-07-04 |
JP5804930B2 true JP5804930B2 (en) | 2015-11-04 |
Family
ID=48909097
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2011278587A Active JP5804930B2 (en) | 2011-12-20 | 2011-12-20 | Serial communication method, communication apparatus, and serial communication system |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5804930B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101558687B1 (en) | 2013-12-10 | 2015-10-08 | 현대자동차주식회사 | Serial communication test device, system including the same and method thereof |
KR101637998B1 (en) * | 2014-11-19 | 2016-07-12 | 현대오트론 주식회사 | Communication apparatus and method for serial peripheral interface |
-
2011
- 2011-12-20 JP JP2011278587A patent/JP5804930B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2013131836A (en) | 2013-07-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7821919B2 (en) | Data processing apparatus and data processing method | |
US8234463B2 (en) | Data processing apparatus, memory controller, and access control method of memory controller | |
JP5835464B2 (en) | Information processing apparatus and information processing apparatus control method | |
JP2010157058A (en) | Memory device, host device, and sampling clock adjusting method | |
TW200910372A (en) | Improving latency by offsetting cyclic redundancy code lanes from data lanes | |
JP5804930B2 (en) | Serial communication method, communication apparatus, and serial communication system | |
JP2008011123A (en) | Communication device performing redundant data communication | |
JPWO2020166378A1 (en) | Communication equipment and methods, and programs | |
US10764409B2 (en) | Data communication device, arithmetic processing device, and control method of data communication device | |
CN115963891A (en) | Method, apparatus, storage medium, and device for synchronous serial communication delay compensation | |
EP3671720B1 (en) | Real-time on-chip data transfer system | |
CN109327284B (en) | Data transmission method and device and electronic equipment | |
CN113821463A (en) | PCIE controller verification method and device based on FPGA and computer equipment | |
JP6595868B2 (en) | Information processing system, device, and interface control method | |
JP2015154233A (en) | Data transmission device, data transmission system, calibration method, and program | |
JP2834094B2 (en) | Asynchronous communication device | |
WO2023139963A1 (en) | Semiconductor device and electronic apparatus | |
US11777627B2 (en) | Serial communication apparatus and serial communication method that are capable of efficiently eliminating a timing lag between serial, data transferred via a plurality of routes in serial communication | |
CN112422229B (en) | Physical layer reconstruction system | |
WO2019176580A1 (en) | Communication device, communication method, program, and communication system | |
JP4239482B2 (en) | Data transfer system, LSI and data transfer method | |
JP6359192B2 (en) | Duplex process control device | |
JP2018125814A (en) | Transmission device, transmission method, and transmission system | |
CN115687188A (en) | Display interface signal output conversion circuit and related method | |
JP6414702B2 (en) | Image processing device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20140922 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20150724 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20150804 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20150901 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5804930 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |