Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP6499602B2 - AD conversion result reading circuit - Google Patents
[go: Go Back, main page]

JP6499602B2 - AD conversion result reading circuit - Google Patents

AD conversion result reading circuit Download PDF

Info

Publication number
JP6499602B2
JP6499602B2 JP2016040667A JP2016040667A JP6499602B2 JP 6499602 B2 JP6499602 B2 JP 6499602B2 JP 2016040667 A JP2016040667 A JP 2016040667A JP 2016040667 A JP2016040667 A JP 2016040667A JP 6499602 B2 JP6499602 B2 JP 6499602B2
Authority
JP
Japan
Prior art keywords
conversion result
register
identification data
conversion
converter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2016040667A
Other languages
Japanese (ja)
Other versions
JP2017157060A (en
Inventor
英毅 栗林
英毅 栗林
平山 博文
博文 平山
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Azbil Corp
Original Assignee
Azbil Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Azbil Corp filed Critical Azbil Corp
Priority to JP2016040667A priority Critical patent/JP6499602B2/en
Priority to CN201780014289.4A priority patent/CN108780385B/en
Priority to KR1020187024599A priority patent/KR102035768B1/en
Priority to PCT/JP2017/007642 priority patent/WO2017150491A1/en
Publication of JP2017157060A publication Critical patent/JP2017157060A/en
Application granted granted Critical
Publication of JP6499602B2 publication Critical patent/JP6499602B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/05Digital input using the sampling of an analogue quantity at regular intervals of time, input from a/d converter or output to d/a converter
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/76Architectures of general purpose stored program computers
    • G06F15/78Architectures of general purpose stored program computers comprising a single central processing unit

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Transfer Systems (AREA)
  • Microcomputers (AREA)
  • Analogue/Digital Conversion (AREA)

Description

本発明は、AD変換器からAD変換結果を読み出すAD変換結果読出回路に関するものである。   The present invention relates to an AD conversion result reading circuit for reading an AD conversion result from an AD converter.

従来の一般的なΔΣ型AD変換器において、CPU(Central Processing Unit)などからSPI(Serial Peripheral Interface)にてAD変換結果を読み出す際、変換状態を示すDRDY信号を監視し、DRDY信号の立ち下がり検出後、次の変換完了までの期間にAD変換結果を読み出すようにSPIマスターを設計しなければならない仕様となっている(非特許文献1、非特許文献2参照)。   In a conventional general ΔΣ type AD converter, when an AD conversion result is read from a CPU (Central Processing Unit) or the like by an SPI (Serial Peripheral Interface), the DRDY signal indicating the conversion state is monitored, and the falling of the DRDY signal is detected. The specification is that the SPI master must be designed so that the AD conversion result is read out after detection until the next conversion is completed (see Non-Patent Document 1 and Non-Patent Document 2).

このような制約があるのは、もしもDRDY信号の立ち下がりを検出してからSPIマスターの変換結果読み出しのタイミングが他の処理の要因で遅れてしまい、次のAD変換結果の更新とSPIマスターからの読み出しがぶつかってしまうと、読み出したAD変換結果が不定値になるためである。さらに破壊されて不定値となったことを判定・確認する方法がAD変換器に用意されていないため、AD変換結果を読み出す際は絶対にタイミングの遅れが許されず、CPUの設計者は極めて厳密な時間管理を行わなければならなかった。   There is such a restriction because if the falling edge of the DRDY signal is detected, the timing of reading the conversion result of the SPI master is delayed due to other processing factors, and the next update of the AD conversion result and the SPI master This is because the read AD conversion result becomes an indeterminate value if the reading of the data is collided. Furthermore, since there is no method for determining / confirming that the value has been destroyed and an indeterminate value is provided in the AD converter, there is absolutely no delay in timing when reading the AD conversion result, and the CPU designer is extremely strict. Time management had to be done.

“温度センサ向け24ビット A/Dコンバータ ADS1248”,日本テキサス・インスツルメンツ株式会社,2011年,<http://www.tij.co.jp/jp/lit/ds/symlink/ads1248.pdf>“24-bit A / D converter ADS1248 for temperature sensors”, Texas Instruments Japan, 2011, <http://www.tij.co.jp/jp/lit/ds/symlink/ads1248.pdf> “20μsセトリング、250kSPSの24ビットΣ−Δ ADC AD7176−2”,アナログ・デバイセズ株式会社,2012年,<http://www.analog.com/media/jp/technical-documentation/data-sheets/AD7176-2_jp.pdf>“20 μs settling, 250 kSPS 24-bit Σ-Δ ADC AD7176-2”, Analog Devices, Inc., 2012, <http://www.analog.com/media/jp/technical-documentation/data-sheets/AD7176 -2_en.pdf>

以上のように、従来は、AD変換結果を読み出すSPIマスターを設計しようとする設計者は、極めて厳密な時間管理を行わなければならず、タイミング設計の負担が大きいため、余裕のある処理能力を持ったCPUを選択せざるを得なかった。   As described above, conventionally, a designer who wants to design an SPI master that reads out the AD conversion result has to perform extremely strict time management, and the burden of timing design is large. I had to select my CPU.

本発明は、上記課題を解決するためになされたもので、設計者のタイミング設計の負担を軽減し、CPUの要求性能を緩和することができるAD変換結果読出回路を提供することを目的とする。   The present invention has been made to solve the above-described problems, and an object of the present invention is to provide an AD conversion result reading circuit that can reduce a designer's timing design burden and can reduce the required performance of a CPU. .

本発明のAD変換結果読出回路は、AD変換器のAD変換結果の送信先となる外部装置からのコマンドの上位ビットを受け取って読み出しコマンドと判定したときに検出信号を有効とし、前記外部装置からのコマンドを全て受け取って読み出しコマンドと確定したときに送信許可信号を有効とする検出回路と、前記外部装置のクロックと同期した前記検出信号に応じて、前記AD変換器のクロックと同期した内部レジスタ値変更禁止信号を出力するクロック載せ換え回路と、前記AD変換器からのデータ準備完了信号が有効であり、かつ前記内部レジスタ値変更禁止信号が無効であるときに、前記AD変換器のAD変換結果を取り込む第1のAD変換結果用レジスタと、前記送信許可信号が有効であるときに、前記第1のAD変換結果用レジスタからAD変換結果を読み出して前記外部装置へ送信するデータ送信回路とを備えることを特徴とするものである。   The AD conversion result reading circuit of the present invention makes the detection signal valid when it receives a high-order bit of a command from an external device that is a transmission destination of the AD conversion result of the AD converter and determines that it is a read command. A detection circuit that validates the transmission permission signal when all the commands are received and confirmed as a read command, and an internal register synchronized with the clock of the AD converter in accordance with the detection signal synchronized with the clock of the external device AD conversion of the AD converter when the clock change circuit for outputting the value change prohibition signal and the data preparation completion signal from the AD converter are valid and the internal register value change prohibition signal is invalid A first AD conversion result register for fetching a result and the first AD conversion result register when the transmission permission signal is valid; It is characterized in further comprising a data transmitting circuit for transmitting read the AD conversion result to the external device from the data.

また、本発明のAD変換結果読出回路の1構成例は、さらに、前記AD変換器からのデータ準備完了信号が有効であり、かつ前記内部レジスタ値変更禁止信号が有効であるときに、前記AD変換器のAD変換結果を取り込む第2のAD変換結果用レジスタを備え、前記第1のAD変換結果用レジスタは、前記内部レジスタ値変更禁止信号が無効になったときに、前記第2のAD変換結果用レジスタの出力を取り込むことを特徴とするものである。
また、本発明のAD変換結果読出回路の1構成例は、さらに、前記AD変換器からのデータ準備完了信号が有効であり、かつ前記内部レジスタ値変更禁止信号が無効であるときに、前記AD変換結果に対応付けられた識別データを前記AD変換器から取り込む第1の識別データ用レジスタを備え、前記データ送信回路は、前記送信許可信号が有効であるときに、前記第1のAD変換結果用レジスタからAD変換結果を読み出して前記外部装置へ送信すると共に、前記第1の識別データ用レジスタから識別データを読み出して前記外部装置へ送信することを特徴とするものである。
また、本発明のAD変換結果読出回路の1構成例は、さらに、前記AD変換器からのデータ準備完了信号が有効であり、かつ前記内部レジスタ値変更禁止信号が有効であるときに、前記識別データを取り込む第2の識別データ用レジスタを備え、前記第1の識別データ用レジスタは、前記内部レジスタ値変更禁止信号が無効になったときに、前記第2の識別データ用レジスタの出力を取り込むことを特徴とするものである。
Further, according to one configuration example of the AD conversion result reading circuit of the present invention, when the data preparation completion signal from the AD converter is valid and the internal register value change prohibiting signal is valid, A second AD conversion result register for fetching an AD conversion result of the converter; and the first AD conversion result register is configured to store the second AD conversion result signal when the internal register value change prohibition signal becomes invalid. The output of the conversion result register is fetched.
Further, in one configuration example of the AD conversion result reading circuit of the present invention, when the data preparation completion signal from the AD converter is valid and the internal register value change prohibition signal is invalid, A first identification data register for fetching identification data associated with a conversion result from the AD converter; and the data transmission circuit includes the first AD conversion result when the transmission permission signal is valid. The AD conversion result is read from the register for use and transmitted to the external device, and the identification data is read from the first register for identification data and transmitted to the external device.
The AD conversion result read circuit according to the present invention further includes a configuration example in which when the data preparation completion signal from the AD converter is valid and the internal register value change prohibition signal is valid, the identification A second identification data register for fetching data; and the first identification data register fetches an output of the second identification data register when the internal register value change prohibition signal becomes invalid. It is characterized by this.

また、本発明のAD変換結果読出回路の1構成例において、前記検出回路は、前記検出信号を有効とした後に、前記外部装置からのコマンドを全て受け取って読み出しコマンドでないと判定したときに、前記検出信号を無効とすることを特徴とするものである。
また、本発明のAD変換結果読出回路の1構成例において、前記識別データは、前記AD変換器によるAD変換処理の実行回数を示すデータである。
また、本発明のAD変換結果読出回路の1構成例において、前記識別データは、前記AD変換器によってAD変換処理が実行された時刻を示すデータである。
また、本発明のAD変換結果読出回路の1構成例において、前記識別データは、前記AD変換器によってAD変換処理が実行される毎に論理レベルが反転する1ビットのデータである。
また、本発明のAD変換結果読出回路の1構成例において、前記識別データは、フリーランカウンタのカウント値に基づくデータである。
In one configuration example of the AD conversion result read circuit according to the present invention, when the detection circuit receives all commands from the external device and determines that the command is not a read command after enabling the detection signal, The detection signal is invalidated.
In one configuration example of the AD conversion result reading circuit according to the present invention, the identification data is data indicating the number of executions of AD conversion processing by the AD converter.
In one configuration example of the AD conversion result reading circuit according to the present invention, the identification data is data indicating a time when AD conversion processing is executed by the AD converter.
In one configuration example of the AD conversion result reading circuit of the present invention, the identification data is 1-bit data whose logic level is inverted every time AD conversion processing is executed by the AD converter.
In one configuration example of the AD conversion result reading circuit of the present invention, the identification data is data based on a count value of a free-run counter.

本発明によれば、検出回路とクロック載せ換え回路と第1のAD変換結果用レジスタとデータ送信回路とを設けることにより、外部装置に対して特別な制約を与えることなくAD変換結果を外部装置に送信することが可能となり、設計者のタイミング設計の負担を軽減することができ、外部装置(CPU)の要求性能を緩和することができる。また、本発明では、AD変換結果が不定値になることを防ぐことができ、AD変換器のクロックの周波数を上げることなくAD変換結果を保護することが可能となる。   According to the present invention, by providing the detection circuit, the clock transfer circuit, the first AD conversion result register, and the data transmission circuit, the AD conversion result can be transferred to the external device without giving any special restriction to the external device. It is possible to reduce the burden on the timing design of the designer, and the required performance of the external device (CPU) can be relaxed. Further, according to the present invention, the AD conversion result can be prevented from becoming an indefinite value, and the AD conversion result can be protected without increasing the frequency of the clock of the AD converter.

また、本発明では、第2のAD変換結果用レジスタを設けることにより、AD変換結果の取りこぼしの発生を回避することができる。   Also, in the present invention, by providing the second AD conversion result register, it is possible to avoid occurrence of missing AD conversion results.

また、本発明では、第1の識別データ用レジスタを設け、データ送信回路が検出回路からの送信許可信号が有効であるときに、第1の識別データ用レジスタから識別データを読み出して外部装置へ送信することにより、AD変換結果の重複取得やAD変換結果の取りこぼしの有無を外部装置側で判断することが可能となる。   In the present invention, the first identification data register is provided, and when the data transmission circuit has a valid transmission permission signal from the detection circuit, the identification data is read from the first identification data register and sent to the external device. By transmitting, it is possible for the external device side to determine whether or not the AD conversion results are redundantly acquired and whether or not the AD conversion results are missed.

また、本発明では、第2の識別データ用レジスタを設けることにより、識別データの取りこぼしの発生を回避することができる。   Further, in the present invention, by providing the second identification data register, it is possible to avoid occurrence of missing identification data.

本発明の第1の実施の形態に係るAD変換結果読出回路の構成を示すブロック図である。1 is a block diagram showing a configuration of an AD conversion result read circuit according to a first embodiment of the present invention. 本発明の第1の実施の形態に係るAD変換結果読出回路のREAD検出回路の動作を説明するフローチャートである。5 is a flowchart for explaining the operation of the READ detection circuit of the AD conversion result reading circuit according to the first embodiment of the present invention. 本発明の第1の実施の形態に係るAD変換結果読出回路の各部の動作を説明するタイミングチャートである。5 is a timing chart for explaining the operation of each part of the AD conversion result read circuit according to the first embodiment of the present invention. 本発明の第1の実施の形態に係るAD変換結果読出回路のクロック載せ換え回路の構成例を示すブロック図である。It is a block diagram which shows the structural example of the clock transfer circuit of the AD conversion result reading circuit which concerns on the 1st Embodiment of this invention. メタステーブル状態を防ぐためのタイミング関係を説明するタイミングチャートである。It is a timing chart explaining the timing relationship for preventing a metastable state. メタステーブル状態を防ぐためのタイミング関係を説明するタイミングチャートである。It is a timing chart explaining the timing relationship for preventing a metastable state. 従来のAD変換結果読出回路においてAD変換器側のクロックの周波数を高くした場合の動作を示すタイミングチャートである。10 is a timing chart showing an operation when the clock frequency on the AD converter side is increased in the conventional AD conversion result reading circuit. 本発明の第2の実施の形態に係るAD変換結果読出回路の各部の動作を説明するタイミングチャートである。6 is a timing chart for explaining the operation of each part of the AD conversion result read circuit according to the second embodiment of the present invention. 本発明の第3の実施の形態に係るAD変換結果読出回路の構成を示すブロック図である。It is a block diagram which shows the structure of the AD conversion result read-out circuit based on the 3rd Embodiment of this invention.

[第1の実施の形態]
以下、本発明の実施の形態について図面を参照して説明する。図1は本発明の第1の実施の形態に係るAD変換結果読出回路の構成を示すブロック図である。本実施の形態のAD変換結果読出回路は、AD変換器(以下、ADC)1のAD変換結果を一時的に格納するAD変換結果用レジスタ2,3と、外部装置であるSPIマスター7からのコマンドの上位ビットを受け取って読み出しコマンドと判定したときに検出信号を有効とし、SPIマスター7からのコマンドを全て受け取って読み出しコマンドと確定したときに送信許可信号を有効とするREAD検出回路4と、SPIマスター7のクロックと同期した検出信号に応じて、ADC1のクロックと同期した内部レジスタ値変更禁止信号を出力するクロック載せ換え回路5と、送信許可信号が有効であるときに、AD変換結果用レジスタ2からAD変換結果を読み出してSPIマスター7へ送信するデータ送信回路6とから構成される。
[First Embodiment]
Hereinafter, embodiments of the present invention will be described with reference to the drawings. FIG. 1 is a block diagram showing a configuration of an AD conversion result reading circuit according to the first embodiment of the present invention. The AD conversion result reading circuit of the present embodiment includes AD conversion result registers 2 and 3 for temporarily storing the AD conversion result of the AD converter (hereinafter referred to as ADC) 1 and an SPI master 7 which is an external device. A READ detection circuit 4 that validates a detection signal when receiving a high-order bit of a command and determines that the command is a read command, and validates a transmission permission signal when all commands from the SPI master 7 are received and confirmed as a read command; In response to a detection signal synchronized with the clock of the SPI master 7, a clock transfer circuit 5 that outputs an internal register value change prohibition signal synchronized with the clock of the ADC 1, and an AD conversion result when the transmission permission signal is valid It comprises a data transmission circuit 6 that reads the AD conversion result from the register 2 and transmits it to the SPI master 7.

本発明において、AD変換結果用レジスタを2つ設けることは必須の構成要件ではない。そこで、まず最初に、AD変換結果用レジスタ2のみを使う場合のAD変換結果読出回路の動作を図2、図3を用いて説明する。図2はREAD検出回路4の動作を説明するフローチャート、図3はAD変換結果読出回路の各部の動作を説明するタイミングチャートである。   In the present invention, providing two AD conversion result registers is not an essential component. First, the operation of the AD conversion result reading circuit when only the AD conversion result register 2 is used will be described with reference to FIGS. FIG. 2 is a flowchart for explaining the operation of the READ detection circuit 4. FIG. 3 is a timing chart for explaining the operation of each part of the AD conversion result reading circuit.

本実施の形態では、ADC1のクロックをCLK_REG、SPIマスター7のクロックをSCLKとする。図1に示したAD変換結果読出回路の構成のうち、AD変換結果用レジスタ2,3とクロック載せ換え回路5とはCLK_REGに同期して動作し、READ検出回路4とクロック載せ換え回路5とデータ送信回路6とはSCLKに同期して動作する。   In this embodiment, the clock of ADC 1 is CLK_REG, and the clock of SPI master 7 is SCLK. In the configuration of the AD conversion result readout circuit shown in FIG. 1, the AD conversion result registers 2 and 3 and the clock transfer circuit 5 operate in synchronization with CLK_REG, and the READ detection circuit 4 and the clock transfer circuit 5 The data transmission circuit 6 operates in synchronization with SCLK.

図3におけるCSはチップセレクト信号、MOSI(Master Out Slave In)およびMISO(Master In Slave Out)はSPIマスター7の信号線、SCLK_INVはクロックSCLKの反転信号、READ_ACTは読み出しコマンドの検出信号、RDATA_ENはAD変換結果の送信許可信号、READ_ACT_SYNCは内部レジスタ値変更禁止信号、DRDYはADC1のデータ準備完了信号、RESULTはADC1から出力されるAD変換結果、RESULT_BUFはAD変換結果用レジスタ3に格納されたAD変換結果、RESULT_LATCHはAD変換結果用レジスタ2に格納されたAD変換結果である。   In FIG. 3, CS is a chip select signal, MOSI (Master Out Slave In) and MISO (Master In Slave Out) are signal lines of the SPI master 7, SCLK_INV is an inverted signal of the clock SCLK, READ_ACT is a detection signal of a read command, and RDATA_EN is RDATA_EN AD conversion result transmission permission signal, READ_ACT_SYNC is an internal register value change prohibition signal, DRDY is a data preparation completion signal of ADC1, RESULT is an AD conversion result output from ADC1, and RESULT_BUF is an AD conversion result stored in the AD conversion result register 3 The conversion result, RESULT_LATCH, is the AD conversion result stored in the AD conversion result register 2.

まず、CPUからなるSPIマスター7から信号線MOSIを介してコマンドが送出されると、READ検出回路4は、コマンドの上位3ビットを受け取った時点で(図2ステップS1)、このコマンドの上位3ビットがRDATA*コマンドの上位3ビット、すなわちAD変換結果の読み出しコマンドの上位3ビットと一致するかどうかを判定する(図2ステップS2)。図3の例では、C7〜C5がコマンドの上位3ビットで、時刻t1の時点で判定を行っている。上位3ビットで判定を行う理由については後述する。   First, when a command is sent from the SPI master 7 comprising the CPU via the signal line MOSI, the READ detection circuit 4 receives the upper 3 bits of the command (step S1 in FIG. 2), and the upper 3 of the command. It is determined whether the bit matches the upper 3 bits of the RDATA * command, that is, the upper 3 bits of the read command of the AD conversion result (step S2 in FIG. 2). In the example of FIG. 3, C7 to C5 are the upper 3 bits of the command, and determination is performed at time t1. The reason for performing the determination with the upper 3 bits will be described later.

READ検出回路4は、SPIマスター7からのコマンドの上位3ビットが読み出しコマンドの上位3ビットと一致する場合(ステップS2においてY)、検出信号READ_ACTを“1”(有効)に設定する(図2ステップS3)。   When the upper 3 bits of the command from the SPI master 7 match the upper 3 bits of the read command (Y in step S2), the READ detection circuit 4 sets the detection signal READ_ACT to “1” (valid) (FIG. 2). Step S3).

