JP5804930B2 - Serial communication method, communication apparatus, and serial communication system - Google Patents

Serial communication method, communication apparatus, and serial communication system Download PDF

Info

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
Application number
JP2011278587A
Other languages
Japanese (ja)
Other versions
JP2013131836A (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.)
Azbil Corp
Original Assignee
Azbil 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 Azbil Corp filed Critical Azbil Corp
Priority to JP2011278587A priority Critical patent/JP5804930B2/en
Publication of JP2013131836A publication Critical patent/JP2013131836A/en
Application granted granted Critical
Publication of JP5804930B2 publication Critical patent/JP5804930B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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 Patent Document 1, a parity signal for request in full-duplex asynchronous communication and The data signal was superimposed and transmitted. However, since the communication system of Patent Document 1 is an asynchronous system and multi-value processing by superposition is necessary, in order to realize a conventional synchronous communication system with a low-cost (binary) digital dedicated circuit. It cannot be applied as it is.

特開2006−246394号公報JP 2006-246394 A

以上のように、従来の全二重同期通信システムはエラー検出・訂正情報を通信するために追加されたフレーム分、通信時間が長くなるという課題があった。特に通信速度が遅い場合、無駄なフレームの追加がミリ秒単位で通信時間が増加してしまうため、少しでも少ないフレームで通信が完結することが望まれている。   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に係るシリアル通信システムの構成を示すブロック図である。It is a block diagram which shows the structure of the serial communication system which concerns on Embodiment 1 of this invention. 実施の形態1に係るシリアル通信システムの通信フレーム構成を説明する図である。3 is a diagram illustrating a communication frame configuration of the serial communication system according to Embodiment 1. FIG. 実施の形態1に係るスレーブ装置のタイミングチャートであり、ライト動作を示す。4 is a timing chart of the slave device according to the first embodiment and shows a write operation. 実施の形態1に係るスレーブ装置のタイミングチャートであり、リード動作を示す。4 is a timing chart of the slave device according to the first embodiment and shows a read operation. 実施の形態1に係るスレーブ装置の動作を示すフローチャートである。3 is a flowchart showing an operation of the slave device according to the first embodiment.

