JP2000222891A - Method and unit for rewriting memory of microcomputer - Google Patents

Method and unit for rewriting memory of microcomputer

Info

Publication number
JP2000222891A
JP2000222891A JP2108499A JP2108499A JP2000222891A JP 2000222891 A JP2000222891 A JP 2000222891A JP 2108499 A JP2108499 A JP 2108499A JP 2108499 A JP2108499 A JP 2108499A JP 2000222891 A JP2000222891 A JP 2000222891A
Authority
JP
Japan
Prior art keywords
data
eeprom
address
memory
control circuit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2108499A
Other languages
Japanese (ja)
Other versions
JP3157800B2 (en
Inventor
Yuichi Osada
勇一 長田
Takashi Kuwabara
孝 桑原
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.)
NEC IC Microcomputer Systems Co Ltd
Original Assignee
NEC IC Microcomputer Systems Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC IC Microcomputer Systems Co Ltd filed Critical NEC IC Microcomputer Systems Co Ltd
Priority to JP2108499A priority Critical patent/JP3157800B2/en
Publication of JP2000222891A publication Critical patent/JP2000222891A/en
Application granted granted Critical
Publication of JP3157800B2 publication Critical patent/JP3157800B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Microcomputers (AREA)
  • Read Only Memory (AREA)

Abstract

PROBLEM TO BE SOLVED: To prolong the rewriting lifetime of memory while sustaining the general purpose performance of program without burdening a program being installed in a microcomputer. SOLUTION: A memory control circuit 8 controls data writing and erasure of an EEPROM 6 in a microcomputer. An address control circuit 10 rewrites the data held in the EEPROM 6 under control of the memory control circuit 8 and a counter 30 constituting the address control circuit 10 counts up the number of times when the memory control circuit 8 flash writes a data into the EEPROM 6 and holds the count nonvolatilisably. An address conversion circuit 32 delivers an address data to the EEPROM 6 while converting into an address data for accessing a different memory area thereof depending on the count held in the counter 30.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、フラツシュEEP
ROMを内蔵したマイクロコンピュータにおいてフラツ
シュEEPROMの記憶内容を書き換える装置および方
法に関数するものである。
The present invention relates to a flash EEP.
This function functions in an apparatus and a method for rewriting the stored contents of a flash EEPROM in a microcomputer having a built-in ROM.

【0002】[0002]

【従来の技術】電気的にデータを一括して書き込みまた
は消去できるフラツシュEEPROMを内蔵したマイク
ロコンピュータ(フラッシュマイコンとも呼ばれる)
は、EEPROMに保持されたプログラムデータなどを
必要に応じて書き換えることで種々の機能を柔軟に実現
できることから様々な分野で広く用いられている。とこ
ろで、この種のEEPROMは、一般的に消去、書き込
みの繰り返しによるメモリセルの劣化のため、書き換え
可能回数が制限されている。このような制限を解消ある
いは緩和すべく、製造方法などの点で様々な改善が試み
られているが、いまだ必ずしも十分に要求を満たす水準
には至っていない。
2. Description of the Related Art A microcomputer (also called a flash microcomputer) having a built-in flash EEPROM capable of electrically writing or erasing data collectively.
Is widely used in various fields because various functions can be flexibly realized by rewriting program data and the like held in the EEPROM as needed. Incidentally, in this type of EEPROM, the number of rewritable times is generally limited due to deterioration of memory cells due to repetition of erasing and writing. Various attempts have been made to eliminate or alleviate such restrictions in terms of manufacturing methods and the like, but they have not yet reached a level that sufficiently satisfies the requirements.

【0003】そこで、フラツシュEEPROMの使用方
法を工夫することで、書き換え可能回数を増大させるこ
とが考えられる。例えば、特開平2−66796号公報
には不揮発性メモリに複数のメモリブロック(メモリバ
ンク)を持たせ、各メモリブロックが使用可能か否かを
判断するという方式が開示されている。この方式を、フ
ラッシュマイコンに適用すると、たとえば図7に示した
ブロック図のような構成となる。このフラッシュマイコ
ン102は、CPU104、フラツシュEEPROM1
06を含み、CPU104がアドレス/データバス10
8を通じて出力したアドレスデータ(単にアドレスとも
いう)はアドレスラッチ110に保持されてEEPRO
M106に供給され、メモリ制御回路112の制御のも
とでEEPROM106に対するデータの書き込みみ、
あるいはEEPROM106からのデータの読み出しが
行われる。また、その際、CPU104が出力したデー
タはライトバッファ114を通じてEEPROM106
に供給され、一方、EEPROM106から読み出され
たデータはリードバッファ116を通じてアドレス/デ
ータバス108に出力される。
Therefore, it is conceivable to increase the number of rewritable times by devising a method of using the flash EEPROM. For example, Japanese Patent Application Laid-Open No. 2-66696 discloses a method in which a nonvolatile memory is provided with a plurality of memory blocks (memory banks) and it is determined whether each memory block is usable. When this method is applied to a flash microcomputer, the configuration becomes, for example, a block diagram shown in FIG. The flash microcomputer 102 includes a CPU 104, a flash EEPROM 1
06, and the CPU 104 controls the address / data bus 10
The address data (also simply referred to as an address) output through the address latch 8 is stored in an address latch 110 and the EEPRO
M106, and writes data to the EEPROM 106 under the control of the memory control circuit 112.
Alternatively, data is read from the EEPROM 106. At this time, the data output from the CPU 104 is transferred to the EEPROM 106 through the write buffer 114.
The data read from the EEPROM 106 is output to an address / data bus 108 through a read buffer 116.

【0004】そして、EEPROM106は本例では4
つの第1ないし第4のメモリブロック118、120、
122、124に分割され、各ブロックごとにカウント
領域126が設けられている。このカウント領域126
には対応するメモリブロックにおけるデータの書き込み
回数が記録され、その値によって、同メモリブロックへ
のデータの書き込みが可能か否かが判定される。このよ
うな構成とすることで、データの書き込みをEEPRO
M106全体に分散して行うことができるので、フラツ
シュEEPROM106の寿命の延長が可能となる。
[0004] In this example, the EEPROM 106 is 4
Three first to fourth memory blocks 118, 120,
It is divided into 122 and 124, and a count area 126 is provided for each block. This count area 126
Indicates the number of times data has been written in the corresponding memory block, and whether or not data can be written in the same memory block is determined based on the value. With such a configuration, data writing can be performed by EEPROM.
Since the operation can be performed in a distributed manner over the entire M106, the life of the flash EEPROM 106 can be extended.

【0005】[0005]

【発明が解決しようとする課題】しかし、この方式で
は、CPU104はどのメモリブロックを使用するかに
よって異なるアドレスをEEPROM106に供給する
必要がある。そのためのアドレス制御はプログラムによ
り行うことになり、フラッシュマイコン102に組み込
むプログラムは必ずこのような機能を備えていなければ
ならず、その点で強い制約を受ける。また、このような
メモリ管理機能はメモリブロックの構成などによって変
わるため、メモリ管理機能を持たせたプログラムは汎用
性がなくなり、フラッシュマイコン102が変われば、
プログラムも変更しなければならない。さらに、上記従
来技術をフラッシュマイコン102に適用した場合、上
記カウント領域126は上記従来技術における本来の意
図とは異なる働きをさせることになるので、上記従来技
術をそのまま適用したのでは処理手順は必要以上に複雑
となる。本発明は、このような問題を解決するためにな
されたもので、その目的は、組み込まれるプログラムに
負担をかけず、またプログラムの汎用性を維持したま
ま、メモリデータの書き換え寿命の延長を実現するマイ
クロコンピュータのメモリ書き換え装置および方法を提
供することにある。
However, in this method, the CPU 104 needs to supply different addresses to the EEPROM 106 depending on which memory block is used. Address control for that purpose is performed by a program, and a program incorporated in the flash microcomputer 102 must necessarily have such a function, which is strongly restricted. Further, since such a memory management function changes depending on the configuration of the memory block, etc., a program having the memory management function loses versatility, and if the flash microcomputer 102 changes,
The program must also be changed. Furthermore, when the above-described conventional technology is applied to the flash microcomputer 102, the count area 126 functions differently from the original intention of the above-described conventional technology. It becomes more complicated. The present invention has been made to solve such a problem, and its object is to extend the life of rewriting memory data without placing a burden on an embedded program and maintaining the versatility of the program. And a memory rewriting device for a microcomputer.

【0006】[0006]

