JP2011010178A - Communication apparatus - Google Patents

Communication apparatus Download PDF

Info

Publication number
JP2011010178A
JP2011010178A JP2009153557A JP2009153557A JP2011010178A JP 2011010178 A JP2011010178 A JP 2011010178A JP 2009153557 A JP2009153557 A JP 2009153557A JP 2009153557 A JP2009153557 A JP 2009153557A JP 2011010178 A JP2011010178 A JP 2011010178A
Authority
JP
Japan
Prior art keywords
data
signal
register
input delay
sio
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.)
Withdrawn
Application number
JP2009153557A
Other languages
Japanese (ja)
Inventor
Yasuhiro Ami
康裕 網
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.)
Renesas Electronics Corp
Original Assignee
Renesas Electronics Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Renesas Electronics Corp filed Critical Renesas Electronics Corp
Priority to JP2009153557A priority Critical patent/JP2011010178A/en
Publication of JP2011010178A publication Critical patent/JP2011010178A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a communication apparatus which performs data communication without reducing a data transfer rate by measuring input delay of serial data.SOLUTION: An initiator includes: an SIO control section 20 for outputting to a target 2 an ADJUST signal indicating an input delay detection mode of serial data; an input delay detection circuit 53 for detecting an input delay value of serial data output from the target 2; and a delay adjustment circuit 57 for adjusting a latch timing of serial data output from the target 2 on the basis of an input delay value detected by the input delay detection circuit 53. Furthermore, the target 2 includes a data output circuit 202 for outputting serial data for input delay value detection when the signal indicating the input delay detection mode of serial data is received from the SIO control section 20. Therefore, data communication can be performed without reducing a data transfer rate.

Description

本発明は、シリアルでデータ通信を行なう技術に関し、特に、受信時におけるシリアルデータの入力遅延を計測して、データ転送レートを下げずにデータ通信を行なうことが可能な通信装置に関する。   The present invention relates to a technique for serial data communication, and more particularly to a communication apparatus capable of measuring data input delay at the time of reception and performing data communication without reducing a data transfer rate.

近年、パーソナルコンピュータなどの情報処理装置の高機能化、多機能化が進んでおり、様々な機能ブロックが搭載されるようになってきている。そのような機能ブロックの1つとして、クロック同期式シリアルI/O(Input/Output)を挙げることができる。下記の非特許文献1は、クロック同期式シリアルI/Oの1つであるシリアルGPIO(SGPIO)について規定している。   In recent years, information processing apparatuses such as personal computers have become highly functional and multifunctional, and various functional blocks have been installed. As one of such functional blocks, a clock synchronous serial I / O (Input / Output) can be cited. The following non-patent document 1 defines serial GPIO (SGPIO) which is one of clock synchronous serial I / O.

このようなクロック同期式シリアルI/Oにおいては、接続されるデバイスや、コネクタ、ケーブルなどの形態によって、受信時にシリアルデータ入力遅延(レイテンシ)が発生する。そのため、入力遅延が大きくなると、シリアルデータ転送速度を遅くして接続しなければならなくなる。これに関連する技術として、下記の特許文献1〜3に開示された発明がある。   In such a clock synchronous serial I / O, a serial data input delay (latency) occurs at the time of reception depending on the form of the connected device, connector, cable, and the like. Therefore, if the input delay becomes large, the serial data transfer rate must be slowed down for connection. As technologies related to this, there are inventions disclosed in the following Patent Documents 1 to 3.

特許文献1は、受信データ遅延に対してデータ転送レートを落とすことなくデータ通信を実現した半導体集積回路装置およびシステムの提供を目的とする。クロック生成回路により基本クロック信号を分周して伝送クロック信号を生成して外部デバイスに向けて出力し、入力端子に上記出力端子を通して外部デバイスに伝えられた伝送クロック信号に対応して上記外部デバイスからの送信データが入力される。かかる入力端子における受信データを取り込む入力回路として、上記基本クロックのエッジと上記伝送クロックを計数するカウンタ回路のカウンタ出力との組合せにより特定されるタイミング信号を用いる。   Patent Document 1 aims to provide a semiconductor integrated circuit device and a system that realize data communication without reducing the data transfer rate with respect to reception data delay. The clock generation circuit divides the basic clock signal to generate a transmission clock signal and outputs it to the external device. The external device corresponds to the transmission clock signal transmitted to the external device through the output terminal to the input terminal. The transmission data from is input. A timing signal specified by a combination of an edge of the basic clock and a counter output of a counter circuit that counts the transmission clock is used as an input circuit that captures received data at the input terminal.

特許文献2は、動作環境の変動に係らず、高周波数の駆動クロック信号によって同期式DRAMからデータを読み出すことができる情報処理装置の提供を目的とする。入力されたクロックに同期させて、1クロック期間ごとにデータを出力する記憶部と、記憶部にクロックを入力し、データを受け取る制御部とを備える。制御部から出力され記憶部に入力される直前の駆動クロックを引き戻し、データを取り込むクロック信号として用いる。これにより、記憶部からのデータと、それを取り込むためのクロックのディレイとの差を小さく抑える。   Patent Document 2 aims to provide an information processing apparatus capable of reading data from a synchronous DRAM by a high-frequency drive clock signal regardless of changes in the operating environment. A storage unit that outputs data every one clock period in synchronization with the input clock, and a control unit that inputs the clock to the storage unit and receives data are provided. The drive clock just output from the control unit and input to the storage unit is pulled back and used as a clock signal for capturing data. As a result, the difference between the data from the storage unit and the delay of the clock for fetching it is kept small.

特許文献3は、テスト装置のピン間スキューによる制限を受けることなく、高い精度でタイミングずれを除去することができるタイミング調整回路の提供を目的とする。タイミング調整回路に、データ入力回路のレプリカ回路を設ける。レプリカ回路は、初段回路とラッチ回路とを含む。初段回路は、外部クロック信号を受け参照クロック信号を出力する。クロックドライバ64からの内部クロック信号に同期して、参照クロック信号をラッチし、外部出力端子へ位相進み遅れ信号として出力する。   Patent Document 3 aims to provide a timing adjustment circuit that can remove a timing shift with high accuracy without being restricted by a skew between pins of a test apparatus. A replica circuit of the data input circuit is provided in the timing adjustment circuit. The replica circuit includes a first stage circuit and a latch circuit. The first stage circuit receives an external clock signal and outputs a reference clock signal. In synchronization with the internal clock signal from the clock driver 64, the reference clock signal is latched and output to the external output terminal as a phase advance / delay signal.

特開2005−354353号公報JP 2005-354353 A 特開2001−290698号公報JP 2001-290698 A 特開2008−211809号公報JP 2008-2111809 A

SFF Committee SFF-8485 Specification for Serial GPIO (SGPIO) BusSFF Committee SFF-8485 Specification for Serial GPIO (SGPIO) Bus

上述のように、受信時のシリアルデータ入力遅延を考慮してデータ転送速度を調整しなければならない。この場合、従来では、受信データ入力遅延時間の計測および調整は、製品設計段階において入力遅延のシミュレーションを行なうか、または製品評価段階においてオシロスコープなどの計測機器を用いて計測を行ない、そのシミュレーション結果または計測結果に基づいてシリアルクロック(SCLK)の周波数を変更することにより行なわれていた。   As described above, the data transfer rate must be adjusted in consideration of the serial data input delay during reception. In this case, conventionally, the received data input delay time is measured and adjusted by simulating the input delay in the product design stage or by using a measurement device such as an oscilloscope in the product evaluation stage. This is done by changing the frequency of the serial clock (SCLK) based on the measurement result.

しかしながら、製造ばらつきや、InitiatorとTargetとの間の接続形態の変化などにより、製品出荷後に実際の入力遅延時間が想定した値よりも大きくなった場合には対応ができない。そのため、通信エラーが発生して製品として正常に動作しなくなったり、最悪の場合には市場クレームに発展したりするといった問題があった。   However, if the actual input delay time becomes larger than the expected value after product shipment due to manufacturing variations or a change in the connection form between the initiator and the target, it cannot be dealt with. For this reason, there has been a problem that a communication error occurs and the product does not operate normally, or in the worst case, it develops into a market complaint.

また、シリアルデータを正常にラッチするためには、SCLK周期におけるサイクル時間を遅延時間よりも大きくする必要があり、SCLKの周波数を下げざるを得なくなる。これによって、データ転送レートが低下するといった問題もあった。   Further, in order to latch serial data normally, the cycle time in the SCLK cycle needs to be longer than the delay time, and the frequency of SCLK must be lowered. As a result, there is a problem that the data transfer rate is lowered.

また、現在、クロック同期シリアル通信は様々な製品に搭載されており、製品によってはLED(Light Emitted Device)表示や、液晶ディスプレイ表示用基板のインタフェースにクロック同期シリアル通信が採用されていることもある。そのため、製品毎に接続する基板が変更されたり、オプション基板として追加されたりすることが想定される。   At present, clock synchronous serial communication is mounted on various products, and depending on the product, clock synchronous serial communication may be adopted for the interface of LED (Light Emitted Device) display and liquid crystal display display board. . Therefore, it is assumed that the board to be connected for each product is changed or added as an optional board.

この場合、製品のメイン基板にInitiatorがあり、メイン基板に接続される基板にTargetがあるといった形態になる。このような製品形態においては、エンドユーザがオプション基板を購入して接続することになるため、遅延時間の再調整が必要になる可能性があるといった問題があった。   In this case, an initiator is provided on the main board of the product, and a target is provided on the board connected to the main board. In such a product form, since the end user purchases and connects the option board, there is a problem that the delay time may need to be readjusted.

さらには、メイン基板に接続される基板の故障についても、インタフェース信号の断線などによるTargetの通信異常しか検出することができず、上述のようなシリアルデータ入力遅延の増大によるデータ転送信号の品質悪化を検出することができない。   Furthermore, even for a failure of the board connected to the main board, only the communication abnormality of the target due to the disconnection of the interface signal or the like can be detected, and the quality of the data transfer signal deteriorates due to the increase in the serial data input delay as described above. Cannot be detected.

本発明は、上記問題点を解決するためになされたものであり、その目的は、シリアルデータの入力遅延を計測して、データ転送レートを下げずにデータ通信を行なうことが可能な通信装置を提供することである。   The present invention has been made in order to solve the above-described problems, and an object of the present invention is to provide a communication apparatus capable of measuring serial data input delay and performing data communication without lowering the data transfer rate. Is to provide.

本発明の一実施例によれば、クロックに同期してシリアルデータを送受信するイニシエータとターゲットとを含んだ通信装置が提供される。イニシエータは、ターゲットに対してシリアルデータの入力遅延検出モードであることを示すADJUST信号を出力するSIO制御部と、ターゲットから出力されるシリアルデータの入力遅延値を検出する入力遅延検出回路と、入力遅延検出回路によって検出された入力遅延値に基づいて、ターゲットから出力されるシリアルデータのラッチタイミングを調整する遅延調整回路とを含む。また、ターゲットは、SIO制御部からシリアルデータの入力遅延検出モードであることを示す信号を受けたときに、入力遅延値検出用のシリアルデータを出力するデータ出力回路を含む。   According to an embodiment of the present invention, a communication apparatus including an initiator and a target that transmit and receive serial data in synchronization with a clock is provided. The initiator outputs an ADJUST signal indicating that it is in a serial data input delay detection mode to the target, an input delay detection circuit that detects an input delay value of serial data output from the target, and an input A delay adjustment circuit for adjusting the latch timing of serial data output from the target based on the input delay value detected by the delay detection circuit. The target also includes a data output circuit that outputs serial data for detecting an input delay value when receiving a signal indicating that it is in the serial data input delay detection mode from the SIO control unit.

この実施例によれば、入力遅延検出回路がターゲットから出力されるシリアルデータの入力遅延値を検出し、遅延調整回路がターゲットから出力されるシリアルデータのラッチタイミングを調整するので、データ転送レートを下げずにデータ通信を行なうことが可能となる。   According to this embodiment, the input delay detection circuit detects the input delay value of the serial data output from the target, and the delay adjustment circuit adjusts the latch timing of the serial data output from the target. Data communication can be performed without lowering.

一般的な情報処理装置におけるクロック同期シリアルI/Oの接続例を説明するための図である。FIG. 11 is a diagram for explaining an example of connection of clock synchronous serial I / O in a general information processing apparatus. Initiator300の内部構成を示すブロック図である。2 is a block diagram showing an internal configuration of an initiator 300. FIG. 図2に示すInitiator300の動作を説明するためのタイミングチャートである。3 is a timing chart for explaining the operation of the initiator 300 shown in FIG. 2. SIOブロック310内のデータ受信制御部350およびTarget400の構成をさらに詳細に説明するためのブロック図である。4 is a block diagram for explaining the configuration of a data reception control unit 350 and a Target 400 in the SIO block 310 in more detail. FIG. 図4に示すInitiator300のSIOブロック310およびTarget400において発生するシリアルデータの遅延時間を説明するためのタイミングチャートである。5 is a timing chart for explaining a delay time of serial data generated in the SIO block 310 and the Target 400 of the initiator 300 shown in FIG. 本発明の第1の実施の形態におけるクロック同期シリアルI/Oの接続例を説明するための図である。It is a figure for demonstrating the example of a connection of the clock synchronous serial I / O in the 1st Embodiment of this invention. 本発明の第1の実施の形態におけるInitiator1の内部構成を示すブロック図である。It is a block diagram which shows the internal structure of Initiator1 in the 1st Embodiment of this invention. 本発明の第1の実施の形態におけるInitiator1の動作を説明するためのタイミングチャートである。It is a timing chart for demonstrating operation | movement of Initiator1 in the 1st Embodiment of this invention. 本発明の第1の実施の形態におけるSIOブロック10内のデータ受信制御部50およびTarget2の構成をさらに詳細に説明するためのブロック図である。It is a block diagram for demonstrating in more detail the structure of the data reception control part 50 and Target2 in the SIO block 10 in the 1st Embodiment of this invention. 図9に示す入力遅延検出回路53の内部構成を示すブロック図である。FIG. 10 is a block diagram showing an internal configuration of an input delay detection circuit 53 shown in FIG. 9. 図10に示す入力遅延検出回路53の入力遅延検出動作を説明するためのタイミングチャートである。11 is a timing chart for explaining an input delay detection operation of the input delay detection circuit 53 shown in FIG. 10. 図10に示す計測制御シーケンサ65の処理手順を説明するためのフローチャートである。It is a flowchart for demonstrating the process sequence of the measurement control sequencer 65 shown in FIG. 図9に示すデータラッチトリガ回路52をさらに詳細に説明するためのブロック図である。FIG. 10 is a block diagram for explaining the data latch trigger circuit 52 shown in FIG. 9 in more detail. 図13に示すデータラッチトリガ回路52の動作を説明するためのタイミングチャートである。14 is a timing chart for explaining the operation of the data latch trigger circuit 52 shown in FIG. 13. 図13に示すデータラッチトリガ回路52の処理手順を説明するためのフローチャートである。14 is a flowchart for explaining a processing procedure of the data latch trigger circuit 52 shown in FIG. 13. 本発明の第2の実施の形態におけるInitiatorのSIOブロックの詳細を説明するための図である。It is a figure for demonstrating the detail of the SIO block of Initiator in the 2nd Embodiment of this invention. 本発明の第2の実施の形態における入力遅延検出回路91の内部構成を説明するためのブロック図である。It is a block diagram for demonstrating the internal structure of the input delay detection circuit 91 in the 2nd Embodiment of this invention. 図17に示す入力遅延検出回路91のドライブ切替え検出動作を説明するためのタイミングチャートである。18 is a timing chart for explaining a drive switching detection operation of the input delay detection circuit 91 shown in FIG. 図17に示す計測制御シーケンサ114の処理手順を説明するためのフローチャートである。It is a flowchart for demonstrating the process sequence of the measurement control sequencer 114 shown in FIG. 本発明の第3の実施の形態におけるInitiatorのSIOブロックの詳細を説明するための図である。It is a figure for demonstrating the detail of the SIO block of Initiator in the 3rd Embodiment of this invention. 本発明の第3の実施の形態における入力遅延検出回路131の内部構成を説明するためのブロック図である。It is a block diagram for demonstrating the internal structure of the input delay detection circuit 131 in the 3rd Embodiment of this invention. 図21に示す入力遅延検出回路131のシリアル通信エラー検出動作を説明するためのタイミングチャートである。22 is a timing chart for explaining the serial communication error detection operation of the input delay detection circuit 131 shown in FIG. 図21に示す計測制御シーケンサ151の処理手順を説明するためのフローチャートである。It is a flowchart for demonstrating the process sequence of the measurement control sequencer 151 shown in FIG.

図1は、一般的な情報処理装置におけるクロック同期シリアルI/Oの接続例を説明するための図である。図1は、Initiator300と、Target400とが1:1で接続されている場合を示している。Initiator300から出力されるSLOAD信号、SCLK信号およびSDATA_OUT信号が、コネクタやケーブルを介してTarget400に入力される。同様に、Target400から出力されるSDATA_IN信号が、コネクタやケーブルを介してInitiator300に入力される。   FIG. 1 is a diagram for explaining a connection example of a clock synchronous serial I / O in a general information processing apparatus. FIG. 1 shows a case where the initiator 300 and the target 400 are connected at a ratio of 1: 1. The SLOAD signal, the SCLK signal, and the SDATA_OUT signal output from the initiator 300 are input to the Target 400 via a connector or a cable. Similarly, an SDATA_IN signal output from the Target 400 is input to the initiator 300 via a connector or a cable.

