JP2006031133A - Semiconductor device - Google Patents

Semiconductor device Download PDF

Info

Publication number
JP2006031133A
JP2006031133A JP2004205430A JP2004205430A JP2006031133A JP 2006031133 A JP2006031133 A JP 2006031133A JP 2004205430 A JP2004205430 A JP 2004205430A JP 2004205430 A JP2004205430 A JP 2004205430A JP 2006031133 A JP2006031133 A JP 2006031133A
Authority
JP
Japan
Prior art keywords
output
counter
input
clock signal
semiconductor device
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.)
Pending
Application number
JP2004205430A
Other languages
Japanese (ja)
Inventor
Iwao Orii
巌 織井
Takanori Ozake
貴紀 大酒
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.)
Toshiba Corp
Kioxia Systems Co Ltd
Original Assignee
Toshiba Corp
Toshiba Memory Systems Co Ltd
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 Toshiba Corp, Toshiba Memory Systems Co Ltd filed Critical Toshiba Corp
Priority to JP2004205430A priority Critical patent/JP2006031133A/en
Publication of JP2006031133A publication Critical patent/JP2006031133A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To realize a semiconductor device for detecting the abnormality of two input clock signals. <P>SOLUTION: The semiconductor device is provided with a counting part 11 for inputting clock signals fc and fs which are asynchronous and different, and for counting the number of clocks of the clock signal fc in a predetermined period based on the clock signal fs, and for outputting a count value sc and a judging part 12 for outputting an error signal err showing the abnormality of the clock signal fc or fs when the count value sc from the counting part 11 is not present in a predetermined range. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、周期の異なる2つのクロック信号が入力される半導体装置に係わり、特に、クロック信号の異常検出機能を有する半導体装置に関する。   The present invention relates to a semiconductor device to which two clock signals having different periods are input, and more particularly, to a semiconductor device having a clock signal abnormality detection function.

CPUにより全体の動作が制御されるシステムでは、CPUの暴走などによるデッドロックを検出するために、システムクロックを監視するウォッチドッグタイマーが採用されている。(例えば、特許文献1を参照。) このため、従来の半導体装置は、システムに異常が発生した場合に、ウォッチドッグタイマーにより生成されるリセット信号でリセットできるよう設計されていた。   In a system in which the entire operation is controlled by the CPU, a watchdog timer that monitors a system clock is employed to detect a deadlock due to a runaway of the CPU. (For example, refer to Patent Document 1.) For this reason, the conventional semiconductor device is designed to be reset by a reset signal generated by a watchdog timer when an abnormality occurs in the system.

しかし、ウォッチドッグタイマーは、CPUのソフトウェアで制御されているので、装着されている水晶発振子の接触不良などでシステムクロックに一時的な異常が発生した場合には、うまく機能しないことが多かった。   However, since the watchdog timer is controlled by the software of the CPU, it often did not function well when a temporary abnormality occurred in the system clock due to poor contact of the mounted crystal oscillator. .

したがって、従来の半導体装置では、システムクロックの異常に起因する誤動作や暴走を防止することが困難であるという問題があった。   Therefore, the conventional semiconductor device has a problem that it is difficult to prevent malfunction and runaway due to an abnormal system clock.

一方、近年、携帯電話などの携帯機器における省電力化の要求に応えて、周期の異なる2つのシステムクロックを使用する半導体装置が開発されている。すなわち、省電力動作をさせる場合には、通常の500〜1000倍の周期を持つ第2のクロック信号をシステムクロックとして使用する。   On the other hand, in recent years, a semiconductor device using two system clocks having different periods has been developed in response to a demand for power saving in a portable device such as a cellular phone. That is, when the power saving operation is performed, the second clock signal having a cycle 500 to 1000 times the normal time is used as the system clock.

ところで、この場合、つまり、周期の長いクロック信号により動作している場合、従来のウォッチドッグタイマーによるシステムクロックの監視では、上述した問題の他に、異常を検出するまでの時間が非常に長くなってしまうという問題もあった。
特開平9−297698号公報
By the way, in this case, that is, when operating with a clock signal having a long cycle, in the conventional system clock monitoring by the watchdog timer, in addition to the above-described problems, the time until an abnormality is detected becomes very long. There was also a problem of end up.
Japanese Patent Laid-Open No. 9-297698

本発明は、入力されたクロック信号の異常を検出することができる半導体装置を提供する。   The present invention provides a semiconductor device capable of detecting an abnormality of an input clock signal.

本発明の一態様によれば、同期していない周期の異なる第1および第2のクロック信号が入力され、前記第2のクロック信号に基づく所定の期間、前記第1のクロック信号のクロック数をカウントし、当該カウント値を出力する計数手段と、前記計数手段からの前記カウント値が所定の範囲にない場合に、前記第1または前記第2のクロック信号の異常を示すエラー信号を出力する判定手段を有することを特徴とする半導体装置が提供される。   According to one aspect of the present invention, first and second clock signals having different periods that are not synchronized are input, and the number of clocks of the first clock signal is set for a predetermined period based on the second clock signal. Counting means for counting and outputting the count value, and determination for outputting an error signal indicating an abnormality in the first or second clock signal when the count value from the counting means is not within a predetermined range There is provided a semiconductor device comprising means.

本発明によれば、2つの入力クロック信号に対してその異常を検出することができる。   According to the present invention, it is possible to detect abnormality of two input clock signals.

以下、図面を参照しながら、本発明の実施例を説明する。   Embodiments of the present invention will be described below with reference to the drawings.

図1は、本発明の実施例に係わる半導体装置を示す回路ブロック図である。ここでは、主に、入力されるクロック信号の異常検出にかかわる部分を示した。   FIG. 1 is a circuit block diagram showing a semiconductor device according to an embodiment of the present invention. Here, the part mainly related to the abnormality detection of the input clock signal is shown.