さらに、READ検出回路4は、SPIマスター7からコマンドの下位5ビットを受け取ると、8ビットのコマンドを全て受け取ったことになるので(図2ステップS4)、この8ビットのコマンドがRDATA*コマンド、すなわちAD変換結果の読み出しコマンドと一致するかどうかを判定する(図2ステップS5)。図3の例では、C4〜C0がコマンドの下位5ビットである。   Further, when the READ detection circuit 4 receives the lower 5 bits of the command from the SPI master 7, it means that all of the 8-bit commands have been received (step S4 in FIG. 2), so that the 8-bit command is an RDATA * command, That is, it is determined whether or not the read command of the AD conversion result matches (step S5 in FIG. 2). In the example of FIG. 3, C4 to C0 are the lower 5 bits of the command.

READ検出回路4は、SPIマスター7からの8ビットのコマンドが読み出しコマンドと一致する場合(ステップS5においてY)、検出信号READ_ACTを“1”のままとし(図2ステップS6)、送信許可信号RDATA_ENを1パルス発行する。   When the 8-bit command from the SPI master 7 matches the read command (Y in step S5), the READ detection circuit 4 keeps the detection signal READ_ACT to “1” (step S6 in FIG. 2), and the transmission enable signal RDATA_EN. 1 pulse is issued.