図2は、Initiator300の内部構成を示すブロック図である。このInitiator300は、SIOブロック310と、CPU360とがCPUバス370を介して接続される。   FIG. 2 is a block diagram showing the internal configuration of the initiator 300. In the initiator 300, the SIO block 310 and the CPU 360 are connected via a CPU bus 370.

SIOブロック310は、SIOデータ転送を制御するSIO制御部320と、シリアルクロックの周波数を切り替えるシリアルクロック制御部330と、データ送信を制御するデータ送信制御部340と、データ受信を制御するデータ受信制御部350とを含む。   The SIO block 310 includes an SIO control unit 320 that controls SIO data transfer, a serial clock control unit 330 that switches the frequency of the serial clock, a data transmission control unit 340 that controls data transmission, and data reception control that controls data reception. Part 350.

また、SIO制御部320は、SIO制御レジスタ324、送信データレジスタ325、受信データレジスタ326などで構成されるレジスタ群322と、レジスタ群322をCPUバス370に接続するCPUバスI/F(Interface)323と、SIO制御レジスタ324に設定された内容に基づいてデータ送受信の開始を指示し、データ送受信の終了を検知するSIO送受信制御部321とを含む。   The SIO control unit 320 includes a register group 322 including an SIO control register 324, a transmission data register 325, a reception data register 326, and the like, and a CPU bus I / F (Interface) that connects the register group 322 to the CPU bus 370. 323 and an SIO transmission / reception control unit 321 that instructs the start of data transmission / reception based on the contents set in the SIO control register 324 and detects the end of data transmission / reception.

SIO制御レジスタ324は、SIOデータ転送ビット長を指定するdata_lenビットと、シリアルクロック周波数を設定するsclk_selビットと、データ転送の開始を指示するsio_en_regビットとを含む。なお、図示していないが、レジスタ群322には、データ転送が終了したことを示すレジスタも含まれる。   The SIO control register 324 includes a data_len bit for specifying the SIO data transfer bit length, a sclk_sel bit for setting the serial clock frequency, and a sio_en_reg bit for instructing the start of data transfer. Although not shown, the register group 322 includes a register indicating that the data transfer is completed.

CPU360によってSIO制御レジスタ324のsclk_selビットにシリアルクロック周波数が設定されると、SIO送受信制御部321は、シリアルクロック制御部330に対してsclk_sel信号を出力する。   When the serial clock frequency is set in the sclk_sel bit of the SIO control register 324 by the CPU 360, the SIO transmission / reception control unit 321 outputs a sclk_sel signal to the serial clock control unit 330.

シリアルクロック制御部330は、SIO送受信制御部321からsclk_sel信号を受けると、システムクロックsysclkを分周して設定された周波数のシリアルクロックを生成し、sio_start信号がアサートされたときにSCLK信号としてTarget400に出力する。sio_start信号がネゲートされると、シリアルクロック制御部330は、SCLK信号に“H”レベルを出力する。また、シリアルクロック制御部330は、内部シリアルクロック信号としてデータ送信制御部340にtx_clk信号を出力し、データ受信制御部350にrx_clk信号を出力する。   When receiving the sclk_sel signal from the SIO transmission / reception control unit 321, the serial clock control unit 330 divides the system clock sysclk to generate a serial clock having a set frequency, and when the sio_start signal is asserted, the Target 400 is the SCLK signal. Output to. When the sio_start signal is negated, the serial clock control unit 330 outputs an “H” level to the SCLK signal. Further, the serial clock control unit 330 outputs a tx_clk signal to the data transmission control unit 340 as an internal serial clock signal, and outputs an rx_clk signal to the data reception control unit 350.

CPU360が送信データレジスタ325に送信データを設定すると、SIO送受信制御部321は、tx_data信号によってその送信データをデータ送信制御部340に出力する。そして、CPU360が、データ転送開始を示すsio_en_regに“1”を設定すると、SIO送受信制御部321は、データ送信制御部340に対してデータ送信開始を示すtx_start信号を出力する。   When the CPU 360 sets transmission data in the transmission data register 325, the SIO transmission / reception control unit 321 outputs the transmission data to the data transmission control unit 340 by a tx_data signal. When the CPU 360 sets “1” to sio_en_reg indicating the start of data transfer, the SIO transmission / reception control unit 321 outputs a tx_start signal indicating the start of data transmission to the data transmission control unit 340.

データ送信制御部340は、CPU360がSIO制御レジスタ324に設定したデータ転送ビット長(data_len)および送信データ(tx_data)を保持している。そして、SIO送受信制御部321から出力されるtx_start信号が“H”レベルになるのを検出すると、tx_clk信号の立ち下がりエッジに同期して送信データ(tx_data)をLSBビットから順にSDATA_OUT信号としてTarget400に出力する。   The data transmission control unit 340 holds the data transfer bit length (data_len) and transmission data (tx_data) set in the SIO control register 324 by the CPU 360. When detecting that the tx_start signal output from the SIO transmission / reception control unit 321 becomes “H” level, the transmission data (tx_data) is sequentially transmitted from the LSB bit to the Target 400 as the SDATA_OUT signal in synchronization with the falling edge of the tx_clk signal. Output.

そして、データ送信制御部340は、データ転送ビット長分のデータの送信を終了すると、tx_end信号にsysclk信号の1クロック分の“H”レベルのパルスを出力して、SIO送受信制御部321にデータ送信の終了を通知する。   When the data transmission control unit 340 finishes transmitting the data for the data transfer bit length, the data transmission control unit 340 outputs an “H” level pulse for one clock of the sysclk signal to the tx_end signal, and transmits the data to the SIO transmission / reception control unit 321. Notify the end of transmission.

なお、CPU360は、SIO制御レジスタ324に値を設定することにより、LSBビットから順にデータを送信するか、MSBビットから順にデータを送信するかを切り替えることができる。   The CPU 360 can switch between transmitting data sequentially from the LSB bit and transmitting data sequentially from the MSB bit by setting a value in the SIO control register 324.

CPU360が、データ転送開始を示すsio_en_regに“1”を設定すると、SIO送受信制御部321は、データ受信制御部350に対してデータ受信開始を示すrx_start信号を出力する。   When the CPU 360 sets “1” to sio_en_reg indicating the start of data transfer, the SIO transmission / reception control unit 321 outputs an rx_start signal indicating the start of data reception to the data reception control unit 350.

データ受信制御部350は、CPU360がSIO制御レジスタ324に設定したデータ転送ビット長(data_len)を保持している。そして、SIO送受信制御部321から出力されるrx_start信号が“H”レベルになるのを検出すると、Target400から出力されるSDATA_IN信号をrx_clk信号の立ち上がりエッジに同期してラッチすることによりシリアルデータを受信する。このとき、データ受信制御部350は、LSBビットから順にシリアルデータを受信する。   The data reception control unit 350 holds the data transfer bit length (data_len) set in the SIO control register 324 by the CPU 360. When the rx_start signal output from the SIO transmission / reception control unit 321 is detected to be “H” level, serial data is received by latching the SDATA_IN signal output from the Target 400 in synchronization with the rising edge of the rx_clk signal. To do. At this time, the data reception control unit 350 receives serial data in order from the LSB bit.

そして、データ受信制御部350は、データ転送ビット長分のシリアルデータをラッチすると、rx_end信号にsysclk信号の1クロック分の“H”レベルのパルスを出力し、ラッチしたシリアルデータをパラレルデータに変換してrx_data信号に出力する。SIO送受信制御部321は、rx_data信号によって受信データを受けると、受信データレジスタ326に受信データを設定する。これによって、CPU360が受信データレジスタ326から受信データを読み出すことができる。   When the data reception control unit 350 latches the serial data corresponding to the data transfer bit length, it outputs an “H” level pulse for one clock of the sysclk signal to the rx_end signal, and converts the latched serial data into parallel data. And output to the rx_data signal. When the SIO transmission / reception control unit 321 receives the reception data by the rx_data signal, the SIO transmission / reception control unit 321 sets the reception data in the reception data register 326. As a result, the CPU 360 can read the received data from the received data register 326.

なお、CPU360は、SIO制御レジスタ324に値を設定することにより、LSBビットから順にデータを受信するか、MSBビットから順にデータを受信するかを切り替えることができる。   The CPU 360 can switch between receiving data sequentially from the LSB bit and receiving data sequentially from the MSB bit by setting a value in the SIO control register 324.

図3は、図2に示すInitiator300の動作を説明するためのタイミングチャートである。図3においては、シリアルクロックSCLKの周波数がsysclkを2分周した周波数であり、データ転送ビット長が8ビットの場合を示している。図3においては、Initiator300がTarget400との間で、SDATA_OUTを介してのデータの送信と、SDATA_INを介しての別のデータの受信とを並列に行なう例を示している。当然のこととして、データの送信と別データの受信とは夫々単独に行なうことも可能である。   FIG. 3 is a timing chart for explaining the operation of the initiator 300 shown in FIG. In FIG. 3, the frequency of the serial clock SCLK is a frequency obtained by dividing sysclk by 2, and the data transfer bit length is 8 bits. FIG. 3 shows an example in which the initiator 300 performs data transmission with the Target 400 via SDATA_OUT and reception of other data via SDATA_IN in parallel. As a matter of course, the transmission of data and the reception of other data can be performed independently.

まず、T1において、CPU360がSIO制御レジスタ324のsio_en_regビットに“1”を設定すると、データ転送が開始される。   First, at T1, when the CPU 360 sets “1” to the sio_en_reg bit of the SIO control register 324, data transfer is started.

SIO送受信制御部321は、sio_en_regビットに“1”が設定されたのを検出すると、T2において、データ送信制御部340に対してsysclkの1クロック分の“H”レベルのパルスをtx_start信号に出力し、データ受信制御部350に対してsysclkの1クロック分の“H”レベルのパルスをrx_start信号に出力する。そして、SIO送受信制御部321は、Target400に対してSCLKの1クロック分の“L”レベルのパルスをSLOAD信号に出力する。   When detecting that the sio_en_reg bit is set to “1”, the SIO transmission / reception control unit 321 outputs an “H” level pulse for one clock of sysclk to the data transmission control unit 340 at T2 as a tx_start signal. Then, an “H” level pulse for one clock of sysclk is output to the data reception control unit 350 as the rx_start signal. Then, the SIO transmission / reception control unit 321 outputs an “L” level pulse for one clock of SCLK to the target 400 as an SLOAD signal.

T3において、SLOAD信号の立ち上がりと同時に、SIO送受信制御部321は、sio_start信号を“H”レベルにアサートして、シリアルクロック制御部330に対してSCLK信号の出力を指示する。このとき、SIO送受信制御部321は、sclk_sel信号によってSCLKの周波数としてsysclkを2分周した周波数とするよう指示する。   At T3, simultaneously with the rise of the SLOAD signal, the SIO transmission / reception control unit 321 asserts the sio_start signal to the “H” level and instructs the serial clock control unit 330 to output the SCLK signal. At this time, the SIO transmission / reception control unit 321 instructs the sclk_sel signal to use a frequency obtained by dividing sysclk by two as the frequency of SCLK.

T4において、Target400に対するSCLK信号の出力が開始されると、データ送信制御部340は、tx_clk信号の立ち下がりに同期して、SCLKの立ち下がりのタイミングにSDATA_OUT信号によりシリアルデータをLSBから順に送信する。また、T5において、データ受信制御部350は、rx_clk信号の立ち上がりに同期して、SCLKの立ち上がりのタイミングにSDATA_IN信号によりシリアルデータをLSBから順に受信する。   When the output of the SCLK signal to the Target 400 is started at T4, the data transmission control unit 340 sequentially transmits serial data from the LSB by the SDATA_OUT signal at the falling timing of the SCLK in synchronization with the falling of the tx_clk signal. . Further, at T5, the data reception control unit 350 receives serial data from the LSB in order by the SDATA_IN signal at the rising edge of SCLK in synchronization with the rising edge of the rx_clk signal.

T6において、8ビットのデータ送信が終了すると、データ送信制御部340は、SIO送受信制御部321に対してデータ送信完了を示すtx_end信号を“H”レベルにアサートする。また、8ビットのデータ受信が終了すると、データ受信制御部350は、SIO送受信制御部321に対してデータ受信完了を示すrx_end信号を“H”レベルにアサートする。   When the 8-bit data transmission ends at T6, the data transmission control unit 340 asserts a tx_end signal indicating the completion of data transmission to the “H” level to the SIO transmission / reception control unit 321. When 8-bit data reception ends, the data reception control unit 350 asserts an rx_end signal indicating completion of data reception to the “H” level to the SIO transmission / reception control unit 321.

T7において、SIO送受信制御部321はtx_end信号とrx_end信号の両方が“H”レベルにアサートされたことに応じて、シリアルクロック制御部330に対してsio_start信号を“L”レベルにネゲートし、SCLKの出力を停止させる。T8において、シリアルクロック制御部330は、Target400に対してSLOAD信号に“L”レベルを出力し、8ビットのデータ受信が完了したことを通知する。   At T7, the SIO transmission / reception control unit 321 negates the sio_start signal to the “L” level with respect to the serial clock control unit 330 in response to the assertion of both the tx_end signal and the rx_end signal to the “H” level. The output of is stopped. At T8, the serial clock control unit 330 outputs “L” level to the SLOAD signal to the Target 400 to notify that the reception of 8-bit data is completed.

なお、SIO送受信制御部321がsio_start信号をネゲートするまでに、CPU360が次のデータ転送開始を指示していれば、T8において、tx_start信号およびrx_start信号がアサートされ、T9以降において、SCLKの出力と次の8ビットのデータ転送が連続して行なわれる。   If the CPU 360 has instructed the start of the next data transfer before the SIO transmission / reception control unit 321 negates the sio_start signal, the tx_start signal and the rx_start signal are asserted at T8, and after T9, The next 8-bit data transfer is continuously performed.

図4は、SIOブロック310内のデータ受信制御部350およびTarget400の構成をさらに詳細に説明するためのブロック図である。データ受信制御部350は、データ受信の開始および終了を制御する受信制御シーケンサ351と、受信データのデータラッチタイミングのトリガ(data_en)信号を生成するデータラッチトリガ回路353と、データラッチトリガ回路353から出力されるdata_en信号によって受信データをラッチするデータラッチ回路354と、データラッチ回路354によってラッチされたシリアルデータ(sdata_in)をパラレルデータに変換して受信データバッファに格納するシリアル・パラレル変換回路352とを含む。   FIG. 4 is a block diagram for explaining the configuration of the data reception control unit 350 and the Target 400 in the SIO block 310 in more detail. The data reception control unit 350 includes a reception control sequencer 351 that controls start and end of data reception, a data latch trigger circuit 353 that generates a data latch timing trigger (data_en) signal, and a data latch trigger circuit 353. A data latch circuit 354 that latches received data in accordance with an output data_en signal; a serial-parallel conversion circuit 352 that converts serial data (sdata_in) latched by the data latch circuit 354 into parallel data and stores the parallel data in a received data buffer; including.

また、受信制御シーケンサ351は、CPU360がSIO制御レジスタ324に設定した受信データビット長(data_len)を保持してカウントする受信データビットカウンタ355を有する。受信制御シーケンサ351は、SIO制御部320によってrx_start信号がアサートされると、データラッチトリガ回路353に対してrx_en信号をアサートし、受信データビットカウンタ355に受信データのビット数のカウントを開始させる。そして、受信データビットカウンタ355が受信データビット長だけ受信データをカウントしたときに、rx_en信号をネゲートする。   The reception control sequencer 351 has a reception data bit counter 355 that holds and counts the reception data bit length (data_len) set by the CPU 360 in the SIO control register 324. When the rx_start signal is asserted by the SIO control unit 320, the reception control sequencer 351 asserts the rx_en signal to the data latch trigger circuit 353, and causes the reception data bit counter 355 to start counting the number of bits of the reception data. When the reception data bit counter 355 counts reception data by the reception data bit length, the rx_en signal is negated.

なお、以下においては、受信データビットカウンタ355がデクリメントカウンタによって構成される場合について説明するが、受信データのビット数をカウントできるものであれば、どのような構成であってもよい。   In the following, a case where the reception data bit counter 355 is configured by a decrement counter will be described, but any configuration may be used as long as the number of bits of reception data can be counted.

データラッチトリガ回路353は、受信制御シーケンサ351からのrx_en信号がアサートされると、データラッチ回路354がSDATA_IN信号のシリアルデータをラッチするタイミングを示すsdata_en信号を生成する。   When the rx_en signal from the reception control sequencer 351 is asserted, the data latch trigger circuit 353 generates an sdata_en signal indicating the timing at which the data latch circuit 354 latches the serial data of the SDATA_IN signal.

データラッチ回路354は、データラッチトリガ回路353から出力されるdata_en信号に同期してSDATA_IN信号のシリアルデータをラッチし、sdata_in信号としてシリアル・パラレル変換回路352に出力する。   The data latch circuit 354 latches the serial data of the SDATA_IN signal in synchronization with the data_en signal output from the data latch trigger circuit 353, and outputs it to the serial / parallel conversion circuit 352 as the sdata_in signal.

シリアル・パラレル変換回路352は、データラッチ回路354から出力されるsdata_in信号およびデータラッチトリガ回路353から出力されるsdata_en信号を受け、sdata_en信号によってsdata_in信号に対して最大8ビットのビットシフトを行なってパラレルデータを生成し、そのパラレルデータを受信データバッファに格納する。   The serial / parallel conversion circuit 352 receives the sdata_in signal output from the data latch circuit 354 and the sdata_en signal output from the data latch trigger circuit 353, and performs a maximum bit shift of 8 bits on the sdata_in signal by the sdata_en signal. Parallel data is generated, and the parallel data is stored in the reception data buffer.