本発明の実施例に係わる半導体装置は、クロック信号をカウントしカウント値(以下、「sc」という。)を出力する計数部11、およびscが所定の範囲をはずれていた場合にクロック信号の異常を示すエラー信号(以下、「err」という。)を出力する判定部12を備えている。   The semiconductor device according to the embodiment of the present invention includes a counting unit 11 that counts a clock signal and outputs a count value (hereinafter referred to as “sc”), and an abnormality of the clock signal when sc is out of a predetermined range. The determination unit 12 outputs an error signal (hereinafter referred to as “err”).

計数部11の第1の入力には16MHzのクロック信号(以下、「fc」という。)が入力され、計数部11の第2の入力には32KHzのクロック信号(以下、「fs」という。)が入力され、計数部11の出力はscとして判定部12の第1の入力に供給されている。   A 16 MHz clock signal (hereinafter referred to as “fc”) is input to the first input of the counting unit 11, and a 32 kHz clock signal (hereinafter referred to as “fs”) is input to the second input of the counting unit 11. , And the output of the counting unit 11 is supplied to the first input of the determination unit 12 as sc.

判定部12の第2の入力にはfsが入力され、判定部12の出力はerrとしてCPUなどの回路ブロック(図示していない。)に供給されている。   The second input of the determination unit 12 is fs, and the output of the determination unit 12 is supplied to a circuit block (not shown) such as a CPU as err.

計数部11は、fsの周期ごとにfcのクロック数をカウントし、その値を10ビットのscとして判定部12へ出力する。   The counting unit 11 counts the number of clocks of fc for each cycle of fs, and outputs the value to the determination unit 12 as 10-bit sc.

判定部12は、計数部11からのscと所定の範囲を比較し、もし、scが所定の範囲に入っていれば、errとして“OK”を出力し、入っていなければ、errとして“NG”を出力する。   The determination unit 12 compares sc from the counting unit 11 with a predetermined range, and if sc is within the predetermined range, “OK” is output as err, and if it does not, “NG” is output as “err”. "Is output.

図1に示したように、計数部11は、制御信号を生成する制御回路13、fcをカウントアップするカウンタ14およびカウンタ15、およびカウンタ14の出力(以下、「cnt1」という。)またはカウンタ15の出力(以下、「cnt2」という。)を選択してscとして出力するセレクタ16を備えている。   As shown in FIG. 1, the counting unit 11 includes a control circuit 13 that generates a control signal, a counter 14 and a counter 15 that counts up fc, and an output of the counter 14 (hereinafter referred to as “cnt1”) or a counter 15. Is selected (hereinafter referred to as “cnt2”) and is output as sc.

制御回路13の入力にはfsが入力され、制御回路13の第1の出力はselとしてセレクタ16の制御入力へ供給され、制御回路13の第2の出力はrst1としてカウンタ14の制御入力へ供給され、制御回路13の第3の出力はrst2としてカウンタ15の制御入力へ供給されている。   Fs is input to the input of the control circuit 13, the first output of the control circuit 13 is supplied to the control input of the selector 16 as sel, and the second output of the control circuit 13 is supplied to the control input of the counter 14 as rst1. The third output of the control circuit 13 is supplied to the control input of the counter 15 as rst2.

カウンタ14の入力にはfcが入力され、その出力は10bit幅でセレクタ16の第1の入力に接続されている。   Fc is input to the input of the counter 14, and its output is connected to the first input of the selector 16 with a 10-bit width.

カウンタ15の入力にはfcが入力され、その出力は10bit幅でセレクタ16の第2の入力に接続されている。   Fc is input to the input of the counter 15, and its output is connected to the second input of the selector 16 with a 10-bit width.

セレクタ16の出力は、計数部11の出力であるscとして、10bit幅で判定部12の第1の入力へ接続されている。   The output of the selector 16 is connected to the first input of the determination unit 12 with a 10-bit width as sc that is the output of the counting unit 11.

制御回路13は、カウンタ14、カウンタ15、およびセレクタ16を制御する信号rst1、rst2、およびselを生成し、それぞれの制御入力へ供給する。   The control circuit 13 generates signals rst1, rst2, and sel that control the counter 14, the counter 15, and the selector 16, and supplies them to the respective control inputs.

図2は、本発明の実施例に係わる半導体装置における制御回路13を示す回路図である。ここでは、一例として、fsのデューティー比が1:1である場合の回路を示した。   FIG. 2 is a circuit diagram showing the control circuit 13 in the semiconductor device according to the embodiment of the present invention. Here, as an example, a circuit in the case where the duty ratio of fs is 1: 1 is shown.

本発明の実施例に係わる半導体装置における制御回路13は、2つのデータラッチ21および22(以下、「DL21およびDL22」という。)、およびインバータ23(以下、「INV23」という。)で構成されている。   The control circuit 13 in the semiconductor device according to the embodiment of the present invention includes two data latches 21 and 22 (hereinafter referred to as “DL21 and DL22”) and an inverter 23 (hereinafter referred to as “INV23”). Yes.

DL21のクロック入力にはfsが入力され、DL21の出力QはINV23の入力、DL22の入力D、およびrst2としてカウンタ15の制御入力に接続されている。   Fs is input to the clock input of DL21, and the output Q of DL21 is connected to the control input of the counter 15 as the input of INV23, the input D of DL22, and rst2.

INV23の出力はDL21の入力Dに接続され、DL22のクロック入力にはfsが入力され、DL22の出力Qはrst1としてカウンタ14の制御入力に接続されている。   The output of INV23 is connected to the input D of DL21, fs is input to the clock input of DL22, and the output Q of DL22 is connected to the control input of the counter 14 as rst1.

また、同時に、DL22の出力Qは、selとしてセレクタ16の制御入力に接続されている。   At the same time, the output Q of the DL 22 is connected to the control input of the selector 16 as sel.

このような構成により、制御回路13は、fsを2分周した制御信号rst2と、rst2を反転した制御信号rst1およびselを生成する。(これらの具体的な波形例は、後述する図4〜図6を参照。)。   With such a configuration, the control circuit 13 generates a control signal rst2 obtained by dividing fs by 2, and control signals rst1 and sel obtained by inverting rst2. (Refer to FIGS. 4 to 6 to be described later for specific waveform examples.)

カウンタ14は、10bit構成のバイナリーカウンタ回路であり、rst1が“L”である期間、fcのクロック数をカウントアップする。   The counter 14 is a binary counter circuit having a 10-bit configuration, and counts up the number of clocks of fc while rst1 is “L”.

したがって、カウンタ14は、fcのクロック周期ごとに、このカウントアップした10bitの2進数をcnt1として順次出力する。   Therefore, the counter 14 sequentially outputs the counted 10-bit binary number as cnt1 every clock cycle of fc.

カウンタ15の構成、機能はカウンタ14と同様である。カウンタ14との違いは、制御入力にrst2が入力されていることと、その出力cnt2がセレクタ16の第2の入力に接続されていることである。   The configuration and function of the counter 15 are the same as those of the counter 14. The difference from the counter 14 is that rst2 is input to the control input and its output cnt2 is connected to the second input of the selector 16.

セレクタ16は、10個の2入力1出力選択回路で構成され、各選択回路は、制御入力が“L”である時に第1の入力を選択して出力し、制御入力が“H”であるときに第2の入力を選択して出力する。   The selector 16 is composed of ten 2-input 1-output selection circuits. Each selection circuit selects and outputs the first input when the control input is “L”, and the control input is “H”. Sometimes the second input is selected and output.

各選択回路の制御入力にはselが入力され、それぞれの第1の入力にはcnt1の各bitが接続され、それぞれの第2の入力にはcnt2の各bitが接続されている。   Sel is input to the control input of each selection circuit, each bit of cnt1 is connected to each first input, and each bit of cnt2 is connected to each second input.

また、各選択回路の出力は、それぞれがscの各bitとして判定部12の第1の入力に接続されている。   Further, the output of each selection circuit is connected to the first input of the determination unit 12 as each bit of sc.

このような構成により、セレクタ16は、selが“L”である期間はcnt1を選択して判定部12へ出力し、selが“H”である期間はcnt2を選択して判定部12へ出力する。   With such a configuration, the selector 16 selects cnt1 during the period when sel is “L” and outputs it to the determination unit 12, and selects cnt2 during the period when sel is “H” and outputs it to the determination unit 12. To do.

判定部12は、図1に示したように、scの正常な範囲の上限を示す上限値を保持している上限値レジスタ17、scの正常な範囲の下限を示す下限値を保持している下限値レジスタ18、scと上限値および下限値を比較する比較器19、および比較器19からの出力(以下、「cmp」という。)を保持するサンプリング回路20を備えている。   As illustrated in FIG. 1, the determination unit 12 holds an upper limit register 17 that holds an upper limit value that indicates the upper limit of the normal range of sc, and a lower limit value that indicates the lower limit of the normal range of sc. The lower limit register 18, sc is provided with a comparator 19 that compares the upper limit value and the lower limit value, and a sampling circuit 20 that holds an output from the comparator 19 (hereinafter referred to as "cmp").

上限値レジスタ17の出力は比較器19の第1の入力に接続され、下限値レジスタ18の出力は比較器19の第2の入力に接続されている。また、比較器19の第3の入力には計数部11からのscが入力され、比較器19の出力(“cmp”)はサンプリング回路20のデータ入力に接続されている。   The output of the upper limit register 17 is connected to the first input of the comparator 19, and the output of the lower limit register 18 is connected to the second input of the comparator 19. Further, sc from the counting unit 11 is input to the third input of the comparator 19, and the output (“cmp”) of the comparator 19 is connected to the data input of the sampling circuit 20.

サンプリング回路20のクロック入力にはfsが入力され、サンプリング回路20の出力は判定部12の出力であるerrとしてCPUなどの回路ブロック(図示していない。)へ供給されている。   Fs is input to the clock input of the sampling circuit 20, and the output of the sampling circuit 20 is supplied to a circuit block (not shown) such as a CPU as err which is the output of the determination unit 12.

上限値レジスタ17は、10個のデータラッチで構成され、それらの出力が10bit幅の2進数として比較器19の第1の入力に供給されている。図1には示されていないが、上限値レジスタ17への上限値のセットはCPUによって行われ、例えば、“501”が設定される。   The upper limit register 17 is composed of ten data latches, and their outputs are supplied to the first input of the comparator 19 as binary numbers having a 10-bit width. Although not shown in FIG. 1, the upper limit value is set in the upper limit value register 17 by the CPU. For example, “501” is set.

下限値レジスタ18の構成、機能は上限値レジスタ17と同様である。上限値レジスタ17との違いは、その出力が比較器19の第2の入力に接続されていることと、CPUによって設定される下限値が、例えば、“499”になっていることである。   The configuration and function of the lower limit register 18 are the same as those of the upper limit register 17. The difference from the upper limit register 17 is that the output is connected to the second input of the comparator 19 and the lower limit set by the CPU is, for example, “499”.

比較器19は、scを上限値および下限値と比較し、scが上限値と下限値の間の値(下限値以上、上限値未満)であれば、cmpとして“L”を出力し、それ以外の場合は、cmpとして“H”を出力する。   The comparator 19 compares sc with the upper limit value and the lower limit value, and if sc is a value between the upper limit value and the lower limit value (more than the lower limit value and less than the upper limit value), it outputs “L” as cmp. Otherwise, “H” is output as cmp.

比較は10bitの2進数として行われる。   The comparison is performed as a 10-bit binary number.

上述したように、計数部11の出力であるscは、fcのクロック周期ごとにその値がカウントアップされるので、cmpもそれにつれて順次変化する。(scおよびcmpの具体的な波形例は、後述する図4〜図6を参照。)。   As described above, sc, which is the output of the counting unit 11, is incremented every clock cycle of fc, so cmp also changes sequentially. (Refer to FIGS. 4 to 6 to be described later for specific waveform examples of sc and cmp.)