【課題を解決するための手段】本発明は、上記目的を達
成するため、フラツシュEEPROMと、前記EEPR
OMへのデータの書き込みおよび消去を制御するメモリ
制御回とを内蔵したマイクロコンピュータに設けられ、
メモリ制御回路の制御のもとで前記EEPROMが保持
するデータを書き換える装置であって、前記メモリ制御
回路が前記EEPROMへのデータの一括書き込みを行
う回数を計数し、計数値を不揮発的に保持するカウンタ
と、前記EEPROMに供給されるアドレスデータを、
前記カウンタが保持する前記計数値に応じて前記EEP
ROMの異なる記憶領域のアドレスデータに変換し前記
EEPROMに供給するアドレス変換回路とを備え、前
記メモリ制御回路は前記カウンタの前記計数値が規定値
に到達したとき、前記EEPROMの各記憶領域に記憶
されているデータを一括消去することを特徴とする。
SUMMARY OF THE INVENTION In order to achieve the above object, the present invention provides a flash EEPROM and the EEPROM.
A microcomputer having a memory control circuit for controlling writing and erasing of data to and from the OM;
An apparatus for rewriting data held in an EEPROM under the control of a memory control circuit, wherein the memory control circuit counts the number of times of batch writing of data to the EEPROM, and holds the count value in a nonvolatile manner. A counter and address data supplied to the EEPROM,
The EEP according to the count value held by the counter
An address conversion circuit that converts the data into address data in different storage areas of the ROM and supplies the data to the EEPROM, wherein the memory control circuit stores the data in each storage area of the EEPROM when the count value of the counter reaches a specified value. Data that has been erased at once.

【0007】また、本発明は、フラツシュEEPROM
と、前記EEPROMへのデータの書き込みおよび消去
を制御するメモリ制御回とを内蔵したマイクロコンピュ
ータで、前記EEPROMが保持するデータを書き換え
る方法であって、前記メモリ制御回路により前記EEP
ROMへのデータの一括書き込みが行われる回数を計数
して計数値を不揮発的に保持し、前記EEPROMに供
給されるアドレスデータを、保持した前記計数値に応じ
前記EEPROMの異なる記憶領域のアドレスデータに
変換して前記EEPROMに供給し、前記計数値が規定
値に到達したとき、前記EEPROMの各記憶領域に記
憶されているデータを一括消去することを特徴とする。
Further, the present invention relates to a flash EEPROM.
And a memory control circuit for controlling writing and erasing of data to and from the EEPROM, wherein the data stored in the EEPROM is rewritten by the microcomputer.
Counting the number of times of batch writing of data to the ROM, holding the count value in a nonvolatile manner, and changing the address data supplied to the EEPROM to address data in different storage areas of the EEPROM according to the held count value. And the data is supplied to the EEPROM, and when the count value reaches a specified value, data stored in each storage area of the EEPROM is collectively erased.

【0008】本発明では、メモリ制御回路によりEEP
ROMへのデータの一括書き込みが行われる回数を計数
して計数値を不揮発的に保持し、EEPROMに供給さ
れるアドレスデータを、上記保持した計数値に応じEE
PROMの異なる記憶領域のアドレスデータに変換して
EEPROMに供給する。そのため、記憶領域を順番に
切り換えて使用でき、特定の記憶領域に書き換えが集中
することがなく、EEPROMの書き換え寿命の延長を
実現できる。そして、このように記憶領域を切り換えて
も、マイクロコンピュータを構成するCPUを動作させ
るプログラムにはメモリ管理の点でいっさい負担がかか
らない。したがってまた、プログラムにメモリ管理に関
する機能を持たせる必要がなく、プログラムの汎用性が
低下することもない。
In the present invention, the EEP is controlled by the memory control circuit.
The number of times of batch writing of data to the ROM is counted, the count value is held in a nonvolatile manner, and the address data supplied to the EEPROM is changed according to the held count value.
The data is converted into address data in a different storage area of the PROM and supplied to the EEPROM. Therefore, the storage areas can be switched and used in order, and rewriting is not concentrated on a specific storage area, and the rewriting life of the EEPROM can be extended. Even when the storage areas are switched in this manner, no burden is imposed on the program for operating the CPU constituting the microcomputer in terms of memory management. Therefore, the program does not need to have a function related to memory management, and the versatility of the program does not decrease.

【0009】また、本発明では、計数値が規定値に到達
したとき、EEPROMの各記憶領域に記憶されている
データを一括して消去するので、各記憶領域でデータの
書き換えを行うごとに消去する場合に比べ、消去を実行
する回数が少なくなり、その点でもEEPROMのメモ
リセルに対するストレスが低減して、寿命の延長に有利
である。さらに、フラッシュマイコンでは従来、一部の
データを書き換える場合でも、他の書き換えの必要のな
いデータも含め、全メモリ領域でデータの書き換えを行
っており、その結果、データのロードと、データの書き
込みに時間がかかっていたが、本発明では、1つの記憶
領域単位でデータの書き込みを行うことができるので、
短時間で作業を終了することができる。また、上述のよ
うに各記憶領域のデータを一括して消去することから、
消去のために費やす時間も短くなり、この点でも効率よ
く作業を行える。
Further, according to the present invention, when the count value reaches a specified value, data stored in each storage area of the EEPROM is collectively erased, so that every time data is rewritten in each storage area, the data is erased. As compared with the case where the erase operation is performed, the number of times of erasing is reduced, which is also advantageous in that the stress on the memory cells of the EEPROM is reduced and the life is extended. Furthermore, in the case of flash microcomputers, even if some data has been rewritten, data has been rewritten in the entire memory area, including other data that does not need to be rewritten. As a result, data loading and data writing However, in the present invention, since data can be written in one storage area unit,
Work can be completed in a short time. Also, since the data in each storage area is erased collectively as described above,
The time spent for erasing is reduced, and work can be performed efficiently in this regard.

【0010】[0010]

【発明の実施の形態】次に本発明の実施の形態例につい
て図面を参照して説明する。図1は本発明によるマイク
ロコンピュータのメモリ書き換え装置の一例を含むフラ
ッシュマイコンを示すブロック図、図2は図1のフラッ
シュマイコンを構成するアドレス制御回路を詳しく示す
ブロック図、図3は図2のアドレス制御回路を構成する
アドレス変換回路を詳しく示す回路図、図4は図1のフ
ラッシュマイコンの動作を示すフローチャートである。
以下では、これらの図面を参照して本発明のマイクロコ
ンピュータのメモリ書き換え装置の一例について説明
し、同時に本発明のマイクロコンピュータのメモリ書き
換え方法の実施の形態例について説明する。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing a flash microcomputer including an example of a memory rewriting device of a microcomputer according to the present invention. FIG. 2 is a block diagram showing an address control circuit constituting the flash microcomputer of FIG. 1 in detail. FIG. 4 is a circuit diagram showing in detail the address conversion circuit constituting the control circuit, and FIG. 4 is a flowchart showing the operation of the flash microcomputer of FIG.
Hereinafter, an example of a memory rewriting device for a microcomputer according to the present invention will be described with reference to these drawings, and at the same time, an embodiment of a memory rewriting method for a microcomputer according to the present invention will be described.

【0011】図1に示したフラッシュマイコン2は、単
一の半導体チップにより構成され、CPU4、フラツシ
ュEEPROM6、メモリ制御回路8、アドレス制御回
路10などを含み、EEPROM6が保持する比較的少
量のデータを長期間にわたって頻繁に変更するような用
途に適した構成となっている。
The flash microcomputer 2 shown in FIG. 1 is composed of a single semiconductor chip, includes a CPU 4, a flash EEPROM 6, a memory control circuit 8, an address control circuit 10, and the like, and stores a relatively small amount of data held by the EEPROM 6. The configuration is suitable for applications that frequently change over a long period of time.

【0012】CPU4がアドレス/データバス12を通
じて出力したアドレスデータ(単にアドレスともいう)
はアドレスラッチ14に保持されアドレス制御回路10
を通じてEEPROM6に供給され、メモリ制御回路8
の制御のもとでEEPROM6に対するデータの書き込
み、あるいはEEPROM6からのデータの読み出しが
行われる。また、その際、CPU4が出力したデータは
ライトバッファ16を通じてEEPROM6に供給さ
れ、一方、EEPROM6から読み出されたデータはリ
ードバッファ18を通じてアドレス/データバス12に
出力される。
Address data output by the CPU 4 through the address / data bus 12 (also referred to simply as an address)
Are held in the address latch 14 and are stored in the address control circuit 10
Supplied to the EEPROM 6 through the memory control circuit 8
Under this control, data writing to the EEPROM 6 or data reading from the EEPROM 6 is performed. At this time, the data output by the CPU 4 is supplied to the EEPROM 6 through the write buffer 16, while the data read from the EEPROM 6 is output to the address / data bus 12 through the read buffer 18.

【0013】EEPROM6の記憶領域は、メモリブロ
ック20および第1ないし第4のメモリブロック22、
24、26、28に分割され、第1ないし第4のメモリ
ブロック22、24、26、28においてデータの書き
換えが行われる。アドレス制御回路10は、図2に示し
たように、カウンタ30、アドレス変換回路32、なら
びにアドレスデコーダ34を含んで構成されている。カ
ウンタ30は、メモリ制御回路8がEEPROM6への
データの一括書き込みを行う回数を計数し、フラッシュ
マイコン2の電源がオフの状態でも不揮発的に計数値を
保持する。アドレス変換回路32は、EEPROM6に
供給されるアドレスデータを、カウンタ30が保持する
計数値に応じEEPROM6の第1ないし第4のメモリ
ブロック22、24、26、28をアクセスするアドレ
スデータに変換してEEPROM6に供給する。具体的
には、アドレス変換回路32は、図3に示したように、
複数の論理回路から成る一種の加算回路となっており、
本実施の形態例では、アドレスデータの上位ビットにカ
ウンタ30の計数値を加算する。
The storage area of the EEPROM 6 includes a memory block 20 and first to fourth memory blocks 22,
Data is rewritten in the first to fourth memory blocks 22, 24, 26, and 28. The address control circuit 10 includes a counter 30, an address conversion circuit 32, and an address decoder 34, as shown in FIG. The counter 30 counts the number of times the memory control circuit 8 performs batch writing of data to the EEPROM 6 and holds the count value in a nonvolatile manner even when the power of the flash microcomputer 2 is off. The address conversion circuit 32 converts the address data supplied to the EEPROM 6 into address data for accessing the first to fourth memory blocks 22, 24, 26, 28 of the EEPROM 6 according to the count value held by the counter 30. The data is supplied to the EEPROM 6. Specifically, the address conversion circuit 32, as shown in FIG.
It is a kind of addition circuit composed of multiple logic circuits,
In the present embodiment, the count value of the counter 30 is added to the upper bits of the address data.

【0014】また、カウンタ30は本実施の形態例では
2ビットのカウンタであり、その計数値の最大値は3で
あって、EEPROM6に4回目の書き込みが行われる
とき、計数値は0になる。このときメモリ制御回路8
は、EEPROM6の第1ないし第4のメモリブロック
22、24、26、28に記憶されているデータを一括
消去する。
The counter 30 is a 2-bit counter in the present embodiment, and its maximum value is three. When the fourth writing is performed on the EEPROM 6, the counter value becomes zero. . At this time, the memory control circuit 8
Erases data stored in the first to fourth memory blocks 22, 24, 26, and 28 of the EEPROM 6 collectively.

【0015】アドレスデコーダ34は、従来から行われ
ているように、CPU4から供給されたアドレスを、実
際のEEPROM6でアクセス可能なアドレスに変換す
るためのものである。なお、本発明のメモリ書き換え装
置は、本例では、主にアドレス制御回路10、メモリ制
御回路8、ならびにアドレスラッチ14により構成され
ている。
The address decoder 34 converts an address supplied from the CPU 4 into an address accessible by the actual EEPROM 6 as conventionally performed. The memory rewriting device of the present invention mainly includes an address control circuit 10, a memory control circuit 8, and an address latch 14 in this example.

【0016】次に、このように構成されたフラッシュマ
イコンの動作について説明する。図5は、EEPROM
6においてデータの書き込みに使用されるメモリブロッ
クの変化を示す説明図である。以下では、この図面、お
よび図4のフローチャートをも適宜参照する。ここで
は、第1ないし第4のメモリブロック22、24、2
6、28の大きさは400Hバイト(Hは16進数であ
ることことを示している)であるとし、図5のもとのメ
モリマップAに示したように、第1ないし第4のメモリ
ブロック22、24、26、28はそれぞれアドレスF
000H〜F3FFH、F400H〜F7FFH、F8
00H〜BFFFH、FC00H〜FFFFHの各記憶
領域となっている。なお、メモリブロック20は000
0H〜F000Hの範囲となっている。
Next, the operation of the flash microcomputer configured as described above will be described. Figure 5 shows an EEPROM
FIG. 6 is an explanatory diagram showing changes in memory blocks used for writing data in FIG. Hereinafter, this drawing and the flowchart of FIG. 4 will be referred to as appropriate. Here, the first to fourth memory blocks 22, 24, 2
Assume that the size of each of the memory blocks 6 and 28 is 400H bytes (H indicates a hexadecimal number), and as shown in the original memory map A of FIG. 22, 24, 26, and 28 are addresses F
000H to F3FFH, F400H to F7FFH, F8
The storage areas are 00H to BFFFH and FC00H to FFFFH. Note that the memory block 20 has 000
The range is from 0H to F000H.

【0017】本実施の形態例では、最初、データは第1
のメモリブロック22に書き込まれており、1回目のデ
ータの書き換えを行うときは第2のメモリブロック24
にデータが書き込まれる。以降、2回目、3回目の書き
換えではそれぞれ第3、第4のメモリブロック26、2
8にデータが書き込まれる。
In this embodiment, first, the data is first data.
Of the second memory block 24 when the first data rewriting is performed.
Data is written to Thereafter, in the second and third rewrites, the third and fourth memory blocks 26, 2
8 is written.

【0018】図4に示したように、カウンタ30の計数
値が初期値である0の状態で、メモリ制御回路8が、C
PU4の制御のもとでEEPROM6に対してデータの
書き換えを行うとき、カウンタ30は計数値に1を加算
し(ステップA1)、計数値は1となる。このときメモ
リ制御回路8はカウンタ30の計数値が0か否かを調べ
(ステップA2)、この場合には0ではないので、メモ
リ制御回路8はCPU4にその旨を通知するとともにデ
ータ書き換えの制御に移る。
As shown in FIG. 4, when the count value of the counter 30 is 0, which is the initial value, the memory control circuit 8
When rewriting data in the EEPROM 6 under the control of the PU 4, the counter 30 adds 1 to the count value (step A1), and the count value becomes 1. At this time, the memory control circuit 8 checks whether or not the count value of the counter 30 is 0 (step A2). In this case, the memory control circuit 8 notifies the CPU 4 of the fact and does not control the data rewriting. Move on to

【0019】そして、CPU4はまず書き込みアドレス
をアドレスラッチ14に保持させ(ステップA5)、さ
らに書き込むべきデータをライトバッファ16を通じて
EEPROM6に供給する(ステップA6)。アドレス
ラッチ14が保持したアドレスはアドレス制御回路10
で変換された後、EEPROM6に供給され、その状態
でメモリ制御回路8は書き込みをEEPROM6に指示
してデータの書き込みを行わせる(ステップA7)。メ
モリ制御回路8はその後、リードバッファ18を通じて
書き込まれたデータを取得し、書き込みが正常に行われ
たか否かを判定する(ステップA8)。
The CPU 4 first causes the address latch 14 to hold the write address (step A5), and supplies data to be written to the EEPROM 6 through the write buffer 16 (step A6). The address held by the address latch 14 is the address control circuit 10
Is supplied to the EEPROM 6, and in this state, the memory control circuit 8 instructs the EEPROM 6 to perform the writing (step A7). Thereafter, the memory control circuit 8 acquires the written data through the read buffer 18, and determines whether or not the writing has been normally performed (Step A8).

【0020】この判定結果がノーの場合は、メモリ制御
回路8はステップA7に戻って再書き込みを行い、ステ
ップA8における判定結果がイエスとなったところでス
テップA9に進む。ここで1つのメモリブロックにおけ
るすべてのデータの書き込みを終了したか否かを判定
し、判定結果がノーの場合はステップA5に戻って次の
データの書き込みを行い、ステップA9で判定結果がイ
エスとなるまで、書き込み動作を繰り返す。
If the result of the determination is negative, the memory control circuit 8 returns to step A7 to perform rewriting, and proceeds to step A9 when the result of the determination in step A8 is YES. Here, it is determined whether or not writing of all data in one memory block has been completed. If the determination result is no, the process returns to step A5 to write the next data, and the determination result is YES in step A9. Until the writing operation is repeated.

