JP2013098614A - Semiconductor device - Google Patents

Semiconductor device Download PDF

Info

Publication number
JP2013098614A
JP2013098614A JP2011237044A JP2011237044A JP2013098614A JP 2013098614 A JP2013098614 A JP 2013098614A JP 2011237044 A JP2011237044 A JP 2011237044A JP 2011237044 A JP2011237044 A JP 2011237044A JP 2013098614 A JP2013098614 A JP 2013098614A
Authority
JP
Japan
Prior art keywords
trimming
value
register
frequency
upper limit
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
JP2011237044A
Other languages
Japanese (ja)
Inventor
Wataru Kurihara
渉 栗原
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Renesas Electronics Corp
Original Assignee
Renesas Electronics Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Renesas Electronics Corp filed Critical Renesas Electronics Corp
Priority to JP2011237044A priority Critical patent/JP2013098614A/en
Publication of JP2013098614A publication Critical patent/JP2013098614A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Semiconductor Integrated Circuits (AREA)
  • Inductance-Capacitance Distribution Constants And Capacitance-Resistance Oscillators (AREA)

Abstract

PROBLEM TO BE SOLVED: To enable the setting of an arbitrary tolerance of oscillation frequency variation.SOLUTION: A semiconductor device (21) includes: an oscillator (12) whose oscillation frequency is changed by a trimming value held in a trimming register (11); and a correction circuit (20) capable of correcting the oscillation frequency. The correction circuit includes: an upper limit value register (6) capable of setting an upper limit value; a lower limit value register (7) capable of setting a lower limit value; a frequency division circuit (13) for dividing the oscillation frequency; and a counter (3) for counting an output of the frequency division circuit. The correction circuit further includes: a buffer register (4) capable of holding an output of the counter; a comparator (5) for determining whether or not the value held in the buffer register is between the upper limit value and the lower limit value; and a trimming value correction control circuit (8) for correcting the trimming value on the basis of the result of determination. A user can set an arbitrary tolerance of oscillation frequency variation with the use of the upper limit value and the lower limit value.

Description

本発明は、半導体装置、さらにはそれに含まれる内蔵発振器(OCO;On-Chip Oscillator)における発振周波数変動の許容範囲を半導体装置のユーザ(顧客)が任意に設定可能とするための技術に関する。   The present invention relates to a technique for allowing a user (customer) of a semiconductor device to arbitrarily set an allowable range of oscillation frequency fluctuations in a semiconductor device, and further, an internal oscillator (OCO; On-Chip Oscillator) included in the semiconductor device.

特許文献1には、マイクロコンピュータのシステムクロックにばらつきが発生しても精度の高いカウント動作を実現するためのタイマ装置が記載されている。   Patent Document 1 describes a timer device for realizing a highly accurate count operation even if a variation occurs in the system clock of a microcomputer.

特許文献2には、マイクロコンピュータのシステムクロック発振器周波数を高精度に保ち、且つ、切り換えることができる発振制御装置が記載されている。   Patent Document 2 describes an oscillation control device that can maintain and switch the system clock oscillator frequency of a microcomputer with high accuracy.

特開2004−334577号公報Japanese Patent Laid-Open No. 2004-334577 特開平7−15237号公報Japanese Patent Laid-Open No. 7-15237

本願発明者は、半導体装置の一例とされるマイクロコンピュータの内蔵発振器について検討し、以下の課題を見いだした。   The inventor of the present application has studied a built-in oscillator of a microcomputer, which is an example of a semiconductor device, and has found the following problems.

内蔵発振器の周波数は温度依存性があり、広範囲の温度で高精度な周波数を保つためには、常時周波数トリミングを行うことで周波数を補正する必要がある。しかも、内蔵発振器の発振周波数やその変動の許容範囲は、マイクロコンピュータが搭載されるシステムによって異なる。特許文献1,2によれば、発振周波数の補正は可能であるが、発振周波数変動の許容範囲を任意に設定することができない。例えばマイクロコンピュータに内蔵される発振器の発振周波数を40〔MHz〕±1.0%保証をユーザが望んでいるにもかかわらず、そのような設定をユーザ自身がマイクロコンピュータに対して行うことができない。   The frequency of the built-in oscillator is temperature dependent, and in order to maintain a highly accurate frequency over a wide range of temperatures, it is necessary to always correct the frequency by performing frequency trimming. In addition, the oscillation frequency of the built-in oscillator and the allowable range of its variation vary depending on the system in which the microcomputer is mounted. According to Patent Documents 1 and 2, the oscillation frequency can be corrected, but the allowable range of oscillation frequency fluctuation cannot be arbitrarily set. For example, although the user wants to guarantee the oscillation frequency of an oscillator built in the microcomputer to 40 [MHz] ± 1.0%, the user cannot make such a setting for the microcomputer. .

本発明の目的は、内蔵発振器における発振周波数変動の許容範囲を任意に設定可能な半導体装置を提供することにある。   An object of the present invention is to provide a semiconductor device capable of arbitrarily setting an allowable range of oscillation frequency fluctuations in a built-in oscillator.