サンプリング回路20は、cmpをラッチしてfsの1周期の間保持し、scが正常な範囲にあるかどうかを示すerrを出力する。すなわち、fsの立ち上がり時にscが上限値と下限値の間(下限値以上、上限値未満)にあれば、errは“OK”を示す“L”となり、それ以外の場合は、errは“NG”を示す“H”となる。   The sampling circuit 20 latches cmp and holds it for one period of fs, and outputs err indicating whether or not sc is in a normal range. That is, if sc is between the upper limit value and the lower limit value at the rise of fs (more than the lower limit value and less than the upper limit value), err becomes “L” indicating “OK”, otherwise, err is “NG”. "H" indicating "".

errの“NG”は、fcまたはfsに瞬断などの異常が発生していることを意味している。   “NG” in err means that an abnormality such as a momentary interruption has occurred in fc or fs.

図3は、本発明の実施例に係わる半導体装置におけるサンプリング回路20を示す回路図である。ここでは、一例として、データラッチ24(以下、「DL24」という。)による構成例を示した。   FIG. 3 is a circuit diagram showing the sampling circuit 20 in the semiconductor device according to the embodiment of the present invention. Here, as an example, a configuration example using the data latch 24 (hereinafter referred to as “DL24”) is shown.

DL24の入力Dにはcmpが接続され、DL24のクロック入力にはfsが接続され、DL24の出力Qにはerrが接続されている。   The cmp is connected to the input D of the DL 24, fs is connected to the clock input of the DL 24, and err is connected to the output Q of the DL 24.

このような構成により、サンプリング回路20は、fsの立ち上がりでcmpをラッチし、fsの1周期の間これを保持し、errとして出力し続けることができる。(fs、cmp、およびerrの具体的な波形例は、後述する図4〜図6を参照。)。   With such a configuration, the sampling circuit 20 can latch cmp at the rising edge of fs, hold it for one period of fs, and continue to output it as err. (See FIGS. 4 to 6 to be described later for specific waveform examples of fs, cmp, and err.)

次に、上述した構成を持つ半導体装置の動作について説明する。ここでは、主に、上述した計数部11および判定部12にかかわる動作について説明する。   Next, the operation of the semiconductor device having the above-described configuration will be described. Here, the operations related to the counting unit 11 and the determination unit 12 described above will be mainly described.

まずはじめに、クロック信号fcおよびfsに異常がない場合の通常動作について説明する。図4は、本発明の実施例に係わる半導体装置の通常動作を示す波形図である。   First, a normal operation when there is no abnormality in the clock signals fc and fs will be described. FIG. 4 is a waveform diagram showing a normal operation of the semiconductor device according to the embodiment of the present invention.

図4には、fsの3クロック分(時刻t0〜t3)を示した。   FIG. 4 shows three clocks of fs (time t0 to t3).

fc、cnt1、cnt2、およびscはクロックの最小周期がfsのそれの1/500なので、そのような部分は縦縞のハッチングで示してある。   Since fc, cnt1, cnt2, and sc have a minimum clock period of 1/500 of that of fs, such portions are indicated by vertical stripes.

また、cnt1、cnt2、およびscでの“[0−9]”という表記は、これらが10bit幅であることを示している。   In addition, the notation “[0-9]” in cnt1, cnt2, and sc indicates that these are 10 bits wide.

さらに、cnt1およびcnt2上部の矢印を付した数値は、それぞれの出力値を10進数で示している。   Further, numerical values with arrows on the top of cnt1 and cnt2 indicate the respective output values in decimal numbers.

さらに、図4の時間スケール(紙面横方向)は、説明のため、横方向の位置によって適宜伸縮させて描いてある。つまり、例えば、図中のfsのパルス幅とcmpのパルス幅の比率は実際の比率を反映していない。   Furthermore, the time scale (horizontal direction in the drawing) of FIG. 4 is drawn by being appropriately expanded and contracted depending on the position in the horizontal direction for the sake of explanation. That is, for example, the ratio between the pulse width of fs and the pulse width of cmp in the figure does not reflect the actual ratio.

ただし、時刻(紙面縦方向)については、すべての波形で揃えて描いてある。   However, the time (vertical direction in the drawing) is drawn with all the waveforms aligned.

まず時刻t0において、fsが立ち上がると、制御回路13がrst1を“L”に設定し、rst2およびsel(図4には示していない。)を“H”に設定する。   First, when fs rises at time t0, the control circuit 13 sets rst1 to “L” and sets rst2 and sel (not shown in FIG. 4) to “H”.

このrst1を受けてカウンタ14は、fcのカウントアップを開始する。また、rst2を受けてカウンタ15の出力cnt2は“0”にリセットされ、時刻t1までその値を保持する。   Upon receiving this rst1, the counter 14 starts counting up fc. In response to rst2, the output cnt2 of the counter 15 is reset to “0”, and the value is held until time t1.

セレクタ16は、selを受けて時刻t1までの間その第1の入力、つまり、cnt1を選択しこれをscとして出力する。   The selector 16 receives the sel and selects its first input, that is, cnt1, until time t1, and outputs it as sc.

比較器19は、入力されたscを上限値レジスタ17に保持されている上限値(“501”)および下限値レジスタ18に保持されている下限値(“499”)と比較し、比較結果をcmpとして出力する。   The comparator 19 compares the input sc with the upper limit value (“501”) held in the upper limit value register 17 and the lower limit value (“499”) held in the lower limit value register 18, and compares the comparison result. Output as cmp.

カウンタ14のカウントアップ開始後しばらくの間はscが下限値よりも小さいので、cmpは“H”のままである。   Since sc is smaller than the lower limit value for a while after the counter 14 starts counting up, cmp remains “H”.

fcによるカウンタ14のカウントアップが進み、cnt1が“499”に達すると、scが正常な範囲(下限値以上、上限値未満)に入るので、cmpは“L”に遷移する。   When the counter 14 counts up by fc and cnt1 reaches “499”, sc enters the normal range (more than the lower limit value and less than the upper limit value), so cmp transitions to “L”.

そして、時刻t1で、fsが立ち上がると、まず、サンプリング回路20がcmpの“L”をerrとしてラッチして出力する。   When fs rises at time t1, first, the sampling circuit 20 latches and outputs “L” of cmp as err.

同時に、制御回路13がrst1を“H”に設定し、rst2およびsel(図4には示していない。)を“L”に設定する。   At the same time, the control circuit 13 sets rst1 to “H”, and sets rst2 and sel (not shown in FIG. 4) to “L”.

このrst1を受けてカウンタ14の出力cnt1は“0”にリセットされ、時刻t2までその値を保持する。また、rst2を受けてカウンタ15は、fcのカウントアップを開始する。   Upon receiving this rst1, the output cnt1 of the counter 14 is reset to “0”, and the value is held until time t2. In response to rst2, the counter 15 starts counting up fc.

セレクタ16は、selを受けて時刻t2までの間その第2の入力、つまり、cnt2を選択しこれをscとして出力する。   The selector 16 receives the sel and selects its second input, that is, cnt2 until time t2, and outputs it as sc.

このため、scはこの時点で“0”にリセットされ、cmpは“H”に遷移する。ここで、errは、サンプリング回路20によりラッチされているので、cmpの状態にかかわらず“L”のままである。   Therefore, sc is reset to “0” at this time, and cmp transitions to “H”. Here, since err is latched by the sampling circuit 20, it remains “L” regardless of the state of cmp.

カウンタ15のカウントアップ開始後しばらくの間はscが下限値よりも小さいので、cmpは“H”のままである。   Since sc is smaller than the lower limit value for a while after the counter 15 starts counting up, cmp remains “H”.

fcによるカウンタ15のカウントアップが進み、cnt2が“499”に達すると、scが正常な範囲に入るので、cmpは“L”に遷移する。   When the counter 15 counts up by fc and cnt2 reaches “499”, sc enters the normal range, so cmp transitions to “L”.

そして、時刻t2で、fsが立ち上がると、サンプリング回路20がcmpの“L”をerrとしてラッチして出力する。   When fs rises at time t2, the sampling circuit 20 latches and outputs “L” of cmp as err.

同時に、制御回路13がrst1を“L”に設定し、rst2およびsel(図4には示していない。)を“H”に設定し、計数部11および判定部12は時刻t0と同じ状態に戻る。   At the same time, the control circuit 13 sets rst1 to “L”, sets rst2 and sel (not shown in FIG. 4) to “H”, and the counting unit 11 and the determination unit 12 are in the same state as the time t0. Return.

このようにして、fcとfsの周期の比が1:499〜1:501の間にあれば、つまり、カウンタ14またはカウンタ15によるfcのカウント値scがfsの立ち上がり時点で499〜501の間にあれば、計数部11および判定部12は上述した動作を繰り返し、errは“OK”を示す“L”を出力し続ける。   In this way, if the ratio of the period of fc and fs is between 1: 499 and 1: 501, that is, the count value sc of fc by the counter 14 or the counter 15 is between 499 and 501 at the rise of fs. If it is, the counting unit 11 and the determination unit 12 repeat the above-described operation, and err continues to output “L” indicating “OK”.

次に、クロック信号fcに瞬断が生じた場合の計数部11および判定部12の異常検出動作について説明する。   Next, the abnormality detection operation of the counting unit 11 and the determination unit 12 when an instantaneous interruption occurs in the clock signal fc will be described.

図5は、本発明の実施例に係わる半導体装置におけるfcの異常を検出する動作を示す波形図である。ここでは、一例として、時刻t1〜t2の間に、fcが瞬断した場合を説明する。   FIG. 5 is a waveform diagram showing an operation for detecting an abnormality in fc in the semiconductor device according to the embodiment of the present invention. Here, as an example, a case will be described in which fc is momentarily interrupted between times t1 and t2.

なお、図中の表記方法などは、図4と同様なので、説明は省略する。また、時刻t0〜t1の動作は図4の通常動作と同様なので、説明は省略する。   In addition, since the notation method etc. in a figure are the same as that of FIG. 4, description is abbreviate | omitted. Also, the operation at times t0 to t1 is the same as the normal operation of FIG.

時刻t1で、fsが立ち上がると、図4と同様に、カウンタ15がカウントアップを開始する。そして、時刻t2まで図4と同様な動作が進行する。   When fs rises at time t1, the counter 15 starts counting up as in FIG. Then, the same operation as in FIG. 4 proceeds until time t2.

しかし、図5に示したように、時刻t1〜t2の間でfcに瞬断が生じているので、時刻t2に達した時点では、カウンタ15のカウントアップは“300”までしか進んでいない状態である。   However, as shown in FIG. 5, since there is an instantaneous interruption in fc between times t1 and t2, when the time t2 is reached, the counter 15 counts up to “300” only. It is.

したがって、この時点では、比較器19の出力であるcmpはまだ“H”のままである。   Therefore, at this time, the output cmp of the comparator 19 is still “H”.

なお、図5においてcnt2[0−9]とsc[0−9]の波形で、時刻t1〜t2にある白抜き部分は、fcによるカウントアップが停止していることを示している。   In FIG. 5, in the waveforms of cnt2 [0-9] and sc [0-9], white portions at times t1 to t2 indicate that the count-up by fc is stopped.

次に、時刻t2のfsの立ち上がりで、サンプリング回路20はcmpの“H”をラッチして出力する。すなわち、fcに瞬断が起こった次のfsの立ち上がりで、errは“NG”を示す“H”となり、errを受信するCPUなどが異常を検知することができる。   Next, at the rise of fs at time t2, the sampling circuit 20 latches and outputs “H” of cmp. That is, err becomes “H” indicating “NG” at the next rising edge of fs after a momentary break in fc, and the CPU or the like that receives err can detect an abnormality.

そして、時刻t2で、制御回路13がrst1を“L”に設定し、rst2およびsel(図5には示していない。)を“H”に設定し、errを除いて、計数部11および判定部12は時刻t0と同じ状態に戻り、カウンタ14のカウントアップが開始される。   At time t2, the control circuit 13 sets rst1 to “L”, sets rst2 and sel (not shown in FIG. 5) to “H”, excludes err, and determines the counting unit 11 and the determination. The unit 12 returns to the same state as the time t0, and the counter 14 starts counting up.

時刻t2〜t3の動作は、errを除いて、時刻t0〜t1の動作と同様であり、カウンタ14の出力であるcnt1が“499”に達すると、cmpは“L”に遷移する。   The operation from time t2 to t3 is the same as the operation from time t0 to t1 except for err. When cnt1 that is the output of the counter 14 reaches “499”, cmp transitions to “L”.

この間、errはサンプリング回路20により“H”に保持されている。   During this time, err is held at “H” by the sampling circuit 20.

時刻t3で、fsが立ち上がると、時刻t1での動作と同様に、サンプリング回路20がcmpの“L”をラッチして、errをリセットし、errは“OK”を示す“L”に復帰する。   When fs rises at time t3, as in the operation at time t1, the sampling circuit 20 latches “L” of cmp, resets err, and err returns to “L” indicating “OK”. .

このようにして、計数部11および判定部12は、時刻t1と同じ状態に復帰する。   In this way, the counting unit 11 and the determination unit 12 return to the same state as at the time t1.

次に、クロック信号fsに瞬断が生じた場合の計数部11および判定部12の異常検出動作について説明する。   Next, an abnormality detection operation of the counting unit 11 and the determination unit 12 when an instantaneous interruption occurs in the clock signal fs will be described.

図6は、本発明の実施例に係わる半導体装置におけるfsの異常を検出する動作を示す波形図である。ここでは、一例として、時刻t1〜t2の間に、fsが瞬断した場合を説明する。   FIG. 6 is a waveform diagram showing an operation for detecting an abnormality in fs in the semiconductor device according to the embodiment of the present invention. Here, as an example, a case where fs is momentarily interrupted between times t1 and t2 will be described.

なお、図中の表記方法などは、図4と同様なので、説明は省略する。また、時刻t0〜t1の動作は図4の通常動作と同様なので、説明は省略する。   Note that the notation and the like in the figure are the same as those in FIG. Also, the operation at times t0 to t1 is the same as the normal operation of FIG.

図6では、fsに瞬断が生じているために、時刻t1になってもfsは立ち上がらない。このため、rst1、rst2、およびsel(図6には示していない。)の状態は変わらず、カウンタ14のカウントアップは継続され、セレクタ16もcnt1の選択を継続する。   In FIG. 6, since fs is interrupted, fs does not rise even at time t1. Therefore, the states of rst1, rst2, and sel (not shown in FIG. 6) do not change, the counter 14 continues to count up, and the selector 16 also continues to select cnt1.

カウンタ14の出力であるcnt1が“501”に達すると、scが上限値になるので、cmpは“H”に遷移する。   When cnt1 which is the output of the counter 14 reaches “501”, sc reaches the upper limit value, so cmp transitions to “H”.

そして、時刻t2のfsの立ち上がりで、サンプリング回路20はcmpの“H”をラッチして出力する。すなわち、瞬断が起こった次のfsの立ち上がりで、errは“NG”を示す“H”となり、errを受信するCPUなどが異常を検知することができる。   Then, at the rise of fs at time t2, the sampling circuit 20 latches and outputs “H” of cmp. That is, err becomes “H” indicating “NG” at the next rise of fs in which an instantaneous interruption occurs, and the CPU or the like that receives err can detect an abnormality.

同時に、時刻t2で、制御回路13がrst1を“H”に設定し、rst2およびsel(図6には示していない。)を“L”に設定し、errを除いて、計数部11および判定部12は図4の時刻t1と同じ状態に戻り、カウンタ15のカウントアップが開始される。   At the same time, at time t2, the control circuit 13 sets rst1 to “H”, sets rst2 and sel (not shown in FIG. 6) to “L”, and except for err, the counting unit 11 and the determination The unit 12 returns to the same state as the time t1 in FIG. 4, and the count up of the counter 15 is started.

時刻t2〜t3の動作は、errを除いて、図4の時刻t1〜t2の動作と同様であり、カウンタ15の出力であるcnt2が“499”に達すると、cmpは“L”に遷移する。   The operation from time t2 to t3 is the same as the operation from time t1 to t2 in FIG. 4 except for err. When cnt2 that is the output of the counter 15 reaches “499”, cmp changes to “L”. .

この間、errはサンプリング回路20により“H”に保持されている。   During this time, err is held at “H” by the sampling circuit 20.

時刻t3で、fsが立ち上がると、図4の時刻t2での動作と同様に、サンプリング回路20がcmpの“L”をラッチして、errをリセットし、errは“OK”を示す“L”に復帰する。   When fs rises at time t3, as in the operation at time t2 in FIG. 4, the sampling circuit 20 latches “L” of cmp, resets err, and err is “L” indicating “OK”. Return to.

このようにして、計数部11および判定部12は、図4の時刻t2と同じ状態に復帰する。   In this way, the counting unit 11 and the determination unit 12 return to the same state as at time t2 in FIG.

上記実施例によれば、周期の異なる2つの入力クロック信号fcおよびfsを用いてそれらの周期の比を監視しているので、CPUのソフトウェアによる制御を利用することなく、fcまたはfsの異常を検出する半導体装置を実現することができる。   According to the above embodiment, since the ratio of the periods is monitored using the two input clock signals fc and fs having different periods, the abnormality of fc or fs can be detected without using the control of the CPU software. A semiconductor device to be detected can be realized.

また、fcまたはfsに瞬断などの異常が生じた直後のfsの立ち上がりでその異常を検出しているので、クロック信号の異常検出までにかかる時間を大幅に削減することができる。   Further, since the abnormality is detected at the rise of fs immediately after an abnormality such as a momentary interruption occurs in fc or fs, the time required for detecting the abnormality of the clock signal can be greatly reduced.

さらに、上記実施例によれば、あらかじめ上限値レジスタ17および下限値レジスタ18に設定された上限値および下限値によりfcとfsの周期比の正常な範囲が規定されるので、fcとfsの周期比が正常な範囲より小さい場合、およびfcとfsの周期比が正常な範囲より大きい場合の両者に対してその異常を検出することができる。   Furthermore, according to the above-described embodiment, the normal range of the cycle ratio of fc and fs is defined by the upper limit value and the lower limit value set in advance in the upper limit value register 17 and the lower limit value register 18, so that the cycle of fc and fs The abnormality can be detected both when the ratio is smaller than the normal range and when the period ratio of fc and fs is larger than the normal range.

すなわち、瞬断などによりfcまたはfsの周期が長くなった場合だけでなく、想定外の逓倍発信などによりfcまたはfsの周期が短くなった場合にもその異常を検出することができる。   That is, the abnormality can be detected not only when the cycle of fc or fs becomes longer due to a momentary interruption or the like, but also when the cycle of fc or fs becomes shorter due to unexpected multiple transmission or the like.

上述の実施例では、fcは16MHz、fsは32KHzであるとしたが、本発明はこれに限られるものではなく、原理的にはfcとfsの周期が異なっていればどのような周波数でも適用可能である。   In the above-described embodiment, fc is 16 MHz and fs is 32 KHz. However, the present invention is not limited to this. In principle, any frequency can be used as long as the periods of fc and fs are different. Is possible.

また、fcとfsが同程度の周波数であっても、それらが非同期のクロック信号であれば、例えば、fsを所定の回数分周することで、本発明を適用することができる。   Also, even if fc and fs have the same frequency, if they are asynchronous clock signals, for example, the present invention can be applied by dividing fs by a predetermined number of times.

さらに、上述の実施例では、カウンタ14およびカウンタ15は10bit構成のバイナリーカウンタ回路であり、上限値レジスタ17および下限値レジスタ18は10個のデータラッチで構成されるとしたが、本発明はこれに限られるものではない。   Further, in the above-described embodiment, the counter 14 and the counter 15 are 10-bit binary counter circuits, and the upper limit register 17 and the lower limit register 18 are configured by 10 data latches. It is not limited to.

さらに、cnt1、cnt2、sc、上限値、および下限値は10bitの2進数であるとしたが、本発明はこれに限られるものではない。   Further, although cnt1, cnt2, sc, the upper limit value, and the lower limit value are 10-bit binary numbers, the present invention is not limited to this.

さらに、上述の実施例では、カウント値scの正常な範囲は“下限値以上、上限値未満”であるとしてが、本発明はこれに限られるものではなく、例えば、“下限値以上、上限値以下”などとしても良い。   Furthermore, in the above-described embodiment, the normal range of the count value sc is “more than the lower limit value and less than the upper limit value”, but the present invention is not limited to this. The following may be used.

さらに、上述の実施例では、fsのデューティー比は1:1であるとしたが、本発明はこれに限られるものではなく、例えば、fsを分周してデューティー比が1:1の信号を生成して、これを使用するようにしても良い。   Further, in the above-described embodiment, the duty ratio of fs is 1: 1, but the present invention is not limited to this. For example, a signal with a duty ratio of 1: 1 is obtained by dividing fs. It may be generated and used.

さらに、上述の実施例では、制御回路13およびサンプリング回路20を主にデータラッチで構成するとしたが、本発明はこれに限られるものではなく、同等の機能を有する他の回路構成を用いて実装しても良い。   Further, in the above-described embodiment, the control circuit 13 and the sampling circuit 20 are mainly configured by the data latch. However, the present invention is not limited to this, and is implemented using another circuit configuration having an equivalent function. You may do it.

さらに、上述の実施例では、説明のため、制御信号などは正論理、つまり、“H”でアクティブ、“L”で非アクティブであるとしたが、本発明はこれに限られるものではなく、例えば、負論理で回路を構成することもできる。   Furthermore, in the above-described embodiments, for the sake of explanation, the control signal and the like are positive logic, that is, active at “H” and inactive at “L”, but the present invention is not limited to this. For example, the circuit can be configured with negative logic.

本発明の実施例に係わる半導体装置を示す回路ブロック図。1 is a circuit block diagram showing a semiconductor device according to an embodiment of the present invention. 本発明の実施例に係わる半導体装置における制御回路を示す回路図。The circuit diagram which shows the control circuit in the semiconductor device concerning the Example of this invention. 本発明の実施例に係わる半導体装置におけるサンプリング回路を示す回路図。The circuit diagram which shows the sampling circuit in the semiconductor device concerning the Example of this invention. 本発明の実施例に係わる半導体装置の通常動作を示す波形図。The wave form diagram which shows the normal operation | movement of the semiconductor device concerning the Example of this invention. 本発明の実施例に係わる半導体装置におけるfcの異常を検出する動作を示す波形図。The wave form diagram which shows the operation | movement which detects abnormality of fc in the semiconductor device concerning the Example of this invention. 本発明の実施例に係わる半導体装置におけるfsの異常を検出する動作を示す波形図。The wave form diagram which shows the operation | movement which detects abnormality of fs in the semiconductor device concerning the Example of this invention.

符号の説明Explanation of symbols

11 計数部
12 判定部
13 制御回路
14、15 カウンタ
16 セレクタ
17 上限値レジスタ
18 下限値レジスタ
19 比較器
20 サンプリング回路
11 Counting unit 12 Determination unit 13 Control circuit 14, 15 Counter 16 Selector 17 Upper limit register 18 Lower limit register 19 Comparator 20 Sampling circuit

Claims (3)

