JP2000268019A - Semiconductor integrated circuit with built-in non- volatile memory circuit - Google Patents

Semiconductor integrated circuit with built-in non- volatile memory circuit

Info

Publication number
JP2000268019A
JP2000268019A JP6980399A JP6980399A JP2000268019A JP 2000268019 A JP2000268019 A JP 2000268019A JP 6980399 A JP6980399 A JP 6980399A JP 6980399 A JP6980399 A JP 6980399A JP 2000268019 A JP2000268019 A JP 2000268019A
Authority
JP
Japan
Prior art keywords
frequency
counter
oscillator
semiconductor integrated
circuit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP6980399A
Other languages
Japanese (ja)
Inventor
Naoki Yada
直樹 矢田
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.)
Hitachi Ltd
Hitachi Solutions Technology Ltd
Original Assignee
Hitachi Ltd
Hitachi ULSI 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 Hitachi Ltd, Hitachi ULSI Systems Co Ltd filed Critical Hitachi Ltd
Priority to JP6980399A priority Critical patent/JP2000268019A/en
Publication of JP2000268019A publication Critical patent/JP2000268019A/en
Withdrawn legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To enable the write and erasure of a memory by forming a write pulse or erase pulse having an exact pulse width even when an oscillation frequency is dispersed by a process dispersion in the semiconductor integrated circuit of a microcomputer or the like with built-in non-volatile memory circuit and oscillator. SOLUTION: The semiconductor integrated circuit of the microcomputer or the like with built-in non-volatile memory circuit and oscillator is provided with trimming circuits capable of regulating the oscillation frequency of an internal oscillator(OSC), a first counter 31 for counting the oscillation frequency of the oscillator, a second counter 32 for counting a clock supplied from the outside or clock derived from that clock and a frequency measuring means (CPU 34) for comparing the count value of the first counter with the count value of the second counter and discriminating one frequency from the other frequency.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、電気的に書込み消
去可能な不揮発性メモリ回路の書込み時間および消去時
間(パルス幅)の設定に適用して有効な技術に関し、例
えばブロック単位で一括してデータの消去が可能なフラ
ッシュメモリを内蔵したマイクロコンピュータに利用し
て有効な技術に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a technique which is effective when applied to setting of a writing time and an erasing time (pulse width) of an electrically writable and erasable nonvolatile memory circuit. The present invention relates to a technology that is effective when used in a microcomputer having a built-in flash memory capable of erasing data.

【0002】[0002]

【従来の技術】フラッシュメモリは、コントロールゲー
トおよびフローティングゲートを有する不揮発性記憶素
子をメモリセルに使用しており、1個のトランジスタで
メモリセルを構成することができる。かかるフラッシュ
メモリにおいては、書き込み動作では、不揮発性記憶素
子のドレイン領域に例えば6.7V(ボルト)のような
電圧を印加し、コントロールゲートが接続されたワード
線には例えば−10.0Vの書込みパルスを印加にする
ことにより、フローティングゲートから電荷をドレイン
領域へ引き抜いて、しきい値電圧を低い状態(論理
“0”)にする。また、消去動作では、ソース領域およ
び基体(ウェル領域)を例えば−10.0Vにし、コン
トローゲートに例えば10.5Vのような高電圧のパル
スを印加してフローティングゲートに負電荷を注入して
しきい値を高い状態(論理“1”)にする。これにより
1つの記憶素子に1ビットのデータを記憶させるように
している。
2. Description of the Related Art A flash memory uses a nonvolatile memory element having a control gate and a floating gate as a memory cell, and the memory cell can be constituted by one transistor. In such a flash memory, in a write operation, a voltage of, for example, 6.7 V (volt) is applied to the drain region of the nonvolatile memory element, and a write of, for example, -10.0 V is applied to the word line to which the control gate is connected. By applying a pulse, charges are extracted from the floating gate to the drain region, and the threshold voltage is set to a low state (logic "0"). In the erasing operation, the source region and the base (well region) are set to, for example, -10.0 V, a high voltage pulse such as 10.5 V is applied to the control gate, and negative charges are injected into the floating gate. The threshold is set to a high state (logic "1"). Thus, one bit of data is stored in one storage element.

【0003】[0003]

【発明が解決しようとする課題】フラッシュメモリにお
いては、書込み動作や消去動作時に記憶素子に印加され
るパルスは素子の特性によってそれぞれ所定のパルス幅
を有するように制御する必要がある。このようなパルス
は、内部に書込み処理や消去処理を実行するシーケンサ
を有するフラッシュメモリにおいては、メーカによって
最適のパルス幅の書込みパルスや消去パルスが形成され
て印加されるように構成されるが、そのようなシーケン
サを持たないフラッシュメモリ内蔵マイクロコンピュー
タ等のLSIにおいては、ソフトウェアによって書込み
処理や消去処理等が実行されるようになっている。
In a flash memory, it is necessary to control a pulse applied to a storage element during a write operation or an erase operation so as to have a predetermined pulse width depending on the characteristics of the element. Such a pulse is configured such that a write pulse or an erase pulse having an optimum pulse width is formed and applied by a maker in a flash memory having a sequencer for internally executing a write process or an erase process. In an LSI such as a microcomputer with a built-in flash memory that does not have such a sequencer, a writing process, an erasing process, and the like are executed by software.

【0004】しかしながら、ソフトウェアによって書込
み処理や消去処理を実行する場合には、ソフトタイマに
よりパルス幅が設定されるためLSIの動作周波数が異
なると同一プログラムではパルス幅が異なってしまう。
そのため、動作周波数毎に書込みプログラムや消去プロ
グラムを作成する必要があった。
[0004] However, when the writing and erasing processes are executed by software, the pulse width is set by a soft timer, so that if the operating frequency of the LSI is different, the pulse width will be different in the same program.
Therefore, it is necessary to create a write program and an erase program for each operating frequency.

【0005】また、フラッシュメモリを内蔵したマイク
ロコンピュータなどにおいては、内部クロックを発生す
る発振器が内蔵されることもある。しかるに、内部発振
器はプロセスばらつきによって発振周波数がばらついて
しまう。その結果、正確な書込みパルスや消去パルスが
形成されなくなるという問題点があることが明らかにな
った。
In some cases, a microcomputer having a built-in flash memory has a built-in oscillator for generating an internal clock. However, the oscillation frequency of the internal oscillator varies due to process variations. As a result, it has been clarified that there is a problem that an accurate write pulse or erase pulse cannot be formed.

【0006】この発明の目的は、不揮発性メモリ回路を
内蔵したマイクロコンピュータ等の半導体集積回路にお
いて、動作周波数が異なっても同一のプログラムによっ
て所望のパルス幅を有する書込みパルスや消去パルスを
形成してメモリの書込み、消去を行なうことができるよ
うにすることにある。
An object of the present invention is to form a write pulse or an erase pulse having a desired pulse width by the same program even if the operating frequency is different in a semiconductor integrated circuit such as a microcomputer having a built-in nonvolatile memory circuit. An object of the present invention is to enable writing and erasing of a memory.

【0007】この発明の他の目的は、不揮発性メモリ回
路および発振器を内蔵したマイクロコンピュータ等の半
導体集積回路において、プロセスばらつきにより発振周
波数がばらついても正確なパルス幅を有する書込みパル
スや消去パルスを形成してメモリの書込み、消去を行な
うことができるようにすることにある。
Another object of the present invention is to provide a semiconductor integrated circuit such as a microcomputer having a built-in non-volatile memory circuit and an oscillator, in which a write pulse or an erase pulse having an accurate pulse width is obtained even if the oscillation frequency varies due to process variations. Formed so that writing and erasing of the memory can be performed.

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

【0009】[0009]

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

【0010】すなわち、不揮発性メモリ回路および発振
器を内蔵したマイクロコンピュータ等の半導体集積回路
において、内部発振器の発振周波数を調整可能なトリミ
ング回路と、発振器の発振周波数を計数する第1のカウ
ンタと、外部から供給されるクロックもしくはそれから
派生するクロックを計数する第2のカウンタと、第1の
カウンタの計数値と第2のカウンタの計数値を比較して
一方の周波数から他方の周波数を判定する周波数測定手
段とを設けるようにしたものである。
That is, in a semiconductor integrated circuit such as a microcomputer incorporating a nonvolatile memory circuit and an oscillator, a trimming circuit capable of adjusting the oscillation frequency of an internal oscillator, a first counter for counting the oscillation frequency of the oscillator, and an external A second counter for counting a clock supplied from the second counter or a clock derived therefrom, and a frequency measurement for comparing the count value of the first counter and the count value of the second counter to determine one frequency from the other frequency Means is provided.