図4において、SCLK(out)信号は、Initiator300の端子から出力されるSCLK信号であり、基板またはケーブルに接続される。SCLK(in)信号は、Target400の端子から入力され、Target400内の各回路に供給されるSCLK信号である。SDATA_IN信号は、Target400の端子から出力され、基板またはケーブルに接続されたInitiator300の端子から入力されて、データ受信制御部350に供給される信号である。   In FIG. 4, an SCLK (out) signal is an SCLK signal output from a terminal of the initiator 300, and is connected to a substrate or a cable. The SCLK (in) signal is an SCLK signal that is input from a terminal of the Target 400 and is supplied to each circuit in the Target 400. The SDATA_IN signal is a signal that is output from the terminal of the Target 400, input from a terminal of the initiator 300 connected to the board or cable, and supplied to the data reception control unit 350.

Target400は、Initiator300に送信する送信データを生成し、SCLK(in)信号の立ち下がりエッジに同期してsdata_out信号として出力する送信データ回路410と、SCLK(in)信号の立ち上がりエッジに同期してシリアルデータをSDATA_INとして出力するデータ出力回路420とを含む。   The target 400 generates transmission data to be transmitted to the initiator 300, outputs it as a sdata_out signal in synchronization with the falling edge of the SCLK (in) signal, and serially synchronizes with the rising edge of the SCLK (in) signal. And a data output circuit 420 that outputs data as SDATA_IN.

図5は、図4に示すInitiator300のSIOブロック310およびTarget400において発生するシリアルデータの遅延時間を説明するためのタイミングチャートである。   FIG. 5 is a timing chart for explaining a delay time of serial data generated in the SIO block 310 and the Target 400 of the Initiator 300 shown in FIG.

T1において、SIO制御部320から出力されるrx_start信号がアサートされると、受信制御シーケンサ351は、データラッチトリガ回路353に対してrx_en信号をアサートする。このとき、受信データビットカウンタ355に、受信データビット長から1を差し引いた値“7”がロードされる。   When the rx_start signal output from the SIO control unit 320 is asserted at T1, the reception control sequencer 351 asserts the rx_en signal to the data latch trigger circuit 353. At this time, the reception data bit counter 355 is loaded with a value “7” obtained by subtracting 1 from the reception data bit length.

T2において、データラッチトリガ回路353は、rx_en信号が“H”レベルであり、rx_clk信号が“L”レベルであることを検出し、data_en信号に“H”レベルのパルスを出力する。このとき、データラッチ回路354は、Target400からのSDATA_IN信号のシリアルデータをラッチし、sdata_in信号としてシリアル・パラレル変換回路352に出力する。   At T2, the data latch trigger circuit 353 detects that the rx_en signal is at “H” level and the rx_clk signal is at “L” level, and outputs a pulse of “H” level to the data_en signal. At this time, the data latch circuit 354 latches the serial data of the SDATA_IN signal from the Target 400 and outputs it to the serial / parallel conversion circuit 352 as an sdata_in signal.

T3において、データラッチトリガ回路353は、sdata_en信号に“H”レベルのパルスを出力して、シリアル・パラレル変換回路352に対してデータラッチ回路354からのsdata_in信号のラッチタイミングを指示する。このとき、受信データビットカウンタ355は、data_en信号の“H”レベルのパルスを検出して、ダウンカウントを行なう。   At T 3, the data latch trigger circuit 353 outputs an “H” level pulse to the sdata_en signal to instruct the serial / parallel conversion circuit 352 to latch the sdata_in signal from the data latch circuit 354. At this time, the reception data bit counter 355 detects the “H” level pulse of the data_en signal and performs down-counting.

T4において、SCLK(out)信号が立ち上がる。このとき、rx_clk信号の立ち上がりに対して遅延時間(a)が発生する。また、T5において、SCLK(in)信号が立ち上がる。このとき、SCLK(out)信号の立ち上がりに対して遅延時間(b)が発生する。   At T4, the SCLK (out) signal rises. At this time, a delay time (a) occurs with respect to the rise of the rx_clk signal. At T5, the SCLK (in) signal rises. At this time, a delay time (b) occurs with respect to the rising edge of the SCLK (out) signal.

T6において、Target400内のデータ出力回路420がSCLK(in)信号の立ち上がりエッジに同期してSDATA_IN信号に次のシリアルデータ“#2”を出力する。このとき、SCLK(in)信号の立ち上がりに対して遅延時間(c)が発生する。   At T6, the data output circuit 420 in the Target 400 outputs the next serial data “# 2” to the SDATA_IN signal in synchronization with the rising edge of the SCLK (in) signal. At this time, a delay time (c) occurs with respect to the rising edge of the SCLK (in) signal.

T7において、データラッチ回路354は、data_en信号の“H”レベルのパルスに応じてシリアルデータ“#2”をラッチする。このとき、SDATA_IN信号の変化点から、data_en信号が“H”レベルでありSCLK信号の立ち上がりエッジまでの時間がデータセットアップ時間(d)となる。また、受信データビットカウンタ355は、data_en信号の“H”レベルのパルスを検出して、ダウンカウントを行なう。以下、同様の処理が行われる。   At T7, the data latch circuit 354 latches the serial data “# 2” in accordance with the “H” level pulse of the data_en signal. At this time, the time from the change point of the SDATA_IN signal to the time when the data_en signal is at the “H” level and the rising edge of the SCLK signal is the data setup time (d). The reception data bit counter 355 detects the “H” level pulse of the data_en signal and performs down-counting. Thereafter, the same processing is performed.

受信データビットカウンタ355の値が“0”になると、T8において、受信制御シーケンサ351は、SIO制御部320に対してrx_end信号をアサートし、データ受信が完了したことをSIO制御部320に通知する。そして、rx_en信号に“L”レベルを出力し、データラッチトリガ回路353に対してデータ受信の終了を通知する。   When the value of the reception data bit counter 355 becomes “0”, the reception control sequencer 351 asserts the rx_end signal to the SIO control unit 320 at T8 and notifies the SIO control unit 320 that the data reception is completed. . Then, the “L” level is output to the rx_en signal, and the data latch trigger circuit 353 is notified of the end of data reception.

図5に示すように、シリアルクロック制御部330によって生成されたSCLKは、Initiator300の端子から出力されるまでの遅延時間と、基板またはケーブルによる配線遅延時間とを加算した時間(a)だけ遅れて、SCLK(out)信号としてTarget400に入力される。   As shown in FIG. 5, the SCLK generated by the serial clock control unit 330 is delayed by a time (a) obtained by adding the delay time until output from the terminal of the initiator 300 and the wiring delay time due to the board or cable. , SCLK (out) signal is input to Target 400.

また、Target400の端子に入力されるSCLK(out)信号は、時間(b)だけ遅れてSCLK(in)信号としてデータ出力回路420に入力される。さらに、時間(c)だけ遅れてデータ出力回路420からのSDATA_IN信号がデータラッチ回路354に入力される。   In addition, the SCLK (out) signal input to the terminal of the Target 400 is input to the data output circuit 420 as the SCLK (in) signal with a delay of time (b). Further, the SDATA_IN signal from the data output circuit 420 is input to the data latch circuit 354 with a delay of time (c).

Initiator300のデータラッチ回路354がSDATA_IN信号を正常にラッチするためには、data_en信号が“H”レベルであり、かつSCLK信号の立ち上がりの時間までにSDATA_IN信号が確定していること、すなわちデータセットアップ時間(d)が以下の条件を満たしていることが必要である。   In order for the data latch circuit 354 of the initiator 300 to latch the SDATA_IN signal normally, the data_en signal is at “H” level and the SDATA_IN signal is determined by the rising time of the SCLK signal, that is, the data setup time. (D) must satisfy the following conditions.

データセットアップ時間(d)=SCLK周期サイクル時間−((a)+(b)+(c))>0 …(1)
したがって、Initiator300のシリアルクロック制御部330から出力されたSCLK信号の立ち上がりから、SDATA_IN信号がInitiator300のデータラッチ回路354に入力されるまでの遅延時間(a)+(b)+(c)が大きくなり、SDATA_IN信号のデータセットアップ時間(d)を確保できない場合には、データラッチ回路354はデータを正常にラッチすることができない。
Data setup time (d) = SCLK period cycle time − ((a) + (b) + (c))> 0 (1)
Therefore, the delay time (a) + (b) + (c) from the rise of the SCLK signal output from the serial clock control unit 330 of the initiator 300 to the input of the SDATA_IN signal to the data latch circuit 354 of the initiator 300 increases. When the data setup time (d) of the SDATA_IN signal cannot be secured, the data latch circuit 354 cannot normally latch the data.

(第1の実施の形態)
図6は、本発明の第1の実施の形態におけるクロック同期シリアルI/Oの接続例を説明するための図である。図6は、Initiator1と、Target2とが1:1で接続されている場合を示している。Initiator1から出力されるADJUST信号、SLOAD信号、SCLK信号およびSDATA_OUT信号が、コネクタやケーブルを介してTarget2に入力される。同様に、Target2から出力されるSDATA_IN信号が、コネクタやケーブルを介してInitiator1に入力される。
(First embodiment)
FIG. 6 is a diagram for explaining a connection example of the clock synchronous serial I / O in the first embodiment of the present invention. FIG. 6 shows a case where the initiator 1 and the target 2 are connected by 1: 1. The ADJUST signal, the SLOAD signal, the SCLK signal, and the SDATA_OUT signal output from the initiator 1 are input to the target 2 via a connector or a cable. Similarly, the SDATA_IN signal output from Target 2 is input to Initiator 1 via a connector or a cable.

図7は、本発明の第1の実施の形態におけるInitiator1の内部構成を示すブロック図である。このInitiator1は、SIOブロック10と、CPU60とがCPUバス70を介して接続される。   FIG. 7 is a block diagram showing an internal configuration of the initiator 1 in the first embodiment of the present invention. In the initiator 1, the SIO block 10 and the CPU 60 are connected via a CPU bus 70.

SIOブロック10は、SIOデータ転送を制御するSIO制御部20と、シリアルクロックの周波数を切り替えるシリアルクロック制御部30と、データ送信を制御するデータ送信制御部40と、データ受信を制御するデータ受信制御部50とを含む。   The SIO block 10 includes an SIO control unit 20 that controls SIO data transfer, a serial clock control unit 30 that switches the frequency of the serial clock, a data transmission control unit 40 that controls data transmission, and data reception control that controls data reception. Part 50.

また、SIO制御部20は、SIO制御レジスタ24、input_delayレジスタ25、adj_delayレジスタ26、latch_cycレジスタ27などで構成されるレジスタ群22と、レジスタ群22をCPUバス70に接続するCPUバスI/F23と、SIO制御レジスタ24に設定された内容に基づいてデータ送受信の開始を指示し、データ送受信の終了を検知するSIO送受信制御部21とを含む。   The SIO control unit 20 includes a register group 22 including an SIO control register 24, an input_delay register 25, an adj_delay register 26, a latch_cyc register 27, and the like, and a CPU bus I / F 23 that connects the register group 22 to the CPU bus 70. And an SIO transmission / reception control unit 21 for instructing the start of data transmission / reception based on the contents set in the SIO control register 24 and detecting the end of data transmission / reception.

SIO制御レジスタ24は、SIOデータ転送ビット長を指定するdata_lenビット、シリアルクロック周波数を設定するsclk_selビット、データ転送の開始を指示するsio_en_regビット以外に、受信データの入力遅延を検出するためのモードを設定するadjust_regビットを含む。   The SIO control register 24 has a mode for detecting an input delay of received data, in addition to the data_len bit for specifying the SIO data transfer bit length, the sclk_sel bit for setting the serial clock frequency, and the sio_en_reg bit for instructing the start of data transfer. Contains the adjust_reg bit to set.

input_delayレジスタ25は、受信データの入力遅延値として後述するサンプルクロックsmpclkのクロック数が設定されるレジスタであり、CPU60から読出し可能である。   The input_delay register 25 is a register in which the number of sample clocks smpclk, which will be described later, is set as an input delay value of received data, and can be read from the CPU 60.

adj_delayレジスタ26は、受信データのデータラッチタイミングの調整値としてsmpclkのクロック数を設定するためのレジスタであり、CPU60によって設定可能である。   The adj_delay register 26 is a register for setting the number of clocks of smpclk as an adjustment value of the data latch timing of the received data, and can be set by the CPU 60.

latch_cycレジスタ27は、受信データのデータラッチタイミングの周期としてsmpclkのクロック数を設定するためのレジスタであり、CPU60によって設定可能である。   The latch_cyc register 27 is a register for setting the number of clocks of smpclk as the period of the data latch timing of the received data, and can be set by the CPU 60.

CPU60によってSIO制御レジスタ24のsclk_selビットにシリアルクロック周波数が設定されると、SIO送受信制御部21は、シリアルクロック制御部30に対してsclk_sel信号を出力する。また、CPU60によってSIO制御レジスタ24のadjust_regビットに“1”が設定されると、SIO受信制御部21は、Target2に対して受信データ入力遅延検出モードであることを示すADJUST信号を出力する。   When the serial clock frequency is set in the sclk_sel bit of the SIO control register 24 by the CPU 60, the SIO transmission / reception control unit 21 outputs a sclk_sel signal to the serial clock control unit 30. When the CPU 60 sets “1” in the adjust_reg bit of the SIO control register 24, the SIO reception control unit 21 outputs an ADJUST signal indicating that the received data input delay detection mode is set to Target2.

シリアルクロック制御部30は、SIO送受信制御部21からsclk_sel信号を受けると、smpclkを分周して設定された周波数のシリアルクロックを生成し、sio_start信号がアサートされたときにSCLK信号としてTarget2に出力する。sio_start信号がネゲートされると、シリアルクロック制御部30は、SCLK信号に“H”レベルを出力する。また、シリアルクロック制御部30は、内部シリアルクロック信号としてデータ送信制御部40にtx_clk信号を出力し、データ受信制御部50にrx_clk信号を出力する。   When receiving the sclk_sel signal from the SIO transmission / reception control unit 21, the serial clock control unit 30 divides smpclk to generate a serial clock having a set frequency, and outputs the SCLK signal to the Target 2 when the sio_start signal is asserted. To do. When the sio_start signal is negated, the serial clock control unit 30 outputs an “H” level to the SCLK signal. Further, the serial clock control unit 30 outputs the tx_clk signal to the data transmission control unit 40 as an internal serial clock signal, and outputs the rx_clk signal to the data reception control unit 50.

CPU60が送信データレジスタに送信データを設定すると、SIO送受信制御部21は、tx_data信号によってその送信データをデータ送信制御部40に出力する。そして、CPU60が、データ転送開始を示すsio_en_regに“1”を設定すると、SIO送受信制御部21は、データ送信制御部40に対してデータ送信開始を示すtx_start信号を出力する。   When the CPU 60 sets transmission data in the transmission data register, the SIO transmission / reception control unit 21 outputs the transmission data to the data transmission control unit 40 by a tx_data signal. When the CPU 60 sets “1” to sio_en_reg indicating the start of data transfer, the SIO transmission / reception control unit 21 outputs a tx_start signal indicating the start of data transmission to the data transmission control unit 40.

データ送信制御部40は、CPU60がSIO制御レジスタ24に設定したデータ転送ビット長(data_len)および送信データ(tx_data)を保持している。そして、SIO送受信制御部21から出力されるtx_start信号が“H”レベルになるのを検出すると、tx_clk信号の立ち下がりエッジに同期して送信データ(tx_data)をLSBビットから順にSDATA_OUT信号としてTarget2に出力する。   The data transmission control unit 40 holds the data transfer bit length (data_len) and transmission data (tx_data) set by the CPU 60 in the SIO control register 24. When it is detected that the tx_start signal output from the SIO transmission / reception control unit 21 becomes “H” level, the transmission data (tx_data) is sequentially transmitted from the LSB bit to the Target 2 as the SDATA_OUT signal in synchronization with the falling edge of the tx_clk signal. Output.

そして、データ送信制御部40は、データ転送ビット長分のデータの送信を終了すると、tx_end信号にsmpclk信号の1クロック分の“H”レベルのパルスを出力して、SIO送受信制御部21にデータ送信の終了を通知する。   When the data transmission control unit 40 finishes transmitting the data for the data transfer bit length, the data transmission control unit 40 outputs an “H” level pulse for one clock of the smpclk signal to the tx_end signal, and transmits the data to the SIO transmission / reception control unit 21. Notify the end of transmission.

CPU60が、データ転送開始を示すsio_en_regに“1”を設定すると、SIO送受信制御部21は、データ受信制御部50に対してデータ受信開始を示すrx_start信号を出力する。   When the CPU 60 sets “1” to sio_en_reg indicating the start of data transfer, the SIO transmission / reception control unit 21 outputs an rx_start signal indicating the start of data reception to the data reception control unit 50.

データ受信制御部50は、CPU60がSIO制御レジスタ24に設定したデータ転送ビット長(data_len)を保持している。そして、SIO送受信制御部21から出力されるrx_start信号が“H”レベルになるのを検出すると、Target2から出力されるSDATA_IN信号をrx_clk信号の立ち上がりエッジに同期してラッチすることによりシリアルデータを受信する。   The data reception control unit 50 holds the data transfer bit length (data_len) set in the SIO control register 24 by the CPU 60. When the rx_start signal output from the SIO transmission / reception control unit 21 is detected to be “H” level, serial data is received by latching the SDATA_IN signal output from Target 2 in synchronization with the rising edge of the rx_clk signal. To do.

このとき、データ受信制御部50は、SDATA_IN信号の入力遅延を検出し、その入力遅延値をinput_delay信号としてSIO制御部20に出力する。SIO制御部20は、入力遅延値をinput_delayレジスタ25に格納する。   At this time, the data reception control unit 50 detects an input delay of the SDATA_IN signal and outputs the input delay value to the SIO control unit 20 as an input_delay signal. The SIO control unit 20 stores the input delay value in the input_delay register 25.

