JPH0357049A - Microcomputer incorporating eeprom - Google Patents
Microcomputer incorporating eepromInfo
- Publication number
- JPH0357049A JPH0357049A JP1193030A JP19303089A JPH0357049A JP H0357049 A JPH0357049 A JP H0357049A JP 1193030 A JP1193030 A JP 1193030A JP 19303089 A JP19303089 A JP 19303089A JP H0357049 A JPH0357049 A JP H0357049A
- Authority
- JP
- Japan
- Prior art keywords
- flag
- eeprom
- ram
- write
- data
- 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
Links
- 238000010586 diagram Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 2
- 101000706243 Homo sapiens Prominin-2 Proteins 0.000 description 1
- 102100031190 Prominin-2 Human genes 0.000 description 1
- 239000003990 capacitor Substances 0.000 description 1
- 239000013256 coordination polymer Substances 0.000 description 1
- 238000000034 method Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
Landscapes
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
Description
【発明の詳細な説明】
〔産業上の利用分野〕
本発明は、電気的消去可能不揮発性メモリ(EEPRO
M)を内蔵したシングルチッソ・マイクロコンピュータ
に関する。DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention is directed to electrically erasable non-volatile memory (EEPRO).
Regarding a single Chisso microcomputer with a built-in M).
従来、EEPROM内蔵マイクロコンピュータ(以下マ
イコンと呼ぶ)は、CPUの書込み命令動作によって、
EEPROMの消去動作を開始し、一定の消去時間(通
常は約5 msec)経過後、書込み動作を開始し、一
定の書込時間(通常は約5 msec)書込み動作を行
なうことにより、E.EPROMへの書込みを行なう。Conventionally, microcomputers with a built-in EEPROM (hereinafter referred to as microcomputers) have been configured to
EEPROM erase operation is started, and after a fixed erase time (usually about 5 msec) has elapsed, a write operation is started, and the write operation is performed for a fixed write time (usually about 5 msec). Write to EPROM.
上述した従来のEEPROM内蔵マイコンは、1バイト
当りの書込みに約10msecと云う時間を必要とする
ため、大量データをまとめてEEPROMに書込みを行
なうには非常に長い時間が必要である。例えば、シング
ルチップ・マイコンの場合、電源が断となった時に10
0バイト程度のデータをバックアップするケースが多い
。この場合、100バイトのデータをRAMからEEP
ROMに転送するためには10msX100バイト=I
秒の時間が必要である。従って、従来のEEPROM内
マイコンでは電源が切れてから1秒以上マイコンに印加
する電圧を保持しなければ、データのバックアップを行
うことができない。このために必要なコンデンサ容量は
、例えばマイコンの消費電流を10mA、電源電圧低下
許容値を0.5V(5Vから4.5■に低下しても動作
できの大きな容量が必要となると云う欠点がある。The conventional EEPROM built-in microcomputer described above requires about 10 msec to write one byte, so it takes a very long time to write a large amount of data into the EEPROM. For example, in the case of a single-chip microcontroller, when the power is cut off, the
There are many cases where approximately 0 bytes of data is backed up. In this case, 100 bytes of data are transferred from RAM to EEP.
To transfer to ROM, 10ms x 100 bytes = I
Seconds of time are required. Therefore, in the conventional EEPROM microcomputer, data cannot be backed up unless the voltage applied to the microcomputer is maintained for at least one second after the power is turned off. The capacitor capacity required for this purpose is, for example, 10 mA for the current consumption of the microcontroller, and 0.5 V for the power supply voltage drop tolerance (the drawback is that it requires a large capacity that can operate even if the power supply voltage drops from 5 V to 4.5 µA). be.
この対策としてRAMのうちバックアップするエリアの
データを、常にEEPROMに転送しておく方法が考え
られるが、どのデータまでがEEPROMに転送終了し
ているかわからないという点と、EEPROMは書換え
回数に制限(通常1万〜10万回)があり、常に書込み
を行なう方法は現実的ではない。As a countermeasure to this problem, it is possible to always transfer data in the area of RAM to be backed up to EEPROM, but it is difficult to know which data has been transferred to EEPROM, and EEPROM has a limit on the number of times it can be rewritten (usually 10,000 to 100,000 times), and a method of constantly writing is not practical.
本発明の目的は、電源断が発生した際のバックアップに
要する時間を短縮し、しかもEEPROMの書換え回数
の制限に対して現実可能なEEPROM内蔵マイクロコ
ンピュータを提供することにある。SUMMARY OF THE INVENTION An object of the present invention is to provide a microcomputer with a built-in EEPROM that can shorten the time required for backup in the event of a power outage and is practical for limiting the number of times the EEPROM can be rewritten.
本発明のマイクロコンピュータは、EEPROMとRA
Mとを同一チップ上に内蔵したマイクロコンピュータに
於て、前記RAMの所定領域のアドレスごとに対応した
フラグを有し前記RAMの前記所定領域に対し書込み動
作が行なわれた時そのアドレスに対応する前記フラグが
セット状態となるフラグレジスタと、前記セット状態と
なったフラグに応答して前記RAMの前記所定領域に書
込まれたデータを前記EEPROMに書込む手段とを有
することを特徴とする。The microcomputer of the present invention has EEPROM and RA.
A microcomputer incorporating M on the same chip has a flag corresponding to each address of the predetermined area of the RAM, and corresponds to the address when a write operation is performed to the predetermined area of the RAM. The present invention is characterized by comprising a flag register in which the flag is set, and means for writing data written in the predetermined area of the RAM to the EEPROM in response to the flag being set.
次に、本発明について図面を参照して説明する。 Next, the present invention will be explained with reference to the drawings.
第1図は本発明の第lの実施例を説明するためのブpツ
ク図である。CPUIは同図には示されていないプログ
ラムメモリの内容に従って処理を行う。EEPROM2
はCPUIによって内部バス4を通して書き込み、読み
出しが行われる。書込み制御回路3は、EEPROM2
への書込み命令が実行されると、EEPROMの消去動
作を開始し、消去に必要な時間の計測を行ない、その消
去時間経過後、書込み動作を開始し、書込みに必要な時
間の計測を行ない、その書込み時間経過後、割り込みな
どによって書込みの終了をCPUIに伝える。アドレス
デコーダ5はRAM7への書込みアドレス値をデコード
する。その出力とライト信号(WR)のアンド信号を入
力とするフラグレジスタ6はRAM7のバックアップエ
リアのアドレスにそれぞれ対応するビットを有している
.従って、RAM7に対する書込みが行なわれると、そ
の書込まれたアドレスに相当するフラグレジスタ60ビ
ットがセットされる。フラグ6は内部バスを通じてCP
U1により書込み/読出しを行なうことができる。この
ような構戊によれば、バックア,ブエリア内のデータが
書き換った時だけフラグ6の該当ビットがセットされる
。このためEEPROM書込み割込みルーテンの中でフ
ラグ6の状態をテストし、セットされているビットがあ
れば、そのビットに該当するバックアップエリアのデー
タを読み出し、EEPROM2への書き込み命令を実行
し、フラグ6をリセットするようにプログラムすればバ
ックアップエリア内の書キ換えられたRAMだけがEE
PROM2に常に転送されることとなり、EEPROM
2の書換え回数の制限に対し、現実的な手段を提供する
ことができる。また、バックアップエリア内のデータの
うち、どのデータのEEPROM2への転送が完了して
いるかを確認することができるため、電源断が発生した
際にも転送が完了していないデータだけをEBFROM
2に転送すればよく、データの退避時間を大幅に削減で
きる.
第1図に於では、フラグ6の読出しは8ビ,トあるいは
16ビットのようにCPU1が処理することのできるビ
ット長で一度に複数ビット読出せるようにした方が望ま
しい。何故ならば、フラグ6を順次ビット毎にテストし
ていくと、EEPROM書き込み割込みルーチンの処理
が長くなって、CPU1の処理能力を下げてしまうこと
になるからである.例えば、すべてのビットがリセット
されている時、ビット毎にテストをするのと16ビット
毎に読み出すのでは約l6倍の処理時間の差となる。FIG. 1 is a book diagram for explaining a first embodiment of the present invention. The CPUI performs processing according to the contents of a program memory not shown in the figure. EEPROM2
are written and read by the CPU via the internal bus 4. The write control circuit 3 is an EEPROM2
When a write command is executed, an erasing operation of the EEPROM is started, the time required for erasing is measured, and after the erasing time has elapsed, a writing operation is started, and the time required for writing is measured, After the writing time has elapsed, the end of writing is notified to the CPU by an interrupt or the like. Address decoder 5 decodes the write address value to RAM 7. The flag register 6 which receives the AND signal of the output and the write signal (WR) has bits corresponding to the addresses of the backup area of the RAM 7, respectively. Therefore, when writing to RAM 7 is performed, 60 bits of the flag register corresponding to the written address are set. Flag 6 is CP via internal bus.
Writing/reading can be performed by U1. According to this structure, the corresponding bit of flag 6 is set only when data in the backup area is rewritten. Therefore, the state of flag 6 is tested in the EEPROM write interrupt routine, and if any bit is set, the data in the backup area corresponding to that bit is read, the write command to EEPROM 2 is executed, and flag 6 is set. If you program it to be reset, only the rewritten RAM in the backup area will become EE.
It will always be transferred to PROM2, and EEPROM
It is possible to provide a practical means for limiting the number of rewrites described in 2. In addition, it is possible to check which data in the backup area has been transferred to EEPROM2, so even if a power outage occurs, only the data that has not been transferred can be transferred to EBFROM.
2, the data backup time can be significantly reduced. In FIG. 1, it is preferable to read the flag 6 at a bit length that can be processed by the CPU 1, such as 8 bits, or 16 bits, so that a plurality of bits can be read out at once. This is because if flag 6 is tested bit by bit sequentially, the processing of the EEPROM write interrupt routine becomes long and the processing capacity of the CPU 1 is reduced. For example, when all bits are reset, there is a difference in processing time of approximately 16 times between testing each bit and reading every 16 bits.
第2図は本発明の第2の実施例を説明するためのブロッ
ク図である。ORゲート8はフラグ6のすべての出力の
論理和を出力する。ANDゲート9は、このORゲート
8の出力と書込み制御回路3が書込み中でないことを示
す信号IOとの論理積を出力し、その出力はCPtJ1
に割り込み信号として伝達される。このような構戊によ
れば、バックアップエリア内のRAMのいずれかが書き
換えられることによってフラグ6のいずれかがセットさ
れており、かつEEPROM2への書込みが行なわれて
いない時に、割込み等が発生することによってCPU1
はバックアップエリアからEEPROM2へ転送すべき
データが存在することを知ることができる。第1の実施
例ではバックアップが終了しても、定期的にフラグ6の
状態をテストしなければならないが、第2の実施例では
バックアップが終了すれば、ANDゲート9の出力がア
クティブになるまでEEPROM2へのバックアップ処
理によるCPU1の処理能力ダウンを大巾に緩和するこ
とができる利点がある。FIG. 2 is a block diagram for explaining a second embodiment of the present invention. OR gate 8 outputs the logical sum of all outputs of flag 6. The AND gate 9 outputs the logical product of the output of the OR gate 8 and the signal IO indicating that the write control circuit 3 is not writing, and the output is CPtJ1.
is transmitted as an interrupt signal. According to this structure, when any of the flags 6 is set by rewriting any of the RAMs in the backup area, and no writing is performed to the EEPROM 2, an interrupt etc. occurs. By CPU1
can know that there is data to be transferred from the backup area to the EEPROM2. In the first embodiment, even if the backup is completed, the state of the flag 6 must be tested periodically, but in the second embodiment, once the backup is completed, the state of the flag 6 must be tested until the output of the AND gate 9 becomes active. This has the advantage of being able to greatly alleviate the reduction in processing power of the CPU 1 due to backup processing to the EEPROM 2.
以上説明したように本発明はRAMT上のバックアップ
エリアの各アドレスに対応したフラグ6を持ち、そのフ
ラグ6が対応するRAMデータが書き換えられた時セッ
トされるように構戒することにより、バックアップエリ
ア内のデータを定期的に順次EEPROMへ退避できる
ため通電中にほとんどのデータを退避できることから電
源断が発生した際の、バックアップに要する時間が短縮
され、従ってマイコンの電源電圧を保持するためのコン
デンサ容量を大幅に小さくできる効果がある。As explained above, the present invention has a flag 6 corresponding to each address of the backup area on RAMT, and sets the flag 6 when the corresponding RAM data is rewritten. The data in the memory can be periodically saved to the EEPROM, so most of the data can be saved while the power is on, reducing the time required for backup in the event of a power outage. This has the effect of significantly reducing capacity.
第1図は本発明の第1の実施例を説明するためのブロッ
ク図、第2図は本発明の第2の実施例を説明するための
ブロック図でアル。
1・・・・・・CPU、2・・・・・・EEPROM,
3・・・・・・書込み制御回路、4・・・・・・内部バ
ス、5・・・・・・アドレスデコーダ、6・・・・・・
フラグ、7・・・・・・RAM、8・・・・・・ORゲ
ート、9・・・・・・ANDゲート。FIG. 1 is a block diagram for explaining a first embodiment of the present invention, and FIG. 2 is a block diagram for explaining a second embodiment of the present invention. 1...CPU, 2...EEPROM,
3...Write control circuit, 4...Internal bus, 5...Address decoder, 6...
Flag, 7...RAM, 8...OR gate, 9...AND gate.
Claims (1)
クロコンピュータに於て、前記RAMの所定領域のアド
レスごとに対応したフラグを有し前記RAMの前記所定
領域に対し書込み動作が行なわれた時そのアドレスに対
応する前記フラグがセット状態となるフラグレジスタと
、前記セット状態となったフラグに応答して前記RAM
の前記所定領域に書込まれたデータを前記EEPROM
に書込む手段とを有することを特徴とするEEPROM
内蔵マイクロコンピュータ。In a microcomputer that incorporates an EEPROM and a RAM on the same chip, there is a flag corresponding to each address of a predetermined area of the RAM, and when a write operation is performed to the predetermined area of the RAM, the flag is set to that address. a flag register in which the corresponding flag is set; and a flag register in which the corresponding flag is set;
The data written in the predetermined area of the EEPROM
An EEPROM characterized in that it has means for writing into the EEPROM.
Built-in microcomputer.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP1193030A JPH0357049A (en) | 1989-07-25 | 1989-07-25 | Microcomputer incorporating eeprom |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP1193030A JPH0357049A (en) | 1989-07-25 | 1989-07-25 | Microcomputer incorporating eeprom |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH0357049A true JPH0357049A (en) | 1991-03-12 |
Family
ID=16301000
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP1193030A Pending JPH0357049A (en) | 1989-07-25 | 1989-07-25 | Microcomputer incorporating eeprom |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH0357049A (en) |
-
1989
- 1989-07-25 JP JP1193030A patent/JPH0357049A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JPH07114497A (en) | Semiconductor integrated circuit device | |
JP2002278781A (en) | Storage device, method for controlling storage device and program | |
US5307470A (en) | Microcomputer having EEPROM provided with detector for detecting data write request issued before data write operation responsive to preceding data write request is completed | |
US5915080A (en) | Reprogramming device of a flash memory | |
US6792565B1 (en) | Address conversion device for nonvolatile memory | |
JPH03252993A (en) | Information writing device for e2prom | |
JP2002015584A (en) | Read/protect circuit for non-volatile memory | |
JPH0357049A (en) | Microcomputer incorporating eeprom | |
WO2015176040A1 (en) | Memory devices and methods having instruction acknowledgement | |
JPH02214156A (en) | Nonvolatile semiconductor device | |
JP3635996B2 (en) | Information processing system | |
JPH0719477B2 (en) | EEPROM content protection device | |
JPH082880Y2 (en) | EEPROM data writing device | |
JP2001147863A (en) | Flash memory rewrite device | |
JP2581057B2 (en) | Evaluation microcomputer | |
JPH0765586A (en) | Access system for eeprom | |
JP3133710B2 (en) | Microcomputer evaluation device | |
JP3281858B2 (en) | Microcomputer evaluation device | |
JPH0765592A (en) | Nonvolatile memory | |
JPH1139222A (en) | Microcomputer | |
JPH04263198A (en) | Memory device | |
CN1083963A (en) | Electricity erasable read only storer double as read/write purposes Method and circuits | |
JPH0675866A (en) | Memory control circuit | |
JPS58107931A (en) | Eprom backup system | |
JPH029091A (en) | Semiconductor device |