【0011】上記した手段によれば、発振器を動作させ
て第1のカウンタで計数ながら外部から周波数が分かっ
ている正確なクロックを入力して第2のカウンタで計数
して周波数を比較することで、内部発振器の周波数のず
れを検出しそのずれ量に応じてトリミング回路を調整す
ることができる。また、トリミング回路により内部発振
器の発振周波数を調整した後は、外部から周波数の分か
らない動作クロックが入力されてもそれを第2のカウン
タで計数して、発振器の発振周波数を計数する第1のカ
ウンタの計数値と比較することで動作クロックの周波数
を判定して、メモリの書込みルーチンや消去ルーチンの
実行回数を演算もしくはテーブルを参照して決定するこ
とにより、周波数の異なるクロックで動作する半導体集
積回路であっても同一のプログラムにより正確な書込
み、消去を実行することができるようになる。
According to the above means, an accurate clock whose frequency is known is input from the outside while counting by the first counter while operating the oscillator and counting is performed by the second counter to compare the frequency. In addition, it is possible to detect a shift in the frequency of the internal oscillator and adjust the trimming circuit according to the shift amount. After the oscillation frequency of the internal oscillator is adjusted by the trimming circuit, even if an operation clock whose frequency is unknown from the outside is input, the operation clock is counted by the second counter, and the first operation of counting the oscillation frequency of the oscillator is performed. A semiconductor integrated circuit that operates on clocks having different frequencies by comparing the count value of the counter with the frequency of the operation clock and determining the number of executions of the memory write routine and erase routine by calculating or referring to a table. Even with a circuit, accurate writing and erasing can be executed by the same program.

【0012】なお、上記周波数測定手段によって検出さ
れた内部発振器の周波数のずれ量はこれを外部のメモリ
に記憶しておいて初期設定時に内部のレジスタ等に設定
してトリミング回路に反映させて周波数を補正するよう
にしても良いが、検出された内部発振器の周波数のずれ
量またはずれ量に応じて決定された補正値を記憶する領
域を設けておいて、電源投入時等に内部シーケンスで自
動的にずれ量または補正値を読み出して周波数を補正す
るように構成するのが望ましい。
The frequency deviation of the internal oscillator detected by the frequency measuring means is stored in an external memory, set in an internal register or the like at the time of initial setting, and reflected in a trimming circuit. May be corrected.However, an area for storing the detected deviation amount of the frequency of the internal oscillator or a correction value determined according to the deviation amount is provided, and the internal sequence is automatically performed when the power is turned on. It is desirable to read the shift amount or the correction value and correct the frequency.

【0013】[0013]

【発明の実施の形態】以下、本発明をフラッシュメモリ
を内蔵したマイクロコンピュータ(以下、フラッシュマ
イコンと称する)に適用した場合の実施例を図面を用い
て説明する。図1には、本発明を適用したフラッシュマ
イコンの概略構成が示されている。特に制限されない
が、図1に示されている各回路ブロックは、単結晶シリ
コンのような1個の半導体チップ上に形成されている。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment in which the present invention is applied to a microcomputer having a built-in flash memory (hereinafter referred to as a flash microcomputer) will be described below with reference to the drawings. FIG. 1 shows a schematic configuration of a flash microcomputer to which the present invention is applied. Although not particularly limited, each circuit block shown in FIG. 1 is formed on one semiconductor chip such as single crystal silicon.

【0014】図1において、FLASHはフローティン
グゲートを有するMOSFETからなる不揮発性記憶素
子としてのメモリセルがマトリックス状に配置されたメ
モリアレイおよびメモリセル選択用のアドレスデコーダ
等のメモリ周辺回路からなるメモリ回路、FLCはフラ
ッシュメモリ回路に対する書込みや消去、トリミングを
行なうフラッシュコントローラ、CPUはチップ全体の
制御を司る中央処理装置、RAMはデータを一時記憶し
たり中央処理装置CPUの作業領域を提供するランダム
アクセスメモリ、PRPはA/D変換回路などのCPU
周辺回路、I/Oは外部との信号の入出力を行なう入出
力回路、BUSは上記中央処理装置CPUとフラッシュ
メモリ回路FLASH、RAM、I/O間を接続するバ
ス、DVDは外部から供給される基準クロックφcを分
周してチップ内部のシステムの動作に必要な動作クロッ
ク信号CLKを形成する分周、逓倍回路である。なお、
上記CPUには、上記バスBUSの占有権の制御等を行
なうバスコントローラが一体に設けられている。
In FIG. 1, FLASH is a memory circuit comprising a memory array in which memory cells as nonvolatile storage elements each comprising a MOSFET having a floating gate are arranged in a matrix and a memory peripheral circuit such as an address decoder for selecting a memory cell. FLC is a flash controller for writing, erasing, and trimming the flash memory circuit, CPU is a central processing unit that controls the entire chip, and RAM is a random access memory that temporarily stores data and provides a work area for the central processing unit CPU. , PRP is CPU such as A / D conversion circuit
Peripheral circuits, I / Os are input / output circuits for inputting and outputting signals to and from the outside, BUS is a bus connecting the central processing unit CPU and the flash memory circuits FLASH, RAM, I / O, and DVD is supplied from the outside. A frequency dividing and multiplying circuit that divides the reference clock φc to form an operation clock signal CLK necessary for the operation of the system inside the chip. In addition,
The CPU is integrally provided with a bus controller for controlling the occupation right of the bus BUS and the like.

【0015】この実施例においては、上記回路ブロック
の他に、トリミング回路を備え発振周波数調整可能に構
成されて上記フラッシュメモリ回路FLASHで必要さ
れる書込みパルスや消去パルスのパルス幅を規定するク
ロックRCLKを発生する発振器OSCと、該発振器O
SCで発生されたクロックRCLKと上記分周、逓倍回
路DVDから供給される動作クロックCLKとを比較し
て一方の周波数から他方の周波数を判定する周波数測定
回路FDCとが設けられている。
In this embodiment, in addition to the above-mentioned circuit block, a trimming circuit is provided so as to be capable of adjusting the oscillation frequency, and a clock RCLK for defining the pulse width of a write pulse and an erase pulse required in the flash memory circuit FLASH. Oscillator OSC that generates
A frequency measurement circuit FDC is provided which compares the clock RCLK generated by the SC with the operation clock CLK supplied from the frequency division / multiplication circuit DVD to determine one frequency from the other.

【0016】なお、図1には示されていないが、シング
ルチップマイコンのようなマイクロコンピュータの場合
には、上記CPU周辺回路PRPにA/D変換回路の
他、内部のメモリと外部のメモリ等との間のDMA(ダ
イレクトメモリアクセス)転送を制御するDMA転送制
御回路や、CPUに対する割込み要求の発生および優先
度を判定して割り込みをかける割込み制御回路、外部装
置との間でシリアル通信を行なうシリアルコミュニケー
ションインタフェース回路、各種タイマ回路、システム
監視用のウォッチドッグタイマなどが必要に応じて設け
られる。
Although not shown in FIG. 1, in the case of a microcomputer such as a single-chip microcomputer, the CPU peripheral circuit PRP has an internal memory and an external memory in addition to an A / D conversion circuit. DMA transfer control circuit for controlling DMA (Direct Memory Access) transfer to / from the CPU, an interrupt control circuit for determining the generation of an interrupt request to the CPU and determining the priority, and performing an interrupt, and performing serial communication with an external device A serial communication interface circuit, various timer circuits, a watchdog timer for system monitoring, and the like are provided as necessary.

【0017】この実施例では、外部から供給されるクロ
ックを分周してチップ内部のシステムの動作に必要な動
作クロック信号CLKを形成する分周、逓倍回路DVD
を設けているが、外部から供給されるクロックをそのま
ま動作クロックとすることも可能である。
In this embodiment, a frequency divider / multiplier circuit DVD for dividing an externally supplied clock to form an operation clock signal CLK necessary for the operation of a system inside the chip.
However, it is also possible to use the clock supplied from the outside as the operation clock as it is.

【0018】図2には、上記フラッシュメモリ回路FL
ASHの概略構成が示されている。図2において、11
はフローティングゲートを有するMOSFETからなる
不揮発性記憶素子としてのメモリセルがマトリックス状
に配置されたメモリアレイ、12は外部から入力された
書込みデータを保持するデータレジスタ、13はこのデ
ータレジスタ12に保持されたデータに基づいて上記メ
モリアレイ11に対して書込みを行なう書込み回路であ
る。
FIG. 2 shows the flash memory circuit FL
The schematic configuration of the ASH is shown. In FIG. 2, 11
Is a memory array in which memory cells as nonvolatile storage elements each composed of a MOSFET having a floating gate are arranged in a matrix, 12 is a data register for holding externally input write data, and 13 is held in the data register 12. A writing circuit for writing data to the memory array 11 based on the data.

【0019】また、14はアドレス信号を保持するアド
レスレジスタ、15はメモリアレイ11内のワード線の
中から上記アドレスレジスタ14に取り込まれたXアド
レスに対応した1本のワード線を選択するXデコーダ、
16はアドレスレジスタ14に取り込まれたYアドレス
をデコードして1セクタ内の1バイト(あるいは1ワー
ド)のデータを選択するYデコーダ、17は消去の際に
ブロック(マット)の選択等を行なう消去制御回路、1
8はメモリセルアレイ11より読み出されたデータを増
幅して出力するセンスアンプである。
An address register 14 holds an address signal, and an X decoder 15 selects one word line corresponding to the X address taken into the address register 14 from the word lines in the memory array 11. ,
Reference numeral 16 denotes a Y decoder for decoding the Y address taken into the address register 14 and selecting one byte (or one word) of data in one sector, and 17 an erasure for selecting a block (mat) at the time of erasure. Control circuit, 1
Reference numeral 8 denotes a sense amplifier that amplifies and outputs data read from the memory cell array 11.

【0020】さらに、この実施例のフラッシュメモリ回
路には、上記各回路ブロックの他、CPUからの制御信
号に従ってフラッシュメモリ内の各回路の動作タイミン
グ制御信号を形成する制御回路27、アドレス信号やデ
ータ信号の入出力を行なうI/Oバッファ回路23、外
部から供給される電源電圧Vccに基づいて書込み電圧、
消去電圧、読出し電圧、ベリファイ電圧等チップ内部で
必要とされる電圧を生成する電源回路25、メモリの動
作状態に応じてこれらの電圧の中から所望の電圧を選択
してメモリアレイ11に供給する電源切替回路26等が
設けられている。
Further, the flash memory circuit of this embodiment includes, in addition to the above-described circuit blocks, a control circuit 27 for forming an operation timing control signal for each circuit in the flash memory in accordance with a control signal from the CPU; An I / O buffer circuit 23 for inputting / outputting a signal, a write voltage based on a power supply voltage Vcc externally supplied,
A power supply circuit 25 that generates voltages required inside the chip such as an erase voltage, a read voltage, and a verify voltage. A desired voltage is selected from these voltages according to the operation state of the memory and supplied to the memory array 11. A power supply switching circuit 26 and the like are provided.

【0021】一般のフラッシュメモリチップや一部のフ
ラッシュマイコンでは、外部もしくは内部のCPUから
書込みコマンドや消去コマンド等が入力されるとそれを
解読して所定のシーケンスに従って電源切替回路やデコ
ーダ回路等を制御して最適な書込みパルスや消去パルス
を形成して書込み、消去等を実行する制御回路(シーケ
ンサ)が設けられているが、この実施例のフラッシュマ
イコンチップにおいては、フラッシュメモリFLASH
には単純なタイミング信号を発生する制御回路27が設
けられ、書込みパルス印加回数の制御や書込みベリファ
イ等の機能は、CPUがRAM内に格納されたプログラ
ムに従って実行するように構成されている。これによっ
て、回路規模が小さくて済みチップサイズの低減が可能
になる。
In a general flash memory chip and some flash microcomputers, when a write command or an erase command is input from an external or internal CPU, it is decoded and a power supply switching circuit, a decoder circuit, and the like are operated according to a predetermined sequence. A control circuit (sequencer) is provided to control and form an optimum write pulse or erase pulse to execute writing, erasing, etc. In the flash microcomputer chip of this embodiment, the flash memory FLASH
Is provided with a control circuit 27 that generates a simple timing signal, and is configured so that the CPU executes functions such as control of the number of application of the write pulse and write verification according to a program stored in the RAM. As a result, the circuit scale is small, and the chip size can be reduced.

【0022】図3には、上記周波数測定回路FDCの構
成例が示されている。この実施例の周波数測定回路FD
Cは、上記発振器OSCからの発振クロックRCLKを
計数する第1のカウンタ31と、分周、逓倍回路DVD
から供給される動作クロック信号CLKを計数する第2
のカウンタ32と、第2のカウンタ32が停止されたと
きの計数値を保持する測定結果格納レジスタ33と、上
記発振器OSCの発振開始および第1および第2のカウ
ンタ31,32の計数終了を制御するための周波数測定
コントローラ34とから構成されている。
FIG. 3 shows a configuration example of the frequency measurement circuit FDC. Frequency measuring circuit FD of this embodiment
C is a first counter 31 for counting the oscillation clock RCLK from the oscillator OSC, and a frequency dividing / multiplying circuit DVD
Counting the operation clock signal CLK supplied from the
Counter 32, a measurement result storage register 33 that holds the count value when the second counter 32 is stopped, and controls the start of oscillation of the oscillator OSC and the end of counting of the first and second counters 31 and 32. And a frequency measurement controller 34 for performing the operation.

【0023】上記周波数測定コントローラ34には、上
記発振器OSCの発振開始を指示するビットMFSTと
第1および第2のカウンタ31,32の計数が終了した
ことを知らせるビットCSTPとを有するモジュールコ
ントロールレジスタMCRと、上記発振器OSCの発振
周波数を調整するためのトリミング値を保持するトリミ
ングレジスタTRMRとが設けられている。
The frequency measurement controller 34 has a module control register MCR having a bit MFST for instructing the oscillator OSC to start oscillating and a bit CSTP for notifying that the first and second counters 31 and 32 have completed counting. And a trimming register TRMR for holding a trimming value for adjusting the oscillation frequency of the oscillator OSC.

【0024】上記測定結果格納レジスタ33とモジュー
ルコントロールレジスタMCRとトリミングレジスタT
RMRは、内部バスBUSに接続されており、CPUが
自由に各レジスタの値を読み出したり設定したりするこ
とができるように構成されている。上記モジュールコン
トロールレジスタMCRは、そのビットMFSTに
“1”が設定されると上記発振器OSCに対して発振開
始信号MFSTを出力する。この計数開始信号は遅延回
路DLYによって遅延されて第1および第2のカウンタ
31,32に計数開始信号MFSSとして供給されるよ
うに構成されている。発振器OSCと第1および第2の
カウンタ31,32の動作開始タイミングをずらしてい
るのは、発振器は動作開始直後の発振周波数が安定して
いないためである。
The measurement result storage register 33, the module control register MCR, and the trimming register T
The RMR is connected to the internal bus BUS, and is configured so that the CPU can freely read and set the value of each register. When the bit MFST is set to "1", the module control register MCR outputs an oscillation start signal MFST to the oscillator OSC. The counting start signal is delayed by the delay circuit DLY and is supplied to the first and second counters 31 and 32 as the counting start signal MFSS. The reason why the operation start timings of the oscillator OSC and the first and second counters 31 and 32 are shifted is that the oscillation frequency of the oscillator immediately after the start of operation is not stable.

【0025】図4には、発振周波数をトリミング可能な
発振器OSCの具体例が示されている。この実施例の発
振器は、複数個のインバータG0,G1,……Gnが縦
続接続され、最終段のインバータGnの出力が初段のイ
ンバータG1の入力端子に帰還されるように接続された
リングオシレータにより構成されている。そして、各イ
ンバータG0〜Gn−1の出力端子には、スイッチMO
SFET S1,S2,……Snを介して容量素子C
1,C2……Cnが接続可能にされている。
FIG. 4 shows a specific example of an oscillator OSC capable of trimming the oscillation frequency. The oscillator according to this embodiment includes a ring oscillator in which a plurality of inverters G0, G1,... Gn are connected in cascade, and the output of the last-stage inverter Gn is connected back to the input terminal of the first-stage inverter G1. It is configured. A switch MO is connected to the output terminals of the inverters G0 to Gn-1.
Capacitor C via SFETs S1, S2,..., Sn
1, C2... Cn are connectable.