【0021】次に、特に本発明に深く関わるアドレス制
御回路10の動作について詳しく説明する。EEPRO
M6の容量は本実施の形態例では64KBであり、アド
レスはビット0からビット15までの16ビット(00
00HからFFFFHまで)となっている。アドレス変
換回路32はこのアドレスのビット10、ビット11
(本発明にかかわる上位ビット)に、カウンタ30の2
ビットの計数値を加算し、結果を変換後のアドレスとす
る。そして、このアドレスはアドレスデコーダ34でデ
コードされた後、EEPROM6に供給される。
Next, the operation of the address control circuit 10 particularly related to the present invention will be described in detail. EEPRO
The capacity of M6 is 64 KB in the present embodiment, and the address is 16 bits from bit 0 to bit 15 (00 bits).
00H to FFFFH). The address conversion circuit 32 calculates bit 10 and bit 11 of this address.
(Upper bits according to the present invention) include 2
The count value of the bit is added, and the result is set as the converted address. Then, this address is decoded by the address decoder 34 and then supplied to the EEPROM 6.

【0022】[表1]はカウンタ30の計数値が1の場
合(1回目のデータ書き換えの場合)における変換前と
変換後のアドレスの対応を示している。
Table 1 shows the correspondence between the addresses before and after the conversion when the count value of the counter 30 is 1 (in the case of the first data rewrite).

【0023】[0023]

【表1】 表中の4桁の数字は、左から順にアドレスのビット1
1、10、9、8の値を表している。表に示したよう
に、変換前にこれら4ビットが0000の場合は計数値
1を加算して変換後は0100となる。また、変換前が
0100のときは変換後1000となり、1000は1
100へ、1100は1000へと変換される。
[Table 1] The four digits in the table are bit 1 of the address in order from the left.
1, 10, 9, and 8 are shown. As shown in the table, when these four bits are 0000 before conversion, the count value 1 is added, and after conversion, it becomes 0100. When the value before conversion is 0100, the value after conversion is 1000, and 1000 is 1
To 100, 1100 is converted to 1000.

【0024】また、図5においてメモリマップAはアド
レス変換回路32によりアドレス変換が行われない場合
のEEPROM6のメモリマップを示し、第1ないし第
4のメモリブロック22、24、26、28が上述した
ようなアドレスに割り当てられている。これに対して
[表1]に示したような変換が行われると、上記ビット
11からビット8までの4ビットがたとえば0000の
場合、変換後は0100となるため、CPU4が出力す
るF000HからF3FFHの範囲のアドレスは、F4
00HからF7FFHの範囲のアドレスに変換される。
これは第2のメモリブロック24のアドレス範囲である
から、CPU4が第1のメモリブロック22のデータを
書き換えるべくアドレスのビット9〜ビット0(本発明
にかかわる下位側のビット)を変化させて0F000H
からF3FFHの範囲のアドレスを出力すると、データ
は第2のメモリブロック24に書き込まれることにな
る。
In FIG. 5, a memory map A shows a memory map of the EEPROM 6 when the address conversion is not performed by the address conversion circuit 32. The first to fourth memory blocks 22, 24, 26, and 28 are described above. Are assigned to such addresses. On the other hand, when the conversion shown in [Table 1] is performed, if the four bits from bit 11 to bit 8 are 0000, for example, it becomes 0100 after the conversion, so that F000H to F3FFH output from CPU 4 The address in the range is F4
It is converted to an address in the range from 00H to F7FFH.
Since this is the address range of the second memory block 24, the CPU 4 changes bits 9 to 0 (lower-order bits according to the present invention) of the address to rewrite the data of the first memory block 22 to 0F000H.
When an address in the range from F3FFH to is output, data is written to the second memory block 24.

【0025】したがって、メモリ制御回路8は第1のメ
モリブロック22の消去を行う必要はなく、また、CP
U4にこのような書き込み動作を行わせるプログラム
は、第2のメモリブロック24にデータを書き込むよう
にアドレスを制御したりする必要はいっさいない。図5
に示したメモリマップBは、この1回目の書き換え時の
等価的なメモリマップを示しており、第2ないし第4の
メモリブロック24、26、28はそれぞれ1メモリブ
ロック分、アドレスの下位側に等価的にシフトしてい
る。
Therefore, it is not necessary for the memory control circuit 8 to erase the first memory block 22.
The program that causes U4 to perform such a write operation does not need to control the address so that data is written to the second memory block 24. FIG.
2 shows an equivalent memory map at the time of the first rewriting, and the second to fourth memory blocks 24, 26, and 28 each correspond to one memory block and are located at the lower side of the address. It is equivalently shifted.

【0026】[表2]はカウンタ30の計数値が2の場
合、すなわち2回目のデータ書き換えの場合における変
換前と変換後のアドレスの対応を示している。
Table 2 shows the correspondence between addresses before and after the conversion when the count value of the counter 30 is 2, that is, in the case of the second data rewriting.

【0027】[0027]

【表2】 表中の4桁の数字は、左から順にアドレスのビット1
1、10、9、8の値を表している。表に示したよう
に、変換前これら4ビットが0000の場合は計数値2
を加算して変換後は1000となる。また、変換前が0
100のときは変換後1100となり、1000は00
00へ、1100は0100へと変換される。
[Table 2] The four digits in the table are bit 1 of the address in order from the left.
1, 10, 9, and 8 are shown. As shown in the table, when these 4 bits are 0000 before conversion, the count value 2
Is converted to 1000 after conversion. Also, 0 before conversion
When it is 100, it becomes 1100 after conversion, and 1000 becomes 00
To 00, 1100 is converted to 0100.

【0028】[表2]に示したような変換が行われる
と、上記ビット11からビット8までの4ビットがたと
えば0000の場合、変換後は1000となるため、C
PU4が出力するF000HからF3FFHの範囲のア
ドレスは、F800HからFBFFHの範囲のアドレス
に変換される。これはメモリマップAに示した第3のメ
モリブロック26のアドレス範囲であるから、CPU4
が第1のメモリブロック22のデータを書き換えるべく
F000HからF3FFHの範囲のアドレスを出力する
と、データは第3のメモリブロック26に書き込まれる
ことになる。したがって、メモリ制御回路8は第1や第
2のメモリブロック24の消去を行う必要はなく、ま
た、CPU4にこのような書き込み動作を行わせるプロ
グラムは、第3のメモリブロック26にデータを書き込
むようにアドレスを制御したりする必要はいっさいな
い。図5に示したメモリマップCは、この2回目の書き
換え時の等価的なメモリマップを示しており、第3、第
4のメモリブロック26、28はそれぞれさらに1メモ
リブロック分、アドレスの下位側に等価的にシフトして
いる。
When the conversion as shown in [Table 2] is performed, if the four bits from bit 11 to bit 8 are 0000, for example, it becomes 1000 after the conversion.
The addresses in the range from F000H to F3FFH output by PU4 are converted to addresses in the range from F800H to FBFFH. Since this is the address range of the third memory block 26 shown in the memory map A, the CPU 4
Outputs an address in the range from F000H to F3FFH in order to rewrite the data in the first memory block 22, the data is written to the third memory block 26. Therefore, the memory control circuit 8 does not need to erase the first and second memory blocks 24, and the program that causes the CPU 4 to perform such a write operation should write data to the third memory block 26. You don't need to control the address at all. The memory map C shown in FIG. 5 shows an equivalent memory map at the time of the second rewriting, and the third and fourth memory blocks 26 and 28 are each one more memory block and the lower side of the address. Is equivalently shifted to

【0029】[表3]はカウンタ30の計数値が3の場
合、すなわち3回目のデータ書き換えの場合における変
換前と変換後のアドレスの対応を示している。
Table 3 shows the correspondence between the addresses before and after the conversion when the count value of the counter 30 is 3, that is, in the case of the third data rewriting.

【0030】[0030]

【表3】 表中の4桁の数字は、左から順にアドレスのビット1
1、10、9、8の値を表している。表に示したよう
に、変換前これら4ビットが0000の場合は計数値2
を加算して変換後は1100となる。また、変換前が0
100のときは変換後0000となり、1000は01
00へ、1100は1000へと変換される。
[Table 3] The four digits in the table are bit 1 of the address in order from the left.
1, 10, 9, and 8 are shown. As shown in the table, when these 4 bits are 0000 before conversion, the count value 2
Is converted to 1100. Also, 0 before conversion
When it is 100, it becomes 0000 after conversion, and 1000 becomes 01
To 00, 1100 is converted to 1000.

【0031】[表3]に示したような変換が行われる
と、上記ビット11からビット8までの4ビットがたと
えば0000の場合、変換後は1100となるため、C
PU4が出力するF000HからF3FFHの範囲のア
ドレスは、FC00HからFFFFHの範囲のアドレス
に変換される。これはメモリマップAに示した第4のメ
モリブロック28のアドレス範囲であるから、CPU4
が第1のメモリブロック22のデータを書き換えるべく
F000HからF3FFHの範囲のアドレスを出力する
と、データは第4のメモリブロック28に書き込まれる
ことになる。
When the conversion as shown in Table 3 is performed, if the four bits from bit 11 to bit 8 are 0000, for example, it becomes 1100 after the conversion.
Addresses in the range from F000H to F3FFH output by PU4 are converted to addresses in the range from FC00H to FFFFH. Since this is the address range of the fourth memory block 28 shown in the memory map A,
Outputs an address in the range from F000H to F3FFH in order to rewrite the data in the first memory block 22, the data is written to the fourth memory block.

【0032】したがって、メモリ制御回路8は第1ない
し第3のメモリブロック22、24、26の消去を行う
必要はなく、また、CPU4にこのような書き込み動作
を行わせるプログラムは、第4のメモリブロック28に
データを書き込むようにアドレスを制御したりする必要
はいっさいない。図5に示したメモリマップDは、この
3回目の書き換え時の等価的なメモリマップを示してお
り、第4のメモリブロック28はさらに1メモリブロッ
ク分、アドレスの下位側に等価的にシフトしている。
Therefore, it is not necessary for the memory control circuit 8 to erase the first to third memory blocks 22, 24, and 26, and the program for causing the CPU 4 to perform such a write operation is stored in the fourth memory block. There is no need to control the address to write data to block 28. The memory map D shown in FIG. 5 shows an equivalent memory map at the time of the third rewriting, and the fourth memory block 28 is further equivalently shifted by one memory block to the lower side of the address. ing.

【0033】[表4]はカウンタ30の計数値が0の場
合、すなわち4回目のデータ書き換えの場合における変
換前と変換後のアドレスの対応を示している。
Table 4 shows the correspondence between the addresses before and after the conversion when the count value of the counter 30 is 0, that is, in the case of the fourth data rewriting.

【0034】[0034]

【表4】 この場合には計数値が0であるから変換前と変換後とで
アドレスは変化しない。したがって、この場合のメモリ
マップはもとのメモリマップAとなり、CPU4が出力
したアドレスはそのままアドレス変換回路32から出力
されることになる。
[Table 4] In this case, since the count value is 0, the address does not change between before and after the conversion. Therefore, the memory map in this case becomes the original memory map A, and the address output by the CPU 4 is output from the address conversion circuit 32 as it is.

【0035】この場合には、図4のフローチャートのス
テップA2において判定結果がイエスとなるため、メモ
リ制御回路8は第1ないし第4のメモリブロック22、
24、26、28全体を一括して消去し(ステップA
3)、正しく消去されたか否かを判定し(ステップA
4)、結果が否なら再度消去を行い(ステップA3)、
結果が正なら、データの書き込みを行うべくステップA
5に進む。そして、CPU4が第1のメモリブロック2
2のデータを書き換えるために、F000HからF3F
FHの範囲のアドレスを出力すると、対応する第1のメ
モリブロック22にデータが書き込まれる。
In this case, since the determination result in step A2 of the flowchart of FIG. 4 is YES, the memory control circuit 8 sets the first to fourth memory blocks 22,
Erasing the whole of 24, 26 and 28 at once (step A
3) It is determined whether the data has been correctly erased (step A).
4) If the result is no, erase again (step A3),
If the result is positive, step A is performed to write data.
Go to 5. Then, the CPU 4 sets the first memory block 2
F000H to F3F
When an address in the range of FH is output, data is written to the corresponding first memory block 22.

【0036】このように本実施の形態例では、書き換え
が何回目であるかに応じてメモリブロック20が自動的
に切り換えられるので、CPU4を動作させるプログラ
ムにはメモリ管理の点でいっさい負担がかからない。し
たがってまた、プログラムにメモリ管理に関する機能を
持たせる必要がなく、プログラムの汎用性が低下するこ
ともない。そして、4つのメモリブロック20が順番に
切り換えて使用されるので、特定の記憶領域に書き換え
が集中することがなく、EEPROM6の書き換え寿命
の延長を実現できる。さらに、本実施の形態例では、4
つメモリブロック20をすべて使用した場合にのみデー
タの消去を行うので、消去の回数が少なくなり、その点
でもEEPROM6のメモリセルに対するストレスが低
減し、寿命の延長に有利である。また、フラッシュマイ
コンでは従来、一部のデータを書き換える場合でも、他
の書き換えの必要のないデータも含め、全メモリ領域で
データの書き換えを行っており、その結果、データのロ
ードと、データの書き込みに時間がかかっていたが、本
実施の形態例では、1つのメモリブロック単位でデータ
の書き込みを行うので、短時間で作業を終了することが
できる。そして、本実施の形態例では4回のデータの書
き換えごとに1回の消去動作を行うので、消去のために
費やす時間も短くなり、この点でも効率よく作業を行え
る。
As described above, in the present embodiment, since the memory block 20 is automatically switched according to the number of times of rewriting, the program for operating the CPU 4 does not have any burden in terms of memory management. . Therefore, the program does not need to have a function related to memory management, and the versatility of the program does not decrease. Since the four memory blocks 20 are switched and used in order, rewriting does not concentrate on a specific storage area, and the rewriting life of the EEPROM 6 can be extended. Further, in the present embodiment, 4
Since data is erased only when all the memory blocks 20 are used, the number of times of erasing is reduced, which also reduces stress on the memory cells of the EEPROM 6 and is advantageous in extending the life. Also, in the past, when rewriting a part of data, the flash microcomputer rewrites data in the entire memory area, including other data that does not need to be rewritten. As a result, data loading and data writing However, in this embodiment, since data is written in units of one memory block, the operation can be completed in a short time. In the present embodiment, one erasing operation is performed every four data rewrites, so that the time spent for erasing is reduced, and work can be performed efficiently in this respect as well.

【0037】なお、本実施の形態例では、上述したよう
に1回データの書き換えを行うごとに、メモリブロック
が等価的にアドレスの下位側にシフトするようにした
が、複数のメモリブロックを複数のメモリバンクとして
用意し、それらを順番に切り換えてデータを書き込む構
成とすることも可能である。また、本実施の形態例では
4つのメモリブロックを用いたが、メモリブロックの数
は2つ以上であれば、任意の数であってよく、同様の効
果を得ることができる。
In this embodiment, as described above, each time data is rewritten once, the memory block is equivalently shifted to the lower side of the address. It is also possible to adopt a configuration in which the memory banks are prepared as described above and the data are written by switching them in order. In this embodiment, four memory blocks are used, but the number of memory blocks may be any number as long as it is two or more, and the same effect can be obtained.

【0038】次に、第2の実施の形態例について説明す
る。第2の実施の形態例は上記図1に示したフラッシュ
マイコンと同じ構成であるが、アドレス制御回路10を
構成するカウンタ30(図2)が、メモリ制御回路8の
制御のもとで、1回のデータ書き換えごとに2づつ値が
増加する点で異なっている。したがって、[表5]に示
したように、1回目の書き換えでは、カウンタ30の計
数値として2がビット11、10に加算され、変換前の
ビット11、10、9、8がたとえば0000なら変換
後は1000となり、変換前の0100、1000、1
100はそれぞれ1100、0000、0100とな
る。
Next, a second embodiment will be described. The second embodiment has the same configuration as that of the flash microcomputer shown in FIG. 1, but the counter 30 (FIG. 2) constituting the address control circuit 10 The difference is that the value increases by two each time data is rewritten. Therefore, as shown in [Table 5], in the first rewriting, 2 is added to the bits 11 and 10 as the count value of the counter 30, and if the bits 11, 10, 9, and 8 before conversion are 0000, for example, the conversion is performed. After that, it becomes 1000, and before conversion 0100, 1000, 1
100 becomes 1100, 0000, and 0100, respectively.

【0039】[0039]

【表5】 その結果、上記図5に相当する図6の説明図において、
書き換えが一度も行われていない場合のメモリマップE
で、アドレスのF800HからFFFFHに割り当てら
れていた第3および第4のメモリブロック26、28
は、メモリマップEに示したように、等価的に2つのメ
モリブロック分だけアドレスの下位側にシフトする。し
たがって、CPU4が第1および第2のメモリブロック
22、24にデータを書き込むべく出力したアドレス
は、第3および第4のメモリブロック26、28をアク
セスするアドレスに変換され、EEPROM6に供給さ
れ、第3および第4のメモリブロック26、28にデー
タが書き込まれる。
[Table 5] As a result, in the explanatory diagram of FIG. 6 corresponding to FIG.
Memory map E when rewriting has never been performed
And the third and fourth memory blocks 26 and 28 assigned to the addresses F800H to FFFFH.
Is equivalently shifted to the lower side of the address by two memory blocks as shown in the memory map E. Therefore, an address output by the CPU 4 to write data into the first and second memory blocks 22 and 24 is converted into an address for accessing the third and fourth memory blocks 26 and 28, supplied to the EEPROM 6, and Data is written to the third and fourth memory blocks 26, 28.