データ送信回路6は、送信許可信号RDATA_ENが1パルス発行されると、AD変換結果用レジスタ2からAD変換結果を8ビット分読み出して(図2ステップS7)、この8ビット分のAD変換結果を信号線MISOを介してSPIマスター7へシリアル送信する(図2ステップS8)。図3の例では、時刻t3の送信許可信号RDATA_ENに応じてD0〜D7の8ビット分のAD変換結果がSPIマスター7へ送信される。   When one pulse of the transmission enable signal RDATA_EN is issued, the data transmission circuit 6 reads the AD conversion result for 8 bits from the AD conversion result register 2 (step S7 in FIG. 2), and the AD conversion result for 8 bits is obtained. Serial transmission is performed to the SPI master 7 via the signal line MISO (step S8 in FIG. 2). In the example of FIG. 3, the AD conversion result for 8 bits D0 to D7 is transmitted to the SPI master 7 in response to the transmission permission signal RDATA_EN at time t3.

次に、READ検出回路4は、コマンドに対応した数のデータの送信が完了したかどうかを判定し(図2ステップS9)、送信し終えていない場合には(ステップS9においてN)、ステップS7に戻って送信許可信号RDATA_ENを再び1パルス発行し、データ送信回路6は、AD変換結果用レジスタ2からAD変換結果を8ビット分読み出してSPIマスター7へシリアル送信する(ステップS8)。図3の例では、時刻t4の送信許可信号RDATA_ENに応じてD8〜D15の8ビット分のAD変換結果がSPIマスター7へ送信される。   Next, the READ detection circuit 4 determines whether or not the transmission of the number of data corresponding to the command has been completed (step S9 in FIG. 2). If the transmission has not been completed (N in step S9), step S7 is performed. , The transmission permission signal RDATA_EN is issued again by one pulse, and the data transmission circuit 6 reads the AD conversion result for 8 bits from the AD conversion result register 2 and serially transmits it to the SPI master 7 (step S8). In the example of FIG. 3, the AD conversion result for 8 bits D8 to D15 is transmitted to the SPI master 7 in response to the transmission permission signal RDATA_EN at time t4.

こうして、コマンドに対応した数のデータの送信が完了するまでステップS7,S8の処理が繰り返し実行される。本実施の形態では、SPIマスター7からの読み出しコマンドに応じて送るAD変換結果を24ビットとする。したがって、送信許可信号RDATA_ENが3回発行され、D0〜D23の24ビットのデータを送信し終えた時点でステップS9が判定Yとなる(時刻t5)。   Thus, the processes in steps S7 and S8 are repeatedly executed until the transmission of the number of data corresponding to the command is completed. In this embodiment, the AD conversion result sent in response to the read command from the SPI master 7 is 24 bits. Accordingly, when the transmission permission signal RDATA_EN is issued three times and the transmission of the 24-bit data D0 to D23 is completed, step S9 becomes a determination Y (time t5).

READ検出回路4は、データの送信が完了すると、検出信号READ_ACTを“0”(無効)にする(図2ステップS10)。
なお、READ検出回路4は、SPIマスター7からの8ビットのコマンドが読み出しコマンドと一致しなかった場合にも(図2ステップS5においてN)、検出信号READ_ACTを“0”にする。つまり、ステップS2の判定においてSPIマスター7からのコマンドの上位3ビットが読み出しコマンドの上位3ビットと一致したとしても、判定を誤っている可能性がある。そこで、ステップS5において8ビットのコマンドを全て解析した結果、SPIマスター7からのコマンドが読み出しコマンドでなかった場合には、検出信号READ_ACTを“0”にして、ステップS2,S3で下した判定結果を取り消す。
When the data transmission is completed, the READ detection circuit 4 sets the detection signal READ_ACT to “0” (invalid) (step S10 in FIG. 2).
The READ detection circuit 4 sets the detection signal READ_ACT to “0” even when the 8-bit command from the SPI master 7 does not match the read command (N in step S5 in FIG. 2). That is, even if the upper 3 bits of the command from the SPI master 7 coincide with the upper 3 bits of the read command in the determination in step S2, there is a possibility that the determination is incorrect. Therefore, if the command from the SPI master 7 is not a read command as a result of analyzing all 8-bit commands in step S5, the detection signal READ_ACT is set to “0” and the determination result obtained in steps S2 and S3. Cancel.