【0026】これらのスイッチMOSFET S1,S
2,……Snのゲート端子に前記トリミングレジスタT
RMRの設定値FR1〜FRnが印加され、対応したス
イッチMOSFETがオンされて容量素子が選択的に接
続される。これによって、接続された容量が大きいほど
リングオシレータ全体の遅延時間が長くなり発振周波数
が低くされる。
These switch MOSFETs S1, S
2,... The trimming register T is connected to the gate terminal of Sn.
The set values FR1 to FRn of RMR are applied, the corresponding switch MOSFET is turned on, and the capacitive element is selectively connected. As a result, the larger the connected capacitance, the longer the delay time of the entire ring oscillator and the lower the oscillation frequency.

【0027】表1に、容量素子が4個の場合のトリミン
グレジスタTRMRの設定値FR1,FR2,FR3,
FR4と、リングオシレータの発振周波数との関係の一
例が示されている。なお、表1は容量素子C1〜C4の
容量値を等しく設定した場合である。もっと調整範囲と
段階を多くしたい場合には容量素子C1〜C4の容量値
に2のn乗の重み付けを持たせてやれば良い。
Table 1 shows the setting values FR1, FR2, FR3 of the trimming register TRMR when there are four capacitive elements.
An example of the relationship between FR4 and the oscillation frequency of the ring oscillator is shown. Table 1 shows the case where the capacitance values of the capacitance elements C1 to C4 are set equal. If it is desired to increase the adjustment range and the number of steps, the capacitance values of the capacitance elements C1 to C4 may be weighted by 2 n.

【0028】[0028]

【表1】 なお、図4の実施例の発振器においては、電源スイッチ
用MOSFET Q1,Q2を介して電源電圧と接地電
位が供給、遮断可能に構成されており、電源スイッチ用
MOSFET Q1,Q2のゲート端子の前段には、前
記モジュールコントロールレジスタMCRから発振開始
信号MFSTとシステムの起動信号STRとを入力信号
とするORゲートG10が設けられており、いずれか一
方の信号がハイレベルにされると電源電圧が供給されて
発振を開始する。
[Table 1] In the oscillator of the embodiment shown in FIG. 4, the power supply voltage and the ground potential can be supplied and cut off via the power switch MOSFETs Q1 and Q2. Is provided with an OR gate G10 which receives an oscillation start signal MFST from the module control register MCR and a system start signal STR as input signals, and supplies a power supply voltage when one of the signals is set to a high level. Then oscillation starts.

【0029】また、この実施例の発振器は、電源電圧依
存性をなくした電圧発生回路40からの電圧Vcc1に
よって駆動されるように構成されている。これによっ
て、電源電圧が変動しても安定した発振周波数が得られ
る。電圧発生回路40は、基準電圧発生回路41と、該
基準電圧発生回路41で発生された2.5Vのような基
準電圧Vrefが非反転入力端子(+)に入力されたオペ
アンプ42と、該オペアンプ42の出力電圧がゲートに
印加されたMOSFET Q10と、該MOSFET
Q10と直列に接続された抵抗R1,R2とからなり、
抵抗R1,R2で抵抗分割された電圧が上記オペアンプ
42の反転入力端子(−)に入力されるように構成され
ている。
Further, the oscillator of this embodiment is configured to be driven by the voltage Vcc1 from the voltage generation circuit 40 which has no dependency on the power supply voltage. Thus, a stable oscillation frequency can be obtained even if the power supply voltage fluctuates. The voltage generation circuit 40 includes a reference voltage generation circuit 41, an operational amplifier 42 to which a reference voltage Vref such as 2.5 V generated by the reference voltage generation circuit 41 is input to a non-inverting input terminal (+), MOSFET Q10 having an output voltage of 42 applied to its gate;
Q10 and resistors R1 and R2 connected in series,
The voltage divided by the resistors R1 and R2 is input to the inverting input terminal (-) of the operational amplifier 42.

【0030】これによって、上記電圧発生回路40は、
電源電圧Vccが低下すると抵抗R1,R2に流れる電
流が減少してオペアンプ42の反転入力端子(−)に帰
還される電圧が下がり、オペアンプ42の出力電圧が上
昇してMOSFET Q10のゲート電圧が高くなって
ドレイン電流が増加して抵抗R1,R2に流れる電流を
増加させるように働く。つまり、電源電圧Vccの変動
にかかわらず安定した電圧を発生することができる。そ
の結果、発振器OSCの発振周波数も電源電圧の変動に
関わらず一定にさせることができる。
As a result, the voltage generation circuit 40
When the power supply voltage Vcc decreases, the current flowing through the resistors R1 and R2 decreases, the voltage fed back to the inverting input terminal (-) of the operational amplifier 42 decreases, the output voltage of the operational amplifier 42 increases, and the gate voltage of the MOSFET Q10 increases. As a result, the drain current increases to act to increase the current flowing through the resistors R1 and R2. That is, a stable voltage can be generated regardless of the fluctuation of the power supply voltage Vcc. As a result, the oscillation frequency of the oscillator OSC can be made constant irrespective of the fluctuation of the power supply voltage.

【0031】図5には、上記第1のカウンタ31の構成
例が示されている。図5のカウンタ31は、複数のフリ
ップフロップFF1,FF2,……FFmが縦続接続さ
れてなるカウンタ部CNTと、フリップフロップFF1
とFFnの出力を入力とするNORゲートG21および
その出力を反転するインバータG22とからなる停止信
号出力部STGと、上記発振器OSCの発振クロックR
CLKの立ち上がりと立ち下がりを検出して所定のパル
ス幅のパルス信号を形成するパルス形成部PSGとから
構成されている。カウンタ部CNTを構成する各フリッ
プフロップのリセット端子には、前記発振開始信号MF
STを遅延回路DLYで遅延した信号MFSSが入力さ
れており、この信号MFSSがロウレベルにされるとリ
セットが解除されて各フリップフロップは前段の出力信
号を取り込むことができるようになって、カウンタ部が
計数動作を開始する。
FIG. 5 shows a configuration example of the first counter 31. 5 includes a counter unit CNT in which a plurality of flip-flops FF1, FF2,... FFm are connected in cascade, and a flip-flop FF1.
A stop signal output portion STG including a NOR gate G21 having an input of the output of FFn and an inverter G22 for inverting the output thereof, and an oscillation clock R of the oscillator OSC.
And a pulse forming section PSG for detecting a rise and a fall of CLK to form a pulse signal having a predetermined pulse width. The reset terminal of each flip-flop constituting the counter unit CNT has the oscillation start signal MF
A signal MFSS obtained by delaying ST by a delay circuit DLY is input. When the signal MFSS is set to a low level, the reset is released, and each flip-flop can take in an output signal of a previous stage, and a counter unit. Starts the counting operation.

【0032】この実施例のカウンタ31は、カウンタ部
CNTを構成するフリップフロップの段数によって、信
号MFSSがロウレベルになってから停止信号CSTP
がロウレベルに変化されるまでの入力パルス数が規定さ
れる。従って、発振器OSCの発振周波数との関係から
所望の測定時間Tcntが得られるようにカウンタ31
を構成するフリップフロップの段数を決定してやれば良
い。
The counter 31 of this embodiment is provided with a stop signal CSTP after the signal MFSS becomes low level depending on the number of flip-flops constituting the counter unit CNT.
Is changed to the low level. Therefore, the counter 31 is set so that a desired measurement time Tcnt is obtained from the relationship with the oscillation frequency of the oscillator OSC.
May be determined by determining the number of stages of the flip-flops constituting.

【0033】また、この実施例のカウンタ31は、パル
ス形成部PSGで形成された発振クロックRCLKの立
ち上がりに同期したパルスと立ち下がりに同期したパル
スがそれぞれカウンタ部CNTの奇数番目のフリップフ
ロップと偶数番目のフリップフロップのセット端子に入
力されるように構成されており、これによってフリップ
フロップをマスタ・スレーブ構成とすることなくレーシ
ングを回避することができる。
In the counter 31 of this embodiment, the pulse synchronized with the rising edge of the oscillation clock RCLK and the pulse synchronized with the falling edge of the oscillation clock RCLK formed by the pulse forming unit PSG are respectively the odd-numbered flip-flop and the even-numbered number of the counter unit CNT. The flip-flop is configured to be inputted to the set terminal of the flip-flop so that the racing can be avoided without using the flip-flop in a master-slave configuration.