本発明の前記並びにその他の目的と新規な特徴は本明細書の記述及び添付図面から明らかになるであろう。   The above and other objects and novel features of the present invention will be apparent from the description of this specification and the accompanying drawings.

本願において開示される発明のうち代表的なものの概要を簡単に説明すれば下記の通りである。   The following is a brief description of an outline of typical inventions disclosed in the present application.

すなわち、半導体装置は、トリミング値を格納可能なトリミングレジスタと、上記トリミングレジスタ内のトリミング値に応じて発振周波数が変更される発振器と、上記発振器の発振周波数を補正可能な補正回路とを含む。このとき上記補正回路は、周波数トリミングについての上限値を設定可能な上限値レジスタと、周波数トリミングについての下限値を設定可能な下限値レジスタと、上記発振器の発振周波数を分周するための分周回路と、上記分周回路の出力をカウントするカウンタとを含む。さらに上記補正回路は、上記カウンタの出力を保持可能なバッファレジスタと、上記バッファレジスタの保持値が、上記上限値レジスタの保持値と上記下限値レジスタの保持値との間に入っているか否かを判別するための比較器と、上記比較器での判別結果に基づいて上記トリミングレジスタのトリミング値を補正するトリミング値補正制御回路とを含む。   That is, the semiconductor device includes a trimming register capable of storing a trimming value, an oscillator whose oscillation frequency is changed according to the trimming value in the trimming register, and a correction circuit capable of correcting the oscillation frequency of the oscillator. At this time, the correction circuit includes an upper limit value register that can set an upper limit value for frequency trimming, a lower limit value register that can set a lower limit value for frequency trimming, and a frequency divider for dividing the oscillation frequency of the oscillator. A circuit and a counter for counting the output of the frequency dividing circuit. Further, the correction circuit includes a buffer register capable of holding the output of the counter, and whether or not the holding value of the buffer register is between the holding value of the upper limit register and the holding value of the lower limit register. And a trimming value correction control circuit for correcting the trimming value of the trimming register based on the discrimination result of the comparator.

本願において開示される発明のうち代表的なものによって得られる効果を簡単に説明すれば下記のとおりである。   The effects obtained by the representative ones of the inventions disclosed in the present application will be briefly described as follows.

すなわち、内蔵発振器における発振周波数変動の許容範囲を任意に設定可能な半導体装置を提供することができる。   That is, it is possible to provide a semiconductor device capable of arbitrarily setting an allowable range of oscillation frequency fluctuations in the built-in oscillator.

本発明にかかる半導体装置の一例とされるマイクロコンピュータの構成例ブロック図である。1 is a block diagram illustrating a configuration example of a microcomputer as an example of a semiconductor device according to the present invention. 図1に示されるマイクロコンピュータにおける主要部の動作の流れを示すフローチャートである。It is a flowchart which shows the flow of operation | movement of the principal part in the microcomputer shown by FIG. 図1に示されるマイクロコンピュータにおける主要部の動作タイミング図である。FIG. 2 is an operation timing chart of a main part in the microcomputer shown in FIG. 1. 図1に示されるマイクロコンピュータにおける主要部の動作タイミング図である。FIG. 2 is an operation timing chart of a main part in the microcomputer shown in FIG. 1. 本発明にかかる半導体装置の一例とされるマイクロコンピュータの別の構成例ブロック図である。FIG. 11 is a block diagram showing another configuration example of a microcomputer as an example of a semiconductor device according to the present invention.

1.実施の形態の概要
先ず、本願において開示される発明の代表的な実施の形態について概要を説明する。代表的な実施の形態についての概要説明で括弧を付して参照する図面中の参照符号はそれが付された構成要素の概念に含まれるものを例示するに過ぎない。
1. First, an outline of a typical embodiment of the invention disclosed in the present application will be described. Reference numerals in the drawings referred to in parentheses in the outline description of the representative embodiments merely exemplify what are included in the concept of the components to which the reference numerals are attached.

〔1〕本発明の代表的な実施の形態に係る半導体装置(21)は、トリミング値を格納可能なトリミングレジスタ(11)と、上記トリミングレジスタ内のトリミング値に応じて発振周波数が変更される発振器(12)と、上記発振器の発振周波数を補正可能な補正回路(20)とを含む。上記補正回路は、周波数トリミングについての上限値を設定可能な上限値レジスタ(6)と、周波数トリミングについての下限値を設定可能な下限値レジスタ(7)と、上記発振器の発振周波数を分周するための分周回路(13)と、上記分周回路の出力をカウントするカウンタ(3)とを含む。さらに上記補正回路は、上記カウンタの出力を保持可能なバッファレジスタ(4)と、上記バッファレジスタの保持値が、上記上限値レジスタの保持値と上記下限値レジスタの保持値との間に入っているか否かを判別するための比較器(5)と、上記比較器での判別結果に基づいて上記トリミングレジスタのトリミング値を補正するトリミング値補正制御回路(8)とを含む。   [1] In a semiconductor device (21) according to a typical embodiment of the present invention, a trimming register (11) capable of storing a trimming value and an oscillation frequency are changed according to the trimming value in the trimming register. An oscillator (12) and a correction circuit (20) capable of correcting the oscillation frequency of the oscillator are included. The correction circuit divides the oscillation frequency of the oscillator, and an upper limit value register (6) capable of setting an upper limit value for frequency trimming, a lower limit value register (7) capable of setting a lower limit value for frequency trimming. And a counter (3) that counts the output of the frequency divider circuit. Further, the correction circuit includes a buffer register (4) capable of holding the output of the counter, and a holding value of the buffer register between the holding value of the upper limit register and the holding value of the lower limit register. A comparator (5) for determining whether or not there is a trimming value, and a trimming value correction control circuit (8) for correcting the trimming value of the trimming register based on the determination result of the comparator.