次に、ADC1のクロックCLK_REGに同期して動作する構成について説明する。AD変換結果用レジスタ2は、ADC1から出力されるデータ準備完了信号DRDYが“1”(無効)から“0”(有効)に立ち下がり、ADC1のデータ準備が完了したことが通知されると、このときの内部レジスタ値変更禁止信号READ_ACT_SYNCが“0”(無効)で、読み出しコマンドが検出されていないことを示しているため、ADC1からのAD変換結果RESULTを取り込む。上記のとおり、AD変換結果RESULTは24ビットである。こうして、AD変換結果用レジスタ2の出力RESULT_LATCHが更新される。図3の例では、RESULT_LATCHが、古い変換結果を示す“OLD”から、新たに取り込んだ変換結果を示す“NEW”へと更新されることが分かる。   Next, a configuration that operates in synchronization with the clock CLK_REG of the ADC 1 will be described. When the data preparation completion signal DRDY output from the ADC 1 falls from “1” (invalid) to “0” (valid), the AD conversion result register 2 is notified that the data preparation of the ADC 1 is completed. Since the internal register value change prohibition signal READ_ACT_SYNC at this time is “0” (invalid), indicating that a read command is not detected, the AD conversion result RESULT from the ADC 1 is fetched. As described above, the AD conversion result RESULT is 24 bits. Thus, the output RESULT_LATCH of the AD conversion result register 2 is updated. In the example of FIG. 3, it can be seen that RESULT_LATCH is updated from “OLD” indicating the old conversion result to “NEW” indicating the newly acquired conversion result.

次に、クロック載せ換え回路5は、READ検出回路4から出力される検出信号READ_ACTに応じて、クロックCLK_REGと同期した内部レジスタ値変更禁止信号READ_ACT_SYNCを生成する。図4はクロック載せ換え回路5の構成例を示すブロック図である。クロック載せ換え回路5は、2つのフリップフロップ50,51によって構成される。   Next, the clock transfer circuit 5 generates an internal register value change prohibiting signal READ_ACT_SYNC synchronized with the clock CLK_REG in accordance with the detection signal READ_ACT output from the READ detection circuit 4. FIG. 4 is a block diagram showing a configuration example of the clock transfer circuit 5. The clock transfer circuit 5 includes two flip-flops 50 and 51.

このように、1ビットの信号に対するクロック載せ換え処理は、受信側のクロックで2段受けする手法がよく用いられる。このような手法を用いた場合、内部レジスタ値変更禁止信号READ_ACT_SYNCは、検出信号READ_ACTに対して最大でCLK_REGの周期の2倍の時間遅れることになる。図3の例では、時刻t1で検出信号READ_ACTが“1”(有効)になった後に時刻t2で内部レジスタ値変更禁止信号READ_ACT_SYNCが“1”(有効)になる。また、時刻t5で検出信号READ_ACTが“0”(無効)になった後に時刻t6で内部レジスタ値変更禁止信号READ_ACT_SYNCが“0”(無効)になる。この時刻t1とt2の時間差および時刻t5とt6の時間差が、図4のクロック載せ換え回路5による遅れである。   As described above, a method of receiving two stages with the clock on the receiving side is often used for the clock transposing process for a 1-bit signal. When such a method is used, the internal register value change prohibition signal READ_ACT_SYNC is delayed by a maximum of twice the period of CLK_REG with respect to the detection signal READ_ACT. In the example of FIG. 3, after the detection signal READ_ACT becomes “1” (valid) at time t1, the internal register value change prohibition signal READ_ACT_SYNC becomes “1” (valid) at time t2. Further, after the detection signal READ_ACT becomes “0” (invalid) at time t5, the internal register value change prohibition signal READ_ACT_SYNC becomes “0” (invalid) at time t6. The time difference between the times t1 and t2 and the time difference between the times t5 and t6 are delays due to the clock changing circuit 5 in FIG.

SPIマスター7がADC1の変換周期を考慮せずに変換結果読み出しを行なった場合、正しいデータを読み出せないことがある。データが破壊されてしまう理由としては、SPIマスター7のクロックSCLKとADC1のクロックCLK_REGの関係は非同期であり、異なるクロック間でデータの受け渡しを行う際に偶然この2つのクロックの立ち上がりエッジが近づいてしまうと、フリップフロップのセットアップ/ホールドタイミングが満たせなくなるためである。この現象はメタステーブルと呼ばれている。メタステーブルについては、例えば文献「“コラム:非同期クロックと検証手法−2”,株式会社アルティマ,<http://www.altima.jp/products/software/mentor/fv/column/cdc-2.html>」で説明されている。   If the SPI master 7 reads out the conversion result without considering the conversion cycle of the ADC 1, correct data may not be read out. The reason why the data is destroyed is that the relationship between the clock SCLK of the SPI master 7 and the clock CLK_REG of the ADC 1 is asynchronous, and when the data is transferred between different clocks, the rising edges of the two clocks happen to approach each other. This is because the setup / hold timing of the flip-flop cannot be satisfied. This phenomenon is called metastable. As for metastable, for example, the document “Column: Asynchronous Clock and Verification Method-2”, Altima Co., Ltd., <http://www.altima.jp/products/software/mentor/fv/column/cdc-2.html > ”.

図5、図6はこのメタステーブル状態を防ぐためのタイミング関係を説明するタイミングチャートであり、図5はクロック載せ換え時間が短くなる場合(検出信号READ_ACTの立ち上がり直後にクロックCLK_REGが立ち上がる場合)を示し、図6はクロック載せ換え時間が長くなる場合(クロックCLK_REGの立ち上がり直後に検出信号READ_ACTが立ち上がる場合)を示している。   FIGS. 5 and 6 are timing charts for explaining the timing relationship for preventing the metastable state. FIG. 5 shows a case where the clock transfer time is short (when the clock CLK_REG rises immediately after the rise of the detection signal READ_ACT). FIG. 6 shows a case where the clock transfer time becomes long (when the detection signal READ_ACT rises immediately after the rise of the clock CLK_REG).

メタステーブル状態を防ぐためには、SPIマスター7へのAD変換結果の送信タイミングよりも前に内部レジスタ値変更禁止信号READ_ACT_SYNCを”1”(有効)とし、AD変換結果の送信中にレジスタ値が変化しないように制御する必要があるので、図5、図6においてT1>T2としなければならない。T1は検出信号READ_ACTが“1”になってから送信許可信号RDATA_ENが“1”(有効)になるまでの時間、T2はクロック載せ換えに要する時間である。   In order to prevent the metastable state, the internal register value change prohibition signal READ_ACT_SYNC is set to “1” (valid) before the transmission timing of the AD conversion result to the SPI master 7, and the register value changes during transmission of the AD conversion result. Therefore, T1> T2 must be satisfied in FIGS. 5 and 6. T1 is a time from when the detection signal READ_ACT becomes “1” until the transmission permission signal RDATA_EN becomes “1” (valid), and T2 is a time required for clock switching.

つまり、検出信号READ_ACTの判定実施サイクルをNとすると、次の式(1)が成り立つようなタイミングで検出信号READ_ACTの判定を行う必要がある。
SCLKの周期×(8−N)>CLK_REGの周期×2 ・・・(1)
ここで、コマンドは8ビットなのでNの最大値は8である。
In other words, when the determination execution cycle of the detection signal READ_ACT is N, it is necessary to determine the detection signal READ_ACT at a timing that satisfies the following expression (1).
SCLK cycle × (8−N)> CLK_REG cycle × 2 (1)
Here, since the command is 8 bits, the maximum value of N is 8.

SPIマスター7のクロックSCLKとADC1のクロックCLK_REGの周波数の関係が例えば、SCLK:CLK_REG=1:10であれば、SPIマスター7からのコマンド(8ビット)を全て受け付け後に検出信号READ_ACTの判定を行ったとしても、SPIマスター7に対して特別な制約を与えることなくAD変換結果をSPIマスター7に対して送信することが可能である。   If the relationship between the frequency of the clock SCLK of the SPI master 7 and the clock CLK_REG of the ADC 1 is, for example, SCLK: CLK_REG = 1: 10, the detection signal READ_ACT is determined after receiving all commands (8 bits) from the SPI master 7. Even so, the AD conversion result can be transmitted to the SPI master 7 without giving any special restriction to the SPI master 7.