また、データ受信制御部50は、SIO制御部20のadj_delayレジスタ26およびlatch_cycレジスタ27に設定された値に応じて、SDATA_IN信号のシリアルデータのラッチタイミングを調整する。   Further, the data reception control unit 50 adjusts the latch timing of the serial data of the SDATA_IN signal according to the values set in the adj_delay register 26 and the latch_cyc register 27 of the SIO control unit 20.

そして、データ受信制御部50は、データ転送ビット長分のシリアルデータをラッチすると、rx_end信号にsmpclk信号の1クロック分の“H”レベルのパルスを出力し、ラッチしたシリアルデータをパラレルデータに変換してrx_data信号として出力する。SIO送受信制御部21は、rx_data信号によって受信データを受けると、受信データレジスタに受信データを設定する。これによって、CPU60が受信データレジスタから受信データを読み出すことができる。   When the data reception control unit 50 latches the serial data corresponding to the data transfer bit length, the data reception control unit 50 outputs an “H” level pulse for one clock of the smpclk signal to the rx_end signal, and converts the latched serial data into parallel data. And output as an rx_data signal. When the SIO transmission / reception control unit 21 receives the reception data by the rx_data signal, the SIO transmission / reception control unit 21 sets the reception data in the reception data register. As a result, the CPU 60 can read the received data from the received data register.

図8は、本発明の第1の実施の形態におけるInitiator1の動作を説明するためのタイミングチャートである。図8においては、シリアルクロックSCLKの周波数の4倍の周波数を有するsmpclkが用いられ、データ転送ビット長が8ビットの場合を示している。図8においても、図3と同様に、Initiator300がTarget400との間で、SDATA_OUTを介してのデータの送信と、SDATA_INを介しての別のデータの受信とを並列に行なう例を示しており、データの送信と別データの受信とは夫々単独に行なうことも可能である。   FIG. 8 is a timing chart for explaining the operation of the initiator 1 in the first embodiment of the present invention. FIG. 8 shows a case where smpclk having a frequency four times the frequency of the serial clock SCLK is used and the data transfer bit length is 8 bits. FIG. 8 also shows an example in which the initiator 300 performs transmission of data via SDATA_OUT and reception of other data via SDATA_IN in parallel with Target 400, as in FIG. Data transmission and reception of different data can be performed independently.

まず、T1において、CPU60がSIO制御レジスタ24のsio_en_regビットおよびadjust_regビットに“1”を設定すると、SIO送受信制御部21はデータ転送を開始する。   First, when the CPU 60 sets “1” to the sio_en_reg bit and the adjust_reg bit of the SIO control register 24 at T1, the SIO transmission / reception control unit 21 starts data transfer.

SIO送受信制御部21は、sio_en_regビットおよびadjust_regビットに“1”が設定されたのを検出すると、T2において、Target2に対して受信データ入力遅延検出モードであることを示すADJUST信号に“H”レベルを出力すると共に、データ送信制御部40に対してsmpclkの1クロック分の“H”レベルのパルスをtx_start信号に出力し、データ受信制御部50に対してsmpclkの1クロック分の“H”レベルのパルスをrx_start信号に出力する。そして、SIO送受信制御部21は、Target2に対してSCLKの1クロック分の“L”レベルのパルスをSLOAD信号に出力する。   When the SIO transmission / reception control unit 21 detects that the sio_en_reg bit and the adjust_reg bit are set to “1”, the SJU transmission / reception control unit 21 sets the ADJUST signal indicating that the received data input delay detection mode is set to “H” level at T2. Is output to the data transmission control unit 40 as a tx_start signal, and the data reception control unit 50 is set to the “H” level corresponding to one clock of smpclk. Are output to the rx_start signal. Then, the SIO transmission / reception control unit 21 outputs an “L” level pulse for one clock of SCLK to Target 2 as an SLOAD signal.

Target2は、ADJUST信号が“H”レベルになり受信データ入力遅延検出モードであることを検知すると、Initiator1に対してSDATA_IN信号に“0”、“1”を交互に繰り返すシリアルデータのパターンを出力する。   When Target 2 detects that the ADJUST signal becomes “H” level and is in the received data input delay detection mode, it outputs a serial data pattern that repeats “0” and “1” alternately to the SDATA_IN signal to Initiator 1. .

T3において、SLOAD信号の立ち上がりと同時に、SIO送受信制御部21は、sio_start信号を“H”レベルにアサートして、シリアルクロック制御部30に対してSCLK信号の出力を指示する。このとき、SIO送受信制御部21は、sclk_sel信号によってSCLKの周波数としてsmpclkを4分周した周波数とするよう指示する。   At T3, simultaneously with the rise of the SLOAD signal, the SIO transmission / reception control unit 21 asserts the sio_start signal to the “H” level and instructs the serial clock control unit 30 to output the SCLK signal. At this time, the SIO transmission / reception control unit 21 instructs the frequency of smpclk to be divided by 4 as the frequency of SCLK by the sclk_sel signal.

T4において、Target2に対するSCLK信号の出力が開始されると、データ送信制御部40は、tx_clk信号の立ち下がりに同期して、SCLKの立ち下がりのタイミングにSDATA_OUT信号によりシリアルデータをLSBから順に送信する。また、T5において、データ受信制御部50は、rx_clk信号の立ち上がりに同期して、SCLKの立ち上がりのタイミングにSDATA_IN信号によりシリアルデータをLSBから順に受信する。   When the output of the SCLK signal to Target 2 is started at T4, the data transmission control unit 40 sequentially transmits serial data from the LSB by the SDATA_OUT signal at the falling timing of SCLK in synchronization with the falling of the tx_clk signal. . Further, at T5, the data reception control unit 50 receives serial data from the LSB in order by the SDATA_IN signal at the rising edge of SCLK in synchronization with the rising edge of the rx_clk signal.

T6において、8ビットのデータ送信が終了すると、データ送信制御部40は、SIO送受信制御部21に対してデータ送信完了を示すtx_end信号を“H”レベルにアサートする。また、8ビットのデータ受信が終了すると、データ受信制御部50は、SIO送受信制御部21に対してデータ受信完了を示すrx_end信号を“H”レベルにアサートする。   When the 8-bit data transmission ends at T6, the data transmission control unit 40 asserts the tx_end signal indicating the completion of the data transmission to the “S” transmission / reception control unit 21 at the “H” level. When the 8-bit data reception is completed, the data reception control unit 50 asserts the rx_end signal indicating the completion of data reception to the “H” level to the SIO transmission / reception control unit 21.

T7において、SIO送受信制御部21はtx_end信号とrx_end信号の両方が“H”レベルにアサートされたことに応じて、シリアルクロック制御部30に対してsio_start信号を“L”レベルにネゲートし、SCLKの出力を停止させる。T8において、シリアルクロック制御部30は、Target2に対してSLOAD信号に“L”レベルを出力し、8ビットのデータ受信が完了したことを通知する。   At T7, the SIO transmission / reception control unit 21 negates the sio_start signal to the “L” level with respect to the serial clock control unit 30 in response to the assertion of both the tx_end signal and the rx_end signal to the “H” level. The output of is stopped. At T8, the serial clock control unit 30 outputs “L” level to the SLOAD signal to Target 2 to notify that 8-bit data reception is completed.

なお、SIO送受信制御部21がsio_start信号をネゲートするまでに、CPU60が次のデータ転送開始を指示していれば、T8において、tx_start信号およびrx_start信号がアサートされ、T9以降において、SCLKの出力と次の8ビットのデータ転送が連続して行なわれる。   If the CPU 60 has instructed the start of the next data transfer before the SIO transmission / reception control unit 21 negates the sio_start signal, the tx_start signal and the rx_start signal are asserted at T8. The next 8-bit data transfer is continuously performed.

図9は、本発明の第1の実施の形態におけるSIOブロック10内のデータ受信制御部50およびTarget2の構成をさらに詳細に説明するためのブロック図である。データ受信制御部50は、データ受信の開始および終了を制御する受信制御シーケンサ51と、受信データのデータラッチタイミングのトリガ(data_en)信号を生成するデータラッチトリガ回路52と、受信データの入力遅延を検出する入力遅延検出回路53と、データラッチトリガ回路52から出力されるdata_en信号によって受信データをラッチするデータラッチ回路54と、データラッチ回路54によってラッチされたシリアルデータ(sdata_in)をパラレルデータに変換して受信データバッファに格納するシリアル・パラレル変換回路55とを含む。   FIG. 9 is a block diagram for explaining in further detail the configuration of the data reception control unit 50 and Target 2 in the SIO block 10 according to the first embodiment of the present invention. The data reception control unit 50 includes a reception control sequencer 51 that controls the start and end of data reception, a data latch trigger circuit 52 that generates a data latch timing trigger (data_en) signal of received data, and an input delay of received data. An input delay detection circuit 53 for detecting, a data latch circuit 54 for latching received data by a data_en signal output from the data latch trigger circuit 52, and serial data (sdata_in) latched by the data latch circuit 54 are converted into parallel data. And a serial / parallel conversion circuit 55 for storing in the received data buffer.

また、受信制御シーケンサ51は、CPU60がSIO制御レジスタ24に設定した受信データビット長(data_len)を保持してカウントする受信データビットカウンタ56を有する。受信制御シーケンサ51は、SIO制御部20によってrx_start信号がアサートされると、データラッチトリガ回路52に対してrx_en信号をアサートし、受信データビットカウンタ56に受信データのビット数のカウントを開始させる。そして、受信データビットカウンタ56が受信データビット長だけ受信データをカウントしたときに、rx_en信号をネゲートする。   The reception control sequencer 51 has a reception data bit counter 56 that holds and counts the reception data bit length (data_len) set by the CPU 60 in the SIO control register 24. When the rx_start signal is asserted by the SIO control unit 20, the reception control sequencer 51 asserts the rx_en signal to the data latch trigger circuit 52, and causes the reception data bit counter 56 to start counting the number of bits of the reception data. When the reception data bit counter 56 counts the reception data by the reception data bit length, the rx_en signal is negated.

データラッチトリガ回路52は、受信制御シーケンサ51からのrx_en信号がアサートされると、データラッチ回路54がSDATA_IN信号のシリアルデータをラッチするタイミングを示すdata_en信号を生成する。また、データラッチトリガ回路52は、遅延調整回路57を有しており、SIO制御部20のadj_delayレジスタ26に設定された値およびlatch_cycレジスタ27に設定された値に応じてdata_en信号およびsdata_en信号の出力タイミングを調整する。この遅延調整回路57の詳細については後述する。   When the rx_en signal from the reception control sequencer 51 is asserted, the data latch trigger circuit 52 generates a data_en signal indicating the timing at which the data latch circuit 54 latches the serial data of the SDATA_IN signal. Further, the data latch trigger circuit 52 has a delay adjustment circuit 57, and the data_en signal and the sdata_en signal are set according to the value set in the adj_delay register 26 of the SIO control unit 20 and the value set in the latch_cyc register 27. Adjust the output timing. Details of the delay adjustment circuit 57 will be described later.

データラッチ回路54は、データラッチトリガ回路52から出力されるdata_en信号に同期して入力遅延検出回路53から出力されるSDATA_IN_F2信号のシリアルデータをラッチし、sdata_in信号としてシリアル・パラレル変換回路55に出力する。   The data latch circuit 54 latches the serial data of the SDATA_IN_F2 signal output from the input delay detection circuit 53 in synchronization with the data_en signal output from the data latch trigger circuit 52, and outputs it to the serial / parallel conversion circuit 55 as the sdata_in signal. To do.

シリアル・パラレル変換回路55は、データラッチ回路54から出力されるsdata_in信号およびデータラッチトリガ回路52から出力されるsdata_en信号を受け、sdata_en信号によってsdata_in信号に対して最大8ビットのビットシフトを行なってパラレルデータを生成し、そのパラレルデータを受信データバッファに格納する。   The serial / parallel conversion circuit 55 receives the sdata_in signal output from the data latch circuit 54 and the sdata_en signal output from the data latch trigger circuit 52, and performs a maximum bit shift of 8 bits on the sdata_in signal by the sdata_en signal. Parallel data is generated, and the parallel data is stored in the reception data buffer.

また、Target2内の送信データ回路201は、ADJUST信号が“H”レベルになるのを検知し、SLOAD信号がアサートされると、sdata_out信号に“0”、“1”を交互に繰り返すシリアルデータのパターンを出力する。   Further, the transmission data circuit 201 in Target 2 detects that the ADJUST signal becomes “H” level, and when the SLOAD signal is asserted, serial data of “0” and “1” are alternately repeated in the sdata_out signal. Output the pattern.

また、データ出力回路202は、SCLK(in)信号の立ち上がりエッジに同期して送信データ回路201から受けたシリアルデータをSDATA_IN信号としてInitiator1に出力する。   The data output circuit 202 outputs the serial data received from the transmission data circuit 201 in synchronization with the rising edge of the SCLK (in) signal to the initiator 1 as the SDATA_IN signal.

図10は、図9に示す入力遅延検出回路53の内部構成を示すブロック図である。この入力遅延検出回路53は、smpclkに同期して動作するものであり、遅延時間計測回路61と、データ不一致検出回路62と、フリップフロップFF1(63)およびFF2(64)とを含む。   FIG. 10 is a block diagram showing an internal configuration of the input delay detection circuit 53 shown in FIG. The input delay detection circuit 53 operates in synchronization with smpclk, and includes a delay time measurement circuit 61, a data mismatch detection circuit 62, and flip-flops FF1 (63) and FF2 (64).

また、遅延時間計測回路61は、計測制御シーケンサ65と、遅延時間計測カウンタ(SCLK_D1)66とを含む。   The delay time measurement circuit 61 includes a measurement control sequencer 65 and a delay time measurement counter (SCLK_D1) 66.

計測制御シーケンサ65は、ADJUST信号が“H”レベルとなって受信データ入力遅延検出モードであることを確認し、SIO制御部20からのSLOAD信号がアサートされると、check_start信号をアサートしてデータ不一致検出回路62にデータ不一致の検出開始を指示する。   The measurement control sequencer 65 confirms that the ADJUST signal becomes “H” level and is in the received data input delay detection mode. When the SLOAD signal from the SIO control unit 20 is asserted, the measurement control sequencer 65 asserts the check_start signal to The mismatch detection circuit 62 is instructed to start data mismatch detection.

そして、計測制御シーケンサ65は、シリアルクロック制御部30からのrx_clk信号の立ち上がりエッジを検出すると、遅延時間計測カウンタ66に対してカウント開始を指示する。   When the measurement control sequencer 65 detects the rising edge of the rx_clk signal from the serial clock control unit 30, the measurement control sequencer 65 instructs the delay time measurement counter 66 to start counting.

計測制御シーケンサ65は、データ不一致検出回路62からデータ不一致を検出したことを示すno_match信号を受けると、遅延時間計測カウンタ66にカウントの停止を指示し、check_start信号をネゲートしてデータ不一致検出回路62にデータ不一致の検出終了を指示する。   When the measurement control sequencer 65 receives a no_match signal indicating that data mismatch has been detected from the data mismatch detection circuit 62, the measurement control sequencer 65 instructs the delay time measurement counter 66 to stop counting, negates the check_start signal, and negates the data mismatch detection circuit 62. To end the data mismatch detection.

遅延時間計測カウンタ66は、計測制御シーケンサ65からの指示に応じてカウンタの初期化(“0”クリア)を行なう。そして、計測制御シーケンサ65からカウント開始の指示を受けると、smpclk信号に同期してカウントアップを開始する。そして、計測制御シーケンサ65からカウント停止の指示を受けると、カウントアップを停止してSIO送受信制御部21に対してinput_delay信号によりカウント値を出力する。   The delay time measurement counter 66 initializes the counter (“0” clear) in response to an instruction from the measurement control sequencer 65. When receiving a count start instruction from the measurement control sequencer 65, the count-up is started in synchronization with the smpclk signal. When the count stop instruction is received from the measurement control sequencer 65, the count-up is stopped and the count value is output to the SIO transmission / reception control unit 21 by the input_delay signal.

SIO送受信制御部21は、遅延時間計測カウンタ66から出力されたカウント値をinput_delayレジスタ25に格納する。   The SIO transmission / reception control unit 21 stores the count value output from the delay time measurement counter 66 in the input_delay register 25.

FF1(63)は、SDATA_IN信号をsmpclk信号の立ち上がりでサンプリングし、SDATA_IN_F信号としてデータ不一致検出回路62およびFF2(64)に出力する。   The FF1 (63) samples the SDATA_IN signal at the rising edge of the smpclk signal, and outputs it to the data mismatch detection circuit 62 and the FF2 (64) as the SDATA_IN_F signal.

FF2(64)は、FF1(63)から出力されたSDATA_IN_F信号をsmpclk信号の立ち上がりでサンプリングし、SDATA_IN_F2信号としてデータ不一致検出回路62およびデータラッチ回路54に出力する。   The FF2 (64) samples the SDATA_IN_F signal output from the FF1 (63) at the rising edge of the smpclk signal, and outputs it to the data mismatch detection circuit 62 and the data latch circuit 54 as the SDATA_IN_F2 signal.

なお、FF1(63)およびFF2(64)は、SDATA_INのデータ入力経路としても使用されるため、ADJUST信号のレベルに関係なく動作する。   Since FF1 (63) and FF2 (64) are also used as a data input path of SDATA_IN, they operate regardless of the level of the ADJUST signal.

データ不一致検出回路62は、SDATA_IN_F信号とSDATA_IN_F2信号とを比較してデータの一致/不一致を検出し、データが不一致の場合に遅延時間計測回路61に対してno_match信号を出力する。なお、SDATA_IN_F信号とSDATA_IN_F2信号とのデータ不一致は、SDATA_INの1ビット目と2ビット目のビット変化の遅延、すなわちSDATA_INの入力遅延となる。   The data mismatch detection circuit 62 compares the SDATA_IN_F signal and the SDATA_IN_F2 signal to detect data match / mismatch, and outputs a no_match signal to the delay time measurement circuit 61 when the data does not match. Note that the data mismatch between the SDATA_IN_F signal and the SDATA_IN_F2 signal becomes a delay in bit change of the first and second bits of SDATA_IN, that is, an input delay of SDATA_IN.

図11は、図10に示す入力遅延検出回路53の入力遅延検出動作を説明するためのタイミングチャートである。T1において、計測制御シーケンサ65は、データ転送開始時にSIO制御部20から出力されるSLOAD信号が“L”レベルになるのを検出すると、ADJUST信号の“H”レベルによって受信データ入力遅延検出モードであることを確認し、受信データの入力遅延検出動作を開始する。   FIG. 11 is a timing chart for explaining the input delay detection operation of the input delay detection circuit 53 shown in FIG. In T1, when the measurement control sequencer 65 detects that the SLOAD signal output from the SIO control unit 20 becomes “L” level at the start of data transfer, the measurement control sequencer 65 in the received data input delay detection mode according to the “H” level of the ADJUST signal. Confirm that there is, start the input data delay detection operation.

T2において、計測制御シーケンサ65は、check_start信号をアサートし、データ不一致検出回路62に対してデータ不一致の検出開始を指示すると共に、遅延時間計測カウンタ66に対してカウンタの初期化を指示する。T3において、遅延時間計測カウンタ66は、カウント値を“0”に初期化する。   At T2, the measurement control sequencer 65 asserts the check_start signal, instructs the data mismatch detection circuit 62 to start data mismatch detection, and instructs the delay time measurement counter 66 to initialize the counter. At T3, the delay time measurement counter 66 initializes the count value to “0”.

T4およびT5において、計測制御シーケンサ65は、rx_clk信号が“L”レベルから“H”レベルに変化するのを検出すると、遅延時間計測カウンタ66にカウント動作を開始させる。   At T4 and T5, when the measurement control sequencer 65 detects that the rx_clk signal changes from the “L” level to the “H” level, it causes the delay time measurement counter 66 to start the counting operation.

T6において、SDATA_IN_F信号およびSDATA_IN_F2信号が共に“L”レベルであるため、データ不一致検出回路62はデータ一致と判定する。T7において、SDATA_IN_F信号が“H”レベルに変化すると、データ不一致検出回路62はデータ不一致と判定する。   At T6, since the SDATA_IN_F signal and the SDATA_IN_F2 signal are both at the “L” level, the data mismatch detection circuit 62 determines that the data matches. When the SDATA_IN_F signal changes to the “H” level at T7, the data mismatch detection circuit 62 determines that the data does not match.

T8において、データ不一致検出回路62は、no_match信号をアサートして計測制御シーケンサ65に対してデータ不一致検出を通知する。このとき、計測制御シーケンサ65は、遅延時間計測カウンタ66に対してカウント停止を指示する。   At T8, the data mismatch detection circuit 62 asserts the no_match signal and notifies the measurement control sequencer 65 of data mismatch detection. At this time, the measurement control sequencer 65 instructs the delay time measurement counter 66 to stop counting.

T9において、計測制御シーケンサ65は、check_start信号をネゲートして、データ不一致検出回路62にデータ不一致の検出終了を指示する。なお、遅延時間計測カウンタ66のカウント値は、input_delay信号によってSIO制御部20に通知される。   At T9, the measurement control sequencer 65 negates the check_start signal and instructs the data mismatch detection circuit 62 to end detection of data mismatch. Note that the count value of the delay time measurement counter 66 is notified to the SIO control unit 20 by an input_delay signal.

図12は、図10に示す計測制御シーケンサ65の処理手順を説明するためのフローチャートである。まず、計測制御シーケンサ65は、SIO制御部20から出力されるADJUST信号が“1”であり、かつSLOAD信号が“0”であるか否かを判定する(S11)。ADJUST信号が“0”であるか、SLOAD信号が“1”であれば(S11,No)、ステップS11の処理を繰り返す。   FIG. 12 is a flowchart for explaining the processing procedure of the measurement control sequencer 65 shown in FIG. First, the measurement control sequencer 65 determines whether the ADJUST signal output from the SIO control unit 20 is “1” and the SLOAD signal is “0” (S11). If the ADJUST signal is “0” or the SLOAD signal is “1” (S11, No), the process of step S11 is repeated.

ADJUST信号が“1”であり、かつSLOAD信号が“0”であれば(S11,Yes)、check_start信号を“1”にし、遅延時間計測カウンタ66を“0”に初期化する(S12)。   If the ADJUST signal is “1” and the SLOAD signal is “0” (S11, Yes), the check_start signal is set to “1” and the delay time measurement counter 66 is initialized to “0” (S12).

次に、計測制御シーケンサ65は、シリアルクロック制御部30から出力されるrx_clk信号が“0”であるか否かを判定する(S13)。rx_clk信号が“1”であれば(S13,No)、ステップS13の処理を繰り返す。また、rx_clk信号が“0”であれば(S13,Yes)、rx_clk信号が“1”になるまで待機する(S14)。   Next, the measurement control sequencer 65 determines whether or not the rx_clk signal output from the serial clock control unit 30 is “0” (S13). If the rx_clk signal is “1” (S13, No), the process of step S13 is repeated. If the rx_clk signal is “0” (S13, Yes), the process waits until the rx_clk signal becomes “1” (S14).

rx_clk信号が“1”になると(S14,Yes)、遅延時間計測カウンタ66に対してカウント開始を指示する(S15)。そして、データ不一致検出回路62から出力されるno_match信号が“1”であるか否かを判定する(S16)。   When the rx_clk signal becomes “1” (S14, Yes), the delay time measurement counter 66 is instructed to start counting (S15). Then, it is determined whether or not the no_match signal output from the data mismatch detection circuit 62 is “1” (S16).

計測制御シーケンサ65は、no_match信号が“1”であれば(S16,Yes)、遅延時間計測カウンタ66に対してカウント停止を指示し、データ不一致検出回路62に対してcheck_start信号に“0”を出力する(S17)。そして、ステップS11に戻って、以降の処理を繰り返す。   If the no_match signal is “1” (S16, Yes), the measurement control sequencer 65 instructs the delay time measurement counter 66 to stop counting, and sets the check_start signal to “0” for the data mismatch detection circuit 62. Output (S17). And it returns to step S11 and repeats the subsequent processes.

図13は、図9に示すデータラッチトリガ回路52をさらに詳細に説明するためのブロック図である。データラッチトリガ回路52は、smpclkに同期して動作するものであり、データラッチトリガ制御シーケンサ71と、遅延調整回路57とを含む。また、遅延調整回路57は、data_en調整カウンタ(DATA_DLY)72と、data_en周期カウンタ(LATCH_CNT)73とを含む。なお、データラッチトリガ回路52は、受信データ入力遅延検出モードであるか否かに関係なく、常に動作する。   FIG. 13 is a block diagram for explaining the data latch trigger circuit 52 shown in FIG. 9 in more detail. The data latch trigger circuit 52 operates in synchronization with smpclk, and includes a data latch trigger control sequencer 71 and a delay adjustment circuit 57. The delay adjustment circuit 57 includes a data_en adjustment counter (DATA_DLY) 72 and a data_en cycle counter (LATCH_CNT) 73. The data latch trigger circuit 52 always operates regardless of whether or not it is in the reception data input delay detection mode.

データラッチトリガ制御シーケンサ71は、SLOAD信号が“L”レベルから“H”レベルになる直前にSIO制御部20から出力されるadj_trg信号を受け、遅延調整を開始する。このとき、データラッチトリガ制御シーケンサ71は、遅延調整回路57に対してdly_start信号を出力して、data_en信号の遅延調整を開始させる。   The data latch trigger control sequencer 71 receives the adj_trg signal output from the SIO control unit 20 immediately before the SLOAD signal changes from “L” level to “H” level, and starts delay adjustment. At this time, the data latch trigger control sequencer 71 outputs a dly_start signal to the delay adjustment circuit 57 to start delay adjustment of the data_en signal.

データラッチトリガ制御シーケンサ71は、遅延調整回路57から遅延調整が完了したことを示すdly_match信号を受けると、遅延調整回路57に対してcyc_start信号を出力して、data_en信号の周期を計測させる。遅延調整回路57は、所定の周期を計測したときに、データラッチトリガ制御シーケンサ71に対してcyc_match信号を出力する。   When the data latch trigger control sequencer 71 receives the dly_match signal indicating that the delay adjustment has been completed from the delay adjustment circuit 57, the data latch trigger control sequencer 71 outputs a cyc_start signal to the delay adjustment circuit 57 to measure the period of the data_en signal. The delay adjustment circuit 57 outputs a cyc_match signal to the data latch trigger control sequencer 71 when measuring a predetermined cycle.

データラッチトリガ制御シーケンサ71は、遅延調整回路57から出力されるdly_match信号およびcyc_match信号に同期して、data_en信号を出力し、smpclkの1クロック後にsdata_en信号を出力する。   The data latch trigger control sequencer 71 outputs a data_en signal in synchronization with the dly_match signal and the cyc_match signal output from the delay adjustment circuit 57, and outputs an sdata_en signal after one clock of smpclk.

data_en調整カウンタ72は、データラッチトリガ制御シーケンサ71から出力されるdly_start信号がアサートされると、“0”からカウントを開始する。そして、カウント値がadj_delayレジスタ26に設定される値と一致すると、data_en調整カウンタ72はカウントを停止して、dly_match信号をデータラッチトリガ制御シーケンサ71に出力する。   When the dly_start signal output from the data latch trigger control sequencer 71 is asserted, the data_en adjustment counter 72 starts counting from “0”. When the count value matches the value set in the adj_delay register 26, the data_en adjustment counter 72 stops counting and outputs a dly_match signal to the data latch trigger control sequencer 71.

data_en周期カウンタ73は、データラッチトリガ制御シーケンサ71から出力されるcyc_start信号がアサートされると、“0”からカウントを開始する。そして、カウント値がlatch_cycレジスタ27に設定される値と一致すると、data_en周期カウンタ73はカウントを停止して、cyc_match信号をデータラッチトリガ制御シーケンサ71に出力する。   When the cyc_start signal output from the data latch trigger control sequencer 71 is asserted, the data_en cycle counter 73 starts counting from “0”. When the count value matches the value set in the latch_cyc register 27, the data_en cycle counter 73 stops counting and outputs a cyc_match signal to the data latch trigger control sequencer 71.

CPU60は、受信データ入力遅延検出モードで得られた入力遅延値をadj_delayレジスタ26に設定することにより、シリアルデータの1ビット目のdata_en信号の出力タイミングを調整する。   The CPU 60 adjusts the output timing of the data_en signal of the first bit of the serial data by setting the input delay value obtained in the reception data input delay detection mode in the adj_delay register 26.

また、CPU60は、SCLKの1周期がsmpclkの何クロックに相当するかをlatch_cycレジスタ27に設定することにより、シリアルデータの2ビット目以降のdata_en信号の出力タイミングを調整する。   Further, the CPU 60 adjusts the output timing of the data_en signal after the second bit of the serial data by setting in the latch_cyc register 27 how many clocks of Smpclk corresponds to one clock of SCLK.

この遅延調整アルゴリズムは、Target2から出力されるSDATA_IN信号の入力遅延がSCLK信号の立ち上がりエッジに対して常に一定であり、1ビット目の入力遅延を調整すれば、2ビット目以降はSCLK周期でビット変化が発生することを前提としている。   In this delay adjustment algorithm, the input delay of the SDATA_IN signal output from Target 2 is always constant with respect to the rising edge of the SCLK signal, and if the input delay of the first bit is adjusted, the second and subsequent bits are bits in the SCLK cycle. It is assumed that changes will occur.

図14は、図13に示すデータラッチトリガ回路52の動作を説明するためのタイミングチャートである。図14においては、data_en信号の遅延調整値としてadj_delayレジスタ26に“3”が設定され、data_en信号の周期としてlatch_cycレジスタ27にsmpslkのクロック数である“4”から1を差し引いた“3”が設定される場合を示している。   FIG. 14 is a timing chart for explaining the operation of data latch trigger circuit 52 shown in FIG. In FIG. 14, “3” is set in the adj_delay register 26 as the delay adjustment value of the data_en signal, and “3” obtained by subtracting 1 from “4” which is the number of clocks of smsplk in the latch_cyc register 27 as the period of the data_en signal. The case where it is set is shown.

まず、データラッチトリガ回路52は、受信制御シーケンサ51から出力されるrx_en信号が“H”レベルになるのを検出して、data_en信号の遅延調整を開始する。   First, the data latch trigger circuit 52 detects that the rx_en signal output from the reception control sequencer 51 becomes “H” level, and starts delay adjustment of the data_en signal.

T1において、SIO制御部20からのadj_trg信号に“H”レベルのパルスが出力されると、データラッチトリガ制御シーケンサ71は、dly_start信号に“H”レベルのパルスを出力して、data_en調整カウンタ72にカウントを開始させる。   When the “H” level pulse is output to the adj_trg signal from the SIO control unit 20 at T 1, the data latch trigger control sequencer 71 outputs the “H” level pulse to the dly_start signal, and the data_en adjustment counter 72. To start counting.

T2およびT3において、data_en調整カウンタ72は、smpclk信号の立ち上がりに同期してカウントアップを行なう。T4において、data_en調整カウンタ72は、カウント値とadj_dly信号の値とが一致するので、データラッチトリガ制御シーケンサ71に対してdly_match信号をアサートすると共に、カウント動作を停止する。   At T2 and T3, the data_en adjustment counter 72 counts up in synchronization with the rising edge of the smpclk signal. At T4, the data_en adjustment counter 72 asserts the dly_match signal to the data latch trigger control sequencer 71 and stops the count operation because the count value matches the value of the adj_dly signal.

データラッチトリガ制御シーケンサ71は、data_en調整カウンタ72からdly_match信号を受けると、T5において、data_en信号にシリアルデータの1ビット目に対応する“H”レベルのパルスを出力すると共に、cyc_start信号に“H”レベルのパルスを出力して、data_en周期カウンタ73にカウントを開始させる。このとき、data_en調整カウンタ72は、カウントを停止してカウント値を“0”クリアする。   When receiving the dly_match signal from the data_en adjustment counter 72, the data latch trigger control sequencer 71 outputs a “H” level pulse corresponding to the first bit of the serial data to the data_en signal at T5 and also outputs the “H” level to the cyc_start signal. "Level pulse is output, and the data_en period counter 73 starts counting. At this time, the data_en adjustment counter 72 stops counting and clears the count value to “0”.

T6において、データラッチトリガ制御シーケンサ71は、シリアル・パラレル変換回路55に対してsdata_en信号に“H”レベルのパルスを出力する。T6およびT7において、data_en周期カウンタ73は、smpclk信号の立ち上がりに同期してカウントアップを行なう。   At T 6, the data latch trigger control sequencer 71 outputs an “H” level pulse to the sdata_en signal to the serial / parallel conversion circuit 55. At T6 and T7, the data_en period counter 73 counts up in synchronization with the rising edge of the smpclk signal.

T8において、data_en周期カウンタ73は、カウント値とlatch_cyc信号の値とが一致するので、データラッチトリガ制御シーケンサ71に対してcyc_match信号をアサートすると共に、カウント値を“0”クリアする。   At T8, the data_en cycle counter 73 asserts the cyc_match signal to the data latch trigger control sequencer 71 and clears the count value to “0” because the count value matches the value of the latch_cyc signal.

データラッチトリガ制御シーケンサ71は、data_en周期カウンタ73からcyc_match信号を受けると、T9において、data_en信号にシリアルデータの2ビット目に対応する“H”レベルのパルスを出力する。   When receiving the cyc_match signal from the data_en cycle counter 73, the data latch trigger control sequencer 71 outputs an “H” level pulse corresponding to the second bit of the serial data to the data_en signal at T9.

T10以降において、データラッチトリガ制御シーケンサ71は同様の動作を繰り返し、data_en信号に3ビット目以降のシリアルデータに対応する“H”レベルのパルスを出力する。   After T10, the data latch trigger control sequencer 71 repeats the same operation, and outputs a “H” level pulse corresponding to the third and subsequent bits of serial data to the data_en signal.

T15において、受信制御シーケンサ51が、rx_end信号に“H”レベルを出力して、SIO制御部20にデータ受信の終了を通知する。そして、T16において、受信制御シーケンサ51がrx_en信号に“L”レベルを出力して、データラッチトリガ回路52にデータ受信の終了を通知する。このとき、data_en周期カウンタ73は、カウントを停止してカウント値を“0”クリアする。   At T15, the reception control sequencer 51 outputs “H” level to the rx_end signal to notify the SIO control unit 20 of the end of data reception. At T16, the reception control sequencer 51 outputs “L” level to the rx_en signal, and notifies the data latch trigger circuit 52 of the end of data reception. At this time, the data_en cycle counter 73 stops counting and clears the count value to “0”.

図15は、図13に示すデータラッチトリガ回路52の処理手順を説明するためのフローチャートである。まず、データラッチトリガ制御シーケンサ71は、受信制御シーケンサ51から出力されるrx_en信号が“1”であるか否かを判定する(S21)。rx_en信号が“0”であれば(S21,No)、ステップS21の処理を繰り返す。   FIG. 15 is a flowchart for explaining the processing procedure of the data latch trigger circuit 52 shown in FIG. First, the data latch trigger control sequencer 71 determines whether or not the rx_en signal output from the reception control sequencer 51 is “1” (S21). If the rx_en signal is “0” (S21, No), the process of step S21 is repeated.