上記の構成によれば、上限値及び下限値の設定後は、トリミング値補正制御回路8によってトリミング値が補正されるため、発信周波数の安定化を図ることができる。半導体装置のユーザは、用途に応じて、発振器における発振周波数変動の許容範囲を任意に設定することができる。また、この設定は、上限値と下限値とをそれぞれ上限値レジスタ及び下限値レジスタに設定するだけで良いので容易である。   According to the above configuration, since the trimming value is corrected by the trimming value correction control circuit 8 after the upper limit value and the lower limit value are set, the transmission frequency can be stabilized. A user of the semiconductor device can arbitrarily set an allowable range of oscillation frequency fluctuation in the oscillator according to the application. This setting is easy because it is only necessary to set the upper limit value and the lower limit value in the upper limit register and the lower limit register, respectively.

〔2〕上記〔1〕における半導体装置は、上記発振器の発振周波数のトリミング値を保持する不揮発性メモリ(18,19)を含み、パワーオンリセット処理において、上記不揮発性メモリの保持値が上記トリミングレジスタに書き込まれるように構成することができる。   [2] The semiconductor device according to [1] includes a non-volatile memory (18, 19) that holds a trimming value of the oscillation frequency of the oscillator, and in the power-on reset process, the holding value of the non-volatile memory is the trimming value. It can be configured to be written to a register.

〔3〕上記〔2〕において、上記トリミング値補正回路によって上記トリミングレジスタのトリミング値が補正された場合に、当該補正後のトリミング値によって、不揮発性メモリ(19)内のトリミング値が更新されるように構成することができる。これにより、パワーオンリセット処理後の上記トリミングレジスタの初期値は、前回の電源遮断直前のトリミング値となるので、半導体装置に電源が投入されてから発振周波数が安定するまでの時間短縮を図ることができる。   [3] In the above [2], when the trimming value of the trimming register is corrected by the trimming value correction circuit, the trimming value in the nonvolatile memory (19) is updated with the corrected trimming value. It can be constituted as follows. As a result, the initial value of the trimming register after the power-on reset process is the trimming value immediately before the previous power-off, so the time until the oscillation frequency stabilizes after the power is turned on to the semiconductor device is reduced. Can do.

2.実施の形態の詳細
実施の形態について更に詳述する。
2. Details of Embodiments Embodiments will be further described in detail.

《実施の形態1》
図1には、本発明にかかる半導体装置の一例とされるマイクロコンピュータの構成例が示される。
Embodiment 1
FIG. 1 shows a configuration example of a microcomputer as an example of a semiconductor device according to the present invention.

図1に示されるマイクロコンピュータ21は、特に制限されないが、公知の半導体集積回路製造技術により、単結晶シリコンなどの一つの半導体基板に形成される。   The microcomputer 21 shown in FIG. 1 is not particularly limited, but is formed on one semiconductor substrate such as single crystal silicon by a known semiconductor integrated circuit manufacturing technique.

図1に示されるマイクロコンピュータ21は、OCO周波数トリミングレジスタ11、OCO(On-Chip Oscillator;内蔵発振器)12、SUBクロック発振器14、CPU(Central Processing Unit)16、RAM(Random Access Memory)17、ROM(Read Only Memory)18、OCO周波数自動補正回路20を含む。OCO周波数トリミングレジスタ11、CPU16、RAM17、ROM18、OCO周波数自動補正回路20は、内部データバス15を介して、互いに信号のやり取りが可能に結合されている。   1 includes an OCO frequency trimming register 11, an OCO (On-Chip Oscillator) 12, a SUB clock oscillator 14, a CPU (Central Processing Unit) 16, a RAM (Random Access Memory) 17, and a ROM. (Read Only Memory) 18 and an OCO frequency automatic correction circuit 20 are included. The OCO frequency trimming register 11, the CPU 16, the RAM 17, the ROM 18, and the OCO frequency automatic correction circuit 20 are coupled to each other via the internal data bus 15 so that signals can be exchanged.