図7は従来のAD変換結果読出回路においてクロックCLK_REGの周波数を十分に高くした場合の動作を示している。この図7の例では、C7〜C0の8ビットのコマンドを全て読んだ後で検出信号READ_ACTを”1”にしている。このように、クロックCLK_REGを十分に速くすれば、検出信号READ_ACTを先読みで“1”にする必要がなくなる。ただし、クロックCLK_REGが高速になるため、消費電力が増大するという問題がある。   FIG. 7 shows the operation when the frequency of the clock CLK_REG is sufficiently increased in the conventional AD conversion result reading circuit. In the example of FIG. 7, the detection signal READ_ACT is set to “1” after all the 8-bit commands C7 to C0 are read. In this way, if the clock CLK_REG is made sufficiently fast, the detection signal READ_ACT need not be set to “1” by prefetching. However, since the clock CLK_REG becomes high speed, there is a problem that power consumption increases.

一方、本実施の形態のようにSCLKとCLK_REGの周波数の関係が、SCLK:CLK_REG=2:1の場合、クロック載せ換えに要する時間T2を考慮すると、単純にコマンド8ビット全てを受け取ってから検出信号READ_ACTの判定を行っていては変換結果送信タイミングに間に合わない。そこで、本実施の形態では、8ビットのコマンド全てを受け取る前に先行して検出信号READ_ACTの判定を行っている。本実施の形態のようにクロックSCLKの最大周波数がクロックCLK_REGの周波数の2倍であるとすると、式(1)よりN<4が成り立つことが必要となる。したがって、本実施の形態では、N=3とした。以上が、図2のステップS2においてコマンドの上位3ビットで判定を行う理由である。   On the other hand, when the relationship between the frequency of SCLK and CLK_REG is SCLK: CLK_REG = 2: 1 as in the present embodiment, it is detected after simply receiving all 8 bits of the command in consideration of the time T2 required for clock replacement. The determination of the signal READ_ACT is not in time for the conversion result transmission timing. Therefore, in the present embodiment, the detection signal READ_ACT is determined in advance before receiving all the 8-bit commands. Assuming that the maximum frequency of the clock SCLK is twice the frequency of the clock CLK_REG as in the present embodiment, it is necessary to satisfy N <4 from Equation (1). Therefore, in this embodiment, N = 3. The above is the reason why the determination is made with the upper 3 bits of the command in step S2 of FIG.

8ビットのコマンド全てを受け取る前に先行して検出信号READ_ACTの判定を行うことにより、送信許可信号RDATA_ENが“1”(有効)になるときは必ず内部レジスタ値変更禁止信号READ_ACT_SYNCが“1”(有効)になっているので、AD変換結果の送信タイミング(図3の例ではt3,t4)でAD変換結果用レジスタ2の出力RESULT_LATCHが変化することはない。つまり、メタステーブルは発生しない。   By determining the detection signal READ_ACT prior to receiving all 8-bit commands, the internal register value change prohibition signal READ_ACT_SYNC is always “1” when the transmission permission signal RDATA_EN becomes “1” (valid). Therefore, the output RESULT_LATCH of the AD conversion result register 2 does not change at the AD conversion result transmission timing (t3 and t4 in the example of FIG. 3). That is, no metastable occurs.

以上の構成により、本実施の形態では、SPIマスター7に対して特別な制約を与えることなくAD変換結果をSPIマスター7に送信することが可能となり、設計者のタイミング設計の負担を軽減することができ、SPIマスター7(CPU)の要求性能を緩和することができる。また、本実施の形態では、送信許可信号RDATA_ENが“1”になるタイミングでAD変換結果用レジスタ2の出力RESULT_LATCHを絶対に変化させないようにすることにより、AD変換結果が不定値になることを防ぐことができ、ADC1のクロックCLK_REGの周波数を上げることなくAD変換結果を保護することが可能となる。
なお、本実施の形態では、上位複数ビット、具体的には上位3ビットでステップS2の判定を行なっているが、これに限るものではなく、最上位ビットのみでステップS2の判定を行なう場合も有り得る。
With the above configuration, in the present embodiment, it is possible to transmit the AD conversion result to the SPI master 7 without giving any special restriction to the SPI master 7, thereby reducing the timing design burden on the designer. And the required performance of the SPI master 7 (CPU) can be relaxed. In the present embodiment, the AD conversion result becomes an indeterminate value by not changing the output RESULT_LATCH of the AD conversion result register 2 at the timing when the transmission permission signal RDATA_EN becomes “1”. It is possible to prevent the AD conversion result without increasing the frequency of the clock CLK_REG of the ADC 1.
In the present embodiment, the determination in step S2 is performed with upper multiple bits, specifically, the upper 3 bits. However, the present invention is not limited to this. It is possible.

[第2の実施の形態]
次に、本発明の第2の実施の形態について説明する。本実施の形態は、第1の実施の形態においてAD変換結果用レジスタ2に加えてAD変換結果用レジスタ3を使用するものである。本実施の形態においても、AD変換結果読出回路の構成は第1の実施の形態と同様であるので、図1の符号を用いて説明する。図8は本実施の形態のAD変換結果読出回路の各部の動作を説明するタイミングチャートである。
[Second Embodiment]
Next, a second embodiment of the present invention will be described. In this embodiment, the AD conversion result register 3 is used in addition to the AD conversion result register 2 in the first embodiment. Also in this embodiment, the configuration of the AD conversion result reading circuit is the same as that of the first embodiment, and therefore, description will be made using the reference numerals in FIG. FIG. 8 is a timing chart for explaining the operation of each part of the AD conversion result readout circuit of this embodiment.

READ検出回路4とクロック載せ換え回路5とデータ送信回路6の動作は第1の実施の形態で説明したとおりである。
第1の実施の形態で説明したとおり、AD変換結果用レジスタ2は、ADC1から出力されるデータ準備完了信号DRDYが“1”(無効)から“0”(有効)に立ち下がり、かつ内部レジスタ値変更禁止信号READ_ACT_SYNCが“0”(無効)であれば、ADC1のAD変換結果RESULTを取り込む(AD変換結果用レジスタ2の出力RESULT_LATCHが更新される)。
The operations of the READ detection circuit 4, the clock transfer circuit 5, and the data transmission circuit 6 are as described in the first embodiment.
As described in the first embodiment, the AD conversion result register 2 has an internal register in which the data preparation completion signal DRDY output from the ADC 1 falls from “1” (invalid) to “0” (valid). If the value change prohibition signal READ_ACT_SYNC is “0” (invalid), the AD conversion result RESULT of the ADC 1 is fetched (the output RESULT_LATCH of the AD conversion result register 2 is updated).

しかし、本実施の形態の例では、データ準備完了信号DRDYが“1”から“0”に立ち下がったときに、既に内部レジスタ値変更禁止信号READ_ACT_SYNCが“1”(有効)になっているため、AD変換結果用レジスタ2は、ADC1のAD変換結果RESULTを取り込むことはできない(AD変換結果用レジスタ2の出力RESULT_LATCHの更新は不可)。つまり、第1、第2の実施の形態において内部レジスタ値変更禁止信号READ_ACT_SYNCが“1”(有効)になっている区間は内部レジスタ値変更禁止区間である。   However, in the example of the present embodiment, when the data preparation completion signal DRDY falls from “1” to “0”, the internal register value change prohibition signal READ_ACT_SYNC is already “1” (valid). The AD conversion result register 2 cannot take in the AD conversion result RESULT of the ADC 1 (the output RESULT_LATCH of the AD conversion result register 2 cannot be updated). That is, in the first and second embodiments, the interval in which the internal register value change prohibition signal READ_ACT_SYNC is “1” (valid) is the internal register value change prohibition interval.

そこで、本実施の形態では、AD変換結果用レジスタ3を使用する。つまり、AD変換結果用レジスタ3は、ADC1から出力されるデータ準備完了信号DRDYが“1”(無効)から“0”(有効)に立ち下がり、かつ内部レジスタ値変更禁止信号READ_ACT_SYNCが“1”(有効)であれば、ADC1のAD変換結果RESULTを取り込む。こうして、AD変換結果用レジスタ3の出力RESULT_BUFが更新される。図8の例では、RESULT_BUFが、新たに取り込んだ変換結果を示す“NEW”へと更新されることが分かる。   Therefore, in this embodiment, the AD conversion result register 3 is used. That is, in the AD conversion result register 3, the data preparation completion signal DRDY output from the ADC 1 falls from “1” (invalid) to “0” (valid), and the internal register value change prohibition signal READ_ACT_SYNC is “1”. If (valid), the AD conversion result RESULT of the ADC 1 is taken in. Thus, the output RESULT_BUF of the AD conversion result register 3 is updated. In the example of FIG. 8, it is understood that RESULT_BUF is updated to “NEW” indicating the newly acquired conversion result.