【0034】図6には、上記第2のカウンタ32の構成
例が示されている。図6のカウンタ32は、縦続接続さ
れた16個のJ・Kフリップフロップと、上記第1カウ
ンタ31から出力される計数停止信号CSTPと内部動
作クロックCLKとを入力とするNANDゲートG30
とから構成されており、このNANDゲートG30の出
力信号が初段のフリップフロップのトリガ端子Tに入力
されている。また、J端子とK端子は電源電圧Vccに
固定されており、各フリップフロップのリセット端子に
共通に入力されている計数開始信号MFSSがロウレベ
ルにされることによりリセット状態が解除されて、NA
NDゲートG30を介して供給される動作クロックCL
Kのパルス数の計数動作を行なう。NANDゲートG3
0は、第1カウンタ31から出力される計数停止信号C
STPがロウレベルにされると動作クロックCLKを遮
断するため、カウンタ32の計数値はそれ以上アップさ
れなくなり、その停止時の計数値が測定結果格納レジス
タ33に保持される。
FIG. 6 shows a configuration example of the second counter 32. The counter 32 shown in FIG. 6 includes 16 cascade-connected JK flip-flops, a NAND gate G30 which receives the count stop signal CSTP output from the first counter 31 and the internal operation clock CLK as inputs.
The output signal of the NAND gate G30 is input to the trigger terminal T of the first-stage flip-flop. Further, the J terminal and the K terminal are fixed to the power supply voltage Vcc, and the reset state is released by turning the count start signal MFSS, which is commonly input to the reset terminal of each flip-flop, to the low level, and the NA is reset.
Operation clock CL supplied via ND gate G30
An operation of counting the number of K pulses is performed. NAND gate G3
0 is a count stop signal C output from the first counter 31
When the STP is set to the low level, the operation clock CLK is cut off, so that the count value of the counter 32 is not further increased, and the count value at the time of the stop is held in the measurement result storage register 33.

【0035】次に、上記発振器OSCおよび周波数測定
回路FDCを利用した発振周波数の調整方法を、図7を
参照しながら説明する。
Next, a method of adjusting the oscillation frequency using the oscillator OSC and the frequency measurement circuit FDC will be described with reference to FIG.

【0036】発振器OSCにおける発振周波数の調整
(トリミング)を行なうには、まずチップの外部から分
周、逓倍回路DVDに対して周波数の分かっている基準
クロックφcを供給する。すると、分周、逓倍回路DV
Dは基準クロックφcを分周して所定の周波数の内部動
作クロック信号CLKを形成して周波数測定回路FDC
に供給する。また、CPUにより周波数測定回路FDC
内のモジュールコントロールレジスタMCRのビットM
FSTに“1”をセットする。すると、モジュールコン
トロールレジスタMCRから発振器OSCに対して発振
開始信号MFSTが供給されて発振器は発振を開始す
る。
In order to adjust (trim) the oscillation frequency of the oscillator OSC, first, a reference clock φc having a known frequency is supplied to the frequency dividing / multiplying circuit DVD from outside the chip. Then, the dividing / multiplying circuit DV
D frequency-divides the reference clock φc to form an internal operation clock signal CLK having a predetermined frequency,
To supply. In addition, the frequency measurement circuit FDC is provided by the CPU.
M of the module control register MCR in the
Set "1" to FST. Then, the oscillation start signal MFST is supplied from the module control register MCR to the oscillator OSC, and the oscillator starts oscillating.

【0037】それから、遅延回路DLYにより遅延され
た開始信号MFSSがカウンタ31,32に供給されて
それぞれ計数動作を開始する(図7のタイミングt
1)。この実施例では、第1カウンタ31がカウントア
ップする前に第2カウンタ32がオーバーフローしない
ように構成されており、第1カウンタ31が発振器OS
Cからの発振クロックRCLKを計数して所定数に達す
るとカウントアップ信号が出力される。この信号がカウ
ント停止信号CSTPとして第2カウンタ32に供給さ
れてその計数動作が停止され、停止時の計数値が測定結
果格納レジスタ33に保持される(図7のタイミングt
2)。
Then, the start signal MFSS delayed by the delay circuit DLY is supplied to the counters 31 and 32 to start counting operations (at timing t in FIG. 7).
1). In this embodiment, the second counter 32 is configured not to overflow before the first counter 31 counts up.
When the oscillation clock RCLK from C reaches a predetermined number, a count-up signal is output. This signal is supplied to the second counter 32 as the count stop signal CSTP, the counting operation is stopped, and the count value at the time of the stop is held in the measurement result storage register 33 (at timing t in FIG. 7).
2).

【0038】ここで、上記第1カウンタ31のカウント
終了値はビット数(フリップフロップの段数)により一
義的に決定される(ただし、ロード形式のカウンタを使
用すれば任意に設定できる)。従って、外部から供給さ
れた基準クロックφcに基づいて形成された内部動作ク
ロック信号CLKの周波数をf2、第1カウンタ31の
カウントアップ値をCN1、第2カウンタ32が計数を
開始してから停止するまでの計数値をCN2とすると、
f2とCN1は予め分かっているので、発振器OSCの
周波数f1は、上記第2カウンタ32の計数値より、f
1=(CN1/CN2)・f2として求めることができ
る。上記カウント停止信号CSTPはCPU等にも供給
されるように構成されており、CPUは上記カウント停
止信号CSTPが入って来たならば直ちに第2カウンタ
32の値を読み出して上記演算式より発振周波数f1を
算出することができる。
Here, the count end value of the first counter 31 is uniquely determined by the number of bits (the number of flip-flop stages) (however, it can be arbitrarily set by using a load type counter). Therefore, the frequency of the internal operation clock signal CLK formed based on the reference clock φc supplied from the outside is f2, the count-up value of the first counter 31 is CN1, and the second counter 32 is stopped after starting counting. If the count value up to is CN2,
Since f2 and CN1 are known in advance, the frequency f1 of the oscillator OSC is calculated from the count value of the second counter 32 by f
1 = (CN1 / CN2) · f2. The count stop signal CSTP is also configured to be supplied to a CPU or the like. The CPU immediately reads the value of the second counter 32 as soon as the count stop signal CSTP comes in, and reads the oscillation frequency from the above arithmetic expression. f1 can be calculated.

【0039】このようにして、チップ内部の発振器OS
Cの発振周波数が分かったならば、次に予め作成されて
いる表1に示されているような発振周波数RCLKとト
リミング値FR1〜FR4との関係を示すテーブルを参
照して、トリミングレジスタTRMRに設定すべきトリ
ミング値FR1〜FRnを決定する。そして、この決定
したトリミング値FR1〜FRnをトリミングレジスタ
TRMRに設定すると、発振器OSC内のスイッチMO
SFET S1〜Snのうち設定値FR1〜FRnに対
応するスイッチがオンされて、容量素子がリングオシレ
ータに負荷容量として接続されることにより周波数が調
整される。その結果、この発振クロックRCLKの供給
を受けるフラッシュメモリFLASHの制御回路では、
精度の高い書込みパルスや消去パルスを形成することが
できるようになり、書込み、消去後のメモリ素子のしき
い値のばらつきを小さくしてメモリの信頼性を向上させ
ることができる。
Thus, the oscillator OS inside the chip is
When the oscillation frequency of C is known, the trimming register TRMR is referred to a table showing the relationship between the oscillation frequency RCLK and the trimming values FR1 to FR4 as shown in Table 1 prepared in advance. The trimming values FR1 to FRn to be set are determined. Then, when the determined trimming values FR1 to FRn are set in the trimming register TRMR, the switch MO in the oscillator OSC is set.
The switches corresponding to the set values FR1 to FRn among the SFETs S1 to Sn are turned on, and the frequency is adjusted by connecting the capacitance element to the ring oscillator as a load capacitance. As a result, in the control circuit of the flash memory FLASH receiving the supply of the oscillation clock RCLK,
A highly accurate write pulse or erase pulse can be formed, and variation in the threshold value of the memory element after writing or erasing can be reduced to improve the reliability of the memory.

【0040】上記の手順に従った動作は、チップ内のR
AMに周波数調整プログラムとして格納し、CPUによ
ってそのプログラムを実行させることによって容易に実
現することができる。なお、このような発振周波数測定
はメーカ側において製造の最終段階で行なって例えばフ
ラッシュメモリFLASHの所定の番地に決定したトリ
ミング値を格納してユーザに対して提供するのが望まし
い。
The operation according to the above procedure is performed by using the R in the chip.
It can be easily realized by storing the frequency adjustment program in the AM and causing the CPU to execute the program. It is desirable that such oscillation frequency measurement be performed at the final stage of manufacturing on the manufacturer side, and that the trimming value determined be stored at a predetermined address of the flash memory FLASH and provided to the user, for example.

【0041】また、上記トリミング値を使用して周波数
を調整するプログラムを初期化プログラムとしてユーザ
に提供もしくはユーザプログラムに組み込んでもらう。
すると、ユーザシステムが立ち上がったときに初期化プ
ログラムが実行されて、内部のフラッシュメモリFLA
SHに格納されているトリミング値が読み出されて周波
数測定回路FDC内のトリミングレジスタTRMRに設
定されて内蔵発振器OSCの周波数が調整され、自動的
に所望の周波数で発振させることができるようになる。
Further, a program for adjusting the frequency using the trimming value is provided to the user as an initialization program or is incorporated in the user program.
Then, the initialization program is executed when the user system starts up, and the internal flash memory FLA is started.
The trimming value stored in the SH is read out and set in the trimming register TRMR in the frequency measuring circuit FDC to adjust the frequency of the built-in oscillator OSC, so that the oscillator can automatically oscillate at a desired frequency. .

【0042】次に、上記発振器OSCおよび周波数測定
回路FDCを利用した内部動作クロックの周波数の測定
方法およびその測定結果を利用したフラッシュメモリへ
のデータの書込みおよび消去の動作手順を説明する。
Next, a description will be given of a method of measuring the frequency of the internal operation clock using the oscillator OSC and the frequency measurement circuit FDC, and an operation procedure of writing and erasing data in the flash memory using the measurement result.

【0043】前述した方法により周波数調整された発振
器を内蔵したフラッシュマイコンは、ユーザシステムに
使用される場合動作保証範囲内でユーザによって任意の
周波数の動作クロックが用いられる。本実施例のフラッ
シュマイコンは、次に説明するような手順に従って動作
する動作クロックの周波数測定プログラムを実行するこ
とにより動作クロックの周波数を検出することができ、
図8または図9に示すようなフローチャートに従った書
込み動作および消去動作を行なうことによって最適な書
込みパルスおよび消去パルスで書込み、消去を行なうこ
とができる。
When the flash microcomputer incorporating the oscillator whose frequency is adjusted by the above-described method is used in a user system, an operation clock of an arbitrary frequency is used by the user within an operation guarantee range. The flash microcomputer of the present embodiment can detect the frequency of the operation clock by executing the frequency measurement program of the operation clock that operates according to the procedure described below.
By performing the writing operation and the erasing operation according to the flowchart shown in FIG. 8 or FIG. 9, writing and erasing can be performed with optimal writing and erasing pulses.

【0044】本実施例のフラッシュマイコンにおいて内
部動作クロックCLKの周波数を測定する方法は、前記
発振周波数の調整とほぼ同様である。すなわち、外部か
ら基準となるクロックφcが分周、逓倍回路DVDに入
力されている状態で、CPUにより周波数測定回路FD
C内のモジュールコントロールレジスタMCRのビット
MFSTに“1”をセットする。すると、モジュールコ
ントロールレジスタMCRから発振器OSCに対して発
振開始信号MFSTが供給されて発振器は発振を開始す
る。
The method of measuring the frequency of the internal operation clock CLK in the flash microcomputer of this embodiment is almost the same as the method of adjusting the oscillation frequency. That is, in a state where the reference clock φc is externally input to the frequency dividing / multiplying circuit DVD, the CPU measures the frequency measuring circuit FD.
"1" is set to the bit MFST of the module control register MCR in C. Then, the oscillation start signal MFST is supplied from the module control register MCR to the oscillator OSC, and the oscillator starts oscillating.

【0045】それから、遅延回路DLYにより遅延され
た開始信号MFSSがカウンタ31,32に供給されて
それぞれ計数動作を開始する(図7のタイミングt
1)。第1カウンタ31が発振器OSCからの発振クロ
ックRCLKを計数して所定数に達するとカウントアッ
プ信号が出力される。この信号がカウント停止信号CS
TPとして第2カウンタ32に供給されてその計数動作
が停止され、停止時の計数値が測定結果格納レジスタ3
3に保持される(図7のタイミングt2)。
Then, the start signal MFSS delayed by the delay circuit DLY is supplied to the counters 31 and 32 to start counting operations (at timing t in FIG. 7).
1). When the first counter 31 counts the oscillation clock RCLK from the oscillator OSC and reaches a predetermined number, a count-up signal is output. This signal is the count stop signal CS
The count value is supplied to the second counter 32 as TP, and the counting operation is stopped.
3 (timing t2 in FIG. 7).

【0046】ここで、外部から供給された基準クロック
φcに基づいて形成された内部動作クロック信号CLK
の周波数をf2、第1カウンタ31のカウントアップ値
をCN1、第2カウンタ32が計数を開始してから停止
するまでの計数値をCN2とすると、f1とCN1は予
め分かっているので、内部動作クロック信号CLKの周
波数f2は、上記第2カウンタ32の計数値より、f2
=(CN2/CN1)・f1として求めることができ
る。
Here, an internal operation clock signal CLK formed based on a reference clock φc supplied from the outside.
Is f2, the count-up value of the first counter 31 is CN1, and the count value from when the second counter 32 starts counting until it stops is CN2, since f1 and CN1 are known in advance, the internal operation The frequency f2 of the clock signal CLK is calculated from the count value of the second counter 32 by f2
= (CN2 / CN1) · f1.

【0047】上記カウント停止信号CSTPはCPU等
にも供給されるように構成されており、CPUは上記カ
ウント停止信号CSTPが入って来たならば直ちに第2
カウンタ32の値を読み出して上記演算式により内部動
作クロック信号CLKの周波数f2を算出することがで
きる。また、内部動作クロック信号CLKの周波数f2
が分かればこれに基づいて最適なパルス幅の書込みパル
スや消去パルスを形成するのに必要な書込み処理ルーチ
ンや消去ルーチンでのウェイトループ回数を決定するこ
とができる。
The count stop signal CSTP is also configured to be supplied to a CPU or the like.
By reading the value of the counter 32, the frequency f2 of the internal operation clock signal CLK can be calculated by the above equation. Also, the frequency f2 of the internal operation clock signal CLK
, The number of wait loops in the write processing routine and the erase routine required to form the write pulse and the erase pulse having the optimum pulse width can be determined based on this.

【0048】算出した内部動作クロック信号CLKの周
波数f2または決定したウェイトループ回数は、チップ
内部のRAMまたはフラッシュメモリFLASH内に格
納しておくのが望ましい。これによって、書込み動作や
消去動作の度に動作周波数測定やウェイトループ回数決
定を行なう必要がなくなる。これは、図8および図9の
フローチャートにおけるステップS11,S12やS2
1,S22における動作周波数測定やウェイトループ回
数決定処理を、システムの立ち上がり時やリセット時あ
るいは所定の割込み発生時に行ない、個々の書込み処理
や消去処理の際にはメモリに格納されている動作周波数
またはウェイトループ回数を読み出すようにプログラム
を構成することで実現することができる。
It is desirable that the calculated frequency f2 of the internal operation clock signal CLK or the determined number of times of the wait loop be stored in a RAM or a flash memory FLASH in the chip. This eliminates the need to measure the operating frequency and determine the number of wait loops every time a write operation or an erase operation is performed. This corresponds to steps S11, S12 and S2 in the flowcharts of FIGS.
1, the operation frequency measurement and wait loop number determination processing in S22 are performed at the time of system startup, reset, or when a predetermined interrupt occurs, and at the time of individual writing processing or erasing processing, the operating frequency stored in the memory or This can be realized by configuring a program to read the number of wait loop times.

【0049】なお、決定もしくは読み出されたウェイト
ループ回数は、図8および図9のフローチャートにおけ
るステップS14とS24のパルス印加ルーチンで使用
されるもので、指定されたウェイトループを繰り返すこ
とによって例え内部動作クロックの周波数の異なるシス
テムであっても同一のパルス幅の書込みパルスや消去パ
ルスを形成して、選択されているメモリ素子に印加する
ことができる。
The determined or read number of times of the wait loop is used in the pulse application routines of steps S14 and S24 in the flowcharts of FIGS. 8 and 9, and is performed by repeating the designated wait loop. Even in systems with different operating clock frequencies, write pulses and erase pulses having the same pulse width can be formed and applied to the selected memory element.