OCO周波数トリミングレジスタ11は、OCO周波数のトリミング値を保持する。OCO12は、OCO周波数トリミングレジスタ11内のトリミング値に応じて発振周波数が変更される発振器とされる。SUBクロック発振器14は、32〔kHz〕のSUBクロック(基準クロック)を生成する。この32〔kHz〕のSUBクロックは、マイクロコンピュータ21に外付けされた水晶振動子によって形成されるため、周波数が安定している。このSUBクロック発振器14で発生されたSUBクロック信号は、OCO周波数自動補正回路20に供給される。CPU16は予め設定されたプログラムを実行することにより所定の演算処理を実行する。RAM17は、CPU16での演算処理の作業領域などに利用される。ROM18は不揮発性メモリであり、このROM18には、CPU16で実行されるプログラムや、OCOトリミングレジスタ値が格納されている。ROM18内のOCOトリミングレジスタ値は、マイクロコンピュータ21の工場出荷前に書き込まれたものである。ROM18内のOCOトリミングレジスタ値は、CPU16で実行されるパワーオンリセット処理によってOCO周波数トリミングレジスタ11にその初期値として設定される。   The OCO frequency trimming register 11 holds a trimming value of the OCO frequency. The OCO 12 is an oscillator whose oscillation frequency is changed according to the trimming value in the OCO frequency trimming register 11. The SUB clock oscillator 14 generates a SUB clock (reference clock) of 32 [kHz]. Since this 32 [kHz] SUB clock is formed by a crystal resonator externally attached to the microcomputer 21, the frequency is stable. The SUB clock signal generated by the SUB clock oscillator 14 is supplied to the OCO frequency automatic correction circuit 20. The CPU 16 executes a predetermined calculation process by executing a preset program. The RAM 17 is used as a work area for arithmetic processing in the CPU 16. The ROM 18 is a non-volatile memory, and the ROM 18 stores a program executed by the CPU 16 and an OCO trimming register value. The OCO trimming register value in the ROM 18 is written before the microcomputer 21 is shipped from the factory. The OCO trimming register value in the ROM 18 is set as the initial value in the OCO frequency trimming register 11 by the power-on reset process executed by the CPU 16.

