JP3838401B2 - Nonvolatile memory and system - Google Patents

Nonvolatile memory and system Download PDF

Info

Publication number
JP3838401B2
JP3838401B2 JP25701498A JP25701498A JP3838401B2 JP 3838401 B2 JP3838401 B2 JP 3838401B2 JP 25701498 A JP25701498 A JP 25701498A JP 25701498 A JP25701498 A JP 25701498A JP 3838401 B2 JP3838401 B2 JP 3838401B2
Authority
JP
Japan
Prior art keywords
data
write
flash memory
memory
bit
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.)
Expired - Fee Related
Application number
JP25701498A
Other languages
Japanese (ja)
Other versions
JP2000090678A (en
Inventor
祐之助 内田
康幸 斉藤
功 岩本
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Renesas Technology Corp
Original Assignee
Renesas Technology 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 Technology Corp filed Critical Renesas Technology Corp
Priority to JP25701498A priority Critical patent/JP3838401B2/en
Publication of JP2000090678A publication Critical patent/JP2000090678A/en
Application granted granted Critical
Publication of JP3838401B2 publication Critical patent/JP3838401B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Read Only Memory (AREA)
  • Semiconductor Memories (AREA)
  • Non-Volatile Memory (AREA)

Description

【0001】
【発明の属する技術分野】
この発明は不揮発性メモリ及びシステムに関し、例えば、プレライト機能を持つフラッシュメモリ及びこれを含むシングルチップマイクロコンピュータならびにその信頼性の向上に利用して特に有効な技術に関する。
【0002】
【従来の技術】
フローティング(浮遊)ゲート及びコントロール(制御)ゲートを有し、保持データの論理値に応じてそのしきい値電圧が選択的に高く又は低くされるいわゆる2層ゲート構造型メモリセルがある。また、このような2層ゲート構造型メモリセルが格子配置されてなるメモリアレイをその基本構成要素とするフラッシュメモリがあり、このようなフラッシュメモリや中央処理ユニットを同一半導体基板面上に搭載するシングルチップマイクロコンピュータがある。
【0003】
一方、フラッシュメモリにおけるデータの消去動作は、例えば所定のブロックを単位として行われるが、フラッシュメモリの消去特性を高める一つの手段として、消去動作に先立ち、消去対象となるすべてのメモリセルを書き込み状態に揃える、いわゆるプレライトを行うことが一般的となりつつある。
【0004】
【発明が解決しようとする課題】
本願発明者等は、この発明に先立ってフラッシュメモリを搭載するシングルチップマイクロコンピュータを開発し、その過程で次のような問題点に気付いた。すなわち、このマイクロコンピュータでは、例えば32ビットを単位として中央処理ユニットによるデータ処理が行われ、例えば128バイトのいわゆるセクタを単位としてフラッシュメモリに対するデータの書き込みが行われる。
【0005】
上記マイクロコンピュータにおいて、フラッシュメモリに対するライト(書き込み)データの生成及びベリファイつまり書き込み確認処理は、マイクロコンピュータの中央処理ユニットによってソフトウェア的に行われ、その処理過程は、図14に例示されるように、まずステップS611によりライトデータWDを生成した後、ステップS612によりライトデータWDをビット反転した反転ライトデータWDIが生成される。ライトデータWDでは、書き込み対象となるビットがいわゆる論理“0”とされ、反転ライトデータでは、逆に書き込み対象となるビットがいわゆる論理“1”となる。また、フラッシュメモリでは、メモリアレイを構成する2層ゲート構造型メモリセルのうち、消去状態にあるメモリセルが、例えばそのしきい値電圧が比較的高くされて論理“1”のデータを保持するものとされ、書き込み状態にあるメモリセルは、そのしきい値電圧が比較的低くされて論理“0”のデータを保持するものとされる。
【0006】
マイクロコンピュータでは、次のステップS613により、フラッシュメモリの書き込み対象となるアドレスからその保持データRDが読み出された後、ステップS614により、上記反転ライトデータWDIとリードデータRDとの論理積データWDAが算出される。また、ステップS615により、論理積データWDAをビット反転して上記指定アドレスに再書き込みするためのリライトデータWDRが生成され、ステップS616により、このリライトデータWDRがメモリアレイのフラッシュメモリの指定アドレスに書き込まれる。
【0007】
一連の書き込み動作が終了すると、ステップS617により、指定アドレスからその保持データRDが再び読み出され、ステップS618により、反転ライトデータWDIとリードデータRDとの論理積データWDAが算出された後、ステップS619により、論理積データWDAが全ビット“0”であるかどうかの判定が行われる。そして、全ビット“0”となっていた場合は、書き込み動作が完了したものとされ、いずれかのビットが“1”である場合には、ステップS613に戻り、一連の書き込み動作が繰り返される。これにより、ビット単位の書き込み制御が行われ、消去状態にあるメモリセルに対してのみ書き込みが繰り返されるものとなる。この結果、書き込み状態となったメモリセルに対し無意味な書き込みが繰り返され、そのしきい値電圧が必要以上に低くなるのを防止して、フラッシュメモリの書き込み・消去特性を高めることができる。
【0008】
ところが、上記フラッシュメモリでは、ステップS613〜S616による例えば128バイト分の書き込み動作が繰り返された後、ステップS617〜S619の判定動作が繰り返され、比較的長い時間をおいてステップS613及び617による2回の指定アドレスの読み出し動作が行われる。このため、これらの読み出し動作で得られるリードデータRDの論理値に差異が生じた場合、不本意な書き込み動作が行われ、書き込み所要時間が長くなるとともに、特に指定メモリセルが、その読み出し結果が論理“1”又は“0”にふらつくいわゆる揺らぎ領域にあって、例えばステップS613による読み出し結果が論理“0”となりステップS617による読み出し結果が論理“1”となるケースでは、無限ループ状態となり、書き込み処理が永久に終結せず、これによってフラッシュメモリひいてはこれを含むマイクロコンピュータの信頼性が低下する。
【0009】
これに対処するため、本願発明者等は、図15に例示されるように、上記ステップS613〜S616の書き込み処理に代えて、ステップS713により、与えられたライトデータWDを、指定アドレスの読み出し結果に関係なく固定的に書き込む方法を考えた。しかし、この方法をとることで、指定アドレスの読み出し動作は1回となり上記問題は解消されるが、例えば書き込み単位となる32ビットのメモリセルに消去状態にあるものと書き込み状態にあるものとが混在する場合、すでに書き込み状態にあるメモリセルに対して無意味な書き込みが繰り返されるため、これらのメモリセルに対する書き込みストレスが増大する。また、特にプレライト方式をとるフラッシュメモリでは、消去処理によってそのしきい値電圧が必要以上に低くなるものが出てきて、消去対象となるメモリセルのしきい値電圧が不揃いとなり、フラッシュメモリの消去特性まで低下する。
【0010】
この発明の目的は、プレライト方式をとるフラッシュメモリ等に効果的なデータの書き込み方法を提供することにある。この発明の他の目的は、シングルチップマイクロコンピュータ等に搭載されるフラッシュメモリ等の書き込み・消去特性を改善し、その信頼性を高めることにある。
【0011】
この発明の前記ならびにその他の目的と新規な特徴は、この明細書の記述及び添付図面から明らかになるであろう。
【0012】
【課題を解決するための手段】
本願において開示される発明のうち代表的なものの概要を簡単に説明すれば、次の通りである。すなわち、シングルチップマイクロコンピュータ等に搭載されるフラッシュメモリ等の不揮発性メモリにおいて、指定アドレスから読み出されるリードデータと、指定アドレスに書き込むべきライトデータのビット反転データとの論理積データをもとに、指定アドレスに対する書き込み動作の終了を判定するとともに、同一の論理積データをもとに、書き込みが終了していない指定アドレスに再書き込みするべきリライトデータを生成する。
【0013】
あるいは、指定アドレスに書き込むべきライトデータ、又は書き込みが終了していない指定アドレスに対するリライトデータをビット反転してなる書き込み履歴データと、指定アドレスから読み出されるリードデータとの論理積データをもとに、上記指定アドレスに対する書き込み動作の終了を判定するとともに、同一の論理積データをもとに、上記リライトデータを生成する。
【0014】
上記フラッシュメモリ等の書き込み動作に関する一連の処理を、データの消去に先立ち、消去対象となるすべてのメモリセルの保持情報を書き込み状態に揃えるためのプレライト機能を有するフラッシュメモリ等に適用する。
【0015】
上記フラッシュメモリ等において、指定アドレスに書き込むべきライトデータと、指定アドレスから読み出されるリードデータのビット反転データとの論理積データをもとに、指定アドレスのすでに書き込み済のビットに対する不条理書き込み、又はデプリートエラーを識別判定する。
【0016】
上記フラッシュメモリ等の書き込み動作に関する一連の処理を、マイクロコンピュータ等に搭載された中央処理ユニットによりソフトウェア的に実現する。
【0017】
上記フラッシュメモリ等の書き込み動作に関する一連の処理を、フラッシュメモリ等の関連回路によりハードウェア的に実現する。
【0018】
上記した手段によれば、1回の読み出し動作により得られたリードデータをもとに、書き込み動作の終了を判定し、かつリライトデータを生成することができるため、特にメモリセルのしきい値電圧が揺らぎ領域にある場合の無限ループを抑制して、フラッシュメモリ等の書き込み所要時間の不本意な増大を抑制し、フラッシュメモリ等の書き込み特性を改善することができる。
【0019】
また、書き込み履歴データとリードデータとの論理積データをもとに、書き込み動作の終了を判定し、かつリライトデータを生成することで、一度書き込み状態となったメモリセルが消去状態となった場合でもこのようなメモリセルに対する再書き込みを防止することができるため、特にメモリセルのしきい値電圧が揺らぎ領域にある場合の無限ループをさらに確実に解消して、フラッシュメモリ等の書き込み所要時間の不本意な増大を確実に防止し、フラッシュメモリ等の書き込み特性をさらに改善することができる。
【0020】
書き込み動作に関する一連の処理をプレライト機能を有するフラッシュメモリ等に適用することで、消去対象となるメモリセルのプレライト後のしきい値電圧のバラツキを抑え、フラッシュメモリ等の消去特性を高めることができる。
【0021】
ライトデータとリードデータのビット反転データとの論理積データをもとに不条理書き込みを判定することで、すでに書き込み状態にあるメモリセルに対する書き込みデータの不条理性を識別できるとともに、書き込み対象となったメモリセルと同一ビット線に結合されたメモリセルのデプリートエラーを識別し、フラッシュメモリ等の保持データの信頼性を高めることができる。
【0022】
上記フラッシュメモリ等の書き込み動作に関する一連の処理を、中央処理ユニットによりソフトウェア的に実現することで、フラッシュメモリ等の書き換えが行われる間は通常処理に使用されることのない中央処理ユニットを活用して、フラッシュメモリのハードウェア量を削減し、マイクロコンピュータ等のチップサイズを縮小して、そのコスト低減を図ることができる。
【0023】
上記フラッシュメモリ等の書き込み動作に関する一連の処理を、フラッシュメモリ等の関連回路によりハードウェア的に実現することで、比較的少量のハードウェア追加で、かつ比較的高速に、しかも中央処理ユニットが他の処理を行っている間に、フラッシュメモリ等の部分的な書き換えを行うことができる。
【0024】
以上により、フラッシュメモリ等ならびにこれを含むシングルチップマイクロコンピュータ等の信頼性を高め、その高速化,低コスト化ならびに処理の効率化を図ることができる。
【0025】
【発明の実施の形態】
図1には、この発明が適用されたシングルチップマイクロコンピュータ(システム)の一実施例のブロック図が示されている。同図をもとに、まずこの実施例のシングルチップマイクロコンピュータ(以下、単にマイクロコンピュータと略称する)の構成及び動作の概要ならびにその特徴について説明する。なお、図1の各ブロックを構成する回路素子は、特に制限されないが、公知のMOSFET(金属酸化物半導体型電界効果トランジスタ。この明細書では、MOSFETをして絶縁ゲート型電界効果トランジスタの総称とする)集積回路の製造技術により、単結晶シリコンのような1個の半導体基板面上に形成される。
【0026】
図1において、この実施例のマイクロコンピュータは、いわゆるストアドプログラム方式の中央処理ユニットCPUと、クロック発生回路CPGとを備える。このうち、中央処理ユニットCPUには、内部バスIBUSを介してフラッシュメモリFROM(不揮発性メモリ),スタティック型RAM(SRAM),ダイレクトメモリアクセスコントローラDMACならびにバスコントローラBUSCが結合され、クロック発生回路CPGには、外部端子XTAL及びEXTALを介して所定の固有震動数を有する水晶発振子XTALが結合される。マイクロコンピュータには、さらに外部の電源装置から外部端子VCC及びVSSを介して主たる動作電源となる電源電圧VCC及び接地電位VSSがそれぞれ供給され、中央処理ユニットCPUには、外部端子STBYB及びRESBを介してスタンバイ信号STBYB(ここで、それが有効とされるとき選択的にロウレベルとされるいわゆる反転信号等については、その名称の末尾にBを付して表す。以下同様)及びリセット信号RESBがそれぞれ供給される。なお、主たる動作電源となる電源電圧VCCは、例えば+5V(ボルト)とされる。
【0027】
マイクロコンピュータの中央処理ユニットCPUは、フラッシュメモリFROMに格納された制御プログラムに従ってステップ動作し、各種演算処理を行うとともに、マイクロコンピュータの各部を制御・統轄する。また、この実施例において、中央処理ユニットCPUは、フラッシュメモリFROMの書き換えに関する一連の処理を行うが、このことについては後で詳細に説明する。
【0028】
クロック発生回路CPGは、外部の水晶発振子XTALとともに、その固有振動数に見合った所定の周波数・位相を有するクロック信号を形成し、マイクロコンピュータの各部に供給する。また、フラッシュメモリFROMは、コントロールゲート及びフローティングゲートを有する2層ゲート構造型メモリセルが格子配置されてなるメモリアレイをその基本構成要素とし、中央処理ユニットCPUのステップ動作に必要な制御プログラムや固定データ等を格納する。言うまでもなく、フラッシュメモリFROMの保持データは書き換え可能とされるため、同一のマイクロコンピュータをもって種々の機能を有するシステムを実現することができるとともに、そのデバッグ等のための開発期間を短縮することができる。なお、フラッシュメモリFROMの具体的構成,動作,その書き込み及び消去処理手順ならびに特徴等については、後で詳細に説明する。
【0029】
スタティック型RAM(SRAM)は、比較的高速なアクセスを可能とし、中央処理ユニットCPUの演算結果や制御データ等を一時的に格納する。また、ダイレクトメモリアクセスコントローラDMACは、中央処理ユニットCPUの介在を必要とすることなく、例えばスタティック型RAM(SRAM)と外部装置との間のデータ転送をサポートする。さらに、バスコントローラBUSCは、内部バスIBUSに対するバスアクセスを管理し、内部バスIBUSと周辺バスPBUSつまりこれに結合されるデバイスとの間の接続処理を行う。
【0030】
マイクロコンピュータの周辺バスPBUSには、さらにシリアルコミュニケーションインタフェースSCI,タイマー回路TIM,デジタル・アナログ変換回路D/A,アナログ・デジタル変換回路A/Dならびに11個の入出力ポートIOPA〜IOPKが結合される。このうち、シリアルコミュニケーションインタフェースSCIは、対応する入出力ポートIOPA〜IOPKのうち所定のポートに結合された外部のシリアル入出力装置との間で、所定のアルゴリズムに沿ったシリアルデータ転送をサポートし、タイマー回路TIMは、クロック発生回路CPGから供給されるクロック信号に従って時間管理を行う。
【0031】
一方、デジタル・アナログ変換回路D/Aは、中央処理ユニットCPU等により生成されたデジタルデータを、所定のアナログ信号に変換して外部の入出力装置に伝達する。また、アナログ・デジタル変換回路A/Dは、例えば外部の各種センサ等から入力されるアナログ入力信号を、所定ビットのディジタル信号に変換して、中央処理ユニットCPU等に伝達する。さらに、入出力ポートIOPIOPA〜IOPKは、マイクロコンピュータの各部と外部に設けられた各種装置との信号授受を行うインタフェース回路として機能する。
【0032】
前述のように、フラッシュメモリFROMは、制御プログラムや固定データ等の格納に供され、その書き換えは、主に中央処理ユニットCPUによりソフトウェア的に行われる。この実施例では、特にフラッシュメモリFROMの消去動作に先立って、消去対象となるすべてのメモリセルを書き込み状態に揃えるプレライトが行われるとともに、その書き込み時には、指定アドレスから読み出されたリードデータとライトデータのビット反転データとの論理積データをもとに、書き込み動作の終了判定が行われるとともに、同一の論理積データをもとに、書き込み未終了の指定アドレスに対するリライトデータが生成され、あるいは、ライトデータ又はリライトデータをビット反転してなる書き込み履歴データとリードデータとの論理積データをもとに、書き込み動作の終了判定行われるとともに、同一の論理積データをもとに、リライトデータの生成が行われる。
【0033】
これにより、フラッシュメモリFROMひいてはこれを含むマイクロコンピュータの信頼性が高められ、その高速化,低コスト化ならびに処理の効率化が図られる。これらのことについては、後で詳細に説明する。
【0034】
図2には、図1のマイクロコンピュータに含まれるフラッシュメモリFROMの一実施例のブロック図が示されている。また、図3には、図2のフラッシュメモリFROMに含まれるメモリアレイMARY及び周辺部の一実施例の部分的な回路図が示されている。これらの図をもとに、この実施例のマイクロコンピュータに含まれるフラッシュメモリFROMの具体的構成及び動作ならびにその特徴等について説明する。なお、図3には、書き込み回路WC,センスアンプSAならびにカラムラッチCLの代表的な部分が例示されるが、各部を構成する回路素子は、例示されるものがすべてではない。以下の回路図において、そのチャネル(バックゲート)部に矢印が付されるMOSFETはPチャンネル型であって、矢印の付されないNチャンネルMOSFETと区別して示される。
【0035】
図2において、この実施例のフラッシュメモリFROMは、レイアウト所要面積の大半を占めて配置されるメモリアレイMARYをその基本構成要素とする。また、フラッシュメモリFROMは、内部バスIBUSのコントロールバスCBUSに結合されるコントロールバッファCBを備え、さらにコントロールバッファCBの出力信号を受けるメモリコントローラMCと、電源電圧VCC及び接地電位VSSを受ける内部電圧発生回路VGとを備える。
【0036】
このうち、コントロールバッファCB及びメモリコントローラMCは、内部バスIBUSのコントロールバスCBUSを介して供給される各種起動制御信号をもとに、図示されない各種内部制御信号を選択的に形成し、フラッシュメモリFROMの各部に供給する。また、内部電圧発生回路VGは、マイクロコンピュータの図示されない制御回路から供給される電圧制御信号VCSに従って選択的に動作状態とされる複数の電圧発生回路を含み、フラッシュメモリFROMの書き込み,消去ならびに読み出し動作に必要な各種の内部電圧を生成する。
【0037】
一方、メモリアレイMARYは、特に制限されないが、いわゆるノア(NOR)型アレイとされ、図3に示されるように、図の水平方向に平行して配置されるm+1本つまり実質1,024本のワード線W0〜Wmと、垂直方向に平行して配置されるn+1本つまり実質1,024本のビット線B0〜Bnとを含む。これらのワード線及びビット線の交点には、フローティングゲート及びコントロールゲートを有する1,024×1,024個つまり1,048,576個の2層ゲート構造型メモリセルMCが格子配列される。これにより、フラッシュメモリFROMは、いわゆる1メガビットの記憶容量を有するものとなる。
【0038】
メモリアレイMARYの同一行に配置されたn+1個のメモリセルMCのコントロールゲートは、対応するワード線W0〜Wmにそれぞれ共通結合され、そのソースは、隣接行に配置されたn+1個のメモリセルMCのソースとともに、対応するソース線S0〜Spにそれぞれ共通結合される。また、メモリアレイMARYの同一列に配置されたm+1個のメモリセルMCのドレインは、対応するビット線B0〜Bnにそれぞれ共通結合される。なお、ソース線S0〜Spの本数p+1が、ワード線W0〜Wmの本数m+1に対して、
p+1=(m+1)/2
なる関係にあることは言うまでもない。
【0039】
この実施例において、メモリアレイMARYを構成する2層ゲート構造型メモリセルMCのそれぞれは、特に制限されないが、それが消去状態にあるとき、いわゆる論理“1”のデータを保持するものとされ、それが書き込み状態にあるときには、いわゆる論理“0”のデータを保持するものとされる。また、メモリセルMCの消去動作は、そのコントロールゲートつまり対応するワード線W0〜Wmに例えば+9Vのような正電位を印加し、そのソースつまり対応するソース線S0〜Spに例えば−9Vのような負電位を印加して、そのソース側からフローティングゲートに電子を注入することにより行われ、メモリセルMCの書き込み動作は、そのドレインつまり対応するビット線B0〜Bnに例えば+6Vのような正電位を印加し、そのコントロールゲートつまり対応するワード線W0〜Wmに例えば−9Vのような負電位を印加して、そのフローティングゲートに蓄積された電子をドレイン側に引き抜くことにより行われる。
【0040】
これにより、メモリセルMCのしきい値電圧は、それが消去状態にあるとき、例えば+2.5Vを超える比較的高い値とされ、それが書き込み状態にあるときには、+2.5Vより低い比較的低い値とされる。したがって、保持データの読み出し動作時には、対応するワード線W0〜Wmが例えば択一的に+2.5Vのような選択レベルとされることで、消去状態にあるメモリセルMCはオフ状態となって比較的小さな読み出し電流を流し、書き込み状態にあるメモリセルMCはオン状態となって比較的大きな読み出し電流を流すものとなる。
【0041】
メモリアレイMARYを構成するワード線W0〜Wmは、図2に示されるように、その左方においてXアドレスデコーダXDに結合され、ソース線S0〜Spは、その右方においてソース電圧制御回路SCに結合される。XアドレスデコーダXDには、特に制限されないが、アドレスバッファABから10ビットの内部Xアドレス信号X0〜X9が供給され、内部電圧発生回路VGからワード線W0〜Wmの選択又は非選択レベルとして必要な各種の内部電圧が供給される。内部Xアドレス信号X0〜X9は、ソース電圧制御回路SCにも供給され、このソース電圧制御回路SCには、さらに内部電圧発生回路VGからソース線S0〜Spの選択又は非選択レベルとして必要な各種の内部電圧が供給される。
【0042】
XアドレスデコーダXDは、フラッシュメモリFROMが選択状態とされるとき、アドレスバッファABから供給される内部Xアドレス信号X0〜X9をデコードして、メモリアレイMARYのワード線W0〜Wmの対応するビットを選択的に所定の選択又は非選択レベルとする。また、ソース電圧制御回路SCは、フラッシュメモリFROMが選択状態とされるとき、同じく内部Xアドレス信号X0〜X9をデコードして、メモリアレイMARYのソース線S0〜Spの対応するビットを選択的に所定の選択又は非選択レベルとする。
【0043】
特に制限されないが、フラッシュメモリFROMが書き込みモードとされるとき、ワード線W0〜Wmの選択レベルは、前述のように、例えば−9Vとされ、その非選択レベルは例えば電源電圧VCCつまり例えば+5Vとされる。また、フラッシュメモリFROMが消去モードとされるとき、ワード線W0〜Wmの選択レベルは、前述のように、例えば+9Vとされ、その非選択レベルは例えば接地電位VSSとされる。さらに、フラッシュメモリFROMが読み出しモードとされるとき、ワード線W0〜Wmの選択レベルは、前述のように、例えば+2.5Vとされ、その非選択レベルは接地電位VSSとされる。
【0044】
なお、フラッシュメモリFROMの書き込みモードには、書き込み状態を確認するための読み出し動作つまりベリファイ動作が含まれるが、このベリファイ動作時におけるワード線W0〜Wmの選択レベルは、通常の読み出し動作時の選択レベルつまり+2.5Vよりやや高い例えば+4Vとされる。
【0045】
一方、フラッシュメモリFROMが書き込みモードとされるとき、選択状態にあるソース線S0〜Spは、いわゆる開放状態とされ、その非選択レベルは接地電位VSSとされる。また、フラッシュメモリFROMが消去モードとされるとき、ソース線S0〜Spの選択レベルは例えば−9Vとされ、その非選択レベルは接地電位VSSとされる。フラッシュメモリFROMが読み出しモードとされるとき、ソース線S0〜Spはすべて接地電位VSSとされる。
【0046】
次に、メモリアレイMARYを構成するビット線B0〜Bnは、その下方において書き込み回路WC及びセンスアンプSAの対応する単位回路に結合される。書き込み回路WC及びセンスアンプSAの各単位回路は、その他方においてカラムラッチCLの対応する単位回路に結合され、このカラムラッチCLの各単位回路は、その他方においてYゲート回路YGを介して32個ずつ選択的にデータ入出力回路IOの対応する単位回路に接続される。データ入出力回路IOの各単位回路は、その他方においてデータバッファDBの対応する単位回路に結合され、このデータバッファDBは、その他方において内部バスIBUSのデータバスDBUSの対応するビットにそれぞれ結合される。
【0047】
Yゲート回路YGには、YアドレスデコーダYDからq+1ビットつまり実質128ビットのビット線選択信号YS0〜YSqが供給され、YアドレスデコーダYDには、アドレスバッファABから7ビットの内部Yアドレス信号Y0〜Y6が供給される。アドレスバッファABには、内部バスIBUSのアドレスバスABUSを介して17ビットのアドレス信号A0〜A16が供給される。
【0048】
アドレスバッファABは、内部バスIBUSのアドレスバスABUSを介して供給されるアドレス信号A0〜A16を取り込み、保持する。そして、そのうちの10ビットを、内部Xアドレス信号X0〜X9としてXアドレスデコーダXD及びソース電圧制御回路SCに供給し、残りの7ビットを、内部Yアドレス信号Y0〜Y6としてYアドレスデコーダYDに供給する。
【0049】
YアドレスデコーダYDは、アドレスバッファABから供給される内部Yアドレス信号Y0〜Y6をデコードして、Yゲート回路YGに対するビット線選択信号YS0〜YSqの対応するビットを択一的に所定の選択レベルとする。
【0050】
Yゲート回路YGは、カラムラッチCLの各単位回路に対応して設けられるn+1個つまり1,024個のスイッチMOSFETを含む。これらのスイッチMOSFETは、YアドレスデコーダYDから供給されるビット線選択信号YS0〜YSqの対応するビットが択一的にハイレベルとされることで32個ずつ選択的にオン状態となり、カラムラッチCLの各単位回路の一方の入出力ノードとデータ入出力回路IOの対応する単位回路との間を接続状態とする。
【0051】
一方、データバッファDB及びデータ入出力回路IOは、フラッシュメモリFROMが書き込みモードで選択状態とされるとき、内部バスIBUSのデータバスDBUSを介して供給される32ビットの書き込みデータを順次取り込み、Yゲート回路YGを介してカラムラッチCLの指定された32個の単位回路に伝達する。カラムラッチCLの各単位回路に取り込まれた書き込みデータは、128バイトつまり1,024ビット蓄積された時点で、書き込み回路WCを介してメモリアレイMARYの選択ワード線に結合される1,024個のメモリセルMCに一斉に書き込まれる。フラッシュメモリFROMが読み出しモードとされるとき、データバスDBUS及びデータ入出力回路IOは、メモリアレイMARYの選択されたメモリセルMCから出力され、カラムラッチCLの各単位回路に保持される読み出しデータを32ビットずつ選択的に取り出し、内部バスIBUSのデータバスDBUSを介してアクセス装置に出力する。
【0052】
このように、本実施例のフラッシュメモリFROMに対するデータの入出力動作は、32ビットつまり4バイトを単位として行われるが、メモリアレイMARYに対する実質的な書き込み及び読み出し動作は、128バイトつまり1,024ビットのセクタを単位として行われる。このため、メモリアレイMARYのワード線W0〜Wmは、10ビットの内部Xアドレス信号X0〜X9に従って択一的に指定され、そのビット線B0〜Bnは、7ビットの内部Yアドレス信号Y0〜Y6に従って32ビットずつ選択的に指定されるものとなる。
【0053】
ここで、カラムラッチCLは、メモリアレイMARYのビット線B0〜Bnに対応して設けられるn+1個つまり実質1,024個の単位回路を備え、これらの単位回路のそれぞれは、特に制限されないが、図3に例示されるように、一対のインバータV1及びV2が交差結合されてなるラッチ回路L1と、Nチャンネル型の2個のスイッチMOSFETN1及びN2とを含む。このうち、カラムラッチCLの各単位回路のラッチ回路L1の下方の入出力ノードは、スイッチMOSFETN1を介して対応するデータ入出力線D0〜Dnつまりデータ入出力回路IOに結合される。また、その上方の入出力ノードは、後述する書き込み回路WCの対応するインバータV3の入力端子に結合されるとともに、スイッチMOSFETN2を介してセンスアンプSAの対応する単位センスアンプUAの反転出力ノードに結合される。スイッチMOSFETN1のゲートには、メモリコントローラMCからラッチ制御信号LC1が共通に供給され、スイッチMOSFETN2のゲートには、ラッチ制御信号LC2が共通に供給される。
【0054】
なお、ラッチ制御信号LC1は、通常接地電位VSSのようなロウレベルとされ、フラッシュメモリFROMが書き込みモードで選択状態とされるとき、所定のタイミングで選択的に電源電圧VCCのようなハイレベルとされる。また、ラッチ制御信号LC2は、通常接地電位VSSのようなロウレベルとされ、フラッシュメモリFROMが読み出しモードで選択状態とされるとき、所定のタイミングで選択的に電源電圧VCCのようなハイレベルとされる。
【0055】
前述のように、フラッシュメモリFROMが書き込みモードで選択状態とされるとき、カラムラッチCLには、アクセス装置から内部バスIBUSのデータバスDBUS,データバッファDB,データ入出力回路IO,Yゲート回路YGならびにデータ入出力線D0〜Dnを介して書き込みデータが32ビット単位で供給される。これらの書き込みデータは、ラッチ制御信号LC1のハイレベルを受けてオン状態となるスイッチMOSFETN2を介して、カラムラッチCLの対応する32個のラッチ回路L1に順次取り込まれ、保持される。そして、128バイト分の書き込みデータの取り込みが終了した時点で、書き込み回路WCを介してメモリアレイMARYに伝達され、選択ワード線に結合されたn+1個つまり実質1,024個のメモリセルMCに一斉に書き込まれる。
【0056】
一方、フラッシュメモリFROMが読み出しモードで選択状態とされるとき、カラムラッチCLには、後述するセンスアンプSAの1,024個の単位回路から、単位センスアンプUAの反転出力信号つまり反転読み出しデータが供給される。これらの反転読み出しデータは、ラッチ制御信号LC2のハイレベルを受けてオン状態となるスイッチMOSFETN2を介して、カラムラッチCLの各単位回路のラッチ回路L1に一斉に取り込まれ、保持される。そして、対応するラッチ回路L1のインバータV2によりそれぞれ反転されて非反転読み出しデータとなり、データ入出力線D0〜DnからYゲート回路YG,データ入出力回路IO,データバッファDBならびに内部バスIBUSのデータバスDBUSを介して、32ビット単位でアクセス装置に出力される。
【0057】
次に、書き込み回路WCは、メモリアレイMARYのビット線B0〜Bnに対応して設けられるn+1個つまり1,024個の単位回路を備え、これらの単位回路のそれぞれは、特に制限されないが、図3に示されるように、2個のPチャンネルMOSFETP1及びP2と、+6Vのような比較的高電位の内部電圧VPPを動作電源とするインバータV3とを含む。書き込み回路WCの各単位回路を構成するMOSFETP1のソースは、内部電圧供給点VPPに結合され、そのドレインは、MOSFETP2を介してメモリアレイMARYの対応するビット線B0〜Bnに結合される。また、MOSFETP1のゲートは、対応するインバータV3の出力端子に結合され、インバータV3の入力端子は、カラムラッチCLの対応するラッチ回路L1を構成するインバータV1の出力端子に結合される。書き込み回路WCの各単位回路のMOSFETP2のゲートには、メモリコントローラMCから書き込み制御信号WPが共通に供給される。
【0058】
なお、書き込み制御信号WPは、通常内部電圧VPPのようなハイレベルとされ、フラッシュメモリFROMが書き込みモードで選択状態とされるとき、所定のタイミングで選択的に接地電位VSSのようなロウレベルとされる。
【0059】
これにより、書き込み回路WCの各単位回路を構成するMOSFETP2は、フラッシュメモリFROMが書き込みモードで選択状態とされるとき、書き込み制御信号WPのロウレベルを受けて選択的にかつ一斉にオン状態となる。このとき、各単位回路のMOSFETP1は、対応するインバータV3の出力信号が接地電位VSSのようなロウレベルとされることを条件に、言い換えるならば、カラムラッチCLの対応するラッチ回路L1により保持される書き込みデータが論理“0”とされそのインバータV1の出力信号がハイレベルとされることで選択的にオン状態となり、メモリアレイMARYの対応するビット線B0〜Bnを内部電圧VPPつまり+6Vのようなハイレベルの選択レベルとする。
【0060】
言うまでもなく、カラムラッチCLの対応するラッチ回路L1により保持される書き込みデータが論理“1”とされ、対応するインバータV1の出力信号がロウレベルとされるとき、インバータV3の出力信号は内部電圧VPPのようなハイレベルとなる。このため、書き込み回路WCの各単位回路のMOSFETP1はオフ状態となり、メモリアレイMARYの対応するビット線B0〜Bnは図示されない経路を介して接地電位VSSのような非選択レベルとされる。
【0061】
フラッシュメモリFROMが書き込みモードで選択状態とされるとき、メモリアレイMARYのワード線W0〜Wmは、前述のように、択一的に−9Vのような選択レベルとされ、ソース線S0〜Spは開放状態とされる。このとき、メモリアレイMARYの選択ワード線に結合されたn+1個のメモリセルMCでは、対応するビット線B0〜Bnが+6Vのような選択レベルとされることを条件に選択的に書き込みが行われ、フローティングゲートに蓄積された電子が選択的にドレイン側に引き抜かれて、そのしきい値電圧が低くされる。
【0062】
次に、センスアンプSAは、メモリアレイMARYのビット線B0〜Bnに対応して設けられるn+1個つまり実質1,024個の単位回路を備え、これらの単位回路のそれぞれは、特に制限されないが、図3に示されるように、1個の単位センスアンプUAと、Pチャンネル型のスイッチMOSFETP3とを含む。各単位回路を構成する単位センスアンプUAの入力ノードは、スイッチMOSFETP3を介してメモリアレイMARYの対応するビット線B0〜Bnに結合され、その反転出力ノードは、カラムラッチCLのNチャンネルMOSFETN2を介して対応するラッチ回路L1の上方の入出力ノードに結合される。センスアンプSAの各単位回路を構成するMOSFETP3のゲートには、メモリコントローラMCから読み出し制御信号RCが共通に供給される。
【0063】
なお、読み出し制御信号RCは、通常電源電圧VCCのようなハイレベルとされ、フラッシュメモリFROMが読み出しモードで選択状態とされるとき、所定のタイミングで選択的に接地電位VSSのようなロウレベルとされる。
【0064】
フラッシュメモリFROMが読み出しモードで選択状態とされるとき、メモリアレイMARYのワード線W0〜Wmは、前述のように、択一的に+2.5Vのような選択レベルとされ、ソース線S0〜Spはすべて接地電位VSSのようなロウレベルとされる。また、メモリアレイMARYのビット線B0〜Bnは、読み出し動作の当初において、センスアンプSAの図示されないプリチャージ回路により一斉に電源電圧VCCのようなハイレベルにプリチャージされる。これらのビット線B0〜Bnのプリチャージレベルは、選択ワード線との対応する交点に配置されたメモリセルMCが書き込み状態にあり、そのしきい値電圧が比較的低くされることを条件に選択的に引き抜かれ、低下する。
【0065】
ビット線B0〜Bnの選択的なレベル低下は、センスアンプSAの対応する単位回路の単位センスアンプUAによりセンス・増幅され、これを受けて単位センスアンプUAの反転出力ノードにおける反転読み出しデータが選択的にハイレベルとされる。これらの反転読み出しデータは、ラッチ制御信号LC2のハイレベルを受けてカラムラッチCLの対応するラッチ回路L1に取り込まれ、反転されて非反転読み出しデータとなり、32ビットずつ選択的に出力される。
【0066】
ところで、メモリアレイMARYを構成する2層ゲート構造型メモリセルMCは、その書き込み・消去特性に比較的大きなバラツキを呈するため、上記のような128バイト単位の書き込み及びブロック単位の消去動作は、書き込み又は消去動作後におけるメモリセルMCの保持データの変化を確認しながら、すなわち論理“1”の消去状態にあったメモリセルMCが論理“0”の書き込み状態に変わり、あるいは論理“0”の書き込み状態にあったメモリセルMCが論理“1”の消去状態に変わったかどうかを確認しながら繰り返される。また、この実施例のフラッシュメモリFROMでは、消去動作に先立って、消去対象となるすべてのメモリセルMCを書き込み状態に揃えるプレライト方式がとられる。この実施例において、フラッシュメモリFROMの書き込み・消去動作に必要な制御は、前記のように、主に中央処理ユニットCPUによりソフトウェア的に行われ、いくつかの特徴を持つが、このことについては以下に詳細に説明する。
【0067】
図4には、図1のマイクロコンピュータのフラッシュメモリ書き込み時の第1の実施例の基本フロー図が示され、図5には、図4のフラッシュメモリ書き込み時の動作を説明するための一実施例の動作概念図が示されている。また、図6には、図4のフラッシュメモリ書き込み時における不条理書き込み判定処理の一実施例の基本フロー図が示され、図7には、図6の不条理書き込み判定処理時の動作を説明するための一実施例の動作概念図が示されている。さらに、図8には、図4の基本フローをとるマイクロコンピュータの中央処理ユニットの一実施例の処理フロー図が示されている。これらの図をもとに、この実施例のマイクロコンピュータのフラッシュメモリ書き込み時の具体的な動作及びその特徴について説明する。なお、この実施例のマイクロコンピュータでは、前述のように、32ビットつまり4バイト単位のデータ処理が行われるが、以下の動作概念図では、そのうちの8ビットつまり1バイト分のみが例示される。
【0068】
図4において、この実施例のフラッシュメモリFROMにおける書き込み動作は、ステップS111によるライトデータWDの生成処理から始まる。前述のように、フラッシュメモリFROMのメモリアレイMARYを構成する2層ゲート構造型メモリセルMCは、それが消去状態にあるとき、図5の最上段に示されるように、すべて論理“1”のデータを保持するものとされる。また、フラッシュメモリFROMにおける実質的な書き込み動作は、前述のように、実質1,024ビットつまり128バイト単位で行われるが、ライトデータWDは32ビット単位で生成され、このうちの書き込み対象となるビットには、図5の第2段目に例示されるように、論理“0”のデータが選択的に割り当てられる。言うまでもなく、指定アドレスの書き込み対象とならないビット、つまり消去状態のままにしておきたいビットには、論理“1”のデータが割り当てられ、ライトデータWDには、論理“1”及び“0”のデータが混在する場合が多い。
【0069】
ステップS111により生成されたライトデータWDは、ステップS112により、各ビットごとに論理反転され、ビット反転データつまり反転ライトデータWDIが生成される。この反転ライトデータWDIでは、図5の第3段目に例示されるように、指定アドレスの書き込み対象となるビットが論理“1”とされ、書き込み対象とならないビットが論理“0”とされる。
【0070】
ライトデータWD及び反転ライトデータWDIの生成が終了すると、まずステップS113により、指定アドレスの保持データRDが読み出された後、ステップS114により、不条理書き込みの判定処理が行われる。前記したように、指定アドレスから読み出されるリードデータRDの各ビットは、対応するメモリセルMCが未だ消去状態にあるとき論理“1”とされ、すでに書き込み状態にあるときには論理“0”とされる。したがって、消去後最初の読み出しにより得られるリードデータRDは、図5の第4段目に例示されるように、その全ビットが論理“1”とされる。なお、ステップS114による不条理書き込み判定処理の必要性及びその効果等については、後で詳細に説明する。
【0071】
ステップS114の不条理判定処理により異常が検出されず、判定結果がyesとなると、ステップS115により、反転ライトデータWDIとリードデータRDのビットごとの論理積がとられ、論理積データWDAが生成される。言うまでもなく、論理積データWDAの各ビットは、反転ライトデータWDI及びリードデータRDの対応するビットがともに論理“1”であることを条件に選択的に論理“1”とされ、その他の条件では論理“0”とされる。したがって、消去後最初のリードデータRDと反転ライトデータWDIとをもとに生成される論理積データWDAは、図5の第5段目に例示されるように、その各ビットが反転ライトデータWDIの対応するビットと同一の論理値を持つものとなる。
【0072】
ステップS115により生成された論理積データWDAは、ステップS116によりその全ビットが論理“0”となったかどうか、つまり書き込み動作が終了してその書き込み対象となるビットがすべて論理“0”に変わったかどうかの判定を受ける。この結果、論理積データWDAの全ビットが論理“0”に変化した場合、指定アドレスに対する書き込み動作は終了したものとして他の処理に移行し、まだいずれかのビットが論理“1”のままである場合には、ステップS117により、論理積データWDAをビット反転して、指定アドレスに再書き込みすべきリライトデータWDRが生成される。このリライトデータWDRは、ステップS118により指定アドレスに書き込まれ、その後はステップS113に戻って処理ループが形成される。なお、消去後最初のリードデータRD及び論理積データWDAをもとに生成されるリライトデータWDRは、図5の第6段目に例示されるように、ライトデータWDそのものとなる。
【0073】
ステップS118による書き込み動作を終えたメモリアレイMARYの指定アドレスでは、図5の第7段目に例示されるように、その第1〜第2ビットならびに第4〜第8ビットの論理値が、リライトデータWDRの対応するビットに応じた論理値に変化されるものの、その第3ビットは、対応するメモリセルMCのしきい値電圧が充分に低くならず、論理“1”つまり消去状態のままにある。したがって、ループ2回目のステップS113による読み出し動作では、図5の第8段目に例示されるように、リードデータRDの第3ビットも論理“1”となり、ステップS115により得られる新しい論理積データWDAは、図5の第9段目に例示されるように、その第3ビットのみが論理“1”となる。
【0074】
これにより、ループ2回目のステップS117により生成されるリライトデータWDRは、図5の第10段目に例示されるように、その第3ビットのみが論理“0”となり、その他のビットは論理“1”となる。また、このリライトデータWDRは、ステップS118により再度指定アドレスに書き込まれ、その結果として指定アドレスの第3ビットは、図5の第11段目に例示されるように、論理“0”に変化し、全ビットがライトデータWDと一致した状態となる。
【0075】
指定アドレスの保持データは、ループ3回目のステップS113によりリードデータRDとして読み出された後、ステップS115により反転ライトデータWDIとの論理積がとられて論理積データWDAとなる。以上の説明から明らかなように、ループ3回目のステップS115により生成される論理積データWDAは、図5の第13段目に例示されるように、その全ビットが論理“0”となるため、ステップS116の条件が成立し、書き込み終了となる。
【0076】
以上のように、この実施例のマイクロコンピュータでは、ステップS113によりフラッシュメモリFROMの指定アドレスから読み出されたリードデータRDが、ステップS115による反転ライトデータWDIとの論理積データWDAの生成に供され、この論理積データWDAが、ステップS116による書き込み動作の終了判定に供されるとともに、ステップS117によるリライトデータWDRの生成にも供される。つまり、この実施例では、ステップS113による1回の読み出し動作により得られたリードデータRDならびにその反転ライトデータWDIとの論理積データWDAをもとに、書き込み動作の終了を判定し、リライトデータを生成することができる訳であって、特にメモリセルのしきい値電圧が揺らぎ領域にあり、読み出し動作のたびにその論理値が変化するビットが存在する場合でも、これにともなう再書き込みの発生を抑制し、これが繰り返されることによる無限ループの発生を抑制することができる。
【0077】
この結果、フラッシュメモリFROMの書き込み所要時間が不本意に増大するのを防止できるとともに、その書き込み特性を改善することができ、フラッシュメモリFROMひいてはこれを搭載するマイクロコンピュータの信頼性を高め、その高速化及び処理の効率化を図ることができるものである。
【0078】
ところで、図4のステップS114として行われる不条理書き込みの判定処理では、特に制限されないが、図6の点線枠内に示されるように、まずステップS141により、リードデータRDをビット反転してそのビット反転データつまり反転リードデータRDIが生成された後、ステップS142により、ライトデータWDと反転リードデータRDIとの論理積がとられて論理積データRDAが生成される。論理積データRDAは、ステップS143により、全ビットが論理“0”であるかどうか判定され、全ビットが論理“0”である場合、異常がないものと判定されてステップS115以後の処理に移行する。しかし、ステップS143で論理積データRDAのいずれかのビットが論理“1”である場合には、異常発生とみなされて書き込み動作を中断し、エラー処理に移行する。
【0079】
すなわち、ステップS142の処理結果として得られる論理積データRDAの各ビットは、指定アドレスの対応するビットがすでに書き込み状態にありリードデータRDの対応するビットが論理“0”であるにもかかわらず、ライトデータWDの対応するビットが消去状態に対応する論理“1”である場合、つまり不条理書き込みが指定された場合に選択的に論理“1”となる。また、不条理書き込みの指定はなかったが、図7に示されるように、例えばループ3回目のステップS113で、指定アドレスの第2ビットの読み出し結果が同一列に配置された、つまり同一ビット線に結合されたデプリートエラー状態にある他のビットの影響を受けて論理“0”に変化した場合にも選択的に論理“1”となる。
【0080】
以上のことから、この実施例のマイクロコンピュータ及びフラッシュメモリFROMでは、指定アドレスの書き込みに先立って、ライトデータWDの不条理性を識別し、書き込み動作を中断して、保持データの正常性を確保することができるとともに、指定アドレスに対する書き込み動作が開始された後も、指定メモリセルと同一の列に配置された他のメモリセルのデプリートエラーを検出することができ、これによってフラッシュメモリFROMひいてはこれを搭載するマイクロコンピュータの信頼性をさらに高めることができるものである。
【0081】
なお、この実施例のマイクロコンピュータでは、前述のように、実際には128バイトのセクタを単位としてフラッシュメモリFROMの書き込み動作が実行されるとともに、指定セクタの書き込み動作に関する上記一連の処理は、主に中央処理ユニットCPUによりソフトウェア的に行われる。このため、中央処理ユニットCPUでは、図8に例示される手順に従って具体的な処理が進められ、図4の基本フローに沿った書き込み動作が行われる。
【0082】
すなわち、中央処理ユニットCPUは、まずステップS211により、指定アドレスつまり指定セクタに書き込むべき128バイト単位のセクタライトデータWDSを編集し、次のステップS212により、このセクタライトデータWDSをビット反転して反転セクタライトデータWDISを生成する。また、ステップS213により、指定セクタの保持データRDSをセクタ単位で読み出した後、ステップS214により、セクタリードデータRDS及びセクタライトデータWDSをもとに不条理書き込みの判定を行う。なお、ステップS211〜S214によるセクタライトデータWDS及び反転セクタライトデータWDISの生成,セクタリードデータRDSの読み出しならびに不条理書き込み判定処理は、実際には、中央処理ユニットCPUの演算処理単位である32ビットつまり4バイトを単位として32回ずつ繰り返されるが、簡略化して示した。
【0083】
ステップS214の不条理書き込み判定処理を正常に終了した中央処理ユニットCPUは、次にステップS215により、反転セクタライトデータWDISの4Bつまり4バイト分をレジスタREG1に入力した後、ステップS216により、セクタリードデータRDSの対応する4バイト分をレジスタREG2に入力する。また、ステップS217により、レジスタREG1及びREG2の内容、つまり反転セクタライトデータWDIS及びセクタリードデータRDSの対応する4バイトの論理積をとり、その処理結果つまり論理積データをレジスタREG3に入力した後、ステップS218により、レジスタREG3の内容つまり論理積データが全ビット論理“0”であるかどうかの判定を行う。
【0084】
この結果、レジスタREG3の内容つまり論理積データのいずれかのビットが論理“1”である場合、中央処理ユニットCPUは、ステップS222により、レジスタREG3の内容つまり論理積データをビット反転してセクタリライトデータWDRSを4バイト分生成した後、ステップS223により、1セクタ分つまり128バイト分の処理が終了したかの判定を行う。そして、まだ1セクタ分に関する処理が終了していない場合、中央処理ユニットCPUは、ステップS214に戻って次の4バイト分に関する処理を繰り返し、1セクタ分に関する処理が終了した場合には、ステップS224により、該セクタに関する書き込み回数が所定値をオーバーしていないか確認した後、ステップS225により、編集された1セクタ分のリライトデータWDRSをフラッシュメモリFROMの指定セクタに書き込む。なお、ステップS224において、書き込み回数が所定値をオーバーした場合、中央処理ユニットCPUは所定のエラー処理を行う。
【0085】
一方、ステップS218で、レジスタREG3の内容つまり論理積データが全ビット論理“0”となった場合、中央処理ユニットCPUは、ステップS219により、レジスタREG4の対応するビットに論理“0”を書き込んだ後、ステップS220により、1セクタ分つまり128バイト分の処理が終了したかの判定を行う。そして、まだ1セクタ分に関する処理が終了していない場合、ステップS214に戻って次の4バイト分に関する処理を繰り返し、1セクタ分に関する処理が終了した場合は、ステップS221により、レジスタREG4の全ビットが論理“0”となったかどうか判定する。
【0086】
なお、レジスタREG4は、その32ビットのそれぞれがセクタライトデータWDS及びセクタリードデータRDSの各4バイトに対応し、中央処理ユニットCPUは、1セクタ分に関する書き込み動作が開始された時点で、予めレジスタREG4の全ビットに論理“1”を書き込む。また、レジスタREG4の各ビットは、上記のように、レジスタREG3の内容、つまり反転セクタライトデータWDIS及びセクタリードデータRDSの対応する4バイトの論理積データの全ビットが論理“0”、すなわちセクタライトデータWDSの対応する4バイトに関する書き込み動作の終了が確認された時点で、それぞれ論理“0”に書き換えられる。このため、ステップS221において、レジスタREG4の全ビットが論理“0”となったことは、128バイトのセクタライトデータWDSに関するすべての書き込みが終了したことを示すものとなる。
【0087】
したがって、ステップS221において、レジスタREG4のいずれかのビットが論理“1”であることを判定した中央処理ユニットCPUは、ステップS224に移行してセクタリライトデータWDRSの書き込みを行うが、レジスタREG4の全ビットが論理“0”となったことを判定した場合、指定セクタへのセクタライトデータWDSの書き込みに関する処理を終結する。
【0088】
このように、本実施例のマイクロコンピュータでは、フラッシュメモリFROMの書き込み動作に関する一連の処理が、主に中央処理ユニットCPUによりソフトウェア的に行われ、一見すると中央処理ユニットCPUに対する処理負担の増大が気になってくる。しかし、フラッシュメモリFROMは、前述のように、中央処理ユニットCPUの動作制御に関わるプログラムを格納するためのものであり、フラッシュメモリFROMの書き換えが行われるということは、中央処理ユニットCPUひいてはこれを含むシステム本来の通常処理が実行不能又は不要な状態にあることを示すものとなる。したがって、中央処理ユニットCPUは、フラッシュメモリFROMの書き換えに関する制御プログラムが例えばスタティック型RAM等に残されていることを条件に、フラッシュメモリFROMの書き換え動作に関する一連の処理に関与することができる。
【0089】
フラッシュメモリFROMの書き込み動作に関する一連の処理が、主に中央処理ユニットCPUによりソフトウェア的に行われることで、フラッシュメモリFROMの書き込み動作に関するハードウェアを削減し、そのレイアウト所要面積ひいてはマイクロコンピュータのチップサイズを縮小して、マイクロコンピュータの低コスト化を図ることができる。また、特にマイクロコンピュータの開発期間等において、フラッシュメモリFROMの書き換えによりその書き込み手順を任意に修正・変更することができ、これによってフラッシュメモリFROMひいてはマイクロコンピュータの開発期間を短縮することが可能となる。
【0090】
図9には、図1のマイクロコンピュータのフラッシュメモリ書き込み時の第2の実施例の基本フロー図が示されている。また、図10には、図9のフラッシュメモリ書き込み時の動作を説明するための一実施例の動作概念図が示され、図11には、図9の基本フローをとる中央処理ユニットの一実施例の処理フロー図が示されている。なお、この実施例は、前記図4〜図8の実施例を基本的に踏襲するものであるため、これと異なる部分についてのみ説明を追加する。
【0091】
図9において、ステップS311によって生成されたライトデータWDは、ステップS312により、ビット反転されて反転ライトデータWDIとなり、この反転ライトデータWDIは、さらにステップS313により、そのままの論理値で書き込み履歴データWDHとなる。言うまでもなく、ステップS313によって生成される当初の書き込み履歴データWDHは、図10の第3段目に例示されるように、反転ライトデータWDIそのものとなる。
【0092】
次に、ステップS314により、フラッシュメモリFROMの指定アドレスから読み出されたリードデータRDは、ステップS315による不条理書き込みの判定を受けた後、ステップS316により、書き込み履歴データWDHとの論理積をとられて、論理積データWDAとなる。この論理積データWDAは、さらにステップS317により、新しい書き込み履歴データWDHとなるが、上記のように、当初の書き込み履歴データWDHは反転ライトデータWDIそのものであり、ループ1回目の論理積データWDAは、図10の第5段目に例示されるように、反転ライトデータWDIそのものとなるため、ステップS317により生成される新しい書き込み履歴データWDHの各ビットも、図10の第6段目に例示されるように、それまでの論理値をそのまま保持したものとなる。
【0093】
ステップS316により生成された論理積データWDAは、ステップS318により、その全ビットが論理“0”となったかどうか、つまり書き込み動作が終了してその書き込み対象となるビットがすべて論理“0”に変わったかどうかの判定を受ける。この結果、論理積データWDAの全ビットが論理“0”に変化した場合、指定アドレスに対する書き込み動作が終了したものとして他の処理に移行する。しかし、まだいずれかのビットが論理“1”のままである場合は、ステップS319により、論理積データWDAをビット反転してリライトデータWDRが生成された後、ステップS320により、指定アドレスに対するリライトデータWDRの書き込みが行われ、ステップS314に処理が戻される。
【0094】
ステップS320による書き込み動作を終えたメモリアレイMARYの指定アドレスでは、図10の第8段目に例示されるように、その第3ビットだけが、書き込み未終了となって論理“1”つまり消去状態のままにあり、ループ2回目のステップS314による読み出し動作では、図10の第9段目に例示されるように、リードデータRDの第3ビットが論理“1”となる。このため、ステップS316により得られる新しい論理積データWDAは、図10の第10段目に例示されるように、その第3ビットのみが論理“1”となり、ステップS317により得られる新しい書き込み履歴データWDHも、図10の第11段目に例示されるように、やはりその第3ビットのみが論理“1”となる。
【0095】
これにより、ループ2回目のステップS319により生成されるリライトデータWDRは、図10の第12段目に例示されるように、その第3ビットのみが論理“0”となり、その他のビットは論理“1”となる。このリライトデータWDRは、ステップS320により再度指定アドレスに書き込まれ、その結果として指定アドレスの第3ビットは、図10の第13段目に例示されるように、論理“0”に変化し、全ビットがライトデータWDと一致した状態となる。
【0096】
ところで、メモリアレイMARYを構成する2層ゲート構造型メモリセルMCのしきい値電圧が揺らぎ領域にある場合、リードデータRDの対応するビットが読み出し動作のたびに論理“0”から“1”あるいは論理“1”から“0”へと変化するケースが生じる。このことは、ステップS318の判定処理に異常をきたし、不本意な書き込み時間の増大や無限ループ発生の原因となる。
【0097】
この実施例の場合、例えば、リードデータRDの第4ビットに対応するメモリセルMCが揺らぎ領域にあり、図10の第14段目に例示されるように、一旦論理“0”となったリードデータRDの第4ビットが、ループ3回目のステップS314で論理“1”に変化し、消去状態に化けている。
【0098】
ところが、前記図4の実施例では、論理積データWDAの生成がリードデータRDと反転ライトデータWDIとをもとに生成されていたが、この実施例では、上記のように、リードデータRDと書き込み履歴データWDHとをもとに生成されるため、ループ3回目のステップS316では、論理積データWDAの第4ビットが論理“0”のままとなり、書き込み終了となる。
【0099】
つまり、この実施例の場合、書き込み履歴データWDHが、当初は反転ライトデータWDIそのものとして生成されるが、ループ2回目以後は、ステップS316による論理積処理の結果をもとに書き換えられ、一旦書き込み状態となったメモリセルMCに対応するビットは論理“0”に変化する。言い換えると、書き込み履歴データWDHの各ビットは、対応するメモリセルMCが書き込みの対象ビットであることを示すとともに、対応するメモリセルMCが一旦論理“0”に書き換えられたことの履歴を示すものであって、この書き込み履歴データWDHとリードデータRDとをもとにリライトデータWDRが生成される限り、一旦書き換えられたメモリセルMCに対する再書き込みは生じない。
【0100】
この結果、書き込み状態のメモリセルMCに対して再書き込みが繰り返される過書き込みにより、メモリセルのしきい値電圧が低くなり過ぎてデプリート障害となり、あるいはメモリセルMCのしきい値電圧のバラツキが大きくなるのを確実に防止することができ、これによってフラッシュメモリFROMひいてはマイクロコンピュータの信頼性を高めることができるものである。
【0101】
なお、この実施例のマイクロコンピュータでは、前記図4の実施例と同様に、実際には128バイトのセクタを単位としてフラッシュメモリFROMの書き込み動作が実行され、指定セクタの書き込み動作に関する上記一連の処理は、主に中央処理ユニットCPUによりソフトウェア的に行われる。このため、中央処理ユニットCPUでは、図11に示される手順に従って具体的な処理が進められ、図9の基本フローに沿った書き込み動作が行われる。
【0102】
すなわち、中央処理ユニットCPUは、まずステップS411により、指定セクタに書き込むべき128バイト単位のセクタライトデータWDSを編集し、次のステップS412及び413により、このセクタライトデータWDSをビット反転して反転セクタライトデータWDIS及び書き込み履歴データWDHSを生成する。また、ステップS414により、指定セクタの保持データRDSをセクタ単位で読み出した後、ステップS415により、セクタリードデータRDS及びセクタライトデータWDSをもとに不条理書き込みの判定を行う。
【0103】
ステップS415の不条理書き込み判定処理を正常に終了した中央処理ユニットCPUは、次のステップS416により、書き込み履歴データWDHSの4バイト分をレジスタREG1に入力し、ステップS417により、セクタリードデータRDSの対応する4バイト分をレジスタREG2に入力する。また、ステップS418により、レジスタREG1及びREG2の内容、つまり書き込み履歴データWDHS及びセクタリードデータRDSの対応する4バイトの論理積をとり、その処理結果つまり論理積データをレジスタREG3に入力するとともに、ステップS419により、新しい書き込み履歴データWDHSとする。さらに、ステップS420により、レジスタREG3が全ビット論理“0”となったかどうかの判定を行い、その結果に応じて、選択的にステップS424〜S427のリライトデータWDRSの生成処理及び書き込み処理を実行する。そして、ステップS423により、レジスタREG4の全ビットの論理“0”を判定して、セクタライトデータWDSに関する書き込み動作を終結する。
【0104】
このように、フラッシュメモリFROMの書き込み動作に関する一連の処理を主に中央処理ユニットCPUによりソフトウェア的に行うことで、フラッシュメモリFROMの書き込み動作に関するハードウェアを削減し、マイクロコンピュータの低コスト化を図ることができるとともに、フラッシュメモリFROMひいてはマイクロコンピュータの開発期間を短縮できるものとなる。
【0105】
図12には、図1のマイクロコンピュータのフラッシュメモリ消去時の一実施例の基本フロー図が示されている。同図をもとに、この実施例のマイクロコンピュータのフラッシュメモリ消去動作の概要とその特徴について説明する。なお、この実施例は、前記図1ないし図8あるいは図9ないし図11の実施例を基本的に踏襲するものであって、以下に説明する各処理ステップは、特に制限されないが、中央処理ユニットCPUによりソフトウェア的に行われる。また、フラッシュメモリFROMの消去動作は、所定数のセクタからなるブロックを指定として選択的に行われ、あるいは全アドレスを対象に一括して行われる。
【0106】
図12において、この実施例のマイクロコンピュータにおけるフラッシュメモリFROMの消去動作は、ステップS511のライトデータWDの生成で開始される。このステップS511では、消去対象となるアドレスのすべてのメモリセルMCに対して論理“0”を書き込むべくライトデータWDが生成される。ステップS511により生成されたライトデータWDは、ステップS512により、フラッシュメモリFROMの指定アドレスにセクタ単位でプレライトされ、ステップS513により消去対象となる全セクタへのプレライトが終了したかどうかの判定が行われる。この結果、全セクタへのプレライトの終了が確認されると、ステップS514及びS515により、例えばブロックを単位とする消去動作が繰り返され、全ブロックの消去が確認されると消去処理が終了する。
【0107】
この実施例において、ステップS512及びS513によるプレライトは、前記図4又は図9の基本フローに従って行われる。したがって、フラッシュメモリFROMのメモリアレイMARYを構成する2層ゲート構造型メモリセルMCに対する書き込み動作は、各メモリセルMCが一回でも書き込み状態となった時点で停止され、プレライト後のメモリセルMCの書き込み状態は、ほぼ平均した状態に揃えられる。このため、ステップS514及びS515による消去動作が、比較的多数のメモリセルMCからなるブロックを単位として行われるにもかかわらず、これらのメモリセルMCを平均した消去状態とすることができる。この結果、特定のメモリセルMCがいわゆる過消去状態となるのを防止して、メモリセルMCの劣化を防止することができ、これによってフラッシュメモリFROMひいてはマイクロコンピュータの信頼性を高めることができる。
【0108】
図13には、この発明が適用されたマイクロコンピュータのフラッシュメモリに含まれるメモリアレイMARY及び周辺部の他の一実施例の部分的な回路図が示されている。なお、この実施例は、前記図9の基本フローを、主にフラッシュメモリの関連回路によりハードウェア的に実現し、その分、マイクロコンピュータの中央処理ユニットの負担を軽減しようとするものであって、図13の回路素子のうち前記図3と同一の符号が付されるものは、概ねそのままそれぞれ対応する。また、この実施例では、図9のステップS315の不条理書き込み判定処理に対応するハードウェアを含まないが、必要に応じてこれを含むことは可能である。以下、図3と異なる部分について説明を追加する。
【0109】
図13において、カラムラッチCLは、特に制限されないが、メモリアレイMARYのビット線B0〜Bnに対応して設けられるn+1個つまり実質1,024個の単位回路を備え、これらの単位回路のそれぞれは、インバータV1及びV2が交差結合されてなるラッチ回路L1と、インバータV4及びV5が交差結合されてなるもう一つのラッチ回路L2と、これらのラッチ回路L1及びL2の出力信号を受ける2入力のアンド(AND)ゲートG1とを含む。また、カラムラッチCLは、すべて単位回路に共通に設けられる実質1,024入力のアンドゲートG2を含み、このアンドゲートG2の各入力端子には、各単位回路のラッチ回路L1の下方の入出力ノードがそれぞれ結合される。言うまでもなく、アンドゲートG2は1個の論理ゲートからなるものではなく、多数の論理ゲートが組み合わされることで実質1,024入力のアンドゲートG2となる。
【0110】
カラムラッチCLの各単位回路のラッチ回路L1の下方の入出力ノードは、スイッチMOSFETN1を介して対応するデータ入出力線D0〜Dnつまりデータ入出力回路IOに結合されるとともに、上記アンドゲートG2の対応する入力端子にそれぞれ結合される。また、その上方の入出力ノードは、アンドゲートG1の右側の入力端子に結合されるとともに、書き込み回路WCの対応する単位回路のインバータV3の入力端子に結合され、さらにNチャンネル型のスイッチMOSFETN4を介して対応するアンドゲートG1の出力端子にそれぞれ結合される。スイッチMOSFETN1のゲートには、図示されないメモリコントローラMCからラッチ制御信号LC1が共通に供給され、スイッチMOSFETN4のゲートには、ラッチ制御信号LC4が共通に供給される。
【0111】
なお、ラッチ制御信号LC1は、通常接地電位VSSのようなロウレベルとされ、フラッシュメモリが書き込みモードで選択状態とされるとき、データ入出力回路IOからYゲート回路YGを介してライトデータが入力される所定のタイミングで、選択的に電源電圧VCCのようなハイレベルとされる。また、ラッチ制御信号LC4は、やはり通常ロウレベルとされ、フラッシュメモリが書き込みモードで選択状態とされるとき、アンドゲートG1によってリードデータと反転書き込みデータ又は書き込み履歴データとの論理積データが生成される所定のタイミング、言い換えるならば図9の基本フローのステップS316終了時に対応するタイミングで選択的にハイレベルとされる。
【0112】
一方、カラムラッチCLの各単位回路のラッチ回路L2の下方の入出力ノードは、Nチャンネル型のスイッチMOSFETN3を介して対応するデータ入出力線D0〜Dnつまりデータ入出力回路IOに結合されるとともに、上記アンドゲートG1の左側の入力端子に結合され、その上方の入出力ノードは、スイッチMOSFETN2を介してセンスアンプSAの対応する単位センスアンプUAの反転出力ノードに結合される。スイッチMOSFETN2のゲートには、メモリコントローラMCからラッチ制御信号LC2が共通に供給され、スイッチMOSFETN3のゲートには、ラッチ制御信号LC3が共通に供給される。
【0113】
なお、ラッチ制御信号LC2は、通常接地電位VSSのようなロウレベルとされ、フラッシュメモリが読み出しモードで選択状態とされるとき、対応する単位センスアンプUAの出力レベルが確定される所定のタイミングで、選択的に電源電圧VCCのようなハイレベルとされる。また、ラッチ制御信号LC3は、やはり通常ロウレベルとされ、フラッシュメモリが読み出しモードで選択状態とされるとき、指定アドレスのリードデータをデータ入出力回路IOに伝達すべき所定のタイミングで選択的にハイレベルとされる。
【0114】
以下、図9の基本フローの各処理ステップに対応付けて、この実施例のフラッシュメモリの書き込み動作を具体的に説明する。
【0115】
まず、図9のステップS311により生成されるライトデータWDは、データ入出力回路IOからYゲート回路YGならびにデータ入出力線D0〜Dnの対応する32ビットを介して32ビット単位でカラムラッチCLに供給される。これらのライトデータWDは、ラッチ制御信号LC1のハイレベルを受けてオン状態となるスイッチMOSFETN1を介して、カラムラッチCLの対応する単位回路のラッチ回路L1に順次取り込まれ、保持される。
【0116】
言うまでもなく、データ入出力線D0〜DnつまりカラムラッチCLの各単位回路のラッチ回路L1の下方の入出力ノードにおけるライトデータWDの各ビットは、書き込み対象となるメモリセルMCに対応するビットが論理“0”つまり接地電位VSSのようなロウレベルとされ、それ以外のビットはすべて論理“1”つまり電源電圧VCCのようなハイレベルとされる。また、ラッチ回路L1に保持されるライトデータWDの各ビットは、インバータV1の出力端子においてそれぞれビット反転され、図9のステップS312後の反転ライトデータWDIとなり、ステップS313後の書き込み履歴データWDHともなる。
【0117】
次に、図9のステップS314によりメモリアレイMARYの指定アドレスから1,024ビットつまり128バイト単位で読み出され、センスアンプSAの対応する単位センスアンプUAの反転出力ノードに論理反転されて確立されるリードデータRDは、ラッチ制御信号LC2のハイレベルを受けてオン状態となるカラムラッチCLのスイッチMOSFETN2を介して、対応するラッチ回路L2に一斉に取り込まれ、そのインバータV5の出力端子において非反転のリードデータRDとなる。これらのリードデータRDは、対応するアンドゲートG1により、ラッチ回路L1に保持されている書き込み履歴データWDHの対応するビットとそれぞれ論理積がとられ、図9のステップS316後の論理積データWDAとなる。そして、ラッチ制御信号LC4のハイレベルを受けてオン状態となるスイッチMOSFETN4を介して、対応するラッチ回路L1に取り込まれ、ステップS317後の新しい書き込み履歴データWDHとなる。
【0118】
ラッチ回路L1に取り込まれた書き込み履歴データWDHつまり論理積データWDAは、各ラッチ回路L1の下方の入出力ノードで反転されてアンドゲートG2の対応する入力端子にそれぞれ供給され、論理積がとられる。このアンドゲートG2は、図9のステップS318の判定処理に対応するするものであって、その出力信号WDA0は、ラッチ回路L1に保持される論理積データWDAのすべてのビットが論理“0”とされるとき選択的にハイレベルとされる。アンドゲートG2の出力信号WDA0は、フラッシュメモリのメモリコントローラMCに供給され、そのハイレベルを受けて書き込み終了が判定される。
【0119】
一方、ラッチ回路L1に取り込まれた書き込み履歴データWDHつまり論理積データWDAは、各ラッチ回路L1の下方の入出力ノードにおいてリライトデータWDRとなる。そして、このリライトデータWDRの対応するビットが論理“0”とされることを条件に、つまりは論理積データWDAの対応するビットが論理“1”すなわちハイレベルであることを条件に、書き込み回路WCの対応する単位回路のMOSFETP1が選択的にオン状態となり、メモリアレイMARYの対応するメモリセルMCに対する書き込みが選択的に行われる。
【0120】
このように、本実施例のマイクロコンピュータでは、フラッシュメモリの書き込み動作に関する一連の処理が、主にフラッシュメモリの関連回路つまりカラムラッチCL,書き込み回路WCならびにセンスアンプSAによりハードウェア的に行われ、中央処理ユニットは、ライトデータWDの生成や32ビット単位のデータ転送以外にほとんど関与しない。このため、例えばフラッシュメモリの書き込みが中央処理ユニットの通常処理の合間をみて、しかも部分的に行われるような場合、比較的少量のハードウェア追加で、かつ比較的高速に、フラッシュメモリ等の部分的な書き換えを行うことができるものとなる。
【0121】
以上の実施例から得られる作用効果は、下記の通りである。すなわち、
(1)シングルチップマイクロコンピュータ等に搭載されるフラッシュメモリ等の不揮発性メモリにおいて、指定アドレスから読み出されるリードデータと、そこに書き込むべきライトデータのビット反転データとの論理積データをもとに、指定アドレスに対する書き込み動作の終了を判定するとともに、同一の論理積データをもとに、書き込みが終了していない指定アドレスに対して再書き込みすべきリライトデータを生成することで、1回の読み出し動作により得られるリードデータをもとに、書き込み動作の終了を判定し、かつリライトデータを生成できるため、特にメモリセルのしきい値電圧が揺らぎ領域にある場合の無限ループを抑制し、フラッシュメモリ等の書き込み所要時間の不本意な増大を抑制できるとともに、その書き込み特性を改善できるという効果が得られる。
【0122】
(2)シングルチップマイクロコンピュータ等に搭載されるフラッシュメモリ等の不揮発性メモリにおいて、指定アドレスに書き込むべきライトデータ、又は書き込みが終了していない指定アドレスに対するリライトデータをビット反転してなる書き込み履歴データと、指定アドレスから読み出されるリードデータとの論理積データをもとに、指定アドレスに対する書き込み動作の終了を判定するとともに、同一の論理積データをもとに、リライトデータを生成することで、一度書き込み状態となったメモリセルが消去状態となった場合でもこのようなメモリセルに対する再書き込みを防止することができるため、特にメモリセルのしきい値電圧が揺らぎ領域にある場合の無限ループをさらに確実に解消して、フラッシュメモリ等の書き込み所要時間の不本意な増大を確実に防止できるとともに、その書き込み特性を改善することができるという効果が得られる。
【0123】
(3)上記(1)項又は(2)項において、フラッシュメモリ等の書き込み動作に関する一連の処理を、プレライト機能を有するフラッシュメモリ等に適用することで、消去対象となるメモリセルのプレライト後のしきい値電圧のバラツキを小さくし、その消去特性を高めることができるという効果が得られる。
【0124】
(4)上記(1)項〜(3)項において、指定アドレスに書き込むべきライトデータと、指定アドレスから読み出されるリードデータのビット反転データとの論理積データをもとに、不条理書き込み判定処理を行うことで、指定アドレスのすでに書き込み済のビットに対する不条理書き込みを防止することができるとともに、デプリートエラーを識別することができ、これによってフラッシュメモリ等の保持データの信頼性を高めることができるという効果が得られる。
【0125】
(5)上記(1)項〜(4)項において、フラッシュメモリ等の書き込み動作に関する一連の処理を、マイクロコンピュータ等に搭載された中央処理ユニットによりソフトウェア的に実現することで、フラッシュメモリ等の書き込みが行われる間は通常処理に使用されることのない中央処理ユニットを活用して、フラッシュメモリのハードウェア量を削減し、マイクロコンピュータ等のチップサイズを縮小して、そのコスト低減を図ることができるという効果が得られる。
【0126】
(6)上記(1)項〜(4)項において、フラッシュメモリ等の書き込み動作に関する一連の処理を、フラッシュメモリ等の関連回路によりハードウェア的に実現することで、比較的少量のハードウェア追加で、かつ比較的高速に、しかも中央処理ユニットが他の処理を行っている間に、フラッシュメモリ等の部分的な書き換えを行うことができるという効果が得られる。
【0127】
(7)上記(1)項〜(6)項により、フラッシュメモリ等ならびにこれを含むシングルチップマイクロコンピュータ等の信頼性を高め、その高速化,低コスト化ならびに処理の効率化を図ることができるという効果が得られる。
【0128】
以上、本発明者によってなされた発明を実施例に基づき具体的に説明したが、この発明は、上記実施例に限定されるものではなく、その要旨を逸脱しない範囲で種々変更可能であることは言うまでもない。例えば、図1において、シングルチップマイクロコンピュータは、必ずしも図示されるすべての機能ブロックを備える必要はないし、他の各種機能ブロックを含むこともできる。シングルチップマイクロコンピュータのブロック構成及びバス構成等は、この実施例による制約を受けることなく種々の実施形態をとりうる。
【0129】
図2において、フラッシュメモリFROMは、例えば×8ビット又は×16ビット等、任意のビット構成を採ることができるし、メモリアレイMARYは、その直接周辺回路を含めて複数のメモリマットに分割することができる。フラッシュメモリFROMの記憶容量は、任意に設定できるし、そのブロック構成についても同様である。図3及び図13において、メモリアレイMARYは、任意数の冗長素子を含むことができるし、そのワード線及びビット線の絶対数も任意に設定できる。書き込み回路WC,センスアンプSAならびにカラムラッチCLの具体的な回路構成,電源電圧の極性及び絶対値,MOSFETの導電型ならびに各制御信号の有効レベル等は、種々の実施形態をとりうる。
【0130】
図4,図6,図8,図9,図11ならびに図12において、フラッシュメモリFROMの書き込み・消去時の具体的な処理フローは、例えばその順序を入れ換え、又は論理値を入れ換える等、種々の形態が考えられよう。
【0131】
以上の説明では、主として本発明者によってなされた発明をその背景となった利用分野であるフラッシュメモリならびにこれを搭載するシングルチップマイクロコンピュータに適用した場合について説明したが、それに限定されるものではなく、例えば、フラッシュメモリと中央処理ユニットがそれぞれ別個の半導体基板面上に形成されるものや、フラッシュメモリとして単体で形成されるもの、あるいは同様な書き込み・消去機能を持つ各種のメモリ集積回路装置、さらにはこれを搭載する各種デジタルシステムにも適用できる。この発明は、少なくとも2層ゲート構造型メモリセルが格子配列されてなるメモリアレイを備える不揮発性メモリならびにこれを含むシステムに広く適用できる。
【0132】
【発明の効果】
本願において開示される発明のうち代表的なものによって得られる効果を簡単に説明すれば、下記の通りである。すなわち、シングルチップマイクロコンピュータ等に搭載されるフラッシュメモリ等の不揮発性メモリにおいて、指定アドレスから読み出されるリードデータと、そこに書き込むべきライトデータのビット反転データとの論理積データをもとに、指定アドレスに対する書き込み動作の終了を判定するとともに、同一の論理積データをもとに、書き込みが終了していない指定アドレスに対して再書き込みすべきリライトデータを生成することで、1回の読み出し動作により得られるリードデータをもとに、書き込み動作の終了を判定し、かつリライトデータを生成することができるため、特にメモリセルのしきい値電圧が揺らぎ領域にある場合の無限ループを抑制し、フラッシュメモリ等の書き込み所要時間の不本意な増大を抑制することができるとともに、フラッシュメモリ等の書き込み特性を改善することができる。
【0133】
シングルチップマイクロコンピュータ等に搭載されるフラッシュメモリ等の不揮発性メモリにおいて、指定アドレスに書き込むべきライトデータ、又は書き込みが終了していない指定アドレスに対するリライトデータをビット反転してなる書き込み履歴データと、指定アドレスから読み出されるリードデータとの論理積データをもとに、書き込み動作の終了を判定するとともに、同一の論理積データをもとに、リライトデータを生成することで、一旦書き込み状態となったメモリセルが再度消去状態となった場合でも、このようなメモリセルに対する再書き込みを防止することができるため、特にメモリセルのしきい値電圧が揺らぎ領域にある場合の無限ループをさらに確実に解消して、フラッシュメモリ等の書き込み所要時間の不本意な増大を確実に防止することができるとともに、フラッシュメモリ等の書き込み特性を改善することができる。
【0134】
上記フラッシュメモリ等の書き込み動作に関する一連の処理を、プレライト機能を有するフラッシュメモリ等ならびにこれを含むマイクロコンピュータ等に適用することで、消去対象となるメモリセルのプレライト後のしきい値電圧のバラツキを抑制し、その消去特性を高めることができる。
【0135】
上記フラッシュメモリ等において、指定アドレスに書き込むべきライトデータと、指定アドレスから読み出されるリードデータのビット反転データとの論理積データをもとに、不条理書き込み判定処理を行うことで、指定アドレスのすでに書き込み済のビットに対する不条理書き込みを防止することができるとともに、デプリートエラーを識別することができ、これによってフラッシュメモリ等の保持データの信頼性を高めることができる。
【0136】
上記フラッシュメモリ等の書き込み動作に関する一連の処理を、マイクロコンピュータ等に搭載された中央処理ユニットによりソフトウェア的に実現することで、フラッシュメモリ等の書き込みが行われる間は通常処理に使用されることのない中央処理ユニットをフラッシュメモリ等の書き換えに活用して、フラッシュメモリ等のハードウェア量を削減し、マイクロコンピュータ等のチップサイズを縮小して、そのコスト低減を図ることができる。
【0137】
上記フラッシュメモリ等の書き込み動作に関する一連の処理を、フラッシュメモリ等の関連回路によりハードウェア的に実現することで、比較的少量のハードウェア追加で、かつ比較的高速に、しかも中央処理ユニットが他の処理を行っている間に、フラッシュメモリ等の部分的な書き換えを行うことができる。
【0138】
以上により、フラッシュメモリ等ならびにこれを含むシングルチップマイクロコンピュータ等の信頼性を高め、その高速化,低コスト化ならびに処理の効率化を図ることができる。
【図面の簡単な説明】
【図1】この発明が適用されたマイクロコンピュータの一実施例を示すブロック図である。
【図2】図1のマイクロコンピュータに含まれるフラッシュメモリの一実施例を示すブロック図である。
【図3】図2のフラッシュメモリFROMに含まれるメモリアレイ及び周辺部の一実施例を示す部分的な回路図である。
【図4】図1のマイクロコンピュータのフラッシュメモリ書き込み時の第1の実施例を示す基本フロー図である。
【図5】図4のフラッシュメモリ書き込み時の動作を説明するための一実施例を示す動作概念図である。
【図6】図4のフラッシュメモリ書き込み時における不条理書き込み判定処理の一実施例を示す基本フロー図である。
【図7】図6の不条理書き込み判定処理時の動作を説明するための一実施例を示す動作概念図である。
【図8】図4の基本フローをとるマイクロコンピュータの中央処理ユニットの一実施例を示す処理フロー図である。
【図9】図1のマイクロコンピュータのフラッシュメモリ書き込み時の第2の実施例を示す基本フロー図である。
【図10】図9のフラッシュメモリ書き込み動作を説明するための一実施例を示す動作概念図である。
【図11】図9の基本フローをとるマイクロコンピュータの中央処理ユニットの一実施例を示す処理フロー図である。
【図12】図1のマイクロコンピュータのフラッシュメモリ消去時の一実施例を示す基本フロー図である。
【図13】この発明が適用されたマイクロコンピュータのフラッシュメモリに含まれるメモリアレイ及び周辺部の他の一実施例を示す部分的な回路図である。
【図14】この発明に先立って本願発明者等が開発したマイクロコンピュータのフラッシュメモリ書き込み時の一例を示す基本フロー図である。
【図15】この発明に先立って本願発明者等が開発したマイクロコンピュータのフラッシ
ュメモリ書き込み時の他の一例を示す基本フロー図である。
【符号の説明】
CPU……中央処理ユニット、CPG……クロック発生回路、IBUS……内部バス、PBUS……周辺バス、FROM……フラッシュメモリ、SRAM……スタティック型RAM(ランダムアクセスメモリ)、DMAC……ダイレクトメモリアクセスコントローラ、BUSC……バスコントローラ、SCI……シリアルコミュニケーションインタフェース、TIM……タイマー回路、D/A……デジタル・アナログ変換回路、A/D……アナログ・デジタル変換回路、IOPA〜IOPK……入出力ポート、XTAL……水晶発振子。
MARY……メモリアレイ、XD……Xアドレスデコーダ、SC……ソース電圧制御回路、WC……書き込み回路、SA……センスアンプ、CL……カラムラッチ、YG……Yゲート回路、YD……Yアドレスデコーダ、CB……コントロールバッファ、MC……メモリコントローラ、AB……アドレスバッファ、DB……データバッファ、IO……データ入出力回路、VG……内部電圧発生回路、VCS……電圧制御信号、VCC……電源電圧、VSS……接地電位。
W0〜Wm……ワード線、B0〜Bn……ビット線、MC……2層ゲート構造型メモリセル、S0〜Sp……ソース線、VPP……内部電圧、UA……単位センスアンプ、D0〜Dn……データ入出力線、WP……書き込み制御信号、RC……読み出し制御信号、LC1〜LC4……ラッチ制御信号。
S111〜S118,S141〜S143,S211〜S225,S311〜S320,S411〜S427,S511〜S515,S611〜S619,S711〜S716……処理ステップ。
WD……ライトデータ、WDI……反転ライトデータ、WDR……リライト(再書き込み)データ、WDH,WDSH……書き込み履歴データ、RD……リードデータ、RDI……反転リードデータ、WDA,RDA……論理積データ、WDS……セクタライトデータ、WDIS……反転セクタライトデータ、WDRS……セクタリライトデータ、RDS……セクタリードデータ、REG1〜REG4……レジスタ。
L1〜L2……ラッチ回路。
P1〜P3……PチャンネルMOSFET、N1〜N4……NチャンネルMOSFET、V1〜V5……インバータ、G1〜G2……アンドゲート。
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a nonvolatile memory and a system, for example, a flash memory having a prewrite function, a single-chip microcomputer including the flash memory, and a technique particularly effective for improving the reliability thereof.
[0002]
[Prior art]
There is a so-called two-layer gate structure type memory cell that has a floating gate and a control gate, and whose threshold voltage is selectively increased or decreased according to the logical value of retained data. In addition, there is a flash memory whose basic component is a memory array in which such two-layer gate structure type memory cells are arranged in a lattice. Such a flash memory and a central processing unit are mounted on the same semiconductor substrate surface. There is a single-chip microcomputer.
[0003]
On the other hand, the data erase operation in the flash memory is performed in units of, for example, a predetermined block. As one means for improving the erase characteristics of the flash memory, all memory cells to be erased are written before the erase operation. It is becoming common to perform so-called pre-lighting.
[0004]
[Problems to be solved by the invention]
Prior to the present invention, the inventors of the present application have developed a single-chip microcomputer equipped with a flash memory, and have found the following problems in the process. That is, in this microcomputer, data processing by the central processing unit is performed in units of 32 bits, for example, and data is written into the flash memory in units of so-called sectors of 128 bytes, for example.
[0005]
In the microcomputer described above, the generation and verification of the write data to the flash memory, that is, the write confirmation process is performed by software by the central processing unit of the microcomputer, and the process is as shown in FIG. First, write data WD is generated in step S611, and then inverted write data WDI obtained by bit-inverting write data WD is generated in step S612. In the write data WD, the bit to be written is a so-called logic “0”, and in the inverted write data, the bit to be written is a so-called logic “1”. Further, in the flash memory, among the two-layer gate structure type memory cells constituting the memory array, the memory cell in the erased state retains data of logic “1”, for example, having a relatively high threshold voltage. It is assumed that the memory cell in the write state has a relatively low threshold voltage and holds data of logic “0”.
[0006]
In the microcomputer, after the retained data RD is read from the address to be written to the flash memory in the next step S613, the logical product data WDA of the inverted write data WDI and the read data RD is obtained in step S614. Calculated. Also, in step S615, rewrite data WDR is generated to invert the logical product data WDA and rewrite to the specified address, and in step S616, the rewrite data WDR is written to the specified address of the flash memory in the memory array. It is.
[0007]
When the series of write operations is completed, the held data RD is read again from the designated address in step S617, and the logical product data WDA of the inverted write data WDI and the read data RD is calculated in step S618, and then the step By S619, it is determined whether or not the logical product data WDA is all the bits “0”. If all the bits are “0”, the write operation is completed. If any of the bits is “1”, the process returns to step S613, and a series of write operations is repeated. As a result, bit-by-bit writing control is performed, and writing is repeated only for memory cells in the erased state. As a result, meaningless writing is repeated for the memory cell in the writing state, and the threshold voltage is prevented from becoming lower than necessary, and the writing / erasing characteristics of the flash memory can be improved.
[0008]
However, in the above flash memory, for example, after 128 bytes of writing operations in steps S613 to S616 are repeated, the determination operations in steps S617 to S619 are repeated, and after a relatively long time, the operations are performed twice in steps S613 and 617. The reading operation of the designated address is performed. For this reason, when a difference occurs in the logical value of the read data RD obtained by these read operations, an unintentional write operation is performed, and the required write time becomes long. In a so-called fluctuation region that fluctuates to logic “1” or “0”, for example, when the read result in step S613 is logic “0” and the read result in step S617 is logic “1”, an infinite loop state occurs and writing The process does not end indefinitely, which reduces the reliability of the flash memory and hence the microcomputer containing it.
[0009]
In order to deal with this, the inventors of the present application, as illustrated in FIG. 15, replaces the write processing in steps S613 to S616 with the write data WD provided in step S713 as a result of reading the designated address. I thought about how to write in a fixed manner regardless of. However, by using this method, the read operation of the designated address is performed once, and the above problem is solved. However, there are, for example, a 32-bit memory cell as a write unit in an erase state and a write state. When they are mixed, meaningless writing is repeated for memory cells that are already in a writing state, so that writing stress on these memory cells increases. In particular, in the flash memory adopting the pre-write method, the threshold voltage becomes lower than necessary due to the erasing process, and the threshold voltages of the memory cells to be erased become uneven. Decreasing to the erasing characteristic.
[0010]
An object of the present invention is to provide an effective data writing method in a flash memory or the like that adopts a prewrite system. Another object of the present invention is to improve the write / erase characteristics of a flash memory or the like mounted on a single chip microcomputer or the like and to enhance its reliability.
[0011]
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.
[0012]
[Means for Solving the Problems]
The outline of a typical invention among the inventions disclosed in the present application will be briefly described as follows. That is, in a nonvolatile memory such as a flash memory mounted on a single chip microcomputer or the like, based on logical product data of read data read from a specified address and bit inverted data of write data to be written to the specified address, The end of the write operation for the specified address is determined, and rewrite data to be rewritten to the specified address that has not been written is generated based on the same logical product data.
[0013]
Alternatively, based on logical product data of write data to be written to a specified address, or write history data obtained by bit-reversing rewrite data for a specified address that has not been written, and read data read from the specified address, The end of the write operation for the specified address is determined, and the rewrite data is generated based on the same logical product data.
[0014]
A series of processing related to the write operation of the flash memory or the like is applied to a flash memory or the like having a prewrite function for aligning information held in all memory cells to be erased before writing data.
[0015]
In the flash memory or the like, based on the logical product data of the write data to be written to the designated address and the bit inverted data of the read data read from the designated address, the absurd writing or dewriting to the already written bits of the designated address is performed. Identify and determine a pleat error.
[0016]
A series of processing relating to the writing operation of the flash memory or the like is realized by software by a central processing unit mounted on a microcomputer or the like.
[0017]
A series of processing related to the writing operation of the flash memory or the like is realized in hardware by a related circuit such as a flash memory.
[0018]
According to the above means, it is possible to determine the end of the write operation and generate rewrite data based on the read data obtained by one read operation, and in particular, the threshold voltage of the memory cell. Can suppress an infinite loop in the fluctuation region, suppress an unintentional increase in the time required for writing to the flash memory or the like, and improve the writing characteristics of the flash memory or the like.
[0019]
In addition, when the end of the write operation is determined based on the logical product data of the write history data and the read data, and the rewrite data is generated, the memory cell once in the write state is erased. However, since rewriting to such a memory cell can be prevented, an infinite loop, particularly when the threshold voltage of the memory cell is in the fluctuation region, is more reliably eliminated, and the time required for writing to the flash memory or the like is reduced. Unintentional increase can be surely prevented, and the writing characteristics of the flash memory or the like can be further improved.
[0020]
By applying a series of processing related to the write operation to a flash memory or the like having a prewrite function, it is possible to suppress the variation in threshold voltage after prewrite of the memory cell to be erased and improve the erase characteristics of the flash memory or the like. Can do.
[0021]
By determining the absurd writing based on the logical product data of the write data and the bit inverted data of the read data, it is possible to identify the absurdity of the write data for the memory cell already in the write state, and the memory to be written The depletion error of the memory cell coupled to the same bit line as the cell can be identified, and the reliability of data held in the flash memory or the like can be improved.
[0022]
A series of processing related to the write operation of the flash memory and the like is realized by software by the central processing unit, so that the central processing unit that is not used for normal processing is used while the flash memory is rewritten. Thus, the hardware amount of the flash memory can be reduced, the chip size of the microcomputer or the like can be reduced, and the cost can be reduced.
[0023]
A series of processing related to the write operation of the flash memory and the like is realized by hardware using a related circuit such as a flash memory, so that a relatively small amount of hardware is added and the central processing unit can be operated at a relatively high speed. During the processing, partial rewriting of the flash memory or the like can be performed.
[0024]
As described above, the reliability of a flash memory and the like and a single chip microcomputer including the same can be improved, and the speed, cost, and efficiency of processing can be improved.
[0025]
DETAILED DESCRIPTION OF THE INVENTION
FIG. 1 is a block diagram showing an embodiment of a single chip microcomputer (system) to which the present invention is applied. Based on this figure, the outline and configuration of a single-chip microcomputer (hereinafter simply referred to as a microcomputer) of this embodiment and its features will be described first. The circuit elements constituting each block in FIG. 1 are not particularly limited, but are known MOSFETs (metal oxide semiconductor field effect transistors. In this specification, MOSFETs are collectively referred to as insulated gate field effect transistors). It is formed on the surface of a single semiconductor substrate such as single crystal silicon by an integrated circuit manufacturing technique.
[0026]
In FIG. 1, the microcomputer of this embodiment comprises a so-called stored program type central processing unit CPU and a clock generation circuit CPG. Among them, the central processing unit CPU is coupled with a flash memory FROM (nonvolatile memory), a static RAM (SRAM), a direct memory access controller DMAC and a bus controller BUSC via an internal bus IBUS, and is connected to the clock generation circuit CPG. Are coupled to a crystal oscillator XTAL having a predetermined natural vibration number via external terminals XTAL and EXTAL. The microcomputer is further supplied with a power supply voltage VCC and a ground potential VSS, which are main operation power supplies, from an external power supply device via external terminals VCC and VSS, respectively, and to the central processing unit CPU via external terminals STBYB and RESB. The standby signal STBYB (here, a so-called inverted signal that is selectively set to the low level when it is enabled is indicated by adding B to the end of its name, and so on) and the reset signal RESB respectively. Supplied. Note that the power supply voltage VCC as the main operating power supply is, for example, +5 V (volts).
[0027]
The central processing unit CPU of the microcomputer performs a step operation according to a control program stored in the flash memory FROM, performs various arithmetic processes, and controls and controls each part of the microcomputer. In this embodiment, the central processing unit CPU performs a series of processes related to rewriting of the flash memory FROM, which will be described in detail later.
[0028]
The clock generation circuit CPG, together with the external crystal oscillator XTAL, forms a clock signal having a predetermined frequency / phase corresponding to its natural frequency and supplies it to each part of the microcomputer. The flash memory FROM has a memory array in which a two-layer gate structure type memory cell having a control gate and a floating gate is arranged in a lattice as its basic component, and a control program and fixed program required for the step operation of the central processing unit CPU. Stores data etc. Needless to say, since the data held in the flash memory FROM can be rewritten, a system having various functions can be realized with the same microcomputer, and the development period for debugging and the like can be shortened. . The specific configuration, operation, write / erase processing procedure and features of the flash memory FROM will be described later in detail.
[0029]
A static RAM (SRAM) enables relatively high-speed access, and temporarily stores calculation results, control data, and the like of the central processing unit CPU. Further, the direct memory access controller DMAC supports data transfer between, for example, a static RAM (SRAM) and an external device without requiring the intervention of a central processing unit CPU. Further, the bus controller BUSC manages bus access to the internal bus IBUS and performs connection processing between the internal bus IBUS and the peripheral bus PBUS, that is, a device coupled thereto.
[0030]
Further connected to the peripheral bus PBUS of the microcomputer are a serial communication interface SCI, a timer circuit TIM, a digital / analog conversion circuit D / A, an analog / digital conversion circuit A / D, and 11 input / output ports IOPA to IOPK. . Among these, the serial communication interface SCI supports serial data transfer according to a predetermined algorithm with an external serial input / output device coupled to a predetermined port among the corresponding input / output ports IOPA to IOOPK. The timer circuit TIM performs time management according to the clock signal supplied from the clock generation circuit CPG.
[0031]
On the other hand, the digital / analog conversion circuit D / A converts digital data generated by the central processing unit CPU or the like into a predetermined analog signal and transmits it to an external input / output device. The analog / digital conversion circuit A / D converts an analog input signal input from, for example, various external sensors into a digital signal of a predetermined bit and transmits it to the central processing unit CPU or the like. Further, the input / output ports IOPIOPA to IOPK function as an interface circuit that exchanges signals between each part of the microcomputer and various devices provided outside.
[0032]
As described above, the flash memory FROM is used for storing control programs, fixed data, and the like, and rewriting thereof is mainly performed by software by the central processing unit CPU. In this embodiment, in particular, prior to the erase operation of the flash memory FROM, prewrite is performed to align all memory cells to be erased in a write state, and at the time of write, read data read from a specified address and The write operation end determination is performed based on the logical product data of the write data and the bit inverted data, and the rewrite data for the designated address that has not been written is generated based on the same logical product data, or The end of the write operation is determined based on the logical product data of the write history data and the read data obtained by bit inversion of the write data or the rewrite data, and the rewrite data of the rewrite data is determined based on the same logical product data. Generation occurs.
[0033]
As a result, the reliability of the flash memory FROM and thus the microcomputer including the flash memory FROM can be improved, and the speed, cost, and efficiency of processing can be improved. These will be described in detail later.
[0034]
FIG. 2 is a block diagram showing an embodiment of a flash memory FROM included in the microcomputer of FIG. FIG. 3 shows a partial circuit diagram of an embodiment of the memory array MARY and its peripheral part included in the flash memory FROM of FIG. Based on these drawings, the specific configuration and operation of the flash memory FROM included in the microcomputer of this embodiment, and its features will be described. FIG. 3 illustrates representative portions of the write circuit WC, the sense amplifier SA, and the column latch CL, but the circuit elements constituting each portion are not all illustrated. In the following circuit diagrams, MOSFETs with an arrow attached to the channel (back gate) portion are P-channel type, and are distinguished from N-channel MOSFETs without an arrow.
[0035]
In FIG. 2, the flash memory FROM according to this embodiment has a memory array MARY, which occupies most of the required layout area, as its basic component. The flash memory FROM has a control buffer CB coupled to the control bus CBUS of the internal bus IBUS, and further generates a memory controller MC that receives the output signal of the control buffer CB, and an internal voltage that receives the power supply voltage VCC and the ground potential VSS. A circuit VG.
[0036]
Among them, the control buffer CB and the memory controller MC selectively form various internal control signals (not shown) on the basis of various activation control signals supplied via the control bus CBUS of the internal bus IBUS. Supply to each part. The internal voltage generation circuit VG includes a plurality of voltage generation circuits that are selectively operated in accordance with a voltage control signal VCS supplied from a control circuit (not shown) of the microcomputer, and writes, erases, and reads the flash memory FROM. Various internal voltages required for operation are generated.
[0037]
On the other hand, the memory array MARY is not particularly limited, but is a so-called NOR type array, and as shown in FIG. 3, m + 1 arranged in parallel to the horizontal direction in the drawing, that is, substantially 1,024. It includes word lines W0 to Wm and n + 1, that is, substantially 1,024 bit lines B0 to Bn arranged in parallel in the vertical direction. At the intersections of these word lines and bit lines, 1,024 × 1,024, that is, 1,048,576 two-layer gate structure type memory cells MC having floating gates and control gates are arranged in a grid. As a result, the flash memory FROM has a so-called 1 megabit storage capacity.
[0038]
The control gates of n + 1 memory cells MC arranged in the same row of memory array MARY are commonly coupled to corresponding word lines W0 to Wm, respectively, and their sources are n + 1 memory cells MC arranged in adjacent rows. Are commonly coupled to the corresponding source lines S0 to Sp. The drains of m + 1 memory cells MC arranged in the same column of memory array MARY are commonly coupled to corresponding bit lines B0 to Bn. Note that the number p + 1 of the source lines S0 to Sp is smaller than the number m + 1 of the word lines W0 to Wm.
p + 1 = (m + 1) / 2
Needless to say, the relationship
[0039]
In this embodiment, each of the two-layer gate structure type memory cells MC constituting the memory array MARY is not particularly limited. However, when it is in an erased state, it is assumed to hold data of so-called logic “1”. When it is in a write state, so-called logic “0” data is held. In the erase operation of the memory cell MC, a positive potential such as + 9V is applied to the control gate, that is, the corresponding word lines W0 to Wm, and the source, that is, the corresponding source lines S0 to Sp, such as −9V. A negative potential is applied and electrons are injected from the source side into the floating gate, and the write operation of the memory cell MC is performed by applying a positive potential such as +6 V to the drain, that is, the corresponding bit lines B0 to Bn. This is performed by applying a negative potential such as −9 V to the control gate, that is, the corresponding word lines W0 to Wm, and extracting electrons accumulated in the floating gate to the drain side.
[0040]
Thereby, the threshold voltage of the memory cell MC is set to a relatively high value exceeding, for example, +2.5 V when it is in the erased state, and is relatively low lower than +2.5 V when it is in the written state. Value. Therefore, during the read operation of the retained data, the corresponding word lines W0 to Wm are alternatively set to a selection level such as +2.5 V, for example, so that the memory cell MC in the erased state is turned off and compared. A relatively small read current is supplied, and the memory cell MC in the write state is turned on to pass a relatively large read current.
[0041]
As shown in FIG. 2, word lines W0 to Wm constituting memory array MARY are coupled to X address decoder XD on the left side, and source lines S0 to Sp are connected to source voltage control circuit SC on the right side. Combined. Although not particularly limited, the X address decoder XD is supplied with 10-bit internal X address signals X0 to X9 from the address buffer AB, and is necessary for selecting or deselecting the word lines W0 to Wm from the internal voltage generation circuit VG. Various internal voltages are supplied. The internal X address signals X0 to X9 are also supplied to the source voltage control circuit SC, and the source voltage control circuit SC further includes various types necessary for selecting or deselecting the source lines S0 to Sp from the internal voltage generation circuit VG. The internal voltage is supplied.
[0042]
The X address decoder XD decodes the internal X address signals X0 to X9 supplied from the address buffer AB when the flash memory FROM is selected, and outputs the corresponding bits of the word lines W0 to Wm of the memory array MARY. A predetermined selection or non-selection level is selectively set. Further, when the flash memory FROM is selected, the source voltage control circuit SC similarly decodes the internal X address signals X0 to X9 and selectively selects the corresponding bits of the source lines S0 to Sp of the memory array MARY. A predetermined selection or non-selection level is set.
[0043]
Although not particularly limited, when the flash memory FROM is set to the write mode, the selection level of the word lines W0 to Wm is, for example, −9V as described above, and the non-selection level is, for example, the power supply voltage VCC, for example, + 5V. Is done. When the flash memory FROM is set to the erase mode, the selection level of the word lines W0 to Wm is, for example, + 9V as described above, and the non-selection level is, for example, the ground potential VSS. Furthermore, when the flash memory FROM is set to the read mode, the selection level of the word lines W0 to Wm is, for example, +2.5 V as described above, and the non-selection level is the ground potential VSS.
[0044]
Note that the write mode of the flash memory FROM includes a read operation for verifying the write state, that is, a verify operation. The selection level of the word lines W0 to Wm during the verify operation is the selection level during the normal read operation. For example, + 4V, which is slightly higher than + 2.5V.
[0045]
On the other hand, when the flash memory FROM is set to the write mode, the source lines S0 to Sp in the selected state are in a so-called open state, and the non-selected level is set to the ground potential VSS. When the flash memory FROM is set to the erase mode, the selection level of the source lines S0 to Sp is set to -9V, for example, and the non-selection level is set to the ground potential VSS. When the flash memory FROM is set to the read mode, all the source lines S0 to Sp are set to the ground potential VSS.
[0046]
Next, the bit lines B0 to Bn constituting the memory array MARY are coupled to the corresponding unit circuits of the write circuit WC and the sense amplifier SA below. Each unit circuit of the write circuit WC and the sense amplifier SA is coupled to the corresponding unit circuit of the column latch CL on the other side, and 32 unit circuits on the other side are connected via the Y gate circuit YG. Each is selectively connected to a corresponding unit circuit of the data input / output circuit IO. Each unit circuit of data input / output circuit IO is coupled to a corresponding unit circuit of data buffer DB on the other side, and this data buffer DB is coupled to a corresponding bit on data bus DBUS of internal bus IBUS on the other side. The
[0047]
The Y gate circuit YG is supplied with q + 1 bits, that is, substantially 128-bit bit line selection signals YS0 to YSq from the Y address decoder YD, and the Y address decoder YD receives the 7-bit internal Y address signals Y0 to Y0 from the address buffer AB. Y6 is supplied. The address buffer AB is supplied with 17-bit address signals A0 to A16 via the address bus ABUS of the internal bus IBUS.
[0048]
The address buffer AB takes in and holds the address signals A0 to A16 supplied via the address bus ABUS of the internal bus IBUS. Then, 10 bits are supplied to the X address decoder XD and the source voltage control circuit SC as internal X address signals X0 to X9, and the remaining 7 bits are supplied to the Y address decoder YD as internal Y address signals Y0 to Y6. To do.
[0049]
The Y address decoder YD decodes the internal Y address signals Y0 to Y6 supplied from the address buffer AB, and alternatively selects the corresponding bits of the bit line selection signals YS0 to YSq for the Y gate circuit YG to a predetermined selection level. And
[0050]
The Y gate circuit YG includes n + 1, that is, 1,024 switch MOSFETs provided corresponding to each unit circuit of the column latch CL. These switch MOSFETs are selectively turned on 32 by selectively turning the corresponding bits of the bit line selection signals YS0 to YSq supplied from the Y address decoder YD to the high level, and the column latch CL A connection state is established between one input / output node of each unit circuit and a corresponding unit circuit of the data input / output circuit IO.
[0051]
On the other hand, the data buffer DB and the data input / output circuit IO sequentially fetch 32-bit write data supplied via the data bus DBUS of the internal bus IBUS when the flash memory FROM is selected in the write mode, and Y The data is transmitted to 32 designated unit circuits of the column latch CL via the gate circuit YG. The write data taken into each unit circuit of the column latch CL is 1,024 pieces of 1,024 bits coupled to the selected word line of the memory array MARY via the write circuit WC when 128 bytes, that is, 1,024 bits are accumulated. Data are simultaneously written to the memory cells MC. When the flash memory FROM is set to the read mode, the data bus DBUS and the data input / output circuit IO output the read data output from the selected memory cell MC of the memory array MARY and held in each unit circuit of the column latch CL. The data is selectively extracted 32 bits at a time and output to the access device via the data bus DBUS of the internal bus IBUS.
[0052]
As described above, the data input / output operation for the flash memory FROM of this embodiment is performed in units of 32 bits, that is, 4 bytes, but the substantial write and read operations for the memory array MARY are 128 bytes, that is, 1,024. This is done in units of bits. Therefore, word lines W0 to Wm of memory array MARY are alternatively designated according to 10-bit internal X address signals X0 to X9, and bit lines B0 to Bn are 7-bit internal Y address signals Y0 to Y6. As a result, 32 bits are selectively designated.
[0053]
Here, the column latch CL includes n + 1, that is, substantially 1,024 unit circuits provided corresponding to the bit lines B0 to Bn of the memory array MARY, and each of these unit circuits is not particularly limited. As illustrated in FIG. 3, it includes a latch circuit L1 in which a pair of inverters V1 and V2 are cross-coupled, and two N-channel type switch MOSFETs N1 and N2. Among these, the input / output node below the latch circuit L1 of each unit circuit of the column latch CL is coupled to the corresponding data input / output lines D0 to Dn, that is, the data input / output circuit IO via the switch MOSFET N1. The input / output node above it is coupled to the input terminal of the corresponding inverter V3 of the write circuit WC, which will be described later, and coupled to the inverting output node of the corresponding unit sense amplifier UA of the sense amplifier SA via the switch MOSFET N2. Is done. A latch control signal LC1 is commonly supplied from the memory controller MC to the gate of the switch MOSFET N1, and a latch control signal LC2 is commonly supplied to the gate of the switch MOSFET N2.
[0054]
The latch control signal LC1 is normally set to a low level such as the ground potential VSS, and is selectively set to a high level such as the power supply voltage VCC at a predetermined timing when the flash memory FROM is selected in the write mode. The The latch control signal LC2 is normally set to a low level such as the ground potential VSS, and is selectively set to a high level such as the power supply voltage VCC at a predetermined timing when the flash memory FROM is selected in the read mode. The
[0055]
As described above, when the flash memory FROM is selected in the write mode, the column latch CL receives the data bus DBUS, the data buffer DB, the data input / output circuit IO, the Y gate circuit YG of the internal bus IBUS from the access device. Write data is supplied in units of 32 bits via the data input / output lines D0 to Dn. These write data are sequentially fetched and held in the 32 latch circuits L1 corresponding to the column latch CL via the switch MOSFET N2 which is turned on in response to the high level of the latch control signal LC1. Then, at the time when the capture of 128 bytes of write data is completed, the data is transmitted to the memory array MARY via the write circuit WC and is simultaneously transmitted to n + 1, that is, substantially 1,024 memory cells MC coupled to the selected word line. Is written to.
[0056]
On the other hand, when the flash memory FROM is selected in the read mode, the column latch CL receives the inverted output signal of the unit sense amplifier UA, that is, the inverted read data, from 1,024 unit circuits of the sense amplifier SA described later. Supplied. These inverted read data are simultaneously fetched and held in the latch circuit L1 of each unit circuit of the column latch CL via the switch MOSFET N2 that is turned on in response to the high level of the latch control signal LC2. Then, it is inverted by the inverter V2 of the corresponding latch circuit L1 to become non-inverted read data, and from the data input / output lines D0 to Dn, the Y gate circuit YG, the data input / output circuit IO, the data buffer DB and the data bus of the internal bus IBUS. The data is output to the access device in units of 32 bits via DBUS.
[0057]
Next, the write circuit WC includes n + 1, that is, 1,024 unit circuits provided corresponding to the bit lines B0 to Bn of the memory array MARY, and each of these unit circuits is not particularly limited. 3 includes two P-channel MOSFETs P1 and P2, and an inverter V3 that uses a relatively high internal voltage VPP such as + 6V as an operation power supply. The source of MOSFET P1 constituting each unit circuit of write circuit WC is coupled to internal voltage supply point VPP, and its drain is coupled to corresponding bit lines B0 to Bn of memory array MARY via MOSFET P2. Further, the gate of MOSFET P1 is coupled to the output terminal of the corresponding inverter V3, and the input terminal of inverter V3 is coupled to the output terminal of inverter V1 constituting the corresponding latch circuit L1 of column latch CL. A write control signal WP is commonly supplied from the memory controller MC to the gate of the MOSFET P2 of each unit circuit of the write circuit WC.
[0058]
The write control signal WP is normally set to a high level such as the internal voltage VPP, and is selectively set to a low level such as the ground potential VSS at a predetermined timing when the flash memory FROM is selected in the write mode. The
[0059]
Thereby, when the flash memory FROM is selected in the write mode, the MOSFETs P2 constituting each unit circuit of the write circuit WC are selectively turned on in response to the low level of the write control signal WP. At this time, the MOSFET P1 of each unit circuit is held by the corresponding latch circuit L1 of the column latch CL, in other words, on condition that the output signal of the corresponding inverter V3 is at a low level such as the ground potential VSS. When the write data is set to logic “0” and the output signal of the inverter V1 is set to the high level, it is selectively turned on, and the corresponding bit lines B0 to Bn of the memory array MARY are set to the internal voltage VPP, that is, + 6V. A high selection level.
[0060]
Needless to say, when the write data held by the corresponding latch circuit L1 of the column latch CL is logic "1" and the output signal of the corresponding inverter V1 is low level, the output signal of the inverter V3 is the internal voltage VPP. It becomes such a high level. For this reason, the MOSFET P1 of each unit circuit of the write circuit WC is turned off, and the corresponding bit lines B0 to Bn of the memory array MARY are set to a non-selection level such as the ground potential VSS through a path not shown.
[0061]
When the flash memory FROM is selected in the write mode, the word lines W0 to Wm of the memory array MARY are alternatively set to a selection level such as −9V as described above, and the source lines S0 to Sp are Opened. At this time, in n + 1 memory cells MC coupled to the selected word line of the memory array MARY, writing is selectively performed on condition that the corresponding bit lines B0 to Bn are set to a selection level such as + 6V. Electrons accumulated in the floating gate are selectively extracted to the drain side, and the threshold voltage is lowered.
[0062]
Next, the sense amplifier SA includes n + 1, that is, substantially 1,024 unit circuits provided corresponding to the bit lines B0 to Bn of the memory array MARY. Each of these unit circuits is not particularly limited. As shown in FIG. 3, it includes one unit sense amplifier UA and a P-channel type switch MOSFET P3. The input node of the unit sense amplifier UA constituting each unit circuit is coupled to the corresponding bit lines B0 to Bn of the memory array MARY via the switch MOSFET P3, and the inverted output node thereof is connected via the N channel MOSFET N2 of the column latch CL. Are coupled to the input / output node above the corresponding latch circuit L1. A read control signal RC is commonly supplied from the memory controller MC to the gates of the MOSFETs P3 constituting each unit circuit of the sense amplifier SA.
[0063]
The read control signal RC is set to a high level such as the normal power supply voltage VCC, and is selectively set to a low level such as the ground potential VSS at a predetermined timing when the flash memory FROM is selected in the read mode. The
[0064]
When the flash memory FROM is selected in the read mode, the word lines W0 to Wm of the memory array MARY are alternatively set to a selection level such as +2.5 V as described above, and the source lines S0 to Sp. Are all at a low level like the ground potential VSS. In addition, the bit lines B0 to Bn of the memory array MARY are precharged simultaneously to a high level such as the power supply voltage VCC by a precharge circuit (not shown) of the sense amplifier SA at the beginning of the read operation. The precharge levels of these bit lines B0 to Bn are selective on condition that the memory cells MC arranged at the corresponding intersections with the selected word line are in the write state and their threshold voltages are relatively low. It is pulled out and falls.
[0065]
The selective lowering of the bit lines B0 to Bn is sensed and amplified by the unit sense amplifier UA of the corresponding unit circuit of the sense amplifier SA, and in response to this, the inverted read data at the inverted output node of the unit sense amplifier UA is selected. High level. These inverted read data are received by the corresponding latch circuit L1 of the column latch CL in response to the high level of the latch control signal LC2, are inverted to become non-inverted read data, and are selectively output bit by bit.
[0066]
By the way, the two-layer gate structure type memory cells MC constituting the memory array MARY exhibit a relatively large variation in the write / erase characteristics. Therefore, the above-described 128-byte unit write and block-unit erase operations are performed as write operations. Or, while confirming the change in the data held in the memory cell MC after the erase operation, that is, the memory cell MC that has been in the erased state of logic “1” changes to the write state of logic “0”, or the write of logic “0” The process is repeated while confirming whether the memory cell MC in the state has changed to the erased state of logic “1”. In addition, in the flash memory FROM of this embodiment, a prewrite system is adopted in which all memory cells MC to be erased are aligned in a write state prior to the erase operation. In this embodiment, the control necessary for the write / erase operation of the flash memory FROM is mainly performed by software by the central processing unit CPU as described above, and has several features. Will be described in detail.
[0067]
FIG. 4 shows a basic flow diagram of the first embodiment of the microcomputer of FIG. 1 when writing to the flash memory, and FIG. 5 shows an embodiment for explaining the operation when writing the flash memory of FIG. An example operation conceptual diagram is shown. FIG. 6 shows a basic flow diagram of an embodiment of the absurd write determination process at the time of writing to the flash memory in FIG. 4, and FIG. 7 illustrates the operation at the absurd write determination process in FIG. The operation | movement conceptual diagram of one Example is shown. Further, FIG. 8 shows a processing flow chart of an embodiment of the central processing unit of the microcomputer taking the basic flow of FIG. Based on these drawings, the specific operation and characteristics of the microcomputer of this embodiment when writing to the flash memory will be described. In the microcomputer of this embodiment, as described above, data processing is performed in units of 32 bits, that is, 4 bytes. However, in the following operation conceptual diagram, only 8 bits, that is, 1 byte is exemplified.
[0068]
In FIG. 4, the write operation in the flash memory FROM of this embodiment starts from the generation process of the write data WD in step S111. As described above, when the two-layer gate structure type memory cell MC constituting the memory array MARY of the flash memory FROM is in the erased state, as shown in the uppermost part of FIG. It is supposed to hold data. Further, as described above, the substantial write operation in the flash memory FROM is carried out in units of substantially 1,024 bits, that is, in units of 128 bytes, but the write data WD is generated in units of 32 bits, and of these, it becomes a write target. As illustrated in the second row of FIG. 5, data of logic “0” is selectively assigned to the bits. Needless to say, logic “1” data is assigned to bits that are not to be written at the specified address, that is, bits that are to remain in the erased state, and write data WD has logic “1” and “0”. There are many cases where data is mixed.
[0069]
The write data WD generated in step S111 is logically inverted for each bit in step S112 to generate bit inverted data, that is, inverted write data WDI. In the inverted write data WDI, as illustrated in the third row of FIG. 5, the bit to be written to the designated address is set to logic “1”, and the bit not to be written to is set to logic “0”. .
[0070]
When the generation of the write data WD and the inverted write data WDI is completed, first, the retained data RD at the designated address is read out in step S113, and then the absurd writing determination process is performed in step S114. As described above, each bit of the read data RD read from the designated address is set to logic “1” when the corresponding memory cell MC is still in the erased state, and is set to logic “0” when the corresponding memory cell MC is already in the written state. . Therefore, all the bits of the read data RD obtained by the first read after erasure are set to logic “1” as illustrated in the fourth row of FIG. The necessity and effect of the absurd writing determination process in step S114 will be described later in detail.
[0071]
If no abnormality is detected by the absurdity determination process in step S114 and the determination result is yes, in step S115, a logical product is taken for each bit of the inverted write data WDI and the read data RD, and logical product data WDA is generated. . Needless to say, each bit of the logical product data WDA is selectively set to logic “1” on condition that the corresponding bits of the inverted write data WDI and the read data RD are both logic “1”. Logic “0” is set. Therefore, the logical product data WDA generated based on the first read data RD after erasure and the inverted write data WDI has each bit set to the inverted write data WDI as illustrated in the fifth row of FIG. Have the same logical value as the corresponding bit.
[0072]
In the logical product data WDA generated in step S115, whether all the bits have become logic “0” in step S116, that is, whether all the bits to be written have changed to logic “0” after the write operation is completed. Get a judgment of whether. As a result, when all the bits of the logical product data WDA change to logic “0”, the write operation for the designated address is completed, and the process proceeds to another process, and any one of the bits remains logic “1”. If there is, in step S117, the logical product data WDA is bit-inverted, and rewrite data WDR to be rewritten to the specified address is generated. The rewrite data WDR is written to the designated address in step S118, and thereafter, the process returns to step S113 to form a processing loop. Note that the rewrite data WDR generated based on the first read data RD and the logical product data WDA after erasure is the write data WD itself as illustrated in the sixth row of FIG.
[0073]
At the designated address of the memory array MARY for which the write operation in step S118 has been completed, the logical values of the first to second bits and the fourth to eighth bits are rewritten as illustrated in the seventh row of FIG. Although the logic value is changed according to the corresponding bit of the data WDR, the threshold voltage of the corresponding memory cell MC is not sufficiently lowered, and the third bit remains at the logic “1”, that is, the erased state. is there. Therefore, in the read operation in step S113 in the second loop, as illustrated in the eighth stage of FIG. 5, the third bit of the read data RD is also “1”, and the new logical product data obtained in step S115. As illustrated in the ninth row of FIG. 5, only the third bit of the WDA is logic “1”.
[0074]
As a result, the rewrite data WDR generated in step S117 of the second loop is, as exemplified in the 10th stage of FIG. 5, only the third bit is logic “0”, and the other bits are logic “0”. 1 ". The rewrite data WDR is written again to the designated address in step S118. As a result, the third bit of the designated address changes to logic “0” as illustrated in the eleventh stage of FIG. All bits coincide with the write data WD.
[0075]
The retained data at the specified address is read as read data RD in step S113 in the third loop, and then logically ANDed with the inverted write data WDI in step S115 to become logical product data WDA. As is clear from the above description, the logical product data WDA generated by the step S115 in the third loop is that all bits are logical “0” as illustrated in the 13th stage of FIG. The condition of step S116 is satisfied, and the writing is completed.
[0076]
As described above, in the microcomputer of this embodiment, the read data RD read from the designated address of the flash memory FROM in step S113 is used to generate the logical product data WDA with the inverted write data WDI in step S115. The logical product data WDA is used for determining the end of the write operation in step S116 and also used for generating the rewrite data WDR in step S117. In other words, in this embodiment, the end of the write operation is determined based on the read data RD obtained by one read operation in step S113 and the logical product data WDA with the inverted write data WDI, and the rewrite data is determined. In particular, even if the threshold voltage of the memory cell is in the fluctuation region and there is a bit whose logical value changes every time a read operation is performed, the occurrence of rewrite accompanying this is suppressed. In addition, the occurrence of an infinite loop due to the repetition of this can be suppressed.
[0077]
As a result, it is possible to prevent the time required for writing to the flash memory FROM from unintentionally increasing, and to improve the writing characteristics, and to improve the reliability of the flash memory FROM and thus the microcomputer in which the flash memory FROM is mounted. And efficiency of processing can be achieved.
[0078]
By the way, in the absurd writing determination process performed as step S114 in FIG. 4, although not particularly limited, first, as shown in the dotted frame in FIG. 6, the read data RD is bit-inverted and the bit inversion is performed in step S141. After the data, that is, the inverted read data RDI is generated, the logical product of the write data WD and the inverted read data RDI is obtained in step S142 to generate the logical product data RDA. The logical product data RDA is determined in step S143 as to whether or not all bits are logic “0”. If all the bits are logic “0”, it is determined that there is no abnormality and the process proceeds to step S115 and subsequent steps. To do. However, if any bit of the logical product data RDA is logical “1” in step S143, it is regarded that an abnormality has occurred, the write operation is interrupted, and the process proceeds to error processing.
[0079]
That is, each bit of the logical product data RDA obtained as a result of the processing in step S142 has the corresponding bit of the designated address already in the written state and the corresponding bit of the read data RD is logical “0”. When the corresponding bit of the write data WD is logic “1” corresponding to the erased state, that is, when absurd writing is designated, the logic “1” is selectively set. Although no absurd writing has been specified, as shown in FIG. 7, for example, in step S113 in the third loop, the read result of the second bit of the specified address is arranged in the same column, that is, in the same bit line. Even when the bit is changed to logic "0" due to the influence of other bits in the combined depletion error state, it is selectively set to logic "1".
[0080]
From the above, in the microcomputer and the flash memory FROM of this embodiment, prior to the writing of the specified address, the absurdity of the write data WD is identified, the writing operation is interrupted, and the normality of the retained data is ensured. In addition, even after the write operation to the designated address is started, it is possible to detect a depletion error of another memory cell arranged in the same column as the designated memory cell. The reliability of the microcomputer equipped with can be further increased.
[0081]
In the microcomputer of this embodiment, as described above, the flash memory FROM is actually written in units of 128-byte sectors, and the above-described series of processing relating to the designated sector write operation is performed mainly. The central processing unit CPU performs the processing in software. For this reason, the central processing unit CPU proceeds with specific processing according to the procedure illustrated in FIG. 8, and performs a writing operation along the basic flow of FIG.
[0082]
That is, the central processing unit CPU first edits the 128-byte sector write data WDS to be written to the designated address, that is, the designated sector in step S211, and inverts and reverses the sector write data WDS in the next step S212. Sector write data WDIS is generated. In step S213, the holding data RDS of the designated sector is read out in units of sectors, and in step S214, absurd writing is determined based on the sector read data RDS and the sector write data WDS. The generation of the sector write data WDS and the inverted sector write data WDIS, the reading of the sector read data RDS, and the absurd write determination processing in steps S211 to S214 are actually 32 bits, which is the arithmetic processing unit of the central processing unit CPU. Although it is repeated 32 times in units of 4 bytes, it is shown in a simplified manner.
[0083]
The central processing unit CPU, which has successfully completed the absurd write determination process in step S214, next inputs 4B, that is, 4 bytes of the inverted sector write data WDIS to the register REG1 in step S215, and then reads the sector read data in step S216. The corresponding 4 bytes of RDS are input to the register REG2. In step S217, the contents of the registers REG1 and REG2, that is, the corresponding 4-byte logical product of the inverted sector write data WDIS and the sector read data RDS are obtained, and the processing result, that is, the logical product data is input to the register REG3. In step S218, it is determined whether or not the contents of the register REG3, that is, the logical product data, is all-bit logic “0”.
[0084]
As a result, when the contents of the register REG3, that is, any bit of the logical product data is logical “1”, the central processing unit CPU performs the sector rewrite by inverting the content of the register REG3, that is, the logical product data in step S222. After generating 4 bytes of data WDRS, it is determined in step S223 whether processing for 1 sector, that is, 128 bytes has been completed. If the processing for one sector has not been completed yet, the central processing unit CPU returns to step S214 to repeat the processing for the next four bytes, and if the processing for one sector has been completed, step S224 is performed. Thus, after confirming whether the number of times of writing related to the sector has exceeded the predetermined value, the edited rewrite data WDRS for one sector is written to the designated sector of the flash memory FROM in step S225. In step S224, when the write count exceeds a predetermined value, the central processing unit CPU performs a predetermined error process.
[0085]
On the other hand, when the content of the register REG3, that is, the logical product data becomes all-bit logic “0” in step S218, the central processing unit CPU writes logic “0” to the corresponding bit of the register REG4 in step S219. Thereafter, in step S220, it is determined whether the processing for one sector, that is, 128 bytes has been completed. If the processing for one sector has not been completed yet, the process returns to step S214 to repeat the processing for the next four bytes. If the processing for one sector has been completed, all bits of the register REG4 are obtained in step S221. Is determined to be logic “0”.
[0086]
The register REG4 has 32 bits each corresponding to 4 bytes of the sector write data WDS and the sector read data RDS, and the central processing unit CPU registers the register in advance when the write operation for one sector is started. Write logic “1” to all bits of REG4. Further, as described above, each bit of the register REG4 includes the contents of the register REG3, that is, all the bits of 4-byte AND data corresponding to the inverted sector write data WDIS and the sector read data RDS are logical “0”, that is, the sector When the end of the write operation for the corresponding 4 bytes of the write data WDS is confirmed, each is rewritten to logic “0”. Therefore, in step S221, all the bits of the register REG4 becoming logic “0” indicates that all writing relating to the 128-byte sector write data WDS has been completed.
[0087]
Accordingly, in step S221, the central processing unit CPU that determines that any bit of the register REG4 is logic “1” moves to step S224 and writes the sector rewrite data WDRS. When it is determined that the bit is logic “0”, the process related to writing the sector write data WDS to the designated sector is terminated.
[0088]
As described above, in the microcomputer according to the present embodiment, a series of processes related to the writing operation of the flash memory FROM is performed mainly by software by the central processing unit CPU. At first glance, an increase in processing load on the central processing unit CPU is noticed. It becomes. However, as described above, the flash memory FROM is for storing a program related to the operation control of the central processing unit CPU, and the fact that the flash memory FROM is rewritten means that the central processing unit CPU and this are rewritten. This indicates that the normal processing inherent to the system including the system is in an inexecutable or unnecessary state. Therefore, the central processing unit CPU can be involved in a series of processes relating to the rewriting operation of the flash memory FROM, on the condition that the control program relating to the rewriting of the flash memory FROM remains in, for example, the static RAM.
[0089]
A series of processing relating to the writing operation of the flash memory FROM is mainly performed by software by the central processing unit CPU, so that the hardware relating to the writing operation of the flash memory FROM is reduced, and the required layout area and the chip size of the microcomputer are reduced. To reduce the cost of the microcomputer. In particular, during the development period of the microcomputer, the writing procedure can be arbitrarily modified and changed by rewriting the flash memory FROM, and thus the development period of the flash memory FROM and thus the microcomputer can be shortened. .
[0090]
FIG. 9 shows a basic flowchart of the second embodiment at the time of writing to the flash memory of the microcomputer of FIG. FIG. 10 shows an operation conceptual diagram of an embodiment for explaining the operation at the time of flash memory writing in FIG. 9, and FIG. 11 shows an embodiment of the central processing unit taking the basic flow of FIG. An example process flow diagram is shown. Since this embodiment basically follows the embodiment shown in FIGS. 4 to 8, only the portions different from this will be described.
[0091]
In FIG. 9, the write data WD generated at step S311 is bit-inverted to become inverted write data WDI at step S312, and this inverted write data WDI is further written with the same logical value at step S313 as write history data WDH. It becomes. Needless to say, the initial write history data WDH generated in step S313 is the inverted write data WDI itself as illustrated in the third row of FIG.
[0092]
Next, the read data RD read from the designated address of the flash memory FROM in step S314 is subjected to the logical product with the write history data WDH in step S316 after receiving the absurd write determination in step S315. The logical product data WDA. The logical product data WDA becomes new write history data WDH in step S317. As described above, the initial write history data WDH is the inverted write data WDI itself, and the first logical product data WDA is As illustrated in the fifth row in FIG. 10, the inverted write data WDI itself is used, and therefore each bit of the new write history data WDH generated in step S317 is also illustrated in the sixth row in FIG. Thus, the logical value up to that point is retained as it is.
[0093]
The logical product data WDA generated in step S316 is determined in step S318 whether all the bits have become logic “0”, that is, all the bits to be written are changed to logic “0” after the write operation is completed. Received a determination of whether or not As a result, when all the bits of the logical product data WDA have changed to logic “0”, it is determined that the write operation for the designated address has been completed, and the process proceeds to another process. However, if any of the bits is still logic “1”, the rewrite data WDR is generated by inverting the logical product data WDA in step S319, and then the rewrite data for the designated address is generated in step S320. WDR writing is performed, and the process returns to step S314.
[0094]
At the specified address of the memory array MARY for which the write operation in step S320 has been completed, as illustrated in the eighth row of FIG. 10, only the third bit has not been written, and the logical “1”, that is, the erase state In the second read operation in step S314 in the loop, the third bit of the read data RD becomes logic “1” as illustrated in the ninth row of FIG. For this reason, the new logical product data WDA obtained in step S316 is, as exemplified in the 10th stage of FIG. 10, only the third bit becomes logic “1”, and the new write history data obtained in step S317. As illustrated in the eleventh stage of FIG. 10, only the third bit of the WDH is also a logic “1”.
[0095]
As a result, the rewrite data WDR generated in step S319 in the second loop is, as illustrated in the twelfth stage of FIG. 10, only the third bit is logic “0”, and the other bits are logic “0”. 1 ". The rewrite data WDR is written to the designated address again in step S320, and as a result, the third bit of the designated address changes to logic “0” as illustrated in the 13th stage of FIG. The bit matches the write data WD.
[0096]
By the way, when the threshold voltage of the two-layer gate structure type memory cell MC constituting the memory array MARY is in the fluctuation region, the corresponding bit of the read data RD is changed from logic “0” to “1” every time a read operation is performed. There is a case where the logic changes from “1” to “0”. This causes an abnormality in the determination process in step S318, which causes an undesired increase in write time and occurrence of an infinite loop.
[0097]
In the case of this embodiment, for example, the memory cell MC corresponding to the fourth bit of the read data RD is in the fluctuation region, and as shown in the 14th stage of FIG. The fourth bit of the data RD is changed to logic “1” in the third step S314 of the loop, and is in an erased state.
[0098]
However, in the embodiment of FIG. 4, the logical product data WDA is generated based on the read data RD and the inverted write data WDI. However, in this embodiment, as described above, the read data RD and Since it is generated on the basis of the write history data WDH, the fourth bit of the logical product data WDA remains logical “0” in step S316 of the third loop, and the writing is completed.
[0099]
That is, in the case of this embodiment, the write history data WDH is initially generated as the inverted write data WDI itself, but after the second loop, the write history data WDH is rewritten based on the result of the logical product processing in step S316, and once written. The bit corresponding to the memory cell MC in the state changes to logic “0”. In other words, each bit of the write history data WDH indicates that the corresponding memory cell MC is a write target bit, and also indicates a history that the corresponding memory cell MC has been once rewritten to logic “0”. As long as the rewrite data WDR is generated based on the write history data WDH and the read data RD, rewriting to the memory cell MC once rewritten does not occur.
[0100]
As a result, due to overwriting in which rewriting is repeated with respect to the memory cell MC in the written state, the threshold voltage of the memory cell becomes too low, causing a depletion failure, or the variation in the threshold voltage of the memory cell MC is large. Thus, the reliability of the flash memory FROM and thus the microcomputer can be improved.
[0101]
In the microcomputer of this embodiment, as in the embodiment of FIG. 4, the flash memory FROM write operation is actually executed in units of 128-byte sectors, and the above-described series of processing relating to the write operation of the designated sector. Is mainly performed by software by the central processing unit CPU. For this reason, the central processing unit CPU proceeds with specific processing according to the procedure shown in FIG. 11, and performs the write operation along the basic flow of FIG.
[0102]
That is, the central processing unit CPU first edits the 128-byte sector write data WDS to be written in the designated sector in step S411, and in the next steps S412 and 413, the sector write data WDS is bit-inverted to invert the sector. Write data WDIS and write history data WDHS are generated. In step S414, after holding data RDS of the designated sector is read out in units of sectors, in step S415, absurd writing is determined based on sector read data RDS and sector write data WDS.
[0103]
The central processing unit CPU that has successfully completed the absurd write determination process in step S415 inputs 4 bytes of the write history data WDHS to the register REG1 in the next step S416, and corresponds to the sector read data RDS in step S417. 4 bytes are input to the register REG2. In step S418, the contents of the registers REG1 and REG2, that is, the corresponding 4-byte logical product of the write history data WDHS and the sector read data RDS are obtained, and the processing result, that is, the logical product data is input to the register REG3. By S419, new write history data WDHS is set. Further, in step S420, it is determined whether or not the register REG3 becomes all bit logic “0”, and the generation processing and the writing processing of the rewrite data WDRS in steps S424 to S427 are selectively executed according to the result. . In step S423, the logic “0” of all bits of the register REG4 is determined, and the write operation relating to the sector write data WDS is terminated.
[0104]
In this way, a series of processing relating to the writing operation of the flash memory FROM is performed mainly by software by the central processing unit CPU, thereby reducing the hardware relating to the writing operation of the flash memory FROM and reducing the cost of the microcomputer. In addition, the development period of the flash memory FROM and thus the microcomputer can be shortened.
[0105]
FIG. 12 shows a basic flow chart of an embodiment at the time of erasing the flash memory of the microcomputer of FIG. The outline of flash memory erasing operation of the microcomputer of this embodiment and its features will be described with reference to FIG. This embodiment basically follows the embodiment shown in FIG. 1 to FIG. 8 or FIG. 9 to FIG. 11, and each processing step described below is not particularly limited. Performed by the CPU in software. The erase operation of the flash memory FROM is selectively performed by designating a block composed of a predetermined number of sectors, or is performed collectively for all addresses.
[0106]
In FIG. 12, the erase operation of the flash memory FROM in the microcomputer of this embodiment is started by the generation of the write data WD in step S511. In step S511, write data WD is generated to write logic “0” to all the memory cells MC at the address to be erased. The write data WD generated in step S511 is prewritten to the designated address of the flash memory FROM in a sector unit in step S512, and it is determined in step S513 whether prewrite to all the sectors to be erased has been completed. Done. As a result, when it is confirmed that pre-writing to all sectors is completed, the erasing operation is repeated in units of blocks, for example, in steps S514 and S515, and when erasing of all the blocks is confirmed, the erasing process is completed.
[0107]
In this embodiment, the pre-lighting in steps S512 and S513 is performed according to the basic flow of FIG. 4 or FIG. Therefore, the write operation to the two-layer gate structure type memory cell MC constituting the memory array MARY of the flash memory FROM is stopped when each memory cell MC is in a write state even once, and the memory cell MC after the prewrite is performed. The write state of is substantially equal to the average state. For this reason, even though the erase operation in steps S514 and S515 is performed in units of a block composed of a relatively large number of memory cells MC, these memory cells MC can be averaged. As a result, it is possible to prevent a specific memory cell MC from entering an over-erased state, thereby preventing the deterioration of the memory cell MC, thereby improving the reliability of the flash memory FROM and thus the microcomputer.
[0108]
FIG. 13 shows a partial circuit diagram of another embodiment of the memory array MARY and its peripheral part included in the flash memory of the microcomputer to which the present invention is applied. In this embodiment, the basic flow of FIG. 9 is realized by hardware mainly by related circuits of the flash memory, and the load on the central processing unit of the microcomputer is reduced accordingly. The circuit elements in FIG. 13 denoted by the same reference numerals as those in FIG. Further, in this embodiment, hardware corresponding to the absurd write determination process in step S315 of FIG. 9 is not included, but it is possible to include this as necessary. In the following, description will be added regarding parts different from FIG.
[0109]
In FIG. 13, the column latch CL is not particularly limited, but includes n + 1, that is, substantially 1,024 unit circuits provided corresponding to the bit lines B0 to Bn of the memory array MARY. A latch circuit L1 in which inverters V1 and V2 are cross-coupled, another latch circuit L2 in which inverters V4 and V5 are cross-coupled, and a two-input AND circuit that receives the output signals of these latch circuits L1 and L2. (AND) gate G1. The column latch CL includes an AND gate G2 having a substantially 1,024 input provided in common to the unit circuits, and each input terminal of the AND gate G2 has an input / output below the latch circuit L1 of each unit circuit. Each node is joined. Needless to say, the AND gate G2 is not composed of a single logic gate, but becomes a AND gate G2 having substantially 1,024 inputs by combining a large number of logic gates.
[0110]
The input / output node below the latch circuit L1 of each unit circuit of the column latch CL is coupled to the corresponding data input / output lines D0 to Dn, that is, the data input / output circuit IO via the switch MOSFET N1, and the AND gate G2 Each is coupled to a corresponding input terminal. The upper input / output node is coupled to the input terminal on the right side of the AND gate G1 and is coupled to the input terminal of the inverter V3 of the corresponding unit circuit of the write circuit WC, and further includes an N-channel switch MOSFET N4. To the corresponding output terminal of the AND gate G1. The latch control signal LC1 is commonly supplied from the memory controller MC (not shown) to the gate of the switch MOSFET N1, and the latch control signal LC4 is commonly supplied to the gate of the switch MOSFET N4.
[0111]
The latch control signal LC1 is normally at a low level such as the ground potential VSS, and when the flash memory is selected in the write mode, write data is input from the data input / output circuit IO via the Y gate circuit YG. At a predetermined timing, the power supply voltage VCC is selectively set to a high level. The latch control signal LC4 is also normally at a low level, and when the flash memory is selected in the write mode, AND data of the read data and the inverted write data or the write history data is generated by the AND gate G1. At a predetermined timing, in other words, at a timing corresponding to the end of step S316 in the basic flow of FIG.
[0112]
On the other hand, the input / output node below the latch circuit L2 of each unit circuit of the column latch CL is coupled to the corresponding data input / output lines D0 to Dn, that is, the data input / output circuit IO via the N-channel type switch MOSFET N3. The input terminal on the left side of the AND gate G1 is coupled to the inverted output node of the corresponding unit sense amplifier UA of the sense amplifier SA via the switch MOSFET N2. The latch control signal LC2 is commonly supplied from the memory controller MC to the gate of the switch MOSFET N2, and the latch control signal LC3 is commonly supplied to the gate of the switch MOSFET N3.
[0113]
Note that the latch control signal LC2 is normally at a low level such as the ground potential VSS, and when the flash memory is selected in the read mode, the output level of the corresponding unit sense amplifier UA is determined at a predetermined timing. It is selectively set to a high level like the power supply voltage VCC. The latch control signal LC3 is also normally at a low level, and when the flash memory is selected in the read mode, the latch control signal LC3 is selectively high at a predetermined timing at which the read data at the specified address should be transmitted to the data input / output circuit IO. Level.
[0114]
The write operation of the flash memory of this embodiment will be specifically described below in association with each processing step in the basic flow of FIG.
[0115]
First, the write data WD generated in step S311 of FIG. 9 is transferred from the data input / output circuit IO to the column latch CL in units of 32 bits via the corresponding 32 bits of the Y gate circuit YG and the data input / output lines D0 to Dn. Supplied. These write data WD are sequentially fetched and held in the latch circuit L1 of the corresponding unit circuit of the column latch CL via the switch MOSFET N1 that is turned on in response to the high level of the latch control signal LC1.
[0116]
Needless to say, each bit of the write data WD at the input / output node below the data input / output lines D0 to Dn, that is, the latch circuit L1 of each unit circuit of the column latch CL, is a bit corresponding to the memory cell MC to be written. “0”, that is, a low level such as the ground potential VSS, and all other bits are set to a logic “1”, that is, a high level such as the power supply voltage VCC. Each bit of the write data WD held in the latch circuit L1 is bit-inverted at the output terminal of the inverter V1, and becomes the inverted write data WDI after step S312 in FIG. 9, and also the write history data WDH after step S313. Become.
[0117]
Next, in step S314 in FIG. 9, 1,024 bits, that is, 128 bytes are read from the designated address of the memory array MARY, and logically inverted and established at the inverted output node of the corresponding unit sense amplifier UA of the sense amplifier SA. The read data RD to be received is simultaneously taken into the corresponding latch circuit L2 via the switch MOSFET N2 of the column latch CL which is turned on in response to the high level of the latch control signal LC2, and non-inverted at the output terminal of the inverter V5 Read data RD. These read data RD are logically ANDed with the corresponding bits of the write history data WDH held in the latch circuit L1 by the corresponding AND gate G1, and the logical product data WDA after step S316 in FIG. Become. Then, it is taken into the corresponding latch circuit L1 via the switch MOSFET N4 that is turned on in response to the high level of the latch control signal LC4, and becomes new write history data WDH after step S317.
[0118]
The write history data WDH, that is, the logical product data WDA taken into the latch circuit L1, is inverted at the input / output node below each latch circuit L1 and supplied to the corresponding input terminal of the AND gate G2, respectively, and the logical product is taken. . The AND gate G2 corresponds to the determination processing in step S318 in FIG. 9, and the output signal WDA0 is that all bits of the logical product data WDA held in the latch circuit L1 are logical "0". When it is done, it is selectively made high. The output signal WDA0 of the AND gate G2 is supplied to the memory controller MC of the flash memory, and the end of writing is determined by receiving the high level.
[0119]
On the other hand, the write history data WDH fetched by the latch circuit L1, that is, the logical product data WDA, becomes the rewrite data WDR at the input / output node below each latch circuit L1. Then, on condition that the corresponding bit of the rewrite data WDR is set to logic “0”, that is, on the condition that the corresponding bit of the logical product data WDA is logic “1”, that is, high level, the write circuit The MOSFET P1 of the corresponding unit circuit of WC is selectively turned on, and writing to the corresponding memory cell MC of the memory array MARY is selectively performed.
[0120]
As described above, in the microcomputer according to the present embodiment, a series of processes related to the write operation of the flash memory is mainly performed by hardware by the related circuit of the flash memory, that is, the column latch CL, the write circuit WC, and the sense amplifier SA. The central processing unit is hardly involved other than generation of write data WD and data transfer in units of 32 bits. For this reason, for example, when writing to the flash memory is performed partially in the interval of normal processing of the central processing unit, a relatively small amount of hardware is added and the flash memory or the like is relatively fast. Rewriting can be performed.
[0121]
The effects obtained from the above embodiments are as follows. That is,
(1) In a nonvolatile memory such as a flash memory mounted on a single chip microcomputer or the like, based on logical product data of read data read from a specified address and bit inverted data of write data to be written there, One read operation by determining the end of the write operation for the specified address and generating rewrite data to be rewritten to the specified address that has not been written based on the same logical product data The end of the write operation can be determined and the rewrite data can be generated based on the read data obtained by the above, so that an infinite loop is suppressed especially when the threshold voltage of the memory cell is in the fluctuation region, and the flash memory, etc. Can suppress unintentional increase in the time required for writing Effect that can improve characteristics.
[0122]
(2) Write history data obtained by bit-inverting write data to be written to a specified address or rewrite data for a specified address that has not been written in a non-volatile memory such as a flash memory mounted on a single chip microcomputer or the like. By determining the end of the write operation for the specified address based on the logical product data with the read data read from the specified address, and generating rewrite data based on the same logical product data, Even when a memory cell that has been written into is in an erased state, rewriting to such a memory cell can be prevented, so that an infinite loop especially when the threshold voltage of the memory cell is in the fluctuation region is further increased. Reliable cancellation and writing to flash memory etc. With an involuntary increase in main time can be reliably prevented, there is an advantage that it is possible to improve the writing characteristic.
[0123]
(3) In the above item (1) or (2), by applying a series of processes relating to a write operation of a flash memory or the like to a flash memory or the like having a prewrite function, prewriting of a memory cell to be erased There is an effect that the variation in the threshold voltage later can be reduced and the erasing characteristics can be improved.
[0124]
(4) In the above items (1) to (3), the absurd write determination processing is performed based on the logical product data of the write data to be written to the designated address and the bit inverted data of the read data read from the designated address. By doing so, it is possible to prevent the absurd writing to the already written bits of the specified address, and to identify the depletion error, thereby improving the reliability of the retained data such as the flash memory. An effect is obtained.
[0125]
(5) In the above items (1) to (4), a series of processing relating to the writing operation of the flash memory or the like is realized by software by a central processing unit mounted on the microcomputer or the like, so that the flash memory or the like Utilizing a central processing unit that is not used for normal processing while writing is in progress, reduce the amount of flash memory hardware, reduce the size of microcomputers and other chips, and reduce their costs The effect of being able to be obtained.
[0126]
(6) In the above items (1) to (4), a series of processing related to the write operation of the flash memory or the like is realized in hardware by a related circuit such as the flash memory, thereby adding a relatively small amount of hardware. In addition, there is an effect that the flash memory or the like can be partially rewritten at a relatively high speed and while the central processing unit is performing other processing.
[0127]
(7) According to the above items (1) to (6), the reliability of the flash memory and the single-chip microcomputer including the same can be improved, and the speed, cost, and efficiency of processing can be improved. The effect is obtained.
[0128]
As mentioned above, the invention made by the present inventor has been specifically described based on the embodiments. However, the present invention is not limited to the above-described embodiments, and various modifications can be made without departing from the scope of the invention. Needless to say. For example, in FIG. 1, the single-chip microcomputer does not necessarily include all the functional blocks shown in the figure, and can include other various functional blocks. The block configuration and bus configuration of the single-chip microcomputer can take various embodiments without being restricted by this embodiment.
[0129]
In FIG. 2, the flash memory FROM can take an arbitrary bit configuration such as x8 bits or x16 bits, and the memory array MARY is divided into a plurality of memory mats including its direct peripheral circuits. Can do. The storage capacity of the flash memory FROM can be arbitrarily set, and the same applies to the block configuration. 3 and 13, the memory array MARY can include an arbitrary number of redundant elements, and the absolute numbers of the word lines and bit lines can be arbitrarily set. The specific circuit configuration of the write circuit WC, the sense amplifier SA, and the column latch CL, the polarity and absolute value of the power supply voltage, the conductivity type of the MOSFET, the effective level of each control signal, and the like can take various embodiments.
[0130]
4, 6, 8, 9, 11, and 12, the specific processing flow at the time of writing / erasing the flash memory FROM can be changed in various ways such as changing the order or changing the logical value. A form may be considered.
[0131]
In the above description, the case where the invention made mainly by the present inventor is applied to the flash memory, which is a field of use as a background, and the single-chip microcomputer on which the flash memory is mounted has been described. However, the present invention is not limited thereto. For example, a flash memory and a central processing unit formed on separate semiconductor substrate surfaces, a single flash memory, or various memory integrated circuit devices having similar write / erase functions, Furthermore, it can be applied to various digital systems equipped with this. The present invention can be widely applied to a nonvolatile memory having a memory array in which at least two-layer gate structure type memory cells are arranged in a grid and a system including the nonvolatile memory.
[0132]
【The invention's effect】
The effects obtained by the representative ones of the inventions disclosed in the present application will be briefly described as follows. In other words, in a non-volatile memory such as a flash memory mounted on a single-chip microcomputer, etc., specified based on the logical product data of the read data read from the specified address and the bit inverted data of the write data to be written there By determining the end of the write operation for the address and generating rewrite data to be rewritten to the designated address where the write has not been completed based on the same logical product data, Based on the obtained read data, the end of the write operation can be determined and rewrite data can be generated, so that infinite loops are suppressed especially when the threshold voltage of the memory cell is in the fluctuation region, and flash Suppressing unintentional increases in the time required for writing to memory, etc. Rutotomoni, it is possible to improve the writing characteristic such as a flash memory.
[0133]
In non-volatile memory such as flash memory mounted on a single-chip microcomputer, etc., write data to be written to a specified address, or write history data obtained by bit-reversing rewrite data for a specified address that has not been written, and specified Memory that has been written once by determining the end of the write operation based on logical product data with read data read from the address and generating rewrite data based on the same logical product data Even when the cell is in the erased state again, such rewriting to the memory cell can be prevented, so that the infinite loop can be more reliably eliminated especially when the threshold voltage of the memory cell is in the fluctuation region. Unnecessarily increase the time required for writing to flash memory, etc. It is possible to reliably prevent, it is possible to improve the writing characteristic such as a flash memory.
[0134]
By applying a series of processing related to the write operation of the flash memory to a flash memory having a prewrite function and a microcomputer including the same, the threshold voltage after prewrite of the memory cell to be erased is reduced. The variation can be suppressed and the erasing characteristics can be enhanced.
[0135]
In the above flash memory or the like, the specified address is already written by performing an absurd write determination process based on the logical product data of the write data to be written to the specified address and the bit inverted data of the read data read from the specified address. It is possible to prevent an absurd writing to a completed bit and to identify a depletion error, thereby improving the reliability of data held in a flash memory or the like.
[0136]
A series of processing related to the writing operation of the flash memory or the like is realized by software by a central processing unit mounted on a microcomputer or the like so that it can be used for normal processing while writing to the flash memory or the like is performed. It is possible to reduce the cost by reducing the amount of hardware such as a flash memory and reducing the chip size of a microcomputer or the like by utilizing a non-central processing unit for rewriting a flash memory or the like.
[0137]
A series of processing related to the write operation of the flash memory and the like is realized by hardware using a related circuit such as a flash memory, so that a relatively small amount of hardware is added and the central processing unit can be operated at a relatively high speed. During the processing, partial rewriting of the flash memory or the like can be performed.
[0138]
As described above, the reliability of a flash memory and the like and a single chip microcomputer including the same can be improved, and the speed, cost, and efficiency of processing can be improved.
[Brief description of the drawings]
FIG. 1 is a block diagram showing an embodiment of a microcomputer to which the present invention is applied.
2 is a block diagram showing an embodiment of a flash memory included in the microcomputer of FIG. 1. FIG.
3 is a partial circuit diagram showing one embodiment of a memory array and a peripheral portion included in the flash memory FROM of FIG. 2; FIG.
4 is a basic flow diagram showing a first embodiment of the microcomputer of FIG. 1 when writing to a flash memory. FIG.
5 is an operation concept diagram showing one embodiment for explaining the operation at the time of writing to the flash memory of FIG. 4; FIG.
6 is a basic flowchart showing an embodiment of absurd write determination processing at the time of writing to the flash memory of FIG. 4; FIG.
7 is an operation conceptual diagram showing an embodiment for explaining the operation during the absurd write determination processing of FIG. 6; FIG.
8 is a process flow diagram showing an embodiment of a central processing unit of a microcomputer taking the basic flow of FIG.
FIG. 9 is a basic flowchart showing a second embodiment of the microcomputer of FIG. 1 when writing to the flash memory.
10 is an operation concept diagram showing one embodiment for explaining the flash memory writing operation of FIG. 9; FIG.
11 is a process flow diagram showing an embodiment of a central processing unit of a microcomputer taking the basic flow of FIG. 9;
12 is a basic flow diagram showing an embodiment of the microcomputer of FIG. 1 when erasing flash memory. FIG.
FIG. 13 is a partial circuit diagram showing another embodiment of a memory array and its peripheral part included in a flash memory of a microcomputer to which the present invention is applied;
FIG. 14 is a basic flowchart showing an example of writing to flash memory by a microcomputer developed by the inventors of the present application prior to the present invention.
FIG. 15 is a flash of a microcomputer developed by the present inventors prior to the present invention.
It is a basic flowchart which shows another example at the time of write-in memory.
[Explanation of symbols]
CPU ... Central processing unit, CPG ... Clock generation circuit, IBUS ... Internal bus, PBUS ... Peripheral bus, FROM ... Flash memory, SRAM ... Static RAM (Random access memory), DMAC ... Direct memory access Controller, BUSC ... Bus controller, SCI ... Serial communication interface, TIM ... Timer circuit, D / A ... Digital / analog conversion circuit, A / D ... Analog / digital conversion circuit, IOPA-IOPK ... Input / output Port, XTAL: Crystal oscillator.
MARY ... Memory array, XD ... X address decoder, SC ... Source voltage control circuit, WC ... Write circuit, SA ... Sense amplifier, CL ... Column latch, YG ... Y gate circuit, YD ... Y Address decoder, CB ... Control buffer, MC ... Memory controller, AB ... Address buffer, DB ... Data buffer, IO ... Data input / output circuit, VG ... Internal voltage generation circuit, VCS ... Voltage control signal, VCC: power supply voltage, VSS: ground potential.
W0 to Wm... Word line, B0 to Bn... Bit line, MC... Two-layer gate structure type memory cell, S0 to Sp... Source line, VPP ... internal voltage, UA. Dn: Data input / output line, WP: Write control signal, RC: Read control signal, LC1 to LC4: Latch control signal.
S111 to S118, S141 to S143, S211 to S225, S311 to S320, S411 to S427, S511 to S515, S611 to S619, S711 to S716 ... processing steps.
WD: Write data, WDI: Inverted write data, WDR: Rewrite (rewrite) data, WDH, WDSH ... Write history data, RD: Read data, RDI: Inverted read data, WDA, RDA ... Logical product data, WDS: Sector write data, WDIS: Inverted sector write data, WDRS: Sector rewrite data, RDS: Sector read data, REG1 to REG4: Registers.
L1 to L2... Latch circuit.
P1 to P3... P channel MOSFET, N1 to N4... N channel MOSFET, V1 to V5... Inverter, G1 to G2.

Claims (4)

中央処理装置と、2層ゲート構造型メモリセルが格子配列されてなるメモリアレイを有する不揮発性メモリとを同一半導体基板上に有するマイクロコンピュータであって、
上記不揮発性メモリは、上記中央処理装置が実行する所定のデータの書き込み動作において、
上記中央処理装置によって示される上記メモリアレイの指定アドレスに書き込むべきライトデータの反転信号を第1データとして形成し、上記指定アドレスから読み出されたリードデータと上記第1データとを論理積処理して第2データを生成し、上記第2データの反転信号を第3データとして形成して上記メモリアレイの上記指定アドレスに対応したビット線に設けられたラッチ回路に記憶させる第1動作を上記メモリアレイの書き込み単位に対応した複数の指定アドレスについて複数回行う第2動作と、
上記メモリアレイにおいて、上記ラッチ回路に記憶された上記第3データを上記メモリアレイのメモリセルに一斉に書き込む第3動作と、
上記第1ないし第3動作が上記各指定アドレスに対応した上記書き込み単位に対応した第2データが同じビット状態に一致するまで繰り返し行われることを特徴とするマイクロコンピュータ
A microcomputer having a central processing unit and a non-volatile memory having a memory array in which two-layer gate structure type memory cells are arranged in a lattice on the same semiconductor substrate,
The non-volatile memory is a predetermined data write operation executed by the central processing unit.
An inverted signal of write data to be written to the designated address of the memory array indicated by the central processing unit is formed as first data, and the read data read from the designated address and the first data are subjected to a logical product process. Generating a second data, forming an inverted signal of the second data as third data, and storing the first data in a latch circuit provided in a bit line corresponding to the designated address of the memory array. A second operation performed a plurality of times for a plurality of designated addresses corresponding to the write unit of the array;
A third operation of simultaneously writing the third data stored in the latch circuit to the memory cells of the memory array in the memory array;
The microcomputer in which the first to third operations are repeatedly performed until the second data corresponding to the write unit corresponding to each designated address matches the same bit state .
請求項において、
上記不揮発性メモリは、データの消去に先立ち、消去対象となるすべてのメモリセルの保持情報を書き込み状態に揃えるべくプレライトするものであって、
上記不揮発性メモリの上記第1ないし第3動作からなる書き込み動作に関する一連の処理は、上記ライトデータの全ビットをメモリセルの上記消去状態を書き込み状態にすべきデータとして、上記プレライト時においても行われるものであることを特徴とするマイクロコンピュータ。
In claim 1 ,
Prior to erasing data, the non-volatile memory pre-writes the information held in all memory cells to be erased so as to be in a written state,
A series of processing related to the write operation including the first to third operations of the nonvolatile memory uses all the bits of the write data as data that should make the erase state of the memory cell the write state , even during the pre-write. A microcomputer characterized by being performed .
請求項1又は請求項2において、
上記第1動作又は第2動作の後にメモリアレイの指定アドレスに書き込むべきライトデータと、上記メモリアレイの指定アドレスから読み出されたリードデータを反転して形成された第4データとの論理積処理した全ビットが一致したときに上記第3動作に移行し、1ビットでも不一致のものが存在することを持ってエラー判定する第4動作を更に行うことを特徴とするマイクロコンピュータ。
In claim 1 or claim 2 ,
And the write data to be written to the specified address in the memory array after said first operation or second operation, logical and fourth data formed by inverting the read data read from the specified address of the memory array Riseki processing all the bits that are shifted to the third operation when there is a match, the microcomputer characterized that you further performs a fourth operation error is also determined with the presence of stated mismatch in 1 bit.
請求項3において、
上記中央処理装置が実行する所定のデータの書き込み動作は、上記不揮発性メモリ上に格納された上記第1動作ないし第4動作を含む書込制御プログラムに従ってソフトウェア的に行われるものであることを特徴とするマイクロコンピュータ。
In claim 3 ,
The predetermined data write operation executed by the central processing unit is performed by software in accordance with a write control program including the first to fourth operations stored in the nonvolatile memory. A microcomputer.
JP25701498A 1998-09-10 1998-09-10 Nonvolatile memory and system Expired - Fee Related JP3838401B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP25701498A JP3838401B2 (en) 1998-09-10 1998-09-10 Nonvolatile memory and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP25701498A JP3838401B2 (en) 1998-09-10 1998-09-10 Nonvolatile memory and system

Publications (2)

Publication Number Publication Date
JP2000090678A JP2000090678A (en) 2000-03-31
JP3838401B2 true JP3838401B2 (en) 2006-10-25

Family

ID=17300542

Family Applications (1)

Application Number Title Priority Date Filing Date
JP25701498A Expired - Fee Related JP3838401B2 (en) 1998-09-10 1998-09-10 Nonvolatile memory and system

Country Status (1)

Country Link
JP (1) JP3838401B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7224619B2 (en) * 2005-09-09 2007-05-29 Macronix International Co., Ltd. Method and apparatus for protection from over-erasing nonvolatile memory cells
JP4611878B2 (en) * 2005-12-01 2011-01-12 ルネサスエレクトロニクス株式会社 Semiconductor device
KR100827702B1 (en) 2006-11-01 2008-05-07 삼성전자주식회사 Resistive semiconductor memory device
WO2011102126A1 (en) * 2010-02-22 2011-08-25 パナソニック株式会社 Non-volatile semiconductor memory device and electronic device
KR101731033B1 (en) 2010-07-09 2017-04-28 에스케이하이닉스 주식회사 Semiconductor memory device and method of operating the same

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH043396A (en) * 1990-04-20 1992-01-08 Mitsubishi Electric Corp Ic card
JPH06187791A (en) * 1992-12-15 1994-07-08 Mitsubishi Electric Corp Semiconductor memory
JPH06349286A (en) * 1993-06-04 1994-12-22 Matsushita Electric Ind Co Ltd Writing controller and control method for flash memory
JPH1064288A (en) * 1996-08-23 1998-03-06 Nec Ic Microcomput Syst Ltd Flash erasure type non-volatile memory and its erasing method

Also Published As

Publication number Publication date
JP2000090678A (en) 2000-03-31

Similar Documents

Publication Publication Date Title
JP6012876B2 (en) Semiconductor device that masks and outputs data stored in twin cells
US7440337B2 (en) Nonvolatile semiconductor memory apparatus having buffer memory for storing a program and buffering work data
JP3976839B2 (en) Nonvolatile memory system and nonvolatile semiconductor memory
JP3373632B2 (en) Nonvolatile semiconductor memory device
JPS63310215A (en) Programmable logic circuit
JP6097398B2 (en) Semiconductor device
JP3838401B2 (en) Nonvolatile memory and system
JP2000090675A (en) Non-volatile semiconductor memory and semiconductor integrated circuit having built-in non-volatile semiconductor memory
US20030095438A1 (en) Nonvolatile semiconductor memory device having function of determining good sector
JPH113594A (en) Non-volatile memory, data writing and read method
JP6035422B2 (en) Semiconductor device
JP3193810B2 (en) Nonvolatile semiconductor memory device and test method therefor
JP2801879B2 (en) Common source line driving circuit for nonvolatile semiconductor memory
JPH09204783A (en) Semiconductor nonvolatile memory
JP3268732B2 (en) Non-volatile semiconductor memory
KR100313555B1 (en) Nonvolatile semiconductor memory device having test circuit for testing erasing function thereof
JP3071435B2 (en) Multi-bit match circuit
JP2984045B2 (en) Semiconductor storage device
US5327395A (en) Page-mode type memory writing control circuit using end-of-page address
JPH09213092A (en) Semiconductor integrated circuit device
JPH0426996A (en) Nonvolatile semiconductor memory circuit
JP2007250175A (en) Nonvolatile memory system
JP2000173275A (en) Nonvolatile memory and memory system
JPH07169288A (en) Batch erasing type non-volatile memory
JP2659227B2 (en) MOS nonvolatile semiconductor memory device

Legal Events

Date Code Title Description
A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A711

Effective date: 20040310

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20040310

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060202

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060217

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060418

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20060726

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20060726

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090811

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100811

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110811

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110811

Year of fee payment: 5

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110811

Year of fee payment: 5

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120811

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120811

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130811

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees