JPH11110304A - Microcomputer - Google Patents

Microcomputer

Info

Publication number
JPH11110304A
JPH11110304A JP9267194A JP26719497A JPH11110304A JP H11110304 A JPH11110304 A JP H11110304A JP 9267194 A JP9267194 A JP 9267194A JP 26719497 A JP26719497 A JP 26719497A JP H11110304 A JPH11110304 A JP H11110304A
Authority
JP
Japan
Prior art keywords
data
area
flag
control unit
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP9267194A
Other languages
Japanese (ja)
Inventor
Kazumasa Chiaki
一雅 千明
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.)
Sanyo Electric Co Ltd
Original Assignee
Sanyo Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sanyo Electric Co Ltd filed Critical Sanyo Electric Co Ltd
Priority to JP9267194A priority Critical patent/JPH11110304A/en
Publication of JPH11110304A publication Critical patent/JPH11110304A/en
Pending legal-status Critical Current

Links

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

PROBLEM TO BE SOLVED: To improve the life of write/deletion characteristics of nonvolatile memory for a microcomputer. SOLUTION: A controlling part 2 outputs address data and designates one among data areas of nonvolatile memory 7, e.g. a data area (a). The value of a flag is applied to the part 2 from a flag area Fa that corresponds to it and the data area is decided as either storable or unstorable. When it is storable, data are written in the area (a). It is confirmed whether the data before writing coincide with read data in the area (a) after writing. In the case of coincidence, a write operation is finished, and if it does not coincide, the value of a register area Ra is increased and it is confirmed whether this value exceeds prescribed value. When it exceeds, a flag which shows that the data area is unstorable is set in the area Fa. When it does not exceed, a deletion operation is performed to eliminate the charge of a floating gate.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、データの一括消去
可能な不揮発性メモリーを内蔵したマイクロコンピュー
タに関する。
[0001] 1. Field of the Invention [0002] The present invention relates to a microcomputer having a built-in nonvolatile memory capable of collectively erasing data.

【0002】[0002]

【従来の技術】一般に、マイクロコンピュータには動作
制御用のプログラムが記憶されるマスクROMやデータ
が記憶されるRAMが内蔵されている。一方、メモリー
として、書き込まれたデータの電気的な一括消去が可能
な不揮発性メモリが知られており、最近ではマイクロコ
ンピュータにおいて前記マスクROM及びRAMの代わ
りに不揮発性メモリが内蔵されるようになった。不揮発
性メモリがマイクロコンピュータに内蔵されると、不揮
発性メモリが電気的に書き込み済みデータの消去が可能
なため、製品となってからも動作制御用のプログラムの
書き換えが可能となる利点がある。その為、不揮発性メ
モリをマイクロコンピュータに内蔵する用途が多くなっ
ている。
2. Description of the Related Art Generally, a microcomputer has a built-in mask ROM for storing an operation control program and a RAM for storing data. On the other hand, a nonvolatile memory capable of electrically erasing written data electrically at a time is known as a memory. Recently, a nonvolatile memory has been built in a microcomputer instead of the mask ROM and RAM. Was. When the nonvolatile memory is incorporated in the microcomputer, the nonvolatile memory can electrically erase the written data, and thus has an advantage that the operation control program can be rewritten even after the product is manufactured. For this reason, applications for incorporating a non-volatile memory in a microcomputer are increasing.

【0003】ここで、不揮発性メモリの一つとして、図
3のようなスプリットゲート型フラッシュメモリーがあ
り、この不揮発性メモリーについて動作説明を行う。ま
ず、フラッシュメモリーへのデータの書き込みを行う場
合、ドレイン電極Dを接地し、ソース電極Sに12Vの
電圧を印加し、ゲート電極Gに2Vの電圧を印加する。
ソース−ドレイン間に大きい電位差が生じるので、その
間に負の電荷が生じ、ソースからドレインに電流が流れ
る。このとき、ソース−ドレイン間の大きな電位差によ
りホットエレクトロンという電荷が発生する。さらに、
コントロールゲートCGに2Vの電圧を印加しているた
め、フローティングゲートFG下部のチャネルの電圧は
約9Vとなり、前記ホットエレクトロンが引き上げられ
フローティングゲートFGに蓄えられる。フローティン
グゲートFGに電荷が蓄えられると、フローティングゲ
ートFG下部のチャネルが正に帯電されるので、ソース
−ドレイン間に電流が流れることはない。よって、この
状態をデータ「0」の書き込み状態と定義する。尚、フ
ローティングゲートFGに電荷が蓄えられていないと、
フローティングゲートFGが正に帯電されるため、ソー
ス−ドレイン間のチャネルが負に帯電されるため、この
間を電流が流れる。よって、この状態はデータ「1」の
書き込み状態になる。
Here, as one of the nonvolatile memories, there is a split gate type flash memory as shown in FIG. 3, and the operation of this nonvolatile memory will be described. First, when writing data to the flash memory, the drain electrode D is grounded, a voltage of 12 V is applied to the source electrode S, and a voltage of 2 V is applied to the gate electrode G.
Since a large potential difference is generated between the source and the drain, a negative charge is generated therebetween, and a current flows from the source to the drain. At this time, a charge called hot electron is generated due to a large potential difference between the source and the drain. further,
Since a voltage of 2 V is applied to the control gate CG, the voltage of the channel below the floating gate FG becomes about 9 V, and the hot electrons are pulled up and stored in the floating gate FG. When charges are stored in the floating gate FG, the channel below the floating gate FG is positively charged, so that no current flows between the source and the drain. Therefore, this state is defined as a state of writing data “0”. If no charge is stored in the floating gate FG,
Since the floating gate FG is positively charged, the channel between the source and the drain is negatively charged, and a current flows during this period. Therefore, this state is a state where data “1” is written.