OCO周波数自動補正回路20は、特に制限されないが、SUBクロック分周回路1、エッジ選択回路2、カウンタ3、バッファレジスタ4、比較器5、上限値レジスタ6、下限値レジスタ7、トリミング値補正制御回路8、フラグステータスレジスタ9、トリミング値補正コントロールレジスタ10、OCO分周回路13を含む。SUBクロック分周回路1は、SUBクロック発振器14から出力されたSUBクロック信号を分周する。SUBクロック信号の周期をφとするとき、SUBクロック分周回路1の分周出力は、例えばφ,φ/32,φ/128,φ/1024,φ/8192とされる。エッジ選択回路2は、SUBクロック分周回路1の出力に基づいて、カウンタ3でのカウント動作を制御するための測定用クロック信号SCKを形成する。測定用クロック信号SCKは、SUBクロック分周回路1の出力波形の立ち上がりエッジ、波形立ち下がりエッジ、波形立ち上がり立ち下がり両エッジの何れかに基づいて形成される。OCO分周回路13は、OCO12から出力されたOCOクロック信号を分周する。OCOクロック信号の周期をφとするとき、OCO分周回路13の分周出力は、例えばφ,φ/2,φ/4,φ/8,φ/40とされる。OCO分周回路13の分周出力は、マイクロコンピュータ21内の内部回路に供給される。カウンタ3は、クロック監視イネーブル信号CKNがイネーブル状態のとき、エッジ選択回路2によって形成された測定用クロック信号SCKに基づいて、OCO分周回路13の出力をカウントする。クロック監視イネーブル信号CKNは、CPU16で形成することができる。バッファレジスタ4は、カウンタ3のカウント値を保持する。カウント値がバッファレジスタ4に保持された時点でカウンタ3がクリアされ、次の測定が開始される。上限値レジスタ6は、周波数トリミングについての上限値を保持する。下限値レジスタ7は、周波数トリミングについての下限値を保持する。周波数トリミングについての上限値や下限値は、CPU16によって設定することができる。比較器5は、バッファレジスタ4の保持値が、上限値レジスタ6の保持値と下限値レジスタ7の保持値との間に入っているか否かを判別する。トリミング値補正制御回路8は、比較器5での判別結果に基づいて、OCO周波数トリミングレジスタ11内のトリミング値の補正を制御する。トリミング値補正制御回路8は、バッファレジスタ4の保持値が、上限値レジスタ6の保持値と下限値レジスタ7の保持値との間に入っている場合にはトリミング値の補正を行わない。トリミング値補正制御回路8は、バッファレジスタ4の保持値が、上限値レジスタ6の保持値より大きい場合、OCO周波数を下げるようにOCO周波数トリミングレジスタ11内のトリミング値を補正する。トリミング値補正制御回路8は、バッファレジスタ4の保持値が、下限値レジスタの保持値より小さい場合には、OCO周波数を上げるようにOCO周波数トリミングレジスタ11内のトリミング値を補正する。フラグステータスレジスタ9は、周波数正常フラグ、上限オーバーフラグの状態及び下限未達フラグの状態を保持する。バッファレジスタ4の保持値が、上限値レジスタ6の保持値より大きい場合、トリミング値補正制御回路8によって、フラグステータスレジスタ9内の上限オーバーフラグが立てられる。バッファレジスタ4の保持値が、下限値レジスタ7の保持値より小さい場合、トリミング値補正制御回路8によって、フラグステータスレジスタ9内の下限未達フラグが立てられる。CPU16は、内部データバス15を介して、上限オーバーフラグの状態や下限未達フラグの状態をモニタすることができる。トリミング値補正コントロールレジスタ10には、トリミング値補正コントロール信号(命令)が設定される。このトリミング値補正コントロール信号は、内部データバス15を介してCPU16によって設定される。トリミング値補正制御回路8の動作は、トリミング値補正コントロールレジスタ10に設定されたトリミング値補正コントロール信号によって制御される。   The OCO frequency automatic correction circuit 20 is not particularly limited, but includes a SUB clock dividing circuit 1, an edge selection circuit 2, a counter 3, a buffer register 4, a comparator 5, an upper limit register 6, a lower limit register 7, and trimming value correction control. A circuit 8, a flag status register 9, a trimming value correction control register 10, and an OCO frequency dividing circuit 13 are included. The SUB clock dividing circuit 1 divides the SUB clock signal output from the SUB clock oscillator 14. When the period of the SUB clock signal is φ, the divided outputs of the SUB clock frequency dividing circuit 1 are, for example, φ, φ / 32, φ / 128, φ / 1024, φ / 8192. The edge selection circuit 2 forms a measurement clock signal SCK for controlling the counting operation of the counter 3 based on the output of the SUB clock frequency dividing circuit 1. The measurement clock signal SCK is formed based on one of the rising edge, the waveform falling edge, and both the waveform rising and falling edges of the output waveform of the SUB clock divider circuit 1. The OCO divider circuit 13 divides the OCO clock signal output from the OCO 12. When the cycle of the OCO clock signal is φ, the frequency-divided outputs of the OCO frequency dividing circuit 13 are, for example, φ, φ / 2, φ / 4, φ / 8, and φ / 40. The frequency-divided output of the OCO frequency dividing circuit 13 is supplied to an internal circuit in the microcomputer 21. The counter 3 counts the output of the OCO frequency dividing circuit 13 based on the measurement clock signal SCK formed by the edge selection circuit 2 when the clock monitoring enable signal CKN is enabled. The clock monitoring enable signal CKN can be formed by the CPU 16. The buffer register 4 holds the count value of the counter 3. When the count value is held in the buffer register 4, the counter 3 is cleared and the next measurement is started. The upper limit register 6 holds an upper limit value for frequency trimming. The lower limit register 7 holds a lower limit value for frequency trimming. The upper limit value and the lower limit value for frequency trimming can be set by the CPU 16. The comparator 5 determines whether or not the holding value of the buffer register 4 is between the holding value of the upper limit register 6 and the holding value of the lower limit register 7. The trimming value correction control circuit 8 controls the correction of the trimming value in the OCO frequency trimming register 11 based on the determination result in the comparator 5. The trimming value correction control circuit 8 does not correct the trimming value when the holding value of the buffer register 4 is between the holding value of the upper limit register 6 and the holding value of the lower limit register 7. The trimming value correction control circuit 8 corrects the trimming value in the OCO frequency trimming register 11 so as to lower the OCO frequency when the holding value of the buffer register 4 is larger than the holding value of the upper limit value register 6. The trimming value correction control circuit 8 corrects the trimming value in the OCO frequency trimming register 11 so as to increase the OCO frequency when the holding value of the buffer register 4 is smaller than the holding value of the lower limit value register. The flag status register 9 holds the state of the frequency normal flag, the upper limit over flag, and the lower limit unachieved flag. When the holding value of the buffer register 4 is larger than the holding value of the upper limit value register 6, the trimming value correction control circuit 8 sets the upper limit over flag in the flag status register 9. When the holding value of the buffer register 4 is smaller than the holding value of the lower limit value register 7, the trimming value correction control circuit 8 sets the lower limit unachieved flag in the flag status register 9. The CPU 16 can monitor the state of the upper limit over flag and the state of the lower limit unachieved flag via the internal data bus 15. A trimming value correction control signal (command) is set in the trimming value correction control register 10. This trimming value correction control signal is set by the CPU 16 via the internal data bus 15. The operation of the trimming value correction control circuit 8 is controlled by a trimming value correction control signal set in the trimming value correction control register 10.

次に、上記構成の動作について説明する。   Next, the operation of the above configuration will be described.

図2には、図1に示されるマイクロコンピュータ21における主要動作の流れが示される。また、図3及び図4には、図1に示されるマイクロコンピュータ21における主要部の動作タイミングが示される。   FIG. 2 shows a flow of main operations in the microcomputer 21 shown in FIG. 3 and 4 show the operation timing of the main part of the microcomputer 21 shown in FIG.

本例では、40〔MHz〕について、±1.0〔%〕保証を行う場合について説明する。   In this example, a case where ± 1.0 [%] is guaranteed for 40 [MHz] will be described.

CPU16によって、上限値レジスタ6及び下限値レジスタ7の設定が行われる(201)。上限値及び下限値として、40〔MHz〕±0.75〔%〕相当の値が格納される。±0.75〔%〕としているのは、±1.0〔%〕に対してマージンを持たせているためである。CPU16によって、クロック監視イネーブル信号CKNハイレベルに設定されると、カウンタ3でのカウント動作が開始される(202)。エッジ選択回路2によって測定用クロック信号SCKが形成される毎に、カウンタ3でのカウント値がバッファレジスタ4に保持され、それが比較器5において上限値及び下限値と比較される(203〜205)。本例の場合、32〔kHz〕の基準クロックに基づいて40〔MHz〕クロックを測定することから、カウンタ3でのカウント数は、理想的には、1/32k÷(1/40M)≒1250とされる。また本例において、上限値は1260(≒40.3〔MHz〕)とされ、下限値は1240(≒39.7〔MHz〕)とされる。   The CPU 16 sets the upper limit register 6 and the lower limit register 7 (201). Values corresponding to 40 [MHz] ± 0.75 [%] are stored as the upper limit value and the lower limit value. The reason of ± 0.75 [%] is that a margin is provided for ± 1.0 [%]. When the CPU 16 sets the clock monitor enable signal CKN to the high level, the count operation in the counter 3 is started (202). Each time the measurement clock signal SCK is formed by the edge selection circuit 2, the count value of the counter 3 is held in the buffer register 4 and compared with the upper limit value and the lower limit value in the comparator 5 (203 to 205). ). In the case of this example, 40 [MHz] clock is measured based on the 32 [kHz] reference clock, so the count number in the counter 3 is ideally 1 / 32k ÷ (1 / 40M) ≈1250. It is said. In this example, the upper limit value is 1260 (≈40.3 [MHz]), and the lower limit value is 1240 (≈39.7 [MHz]).

バッファレジスタ4の保持値が、上限値より大きくて、下限値よりも小さい場合(206)、不正状態とされ(207)、CPU16によるリセット又は所定の割り込み処理が行われる(208)。   When the held value of the buffer register 4 is larger than the upper limit value and smaller than the lower limit value (206), it is set in an illegal state (207), and reset or predetermined interrupt processing by the CPU 16 is performed (208).

図4に示されるように、OCO12の発振周波数が下限値(39.7〔MHz〕)以下の場合、すなわち、バッファレジスタ4の保持値が、上限値より小さくて、下限値よりも小さい場合には(209)、トリミング値補正制御回路8によって下限未達フラグが立てられる(210)。それによりOCO12での発振周波数を上げるようにOCO周波数トリミングレジスタ11のトリミング値が補正され、それによってOCO周波数トリミングレジスタ11のトリミング用タップ切り換えが行われることで発振周波数が上げられる(211)。   As shown in FIG. 4, when the oscillation frequency of the OCO 12 is equal to or lower than the lower limit value (39.7 [MHz]), that is, when the holding value of the buffer register 4 is smaller than the upper limit value and smaller than the lower limit value. (209), the trimming value correction control circuit 8 sets a lower limit unachieved flag (210). As a result, the trimming value of the OCO frequency trimming register 11 is corrected so as to increase the oscillation frequency in the OCO 12, and the oscillation frequency is raised by switching the trimming tap of the OCO frequency trimming register 11 (211).

図3に示されるように、OCO12の発振周波数が上限値(40.3〔MHz〕)以上の場合、すなわち、バッファレジスタ4の保持値が、上限値より大きくて、下限値よりも大きい場合には(212)、トリミング値補正制御回路8によって、フラグステータスレジスタ9内の上限オーバーフラグが立てられる(213)。それによりOCO12での発振周波数を下げるようにOCO周波数トリミングレジスタ11のトリミング値が補正され、それによってOCO12におけるトリミング用タップ切り換えが行われることで発振周波数が低下される(214)。   As shown in FIG. 3, when the oscillation frequency of the OCO 12 is equal to or higher than the upper limit value (40.3 [MHz]), that is, when the holding value of the buffer register 4 is larger than the upper limit value and larger than the lower limit value. (212), the trimming value correction control circuit 8 sets the upper limit over flag in the flag status register 9 (213). As a result, the trimming value of the OCO frequency trimming register 11 is corrected so as to lower the oscillation frequency in the OCO 12, and the oscillation frequency is lowered by switching the trimming tap in the OCO 12 (214).

バッファレジスタ4の保持値が、上限値より小さくて、下限値よりも大きい場合(215)、トリミング値補正制御回路8によって周波数正常フラグが立てられる(216)。この場合、トリミング値補正は行われない。   When the holding value of the buffer register 4 is smaller than the upper limit value and larger than the lower limit value (215), the frequency normality flag is set by the trimming value correction control circuit 8 (216). In this case, trimming value correction is not performed.