【0050】書込み動作では書込みパルス印加後に書込
みベリファイを行なって書込みが終了したか判定し(図
8のステップS15)、また消去動作では書込みパルス
印加後に消去ベリファイを行なって消去が終了したか判
定し(図9のステップS25)、終了していないときは
それぞれ所定の書込み回数または消去をオーバーするま
でパルスの印加を繰り返す(ステップS16,S2
6)。
In the write operation, write verify is performed after the application of the write pulse to determine whether the write is completed (step S15 in FIG. 8). In the erase operation, erase verify is performed after the application of the write pulse to determine whether the erase is completed. (Step S25 in FIG. 9), if not completed, the application of the pulse is repeated until the number of times of writing or erasing is exceeded, respectively (steps S16 and S2).
6).

【0051】書込み動作のフローチャートのステップS
17で再書込みデータの演算を行なっているのは、所定
のしきい値に達していないメモリ素子に対してのみ再度
書込みパルスを印加して過剰書込みによるしきい値の下
がり過ぎを防止するためである。なお、消去の場合には
書込みの場合のように過剰消去によるしきい値の上がり
過ぎという不具合はないので、選択ブロックの全部のメ
モリ素子に対して再度消去パルスを印加するようにして
回路の複雑化を回避している。
Step S in the flowchart of the write operation
The reason why the rewriting data operation is performed in step 17 is to prevent the threshold value from excessively lowering due to excessive writing by applying a writing pulse again only to the memory element not reaching the predetermined threshold value. is there. In the case of erasing, there is no problem that the threshold value is excessively raised due to excessive erasing as in the case of writing. Has been avoided.

【0052】以上本発明者によってなされた発明を実施
例に基づき具体的に説明したが、本発明は上記実施例に
限定されるものではなく、その要旨を逸脱しない範囲で
種々変更可能であることはいうまでもない。例えば、上
記実施例のフラッシュメモリは、消去動作によって記憶
素子のしきい値を高くし書込みによって記憶素子のしき
い値を低くする形式のものでも、消去によってしきい値
を下げ書込みによって記憶素子のしきい値を高くする形
式のものでもよい。
Although the invention made by the inventor has been specifically described based on the embodiments, the present invention is not limited to the above embodiments, and various modifications can be made without departing from the gist of the invention. Needless to say. For example, even in the flash memory of the above embodiment, the threshold value of the storage element is increased by the erase operation and the threshold value of the storage element is decreased by the write operation. A type in which the threshold value is increased may be used.

【0053】また、実施例では、周波数測定モードの際
にフラッシュマイコン内部に設けた第2カウンタの計数
値に基づいて同じく内部のCPUによって発振器のトリ
ミング値を決定するようにしているが、第2カウンタの
計数値を外部に読み出して外部で内部発振器のトリミン
グ値を決定するようにしても良い。
In the embodiment, the trimming value of the oscillator is also determined by the internal CPU based on the count value of the second counter provided in the flash microcomputer in the frequency measurement mode. The trimming value of the internal oscillator may be determined externally by reading the count value of the counter to the outside.

【0054】以上の説明では主として本発明者によって
なされた発明をその背景となった利用分野であるフラッ
シュメモリを内蔵したマイクロコンピュータに適用した
場合について説明したが、この発明はそれに限定される
ものでなく、不揮発性記憶メモリおよび発振器を内蔵し
た半導体集積回路に広く利用することができる。
In the above description, the case where the invention made by the present inventor is mainly applied to a microcomputer having a built-in flash memory, which is the field of application, has been described. However, the present invention is not limited to this. Therefore, it can be widely used for a semiconductor integrated circuit having a built-in nonvolatile memory and an oscillator.

【0055】[0055]

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

【0056】すなわち、この発明は、動作周波数が異な
っても同一のプログラムによって所望のパルス幅を有す
る書込みパルスや消去パルスを形成してメモリの書込
み、消去を行なうことができるとともに、プロセスばら
つきにより発振周波数がばらついても正確なパルス幅を
有する書込みパルスや消去パルスを形成してメモリの書
込み、消去を行なうことができる不揮発性メモリ回路を
内蔵したマイクロコンピュータ等の半導体集積回路を得
ることができる。
That is, according to the present invention, even if the operating frequency is different, a write pulse or an erase pulse having a desired pulse width can be formed by the same program to perform writing and erasing of the memory, and oscillation due to process variation. A semiconductor integrated circuit such as a microcomputer having a built-in nonvolatile memory circuit capable of writing and erasing a memory by forming a writing pulse or an erasing pulse having an accurate pulse width even when the frequency varies can be obtained.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明を適用したフラッシュメモリ内蔵マイク
ロコンピュータの一実施例の概略を示す全体ブロック図
である。
FIG. 1 is an overall block diagram schematically showing an embodiment of a microcomputer with a built-in flash memory to which the present invention is applied.

【図2】フラッシュメモリ回路部の構成例を示すブロッ
ク図である。
FIG. 2 is a block diagram illustrating a configuration example of a flash memory circuit unit.

【図3】クロックの周波数測定回路の構成例を示すブロ
ック図である。
FIG. 3 is a block diagram illustrating a configuration example of a clock frequency measurement circuit.

【図4】周波数トリミング回路を備えた発振器の構成例
を示す回路構成図である。
FIG. 4 is a circuit configuration diagram illustrating a configuration example of an oscillator including a frequency trimming circuit.

【図5】第1のカウンタの構成例を示す回路構成図であ
る。
FIG. 5 is a circuit configuration diagram showing a configuration example of a first counter.

【図6】第2のカウンタの構成例を示す回路構成図であ
る。
FIG. 6 is a circuit configuration diagram showing a configuration example of a second counter.

【図7】実施例の周波数測定回路におけるクロック周波
数の測定時の信号のタイミング例を示すタイミングチャ
ートである。
FIG. 7 is a timing chart showing an example of signal timing when measuring a clock frequency in the frequency measurement circuit of the embodiment.

【図8】本発明を適用したフラッシュマイコンにおける
フラッシュメモリへのデータ書込み手順の一例を示すフ
ローチャートである。
FIG. 8 is a flowchart showing an example of a procedure for writing data to a flash memory in a flash microcomputer to which the present invention is applied.

【図9】本発明を適用したフラッシュマイコンにおける
フラッシュメモリのデータ消去手順の一例を示すフロー
チャートである。
FIG. 9 is a flowchart showing an example of a data erase procedure of a flash memory in a flash microcomputer to which the present invention is applied.

【符号の説明】[Explanation of symbols]

11 メモリアレイ 12 データレジスタ 13 書込み回路 14 アドレスレジスタ 15 Xデコーダ 17 Yデコーダ 25 電源回路 26 電源切替回路 31 第1のカウンタ 32 第2のカウンタ 33 計数値保持レジスタ 34 周波数測定制御回路 OSC 発振器 FDC 周波数測定回路 TRMR トリミング値設定レジスタ Reference Signs List 11 memory array 12 data register 13 writing circuit 14 address register 15 X decoder 17 Y decoder 25 power supply circuit 26 power supply switching circuit 31 first counter 32 second counter 33 count value holding register 34 frequency measurement control circuit OSC oscillator FDC frequency measurement Circuit TRMR Trimming value setting register

───────────────────────────────────────────────────── フロントページの続き (51)Int.Cl.7 識別記号 FI テーマコート゛(参考) H01L 29/788 H01L 29/78 371 29/792 Fターム(参考) 5B025 AA00 AB00 AC00 AD04 AD08 AD09 AD15 AE00 AE08 5B062 AA08 CC01 DD06 DD10 HH01 HH04 5F001 AE02 AE08 AE50 AG40 5F083 ER22 GA17 GA30 LA10 ZA13──────────────────────────────────────────────────続 き Continued on the front page (51) Int.Cl. 7 Identification symbol FI theme coat ゛ (Reference) H01L 29/788 H01L 29/78 371 29/792 F term (Reference) 5B025 AA00 AB00 AC00 AD04 AD08 AD09 AD15 AE00 AE08 5B062 AA08 CC01 DD06 DD10 HH01 HH04 5F001 AE02 AE08 AE50 AG40 5F083 ER22 GA17 GA30 LA10 ZA13

Claims (7)

【特許請求の範囲】[Claims] 【請求項1】 不揮発性メモリ回路および発振器を内蔵
した半導体集積回路において、内部発振器の発振周波数
を調整可能なトリミング回路と、前記発振器の発振周波
数を計数する第1のカウンタと、外部から供給されるク
ロックもしくはそれから派生したクロックを計数する第
2のカウンタと、前記第1のカウンタの計数値と第2の
カウンタの計数値を比較して一方の周波数から他方の周
波数を判定する周波数測定手段とを設けたことを特徴と
する半導体集積回路。
1. A semiconductor integrated circuit having a built-in nonvolatile memory circuit and an oscillator, a trimming circuit capable of adjusting an oscillation frequency of an internal oscillator, a first counter for counting the oscillation frequency of the oscillator, and an externally supplied counter. A second counter that counts a clock derived therefrom or a clock derived therefrom; and a frequency measurement unit that compares the count value of the first counter and the count value of the second counter to determine one frequency from the other. A semiconductor integrated circuit, comprising:
【請求項2】 上記周波数測定手段により測定された周
波数に基づいて決定された前記発振器の周波数調整用ト
リミング値を保持するレジスタを備えていることを特徴
とする請求項1に記載の半導体集積回路。
2. The semiconductor integrated circuit according to claim 1, further comprising a register for holding a trimming value for adjusting the frequency of said oscillator determined based on the frequency measured by said frequency measuring means. .
【請求項3】 上記周波数測定手段により測定された周
波数に基づいて発振器調整用トリミング値を決定し上記
レジスタに設定する制御手段を備えていることを特徴と
する請求項2に記載の半導体集積回路。
3. The semiconductor integrated circuit according to claim 2, further comprising control means for determining an oscillator adjustment trimming value based on the frequency measured by said frequency measuring means and setting the trimming value in said register. .
【請求項4】 上記制御手段は、上記周波数測定手段に
より測定された前記クロックの周波数に基づいて上記不
揮発性メモリ回路に印加される書込みパルスまたは消去
パルスの実効パルス幅を設定する機能を備えていること
を特徴とする請求項3に記載の半導体集積回路。
4. The control means has a function of setting an effective pulse width of a write pulse or an erase pulse applied to the nonvolatile memory circuit based on the frequency of the clock measured by the frequency measurement means. 4. The semiconductor integrated circuit according to claim 3, wherein:
【請求項5】 外部から供給される電源電圧から該電源
電圧に依存しない電圧を発生する電圧発生回路を備え、
該電圧発生回路で発生された電圧により上記発振器が発
振動作するように構成されていることを特徴とする請求
項1、2、3または4に記載の半導体集積回路。
5. A voltage generating circuit for generating a voltage independent of the power supply voltage from a power supply voltage supplied from the outside,
5. The semiconductor integrated circuit according to claim 1, wherein said oscillator is configured to oscillate by a voltage generated by said voltage generation circuit.
【請求項6】 上記第1のカウンタは予め定められた数
を計数するカウンタであり、該カウンタが所定数を計数
したときに上記第2のカウンタの計数動作を停止させる
ように構成されていることを特徴とする請求項1、2、
3、4または5に記載の半導体集積回路。
6. The first counter is a counter that counts a predetermined number, and is configured to stop the counting operation of the second counter when the counter has counted a predetermined number. Claims 1 and 2,
6. The semiconductor integrated circuit according to 3, 4, or 5.
【請求項7】 上記第2のカウンタの計数値を保持する
レジスタを内蔵してなることを特徴とする請求項1、
2、3、4または5に記載の半導体集積回路。
7. The semiconductor device according to claim 1, further comprising a register for holding a count value of said second counter.
6. The semiconductor integrated circuit according to 2, 3, 4, or 5.
JP6980399A 1999-03-16 1999-03-16 Semiconductor integrated circuit with built-in non- volatile memory circuit Withdrawn JP2000268019A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6980399A JP2000268019A (en) 1999-03-16 1999-03-16 Semiconductor integrated circuit with built-in non- volatile memory circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6980399A JP2000268019A (en) 1999-03-16 1999-03-16 Semiconductor integrated circuit with built-in non- volatile memory circuit

Publications (1)

Publication Number Publication Date
JP2000268019A true JP2000268019A (en) 2000-09-29

Family

ID=13413286

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6980399A Withdrawn JP2000268019A (en) 1999-03-16 1999-03-16 Semiconductor integrated circuit with built-in non- volatile memory circuit

Country Status (1)

Country Link
JP (1) JP2000268019A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002297563A (en) * 2001-03-30 2002-10-11 Hitachi Ltd Microcomputer and data processing apparatus
JP2005309799A (en) * 2004-04-22 2005-11-04 Nec Electronics Corp Microcomputer with built-in flash memory
JP2006004245A (en) * 2004-06-18 2006-01-05 Seiko Epson Corp Integrated circuit device, and electronic device
JP2006042214A (en) * 2004-07-29 2006-02-09 Nec Electronics Corp Semiconductor device and ic tag
US7382681B2 (en) 2003-07-30 2008-06-03 Renesas Technology Corp. Semiconductor integrated circuit
JP2008537237A (en) * 2005-04-20 2008-09-11 ブラウン ゲーエムベーハー A time base for microcontrollers and a method for producing circuit devices therefor
JP2010170579A (en) * 2010-04-19 2010-08-05 Renesas Technology Corp Data processor
US8008967B2 (en) 2005-09-20 2011-08-30 Fujitsu Limited Power supply voltage adjusting device
JP2011198466A (en) * 2011-06-10 2011-10-06 Panasonic Corp Semiconductor memory device
JP2018079210A (en) * 2016-11-18 2018-05-24 東芝ライフスタイル株式会社 Washing machine

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002297563A (en) * 2001-03-30 2002-10-11 Hitachi Ltd Microcomputer and data processing apparatus
US7382681B2 (en) 2003-07-30 2008-06-03 Renesas Technology Corp. Semiconductor integrated circuit
JP2005309799A (en) * 2004-04-22 2005-11-04 Nec Electronics Corp Microcomputer with built-in flash memory
JP2006004245A (en) * 2004-06-18 2006-01-05 Seiko Epson Corp Integrated circuit device, and electronic device
JP4662019B2 (en) * 2004-06-18 2011-03-30 セイコーエプソン株式会社 Integrated circuit device and electronic apparatus
JP2006042214A (en) * 2004-07-29 2006-02-09 Nec Electronics Corp Semiconductor device and ic tag
JP2008537237A (en) * 2005-04-20 2008-09-11 ブラウン ゲーエムベーハー A time base for microcontrollers and a method for producing circuit devices therefor
US8008967B2 (en) 2005-09-20 2011-08-30 Fujitsu Limited Power supply voltage adjusting device
JP2010170579A (en) * 2010-04-19 2010-08-05 Renesas Technology Corp Data processor
JP2011198466A (en) * 2011-06-10 2011-10-06 Panasonic Corp Semiconductor memory device
JP2018079210A (en) * 2016-11-18 2018-05-24 東芝ライフスタイル株式会社 Washing machine

Similar Documents

Publication Publication Date Title
US7250825B2 (en) Method and apparatus for calibration of a low frequency oscillator in a processor based system
JP3023238B2 (en) Power-on reset system and semiconductor memory device provided with the power-on reset system
US7149119B2 (en) System and method of controlling a three-dimensional memory
JP2002133878A (en) Non-volatile semiconductor memory circuit and semiconductor integrated circuit
CN110908488A (en) Voltage drop monitoring circuit and system on chip
KR100515541B1 (en) Semiconductor integrated circuit and microcomputer
US8008967B2 (en) Power supply voltage adjusting device
JP2000268019A (en) Semiconductor integrated circuit with built-in non- volatile memory circuit
US20160232982A1 (en) Semiconductor device control circuit and method thereof
TW201931378A (en) Semiconductor storage device and operation method thereof
EP0855653A1 (en) Memory controller with a programmable strobe delay
US6892315B1 (en) Adjustable microcontroller wake-up scheme that calibrates a programmable delay value based on a measured delay
JP2004355362A (en) Microcomputer and initialization method
JP2004192488A (en) Data processor and memory card
JP4683617B2 (en) Microcomputer and microcomputer optimization method
JP3781240B2 (en) Nonvolatile semiconductor memory and semiconductor integrated circuit incorporating the same
CN107769774B (en) Oscillator device with improved accuracy and related method
JPH11297086A (en) Nonvolatile semiconductor memory, integrated circuit including the same and method of adjusting write time of memory
JP4107877B2 (en) Semiconductor nonvolatile memory device
JP2000123584A (en) Nonvolatile semiconductor memory and semiconductor integrated circuit incorporating it
US20050005060A1 (en) Write state machine architecture for flash memory internal instructions
JP6741811B1 (en) Erase control circuit and method for nonvolatile semiconductor memory device, and nonvolatile semiconductor memory device
JP2003288791A (en) Semiconductor integrated circuit device and microprocessor
US20220359018A1 (en) Semiconductor device and operation method
JPH10502482A (en) Initialization of read pipeline of nonvolatile sequential memory device

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20060606