内部レジスタ値変更禁止信号READ_ACT_SYNCが“1”(有効)から“0”(無効)になると、AD変換結果用レジスタ2は、AD変換結果用レジスタ3の出力RESULT_BUFを取り込む(時刻t7)。こうして、AD変換結果用レジスタ2の出力RESULT_LATCHが更新される。図8の例では、RESULT_LATCHが、古い変換結果を示す“OLD”から、新たに取り込んだ変換結果を示す“NEW”へと更新されることが分かる。
その他の構成は第1の実施の形態で説明したとおりである。
When the internal register value change prohibition signal READ_ACT_SYNC changes from “1” (valid) to “0” (invalid), the AD conversion result register 2 takes in the output RESULT_BUF of the AD conversion result register 3 (time t7). Thus, the output RESULT_LATCH of the AD conversion result register 2 is updated. In the example of FIG. 8, it can be seen that RESULT_LATCH is updated from “OLD” indicating the old conversion result to “NEW” indicating the newly acquired conversion result.
Other configurations are the same as those described in the first embodiment.

第1の実施の形態では、ADC1から出力されるデータ準備完了信号DRDYが“1”から“0”に立ち下がったときに、既に内部レジスタ値変更禁止信号READ_ACT_SYNCが“1”になっている状況では、AD変換結果用レジスタ2がADC1のAD変換結果を取り込むことができないので、AD変換結果の取りこぼしが発生する可能性がある。これに対して、本実施の形態では、AD変換結果用レジスタ2がAD変換結果を取り込むことができない状況では、AD変換結果用レジスタ3がAD変換結果を取り込むようになっているので、AD変換結果の取りこぼしの発生を回避することができる。   In the first embodiment, when the data preparation completion signal DRDY output from the ADC 1 falls from “1” to “0”, the internal register value change prohibition signal READ_ACT_SYNC is already “1”. Then, since the AD conversion result register 2 cannot capture the AD conversion result of the ADC 1, there is a possibility that the AD conversion result may be missed. On the other hand, in the present embodiment, in a situation where the AD conversion result register 2 cannot capture the AD conversion result, the AD conversion result register 3 captures the AD conversion result. Occurrence of the result missing can be avoided.

[第3の実施の形態]
次に、本発明の第3の実施の形態について説明する。図9は本発明の第3の実施の形態に係るAD変換結果読出回路の構成を示すブロック図であり、図1と同一の構成には同一の符号を付してある。本実施の形態のAD変換結果読出回路は、AD変換結果用レジスタ2,3と、READ検出回路4aと、クロック載せ換え回路5と、データ送信回路6aと、識別データ用レジスタ8,9とから構成される。
[Third Embodiment]
Next, a third embodiment of the present invention will be described. FIG. 9 is a block diagram showing a configuration of an AD conversion result reading circuit according to the third embodiment of the present invention. The same components as those in FIG. 1 are denoted by the same reference numerals. The AD conversion result reading circuit according to the present embodiment includes AD conversion result registers 2 and 3, a READ detection circuit 4 a, a clock transfer circuit 5, a data transmission circuit 6 a, and identification data registers 8 and 9. Composed.

本実施の形態のADC1は、AD変換結果RESULTに加えて、そのAD変換結果RESULTに対応付けられた識別データDIDを出力する。
本実施の形態のREAD検出回路4aは、AD変換結果を24ビット分送信し終えた後、例えば8ビットの識別データDIDの送信のために送信許可信号RDATA_ENを1パルス発行する(図2ステップS7)。データ送信回路6aは、送信許可信号RDATA_ENに応じて、識別データ用レジスタ8から識別データDIDを読み出してSPIマスター7へシリアル送信する(図2ステップS8)。
The ADC 1 of the present embodiment outputs identification data DID associated with the AD conversion result RESULT in addition to the AD conversion result RESULT.
The READ detection circuit 4a according to the present embodiment issues one pulse of a transmission permission signal RDATA_EN for transmitting, for example, 8-bit identification data DID after completing transmission of the AD conversion result for 24 bits (step S7 in FIG. 2). ). In response to the transmission permission signal RDATA_EN, the data transmission circuit 6a reads the identification data DID from the identification data register 8 and serially transmits it to the SPI master 7 (step S8 in FIG. 2).

こうして、本実施の形態では、24ビットのAD変換結果に加えて8ビットの識別データDID、すなわち計32ビットのデータの送信が完了するまで図2のステップS7,S8の処理を繰り返し実行することになる。図3、図8の例で言えば、D0〜D23の24ビットのデータを送信し終えた後に例えば8ビットの識別データDIDを送信することになる。READ検出回路4aのその他の動作は、第1、第2の実施の形態のREAD検出回路4と同じである。   Thus, in the present embodiment, the processes of steps S7 and S8 in FIG. 2 are repeatedly executed until transmission of 8-bit identification data DID, that is, a total of 32 bits of data, in addition to the 24-bit AD conversion result is completed. become. In the example of FIGS. 3 and 8, for example, 8-bit identification data DID is transmitted after the transmission of 24-bit data D0 to D23. Other operations of the READ detection circuit 4a are the same as those of the READ detection circuit 4 of the first and second embodiments.

次に、識別データ用レジスタ8,9の動作について説明する。識別データ用レジスタ8は、ADC1から出力されるデータ準備完了信号DRDYが“1”(無効)から“0”(有効)に立ち下がり、かつ内部レジスタ値変更禁止信号READ_ACT_SYNCが“0”(無効)であれば、ADC1から出力された識別データDIDを取り込む。こうして、識別データ用レジスタ8の出力DID_LATCHが更新される。   Next, the operation of the identification data registers 8 and 9 will be described. In the identification data register 8, the data preparation completion signal DRDY output from the ADC 1 falls from “1” (invalid) to “0” (valid), and the internal register value change prohibition signal READ_ACT_SYNC is “0” (invalid). If so, the identification data DID output from the ADC 1 is captured. Thus, the output DID_LATCH of the identification data register 8 is updated.

ただし、AD変換結果用レジスタ2と同様に、識別データ用レジスタ8は、ADC1から出力されるデータ準備完了信号DRDYが“1”から“0”に立ち下がったときに、既に内部レジスタ値変更禁止信号READ_ACT_SYNCが“1”(有効)になっている場合には、識別データDIDを取り込むことはできない。   However, like the AD conversion result register 2, the identification data register 8 is already prohibited from changing the internal register value when the data preparation completion signal DRDY output from the ADC 1 falls from "1" to "0". When the signal READ_ACT_SYNC is “1” (valid), the identification data DID cannot be captured.

一方、識別データ用レジスタ9は、ADC1から出力されるデータ準備完了信号DRDYが“1”から“0”に立ち下がり、かつ内部レジスタ値変更禁止信号READ_ACT_SYNCが“1”であれば、ADC1からの識別データDIDを取り込む。こうして、識別データ用レジスタ9の出力DID_BUFが更新される。
また、識別データ用レジスタ8は、内部レジスタ値変更禁止信号READ_ACT_SYNCが“1”から“0”になったときに、識別データ用レジスタ9の出力DID_BUFを取り込む。
On the other hand, if the data preparation completion signal DRDY output from the ADC 1 falls from “1” to “0” and the internal register value change prohibition signal READ_ACT_SYNC is “1”, the identification data register 9 outputs from the ADC 1 The identification data DID is captured. Thus, the output DID_BUF of the identification data register 9 is updated.
The identification data register 8 takes in the output DID_BUF of the identification data register 9 when the internal register value change prohibition signal READ_ACT_SYNC changes from “1” to “0”.

このように、識別データ用レジスタ8は識別データDIDについてAD変換結果用レジスタ2と同様の動作を行い、識別データ用レジスタ9はAD変換結果用レジスタ3と同様の動作を行う。   Thus, the identification data register 8 performs the same operation as the AD conversion result register 2 for the identification data DID, and the identification data register 9 performs the same operation as the AD conversion result register 3.

次に、識別データDIDについて詳細に説明する。識別データDIDの生成手法としては、例えば以下の4つを例示することができる。   Next, the identification data DID will be described in detail. Examples of the method for generating the identification data DID include the following four methods.

第1の例は、AD変換処理の実行回数に基づくデータを識別データDIDとする手法である。具体的には、ADC1内でAD変換処理の実行回数をカウントし、そのカウント値を識別データDIDとすればよい。このように、AD変換処理の実行回数を識別データDIDとして記録することにより、あるタイミングで実行されたAD変換処理によるAD変換結果とその前後のタイミングで実行されたAD変換処理によるAD変換結果とを識別することが可能となる。   The first example is a technique in which data based on the number of executions of AD conversion processing is used as identification data DID. Specifically, the number of executions of the AD conversion process may be counted in the ADC 1 and the count value may be used as the identification data DID. Thus, by recording the number of executions of the AD conversion process as the identification data DID, the AD conversion result by the AD conversion process executed at a certain timing and the AD conversion result by the AD conversion process executed at the timing before and after the AD conversion process are obtained. Can be identified.

第2の例は、AD変換処理の実行時刻に基づくデータを識別データDIDとする手法である。具体的には、ADC1は、AD変換処理の実行時刻(タイムスタンプ)を識別データDIDとすればよい。   The second example is a technique in which data based on the execution time of AD conversion processing is used as identification data DID. Specifically, the ADC 1 may set the execution time (time stamp) of the AD conversion process as the identification data DID.

AD変換処理の実行時刻を用いる具体的な手法として、例えば以下の2つを例示することができる。一つは、ADC1の内部または外部にリアルタイムクロックを設ける手法である。もう一つは、リアルタイムクロックの代わりに、例えば電源投入時を時刻0として一定周期毎にインクリメントするカウンタをADC1の内部または外部に設ける手法である。   As specific methods using the execution time of the AD conversion process, the following two examples can be exemplified. One is a method of providing a real-time clock inside or outside the ADC 1. The other is a method of providing a counter that is incremented at regular intervals, for example, at time 0 when the power is turned on, inside or outside the ADC 1 instead of the real-time clock.

上記の2つの手法のいずれによっても、あるタイミングで実行されたAD変換処理によるAD変換結果とその前後のタイミングで実行されたAD変換処理によるAD変換結果とを識別することが可能となる。更に、上述したリアルタイムクロックを用いる手法によれば、AD変換処理が実行された正確な時刻が記録できる。一方、上述したリアルタイムクロックを用いない手法によれば、回路規模の増大を抑えることができる。   With either of the two methods described above, it is possible to distinguish between an AD conversion result by an AD conversion process executed at a certain timing and an AD conversion result by an AD conversion process executed at a timing before and after that. Furthermore, according to the above-described method using the real-time clock, it is possible to record the accurate time when the AD conversion process is executed. On the other hand, according to the technique that does not use the real-time clock described above, an increase in circuit scale can be suppressed.

第3の例は、AD変換処理が実行される毎に論理レベルが反転する1ビットのデータを識別データDIDとする手法である。この手法によれば、あるタイミングで実行されたAD変換処理によるAD変換結果とその前後のタイミングで実行されたAD変換処理によるAD変換結果とを識別することが可能となる。また、識別データDIDを1ビットとするため、必要なハードウェアリソースを少なくすることができ、回路規模の増大を抑えることができる。   A third example is a technique in which 1-bit data whose logic level is inverted every time AD conversion processing is executed is used as identification data DID. According to this method, it is possible to identify an AD conversion result by an AD conversion process executed at a certain timing and an AD conversion result by an AD conversion process executed at a timing before and after the AD conversion process. Further, since the identification data DID is 1 bit, the necessary hardware resources can be reduced, and an increase in circuit scale can be suppressed.

第4の例は、フリーランカウンタのカウント値に基づくデータを識別データDIDとする手法である。例えば、8ビットのフリーランカウンタによって、AD変換処理の実行処理とは無関係に連続して入力されるパルスをカウントし、そのカウント値を識別データDIDとしても良い。これによれば、ビット幅の大きなカウンタは必要ないので、回路規模の増大を抑えることができる。なお、識別データDIDとして記憶するデータは、フリーランカウンタのカウント値(数値)そのものでなくてもよく、例えばA〜Z等のような順番のわかるアルファベット(キャラクターコード)であってもよい。   The fourth example is a technique in which data based on the count value of the free-run counter is used as identification data DID. For example, an 8-bit free-run counter may count pulses input continuously regardless of the execution process of the AD conversion process, and the count value may be used as the identification data DID. According to this, since a counter having a large bit width is not required, an increase in circuit scale can be suppressed. Note that the data stored as the identification data DID does not have to be the count value (numerical value) of the free-run counter itself, but may be an alphabet (character code) whose order is known, such as AZ.

以上、本実施の形態によれば、AD変換結果毎に識別データを付与し、AD変換結果と識別データとをセットで出力するので、AD変換結果を受信したSPIマスター7側で、取得したAD変換結果の連続性が保たれているか否かを判断することが可能となる。   As described above, according to the present embodiment, identification data is assigned to each AD conversion result, and the AD conversion result and the identification data are output as a set, so that the acquired AD AD is received on the SPI master 7 side that received the AD conversion result. It is possible to determine whether or not the continuity of the conversion result is maintained.

例えば、取得したAD変換結果に対応する識別データとその直前に取得したAD変換結果に対応する識別データとを比較することによって、同じAD変換周期のAD変換結果の重複取得やAD変換結果の取りこぼしの有無、すなわち、取得したAD変換結果の連続性が保たれているか否かを、SPIマスター7側で判断することが可能となる。   For example, by comparing the identification data corresponding to the acquired AD conversion result with the identification data corresponding to the AD conversion result acquired immediately before it, duplicate acquisition of AD conversion results in the same AD conversion cycle or missing of the AD conversion results It is possible for the SPI master 7 side to determine whether or not there is, that is, whether or not the continuity of the acquired AD conversion results is maintained.

なお、本実施の形態では、AD変換結果用レジスタ2,3を両方用いる場合について説明しているが、第1の実施の形態で説明したとおりAD変換結果用レジスタ2のみを用いるようにしてもよい。上記で説明したとおり、第1の実施の形態ではAD変換結果の取りこぼしが発生する可能性があるが、本実施の形態によれば、このような取りこぼしの有無をSPIマスター7側で判断することが可能となる。   In this embodiment, the case where both the AD conversion result registers 2 and 3 are used is described. However, as described in the first embodiment, only the AD conversion result register 2 may be used. Good. As described above, in the first embodiment, there is a possibility that the AD conversion result may be missed. According to this embodiment, the SPI master 7 determines whether such a miss has occurred or not. Is possible.

本発明は、AD変換器の変換周期を考慮せずにAD変換結果を読み出す技術に適用することができる。   The present invention can be applied to a technique of reading an AD conversion result without considering the conversion cycle of the AD converter.

1…AD変換器、2,3…AD変換結果用レジスタ、4,4a…READ検出回路、5…クロック載せ換え回路、6,6a…データ送信回路、7…SPIマスター、8,9…識別データ用レジスタ、50,51…フリップフロップ。   DESCRIPTION OF SYMBOLS 1 ... AD converter, 2, 3 ... AD conversion result register, 4, 4a ... READ detection circuit, 5 ... Clock transfer circuit, 6, 6a ... Data transmission circuit, 7 ... SPI master, 8, 9 ... Identification data Registers, 50, 51 flip-flops.

Claims (9)

AD変換器のAD変換結果の送信先となる外部装置からのコマンドの上位ビットを受け取って読み出しコマンドと判定したときに検出信号を有効とし、前記外部装置からのコマンドを全て受け取って読み出しコマンドと確定したときに送信許可信号を有効とする検出回路と、
前記外部装置のクロックと同期した前記検出信号に応じて、前記AD変換器のクロックと同期した内部レジスタ値変更禁止信号を出力するクロック載せ換え回路と、
前記AD変換器からのデータ準備完了信号が有効であり、かつ前記内部レジスタ値変更禁止信号が無効であるときに、前記AD変換器のAD変換結果を取り込む第1のAD変換結果用レジスタと、
前記送信許可信号が有効であるときに、前記第1のAD変換結果用レジスタからAD変換結果を読み出して前記外部装置へ送信するデータ送信回路とを備えることを特徴とするAD変換結果読出回路。
When the upper bit of the command from the external device that is the transmission destination of the AD conversion result of the AD converter is received and determined as a read command, the detection signal is validated, and all the commands from the external device are received and confirmed as the read command A detection circuit that validates the transmission permission signal when
A clock transfer circuit that outputs an internal register value change prohibition signal synchronized with the clock of the AD converter in response to the detection signal synchronized with the clock of the external device;
A first AD conversion result register for fetching an AD conversion result of the AD converter when a data preparation completion signal from the AD converter is valid and the internal register value change prohibition signal is invalid;
An AD conversion result reading circuit comprising: a data transmission circuit that reads an AD conversion result from the first AD conversion result register and transmits the AD conversion result to the external device when the transmission permission signal is valid.
請求項1記載のAD変換結果読出回路において、
さらに、前記AD変換器からのデータ準備完了信号が有効であり、かつ前記内部レジスタ値変更禁止信号が有効であるときに、前記AD変換器のAD変換結果を取り込む第2のAD変換結果用レジスタを備え、
前記第1のAD変換結果用レジスタは、前記内部レジスタ値変更禁止信号が無効になったときに、前記第2のAD変換結果用レジスタの出力を取り込むことを特徴とするAD変換結果読出回路。
The AD conversion result read circuit according to claim 1,
Further, when a data preparation completion signal from the AD converter is valid and the internal register value change prohibition signal is valid, a second AD conversion result register for fetching the AD conversion result of the AD converter With
The AD conversion result read circuit, wherein the first AD conversion result register takes in an output of the second AD conversion result register when the internal register value change prohibition signal becomes invalid.
請求項1または2記載のAD変換結果読出回路において、
さらに、前記AD変換器からのデータ準備完了信号が有効であり、かつ前記内部レジスタ値変更禁止信号が無効であるときに、前記AD変換結果に対応付けられた識別データを前記AD変換器から取り込む第1の識別データ用レジスタを備え、
前記データ送信回路は、前記送信許可信号が有効であるときに、前記第1のAD変換結果用レジスタからAD変換結果を読み出して前記外部装置へ送信すると共に、前記第1の識別データ用レジスタから識別データを読み出して前記外部装置へ送信することを特徴とするAD変換結果読出回路。
The AD conversion result readout circuit according to claim 1 or 2,
Further, when the data preparation completion signal from the AD converter is valid and the internal register value change prohibition signal is invalid, the identification data associated with the AD conversion result is taken from the AD converter. A first identification data register;
The data transmission circuit reads an AD conversion result from the first AD conversion result register and transmits the AD conversion result to the external device when the transmission permission signal is valid, and from the first identification data register. An AD conversion result reading circuit, wherein identification data is read and transmitted to the external device.
請求項3記載のAD変換結果読出回路において、
さらに、前記AD変換器からのデータ準備完了信号が有効であり、かつ前記内部レジスタ値変更禁止信号が有効であるときに、前記識別データを取り込む第2の識別データ用レジスタを備え、
前記第1の識別データ用レジスタは、前記内部レジスタ値変更禁止信号が無効になったときに、前記第2の識別データ用レジスタの出力を取り込むことを特徴とするAD変換結果読出回路。
The AD conversion result read circuit according to claim 3,
And a second identification data register that takes in the identification data when the data preparation completion signal from the AD converter is valid and the internal register value change prohibition signal is valid,
The AD conversion result read circuit, wherein the first identification data register takes in an output of the second identification data register when the internal register value change prohibition signal becomes invalid.
請求項3または4記載のAD変換結果読出回路において、
前記識別データは、前記AD変換器によるAD変換処理の実行回数を示すデータであることを特徴とするAD変換結果読出回路。
The AD conversion result read circuit according to claim 3 or 4 ,
The AD conversion result reading circuit, wherein the identification data is data indicating the number of times of AD conversion processing by the AD converter.
請求項3または4記載のAD変換結果読出回路において、
前記識別データは、前記AD変換器によってAD変換処理が実行された時刻を示すデータであることを特徴とするAD変換結果読出回路。
The AD conversion result read circuit according to claim 3 or 4 ,
The AD conversion result reading circuit, wherein the identification data is data indicating a time when AD conversion processing is executed by the AD converter.
請求項3または4記載のAD変換結果読出回路において、
前記識別データは、前記AD変換器によってAD変換処理が実行される毎に論理レベルが反転する1ビットのデータであることを特徴とするAD変換結果読出回路。
The AD conversion result read circuit according to claim 3 or 4 ,
The AD conversion result reading circuit, wherein the identification data is 1-bit data whose logic level is inverted every time AD conversion processing is executed by the AD converter.
請求項3または4記載のAD変換結果読出回路において、
前記識別データは、フリーランカウンタのカウント値に基づくデータであることを特徴とするAD変換結果読出回路。
The AD conversion result read circuit according to claim 3 or 4 ,
The AD conversion result reading circuit, wherein the identification data is data based on a count value of a free-run counter.
請求項1〜8のいずれか1項に記載のAD変換結果読出回路において、
前記検出回路は、前記検出信号を有効とした後に、前記外部装置からのコマンドを全て受け取って読み出しコマンドでないと判定したときに、前記検出信号を無効とすることを特徴とするAD変換結果読出回路。
In the AD conversion result read circuit according to any one of claims 1 to 8 ,
The detection circuit invalidates the detection signal when it receives all the commands from the external device and determines that the detection signal is not a read command after the detection signal is validated. .
JP2016040667A 2016-03-03 2016-03-03 AD conversion result reading circuit Active JP6499602B2 (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2016040667A JP6499602B2 (en) 2016-03-03 2016-03-03 AD conversion result reading circuit
CN201780014289.4A CN108780385B (en) 2016-03-03 2017-02-28 Analog-to-digital conversion result reading circuit
KR1020187024599A KR102035768B1 (en) 2016-03-03 2017-02-28 AD conversion result reading circuit
PCT/JP2017/007642 WO2017150491A1 (en) 2016-03-03 2017-02-28 A-d conversion result readout circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016040667A JP6499602B2 (en) 2016-03-03 2016-03-03 AD conversion result reading circuit

Publications (2)

Publication Number Publication Date
JP2017157060A JP2017157060A (en) 2017-09-07
JP6499602B2 true JP6499602B2 (en) 2019-04-10

Family

ID=59744018

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016040667A Active JP6499602B2 (en) 2016-03-03 2016-03-03 AD conversion result reading circuit

Country Status (4)

Country Link
JP (1) JP6499602B2 (en)
KR (1) KR102035768B1 (en)
CN (1) CN108780385B (en)
WO (1) WO2017150491A1 (en)

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7346094B2 (en) * 2002-12-13 2008-03-18 International Business Machines Corporation System and method for transmitting data and additional information simultaneously within a wire based communication system
US7702941B2 (en) * 2003-08-13 2010-04-20 Intel Corporation Universal adaptive synchronization scheme for distributed audio-video capture on heterogeneous computing platforms
US7071859B1 (en) * 2005-06-30 2006-07-04 Sigmatel, Inc. System and method for scheduling access to an analog-to-digital converter and a microprocessor
JP4661718B2 (en) * 2006-07-25 2011-03-30 株式会社デンソー A / D converter
CN102314402A (en) * 2011-07-29 2012-01-11 中国地震灾害防御中心 Digital strong motion seismograph and multipath data acquisition interface thereof
JP6034699B2 (en) * 2013-01-07 2016-11-30 ルネサスエレクトロニクス株式会社 Semiconductor device and command control method thereof
JP2016040647A (en) * 2014-08-12 2016-03-24 アズビル株式会社 Analog / digital conversion circuit

Also Published As

Publication number Publication date
JP2017157060A (en) 2017-09-07
CN108780385B (en) 2021-08-17
WO2017150491A1 (en) 2017-09-08
KR102035768B1 (en) 2019-10-24
KR20180108723A (en) 2018-10-04
CN108780385A (en) 2018-11-09

Similar Documents

Publication Publication Date Title
CN113608600B (en) Method and apparatus for data synchronization in a system having multiple clock domains and reset domains
US9722767B2 (en) Clock domain bridge static timing analysis
US9418037B2 (en) SPI interface and method for serial communication via an SPI interface having an SPI protocol handler for evaluating signal transitions of SPI signals
US9330740B1 (en) First-in first-out circuits and methods
KR101334111B1 (en) Quad-data rate controller and realization method thereof
CN110892643B (en) Circuit for satisfying setup time and hold time of control signal
EP2662745A1 (en) Signal processing device
GB2524516A (en) Hardware compression method finding backward references with multi-level hashes
CN106933767B (en) Comma detection and word alignment method and system suitable for JESD204B protocol
JP6499602B2 (en) AD conversion result reading circuit
US9207706B2 (en) Generating monotonically increasing TOD values in a multiprocessor system
EP3032428A1 (en) Data communication device and method for data communication
KR100826496B1 (en) Semiconductor integrated circuit device and its operation method
CN115129296A (en) True random number generator and true random number generation method
Kebaili et al. Clock domain crossing formal verification: a meta-model
JP5239747B2 (en) Logic simulation program, logic simulation apparatus, and logic simulation method
JP7221759B2 (en) time measurement circuit
EP2667311A2 (en) Information processing apparatus, method of measuring delay difference, and delay difference measuring program
JP6303509B2 (en) Circuit verification method and circuit verification program
US8701061B2 (en) Semiconductor design support apparatus
KR101031641B1 (en) Debugging chip, debugging system and data method of external chip signal using same
JP5483172B2 (en) Data transfer apparatus and data transfer method
JPH081572B2 (en) Synchronization circuit
US20210004513A1 (en) Method of checking equivalence between a first design comprising a shift register logic srl chain and a second design
KR200158764Y1 (en) Synchronous serial input device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180921

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20181218

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20190212

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20190312

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20190315

R150 Certificate of patent or registration of utility model

Ref document number: 6499602

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250