rx_en信号が“1”であれば(S21,Yes)、データラッチトリガ制御シーケンサ71は、SIO制御部20から出力されるadj_trg信号が“1”であるか否かを判定する(S22)。   If the rx_en signal is “1” (S21, Yes), the data latch trigger control sequencer 71 determines whether or not the adj_trg signal output from the SIO control unit 20 is “1” (S22).

adj_trg信号が“0”であれば(S22,No)、ステップS22の処理を繰り返す。また、adj_trg信号が“1”であれば(S22,Yes)、dly_start信号に“H”レベルのパルスを出力して、data_en調整カウンタ72に対してカウント開始を指示する(S23)。   If the adj_trg signal is “0” (S22, No), the process of step S22 is repeated. If the adj_trg signal is “1” (S22, Yes), an “H” level pulse is output to the dly_start signal to instruct the data_en adjustment counter 72 to start counting (S23).

data_en調整カウンタ72は、カウントを行ない(S24)、カウント値がadj_delayの値と一致するか否かを判定する(S25)。カウント値がadj_delayの値と一致しなければ(S25,No)、ステップS24に戻ってカウントアップを繰り返す。   The data_en adjustment counter 72 performs counting (S24), and determines whether or not the count value matches the value of adj_delay (S25). If the count value does not match the value of adj_delay (S25, No), the process returns to step S24 and repeats counting up.

また、カウント値とadj_delayの値とが一致すれば(S25,Yes)、data_en調整カウンタ72は、データラッチトリガ制御シーケンサ71に対してdly_match信号に“H”レベルのパルスを出力する(S26)。   If the count value matches the value of adj_delay (S25, Yes), the data_en adjustment counter 72 outputs an “H” level pulse to the dly_match signal to the data latch trigger control sequencer 71 (S26).

データラッチトリガ制御シーケンサ71は、data_en調整カウンタ72からdly_match信号を受けると、data_en調整カウンタ72に対してカウントを停止させ、カウント値を“0”クリアさせる。そして、data_en信号に1回目の“H”レベルのパルスを出力し、smpclkの1クロック後にsdata_en信号に“H”レベルのパルスを出力する。そして、cyc_start信号に“H”レベルのパルスを出力して、data_en周期カウンタ73に対してカウント開始を指示する(S27)。   When the data latch trigger control sequencer 71 receives the dly_match signal from the data_en adjustment counter 72, the data latch trigger control sequencer 71 causes the data_en adjustment counter 72 to stop counting and clear the count value to “0”. Then, the first “H” level pulse is output to the data_en signal, and the “H” level pulse is output to the sdata_en signal after one clock of smpclk. Then, an “H” level pulse is output to the cyc_start signal to instruct the data_en cycle counter 73 to start counting (S27).

data_en周期カウンタ73は、カウントを行ない(S28)、カウント値がlatch_cycの値と一致するか否かを判定する(S29)。カウント値がlatch_cycの値と一致しなければ(S29,No)、ステップS28に戻ってカウントアップを繰り返す。   The data_en cycle counter 73 counts (S28), and determines whether the count value matches the value of latch_cyc (S29). If the count value does not match the value of latch_cyc (S29, No), the process returns to step S28 and repeats counting up.

また、カウント値とlatch_cycの値とが一致すれば(S29,Yes)、data_en周期カウンタ73は、データラッチトリガ制御シーケンサ71に対してcyc_match信号に“H”レベルのパルスを出力する。そして、data_en信号に“H”レベルのパルスを出力し、smpclkの1クロック後にsdata_en信号に“H”レベルのパルスを出力する(S30)。   If the count value matches the value of latch_cyc (S29, Yes), the data_en cycle counter 73 outputs an “H” level pulse to the cyc_match signal to the data latch trigger control sequencer 71. Then, an “H” level pulse is output to the data_en signal, and an “H” level pulse is output to the sdata_en signal after one clock of smpclk (S30).

次に、データラッチトリガ制御シーケンサ71は、受信制御シーケンサ51から出力されるrx_en信号が“0”であるか否かを判定する(S31)。rx_en信号が“1”であれば(S31,No)、ステップS28に戻って以降の処理を繰り返す。また、rx_en信号が“0”であれば(S31,Yes)、data_en周期カウンタ73に対してカウントを停止させ、カウント値を“0”クリアさせ(S32)、ステップS21に戻って以降の処理を繰り返す。   Next, the data latch trigger control sequencer 71 determines whether or not the rx_en signal output from the reception control sequencer 51 is “0” (S31). If the rx_en signal is “1” (S31, No), the process returns to step S28 and the subsequent processing is repeated. If the rx_en signal is “0” (S31, Yes), the data_en cycle counter 73 stops counting, clears the count value to “0” (S32), returns to step S21, and performs the subsequent processing. repeat.

以上説明したように、本実施の形態におけるInitiator1によれば、CPU60が、SIO制御部20に設けられたSIO制御レジスタ24のadjust_regビットに“1”を設定することによりADJUST信号に“H”レベルが出力され、Initiator1およびTarget2を受信データ入力遅延検出モードに移行させるようにした。これによって、任意のタイミングで、CPU60がシリアルデータの入力遅延を検出でき、入力遅延値に応じてシリアルデータのラッチタイミングを調整することが可能となった。   As described above, according to the initiator 1 in the present embodiment, the CPU 60 sets the adjust_reg bit of the SIO control register 24 provided in the SIO control unit 20 to “1” to set the ADJUST signal to the “H” level. Is output, and the initiator 1 and the target 2 are shifted to the reception data input delay detection mode. As a result, the CPU 60 can detect the input delay of the serial data at an arbitrary timing, and can adjust the latch timing of the serial data according to the input delay value.

また、入力遅延検出回路53は、ADJUST信号が“H”レベルになるのを検出して、シリアルデータの入力遅延を検出し、その入力遅延値をSIO制御部20内のinput_delayレジスタ25に設定するようにした。これによって、CPU60は、シリアルデータの入力遅延値を容易に把握することが可能となった。したがって、受信データ入力遅延検出処理を実現するプログラムを製品に実装しておけば、製品出荷後においても任意のタイミングで受信データ入力遅延を検出することができる。   Further, the input delay detection circuit 53 detects that the ADJUST signal becomes “H” level, detects an input delay of serial data, and sets the input delay value in the input_delay register 25 in the SIO control unit 20. I did it. As a result, the CPU 60 can easily grasp the input delay value of the serial data. Therefore, if a program for realizing the received data input delay detection process is installed in the product, the received data input delay can be detected at an arbitrary timing even after the product is shipped.

また、SIO制御部20に、CPU60が値を設定することができるadj_delayレジスタ26およびlatch_cycレジスタ27を設け、遅延調整回路57がこれらのレジスタの値に応じてシリアルデータのラッチタイミングを調整するようにした。これによって、シリアルデータの入力遅延値に応じてラッチタイミングを調整することができ、データ転送速度を下げずにシリアルデータを確実にラッチすることが可能となった。したがって、この入力遅延調整処理を実現するプログラムを製品に実装しておけば、製品出荷後においても任意のタイミングでシリアルデータのラッチタイミングを調整することができる。   Further, the SIO control unit 20 is provided with an adj_delay register 26 and a latch_cyc register 27 in which values can be set by the CPU 60, so that the delay adjustment circuit 57 adjusts the latch timing of serial data according to the values of these registers. did. As a result, the latch timing can be adjusted according to the input delay value of the serial data, and the serial data can be reliably latched without reducing the data transfer rate. Therefore, if a program for realizing this input delay adjustment processing is mounted on a product, the latch timing of serial data can be adjusted at an arbitrary timing even after product shipment.

(第2の実施の形態)
第1の実施の形態において、製品出荷後であってもInitiatorとTargetとの間のシリアルデータの入力遅延調整が可能となることを説明した。しかしながら、エンドユーザが接続ケーブルを変更したり、Targetの特性を変更したりして、入力遅延が著しく大きくなる場合には、SIO通信エラーやデータ転送性能の悪化に至る場合も考えられる。本発明の第2の実施の形態においては、出力I/Oバッファの性能を高めることでSIO通信エラーやデータ転送性能の悪化を防止するものである。
(Second Embodiment)
In the first embodiment, it has been described that the serial data input delay adjustment between the initiator and the target is possible even after the product is shipped. However, when the end user changes the connection cable or changes the characteristics of the target and the input delay becomes remarkably large, the SIO communication error or the data transfer performance may be deteriorated. In the second embodiment of the present invention, the SIO communication error and the deterioration of the data transfer performance are prevented by improving the performance of the output I / O buffer.

図16は、本発明の第2の実施の形態におけるInitiatorのSIOブロックの詳細を説明するための図である。なお、このSIOブロック10’が、CPUバス70を介してCPU60と接続される点においては、図7に示すInitiator1の構成と同様である。また、図7および図9に示す第1の実施の形態におけるSIOブロック10と同様の構成および機能を有する部分については、同じ参照番号を付すものとする。   FIG. 16 is a diagram for explaining details of the SIO block of the initiator according to the second embodiment of this invention. The SIO block 10 ′ is similar to the configuration of the initiator 1 shown in FIG. 7 in that the SIO block 10 ′ is connected to the CPU 60 via the CPU bus 70. Also, the same reference numerals are assigned to portions having the same configuration and function as the SIO block 10 in the first embodiment shown in FIGS.

SIOブロック10’は、SIO制御部81と、データ送信制御部40と、シリアルクロック制御部30と、データ受信制御部84と、4mAのドライブ能力を有する4mAIOセルブロック85−1〜85−4と、8mAのドライブ能力を有する8mAIOセルブロック86−1〜86−4とを含む。   The SIO block 10 ′ includes an SIO control unit 81, a data transmission control unit 40, a serial clock control unit 30, a data reception control unit 84, and 4 mAIO cell blocks 85-1 to 85-4 having a drive capacity of 4 mA. And 8 mAIO cell blocks 86-1 to 86-4 having a drive capacity of 8 mA.

SIO制御部81は、SIO制御レジスタ101と、SDATA_IN信号が変化しない一定時間を設定するためのdrv_dataレジスタ102と、SDATA_IN信号が一定時間変化しない場合に設定されるdrv_intレジスタ103とを含む。   The SIO control unit 81 includes an SIO control register 101, a drv_data register 102 for setting a certain time during which the SDATA_IN signal does not change, and a drv_int register 103 that is set when the SDATA_IN signal does not change for a certain time.

SIO制御レジスタ101は、SIOデータ転送ビット長を指定するdata_lenビット、シリアルクロック周波数を設定するsclk_selビット、データ転送の開始を指示するsio_en_regビット、受信データの入力遅延を検出するためのモードを設定するadjust_regビット以外に、4mAIO85−1〜85−4および8mAIO86−1〜86−4のいずれを選択するかを指定する4ma_oe_regビットおよび8ma_oe_regビットを含む。   The SIO control register 101 sets a data_len bit for specifying the SIO data transfer bit length, a sclk_sel bit for setting the serial clock frequency, a sio_en_reg bit for instructing the start of data transfer, and a mode for detecting an input delay of received data. In addition to the adjust_reg bit, 4ma_oe_reg bit and 8ma_oe_reg bit for designating which of 4 mAIO 85-1 to 85-4 and 8 mAIO 86-1 to 86-4 are selected are included.

CPU60が4ma_oe_regビットに“1”を設定したときに、SIO制御部81から出力される4MA_OE信号によって4mAIO85−1〜85−4が選択され、それぞれSDATA_OUT信号、SCLK信号、ADJUST信号およびSLOAD信号を駆動する。   When the CPU 60 sets the 4ma_oe_reg bit to “1”, the 4MAIO 85-1 to 85-4 are selected by the 4MA_OE signal output from the SIO control unit 81, and the SDATA_OUT signal, the SCLK signal, the ADJUST signal, and the SLOAD signal are driven, respectively. To do.

また、CPU60が8ma_oe_regビットに“1”を設定したときに、SIO制御部81から出力される8MA_OE信号によって8mAIO86−1〜86−4が選択され、それぞれSDATA_OUT信号、SCLK信号、ADJUST信号およびSLOAD信号を駆動する。   Further, when the CPU 60 sets “1” in the 8ma_oe_reg bit, the 8MAIO 86-1 to 86-4 are selected by the 8MA_OE signal output from the SIO control unit 81, and the SDATA_OUT signal, the SCLK signal, the ADJUST signal, and the SLOAD signal, respectively. Drive.

データ受信制御部84は、受信制御シーケンサ51と、データラッチトリガ回路52と、データラッチ回路54と、シリアル・パラレル変換回路55と、入力遅延検出回路91とを含む。   The data reception control unit 84 includes a reception control sequencer 51, a data latch trigger circuit 52, a data latch circuit 54, a serial / parallel conversion circuit 55, and an input delay detection circuit 91.

入力遅延検出回路91は、受信データの入力遅延を検出するときに、想定している入力遅延時間よりもさらにSDATA_IN信号が一定時間変化しないか否かを検出する。このSDATA_IN信号が変化しない一定時間が、CPU60によってdrv_dataレジスタ102に設定され、入力遅延検出回路91にdrv_data信号として与えられる。   When detecting the input delay of the received data, the input delay detection circuit 91 detects whether or not the SDATA_IN signal does not change for a certain time further than the assumed input delay time. A certain time during which the SDATA_IN signal does not change is set in the drv_data register 102 by the CPU 60 and is given to the input delay detection circuit 91 as the drv_data signal.

また、入力遅延検出回路91は、想定している入力遅延時間よりもさらにSDATA_IN信号が一定時間変化しないこと、すなわち、入力遅延の計測値がdrv_dataとして設定された値と等しいことを検出したときに、drv_int信号によってSIO制御部81に通知する。SIO制御部81は、その情報をdrv_intレジスタ103に格納する。drv_intレジスタ103に格納された情報は、CPU60によって適宜読み出される。   Further, the input delay detection circuit 91 detects that the SDATA_IN signal does not change for a certain time further than the assumed input delay time, that is, the input delay measurement value is equal to the value set as drv_data. The SIO control unit 81 is notified by the drv_int signal. The SIO control unit 81 stores the information in the drv_int register 103. Information stored in the drv_int register 103 is appropriately read out by the CPU 60.

CPU60は、drv_intレジスタの内容を読出し、想定している入力遅延時間よりもさらにSDATA_IN信号が一定時間変化しないことを確認した場合、SIO制御レジスタ101の8ma_oe_regビットに“1”を設定して、4mAIOから8mAIOにI/O出力バッファを切り替える。   When the CPU 60 reads the contents of the drv_int register and confirms that the SDATA_IN signal does not change for a certain time further than the expected input delay time, the CPU 60 sets the 8ma_oe_reg bit of the SIO control register 101 to “1” and sets 4 mAIO. Switch the I / O output buffer from 1 to 8 mAIO.

図17は、本発明の第2の実施の形態における入力遅延検出回路91の内部構成を説明するためのブロック図である。この入力遅延検出回路91は、遅延時間計測回路110と、データ不一致検出回路62と、FF1(63)およびFF2(64)とを含む。また、遅延時間計測回路110は、計測制御シーケンサ114と、ドライブ切替え検出回路115と、遅延時間計測カウンタ116とを含む。なお、図10に示す第1の実施の形態における入力遅延検出回路53と同様の構成および機能を有する部分については、同じ参照番号を付すものとする。   FIG. 17 is a block diagram for explaining the internal configuration of the input delay detection circuit 91 according to the second embodiment of the present invention. The input delay detection circuit 91 includes a delay time measurement circuit 110, a data mismatch detection circuit 62, and FF1 (63) and FF2 (64). The delay time measurement circuit 110 includes a measurement control sequencer 114, a drive switching detection circuit 115, and a delay time measurement counter 116. Parts having the same configuration and function as those of the input delay detection circuit 53 in the first embodiment shown in FIG. 10 are denoted by the same reference numerals.

計測制御シーケンサ114は、ADJUST信号が“H”レベルとなって受信データ入力遅延検出モードであることを確認し、SIO制御部81からのSLOAD信号がアサートされると、check_start信号をアサートしてデータ不一致検出回路62にデータ不一致の検出開始を指示する。   The measurement control sequencer 114 confirms that the ADJUST signal becomes “H” level and is in the received data input delay detection mode. When the SLOAD signal from the SIO control unit 81 is asserted, the measurement control sequencer 114 asserts the check_start signal to The mismatch detection circuit 62 is instructed to start data mismatch detection.

そして、計測制御シーケンサ114は、シリアルクロック制御部30からのrx_clk信号の立ち上がりエッジを検出すると、遅延時間計測カウンタ116に対してカウント開始を指示する。遅延時間計測カウンタ116は、カウント値をドライブ切替え検出回路115に出力する。   When the measurement control sequencer 114 detects the rising edge of the rx_clk signal from the serial clock control unit 30, the measurement control sequencer 114 instructs the delay time measurement counter 116 to start counting. The delay time measurement counter 116 outputs the count value to the drive switching detection circuit 115.

ドライブ切替え検出回路115は、drv_dataの値と遅延時間計測カウンタ116から出力されるカウント値とを比較し、一致したときにSIO制御部81に対してdrv_int信号を出力する。   The drive switching detection circuit 115 compares the value of drv_data with the count value output from the delay time measurement counter 116, and outputs a drv_int signal to the SIO control unit 81 when they match.