上記マイクロコンピュータ21は、自動車の制御装置や、家電製品の制御装置などに適用することができ、ユーザは、用途に応じて、内蔵発振器12における発振周波数変動の許容範囲を任意に設定することができる。また、この設定は、CPU16を介して上限値と下限値とをそれぞれ上限値レジスタ6及び下限値レジスタ7に設定するだけで良いので容易である。上限値及び下限値の設定後は、トリミング値補正制御回路8によってOCO周波数のトリミング値が補正されるため、OCO周波数の安定化を図ることができる。   The microcomputer 21 can be applied to a control device for automobiles, a control device for home appliances, etc., and the user can arbitrarily set the allowable range of oscillation frequency fluctuations in the built-in oscillator 12 according to the application. it can. This setting is easy because it is only necessary to set the upper limit value and the lower limit value in the upper limit register 6 and the lower limit register 7 through the CPU 16, respectively. After the upper limit value and the lower limit value are set, the trimming value correction control circuit 8 corrects the trimming value of the OCO frequency, so that the OCO frequency can be stabilized.

《実施の形態2》
図5には、本発明にかかる半導体装置の一例とされるマイクロコンピュータの別の構成例が示される。図5に示されるマイクロコンピュータ21が、図1に示されるのと大きく相違するのは、ROM18に代えて、フラッシュメモリが設けられている点である。フラッシュメモリは、EEPROM(Electrically Erasable Programmable Read-Only Memory)の一種であり、記憶情報の書換えが可能な不揮発性メモリとされる。このフラッシュメモリ19には、CPU16で実行されるプログラムや、OCOトリミングレジスタ値が格納されている。また本例では、OCO周波数トリミングレジスタ11のトリミング値がトリミング値補正制御回路8によって補正された場合に、OCO周波数トリミングレジスタ11内の補正後のトリミング値によって、フラッシュメモリ19内のトリミング値が更新される。この更新は、CPU16の制御によって行われる。そして、マイクロコンピュータ21の電源が遮断されても、フラッシュメモリ19には、電源遮断直前のOCO周波数トリミングレジスタ11内のトリミング値が保持されている。そして、次にマイクロコンピュータ21に電源が投入された場合には、CPU16で実行されるパワーオンリセット処理において、フラッシュメモリ19内のトリミング値がOCO周波数トリミングレジスタ11に書き込まれる。これにより、パワーオンリセット処理後のOCO周波数トリミングレジスタ11の初期値は、前回の電源遮断直前のトリミング値となる。このため、図1に示されるマイクロコンピュータ21のように、工場出荷前に設定されたトリミング値を初期値とする場合に比べて、電源が投入されてから発振周波数が安定するまでの時間短縮を図ることができる。
<< Embodiment 2 >>
FIG. 5 shows another configuration example of a microcomputer as an example of a semiconductor device according to the present invention. The microcomputer 21 shown in FIG. 5 is greatly different from that shown in FIG. 1 in that a flash memory is provided in place of the ROM 18. The flash memory is a kind of EEPROM (Electrically Erasable Programmable Read-Only Memory) and is a nonvolatile memory capable of rewriting stored information. The flash memory 19 stores a program executed by the CPU 16 and an OCO trimming register value. Further, in this example, when the trimming value in the OCO frequency trimming register 11 is corrected by the trimming value correction control circuit 8, the trimming value in the flash memory 19 is updated by the corrected trimming value in the OCO frequency trimming register 11. Is done. This update is performed under the control of the CPU 16. Even when the power of the microcomputer 21 is shut off, the flash memory 19 holds the trimming value in the OCO frequency trimming register 11 immediately before the power is shut off. When the microcomputer 21 is turned on next time, the trimming value in the flash memory 19 is written to the OCO frequency trimming register 11 in the power-on reset process executed by the CPU 16. As a result, the initial value of the OCO frequency trimming register 11 after the power-on reset process is the trimming value immediately before the previous power shutdown. Therefore, as in the microcomputer 21 shown in FIG. 1, the time until the oscillation frequency is stabilized after the power is turned on can be shortened compared to the case where the trimming value set before factory shipment is used as the initial value. Can be planned.

以上、本発明者によってなされた発明を実施形態に基づいて具体的に説明したが、本発明はそれに限定されるものではなく、その要旨を逸脱しない範囲において種々変更可能であることは言うまでもない。   As mentioned above, although the invention made by this inventor was concretely demonstrated based on embodiment, it cannot be overemphasized that this invention is not limited to it and can be variously changed in the range which does not deviate from the summary.

1 SUBクロック分周回路
2 エッジ選択回路
3 カウンタ
4 バッファレジスタ
5 比較器
6 上限値レジスタ
7 下限値レジスタ
8 トリミング値補正制御回路
9 フラグステータスレジスタ
10 トリミング値補正コントロールレジスタ
11 OCO周波数トリミングレジスタ
12 OCO
13 OCO分周回路
14 SUBクロック発振器
15 内蔵データバス
16 CPU
17 RAM
18 ROM
19 フラッシュメモリ
DESCRIPTION OF SYMBOLS 1 SUB clock dividing circuit 2 Edge selection circuit 3 Counter 4 Buffer register 5 Comparator 6 Upper limit register 7 Lower limit register 8 Trimming value correction control circuit 9 Flag status register 10 Trimming value correction control register 11 OCO frequency trimming register 12 OCO
13 OCO Divider Circuit 14 SUB Clock Oscillator 15 Built-in Data Bus 16 CPU
17 RAM
18 ROM
19 Flash memory