実施の形態1.
図1は、本実施の形態1に係るシリアル通信システムの構成を示すブロック図である。図示例のシリアル通信システムは、マスタ装置100とスレーブ装置200を備え、これらマスタ装置100とスレーブ装置200との間がシリアルクロック入力用のシリアルクロックライン(SCLK端子)および2本のシリアルデータライン(データ入力用のSDI端子とデータ出力用のSDO端子)の合計3ラインで接続されて、SPI(Serial Prepheral Interface)を利用した全二重通信を行う。
Embodiment 1 FIG.
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 master device 100 and a slave device 200. Between the master device 100 and the slave device 200, a serial clock line (SCLK terminal) for inputting a serial clock and two serial data lines ( The SDI terminal for data input and the SDO terminal for data output are connected by a total of three lines, and full-duplex communication using SPI (Serial Preferential Interface) is performed.

以下では、マスタ装置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 master device 100, and the communication unit (frame) is 8 bits in accordance with this specification. The slave device 200 is a peripheral device such as an ASIC (Application Specific Integrated Circuit) or an FPGA (Field-Programmable Gate Array).
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 master device 100 to the register (not shown) of the slave device 200 is realized by a two-phase operation of AS phase + RD phase or a two-phase operation of AS phase + WD phase. Therefore, the two-phase operation requires a communication time of two 8-bit communications (that is, two frames).

マスタ装置100は、スレーブ装置200との間でシリアル通信を行うシリアル通信部110と、マイコンコアであるマスタ装置主要処理部120と、スレーブ装置200との間で通信を同期するためのクロック信号を生成するクロック生成部130とを備える。マスタ側のシリアル通信部110は、SPIの全二重通信を行う通信回路であり、クロック生成部130から出力されるクロック信号に同期したタイミングで動作するシフトレジスタ111を備える。なお、シリアル通信部110とマスタ装置主要処理部120との間のデータのやり取りは、内部バスインタフェース(不図示)を介して行ってもよい。   The master device 100 generates a clock signal for synchronizing communication between the serial communication unit 110 that performs serial communication with the slave device 200, the master device main processing unit 120 that is a microcomputer core, and the slave device 200. And a clock generation unit 130 for generation. The serial communication unit 110 on the master side is a communication circuit that performs SPI full-duplex communication, and includes a shift register 111 that operates at a timing synchronized with a clock signal output from the clock generation unit 130. Note that data exchange between the serial communication unit 110 and the master device main processing unit 120 may be performed via an internal bus interface (not shown).

シフトレジスタ111は、マスタ装置主要処理部120側から入力されるパラレルデータ(アドレス、R/W制御情報、ライトデータなど)を格納し、シリアルデータに変換して、SDO端子から1ビットずつ出力する。また、シフトレジスタ111は、SDI端子から入力されるシリアルデータ(リードデータなど)を格納して、パラレルデータに変換して、マスタ装置主要処理部120へ出力する。
マスタ装置主要処理部120は、スレーブ装置200へ送信するデータのパリティを計算してシフトレジスタ111へ出力すると共に、スレーブ装置200から受信したデータに含まれるパリティを取得してパリティチェックを行う。
The shift register 111 stores parallel data (address, R / W control information, write data, etc.) input from the master device main processing unit 120 side, converts it into serial data, and outputs it from the SDO terminal bit by bit. . The shift register 111 stores serial data (such as read data) input from the SDI terminal, converts it into parallel data, and outputs the parallel data to the master device main processing unit 120.
The master device main processing unit 120 calculates the parity of the data to be transmitted to the slave device 200 and outputs it to the shift register 111, and acquires the parity included in the data received from the slave device 200 and performs a parity check.

スレーブ装置200は、マスタ装置100との間でシリアル通信を行うシリアル通信部210と、マイコンコアであるスレーブ装置主要処理部220とを備える。スレーブ側のシリアル通信部210は、SPIの全二重通信を行う通信回路であり、マスタ側のシリアル通信部110から入力されるクロック信号に同期したタイミングで動作する受信シフトレジスタ211、送信データセレクタ212および状態遷移制御部213を備える。なお、シリアル通信部210とスレーブ装置主要処理部220との間のデータのやり取りは、内部バスインタフェース(不図示)を介して行ってもよい。   The slave device 200 includes a serial communication unit 210 that performs serial communication with the master device 100 and a slave device main processing unit 220 that is a microcomputer core. The slave-side serial communication unit 210 is a communication circuit that performs SPI full-duplex communication, and includes a reception shift register 211 that operates at a timing synchronized with a clock signal input from the master-side serial communication unit 110, and a transmission data selector. 212 and a state transition control unit 213. Note that data exchange between the serial communication unit 210 and the slave device main processing unit 220 may be performed via an internal bus interface (not shown).

受信シフトレジスタ211は、SDI端子から入力されるシリアルデータ(アドレス、R/W制御情報、ライトデータ、パリティなど)を格納し、パラレルデータに変換して、スレーブ装置主要処理部220へ出力する。送信データセレクタ212は、スレーブ装置主要処理部220から入力されるパラレルデータ(リードデータなど)、受信シフトレジスタ211の格納するデータ、およびスレーブ装置主要処理部220から入力されるパリティチェック結果のうちから、状態遷移制御部213の選択信号に従ったデータを選択取得し、シリアルデータに変換して、SDO端子から1ビットずつ出力する。
スレーブ装置主要処理部220は、マスタ装置100へ送信するデータのパリティを計算して送信データセレクタ212へ出力すると共に、マスタ装置100から受信したデータに含まれるパリティを取得してパリティチェックを行う。
状態遷移制御部213は、SDI端子から入力される各ビットのデータに基づいて、リード/ライト動作およびフェーズ種別を判定して、各ビットについて予め定められた選択信号(アドレス情報またはライト情報)を送信データセレクタ212およびスレーブ装置主要処理部220に出力する。
The reception shift register 211 stores serial data (address, R / W control information, write data, parity, etc.) input from the SDI terminal, converts it into parallel data, and outputs it to the slave device main processing unit 220. The transmission data selector 212 is selected from among parallel data (such as read data) input from the slave device main processing unit 220, data stored in the reception shift register 211, and parity check results input from the slave device main processing unit 220. The data according to the selection signal of the state transition control unit 213 is selectively acquired, converted into serial data, and output bit by bit from the SDO terminal.
The slave device main processing unit 220 calculates the parity of the data to be transmitted to the master device 100 and outputs it to the transmission data selector 212, and obtains the parity included in the data received from the master device 100 and performs a parity check.
The state transition control unit 213 determines the read / write operation and the phase type based on the data of each bit input from the SDI terminal, and receives a selection signal (address information or write information) predetermined for each bit. The data is output to the transmission data selector 212 and the slave device main processing unit 220.

(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 slave device 200. FIG. 3 shows the AS phase and WD phase during the write operation, and FIG. 4 shows the AS phase and RD phase during the read operation. As shown in FIG. 3, the slave device 200 detects the signal at the SDI terminal at the falling edge of the clock signal in synchronization with the clock signal input from the SCLK terminal, and the SDO terminal at the falling edge of the clock signal. Output from. On the other hand, master device 100 detects the signal at the SDI terminal at the timing indicated by the broken line in FIGS.

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 bits 0 to 7 from the SDO terminal on the master side to the SDI terminal on the slave side. Bit 0 is a start bit (value is 0). Bits 1 to 4 are an address (4 bits) of a read / write operation target register. Bit 5 is R / W control information for designating either a read / write operation, and is 1 for a read operation and 0 for a write operation. Bit 6 is an AS parity (in this case, odd) of the upper 5 bits of the AS phase (address 4 bits and R / W control information 1 bit). In order to check on the slave side whether the address request is correct or not. Information to be used. Bit 7 is a WD parity (in this case, odd) of write data (8 bits) transmitted in the WD phase during a write operation, and is information used to check whether the write data received on the slave side is correct. is there. In the first embodiment, the parity for WD is transmitted in advance in the AS phase preceding the WD phase. On the other hand, transmission of parity is not necessary in the AS phase during the read operation.

マスタ側からスレーブ側への送信と同時に、スレーブ側の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 bits 0 to 7 from the SDO terminal on the slave side to the SDI terminal on the master side. Bits 0 to 5 may be any value, for example, the upper 6 bits received by the slave side in the previous phase as dummy data are returned as they are. Bit 6 is RD parity of read data (8 bits) transmitted in the RD phase during the read operation, and is obtained by reading the read data in the cycle of bit 5 in the AS phase. In the first embodiment, RD parity is transmitted in advance in the AS phase preceding the RD phase. On the other hand, transmission of parity is not necessary in the AS phase during the write operation. Bit 7 is information indicating the parity check result of the address received on the slave side. The address and R / W control information received in the AS phase are also used as the AS parity received in the AS phase. This is a parity check (5 if there is no error) in 5 cycles.

なお、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 main processing unit 220 in advance (timing indicated by the solid arrow in FIG. 4), parity check is performed, and the result is returned in the same phase. It becomes possible to do. Details will be described later.

(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 bits 0 to 7 from the SDO terminal on the master side to the SDI terminal on the slave side. Bits 0 to 7 are write data (8 bits) for writing to the address specified in the previous AS phase.
Simultaneously with the transmission from the master side to the slave side, data is transmitted in the order of bits 0 to 7 from the SDO terminal on the slave side to the SDI terminal on the master side. However, bits 0 to 5 may be any value, for example, the upper 7 bits received by the slave side in the previous phase as dummy data are returned as they are. Bit 7 is information indicating the parity check result of the write data received on the slave side, and the write data received in the WD phase is used in the cycle of bit 7 by using the WD parity received in the previous AS phase. Parity check (1 if there is no error).

(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 bits 0 to 7 from the SDO terminal on the master side to the SDI terminal on the slave side. However, the bits 0 to 7 may be any value.
Simultaneously with the transmission from the master side to the slave side, data is transmitted in the order of bits 0 to 7 from the SDO terminal on the slave side to the SDI terminal on the master side. Bits 0 to 7 are read data (8 bits) read from the register at the address specified in the previous AS phase.

図1に示すマスタ装置100において、シリアル通信部110は、従来のSPI通信に必要なハードウェア構成と同じでよい。ただし、従来のSPI通信とはソフトウェア上の処理が異なる。従来のSPI通信では、先立って説明したように最初のフレームでアドレスとR/W制御情報を送信するのに対し、本実施の形態1ではAS用パリティとWD用パリティを求めて、最初のフレーム(ASフェーズ)でアドレスとR/W制御情報に加えてAS用パリティとWD用パリティも送信する。   In the master device 100 shown in FIG. 1, the serial communication unit 110 may have the same hardware configuration as that required for conventional SPI communication. However, software processing is different from conventional SPI communication. In the conventional SPI communication, the address and the R / W control information are transmitted in the first frame as described above. In the first embodiment, the first frame is obtained by obtaining the parity for AS and the parity for WD. In the (AS phase), in addition to the address and R / W control information, an AS parity and a WD parity are also transmitted.

他方のスレーブ装置200において、シリアル通信部210は、従来のSPI通信に必要なハードウェア構成に加え、新たに送信データセレクタ212と状態遷移制御部213とを備えている。
以下、これら送信データセレクタ212と状態遷移制御部213を備えたスレーブ装置200の動作を中心にして、マスタ装置100を含めたシリアル通信システム全体の動作を説明する。
In the other slave device 200, the serial communication unit 210 is newly provided with a transmission data selector 212 and a state transition control unit 213 in addition to the hardware configuration necessary for conventional SPI communication.
Hereinafter, the operation of the entire serial communication system including the master device 100 will be described focusing on the operation of the slave device 200 including the transmission data selector 212 and the state transition control unit 213.

先ずライト動作を説明し、続いてリード動作を説明する。
ライト動作時の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 master device 100, the master device main processing unit 120 calculates the AS parity from the write data address and the R / W control information, and outputs it to the shift register 111. The WD parity is calculated from the data and output to the shift register 111.
The shift register 111 stores the address and R / W control information output from the master device main processing unit 120, the parity for AS, and the parity for WD in bits 1 to 7. Bit 0 is a start bit.
The serial communication unit 110 outputs the clock signal generated by the clock generation unit 130 from the SCLK terminal, and outputs the 8-bit data stored in the shift register 111 from the SDO terminal in synchronization with the clock signal (AS phase). ).

図5は、スレーブ装置200の動作を示すフローチャートである。ステップST1〜ST8は受信側の処理、ステップST11〜ST18は送信側の処理であり、マスタ装置100とスレーブ装置200の送受信はSCLK端子のクロック信号に同期して行われる。また、ステップST21〜ST24の処理は各種の内部処理であり、状態遷移制御部213の指示で行われる。   FIG. 5 is a flowchart showing the operation of the slave device 200. Steps ST1 to ST8 are processing on the reception side, and steps ST11 to ST18 are processing on the transmission side. Transmission / reception between the master device 100 and the slave device 200 is performed in synchronization with the clock signal at the SCLK terminal. Further, the processes in steps ST21 to ST24 are various internal processes, and are performed according to an instruction from the state transition control unit 213.

スレーブ装置200のシリアル通信部210では、状態遷移制御部213がSDI端子から入力されるビット0のスタートビットを検出し(ステップST1“YES”)、ASフェーズの開始を判定する。そして、受信したビット0のデータは受信シフトレジスタ211に格納する。
他方、スタートビットを検出した状態遷移制御部213は、送信データセレクタ212へ選択信号を出力し、送信データセレクタ212が受信シフトレジスタ211に格納されていた前回受信データの上位1ビットを選択して、ダミーデータとしてSDO端子からマスタ装置100へ送信する(ステップST11)。
In the serial communication unit 210 of the slave device 200, the state transition control unit 213 detects the start bit of bit 0 input from the SDI terminal (step ST1 “YES”), and determines the start of the AS phase. The received data of bit 0 is stored in the reception shift register 211.
On the other hand, the state transition control unit 213 that has detected the start bit outputs a selection signal to the transmission data selector 212, and the transmission data selector 212 selects the upper 1 bit of the previous reception data stored in the reception shift register 211. Then, it is transmitted as dummy data from the SDO terminal to the master device 100 (step ST11).

シリアル通信部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 serial communication unit 210 receives the address of bits 1 to 4 and the R / W control information of bit 5 from the master device 100 and stores them in the reception shift register 211 (steps ST2 and ST3).
On the other hand, the state transition control unit 213 continues to output a selection signal to the transmission data selector 212, and the transmission data selector 212 selects bits 1 to 5 of the previous reception data stored in the reception shift register 211 to obtain dummy data. Transmission is performed from the SDO terminal to the master device 100 (step ST12).
Further, the state transition control unit 213 notifies the slave device main processing unit 220 of the address of bits 1 to 4 stored in the reception shift register 211 in advance, and the slave device main processing unit 220 reads during the AS phase. Data is read and RD parity is calculated (steps TT21 and ST22).

シリアル通信部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 serial communication unit 210 receives the AS parity of bit 6 from the master device 100 and stores it in the reception shift register 211 (step ST4).
On the other hand, the state transition control unit 213 determines whether to write or read according to the R / W control information. In the case of writing, the state transition control unit 213 continues to output a selection signal to the transmission data selector 212, and the transmission data selector 212 is stored in the reception shift register 211. Bit 6 of the previously received data that has been received is selected and transmitted as dummy data from the SDO terminal to master device 100 (step ST13). Processing in the case of reading will be described later. In the case of writing, the RD parity obtained in step ST22 is not necessary.
Further, the slave device main processing unit 220 acquires data from the reception shift register 211, and performs parity check of the address and the R / W control information using the AS parity (step ST23).

シリアル通信部210は、マスタ装置100からビット7のWD用パリティを受信して、受信シフトレジスタ211に格納する(ステップST5)。
他方、状態遷移制御部213は送信データセレクタ212に対してスレーブ装置主要処理部220からアドレスのパリティチェック結果を取得するよう選択信号を出力する。送信データセレクタ212は、ステップST23でスレーブ装置主要処理部220の計算したアドレスのパリティチェック結果を取得して、ビット7としてSDO端子からマスタ装置100へ送信する(ステップST14)。
The serial communication unit 210 receives the WD parity of bit 7 from the master device 100 and stores it in the reception shift register 211 (step ST5).
On the other hand, the state transition control unit 213 outputs a selection signal to the transmission data selector 212 so as to acquire the parity check result of the address from the slave device main processing unit 220. The transmission data selector 212 acquires the parity check result of the address calculated by the slave device main processing unit 220 in step ST23, and transmits the result as bit 7 from the SDO terminal to the master device 100 (step ST14).

一方、マスタ装置100では、シフトレジスタ111からSDO端子へ、アドレス等のデータを送信すると共に、SDI端子から上位7ビットのダミーデータと、アドレスのパリティチェック結果とを受信して、シフトレジスタ111へ格納していく(ASフェーズ)。格納された8ビットデータはマスタ装置主要処理部120へ出力される。
続いてマスタ装置主要処理部120からシフトレジスタ111へ8ビットのライトデータが出力され、シフトレジスタ111がSDO端子から出力する(WDフェーズ)。
On the other hand, the master device 100 transmits data such as an address from the shift register 111 to the SDO terminal, and also receives upper 7-bit dummy data and an address parity check result from the SDI terminal, and sends them to the shift register 111. Store (AS phase). The stored 8-bit data is output to master device main processing unit 120.
Subsequently, 8-bit write data is output from the master device main processing unit 120 to the shift register 111, and the shift register 111 outputs from the SDO terminal (WD phase).

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 slave device 200, the state transition control unit 213 determines whether to read or write according to the R / W control information stored in the reception shift register 211, and outputs the determination result to the master device main processing unit 120 ( Step ST6). This time for writing (step ST6 “Write”), write data is received from the SDI terminal, stored in the reception shift register 211, and 8-bit write data is output to the slave device main processing unit 220. The slave device main processing unit 220 writes the write data to the address specified in the AS phase (step ST7).
Also, the slave device main processing unit 220 acquires the write data of 7 bits already stored in the reception shift register 211 and 1 bit received by this clock for a total of 8 bits in step ST5 of the AS phase. A parity check is performed using the stored WD parity (step ST24).

なお、シリアル通信部210は、ステップST23のパリティチェック結果がエラーであって正しいアドレス要求を受信できなかったと判断した場合、および、ステップST24のパリティチェック結果がエラーであって正しいライトデータを受信できなかったと判断した場合のいずれか一方、または両方において、スレーブ装置主要処理部220への書き込み要求を中止して、レジスタのデータを保護する構成にしてもよい。   The serial communication unit 210 can receive correct write data when it is determined that the parity check result at step ST23 is an error and the correct address request cannot be received, and when the parity check result at step ST24 is an error. In either one or both of the cases where it is determined that there is no data, the write request to the slave device main processing unit 220 may be stopped to protect the register data.

また、状態遷移制御部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 transition control unit 213 determines that the transition from the AS phase to the WD phase has been made (step ST15 “Write”), and outputs a selection signal to the transmission data selector 212. The transmission data selector 212 then transfers to the reception shift register 211. The upper 7 bits of the previously received data stored are selected and transmitted as dummy data from the SDO terminal to the master device 100 (step ST16). Further, the state transition control unit 213 outputs a selection signal to the transmission data selector 212 so as to acquire the parity check result of the write data from the slave device main processing unit 220. The transmission data selector 212 acquires the parity check result of the write data calculated by the slave device main processing unit 220 in step ST24, and transmits it as bit 7 from the SDO terminal to the master device 100 (step ST17).

一方、マスタ装置100では、シフトレジスタ111からSDO端子へ、ライトデータを送信すると共に、SDI端子から上位7ビットのダミーデータと、ライトデータのパリティチェック結果とを受信して、シフトレジスタ111へ格納していく(WDフェーズ)。なお、マスタ装置100はパリティチェック結果に応じて、ライト動作を繰り返すなど所定の対応を行う。   On the other hand, the master device 100 transmits write data from the shift register 111 to the SDO terminal, and also receives the upper 7-bit dummy data and the parity check result of the write data from the SDI terminal and stores them in the shift register 111. (WD phase). The master device 100 performs a predetermined response such as repeating the write operation according to the parity check result.

次に、リード動作を説明する。
リード動作時の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 master device 100, the master device main processing unit 120 calculates the AS parity from the read data address and the R / W control information in the same manner as in the AS phase of the write operation. To 111.
The shift register 111 stores the address and R / W control information output from the master device main processing unit 120 and the parity for AS in bits 1 to 6. Bit 0 is a start bit and bit 7 is not required.
The serial communication unit 110 outputs the AS phase frame stored in the shift register 111 in synchronization with the clock signal.

スレーブ装置200のシリアル通信部210は、上記同様にステップST1〜ST5,ST11,ST12,ST23を行う。ここではライト動作時とは処理の異なるステップを中心に説明する。
リード動作時のASフェーズでは、ステップST2においてビット1〜4のアドレスを受信すると、続くR/W制御情報およびAS用パリティを受信する間に、状態遷移制御部213の通知を受けてスレーブ装置主要処理部220がこのアドレスのリードデータ取得し(ステップST21)、パリティを計算する(ステップST22)。
The serial communication unit 210 of the slave device 200 performs steps ST1 to ST5, ST11, ST12, and ST23 as described above. Here, the description will focus on steps that are different from those in the write operation.
In the AS phase during the read operation, when the address of bits 1 to 4 is received in step ST2, the slave device receives the notification from the state transition control unit 213 while receiving the following R / W control information and AS parity. The processing unit 220 acquires the read data at this address (step ST21) and calculates the parity (step ST22).

続くステップ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 transition control unit 213 outputs a selection signal to the transmission data selector 212 so as to obtain the RD parity from the slave device main processing unit 220 in the case of reading. . Then, the transmission data selector 212 acquires the RD parity calculated by the slave device main processing unit 220 in step ST22 and transmits it as the bit 6 from the SDO terminal to the master device 100.

一方、マスタ装置100では、シフトレジスタ111からSDO端子へ、アドレス等のデータを送信すると共に、SDI端子からシフトレジスタ111へ上位6ビットのダミーデータと、RD用パリティと、アドレスのパリティチェック結果とを受信して格納していく。格納された8ビットデータはマスタ装置主要処理部120へ出力される。
続いてシフトレジスタ111は、クロック信号に同期してSDO端子からダミーデータを出力する(RDフェーズ)。
On the other hand, in the master device 100, data such as an address is transmitted from the shift register 111 to the SDO terminal, and upper 6-bit dummy data, RD parity, and address parity check result are transmitted from the SDI terminal to the shift register 111. Are received and stored. The stored 8-bit data is output to master device main processing unit 120.
Subsequently, the shift register 111 outputs dummy data from the SDO terminal in synchronization with the clock signal (RD phase).

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 slave device 200, the state transition control unit 213 determines whether to read or write according to the R / W control information stored in the reception shift register 211 (step ST6). This time for reading (step ST6 “Read”), dummy data is received from the SDI terminal and stored in the reception shift register 211 (step ST8).
Further, the state transition control unit 213 determines that the transition from the AS phase to the RD phase has been made (step ST15 “Read”), and outputs a selection signal to the transmission data selector 212. The transmission data selector 212 performs the slave device main processing unit. Read data output from 220 is transmitted from the SDO terminal to master device 100 (step ST18).

一方、マスタ装置100のマスタ装置主要処理部120は、先のASフェーズで事前入手していたRD用パリティを用いて、今回のRDフェーズでSDI端子から入力されシフトレジスタ111に格納された8ビットのリードデータをパリティチェックする(RDフェーズ)。なお、マスタ装置100はパリティチェック結果に応じて、リード動作を繰り返すなど所定の対応を行う。   On the other hand, the master device main processing unit 120 of the master device 100 uses the RD parity acquired in advance in the previous AS phase, and is input from the SDI terminal in the current RD phase and stored in the shift register 111. Parity check is performed on the read data (RD phase). The master device 100 performs a predetermined response such as repeating a read operation according to the parity check result.

以上より、実施の形態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 master device 100 to the slave device 200 in the AS phase. When the address is received, the slave device 200 reads the read data, obtains the parity for RD, returns it to the master device 100 in the same frame, and in the subsequent RD phase, from the slave device 200 to the master device 100. A frame including read data read in the AS phase is transmitted to the frame. For this reason, the communication including the parity for RD (information for error detection) is completed in the communication time of 2 frames of the AS phase and the RD phase by transmitting the parity for RD before the RD phase. it can. Therefore, the parity check can be started immediately on the master side without separately communicating a frame with only parity. In addition, communication reliability can be improved. Therefore, it is possible to shorten the communication latency for one frame (up to about 30% reduction) and increase the communication band by reducing the conventional 3 frames to 2 frames, and further, it is required for applications where real-time processing is important. Response time can be shortened.
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 master device 100 to the slave device 200, the frame in which the address is packed ahead of the parity is transmitted. When the device 200 receives the address, the slave device main processing unit 220 can read the read data in advance and obtain and return the parity for RD.

また、実施の形態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 master device 100 to the slave device 200, and the parity for WD The frame including the write data is transmitted from the master device 100 to the slave device 200 in the subsequent WD phase. For this reason, in the write operation, the WD parity (information for error detection) is sent from the master side in the AS phase before the WD phase, the write data is sent in the subsequent WD phase, and the parity check result in the same frame Thus, the communication including the parity check result of the parity for WD can be completed in the communication time of two frames of the AS phase and the WD phase. Therefore, communication reliability can be improved. In addition, it is possible to reduce the communication latency for one frame and increase the communication band by reducing the number of frames from the conventional 3 frames to 2 frames, and further, it is possible to reduce the response time required for applications where real-time processing is important. .

なお、リード動作時およびライト動作時とも、通信単位であるフレームのビット数は、マスタ装置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 master device 100 and the slave device 200 or less than the number of data bits in both the read operation and the write operation.
Here, the number of data bits of the master device 100 and the slave device 200 represents the width of data that can be processed at one time in each device in terms of the number of bits. For example, only 8 bits can be calculated at a time. Those having 8 bits of data bits and those capable of performing operations of 32 bits have 32 data bits.
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 transmission data selector 212 and the state transition control unit 213 can be omitted. In this case, the reception shift register 211 is used in the same manner as the shift register 111, and the received data is serial / parallel converted and output to the slave device main processing unit 220, and the data output from the slave device main processing unit 220 is also output. May be parallel / serial converted and transmitted to the master device 100.

なお、ライト動作時は、全二重シリアル通信に限定されるものではなく、半二重または単向のシリアル通信であってもよい。
また、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 master device 100 during the write operation first receives write data for writing to the slave device 200 from the master device main processing unit 120 in the WD phase and transmits it from the shift register 111 to the slave device 200, and in the subsequent AS phase. The frame including the address of the write data and the WD parity obtained by the master device main processing unit 120 is transmitted from the shift register 111 to the slave device 200. The other slave device 200 first receives a frame including write data to be written to the slave device main processing unit 220 from the master device 100 in the WD phase. In the subsequent AS phase, the address and WD of the write data from the master device 100 are received. The slave device main processing unit 220 received the WD parity received in the AS phase using the WD parity received in the WD phase and included the parity check result. The frame is configured to be transmitted to the master device 100. Even in this case, highly reliable communication including WD parity can be completed in a communication time of 2 frames.
It is assumed that the number of bits of a frame that is a communication unit matches the number of data bits of master device 100 and slave device 200 or is smaller than the number of data bits.

また、実施の形態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 master device 100 to the slave device 200, the master device 100 generates a frame including the address, the R / W control information, and the AS parity. In particular, the address is arranged so as to be packed on the first bit side of the shift register 111. Therefore, in this AS phrase, the slave device 200 can perform the parity check of the address using the AS parity, and return the check result. Therefore, in the communication time of 2 frames, communication including not only the parity of the read data or the write data but also the parity of the address can be completed. Thereby, in addition to shortening the communication time, the communication reliability can be further improved.

また、実施の形態1によれば、スレーブ装置200は、AS用パリティを用いたアドレスとR/W制御情報のエラー検出処理においてエラーが検出された場合、およびWD用パリティを用いたライトデータのエラー検出処理においてエラーが検出された場合のいずれか一方、または両方において、このライトデータの書き込みを中止するように構成した。このため、スレーブ装置200側で誤って受信したライトデータ値の書き込みを防止することにより、誤った設定・制御の発生による、誤動作の発生を防ぐことができる。   Also, according to the first embodiment, the slave device 200 detects an error in the error detection process of the address and R / W control information using the AS parity, and writes the write data using the WD parity. The writing of the write data is stopped in one or both of cases where an error is detected in the error detection process. For this reason, by preventing writing of the write data value received in error on the slave device 200 side, it is possible to prevent the occurrence of malfunction due to erroneous setting / control.

なお、本発明の実施形態を図面を参照して詳述してきたが、具体的な構成は、上述した実施の形態の構成に限られるものではなく、本発明の要旨を逸脱しない範囲の設計の変更などがあっても本発明に含まれることは言うまでもない。
例えば、上記実施の形態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 master device 100 and one slave device 200 are used, but a plurality of slave devices 200 may be used.
For example, although a general-purpose microcomputer is used as the master device 100, the invention is not limited to this, and the slave device 200 may be used as the master device 100. In the case of this configuration, a plurality of slave devices 200 each including the clock generation unit 130 may be prepared, and one of the clock generation units 130 may be activated to transmit a clock signal to another slave device 200.
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 SYMBOLS 100 Master apparatus 110,210 Serial communication part 111 Shift register 120 Master apparatus main process part 130 Clock generation part 200 Slave apparatus 211 Reception shift register 212 Transmission data selector 213 State transition control part 220 Slave apparatus main process part

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フェーズにて、マスタ側からスレーブ側へエラー検出または訂正のための情報より先出側にアドレス情報を詰めたフレームを送信することを特徴とする請求項1または請求項2記載のシリアル通信方法。   3. The serial communication according to claim 1, wherein in the first phase, a frame in which address information is packed is transmitted from the master side to the slave side from the information for error detection or correction. Method. 第1フェーズにて、マスタ側からスレーブ側へアドレス情報と、リード動作かライト動作かを指示する制御情報と、当該アドレス情報および当該制御情報のエラー検出または訂正のための情報とを含めたフレームを送信することを特徴とする請求項1から請求項3のうちのいずれか1項記載のシリアル通信方法。   In the first phase, a frame including address information from the master side to the slave side, control information instructing whether to perform a read operation or a write operation, and the address information and information for error detection or correction of the control information The serial communication method according to claim 1, wherein the serial communication method is transmitted. スレーブ側では、第1フェーズにてマスタ側からアドレス情報と、リード動作かライト動作かを指示する制御情報と、当該アドレス情報および当該制御情報のエラー検出または訂正のための情報とを含めたフレームを受信し、当該アドレス情報および制御情報について当該エラー検出または訂正のための情報を用いてエラー検出または訂正処理を行い、処理結果を同一フレーム中に前記マスタ側へ返送することを特徴とする請求項4記載のシリアル通信方法。   On the slave side, a frame including address information from the master side in the first phase, control information for instructing a read operation or a write operation, the address information and information for error detection or correction of the control information And performing error detection or correction processing on the address information and control information using information for error detection or correction, and returning the processing result to the master side in the same frame. Item 5. The serial communication method according to Item 4. スレーブ側では、ライトデータのアドレス情報と制御情報に対するエラー検出または訂正処理においてエラーが検出された場合、当該ライトデータの書き込みを中止可能とすることを特徴とする請求項5記載のシリアル通信方法。   6. The serial communication method according to claim 5, wherein when an error is detected in error detection or correction processing for address information and control information of write data, writing of the write data can be stopped on the slave side. スレーブ側では、第2フェーズにてライトデータに対するエラー検出または訂正処理を行って処理結果を同一フレーム中に前記マスタ側へ返送すると共に、当該エラー検出または訂正処理においてエラーが検出された場合、当該ライトデータの書き込みを中止可能とすることを特徴とする請求項2記載のシリアル通信方法。   On the slave side, error detection or correction processing is performed on the write data in the second phase, the processing result is returned to the master side in the same frame, and if an error is detected in the error detection or correction processing, 3. The serial communication method according to claim 2, wherein writing of write data can be stopped. マスタ側からスレーブ側へ、第1フェーズにてライトデータを含めたフレームを送信し、第2フェーズにて当該ライトデータのアドレス情報とエラー検出または訂正のための情報とを含めたフレームを送信することを特徴とする請求項2記載のシリアル通信方法。   A frame including write data in the first phase is transmitted from the master side to the slave side, and a frame including address information of the write data and information for error detection or correction is transmitted in the second phase. The serial communication method according to claim 2, wherein: データ信号を送受信するシリアルデータラインにより接続され、全二重通信を行う通信装置において、
通信単位であるフレームのビット数が、マスタ側およびスレーブ側の各通信装置のデータビット数と一致する場合、または当該データビット数より少ない場合に、
マスタ側の通信装置は、
第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.
請求項9または請求項10記載の通信装置をマスタ側として用い、請求項11または請求項12記載の通信装置をスレーブ側として用い、両通信装置間でシリアル通信を行うシリアル通信システム。   A serial communication system that uses the communication device according to claim 9 or 10 as a master side and uses the communication device according to claim 11 or claim 12 as a slave side to perform serial communication between both communication devices.
JP2011278587A 2011-12-20 2011-12-20 Serial communication method, communication apparatus, and serial communication system Active JP5804930B2 (en)

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)

* Cited by examiner, † Cited by third party
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

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