また、drv_dataの値と遅延時間計測カウンタ116から出力されるカウント値とが一致する前に、データ不一致検出回路62がデータ不一致を検出した場合は、ドライブ切替え検出回路115からdrv_int信号は出力されない。   Also, if the data mismatch detection circuit 62 detects a data mismatch before the value of drv_data matches the count value output from the delay time measurement counter 116, the drive switching detection circuit 115 does not output the drv_int signal.

計測制御シーケンサ114は、データ不一致検出回路62からデータ不一致を検出したことを示すno_match信号を受けるか、ドライブ切替え検出回路115がdrv_int信号に“H”レベルのパルスを出力すると、遅延時間計測カウンタ116にカウントの停止を指示し、check_start信号をネゲートしてデータ不一致検出回路62にデータ不一致の検出終了を指示する。   When the measurement control sequencer 114 receives a no_match signal indicating that a data mismatch has been detected from the data mismatch detection circuit 62 or when the drive switching detection circuit 115 outputs an “H” level pulse to the drv_int signal, the delay time measurement counter 116. To stop counting, negate the check_start signal, and instruct the data mismatch detection circuit 62 to end detection of data mismatch.

図18は、図17に示す入力遅延検出回路91のドライブ切替え検出動作を説明するためのタイミングチャートである。図18においては、drv_dataレジスタ102に“6”が設定され、I/O出力バッファとして4mAIOセルブロックが選択されている場合を示している。   FIG. 18 is a timing chart for explaining the drive switching detection operation of the input delay detection circuit 91 shown in FIG. FIG. 18 shows a case where “6” is set in the drv_data register 102 and the 4 mAIO cell block is selected as the I / O output buffer.

T1において、計測制御シーケンサ114は、データ転送開始時にSIO制御部81から出力されるSLOAD信号が“L”レベルになるのを検出すると、ADJUST信号の“H”レベルによって受信データ入力遅延検出モードであることを確認し、受信データの入力遅延検出を開始する。   In T1, when the measurement control sequencer 114 detects that the SLOAD signal output from the SIO control unit 81 becomes “L” level at the start of data transfer, the measurement control sequencer 114 is in the received data input delay detection mode based on the “H” level of the ADJUST signal. Confirm that there is, start detection of received data input delay.

計測制御シーケンサ114は、check_start信号をアサートし、データ不一致検出回路62に対してデータ不一致の検出開始を指示すると共に、遅延時間計測カウンタ116に対してカウンタの初期化を指示する。T3において、遅延時間計測カウンタ116は、カウント値を“0”に初期化する。   The measurement control sequencer 114 asserts the check_start signal, instructs the data mismatch detection circuit 62 to start data mismatch detection, and instructs the delay time measurement counter 116 to initialize the counter. At T3, the delay time measurement counter 116 initializes the count value to “0”.

T4およびT5において、計測制御シーケンサ114は、rx_clk信号が“L”レベルから“H”レベルに変化するのを検出すると、遅延時間計測カウンタ116にカウント動作を開始させる。   At T4 and T5, when the measurement control sequencer 114 detects that the rx_clk signal changes from the “L” level to the “H” level, the measurement control sequencer 114 causes the delay time measurement counter 116 to start the counting operation.

T6において、no_match信号が“L”レベルのままであり、遅延時間計測カウンタ116のカウント値がdrv_dataの値と一致する。T7において、ドライブ切替え検出回路115は、SIO制御部81に対してdrv_int信号に“H”レベルを出力する。   At T6, the no_match signal remains at the “L” level, and the count value of the delay time measurement counter 116 matches the value of drv_data. At T 7, the drive switching detection circuit 115 outputs “H” level to the drv_int signal to the SIO control unit 81.

T8において、計測制御シーケンサ114は、drv_int信号が“H”レベルになったのを検出して、check_start信号をネゲートして、データ不一致検出回路62にデータ不一致の検出終了を指示する。   At T8, the measurement control sequencer 114 detects that the drv_int signal has become “H” level, negates the check_start signal, and instructs the data mismatch detection circuit 62 to end detection of data mismatch.

図19は、図17に示す計測制御シーケンサ114の処理手順を説明するためのフローチャートである。まず、計測制御シーケンサ114は、SIO制御部81から出力されるADJUST信号が“1”であり、かつSLOAD信号が“0”であるか否かを判定する(S41)。ADJUST信号が“0”であるか、SLOAD信号が“1”であれば(S41,No)、ステップS41の処理を繰り返す。   FIG. 19 is a flowchart for explaining the processing procedure of the measurement control sequencer 114 shown in FIG. First, the measurement control sequencer 114 determines whether the ADJUST signal output from the SIO control unit 81 is “1” and the SLOAD signal is “0” (S41). If the ADJUST signal is “0” or the SLOAD signal is “1” (S41, No), the process of step S41 is repeated.

ADJUST信号が“1”であり、かつSLOAD信号が“0”であれば(S41,Yes)、check_start信号を“1”にし、遅延時間計測カウンタ116を“0”に初期化する(S42)。   If the ADJUST signal is “1” and the SLOAD signal is “0” (S41, Yes), the check_start signal is set to “1” and the delay time measurement counter 116 is initialized to “0” (S42).

次に、計測制御シーケンサ114は、シリアルクロック制御部30から出力されるrx_clk信号が“0”であるか否かを判定する(S43)。rx_clk信号が“1”であれば(S43,No)、ステップS43の処理を繰り返す。また、rx_clk信号が“0”であれば(S43,Yes)、rx_clk信号が“1”になるまで待機する(S44)。   Next, the measurement control sequencer 114 determines whether or not the rx_clk signal output from the serial clock control unit 30 is “0” (S43). If the rx_clk signal is “1” (S43, No), the process of step S43 is repeated. If the rx_clk signal is “0” (S43, Yes), the process waits until the rx_clk signal becomes “1” (S44).

rx_clk信号が“1”になると(S44,Yes)、遅延時間計測カウンタ116に対してカウント開始を指示する(S45)。これと並行して、ドライブ切替え検出回路115は、ドライブ切替え検出動作を開始し、遅延時間計測カウンタ116のカウント値がdrv_dataの値と等しいか否かを判定する(S51)。等しい場合には(S51,Yes)、drv_int信号に“H”レベルのパルスを出力する(S52)。   When the rx_clk signal becomes “1” (S44, Yes), the delay time measurement counter 116 is instructed to start counting (S45). In parallel with this, the drive switching detection circuit 115 starts a drive switching detection operation, and determines whether or not the count value of the delay time measurement counter 116 is equal to the value of drv_data (S51). If equal (S51, Yes), an "H" level pulse is output to the drv_int signal (S52).

計測制御シーケンサ114は、データ不一致検出回路62から出力されるno_match信号が“1”であるか、またはdrv_int信号に“1”が出力されているかを判定する(S46)。   The measurement control sequencer 114 determines whether the no_match signal output from the data mismatch detection circuit 62 is “1” or “1” is output as the drv_int signal (S46).

計測制御シーケンサ114は、no_match信号が“1”であるか、drv_int信号が“1”であれば(S46,Yes)、遅延時間計測カウンタ116に対してカウント停止を指示し、データ不一致検出回路62に対してcheck_start信号に“0”を出力する(S47)。そして、ステップS41に戻って、以降の処理を繰り返す。   If the no_match signal is “1” or the drv_int signal is “1” (S46, Yes), the measurement control sequencer 114 instructs the delay time measurement counter 116 to stop counting and the data mismatch detection circuit 62. In response to this, "0" is output to the check_start signal (S47). Then, the process returns to step S41, and the subsequent processing is repeated.

以上説明したように、本実施の形態におけるInitiator1によれば、ドライブ切替え検出回路115が想定している入力遅延時間よりもさらにSDATA_IN信号が一定時間変化しないことを検出したときにdrv_int信号を出力し、その内容がSIO制御部81内のdrv_intレジスタ103に格納される。そして、CPU60がdrv_intレジスタ103の内容を読み出してI/O出力バッファを切り替えるようにしたので、第1の実施の形態において説明した効果に加えて、SIO通信エラーやデータ転送性能の悪化を防止することが可能となった。   As described above, according to the initiator 1 in the present embodiment, the drv_int signal is output when it is detected that the SDATA_IN signal does not change for a certain time further than the input delay time assumed by the drive switching detection circuit 115. The contents are stored in the drv_int register 103 in the SIO control unit 81. Since the CPU 60 reads the contents of the drv_int register 103 and switches the I / O output buffer, in addition to the effects described in the first embodiment, SIO communication errors and deterioration of data transfer performance are prevented. It became possible.

(第3の実施の形態)
本発明の第3の実施の形態におけるInitiatorは、第2の実施の形態におけるInitiatorと同様に、SDATA_IN信号が一定時間変化しないことを検出するものであるが、その状態をシリアル通信状態異常としてCPUに通知するものである。
(Third embodiment)
The Initiator in the third embodiment of the present invention detects that the SDATA_IN signal does not change for a certain period of time as in the Initiator in the second embodiment. To notify.

図20は、本発明の第3の実施の形態におけるInitiatorのSIOブロックの詳細を説明するための図である。なお、このSIOブロック10”が、CPUバス70を介してCPU60と接続される点においは、図7に示すInitiator1の構成と同様である。また、図7および図9に示す第1の実施の形態におけるSIOブロック10と同様の構成および機能を有する部分については、同じ参照番号を付すものとする。   FIG. 20 is a diagram for explaining details of the SIO block of the initiator according to the third embodiment of this invention. The SIO block 10 ″ is connected to the CPU 60 via the CPU bus 70 in the same manner as the configuration of the Initiator 1 shown in FIG. 7. Also, the first embodiment shown in FIGS. Parts having the same configuration and function as the SIO block 10 in the embodiment are given the same reference numerals.

SIOブロック10”は、SIO制御部120と、シリアルクロック制御部30と、データ受信制御部122とを含む。   The SIO block 10 ″ includes a SIO control unit 120, a serial clock control unit 30, and a data reception control unit 122.

SIO制御部120は、SDATA_IN信号が変化しない一定時間を設定するためのerr_dataレジスタ123と、SDATA_IN信号が一定時間変化しない場合にシリアル通信異常として設定されるerr_intレジスタ124とを含む。   The SIO control unit 120 includes an err_data register 123 for setting a certain time during which the SDATA_IN signal does not change, and an err_int register 124 that is set as a serial communication abnormality when the SDATA_IN signal does not change for a certain time.

データ受信制御部122は、受信制御シーケンサ51と、データラッチトリガ回路52と、データラッチ回路54と、シリアル・パラレル変換回路55と、入力遅延検出回路131とを含む。   The data reception control unit 122 includes a reception control sequencer 51, a data latch trigger circuit 52, a data latch circuit 54, a serial / parallel conversion circuit 55, and an input delay detection circuit 131.

入力遅延検出回路131は、受信データの入力遅延を検出するときに、想定している入力遅延時間よりもさらにSDATA_IN信号が一定時間変化しないか否かを検出する。このSDATA_IN信号が変化しない一定時間が、CPU60によってerr_dataレジスタ123に設定され、入力遅延検出回路131にerr_data信号として与えられる。   When detecting the input delay of the received data, the input delay detection circuit 131 detects whether or not the SDATA_IN signal does not change for a certain time further than the assumed input delay time. A certain time during which the SDATA_IN signal does not change is set in the err_data register 123 by the CPU 60 and is given to the input delay detection circuit 131 as the err_data signal.

また、入力遅延検出回路131は、想定している入力遅延時間よりもさらにSDATA_IN信号が一定時間変化しないこと、すなわち、入力遅延の計測値がerr_dataとして設定された値と等しいことを検出したときに、err_int信号によってSIO制御部120に通知する。SIO制御部120は、その情報をerr_intレジスタ124に格納する。err_intレジスタ124に格納された情報は、CPU60によって適宜読み出される。   Further, when the input delay detection circuit 131 detects that the SDATA_IN signal does not change for a certain time further than the assumed input delay time, that is, the input delay measurement value is equal to the value set as err_data. The SIO control unit 120 is notified by the err_int signal. The SIO control unit 120 stores the information in the err_int register 124. Information stored in the err_int register 124 is appropriately read out by the CPU 60.

CPU60は、err_intレジスタ124の内容を読出し、想定している入力遅延時間よりもさらにSDATA_IN信号が一定時間変化しないことを確認した場合、シリアル通信異常が発生していると判断する。   When the CPU 60 reads the contents of the err_int register 124 and confirms that the SDATA_IN signal does not change for a certain period of time beyond the expected input delay time, it determines that a serial communication error has occurred.

図21は、本発明の第3の実施の形態における入力遅延検出回路131の内部構成を説明するためのブロック図である。この入力遅延検出回路131は、遅延時間計測回路141と、データ不一致検出回路62と、FF1(63)およびFF2(64)とを含む。また、遅延時間計測回路141は、計測制御シーケンサ151と、シリアル通信エラー検出回路152と、遅延時間計測カウンタ153とを含む。なお、図10に示す第1の実施の形態における入力遅延検出回路53と同様の構成および機能を有する部分については、同じ参照番号を付すものとする。   FIG. 21 is a block diagram for explaining the internal configuration of the input delay detection circuit 131 according to the third embodiment of the present invention. The input delay detection circuit 131 includes a delay time measurement circuit 141, a data mismatch detection circuit 62, and FF1 (63) and FF2 (64). The delay time measurement circuit 141 includes a measurement control sequencer 151, a serial communication error detection circuit 152, and a delay time measurement counter 153. Parts having the same configuration and function as those of the input delay detection circuit 53 in the first embodiment shown in FIG. 10 are denoted by the same reference numerals.

計測制御シーケンサ151は、ADJUST信号が“H”レベルとなって受信データ入力遅延検出モードであることを確認し、SIO制御部120からのSLOAD信号がアサートされると、check_start信号をアサートしてデータ不一致検出回路62にデータ不一致の検出開始を指示する。   The measurement control sequencer 151 confirms that the ADJUST signal becomes “H” level and is in the received data input delay detection mode, and when the SLOAD signal from the SIO control unit 120 is asserted, the check_start signal is asserted and the data The mismatch detection circuit 62 is instructed to start data mismatch detection.

そして、計測制御シーケンサ151は、シリアルクロック制御部30からのrx_clk信号の立ち上がりエッジを検出すると、遅延時間計測カウンタ153に対してカウント開始を指示する。遅延時間計測カウンタ153は、カウント値をシリアル通信エラー検出回路152に出力する。   When the measurement control sequencer 151 detects the rising edge of the rx_clk signal from the serial clock control unit 30, the measurement control sequencer 151 instructs the delay time measurement counter 153 to start counting. The delay time measurement counter 153 outputs the count value to the serial communication error detection circuit 152.

シリアル通信エラー検出回路152は、err_dataの値と遅延時間計測カウンタ153から出力されるカウント値とを比較し、一致したときにSIO制御部120に対してerr_int信号を出力する。   The serial communication error detection circuit 152 compares the value of err_data with the count value output from the delay time measurement counter 153, and outputs an err_int signal to the SIO control unit 120 when they match.

また、err_dataの値と遅延時間計測カウンタ153から出力されるカウント値とが一致する前に、データ不一致検出回路62がデータ不一致を検出した場合は、シリアル通信エラー検出回路152からerr_int信号は出力されない。   Also, if the data mismatch detection circuit 62 detects a data mismatch before the value of err_data matches the count value output from the delay time measurement counter 153, the err_int signal is not output from the serial communication error detection circuit 152. .

計測制御シーケンサ151は、データ不一致検出回路62からデータ不一致を検出したことを示すno_match信号を受けるか、シリアル通信エラー検出回路152がerr_int信号に“H”レベルのパルスを出力すると、遅延時間計測カウンタ153にカウントの停止を指示し、check_start信号をネゲートしてデータ不一致検出回路62にデータ不一致の検出終了を指示する。   When the measurement control sequencer 151 receives a no_match signal indicating that a data mismatch has been detected from the data mismatch detection circuit 62 or when the serial communication error detection circuit 152 outputs an “H” level pulse to the err_int signal, the measurement control sequencer 151 Instruct 153 to stop counting, negate the check_start signal, and instruct the data mismatch detection circuit 62 to end detection of data mismatch.

図22は、図21に示す入力遅延検出回路131のシリアル通信エラー検出動作を説明するためのタイミングチャートである。図22においては、err_dataレジスタ123に“14”が設定されている場合を示している。   FIG. 22 is a timing chart for explaining the serial communication error detection operation of the input delay detection circuit 131 shown in FIG. FIG. 22 shows a case where “14” is set in the err_data register 123.

T1において、計測制御シーケンサ151は、データ転送開始時にSIO制御部120から出力されるSLOAD信号が“L”レベルになるのを検出すると、ADJUST信号の“H”レベルによって受信データ入力遅延検出モードであることを確認し、受信データの入力遅延検出を開始する。   In T1, when the measurement control sequencer 151 detects that the SLOAD signal output from the SIO control unit 120 becomes “L” level at the start of data transfer, the measurement control sequencer 151 is in the received data input delay detection mode according to the “H” level of the ADJUST signal. Confirm that there is, start detection of received data input delay.

計測制御シーケンサ151は、check_start信号をアサートし、データ不一致検出回路62に対してデータ不一致の検出開始を指示すると共に、遅延時間計測カウンタ153に対してカウンタの初期化を指示する。T3において、遅延時間計測カウンタ153は、カウント値を“0”に初期化する。   The measurement control sequencer 151 asserts the check_start signal, instructs the data mismatch detection circuit 62 to start data mismatch detection, and instructs the delay time measurement counter 153 to initialize the counter. At T3, the delay time measurement counter 153 initializes the count value to “0”.

T4およびT5において、計測制御シーケンサ151は、rx_clk信号が“L”レベルから“H”レベルに変化するのを検出すると、遅延時間計測カウンタ153にカウント動作を開始させる。   At T4 and T5, the measurement control sequencer 151 causes the delay time measurement counter 153 to start the count operation when detecting that the rx_clk signal changes from the “L” level to the “H” level.