Claims (3)

トリミング値を格納可能なトリミングレジスタと、
上記トリミングレジスタ内のトリミング値に応じて発振周波数が変更される発振器と、
上記発振器の発振周波数を補正可能な補正回路と、を含み、
上記補正回路は、
周波数トリミングについての上限値を設定可能な上限値レジスタと、
周波数トリミングについての下限値を設定可能な下限値レジスタと、
上記発振器の発振周波数を分周するための分周回路と、
上記分周回路の出力をカウントするカウンタと、
上記カウンタの出力を保持可能なバッファレジスタと、
上記バッファレジスタの保持値が、上記上限値レジスタの保持値と上記下限値レジスタの保持値との間に入っているか否かを判別するための比較器と、
上記比較器での判別結果に基づいて上記トリミングレジスタのトリミング値を補正するトリミング値補正制御回路と、を含んで成る半導体装置。
A trimming register capable of storing trimming values;
An oscillator whose oscillation frequency is changed according to the trimming value in the trimming register;
A correction circuit capable of correcting the oscillation frequency of the oscillator,
The correction circuit is
An upper limit register that can set an upper limit for frequency trimming;
A lower limit register that can set a lower limit for frequency trimming;
A frequency dividing circuit for dividing the oscillation frequency of the oscillator;
A counter that counts the output of the divider circuit;
A buffer register capable of holding the output of the counter;
A comparator for determining whether the holding value of the buffer register is between the holding value of the upper limit register and the holding value of the lower limit register;
A semiconductor device comprising: a trimming value correction control circuit that corrects a trimming value of the trimming register based on a result of determination by the comparator.
上記半導体装置は、上記発振器の発振周波数のトリミング値を保持する不揮発性メモリを含み、パワーオンリセット処理により、上記不揮発性メモリの保持値が上記トリミングレジスタに書き込まれる請求項1記載の半導体装置。   The semiconductor device according to claim 1, wherein the semiconductor device includes a non-volatile memory that holds a trimming value of an oscillation frequency of the oscillator, and the holding value of the non-volatile memory is written to the trimming register by a power-on reset process. 上記トリミング値補正回路によって上記トリミングレジスタのトリミング値が補正された場合に、当該補正後のトリミング値によって、上記不揮発性メモリ内のトリミング値が更新される請求項2記載の半導体装置。   3. The semiconductor device according to claim 2, wherein when the trimming value in the trimming register is corrected by the trimming value correction circuit, the trimming value in the nonvolatile memory is updated with the corrected trimming value.
JP2011237044A 2011-10-28 2011-10-28 Semiconductor device Pending JP2013098614A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011237044A JP2013098614A (en) 2011-10-28 2011-10-28 Semiconductor device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011237044A JP2013098614A (en) 2011-10-28 2011-10-28 Semiconductor device

Publications (1)

Publication Number Publication Date
JP2013098614A true JP2013098614A (en) 2013-05-20

Family

ID=48620166

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011237044A Pending JP2013098614A (en) 2011-10-28 2011-10-28 Semiconductor device

Country Status (1)

Country Link
JP (1) JP2013098614A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10116353B2 (en) 2015-10-28 2018-10-30 Samsung Electronics Co., Ltd. Contactless communication device and electronic system having the same

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10116353B2 (en) 2015-10-28 2018-10-30 Samsung Electronics Co., Ltd. Contactless communication device and electronic system having the same

Similar Documents

Publication Publication Date Title
US7536578B2 (en) Method and apparatus for over clocking in a digital processing system
US7449926B2 (en) Circuit for asynchronously resetting synchronous circuit
JP6441619B2 (en) Semiconductor device
JP5659855B2 (en) Calibration method and calibration apparatus
JP2011199481A (en) Clock system
JP2004355362A (en) Microcomputer and initialization method
US9966900B2 (en) Apparatus for oscillator with improved precision and associated methods
TWI638517B (en) Mitigation of long wake-up delay of a crystal oscillator
JP2013098614A (en) Semiconductor device
US8891302B2 (en) Electronic equipment
JP5045167B2 (en) Oscillation circuit and semiconductor device
JP2012047705A (en) Time correction device and control method
JP2000268019A (en) Semiconductor integrated circuit with built-in non- volatile memory circuit
JP2004258045A (en) Clock signal supply device, and its control method
JP6585977B2 (en) Semiconductor device and oscillation circuit control method
JP2014138094A (en) Semiconductor device
JP2002365383A (en) Temperature correction method of real-time clock and processor equipped with the real-time clock
JP5606003B2 (en) Display control device
JP2010067030A (en) Navigation apparatus
JP4216282B2 (en) Semiconductor integrated circuit device
JP2010066809A (en) Microcomputer
JP6013841B2 (en) Semiconductor device
JP2006010848A (en) Microcomputer with built-in display driver
JP2014038465A (en) Semiconductor integrated circuit device
JP2006209186A (en) Clock control device and electronic device