【0040】また、2回目のデータ書き換えでは、カウ
ンタの計数値は0に戻るため、CPUが第1および第2
のメモリブロック22、24にデータを書き込むべく出
力したアドレスは、そのまま第1および第2のメモリブ
ロック22、24をアクセスするアドレスとしてEEP
ROM6に供給される([表6]参照)。
Also, in the second data rewriting, the count value of the counter returns to 0, so that the CPU
The address output to write data to the memory blocks 22 and 24 of the EEP is used as an address for accessing the first and second memory blocks 22 and 24 as it is.
It is supplied to the ROM 6 (see [Table 6]).

【0041】[0041]

【表6】 ただし、この場合には、カウンタの計数値が0であるこ
とから、上記実施の形態例の場合と同様、EEPROM
6においてデータの消去が行われる(図4のステップA
3)。その結果、第2の実施の形態例では、上記実施の
形態例と同様の効果が得られることに加えて、カウンタ
の計数値が2ずつ大きくなるため、上記実施の形態例の
場合と異なり、2つのメモリブロックを1回の書き換え
で用いることができ、書き換えデータ量がより多い場合
にも対応可能となる。
[Table 6] However, in this case, since the count value of the counter is 0, as in the case of the above-described embodiment, the EEPROM is used.
6, the data is erased (step A in FIG. 4).
3). As a result, in the second embodiment, in addition to obtaining the same effect as the above-described embodiment, the count value of the counter increases by two, and therefore, unlike the above-described embodiment, Two memory blocks can be used in one rewrite, and it is possible to cope with a case where the rewrite data amount is larger.

【0042】[0042]

【発明の効果】以上説明したように本発明では、メモリ
制御回路によりEEPROMへのデータの一括書き込み
が行われる回数を計数して計数値を不揮発的に保持し、
EEPROMに供給されるアドレスデータを、上記保持
した計数値に応じEEPROMの異なる記憶領域のアド
レスデータに変換してEEPROMに供給する。そのた
め、記憶領域を順番に切り換えて使用でき、特定の記憶
領域に書き換えが集中することがなく、EEPROMの
書き換え寿命の延長を実現できる。そして、このように
記憶領域を切り換えても、マイクロコンピュータを構成
するCPUを動作させるプログラムにはメモリ管理の点
でいっさい負担がかからない。したがってまた、プログ
ラムにメモリ管理に関する機能を持たせる必要がなく、
プログラムの汎用性が低下することもない。
As described above, according to the present invention, the number of times data is written to the EEPROM at once by the memory control circuit is counted, and the count value is held in a nonvolatile manner.
The address data supplied to the EEPROM is converted into address data in a different storage area of the EEPROM in accordance with the held count value and supplied to the EEPROM. Therefore, the storage areas can be switched and used in order, and rewriting is not concentrated on a specific storage area, and the rewriting life of the EEPROM can be extended. Even when the storage areas are switched in this manner, no burden is imposed on the program for operating the CPU constituting the microcomputer in terms of memory management. Therefore, it is not necessary for the program to have a function related to memory management.
The versatility of the program does not decrease.

【0043】また、本発明では、計数値が規定値に到達
したとき、EEPROMの各記憶領域に記憶されている
データを一括して消去するので、各記憶領域でデータの
書き換えを行うごとに消去する場合に比べ、消去を実行
する回数が少なくなり、その点でもEEPROMのメモ
リセルに対するストレスが低減して、寿命の延長に有利
である。さらに、フラッシュマイコンでは従来、一部の
データを書き換える場合でも、他の書き換えの必要のな
いデータも含め、全メモリ領域でデータの書き換えを行
っており、その結果、データのロードと、データの書き
込みに時間がかかっていたが、本発明では、1つの記憶
領域単位でデータの書き込みを行うことができるので、
短時間で作業を終了することができる。また、上述のよ
うに各記憶領域のデータを一括して消去することから、
消去のために費やす時間も短くなり、この点でも効率よ
く作業を行える。
Further, according to the present invention, when the count value reaches the specified value, the data stored in each storage area of the EEPROM is collectively erased. As compared with the case where the erase operation is performed, the number of times of erasing is reduced, which is also advantageous in that the stress on the memory cells of the EEPROM is reduced and the life is extended. Furthermore, in the case of flash microcomputers, even if some data has been rewritten, data has been rewritten in the entire memory area, including other data that does not need to be rewritten. As a result, data loading and data writing However, in the present invention, since data can be written in one storage area unit,
Work can be completed in a short time. Also, since the data in each storage area is erased collectively as described above,
The time spent for erasing is reduced, and work can be performed efficiently in this regard.

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

【図1】本発明によるマイクロコンピュータのメモリ書
き換え装置の一例を含むフラッシュマイコンを示すブロ
ック図である。
FIG. 1 is a block diagram showing a flash microcomputer including an example of a memory rewriting device for a microcomputer according to the present invention.

【図2】図1のフラッシュマイコンを構成するアドレス
制御回路を詳しく示すブロック図である。
FIG. 2 is a block diagram showing an address control circuit constituting the flash microcomputer of FIG. 1 in detail;

【図3】図2のアドレス制御回路を構成するアドレス変
換回路を詳しく示す回路図である。
FIG. 3 is a circuit diagram showing an address conversion circuit constituting the address control circuit of FIG. 2 in detail;

【図4】図1のフラッシュマイコンの動作を示すフロー
チャートである。
FIG. 4 is a flowchart showing an operation of the flash microcomputer of FIG. 1;

【図5】EEPROMにおいてデータの書き込みに使用
されるメモリブロックの変化を示す説明図である。
FIG. 5 is an explanatory diagram showing changes in memory blocks used for writing data in an EEPROM.

【図6】第2の実施の形態例で、EEPROMにおいて
データの書き込みに使用されるメモリブロックの変化を
示す説明図である。
FIG. 6 is an explanatory diagram showing a change in a memory block used for writing data in an EEPROM in the second embodiment.

【図7】従来技術を適用して構成したフラッシュマイコ
ンの一例を示すブロック図である。
FIG. 7 is a block diagram illustrating an example of a flash microcomputer configured by applying the related art.

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

2……フラッシュマイコン、4……CPU、6……EE
PROM、8……メモリ制御回路、10……アドレス制
御回路、12……アドレス/データバス、14……アド
レスラッチ、16……ライトバッファ、18……リード
バッファ、20……メモリブロック、22……第1のメ
モリブロック、24……第2のメモリブロック、26…
…第3のメモリブロック、28……第4のメモリブロッ
ク、30……カウンタ、32……アドレス変換回路、3
4……アドレスデコーダ、102……フラッシュマイコ
ン、104……CPU、106……EEPROM、10
8……アドレス/データバス、110……アドレスラッ
チ、112……メモリ制御回路、114……ライトバッ
ファ、116……リードバッファ、118……第1のメ
モリブロック、120……第2のメモリブロック、12
2……第3のメモリブロック、124……第4のメモリ
ブロック、126……カウント領域。
2 ... Flash microcomputer, 4 ... CPU, 6 ... EE
PROM, 8 ... memory control circuit, 10 ... address control circuit, 12 ... address / data bus, 14 ... address latch, 16 ... write buffer, 18 ... read buffer, 20 ... memory block, 22 ... ... first memory block, 24 ... second memory block, 26 ...
... Third memory block, 28... Fourth memory block, 30... Counter, 32.
4 ... Address decoder, 102 ... Flash microcomputer, 104 ... CPU, 106 ... EEPROM, 10
8 ... address / data bus, 110 ... address latch, 112 ... memory control circuit, 114 ... write buffer, 116 ... read buffer, 118 ... first memory block, 120 ... second memory block , 12
2... Third memory block, 124... Fourth memory block, 126.

─────────────────────────────────────────────────────
────────────────────────────────────────────────── ───

【手続補正書】[Procedure amendment]

【提出日】平成12年1月31日(2000.1.3
1)
[Submission date] January 31, 2000 (200.1.3
1)

【手続補正1】[Procedure amendment 1]

【補正対象書類名】明細書[Document name to be amended] Statement

【補正対象項目名】特許請求の範囲[Correction target item name] Claims

【補正方法】変更[Correction method] Change

【補正内容】[Correction contents]