T6において、no_match信号が“L”レベルのままであり、遅延時間計測カウンタ153のカウント値がerr_dataの値と一致する。T7において、シリアル通信エラー検出回路152は、SIO制御部120に対してerr_int信号に“H”レベルを出力する。   At T6, the no_match signal remains at the “L” level, and the count value of the delay time measurement counter 153 matches the value of err_data. At T 7, the serial communication error detection circuit 152 outputs “H” level to the err_int signal to the SIO control unit 120.

T8において、計測制御シーケンサ151は、err_int信号が“H”レベルになったのを検出して、check_start信号をネゲートして、データ不一致検出回路62にデータ不一致の検出終了を指示する。   At T8, the measurement control sequencer 151 detects that the err_int signal has become “H” level, negates the check_start signal, and instructs the data mismatch detection circuit 62 to end detection of data mismatch.

図23は、図21に示す計測制御シーケンサ151の処理手順を説明するためのフローチャートである。まず、計測制御シーケンサ151は、SIO制御部120から出力されるADJUST信号が“1”であり、かつSLOAD信号が“0”であるか否かを判定する(S61)。ADJUST信号が“0”であるか、SLOAD信号が“1”であれば(S61,No)、ステップS61の処理を繰り返す。   FIG. 23 is a flowchart for explaining the processing procedure of the measurement control sequencer 151 shown in FIG. First, the measurement control sequencer 151 determines whether the ADJUST signal output from the SIO control unit 120 is “1” and the SLOAD signal is “0” (S61). If the ADJUST signal is “0” or the SLOAD signal is “1” (S61, No), the process of step S61 is repeated.

ADJUST信号が“1”であり、かつSLOAD信号が“0”であれば(S61,Yes)、check_start信号を“1”にし、遅延時間計測カウンタ153を“0”に初期化する(S62)。   If the ADJUST signal is “1” and the SLOAD signal is “0” (S61, Yes), the check_start signal is set to “1” and the delay time measurement counter 153 is initialized to “0” (S62).

次に、計測制御シーケンサ151は、シリアルクロック制御部30から出力されるrx_clk信号が“0”であるか否かを判定する(S63)。rx_clk信号が“1”であれば(S63,No)、ステップS63の処理を繰り返す。また、rx_clk信号が“0”であれば(S63,Yes)、rx_clk信号が“1”になるまで待機する(S64)。   Next, the measurement control sequencer 151 determines whether or not the rx_clk signal output from the serial clock control unit 30 is “0” (S63). If the rx_clk signal is “1” (S63, No), the process of step S63 is repeated. If the rx_clk signal is “0” (S63, Yes), the process waits until the rx_clk signal becomes “1” (S64).

rx_clk信号が“1”になると(S64,Yes)、遅延時間計測カウンタ153に対してカウント開始を指示する(S65)。これと並行して、シリアル通信エラー検出回路152は、シリアル通信エラー検出動作を開始し、遅延時間計測カウンタ153のカウント値がerr_dataの値と等しいか否かを判定する(S71)。等しい場合には(S71,Yes)、err_int信号に“H”レベルのパルスを出力する(S72)。   When the rx_clk signal becomes “1” (S64, Yes), the delay time measurement counter 153 is instructed to start counting (S65). In parallel with this, the serial communication error detection circuit 152 starts a serial communication error detection operation, and determines whether or not the count value of the delay time measurement counter 153 is equal to the value of err_data (S71). If equal (S71, Yes), an "H" level pulse is output to the err_int signal (S72).

計測制御シーケンサ151は、データ不一致検出回路62から出力されるno_match信号が“1”であるか、またはerr_int信号に“1”が出力されているかを判定する(S66)。   The measurement control sequencer 151 determines whether the no_match signal output from the data mismatch detection circuit 62 is “1” or whether “1” is output as the err_int signal (S66).

計測制御シーケンサ151は、no_match信号が“1”であるか、err_int信号が“1”であれば(S66,Yes)、遅延時間計測カウンタ153に対してカウント停止を指示し、データ不一致検出回路62に対してcheck_start信号に“0”を出力する(S67)。そして、ステップS61に戻って、以降の処理を繰り返す。   If the no_match signal is “1” or the err_int signal is “1” (S 66, Yes), the measurement control sequencer 151 instructs the delay time measurement counter 153 to stop counting, and the data mismatch detection circuit 62. In response to this, “0” is output to the check_start signal (S67). Then, the process returns to step S61 and the subsequent processing is repeated.

以上説明したように、本実施の形態におけるInitiator1によれば、シリアル通信エラー検出回路152が想定している入力遅延時間よりもさらにSDATA_IN信号が一定時間変化しないことを検出したときにerr_int信号を出力し、その内容がSIO制御部120内のerr_intレジスタ124に格納される。そして、CPU60がerr_intレジスタ124の内容を読み出すようにしたので、第1の実施の形態において説明した効果に加えて、CPU60がシリアル通信エラーの発生の有無を容易に判定することが可能となった。   As described above, according to the initiator 1 in the present embodiment, the err_int signal is output when it is detected that the SDATA_IN signal does not change for a certain time further than the input delay time assumed by the serial communication error detection circuit 152. The contents are stored in the err_int register 124 in the SIO control unit 120. Since the CPU 60 reads the contents of the err_int register 124, in addition to the effects described in the first embodiment, the CPU 60 can easily determine whether or not a serial communication error has occurred. .

今回開示された実施の形態は、すべての点で例示であって制限的なものではないと考えられるべきである。本発明の範囲は上記した説明ではなくて特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。   The embodiment disclosed this time should be considered as illustrative in all points and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.

1,300 Initiator、2,400 Target、10,10’,10”,310 SIOブロック、20,81,120,320 SIO制御部、21,321 SIO送受信制御部、22 レジスタ群、23 CPUバスI/F、24,101,324 SIO制御レジスタ、25 input_delayレジスタ、26 adj_delayレジスタ、27 latch_cycレジスタ、30,330 シリアルクロック制御部、40,340 データ送信制御部、50,84,122,350 データ受信制御部、51 受信制御シーケンサ、52 データラッチトリガ回路、53 入力遅延検出回路、54 データラッチ回路、55 シリアル・パラレル変換回路、56 受信データビットカウンタ、57 遅延調整回路、60,360 CPU、61,110 遅延時間計測回路、62 データ不一致検出回路、63,64 フリップフロップ、65,114,151 計測制御シーケンサ、66,116,153 遅延時間計測カウンタ、70,370 CPUバス、71 データラッチトリガ制御シーケンサ、72 data_en調整カウンタ、73 data_en周期カウンタ、85−1〜85−4 4mAIO、86−1〜86−4 8mAIO、91,131 入力遅延検出回路、102 drv_dataレジスタ、103 drv_intレジスタ、115 ドライブ切替え検出回路、123 err_dataレジスタ、124 err_intレジスタ、152 シリアル通信エラー検出回路、201 送信データ回路、202 データ出力回路、325 送信データレジスタ、326 受信データレジスタ。   1,300 Initiator, 2,400 Target, 10, 10 ′, 10 ″, 310 SIO block, 20, 81, 120, 320 SIO control unit, 21,321 SIO transmission / reception control unit, 22 register group, 23 CPU bus I / F, 24, 101, 324 SIO control register, 25 input_delay register, 26 adj_delay register, 27 latch_cyc register, 30, 330 Serial clock control unit, 40, 340 Data transmission control unit, 50, 84, 122, 350 Data reception control unit , 51 reception control sequencer, 52 data latch trigger circuit, 53 input delay detection circuit, 54 data latch circuit, 55 serial / parallel conversion circuit, 56 reception data bit counter, 57 delay adjustment circuit, 60 360 CPU, 61, 110 delay time measurement circuit, 62 data mismatch detection circuit, 63, 64 flip-flop, 65, 114, 151 measurement control sequencer, 66, 116, 153 delay time measurement counter, 70, 370 CPU bus, 71 data Latch trigger control sequencer, 72 data_en adjustment counter, 73 data_en period counter, 85-1 to 85-4 4 mAIO, 86-1 to 86-4 8 mAIO, 91, 131 input delay detection circuit, 102 drv_data register, 103 drv_int register, 115 Drive switching detection circuit, 123 err_data register, 124 err_int register, 152 serial communication error detection circuit, 201 transmission data circuit, 202 data output circuit, 325 transmission Receive data register, 326 Receive data register.

Claims (7)

クロックに同期してシリアルデータを送受信するイニシエータとターゲットとを含んだ通信装置であって、
前記イニシエータは、前記ターゲットに対してシリアルデータの入力遅延検出モードであることを示す信号を出力する制御手段と、
前記ターゲットから出力されるシリアルデータの入力遅延値を検出する入力遅延検出手段と、
前記入力遅延検出手段によって検出された入力遅延値に基づいて、前記ターゲットから出力されるシリアルデータのラッチタイミングを調整する遅延調整手段とを含み、
前記ターゲットは、前記制御手段からシリアルデータの入力遅延検出モードであることを示す信号を受けたときに、入力遅延値検出用のシリアルデータを出力するデータ出力手段を含む、通信装置。
A communication device including an initiator and a target that transmit and receive serial data in synchronization with a clock,
The initiator outputs a signal indicating a serial data input delay detection mode to the target;
Input delay detection means for detecting an input delay value of serial data output from the target;
Delay adjusting means for adjusting the latch timing of serial data output from the target based on the input delay value detected by the input delay detecting means,
The communication device includes a data output unit that outputs serial data for detecting an input delay value when the target receives a signal indicating that it is in a serial data input delay detection mode from the control unit.
前記シリアルクロックは、サンプルクロックの整数倍の周波数を有するクロック信号であり、
前記入力遅延検出手段は、前記ターゲットから出力されるシリアルデータを前記サンプルクロックでサンプリングする第1のフリップフロップと、
前記第1のフリップフロップから出力される信号をさらに前記サンプルクロックでサンプリングする第2のフリップフロップと、
前記第1のフリップフロップから出力される信号と、前記第2のフリップフロップから出力される信号との不一致を検出するデータ不一致検出回路と、
前記データ不一致検出回路によってデータ不一致が検出された時間を計測して前記入力遅延値とする遅延時間計測回路とを含む、請求項1記載の通信装置。
The serial clock is a clock signal having a frequency that is an integer multiple of the sample clock;
The input delay detection means includes a first flip-flop that samples serial data output from the target with the sample clock;
A second flip-flop for further sampling the signal output from the first flip-flop with the sample clock;
A data mismatch detection circuit for detecting a mismatch between a signal output from the first flip-flop and a signal output from the second flip-flop;
The communication apparatus according to claim 1, further comprising: a delay time measuring circuit that measures a time when the data mismatch is detected by the data mismatch detection circuit and sets the input delay value as the time.
前記制御手段は、前記入力遅延検出手段によって検出された入力遅延値を格納する第1のレジスタを含み、
前記通信装置はさらに、前記第1のレジスタに格納された入力遅延値を読み出して、前記遅延調整手段を制御するプロセッサを含む、請求項1または2記載の通信装置。
The control means includes a first register for storing an input delay value detected by the input delay detection means,
The communication apparatus according to claim 1, further comprising a processor that reads the input delay value stored in the first register and controls the delay adjusting unit.
前記制御手段はさらに、前記シリアルデータをラッチするタイミング信号を前記サンプルクロックの何クロック分遅らすかを設定する第2のレジスタと、
前記シリアルデータをラッチするタイミング信号の周期を前記サンプルクロックの何クロックとするかを設定する第3のレジスタとを含み、
前記遅延調整手段は、前記プロセッサによって設定された前記第2のレジスタおよび第3のレジスタの値に応じて前記タイミング信号を生成する、請求項3記載の通信装置。
The control means further includes a second register for setting how many clocks of the sample clock a timing signal for latching the serial data is delayed,
A third register for setting how many clocks of the sample clock the timing signal for latching the serial data is,
The communication apparatus according to claim 3, wherein the delay adjusting unit generates the timing signal according to values of the second register and the third register set by the processor.
前記通信装置はさらに、駆動能力が異なる複数の出力回路を含み、
前記制御手段はさらに、想定される入力遅延値よりも大きな値が前記プロセッサによって設定される第4のレジスタを含み、
前記制御手段は、前記入力遅延検出手段によって検出された入力遅延値が前記第4のレジスタに設定された値と等しくなったときに、前記複数の出力手段を切り替えて駆動能力が高い出力手段によって前記シリアルクロックを駆動させる、請求項4記載の通信装置。
The communication device further includes a plurality of output circuits having different driving capabilities,
The control means further includes a fourth register in which a value larger than an assumed input delay value is set by the processor;
When the input delay value detected by the input delay detection means becomes equal to the value set in the fourth register, the control means switches the plurality of output means and outputs the high drive capability. The communication apparatus according to claim 4, wherein the serial clock is driven.
前記制御手段はさらに、前記前記入力遅延検出手段によって検出された入力遅延値が前記第4のレジスタに設定された値と等しくなったときに設定される第5のレジスタと、
前記複数の出力手段の切替えを制御する第6のレジスタとを含み、
前記プロセッサは、前記第5のレジスタが設定されたのを検出して、前記第6のレジスタに値を設定して前記複数の出力手段を切り替える、請求項5記載の通信装置。
The control means further includes a fifth register set when an input delay value detected by the input delay detection means becomes equal to a value set in the fourth register;
A sixth register for controlling switching of the plurality of output means,
The communication device according to claim 5, wherein the processor detects that the fifth register is set, sets a value in the sixth register, and switches the plurality of output units.
前記制御手段はさらに、想定される入力遅延値よりも大きな値が前記プロセッサによって設定される第4のレジスタと、
前記入力遅延検出手段によって検出された入力遅延値が前記第4のレジスタに設定された値と等しくなったときに、通信エラーが発生したことを前記プロセッサに通知するための情報が設定される第5のレジスタとを含む、請求項4記載の通信装置。
The control means further includes a fourth register in which a value larger than an assumed input delay value is set by the processor;
Information for notifying the processor that a communication error has occurred is set when the input delay value detected by the input delay detection means becomes equal to the value set in the fourth register. 5. The communication device according to claim 4, comprising 5 registers.
JP2009153557A 2009-06-29 2009-06-29 Communication apparatus Withdrawn JP2011010178A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009153557A JP2011010178A (en) 2009-06-29 2009-06-29 Communication apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009153557A JP2011010178A (en) 2009-06-29 2009-06-29 Communication apparatus

Publications (1)

Publication Number Publication Date
JP2011010178A true JP2011010178A (en) 2011-01-13

Family

ID=43566291

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009153557A Withdrawn JP2011010178A (en) 2009-06-29 2009-06-29 Communication apparatus

Country Status (1)

Country Link
JP (1) JP2011010178A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018196047A (en) * 2017-05-19 2018-12-06 株式会社富士通ゼネラル Communication system
CN113204507A (en) * 2021-04-25 2021-08-03 山东英信计算机技术有限公司 Universal input/output data transmission method, device, equipment and medium
JP2021128414A (en) * 2020-02-12 2021-09-02 三菱電機株式会社 Master device, slave device, and serial transmission system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018196047A (en) * 2017-05-19 2018-12-06 株式会社富士通ゼネラル Communication system
JP2021128414A (en) * 2020-02-12 2021-09-02 三菱電機株式会社 Master device, slave device, and serial transmission system
JP7149974B2 (en) 2020-02-12 2022-10-07 三菱電機株式会社 Master device, slave device and serial transmission system
CN113204507A (en) * 2021-04-25 2021-08-03 山东英信计算机技术有限公司 Universal input/output data transmission method, device, equipment and medium

Similar Documents

Publication Publication Date Title
JP5175728B2 (en) Test apparatus, adjustment method, and adjustment program
TWI723006B (en) High speed data transfer using calibrated, single-clock source synchronous serializer-deserializer protocol
KR102328014B1 (en) Device including single wire interface and data processing system having the same
US8422619B2 (en) Clock frequency divider circuit, clock distribution circuit, clock frequency division method, and clock distribution method
US20120294401A1 (en) Method of calibrating signal skews in mipi and related transmission system
US20080143402A1 (en) Digital pulse-width control apparatus
US7705687B1 (en) Digital ring oscillator
US8856578B2 (en) Integrated circuit device including skew adjustment circuit and skew adjustment method
KR20160147967A (en) Duty cycle based timing margining for i/o ac timing
US7893740B2 (en) Data signal generating apparatus
KR20160042496A (en) Duty cycle error detection device and duty cycle correction device having the same
JP4948421B2 (en) Test apparatus, adjustment apparatus, adjustment method, and adjustment program
US20080175343A1 (en) Phase adjusting function evaluating method, transmission margin measuring method, information processing apparatus, program and computer readable information recording medium
JP2011010178A (en) Communication apparatus
US9354274B2 (en) Circuit test system electric element memory control chip under different test modes
JP2011061350A (en) Receiving apparatus and receiving method thereof
CN113252958A (en) Digital oscilloscope and automatic calibration method for delay difference between channels thereof
US20130246831A1 (en) Selection device, selection method and information processing device
CN108664066B (en) Chip and voltage adjusting method thereof
JP2016063430A (en) Transmitter/receiver circuit, integrated circuit and test method
US7802124B2 (en) Microcode configurable frequency clock
JP2008219813A (en) Lvds receiver, lvds receiving method, lvds data transmission system, and semiconductor device
US20100033189A1 (en) Semiconductor integrated circuit and test method using the same
CN116938352A (en) Chip, bit error rate testing method and electronic equipment
JP5274648B2 (en) Test apparatus, calibration method, and program

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20120904