同期していない周期の異なる第1および第2のクロック信号が入力され、前記第2のクロック信号に基づく所定の期間、前記第1のクロック信号のクロック数をカウントし、当該カウント値を出力する計数手段と、
前記計数手段からの前記カウント値が所定の範囲にない場合に、前記第1または前記第2のクロック信号の異常を示すエラー信号を出力する判定手段を有することを特徴とする半導体装置。
First and second clock signals having different periods that are not synchronized are input, the number of clocks of the first clock signal is counted for a predetermined period based on the second clock signal, and the count value is output. Counting means;
A semiconductor device comprising: determination means for outputting an error signal indicating an abnormality of the first or second clock signal when the count value from the counting means is not within a predetermined range.
前記判定手段は、
前記所定の範囲の上限を示す上限値を保持している第1の記憶手段と、
前記所定の範囲の下限を示す下限値を保持している第2の記憶手段と、
前記第1および前記第2の記憶手段に保持された値と前記計数手段が出力する前記カウント値を比較し、当該カウント値が前記上限値と前記下限値の間の値である時に“OK”を出力し、それ以外の時はエラーを示す“NG”を出力する比較手段と、
前記第2のクロック信号に基づいて、所定のタイミングでの前記比較手段の出力を1周期の間保持する第3の記憶手段を具備することを特徴とする請求項1に記載の半導体装置。
The determination means includes
First storage means for holding an upper limit value indicating the upper limit of the predetermined range;
Second storage means holding a lower limit value indicating the lower limit of the predetermined range;
The values held in the first and second storage means are compared with the count value output from the counting means, and when the count value is between the upper limit value and the lower limit value, “OK” Comparing means for outputting "NG" otherwise, indicating "NG",
2. The semiconductor device according to claim 1, further comprising third storage means for holding the output of the comparison means at a predetermined timing for one period based on the second clock signal.
前記計数手段は、
前記第2のクロック信号に基づいて第1および第2の状態を周期的に交互に繰り返す第1の制御信号と、前記第1の制御信号の反転信号である第2および第3の制御信号とを生成し出力する制御手段と、
前記第1の制御信号が前記第1の状態にある時に、前記第1のクロック信号をカウントアップし出力する第1のカウンタと、
前記第2の制御信号が前記第1の状態にある時に、前記第1のクロック信号をカウントアップし出力する第2のカウンタと、
前記第3の制御信号が前記第1の状態にある時に、前記第2のカウンタからの出力を選択し、前記第3の制御信号が前記第2の状態にある時に、前記第1のカウンタからの出力を選択して、カウンタ値として出力するセレクタを具備することを特徴とする請求項1に記載の半導体装置。
The counting means includes
A first control signal that periodically and alternately repeats the first and second states based on the second clock signal; and second and third control signals that are inverted signals of the first control signal; Control means for generating and outputting
A first counter that counts up and outputs the first clock signal when the first control signal is in the first state;
A second counter for counting up and outputting the first clock signal when the second control signal is in the first state;
When the third control signal is in the first state, the output from the second counter is selected, and when the third control signal is in the second state, from the first counter The semiconductor device according to claim 1, further comprising a selector that selects the output of the output and outputs the output as a counter value.
JP2004205430A 2004-07-13 2004-07-13 Semiconductor device Pending JP2006031133A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004205430A JP2006031133A (en) 2004-07-13 2004-07-13 Semiconductor device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004205430A JP2006031133A (en) 2004-07-13 2004-07-13 Semiconductor device

Publications (1)

Publication Number Publication Date
JP2006031133A true JP2006031133A (en) 2006-02-02

Family

ID=35897444

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004205430A Pending JP2006031133A (en) 2004-07-13 2004-07-13 Semiconductor device

Country Status (1)

Country Link
JP (1) JP2006031133A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010268105A (en) * 2009-05-13 2010-11-25 Renesas Electronics Corp Microcomputer
JP2011059851A (en) * 2009-09-08 2011-03-24 Renesas Electronics Corp Semiconductor integrated circuit and abnormal oscillation detection method for semiconductor integrated circuit
KR20160024581A (en) 2014-08-26 2016-03-07 삼성전자주식회사 Clock monitor and system on chip including the same

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010268105A (en) * 2009-05-13 2010-11-25 Renesas Electronics Corp Microcomputer
JP2011059851A (en) * 2009-09-08 2011-03-24 Renesas Electronics Corp Semiconductor integrated circuit and abnormal oscillation detection method for semiconductor integrated circuit
KR20160024581A (en) 2014-08-26 2016-03-07 삼성전자주식회사 Clock monitor and system on chip including the same
US9391615B2 (en) 2014-08-26 2016-07-12 Samsung Electronics Co., Ltd. Clock monitor and system on chip including the same

Similar Documents

Publication Publication Date Title
US8395417B2 (en) Digital noise filter
US8369477B2 (en) Clock frequency divider circuit and clock frequency division method
US6333646B1 (en) Abnormal clock detector and abnormal clock detecting apparatus
JP2009111824A (en) High-frequency clock detection circuit
JP2007293682A (en) Circuit and method for detecting clock abnormality
US8525597B2 (en) Clock frequency overshoot detection circuit
EP1237282B1 (en) Circuit for the detection of clock signal period abnormalities
JP2011147058A (en) Clock device
JP2011059851A (en) Semiconductor integrated circuit and abnormal oscillation detection method for semiconductor integrated circuit
US6469544B2 (en) Device for detecting abnormality of clock signal
US8552806B2 (en) Apparatus for supplying clock and method thereof
JP2009118449A (en) Circuit and method for clock data recovery for highly integrated system
JP2006031133A (en) Semiconductor device
JP4819707B2 (en) Redundant computing system and computing unit
JP2005252447A (en) Lock detection circuit and method
US7135939B2 (en) Semiconductor device including an external oscillation circuit
US11184011B2 (en) Clock detection and automatic PLL output bypass switching for an audio processor
US6825705B2 (en) Clock signal generation circuit and audio data processing apparatus
JP5171379B2 (en) Frequency abnormality detection circuit
EP3812874A1 (en) Glitch-free clock multiplexer
JP2010045499A (en) Flip-flop circuit
JP2006252265A (en) Microcontroller
WO2008026283A1 (en) Clock monitoring circuit, information processing apparatus and clock monitoring method
JP2003186863A (en) Reception circuit
JP2013187715A (en) Clock monitor device