【特許請求の範囲】[Claims]

【手続補正2】[Procedure amendment 2]

【補正対象書類名】明細書[Document name to be amended] Statement

【補正対象項目名】0006[Correction target item name] 0006

【補正方法】変更[Correction method] Change

【補正内容】[Correction contents]

【0006】[0006]

【課題を解決するための手段】本発明は、上記目的を達
成するため、フラツシュEEPROMと、前記EEPR
OMへのデータの書き込みおよび消去を制御するメモリ
制御回とを内蔵したマイクロコンピュータに設けられ、
メモリ制御回路の制御のもとで前記EEPROMが保持
するデータを書き換える装置であって、前記メモリ制御
回路が前記EEPROMへのデータの一括書き込みを行
う回数を計数し、計数値を不揮発的に保持するカウンタ
と、前記EEPROMに供給されるアドレスデータを、
前記カウンタが保持する前記計数値に応じて前記EEP
ROMの異なる記憶領域のアドレスデータに変換し前記
EEPROMに供給するアドレス変換回路とを備え、前
記メモリ制御回路は前記カウンタの前記計数値が規定値
に到達したとき、前記EEPROMの各記憶領域に記憶
されているデータを一時に一括消去することを特徴とす
る。
SUMMARY OF THE INVENTION In order to achieve the above object, the present invention provides a flash EEPROM and the EEPROM.
A microcomputer having a memory control circuit for controlling writing and erasing of data to and from the OM;
An apparatus for rewriting data held in an EEPROM under the control of a memory control circuit, wherein the memory control circuit counts the number of times of batch writing of data to the EEPROM, and holds the count value in a nonvolatile manner. A counter and address data supplied to the EEPROM,
The EEP according to the count value held by the counter
An address conversion circuit that converts the data into address data in different storage areas of the ROM and supplies the data to the EEPROM, wherein the memory control circuit stores the data in each storage area of the EEPROM when the count value of the counter reaches a specified value. Data is erased at one time.

【手続補正3】[Procedure amendment 3]

【補正対象書類名】明細書[Document name to be amended] Statement

【補正対象項目名】0007[Correction target item name] 0007

【補正方法】変更[Correction method] Change

【補正内容】[Correction contents]

【0007】また、本発明は、フラツシュEEPROM
と、前記EEPROMへのデータの書き込みおよび消去
を制御するメモリ制御回とを内蔵したマイクロコンピュ
ータで、前記EEPROMが保持するデータを書き換え
る方法であって、前記メモリ制御回路により前記EEP
ROMへのデータの一括書き込みが行われる回数を計数
して計数値を不揮発的に保持し、前記EEPROMに供
給されるアドレスデータを、保持した前記計数値に応じ
前記EEPROMの異なる記憶領域のアドレスデータに
変換して前記EEPROMに供給し、前記計数値が規定
値に到達したとき、前記EEPROMの各記憶領域に記
憶されているデータを一時に一括消去することを特徴と
する。
Further, the present invention relates to a flash EEPROM.
And a memory control circuit for controlling writing and erasing of data to and from the EEPROM, wherein the data stored in the EEPROM is rewritten by the microcomputer.
Counting the number of times of batch writing of data to the ROM, holding the count value in a nonvolatile manner, and changing the address data supplied to the EEPROM to address data in different storage areas of the EEPROM according to the held count value. And the data is supplied to the EEPROM, and when the count value reaches a specified value, the data stored in each storage area of the EEPROM is collectively erased at a time.

【手続補正4】[Procedure amendment 4]

【補正対象書類名】明細書[Document name to be amended] Statement

【補正対象項目名】0009[Correction target item name] 0009

【補正方法】変更[Correction method] Change

【補正内容】[Correction contents]

【0009】また、本発明では、計数値が規定値に到達
したとき、EEPROMの各記憶領域に記憶されている
データを一時に一括して消去するので、各記憶領域でデ
ータの書き換えを行うごとに消去する場合に比べ、消去
を実行する回数が少なくなり、その点でもEEPROM
のメモリセルに対するストレスが低減して、寿命の延長
に有利である。さらに、フラッシュマイコンでは従来、
一部のデータを書き換える場合でも、他の書き換えの必
要のないデータも含め、全メモリ領域でデータの書き換
えを行っており、その結果、データのロードと、データ
の書き込みに時間がかかっていたが、本発明では、1つ
の記憶領域単位でデータの書き込みを行うことができる
ので、短時間で作業を終了することができる。また、上
述のように各記憶領域のデータを一時に一括して消去す
ることから、消去のために費やす時間も短くなり、この
点でも効率よく作業を行える。
Further, according to the present invention, when the count value reaches a specified value, data stored in each storage area of the EEPROM is erased at once, so that each time data is rewritten in each storage area. The number of times that erasing is performed is smaller than in the case of
Stress on the memory cell is reduced, which is advantageous in extending the life. In addition, with flash microcomputers,
Even when rewriting part of the data, the data was rewritten in all memory areas, including other data that did not need to be rewritten.As a result, it took time to load and write the data. According to the present invention, since data can be written in units of one storage area, the work can be completed in a short time. In addition, since the data in each storage area is collectively erased at a time as described above, the time spent for erasing is reduced, and work can be performed efficiently in this respect as well.

【手続補正5】[Procedure amendment 5]

【補正対象書類名】明細書[Document name to be amended] Statement

【補正対象項目名】0028[Correction target item name] 0028

【補正方法】変更[Correction method] Change

【補正内容】[Correction contents]

【0028】[表2]に示したような変換が行われる
と、上記ビット11からビット8までの4ビットがたと
えば0000の場合、変換後は1000となるため、C
PU4が出力するF000HからF3FFHの範囲のア
ドレスは、F800HからFBFFHの範囲のアドレス
に変換される。これはメモリマップAに示した第3のメ
モリブロック26のアドレス範囲であるから、CPU4
が第1のメモリブロック22のデータを書き換えるべく
F000HからF3FFHの範囲のアドレスを出力する
と、データは第3のメモリブロック26に書き込まれる
ことになる。したがって、メモリ制御回路8は第1や第
2のメモリブロック22、24の消去を行う必要はな
く、また、CPU4にこのような書き込み動作を行わせ
るプログラムは、第3のメモリブロック26にデータを
書き込むようにアドレスを制御したりする必要はいっさ
いない。図5に示したメモリマップCは、この2回目の
書き換え時の等価的なメモリマップを示しており、第
3、第4のメモリブロック26、28はそれぞれさらに
1メモリブロック分、アドレスの下位側に等価的にシフ
トしている。
When the conversion as shown in [Table 2] is performed, if the four bits from bit 11 to bit 8 are 0000, for example, it becomes 1000 after the conversion.
The addresses in the range from F000H to F3FFH output by PU4 are converted to addresses in the range from F800H to FBFFH. Since this is the address range of the third memory block 26 shown in the memory map A, the CPU 4
Outputs an address in the range from F000H to F3FFH in order to rewrite the data in the first memory block 22, the data is written to the third memory block 26. Therefore, the memory control circuit 8 does not need to erase the first and second memory blocks 22 and 24, and the program that causes the CPU 4 to perform such a write operation stores data in the third memory block 26. There is no need to control the address to write. The memory map C shown in FIG. 5 shows an equivalent memory map at the time of the second rewriting, and the third and fourth memory blocks 26 and 28 are each one more memory block and the lower side of the address. Is equivalently shifted to

【手続補正6】[Procedure amendment 6]

【補正対象書類名】明細書[Document name to be amended] Statement

【補正対象項目名】0043[Correction target item name] 0043

【補正方法】変更[Correction method] Change

【補正内容】[Correction contents]