【0004】また、フラッシュメモリーに書き込まれた
データを読み出す場合、ドレイン電極Dに2Vの電圧を
印加し、ソース電極Sを接地し、ゲート電極Gに電源電
圧程度の電圧を印加する。フローティングゲートFGに
電荷が蓄えられている場合、フローティングゲートFG
下部のチャネルが正に帯電されているため、ソース−ド
レイン間に一定の電位差を与えても、その間にセル電流
が流れない。また、フローティングゲートFGに電荷が
蓄えれられていない場合、ゲート電極Gに電圧を印加す
るため、ソース−ドレイン間のチャネルがより一層負に
帯電し、ソース−ドレイン間により多くセル電流が流れ
る。よって、データの読み出しは、ソースから得られる
セル電流の有無を確認することにより行われる。
When reading data written in the flash memory, a voltage of 2 V is applied to the drain electrode D, the source electrode S is grounded, and a voltage about the power supply voltage is applied to the gate electrode G. When charges are stored in the floating gate FG, the floating gate FG
Since the lower channel is positively charged, no cell current flows during a given potential difference between the source and the drain. When no charge is stored in the floating gate FG, a voltage is applied to the gate electrode G, so that the channel between the source and the drain is more negatively charged, and more cell current flows between the source and the drain. Therefore, data reading is performed by confirming the presence or absence of a cell current obtained from the source.

【0005】次に、不揮発性メモリ中のデータの電気的
消去について説明する。図3において、ソース電極S及
びドレイン電極Dを接地(0V)し、ゲート電極Gを1
5V以上にして、コントロールゲートCGとソースとの
間の電位差を大きくする。この電位差により、フローテ
ィングゲートFGの突起部からコントロールゲートCG
へトンネリング現象が起こり、フローティングゲートF
Gに蓄積された電荷がトンネリング電流としてコントロ
ールゲートCGに引き抜かれる。こうしてフローティン
グゲートFGの電荷を除去し、フローティングゲートF
Gを元の状態とし、電気的消去が実行される。
Next, electrical erasure of data in the nonvolatile memory will be described. In FIG. 3, the source electrode S and the drain electrode D are grounded (0 V), and the gate electrode G is set to 1
The potential difference between the control gate CG and the source is increased to 5 V or more. Due to this potential difference, the projection of the floating gate FG causes the control gate CG
The tunneling phenomenon occurs and the floating gate F
The charge stored in G is extracted to the control gate CG as a tunneling current. Thus, the charge on the floating gate FG is removed, and the floating gate F
G is returned to the original state, and electrical erasure is performed.

【0006】[0006]

【発明が解決しようとする課題】ところで、図3の不揮
発性メモリーには、書き込み/消去を数万回行うと、フ
ローティングゲートFGの電荷を除去できなくなり、デ
ータの消去ができなくなるという問題点がある。フロー
ティングゲートFG中の電荷をどの程度除去できるか
は、一定時間当たりにコントロールゲートCGに印加さ
れる電圧の大きさに依っている。コントロールゲートC
Gへの電圧が大きければフローティングゲートFG中の
電荷を確実に除去できる。
By the way, in the nonvolatile memory shown in FIG. 3, if writing / erasing is performed tens of thousands of times, the charge of the floating gate FG cannot be removed and the data cannot be erased. is there. How much the charge in the floating gate FG can be removed depends on the magnitude of the voltage applied to the control gate CG per fixed time. Control gate C
If the voltage to G is large, the charge in the floating gate FG can be reliably removed.

【0007】しかし、従来例では、消去時フローティン
グゲートFGの電荷を除去するためにゲートCGに印加
される電圧の大きさは一定であった。その為、不揮発性
メモリのデータの電気的消去を何度も繰り返している
と、場合によっては、電気的消去を行ったつもりでいて
も不揮発性メモリのメモリセルの中にはフローティング
ゲートFG中の電荷が完全に除去されないで一部残って
いる状況が起こり得る(過書き込み状態)。すると、フ
ローティングゲートに電荷が残った状態で、メモリセル
に「1」を書き込もうとすると、フローティングゲート
1に電荷が残っているため、このメモリセルは「0」の
書き込み状態となり、「1」を書き込むことができなか
った。すると、フローティングゲートFGに電荷が残っ
た状態のメモリセルを「1」の書き込み状態とした場
合、フローティングゲートFGに電荷が残っているた
め、このメモリセルは「0」の書き込み状態となり、
「1」を書き込むことができなかった。
However, in the conventional example, the magnitude of the voltage applied to the gate CG for removing the charge of the floating gate FG at the time of erasing was constant. Therefore, if the electrical erasure of the data in the nonvolatile memory is repeated many times, even if the electrical erasure is intended to be performed, some of the memory cells of the nonvolatile memory may have the floating gate FG. A situation can occur in which the charge is not completely removed but remains partially (overwriting condition). Then, when an attempt is made to write "1" to the memory cell with the charge remaining in the floating gate, the charge remains in the floating gate 1, so that this memory cell is in the write state of "0" and "1" is written. Could not write. Then, when the memory cell in the state where the charge remains in the floating gate FG is set to the write state of “1”, the charge remains in the floating gate FG, and thus the memory cell is in the write state of “0”.
"1" could not be written.

【0008】上記の不揮発性メモリの問題は、不揮発性
メモリを内蔵したマイクロコンピュータにも悪影響を及
ぼす。例えば、不揮発性メモリをRAMとして使用した
場合、データの書き換えにより不揮発性メモリは書き込
み/消去が繰り返される。この書き込み/消去が不揮発
性メモリの同一アドレス上、即ち所定のメモリセルを含
む領域で繰り返し続けられると、上記の過書き込み状態
が発生する。その為、マイクロコンピュータを動作させ
た場合、過書き込み状態により使用者の意図に反したデ
ータが書き込まれ、誤ったデータや誤ったプログラムが
不揮発性メモリに記憶され、マイクロコンピュータの誤
動作の原因となっていた。
[0008] The above-mentioned problem of the non-volatile memory adversely affects the microcomputer having the non-volatile memory. For example, when a nonvolatile memory is used as a RAM, writing / erasing of the nonvolatile memory is repeated by rewriting data. If this writing / erasing is repeated on the same address of the nonvolatile memory, that is, in an area including a predetermined memory cell, the overwriting state occurs. For this reason, when the microcomputer is operated, data contrary to the user's intention is written due to an overwrite state, and erroneous data and an incorrect program are stored in the non-volatile memory, which causes a malfunction of the microcomputer. I was

【0009】[0009]

【課題を解決するための手段】本発明は、書き込み済み
のデータを電気的に一括消去可能な不揮発性メモリと、
前記不揮発性メモリの書き込み及び消去を制御する制御
部を備えるマイクロコンピュータにおいて、前記不揮発
性メモリ中に、所定単位の複数のデータ領域と、各々の
データ領域に対応し、データの書き込みに不都合がある
ことが検出された回数を保持するレジスタ領域と、各々
のデータ領域に対応し、データの書き込みが不可能なこ
とを示す状態が書き込まれるフラグ領域とを設けたこと
を特徴とする。
According to the present invention, there is provided a nonvolatile memory capable of electrically erasing written data electrically at once,
In a microcomputer including a control unit that controls writing and erasing of the nonvolatile memory, the nonvolatile memory has a plurality of data areas of a predetermined unit and corresponds to each data area, and there is an inconvenience in writing data. And a flag area corresponding to each data area, in which a state indicating that data cannot be written is written.

【0010】特に、前記制御部は、前記複数のデータ領
域のうち1つのメモリ領域を選択する選択手段と、選択
されたデータ領域に書き込みデータを書き込む手段と、
書き込みデータと、前記書き込みデータに対応する読み
出しデータとが一致しているか否か確認する確認手段
と、前記2つのデータが一致しない場合、指定されたデ
ータ領域に対応するレジスタ領域をインクリメントする
インクリメント手段とを含むことを特徴とする。
[0010] In particular, the control unit includes a selection unit that selects one memory region from the plurality of data regions, a unit that writes write data to the selected data region,
Checking means for checking whether the write data and read data corresponding to the write data match; and, if the two data do not match, incrementing a register area corresponding to a specified data area And characterized in that:

【0011】また、前記制御部は、前記2つのデータが
一致しない場合、前記データ領域に対して少なくとも1
回の消去動作を行う消去手段を含むことを特徴とする。
さらに、前記制御部は、前記レジスタ手段の値が所定値
を超えた場合、前記データ領域に対応するフラグ領域に
データの書き込みを禁止することを示す状態をセットす
るフラグ手段を含むことを特徴とする。
When the two data do not match, the control unit may control at least one of the data areas.
It is characterized by including erasing means for performing the erasing operation twice.
Further, the control unit includes flag means for setting a state indicating that data writing is prohibited in a flag area corresponding to the data area when the value of the register means exceeds a predetermined value. I do.

【0012】また、前記不揮発性メモリは、前記データ
領域の対応するレジスタ手段の値が所定値を超えた場
合、前記データ領域に対応するフラグ領域にデータの書
き込みを禁止することを示す状態をセットするセット回
路を備えることを特徴とする。一方、前記制御部は、前
記2つのデータが一致した場合、書き込み動作を終了す
ることを特徴とする。
The nonvolatile memory sets a state indicating that data writing is prohibited in a flag area corresponding to the data area when a value of a register means corresponding to the data area exceeds a predetermined value. The present invention is characterized in that a set circuit is provided. On the other hand, the control unit terminates the write operation when the two data match.

【0013】さらにまた、前記制御部は、データの書き
換えごとに、指定するメモリ領域を変更することを特徴
とする。本発明に依れば、不揮発性メモリにおいて複数
のデータ領域に対応するレジスタ領域及びフラグ領域を
設け、所定のデータ領域にデータの書き込みを行う前
に、それに対応するフラグ領域が書き換え不可能な状態
になっている否か確認し、フラグがあればデータの書き
込みは行われず、フラグがなければデータをデータ領域
に書き込む。、書き込み後、書き込み前のデータとデー
タ領域から読み出されたデータとが一致するか否かを判
断し、一致すればデータの書き込み動作を終了し、一致
しなければレジスタ領域の値をインクリメントする。レ
ジスタ領域の値が所定値を超えた場合、フラグ領域にフ
ラグをセットする。
Further, the control unit changes a designated memory area every time data is rewritten. According to the present invention, a register area and a flag area corresponding to a plurality of data areas are provided in a non-volatile memory, and before writing data to a predetermined data area, the corresponding flag area cannot be rewritten. Is checked, and if there is a flag, the data is not written. If there is no flag, the data is written to the data area. After writing, it is determined whether or not the data before writing matches the data read from the data area. If they match, the data write operation is terminated. If they do not match, the value of the register area is incremented. . When the value of the register area exceeds a predetermined value, a flag is set in the flag area.

【0014】[0014]

【発明の実施の形態】図1は本発明の実施の形態を示す
図である。1は例えば外部データを入出力するための入
出力ポート、2は入出力ポート1からのデータを後述さ
れる不揮発性メモリに書き込むために各回路の動作を制
御する制御部であり、例えばCPU(中央演算処理装
置)で構成され、図示されない不揮発性メモリのプログ
ラム領域に記憶されるプログラムに基づいて動作し、主
に後述される不揮発性メモリ7へのデータの書き込み、
レジスタ領域Ra乃至Reへのインクリメント動作やフ
ラグ領域Fa乃至Feへのフラグのセットの動作を制御
する。
FIG. 1 is a diagram showing an embodiment of the present invention. Reference numeral 1 denotes an input / output port for inputting / outputting external data, for example, and reference numeral 2 denotes a control unit which controls the operation of each circuit to write data from the input / output port 1 to a nonvolatile memory described later. Central processing unit), which operates based on a program stored in a program area of a non-volatile memory (not shown), and mainly writes data to a non-volatile memory 7 described later,
It controls the increment operation to the register areas Ra to Re and the setting operation of the flags to the flag areas Fa to Fe.

【0015】3は制御部2の指示により、データやプロ
グラム動作中に生成されたデータを一旦記憶するRA
M、4はアドレスバスを含み、入出力ポート1、制御部
2及びRAM3の間のデータ伝送を行うためのバス、5
は1ページ分の領域を有し、データバス6を介して伝送
された1ページ分のデータを一旦格納するページバッフ
ァ、7は1ページ分のデータの記憶可能な4つのデータ
領域a乃至dと、領域a乃至dに対応するレジスタ領域
Ra乃至Rdやフラグ領域Fa乃至Fdとを含み、デー
タ領域Fa乃至Fdにデータバス8を介して伝送される
データが記憶される不揮発性メモリであり、制御部2か
らアドレスバス9を介して伝送されるアドレスデータを
デコードして、データ領域a乃至dのうち一つを指定す
るアドレスデコーダ(図示せず)を含む。また、不揮発
性メモリ7は複数のデータ領域を形成し、前記アドレス
デコーダの出力によって所定のアドレスが指定されるこ
とにより、データ領域が指定される。
Reference numeral 3 denotes an RA for temporarily storing data or data generated during a program operation in accordance with an instruction from the control unit 2.
M and 4 include address buses, buses for performing data transmission between the input / output port 1, the control unit 2 and the RAM 3, and 5;
Has a page buffer area, and temporarily stores one page of data transmitted via the data bus 6. A page buffer 7 temporarily stores one page of data. , A non-volatile memory including register areas Ra to Rd and flag areas Fa to Fd corresponding to the areas a to d, and storing data transmitted via the data bus 8 in the data areas Fa to Fd. An address decoder (not shown) for decoding address data transmitted from the unit 2 via the address bus 9 and designating one of the data areas a to d is included. Further, the nonvolatile memory 7 forms a plurality of data areas, and a data area is specified by specifying a predetermined address by the output of the address decoder.

【0016】また、不揮発性メモリ7中のフラグ領域の
状態は、データを消去しても不揮発性メモリ7のフロー
ティング中の電荷を完全に除去できないという理由で、
データの書き込みが不可能である状態の場合「0」とな
り、また、データの書き込みが可能である状態の場合、
「1」になる。尚、このフラグ領域は例えばデータ領域
と独立した領域に形成されており、状態を変えたいフラ
グのアドレスを指定し、フラグセット信号によりフラグ
の不揮発性メモリセルに「0」のデータを書き込むこと
によって、フラグ領域の状態が反転される。このよう
に、フラグ領域に「0」のデータを書き込むので、1ビ
ット毎の状態反転が可能になる。さらに、アドレス指定
されたフラグ領域からはフラグの値が制御部2に供給さ
れるようになる。
The state of the flag area in the nonvolatile memory 7 is determined because the floating charge of the nonvolatile memory 7 cannot be completely removed even if data is erased.
It is "0" when data cannot be written, and when data can be written,
It becomes "1". The flag area is formed, for example, in an area independent of the data area. By specifying the address of the flag whose state is to be changed, and writing "0" data to the nonvolatile memory cell of the flag by the flag set signal. , The state of the flag area is inverted. As described above, since the data “0” is written in the flag area, the state can be inverted for each bit. Further, the flag value is supplied to the control unit 2 from the flag area designated by the address.

【0017】不揮発性メモリ7中のレジスタ領域もデー
タ領域と独立した領域に形成される。値を変えたいレジ
スタ領域の指定は、そのレジスタ領域のアドレスを指定
することにより行われる。1つのレジスタ領域は例えば
3ビットで形成され、制御部2からのインクリメント信
号に応じてレジスタ領域に「111」、「110」、
「100」、「000」のデータを順次書き込むことに
よって、指定されたレジスタ領域の値を10進法で
「0」、「1」、「2」、「3」とインクリメントす
る。また、アドレス指定されたレジスタ領域の値は制御
部2に印加されるようになる。
The register area in the nonvolatile memory 7 is also formed in an area independent of the data area. The register area whose value is to be changed is specified by specifying the address of the register area. One register area is formed of, for example, 3 bits, and “111”, “110”,
By sequentially writing data "100" and "000", the value of the designated register area is incremented to "0", "1", "2", and "3" in decimal notation. Further, the value of the register area specified by the address is applied to the control unit 2.

【0018】まず、不揮発性メモリ7にデータを書き込
む場合、原則的に新規にデータの書き換えが行われるご
とに、書き込みが行われるデータ領域が変わっていく。
例えば図4に示されるように、新規の書き換えが行われ
るごとに、指定されるデータ領域がデータ領域aからデ
ータ領域b、データ領域bからデータ領域cへと順次変
更される。尚、データ領域の変更の順番は図4の限ら
ず、他の順番でも良い。
First, when data is written to the nonvolatile memory 7, the data area to be written changes every time data is rewritten in principle.
For example, as shown in FIG. 4, each time a new rewrite is performed, the designated data area is sequentially changed from the data area a to the data area b and from the data area b to the data area c. The order of changing the data area is not limited to that shown in FIG.

【0019】次に、図1の不揮発性メモリ7中のデータ
の書き換え動作を、図2のフローチャートを参照しなが
ら説明する。まず、外部より書き換え命令が制御部2に
入力されると、制御部2は入力ポート1を介して外部か
らデータを取り込み、データをRAM3に一時記憶させ
る(S1)。次に、制御部2はアドレスデータをバス9
を介して不揮発性メモリ7に入力する。アドレスデータ
がデコードされ、その結果に応じて例えば不揮発性メモ
リ7のデータ領域aが指定される。それに伴い、データ
領域aに対応するレジスタ領域Ra及びフラグ領域Fa
も指定される(S2)。指定されたフラグ領域Faから
その状態が制御部2に出力され、制御部2はフラグ領域
Faの状態を判断する(S3)。
Next, the operation of rewriting data in the nonvolatile memory 7 of FIG. 1 will be described with reference to the flowchart of FIG. First, when a rewrite command is input from the outside to the control unit 2, the control unit 2 takes in data from the outside via the input port 1 and temporarily stores the data in the RAM 3 (S1). Next, the control unit 2 transmits the address data to the bus 9
Is input to the non-volatile memory 7 via. The address data is decoded, and for example, a data area a of the nonvolatile memory 7 is designated according to the result. Accordingly, the register area Ra and the flag area Fa corresponding to the data area a
Is also specified (S2). The state is output from the designated flag area Fa to the control unit 2, and the control unit 2 determines the state of the flag area Fa (S3).

【0020】ところで、このフラグは不揮発性メモリ7
のデータ領域が記憶可能な状態か、記憶不可能な状態か
を示すものである。不揮発性メモリ7のメモリセルは図
3のような構成であり、書き込み済みデータの消去時フ
ローティングゲートから電荷を完全に除去できないと、
メモリセルには誤ったデータが記憶される。書き込みデ
ータを正確に記憶できない場合、読み出しの際には当然
書き込みデータと異なるデータが読み出されるため、こ
の状態を記憶不可能な状態としている。また、書き込み
データに対して、メモリセルから誤りなくデータを読み
出せる場合、この状態を記憶可能な状態としている。そ
こで、フラグ領域の状態は「0」または「1」の値を有
し、フラグが「1」の場合データ領域は書き込み可能な
状態にあることを示し、フラグが「0」の場合データ領
域は書き込み不可能な状態を示す。
Incidentally, this flag is stored in the nonvolatile memory 7.
This indicates whether the data area is in a storable state or a non-storable state. The memory cell of the non-volatile memory 7 has a configuration as shown in FIG. 3, and if charges cannot be completely removed from the floating gate when erasing written data,
Incorrect data is stored in the memory cell. If the write data cannot be stored accurately, data different from the write data is naturally read at the time of reading, so this state is set to a non-storable state. When data can be read from a memory cell without error with respect to write data, this state is set to a storable state. Therefore, the state of the flag area has a value of “0” or “1”, and when the flag is “1”, it indicates that the data area is in a writable state, and when the flag is “0”, the data area is Indicates a state where writing is not possible.

【0021】S3において、フラグ領域Faが「0」の
場合、制御部2は次のデータ領域bを選択する(S
4)。S2に戻り、制御部2はデータ領域bに対応した
アドレスデータを出力し、前記アドレスデータによりデ
ータ領域b及びフラグ領域Fbが指定される。フラグ領
域Fbが指定されると、フラグ領域Fbのフラグが制御
部2に出力され、フラグ領域Fbの値によってデータ領
域bが記憶可能な状態か、記憶不可能な状態かが判断さ
れる。このように、指定されたフラグ領域が「0」であ
ると、次のデータ領域及びフラグ領域を指定して、再び
フラグの状態を判断される。
If the flag area Fa is "0" in S3, the control section 2 selects the next data area b (S3).
4). Returning to S2, the control unit 2 outputs address data corresponding to the data area b, and the data area b and the flag area Fb are designated by the address data. When the flag area Fb is designated, the flag of the flag area Fb is output to the control unit 2, and it is determined whether the data area b can be stored or cannot be stored based on the value of the flag area Fb. As described above, when the designated flag area is “0”, the next data area and the flag area are designated, and the state of the flag is determined again.

【0022】また、S3において、フラグ領域Faが
「1」の場合、データ領域aは記憶可能な状態と判断さ
れる。続いて、制御部2は不揮発性メモリ7に消去信号
をデータバス9を介して出力し、指定されるデータ領域
aに書き込まれているデータの一括消去を行う(S
5)。データの消去後、制御部2はRAM3に記憶され
たデータを読み出し、ページバッファ5に1ページ分の
データを一時格納させる(S6)。制御部2は不揮発性
メモリにライト信号Wを印加し、ページバッファ5のデ
ータはデータ領域aに書き込まれる(S7)。
If the flag area Fa is "1" in S3, it is determined that the data area a is in a storable state. Subsequently, the control unit 2 outputs an erasure signal to the nonvolatile memory 7 via the data bus 9 and performs batch erasure of the data written in the designated data area a (S
5). After erasing the data, the control unit 2 reads the data stored in the RAM 3 and causes the page buffer 5 to temporarily store one page of data (S6). The control unit 2 applies the write signal W to the nonvolatile memory, and the data in the page buffer 5 is written to the data area a (S7).

【0023】次に、データ領域aを指定した状態で、S
6で書き込まれたデータの読み出しを行う。読み出しデ
ータはデータバス6及び8を介して制御部2に印加され
る(S8)。読み出されたデータは、制御部2におい
て、RAM3に記憶されたデータに一致するか否か、比
較される。S9において、1ページ分のデータのうち1
つでもデータが一致しない場合、制御部2は指定された
レジスタ領域のデータを読み出し、レジスタ領域の値を
検出し、検出された値をインクリメントするためにイン
クリメント信号を不揮発性メモリ7に出力する。インク
リメント信号に応じて、レジスタ領域Raの状態が書き
換えられ、その値がインクリメントされる(S10)。
このレジスタ領域の値は、RAM3のデータと読み出し
データとの不一致が確認された回数を示しており、レジ
スタ領域の値を検出することによりデータ領域のメモリ
セルのフローティングゲートから電荷を完全に除去でき
ない状態が何回あったかを知ることができる。
Next, with the data area a specified, S
The data written in step 6 is read. The read data is applied to the control unit 2 via the data buses 6 and 8 (S8). The read data is compared by the control unit 2 to determine whether it matches the data stored in the RAM 3. At S9, one of the data of one page
If any data does not match, the control unit 2 reads the data in the designated register area, detects the value in the register area, and outputs an increment signal to the nonvolatile memory 7 to increment the detected value. In response to the increment signal, the state of the register area Ra is rewritten, and the value is incremented (S10).
The value in the register area indicates the number of times that the mismatch between the data in the RAM 3 and the read data has been confirmed, and the charge cannot be completely removed from the floating gate of the memory cell in the data area by detecting the value in the register area. You can know how many times the condition has occurred.

【0024】その後、制御部2はレジスタ領域Raの値
が所定値N、例えば3という所定値を超えたか否か検出
する(S11)。レジスタ領域Raの値が所定値3を超
えない場合、制御部2は不揮発性メモリ7に対して所定
回数の消去動作を行う。この消去動作はS5におけるデ
ータの一括消去と同一の動作で行う。データの不一致は
メモリセルのフローティングゲート中の電荷を完全に除
去できないことに起因している。消去動作によってフロ
ーティングゲートの電荷を除去できる可能性があるた
め、所定回数の消去動作を行うことにより再び正確なデ
ータの書き込みを行わせようとしている(S12)。
Thereafter, the control unit 2 detects whether the value of the register area Ra exceeds a predetermined value N, for example, 3 (S11). When the value of the register area Ra does not exceed the predetermined value 3, the control unit 2 performs a predetermined number of erasing operations on the nonvolatile memory 7. This erasing operation is performed by the same operation as the batch erasing of data in S5. The data mismatch results from the inability to completely remove the charge in the floating gate of the memory cell. Since there is a possibility that the charge of the floating gate can be removed by the erase operation, the correct data is written again by performing the erase operation a predetermined number of times (S12).

【0025】また、S10においてレジスタ領域Rbの
値が3を超えた場合、制御部2はフラグセット信号se
tを出力する。つまり、データの一致がとれない場合、
何回も消去動作を行ってメモリセルのフローティングゲ
ート中の電荷を除去しても、フローティング中の電荷を
完全に除去できないと判断できるため、指定されたデー
タ領域は正確な記憶を行うことができないと見なすこと
ができる。フラグセット信号setにより、フラグ領域
Faに「0」の値がセットされ、データ領域aは記憶不
可能な状態になる(S13)。その結果、今後データ領
域aにデータ書き込もうとしても、S3でデータ領域a
にフラグがあると検出されるので、今後はデータ領域a
にはデータは書き込まれなくなる。
If the value of the register area Rb exceeds 3 in S10, the control unit 2 sets the flag set signal se.
Output t. That is, if the data does not match,
Even if the erase operation is performed many times to remove the charge in the floating gate of the memory cell, it can be determined that the charge in the floating state cannot be completely removed, so that the specified data area cannot be accurately stored. Can be considered. The value of "0" is set in the flag area Fa by the flag set signal set, and the data area a is set in a state where it cannot be stored (S13). As a result, even if data is written to the data area a in the future, the data area a
It is detected that there is a flag in the data area a.
Will not be written any more.

【0026】その後、S12またはS13の動作が終了
すると、S4へ行き、データ領域aの次に指定されるデ
ータ領域、例えばデータ領域bが選択される。さらに、
S2へ戻り、不揮発性メモリ7のデータ領域bが指定さ
れ、フラグの検出、データの一致の確認、レジスタ領域
Raの値のインクリメント及び確認、データの書き込み
の各動作が繰り返される。
Thereafter, when the operation of S12 or S13 is completed, the process goes to S4, where a data area specified next to the data area a, for example, the data area b is selected. further,
Returning to S2, the data area b of the non-volatile memory 7 is specified, and the operations of detecting the flag, confirming the data match, incrementing and confirming the value of the register area Ra, and writing data are repeated.

【0027】また、S9において、RAM3のデータと
読み出しデータとが一致した場合、データの書き込みが
誤りなく行えたとして、データの書き換えを終了する。
データの一致は、データ領域aにおいて正確な書き込み
が行えることを示している。制御部2はインクリメント
信号及びフラグセット信号を発生しないので、レジスタ
領域Raの値はそのままとなり、フラグ領域Faは
「1」のままとなって、データ領域aは今後もデータの
書き込みを行うことができる。
In S9, if the data in the RAM 3 matches the read data, it is determined that the data has been written without error, and the data rewriting is terminated.
Data coincidence indicates that accurate writing can be performed in the data area a. Since the control unit 2 does not generate the increment signal and the flag set signal, the value of the register area Ra remains unchanged, the flag area Fa remains "1", and the data area a can be written with data in the future. it can.

【0028】図5は他の実施の形態を示す図であり、図
1と異なる点についてのみ説明する。図1ではレジスタ
領域の値を制御部2に入力し、制御部2でレジスタ領域
の値が所定値を超えたか否か確認させているが、これに
代えて図5では、不揮発性メモリ7中にレジスタ領域の
値を見てフラグ領域にフラグをセットさせるセット回路
10を備えている。
FIG. 5 shows another embodiment, and only the points different from FIG. 1 will be described. In FIG. 1, the value of the register area is input to the control unit 2, and the control unit 2 checks whether the value of the register area has exceeded a predetermined value. And a setting circuit 10 for setting a flag in the flag area by looking at the value of the register area.

【0029】図6は図5の回路動作を説明するためのフ
ローチャートであり、図2のフローチャートとは不揮発
性メモリ7のレジスタ領域の値をインクリメントした後
の動作が異なるので、この異なる点についてのみ説明す
る。S10で、例えばレジスタ領域Raの値をインクリ
メントした後、制御部2は、メモリセルのフローティン
グゲートに帯電される電荷を完全に除去するために、所
定回数の消去動作を行う(S14)。その後、S4に行
き、次のデータ領域、例えばデータ領域bを選択する。
一方、インクリメントの後、不揮発性メモリ7におい
て、指定されたデータ領域aに対応するレジスタ領域R
aの値がセット回路10に入力される。セット回路10
において、レジスタ領域Raの値と所定値(例えば、
3)とが比較され、レジスタ領域Raの値が所定値3を
超える場合セット回路10はキャリー信号cを出力す
る。キャリー信号cによって、指定されたデータ領域a
に対応するフラグ領域Faにフラグが「0」にセットさ
れる。フラグがセットされることにより、今後データ領
域aには書き込みは行われなくなる。また、レジスタ領
域Raの値が所定値3を超えない場合、セット回路10
はキャリー信号cを出力せず、フラグ領域Faの値は
「1」のままであって、データ領域aは書き込み可能な
状態を維持する。
FIG. 6 is a flowchart for explaining the operation of the circuit of FIG. 5. The operation after incrementing the value of the register area of the nonvolatile memory 7 is different from that of the flowchart of FIG. explain. After incrementing, for example, the value of the register area Ra in S10, the control unit 2 performs a predetermined number of erasing operations in order to completely remove the electric charge charged in the floating gate of the memory cell (S14). After that, the process goes to S4 to select the next data area, for example, data area b.
On the other hand, after the increment, in the nonvolatile memory 7, the register area R corresponding to the designated data area a
The value of “a” is input to the set circuit 10. Set circuit 10
, The value of the register area Ra and a predetermined value (for example,
3) is compared, and if the value of the register area Ra exceeds the predetermined value 3, the set circuit 10 outputs the carry signal c. Data area a specified by carry signal c
Is set to "0" in the flag area Fa corresponding to. By setting the flag, writing to the data area a will not be performed in the future. If the value of the register area Ra does not exceed the predetermined value 3, the setting circuit 10
Does not output carry signal c, the value of flag area Fa remains "1", and data area a maintains a writable state.

【0030】[0030]

【発明の効果】本発明に依れば、不揮発性メモリに複数
のデータ領域を設け、新規の書き込みを行うごとにデー
タ領域を変えるので、連続した同一データ領域への書き
込みを防止することができ、書き込み/消去特性の寿命
を向上させることができる。特に、データ領域にフラグ
領域を設けることによって、書き込み前に正確な記憶が
不可能なデータ領域がわかるので、記憶不可能なデータ
領域にデータを書き込むことが防止される。その為、マ
イクロコンピュータに使用した場合、過書き込み状態が
防止され、マイクロコンピュータの誤動作を防ぐことが
できる。
According to the present invention, since a plurality of data areas are provided in the nonvolatile memory and the data area is changed each time new writing is performed, it is possible to prevent continuous writing to the same data area. In addition, the life of the write / erase characteristics can be improved. In particular, by providing a flag area in the data area, a data area in which accurate storage is impossible before writing can be known, so that writing of data in a data area in which storage is not possible is prevented. Therefore, when used in a microcomputer, an overwriting state is prevented, and malfunction of the microcomputer can be prevented.

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

【図1】本発明の実施の形態を示すブロック図である。FIG. 1 is a block diagram showing an embodiment of the present invention.

【図2】図1の動作を説明するためのフローチャートで
ある。
FIG. 2 is a flowchart for explaining the operation of FIG. 1;

【図3】スプリットゲート型不揮発性メモリを示す断面
図である。
FIG. 3 is a sectional view showing a split gate nonvolatile memory.

【図4】データの書き換え時データ領域の選択を示すフ
ローチャートである。
FIG. 4 is a flowchart showing selection of a data area when rewriting data.

【図5】本発明の他の実施の形態を示すブロック図であ
る。
FIG. 5 is a block diagram showing another embodiment of the present invention.

【図6】図5の動作を説明するためのフローチャートで
ある。
FIG. 6 is a flowchart for explaining the operation of FIG. 5;

【図7】図1の動作を説明するための他のフローチャー
トである。
FIG. 7 is another flowchart for explaining the operation of FIG. 1;

【図8】図5の動作を説明するための他のフローチャー
トである。
FIG. 8 is another flowchart for explaining the operation of FIG. 5;

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

1 入出力ポート 2 制御部 3 RAM 5 バッファ回路 7 不揮発性メモリ DESCRIPTION OF SYMBOLS 1 I / O port 2 Control part 3 RAM 5 Buffer circuit 7 Non-volatile memory

Claims (7)

【特許請求の範囲】[Claims] 【請求項1】 書き込み済みのデータを電気的に一括消
去可能な不揮発性メモリと、前記不揮発性メモリの書き
込み及び消去を制御する制御部を備えるマイクロコンピ
ュータにおいて、 前記不揮発性メモリ中に、所定単位の複数のデータ領域
と、各々のデータ領域に対応し、データの書き込みに不
都合があることが検出された回数を保持するレジスタ領
域と、各々のデータ領域に対応し、データの書き込みが
不可能なことを示す状態が書き込まれるフラグ領域とを
設けたことを特徴とするマイクロコンピュータ。
1. A microcomputer comprising: a nonvolatile memory capable of electrically erasing written data in a batch; and a control unit for controlling writing and erasing of the nonvolatile memory, wherein a predetermined unit is included in the nonvolatile memory. A plurality of data areas, a register area corresponding to each data area and holding the number of times that it is detected that there is an inconvenience in data writing, and a register area corresponding to each data area and incapable of data writing. And a flag area in which a status indicating the status is written.
【請求項2】 前記制御部は、前記複数のデータ領域の
うち1つのメモリ領域を選択する選択手段と、選択され
たデータ領域に書き込みデータを書き込む手段と、書き
込みデータと、前記書き込みデータに対応する読み出し
データとが一致しているか否か確認する確認手段と、前
記2つのデータが一致しない場合、指定されたデータ領
域に対応するレジスタ領域をインクリメントするインク
リメント手段とを含むことを特徴とする請求項1記載の
マイクロコンピュータ。
A control unit configured to select one memory area from the plurality of data areas; a unit configured to write write data into the selected data area; And a check unit for checking whether read data to be read matches the read data, and an increment unit for incrementing a register area corresponding to a specified data area when the two data do not match. Item 18. The microcomputer according to Item 1.
【請求項3】 前記制御部は、前記2つのデータが一致
しない場合、前記データ領域に対して少なくとも1回の
消去動作を行う消去手段を含むことを特徴とする請求項
2記載のマイクロコンピュータ。
3. The microcomputer according to claim 2, wherein the control unit includes an erasing unit that performs at least one erasing operation on the data area when the two data do not match.
【請求項4】 前記制御部は、前記レジスタ手段の値が
所定値を超えた場合、前記データ領域に対応するフラグ
領域にデータの書き込みを禁止することを示す状態をセ
ットするフラグ手段を含むことを特徴とする請求項3記
載のマイクロコンピュータ。
4. The control unit includes flag means for setting a state indicating that data writing is prohibited in a flag area corresponding to the data area when a value of the register means exceeds a predetermined value. 4. The microcomputer according to claim 3, wherein:
【請求項5】 前記不揮発性メモリは、前記データ領域
の対応するレジスタ手段の値が所定値を超えた場合、前
記データ領域に対応するフラグ領域にデータの書き込み
を禁止することを示す状態をセットするセット回路を備
えることを特徴とする請求項2記載のマイクロコンピュ
ータ。
5. The non-volatile memory sets a state indicating that data writing is prohibited in a flag area corresponding to the data area when a value of a register means corresponding to the data area exceeds a predetermined value. 3. The microcomputer according to claim 2, further comprising a set circuit that performs the setting.
【請求項6】 前記制御部は、前記2つのデータが一致
した場合、書き込み動作を終了することを特徴とする請
求項2記載のマイクロコンピュータ。
6. The microcomputer according to claim 2, wherein the control unit ends the write operation when the two data match.
【請求項7】 前記制御部は、データの書き換えごと
に、指定するメモリ領域を変更することを特徴とする請
求項2記載ののマイクロコンピュータ。
7. The microcomputer according to claim 2, wherein the control unit changes a designated memory area every time data is rewritten.
JP9267194A 1997-09-30 1997-09-30 Microcomputer Pending JPH11110304A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9267194A JPH11110304A (en) 1997-09-30 1997-09-30 Microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9267194A JPH11110304A (en) 1997-09-30 1997-09-30 Microcomputer

Publications (1)

Publication Number Publication Date
JPH11110304A true JPH11110304A (en) 1999-04-23

Family

ID=17441435

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9267194A Pending JPH11110304A (en) 1997-09-30 1997-09-30 Microcomputer

Country Status (1)

Country Link
JP (1) JPH11110304A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009531757A (en) * 2006-03-24 2009-09-03 ローベルト ボッシュ ゲゼルシャフト ミット ベシュレンクテル ハフツング Driving method of storage device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009531757A (en) * 2006-03-24 2009-09-03 ローベルト ボッシュ ゲゼルシャフト ミット ベシュレンクテル ハフツング Driving method of storage device

Similar Documents

Publication Publication Date Title
US6522581B2 (en) Semiconductor storage device
US7016228B2 (en) Semiconductor storage device having page copying function
US6154808A (en) Method and apparatus for controlling data erase operations of a non-volatile memory device
JP3251968B2 (en) Semiconductor storage device
US20050254306A1 (en) Flash memory device and method for driving the same
JP3875153B2 (en) Nonvolatile semiconductor memory device and its rewrite prohibition control method
JP2534733B2 (en) Nonvolatile semiconductor memory device
KR19990083409A (en) A nonvolatile storage device and control method therefor
US7248503B2 (en) Semiconductor nonvolatile storage device
US7590793B2 (en) Data access controlling method in flash memory and data access controlling program
JP3641066B2 (en) Microcomputer data rewriting method with embedded flash memory
JPH11110304A (en) Microcomputer
EP1011105B1 (en) One-chip microcomputer
JPH11110298A (en) Microcomputer
JP2006504202A (en) Method for driving a memory structure
US7187582B2 (en) Erroneous operation preventing circuit of non-volatile memory device
JPH05290585A (en) Nonvolatile memory writable electrically
JP4213053B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JPH11110299A (en) Microcomputer
JPH11110303A (en) Microcomputer
KR100960478B1 (en) Dual plane copyback method for non volatile memory device
JP3796063B2 (en) Non-volatile memory writing circuit
JP3755626B2 (en) Method for writing data in nonvolatile storage medium
JPH07281962A (en) Access method to electrically rewritable nonvolatile memory
US20060155916A1 (en) Writing uncorrupted data to electronic memory