【0043】また、本発明では、計数値が規定値に到達
したとき、EEPROMの各記憶領域に記憶されている
データを一時に一括して消去するので、各記憶領域でデ
ータの書き換えを行うごとに消去する場合に比べ、消去
を実行する回数が少なくなり、その点でもEEPROM
のメモリセルに対するストレスが低減して、寿命の延長
に有利である。さらに、フラッシュマイコンでは従来、
一部のデータを書き換える場合でも、他の書き換えの必
要のないデータも含め、全メモリ領域でデータの書き換
えを行っており、その結果、データのロードと、データ
の書き込みに時間がかかっていたが、本発明では、1つ
の記憶領域単位でデータの書き込みを行うことができる
ので、短時間で作業を終了することができる。また、上
述のように各記憶領域のデータを一時に一括して消去す
ることから、消去のために費やす時間も短くなり、この
点でも効率よく作業を行える。
According to the present invention, when the count value reaches the specified value, the data stored in each storage area of the EEPROM is erased at once, so that each time the data is rewritten in each storage area. The number of times that erasing is performed is smaller than in the case of
Stress on the memory cell is reduced, which is advantageous in extending the life. In addition, with flash microcomputers,
Even when rewriting part of the data, the data was rewritten in all memory areas, including other data that did not need to be rewritten.As a result, it took time to load and write the data. According to the present invention, since data can be written in units of one storage area, the work can be completed in a short time. In addition, since the data in each storage area is collectively erased at a time as described above, the time spent for erasing is reduced, and work can be performed efficiently in this respect as well.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 桑原 孝 神奈川県川崎市中原区小杉町一丁目403番 53 日本電気アイシーマイコンシステム株 式会社内 Fターム(参考) 5B025 AA00 AB00 AC00 AD01 AD04 AD08 AE01 AE05 AE08 5B062 AA10 CC03 DD06 DD10 JJ10 ────────────────────────────────────────────────── ─── Continuing on the front page (72) Inventor Takashi Kuwahara 1-403, Kosugicho, Nakahara-ku, Kawasaki-shi, Kanagawa 53 F-term within NEC Icy Microcomputer Systems Co., Ltd. 5B025 AA00 AB00 AC00 AD01 AD04 AD08 AE01 AE05 AE08 5B062 AA10 CC03 DD06 DD10 JJ10

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】 フラツシュEEPROMと、前記EEP
ROMへのデータの書き込みおよび消去を制御するメモ
リ制御回とを内蔵したマイクロコンピュータに設けら
れ、メモリ制御回路の制御のもとで前記EEPROMが
保持するデータを書き換える装置であって、 前記メモリ制御回路が前記EEPROMへのデータの一
括書き込みを行う回数を計数し、計数値を不揮発的に保
持するカウンタと、 前記EEPROMに供給されるアドレスデータを、前記
カウンタが保持する前記計数値に応じて前記EEPRO
Mの異なる記憶領域のアドレスデータに変換し前記EE
PROMに供給するアドレス変換回路とを備え、 前記メモリ制御回路は前記カウンタの前記計数値が規定
値に到達したとき、前記EEPROMの各記憶領域に記
憶されているデータを一括消去することを特徴とするマ
イクロコンピュータのメモリ書き換え装置。
A flash EEPROM; and said EEPROM.
An apparatus provided in a microcomputer having a memory control circuit for controlling writing and erasing of data in a ROM and rewriting data stored in the EEPROM under the control of a memory control circuit. Counts the number of times that batch writing of data to the EEPROM is performed, and a counter that holds the count value in a nonvolatile manner. The address data supplied to the EEPROM is stored in the EEPROM according to the count value held by the counter.
M to address data of different storage areas,
An address conversion circuit for supplying data to a PROM, wherein the memory control circuit erases data stored in each storage area of the EEPROM at a time when the count value of the counter reaches a specified value. Memory rewriting device for microcomputer.
【請求項2】 アドレス変換回路は、前記アドレスデー
タの上位ビットを前記カウンタの前記計数値にもとづい
て変更することを特徴とする請求項1記載のマイクロコ
ンピュータのメモリ書き換え装置。
2. The memory rewriting device according to claim 1, wherein the address conversion circuit changes upper bits of the address data based on the count value of the counter.
【請求項3】 アドレス変換回路は、前記アドレスデー
タの上位ビットに前記カウンタの前記計数値を加算する
ことを特徴とする請求項2記載のマイクロコンピュータ
のメモリ書き換え装置。
3. The memory rewriting device according to claim 2, wherein the address conversion circuit adds the count value of the counter to upper bits of the address data.
【請求項4】 前記アドレスデータの前記上位ビットよ
り下位側のビットが表すアドレス範囲において、前記メ
モリ制御回路は前記EEPROMへのデータの一括書き
込みを行うことを特徴とする請求項2記載のマイクロコ
ンピュータのメモリ書き換え装置。
4. The microcomputer according to claim 2, wherein the memory control circuit performs batch writing of data to the EEPROM in an address range represented by lower bits than the upper bits of the address data. Memory rewriting device.
【請求項5】 前記マイクロコンピュータは単一の半導
体チップにより構成されていることを特徴とする請求項
1記載のマイクロコンピュータのメモリ書き換え装置。
5. The memory rewriting device according to claim 1, wherein said microcomputer comprises a single semiconductor chip.
【請求項6】 フラツシュEEPROMと、前記EEP
ROMへのデータの書き込みおよび消去を制御するメモ
リ制御回とを内蔵したマイクロコンピュータで、前記E
EPROMが保持するデータを書き換える方法であっ
て、 前記メモリ制御回路により前記EEPROMへのデータ
の一括書き込みが行われる回数を計数して計数値を不揮
発的に保持し、 前記EEPROMに供給されるアドレスデータを、保持
した前記計数値に応じ前記EEPROMの異なる記憶領
域のアドレスデータに変換して前記EEPROMに供給
し、 前記計数値が規定値に到達したとき、前記EEPROM
の各記憶領域に記憶されているデータを一括消去するこ
とを特徴とするマイクロコンピュータのメモリ書き換え
方法。
6. A flash EEPROM and said EEPROM.
A microcomputer having a memory control circuit for controlling writing and erasing of data to and from the ROM;
A method of rewriting data held in an EPROM, wherein the memory control circuit counts the number of times data is collectively written to the EEPROM, holds the count in a nonvolatile manner, and stores address data supplied to the EEPROM. Is converted into address data in a different storage area of the EEPROM in accordance with the held count value and supplied to the EEPROM. When the count value reaches a specified value, the EEPROM
A memory rewriting method for a microcomputer, wherein data stored in each storage area is erased collectively.
JP2108499A 1999-01-29 1999-01-29 Microcomputer memory rewriting apparatus and method Expired - Fee Related JP3157800B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2108499A JP3157800B2 (en) 1999-01-29 1999-01-29 Microcomputer memory rewriting apparatus and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2108499A JP3157800B2 (en) 1999-01-29 1999-01-29 Microcomputer memory rewriting apparatus and method

Publications (2)

Publication Number Publication Date
JP2000222891A true JP2000222891A (en) 2000-08-11
JP3157800B2 JP3157800B2 (en) 2001-04-16

Family

ID=12045025

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2108499A Expired - Fee Related JP3157800B2 (en) 1999-01-29 1999-01-29 Microcomputer memory rewriting apparatus and method

Country Status (1)

Country Link
JP (1) JP3157800B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005285191A (en) * 2004-03-29 2005-10-13 Nec Electronics Corp Nonvolatile semiconductor memory device and its driving method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005285191A (en) * 2004-03-29 2005-10-13 Nec Electronics Corp Nonvolatile semiconductor memory device and its driving method

Also Published As

Publication number Publication date
JP3157800B2 (en) 2001-04-16

Similar Documents

Publication Publication Date Title
EP3686728A1 (en) Data writing method and storage device
US10509570B2 (en) Method, device, and program for managing a flash memory for mass storage
CA2420986C (en) Non-volatile memory control method
US7890732B2 (en) Memory card and semiconductor device
US6154808A (en) Method and apparatus for controlling data erase operations of a non-volatile memory device
US7814264B2 (en) Memory card, semiconductor device, and method of controlling semiconductor memory
US8732385B2 (en) Non-volatile memory, controller controlling next access
KR20060012696A (en) Flash memory for performing bad block management and method for performing bad block management of flash memory
JPWO2002052416A1 (en) Flash memory system
JPH11297078A (en) Method and apparatus for access to flash memory array
JPH0574178A (en) Nonvolatile ic memory
KR20030011230A (en) Non-volatile storage device and rewrite control method thereof
KR100758300B1 (en) Flash memory device and program method thereof
JPH09282862A (en) Memory card
US6510083B1 (en) Electrically erasable and programmable memory that allows data update without prior erasure of the memory
JP2007233838A (en) Control method for memory system
JPH07153284A (en) Non-volatile semiconductor memory and its control method
JP3157800B2 (en) Microcomputer memory rewriting apparatus and method
JP4433792B2 (en) MEMORY CONTROLLER, FLASH MEMORY SYSTEM PROVIDED WITH MEMORY CONTROLLER, AND FLASH MEMORY CONTROL METHOD
JPS58208994A (en) Nonvolatile semiconductor storage device
US6898680B2 (en) Minimization of overhead of non-volatile memory operation
JP2006504202A (en) Method for driving a memory structure
JPH06175917A (en) Flash memory
US20240176531A1 (en) Non-volatile memory
JP2003122630A (en) Memory controller, flash memory system having memory controller, and method for controlling flash memory

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees