[go: up one dir, main page]

JP3510780B2 - Microcomputer - Google Patents

Microcomputer

Info

Publication number
JP3510780B2
JP3510780B2 JP5836198A JP5836198A JP3510780B2 JP 3510780 B2 JP3510780 B2 JP 3510780B2 JP 5836198 A JP5836198 A JP 5836198A JP 5836198 A JP5836198 A JP 5836198A JP 3510780 B2 JP3510780 B2 JP 3510780B2
Authority
JP
Japan
Prior art keywords
circuit
signal
flag
address area
address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP5836198A
Other languages
Japanese (ja)
Other versions
JPH11259286A (en
Inventor
徹 渡辺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP5836198A priority Critical patent/JP3510780B2/en
Publication of JPH11259286A publication Critical patent/JPH11259286A/en
Application granted granted Critical
Publication of JP3510780B2 publication Critical patent/JP3510780B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

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

Description

【発明の詳細な説明】 【0001】 【発明の属する技術分野】本発明は、データの電気消去
及び書き込み読み出しが可能な特性を有する不揮発性メ
モリ(フラッシュメモリ等)を内蔵したマイクロコンピ
ュータに関する。 【0002】 【従来の技術】図3は従来のマイクロコンピュータの要
部を示すブロック図である。図3において、(1)はフ
ラッシュメモリ(不揮発性メモリ)であり、データを一
括又は部分的(例えばページ(128ワード)単位)に
電気消去でき且つデータを繰り返し書き込み及び読み出
しできる特性を有する。フラッシュメモリ(1)はマイ
クロコンピュータのプログラムメモリとして機能し、ア
ドレス領域Aの記憶セルには各種論理演算を実行させる
為のプログラム命令が格納され、アドレス領域Bの記憶
セルにはアドレス領域Aのプログラム命令を書き換える
為の書き換え命令が格納されている。フラッシュメモリ
(1)は、通常はアドレス領域Aが指定され、アドレス
領域Aのプログラム内容を書き換える為の割り込み要求
が発生した時のみアドレス領域Bが指定される様にアド
レス領域Aからジャンプする。マイクロコンピュータ
は、フラッシュメモリ(1)のアドレス領域Aから読み
出されたプログラム命令の解読結果に従って各種論理演
算動作を実行し、一方、フラッシュメモリ(1)のアド
レス領域Bから読み出された書き換え命令の解読結果に
従って、アドレス領域Aの内容の書き換え動作を実行す
る。尚、フラッシュメモリ(1)のアドレス領域Aの書
き換えデータは、マイクロコンピュータの内部に事前準
備する方法(マスクROMを別途設けてテーブルデータ
として格納する方法等)、又は、マイクロコンピュータ
の外部から供給する方法(PROMライタから供給する
方法等)の何れでも良い。 【0003】(2)はページバッファ(スタティックR
AM等の揮発性メモリ)であり、フラッシュメモリ
(1)のアドレス領域Aのプログラム命令を1ページ単
位で書き換える為の128ワードの記憶容量を有する。
ページバッファ(2)は自らをアドレス指定する為のイ
ンクリメント機能を有する。書き換えデータは、ページ
バッファ(2)に一旦格納された後、フラッシュメモリ
(1)のアドレス領域Aの指定ページに書き込まれる。
詳細は後述する。 【0004】(3)はフラグ回路であり、ページバッフ
ァ(2)の各アドレスに1対1に対応する128個のフ
ラグを有する。尚、ページバッファ(2)はフラッシュ
メモリ(1)のアドレス領域Aを128ワード単位で書
き換える為のものである。しかし、使用者が128ワー
ドの全部を異なるプログラム命令に書き換えたい場合も
あれば、128ワードのうち一部を異なるプログラム命
令に書き換え且つ残りを同じプログラム命令のままで書
き換えたくない場合もある。後者の場合、ページバッフ
ァ(2)に前記マスクROM又は前記PROMライタ等
から128ワード単位のプログラム命令を直接格納する
と、ページバッファ(2)にフラッシュメモリ(1)の
指定ページの中の同じプログラム命令をも格納しなけれ
ばならないと言う無駄を生じる。そこで、フラグ回路
(3)は、ページバッファ(2)にフラッシュメモリ
(1)の指定ページの中の異なるプログラム命令を格納
させるだけで済む様にしたものである。即ち、フラグ回
路(3)は、ページバッファ(2)に前記マスクROM
又は前記PROMライタからプログラム命令が格納され
た時、ページバッファ(2)の格納アドレスに対応する
フラグをセット(論理値「1」)する。従って、フラグ
回路(3)の128個のフラグは、128ワードの全部
を異なるプログラム命令に書き換える場合は全部論理値
「1」となるが、128ワードの一部だけを異なるプロ
グラム命令に書き換える場合は論理値「1」及び論理値
「0」の組み合わせとなる。フラッシュメモリ(1)の
指定ページ(128ワード)の値をページバッファ
(2)に読み込む時、フラグ回路(3)のフラグ(論理
値「1」)に対応するページバッファ(2)のアドレス
は読み込みを禁止され、フラグ回路(3)のフラグ(論
理値「0」)に対応するページバッファ(2)のアドレ
スは読み込みを許可される。即ち、ページバッファ
(2)の一部アドレスに前記マスクROM又は前記PR
OMライタから異なるプログラム命令を格納すると、そ
の後の処理で、残りのアドレスにフラッシュメモリ
(1)の指定ページのプログラム命令が格納される。フ
ラッシュメモリ(1)のアドレス領域Aの値は1ページ
単位で書き換えるものであるが、フラグ回路(3)を使
用することにより、EEPROMと同様に最小1ワード
単位で書き換えることが可能となる。フラグ回路(3)
は、フラッシュメモリ(1)の記億セルを書き込み許可
状態又は書き込み禁止状態とする為の状態切換信号WR
Tの立ち下がりでリセットされる。 【0005】 【発明が解決しようとする課題】フラッシュメモリ
(1)のアドレス領域Aのプログラム命令の書き換え方
法としては、前記PROMライタを使用する方法、及
び、フラッシュメモリ(1)のアドレス領域Bの書き換
え命令を実行する方法の2種類が考えられる。前記PR
OMライタを使用する場合、フラッシュメモリ(1)の
アドレス領域Bの書き換え命令を読み出す必要が無い
為、フラッシュメモリ(1)のアドレス領域Aのプログ
ラム命令を書き換える期間は、状態切換信号WRTは常
時書き換え許可レベル(論理値「1」)で良い。この場
合、前記PROMライタは、フラッシュメモリ(1)の
識別回路(9)に対し、動作許可信号*CE、書き込み
許可信号*WE、書き込み終了信号EOW、更には消去
信号ERASE、読み込み信号RECALL、書き込み
信号PROGRAM、アドレスデータADATA、プロ
グラムデータPDATAを供給する。図4は状態切換信
号WRTの変化の様子を示すタイムチャートである。動
作許可信号*CE及び書き込み許可信号*WEが一旦立
ち下がると、状態切換信号WRTが立ち上がり、フラッ
シュメモリ(1)の記億セルは書き込み可能状態とな
る。一連の書き込み処理が終了すると、書き込み終了信
号EOWが発生し、状態切換信号WRTは立ち下がる。
図5は状態切換信号WRTがハイレベルの時の動作を示
すタイムチャートである。状態切換信号WRTが立ち上
がると、ページバッファ(2)に1〜128ワードの範
囲内で所定数のプログラムデータPDATAが格納さ
れ、ページバッファ(2)の格納アドレスに対応するフ
ラグ回路(3)のフラグがセットされる。ページバッフ
ァ(2)に対する格納が終了して一定時間(例えば30
0μsec)経過すると、読み込み信号RECALLが
発生し、フラッシュメモリ(1)のアドレス領域Aの指
定ページの情報がページバッファ(2)に読み込まれ
る。但し、フラグ回路(3)のフラグ(論理値「1」)
に対応するページバッファ(2)の読み込みは禁止され
る。この結果、ページバッファ(2)に異なるプログラ
ムデータPDATAを含む128ワードが準備される
と、消去信号ERASEが発生してフラッシュメモリ
(1)のアドレス領域Aの指定ページが電気消去され、
書き込み信号PROGRAMが発生してページバッファ
(2)の値がフラッシュメモリ(1)のアドレス領域A
の指定ページ(アドレスデータADATAによる指定ア
ドレス)に書き込まれる。フラッシュメモリ(1)に対
する書き込み動作が終了すると、書き込み終了信号EO
Wが発生し、状態切換信号WRTは立ち下がる。 【0006】一方、フラッシュメモリ(1)のアドレス
領域Bの書き換え命令を実行する場合、フラッシュメモ
リ(1)のアドレス領域Bの書き換え命令を読み出す必
要がある為、フラッシュメモリ(1)のアドレス領域A
のプログラム命令を書き換える期間は、状態切換信号W
RTを周期的に書き換え許可レベル(論理値「1」)及
び書き換え禁止レベル(論理値「0」)に変化させる必
要がある。この場合、マイクロコンピュータは、フラッ
シュメモリ(1)に対し、動作許可信号*CE、書き込
み許可信号*WE、読み出し許可信号*OE、書き込み
禁止信号WIを供給する。図6は状態切換信号WRTの
変化の状態を示すタイムチャートである。動作許可信号
*CE及び書き込み許可信号*WEが立ち下がると状態
切換信号WRTは立ち上がり、書き込み禁止信号WIが
発生すると状態切換信号WRTは立ち下がる。状態切換
信号WRTのハイレベル期間、フラッシュメモリ(1)
は書き込み可能状態となる。その後、動作許可信号*C
E及び読み出し許可信号*OEが立ち下がる時は状態切
換信号WRTはローレベルのまま変化しない為、フラッ
シュメモリ(1)は読み出し可能状態となる。即ち、状
態切換信号WRTがローレベルの時、フラッシュメモリ
(1)のアドレス領域Bの書き換え命令が読み出され、
状態切換信号WRTがハイレベルの時、書き換え命令の
解読結果に従ってページバッファ(2)に所定ワード数
のプログラムデータPDATAが1ワードずつ格納され
る。 【0007】ところが、状態切換信号WRTはページバ
ッファ(2)が1ワード単位のプログラムデータPDA
TAを格納する毎に立ち下がる。即ち、フラグ回路
(3)のフラグはページバッファ(2)が1ワード単位
のプログラムデータPDATAを格納する毎にセットさ
れるが、直後の状態切換信号WRTの立ち下がりで直ち
にリセットされてしまう。故に、ページバッファ(2)
に対する格納動作を終了しても、読み込み信号RECA
LLに従って、フラッシュメモリ(1)のアドレス領域
Aにおける指定ページの全情報がページバッファ(2)
に格納されてしまい、フラッシュメモリ(1)のアドレ
ス領域Aのプログラム変更を実行できない問題があっ
た。図3のマイクロコンピュータは外部装置を用いたデ
ータ書き換えにしか対応できない。 【0008】そこで、本発明は、不揮発性メモリの書き
換え命令に従って自らのプログラム命令を書き換える
時、バッファ回路の値を不揮発性メモリに書き込み終了
する迄フラグ回路をリセットしないマイクロコンピュー
タを提供することを目的とする。 【0009】 【課題を解決するための手段】本発明は、前記問題点を
解決する為に成されたものであり、全記憶領域のうち一
定記憶容量単位でデータの電気消去及び書き換えが可能
な不揮発性メモリと、前記不揮発性メモリの動作を制御
する動作許可信号、書き込み許可信号及び読み出し許可
信号の状態を識別し、前記不揮発性メモリの記憶セルを
一定周期で書き込み許可状態又は書き込み禁止状態とす
る為の状態切換信号を発生する識別回路と、前記不揮発
性メモリの一定記憶容量領域と等しいアドレス数を有
し、前記不揮発性メモリの書き換えデータを格納するバ
ッファ回路と、前記バッファ回路のアドレスと1対1に
対応し且つ前記バッファ回路の書き換えデータ格納アド
レスに対応する位置のみセットされるフラグを有し、前
記不揮発性メモリの一定記憶容量領域の値を前記バッフ
ァ回路に転送する時、前記フラグがセットされた前記バ
ッファ回路の対応アドレスのみ転送動作を禁止し、前記
状態切換信号でリセットされるフラグ回路と、を含むマ
イクロコンピュータにおいて、前記不揮発性メモリの一
定記憶容量領域の値を前記バッファ回路に転送した後、
前記バッファ回路の値を前記不揮発性メモリの一定記憶
容量領域に書き込み終了する迄、前記フラグ回路のリセ
ットを禁止する禁止回路を備えたことを特徴とする。 【0010】 【発明の実施の形態】本発明の詳細を図面に従って具体
的に説明する。図1は本発明のマイクロコンピュータを
示す回路ブロック図である。尚、図1において図3と同
一物には同一番号を記すと共にその説明を省略する。図
1において、(4)はラッチ回路であり、状態切換信号
WRTをクロックCLKに同期して保持するものであ
る。(5)はレジスタであり、フラッシュメモリ(1)
のアドレス領域Aの特定ページの情報を書き換える時、
内部バス(6)から転送されて来る論理値「1」を保持
するものであり、ラッチ回路(4)の出力信号OUT1
の論理値「0」から論理値「1」への変化を受けてリセ
ットされる。レジスタ(5)の出力信号OUT2及び状
態切換信号WRTはORゲート(7)を介してフラグ回
路(3)のリセット端子に供給される。 【0011】図1の動作を図2のタイムチャートを用い
て説明する。先ず、電源を投入し、マイクロコンピュー
タの内部の全機能ブロックが動作可能状態となると、プ
ログラムカウンタ(8)がフラッシュメモリ(1)のア
ドレス領域Aをアドレス指定し、マイクロコンピュータ
はフラッシュメモリ(1)のアドレス領域Aから読み出
されたプログラム命令の解読結果に従って各種論理演算
動作を実行する。その後、フラッシュメモリ(1)のア
ドレス領域Aのプログラム命令をページ単位で書き換え
る為の割り込み要求が発生すると、プログラムカウンタ
(8)の値がアドレス領域Aからアドレス領域Bへジャ
ンプし、マイクロコンピュータはアドレス領域Bから読
み出された書き換え命令の解読結果に従ってアドレス領
域Aのプログラム命令の書き換え動作を開始する。 【0012】アドレス領域Bの書き換え命令を使用して
アドレス領域Aのプログラム命令を書き換える為、状態
切換信号WRTは動作許可信号*CE及び書き込み許可
信号*WEが立ち下がった時に立ち上がり且つ書き込み
禁止信号WIが発生した時に立ち下がる所謂間欠的なハ
イレベルを繰り返す信号となる。状態切換信号WRT及
びクロックCLKの関係は、状態切換信号WRTが間欠
的にハイレベル及びローレベルを繰り返す時、クロック
CLKが状態切換信号WRTのローレベルに同期して発
生する関係となっている。即ち、状態切換信号WRTが
書き込み禁止信号WIの影響を受けて周期的変化を繰り
返す期間では、ラッチ回路(4)の出力信号OUT1は
常時ローレベルとなり、これに伴い、レジスタ(5)の
出力信号OUT2はリセットされずに常時ハイレベルと
なり、ORゲート(7)の出力は出力信号OUT2と等
しくなる。この時、フラグ回路(3)はリセットされる
ことはない。従って、ページバッファ(2)に所定ワー
ド数(1〜128の範囲)のプログラムデータPDAT
Aを格納しても、フラグ回路(3)の対応フラグはセッ
トされたままリセットされることはない。 【0013】ページバッファ(2)の格納動作終了後、
所定時間(例えば300μsec)を経過すると、読み
込み信号RECALLが発生し、アドレス領域Aの指定
ページのプログラム命令がページバッファ(2)に読み
込まれる。但し、フラグ回路(3)がアドレス領域A及
びページバッファ(2)間のゲートとして作用する為、
アドレス領域Aの指定ページのプログラム命令のうちフ
ラグ回路(3)のフラグ(論理値「0」)に対応するア
ドレスのプログラム命令のみがページバッファ(2)に
読み込まれる。従って、ページバッファ(2)には、マ
スクROM又はPROMライタからの新規のプログラム
命令及びアドレス領域Aからの従前のプログラム命令を
加えた128ワードが格納される。 【0014】その後、消去信号ERASEが発生し、ア
ドレス領域Aの指定ページの全内容が消去されると、書
き込み信号PROGRAMが発生し、その間、書き込み
禁止信号WIが発生しなくなる。即ち、状態切換信号W
RTは、書き込み信号PROGRAMの発生後、動作許
可信号*CE及び書き込み許可信号*WEの最初の立ち
下がりを受けて立ち上がりハイレベルのままとなる。故
に、ラッチ回路(4)の出力信号OUT1は書き込み信
号PROGRAMの発生後の最初のクロックCLKに同
期してハイレベルに変化し、レジスタ(5)の出力信号
OUT2はリセットされてローレベルに変化する。しか
し、ORゲート(7)の出力は状態切換信号WRTの状
態(常時ハイレベル)と等しい為、フラグ回路(3)は
リセットされることはない。そして、状態切換信号WR
Tのハイレベルの期間、ページバッファ(2)の値は自
動インクリメントされながらアドレス領域Aの指定ペー
ジに書き込まれる。アドレス領域Aの指定ページの書き
換え動作が終了すると、書き込み信号PROGRAMが
ローレベルとなり、これに伴い、状態切換信号WRTも
ローレベルとなる。従って、ORゲート(7)の出力が
ローレベルとなる為、フラグ回路(3)はフラッシュメ
モリ(1)の一連の書き換え動作の過程で初めてリセッ
トされる。 【0015】本発明の実施の形態によれば、アドレス領
域Bの書き換え命令に従ってアドレス領域Aのプログラ
ム命令を書き換える場合(オンボード書き換えの場
合)、以下の作用効果を奏する。即ち、アドレス領域A
の書き換えが終了する迄フラグ回路(3)がリセットさ
れない為、アドレス領域Aの指定ページの一部を変更す
る場合であっても、ページバッファ(2)に変更したい
新規のプログラム命令を格納するだけで済み、アドレス
領域Aの指定ページのプログラム命令をページバッファ
(2)に読み込んでも新規のプログラム命令の消滅を防
止できる。 【0016】 【発明の効果】本発明によれば、一部のアドレス領域に
各種論理演算を実行する為のプログラム命令が格納され
且つ残りのアドレス領域にプログラム命令を書き換える
為の書き換え命令が格納された不揮発性メモリを内蔵す
るマイクロコンピュータにおいて、書き換え命令に従っ
てプログラム命令を書き換える場合、以下の効果を奏す
る。即ち、一部のアドレス領域の書き換えが終了する迄
フラグ回路がリセットされない為、一部のアドレス領域
の指定ページの一部を変更する場合であっても、バッフ
ァ回路に変更したい新規のプログラム命令を格納するだ
けで済み、一部のアドレス領域の指定ページのプログラ
ム命令をバッファ回路に読み込んでも新規のプログラム
命令の消滅を防止できる、といった利点が得られる。
Description: BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microcomputer having a built-in non-volatile memory (such as a flash memory) having characteristics capable of electrically erasing data and writing / reading data. 2. Description of the Related Art FIG. 3 is a block diagram showing a main part of a conventional microcomputer. In FIG. 3, (1) is a flash memory (non-volatile memory), which has a characteristic that data can be electrically erased collectively or partially (for example, in units of pages (128 words)) and data can be repeatedly written and read. The flash memory (1) functions as a program memory of the microcomputer. The memory cells in the address area A store program instructions for executing various logical operations, and the memory cells in the address area B store the program of the address area A. A rewrite command for rewriting the command is stored. The flash memory (1) normally jumps from the address area A so that the address area A is designated and the address area B is designated only when an interrupt request for rewriting the program contents of the address area A is generated. The microcomputer executes various logical operation operations according to the result of decoding the program instruction read from the address area A of the flash memory (1), while the microcomputer executes the rewrite instruction read from the address area B of the flash memory (1). The rewriting operation of the contents of the address area A is executed in accordance with the result of decryption. The rewrite data in the address area A of the flash memory (1) is prepared in advance in the microcomputer (eg, a mask ROM is separately provided and stored as table data) or supplied from outside the microcomputer. Any method (such as a method of supplying from a PROM writer) may be used. (2) A page buffer (static R)
Volatile memory such as AM), and has a storage capacity of 128 words for rewriting the program instruction in the address area A of the flash memory (1) in units of one page.
The page buffer (2) has an increment function for addressing itself. The rewrite data is temporarily stored in the page buffer (2) and then written to a designated page in the address area A of the flash memory (1).
Details will be described later. [0004] (3) is a flag circuit, which has 128 flags corresponding to each address of the page buffer (2) on a one-to-one basis. The page buffer (2) is for rewriting the address area A of the flash memory (1) in units of 128 words. However, there are cases where the user wants to rewrite all of the 128 words with different program instructions, and sometimes does not want to rewrite some of the 128 words with different program instructions and the rest of the word remains the same program instruction. In the latter case, when a 128-word unit program instruction is directly stored in the page buffer (2) from the mask ROM or the PROM writer, the same program instruction in the designated page of the flash memory (1) is stored in the page buffer (2). Must also be stored. In view of this, the flag circuit (3) only needs to store different program instructions in the designated page of the flash memory (1) in the page buffer (2). That is, the flag circuit (3) stores the mask ROM in the page buffer (2).
Alternatively, when a program instruction is stored from the PROM writer, a flag corresponding to the storage address of the page buffer (2) is set (logical value "1"). Accordingly, the 128 flags of the flag circuit (3) all have logical values "1" when all of the 128 words are rewritten with different program instructions, but when only part of the 128 words are rewritten with different program instructions. This is a combination of the logical value “1” and the logical value “0”. When reading the value of the designated page (128 words) of the flash memory (1) into the page buffer (2), the address of the page buffer (2) corresponding to the flag (logical value "1") of the flag circuit (3) is read. And reading of the address of the page buffer (2) corresponding to the flag (logical value “0”) of the flag circuit (3) is permitted. That is, the mask ROM or the PR is stored in a partial address of the page buffer (2).
When a different program instruction is stored from the OM writer, the program instruction of the designated page of the flash memory (1) is stored in the remaining address in the subsequent processing. The value of the address area A of the flash memory (1) is rewritten in units of one page, but by using the flag circuit (3), it can be rewritten in units of at least one word as in the case of the EEPROM. Flag circuit (3)
Is a state switching signal WR for setting a memory cell of the flash memory (1) to a write enable state or a write disable state.
Reset at the falling edge of T. As a method of rewriting a program instruction in the address area A of the flash memory (1), a method using the PROM writer and a method of rewriting the program instruction in the address area B of the flash memory (1) are used. There are two types of methods for executing the rewrite instruction. The PR
When the OM writer is used, it is not necessary to read out the rewrite instruction in the address area B of the flash memory (1). Therefore, during the period in which the program instruction in the address area A of the flash memory (1) is rewritten, the state switching signal WRT is constantly rewritten. The permission level (logical value “1”) may be used. In this case, the PROM writer sends an operation enable signal * CE, a write enable signal * WE, a write end signal EOW, an erase signal ERASE, a read signal RECALL, and a write enable signal * CE to the identification circuit (9) of the flash memory (1). A signal PROGRAM, address data ADATA, and program data PDATA are supplied. FIG. 4 is a time chart showing how the state switching signal WRT changes. Once the operation permission signal * CE and the write permission signal * WE once fall, the state switching signal WRT rises, and the memory cell of the flash memory (1) enters a writable state. When a series of write processing is completed, a write end signal EOW is generated, and the state switching signal WRT falls.
FIG. 5 is a time chart showing the operation when the state switching signal WRT is at the high level. When the state switching signal WRT rises, a predetermined number of program data PDATA within the range of 1 to 128 words is stored in the page buffer (2), and the flag of the flag circuit (3) corresponding to the storage address of the page buffer (2). Is set. After the storage in the page buffer (2) is completed, a predetermined time (for example, 30
After the elapse of 0 μsec), a read signal RECALL is generated, and the information of the designated page in the address area A of the flash memory (1) is read into the page buffer (2). However, the flag of the flag circuit (3) (logical value “1”)
The reading of the page buffer (2) corresponding to. As a result, when 128 words including different program data PDATA are prepared in the page buffer (2), an erase signal ERASE is generated and the designated page in the address area A of the flash memory (1) is electrically erased.
A write signal PROGRAM is generated and the value of the page buffer (2) is changed to the address area A of the flash memory (1).
To the specified page (the address specified by the address data ADATA). When the write operation to the flash memory (1) is completed, a write end signal EO
W is generated, and the state switching signal WRT falls. On the other hand, when executing a rewrite instruction for the address area B of the flash memory (1), it is necessary to read the rewrite instruction for the address area B of the flash memory (1).
The state switching signal W
It is necessary to periodically change RT to a rewrite permission level (logical value “1”) and a rewrite inhibition level (logical value “0”). In this case, the microcomputer supplies an operation enable signal * CE, a write enable signal * WE, a read enable signal * OE, and a write inhibit signal WI to the flash memory (1). FIG. 6 is a time chart showing a change state of the state switching signal WRT. When the operation permission signal * CE and the write permission signal * WE fall, the state switch signal WRT rises, and when the write inhibit signal WI occurs, the state switch signal WRT falls. During the high level period of the state switching signal WRT, the flash memory (1)
Becomes a writable state. After that, the operation permission signal * C
When E and the read enable signal * OE fall, the state switching signal WRT remains at the low level and does not change, so that the flash memory (1) is in a readable state. That is, when the state switching signal WRT is at a low level, a rewrite instruction for the address area B of the flash memory (1) is read,
When the state switching signal WRT is at a high level, a predetermined number of words of program data PDATA are stored in the page buffer (2) one word at a time in accordance with the result of decoding the rewrite instruction. However, the state switch signal WRT is transmitted to the page buffer (2) by the program data PDA of one word unit.
It falls every time TA is stored. That is, the flag of the flag circuit (3) is set each time the page buffer (2) stores the program data PDATA in units of one word, but is immediately reset by the falling edge of the state switching signal WRT immediately after. Therefore, the page buffer (2)
Is completed, the read signal
According to the LL, all information of the designated page in the address area A of the flash memory (1) is stored in the page buffer (2).
And the program change of the address area A of the flash memory (1) cannot be executed. The microcomputer shown in FIG. 3 can cope only with data rewriting using an external device. Accordingly, an object of the present invention is to provide a microcomputer which does not reset the flag circuit until the writing of the value of the buffer circuit to the nonvolatile memory is completed when the own program instruction is rewritten according to the rewriting instruction of the nonvolatile memory. And SUMMARY OF THE INVENTION The present invention has been made to solve the above-mentioned problem, and enables electrical erasure and rewriting of data in units of a fixed storage capacity in all storage areas. A nonvolatile memory, an operation enable signal for controlling the operation of the nonvolatile memory, a state of a write enable signal and a state of a read enable signal are identified, and a storage cell of the nonvolatile memory is switched between a write enable state and a write disable state at a fixed cycle. An identification circuit for generating a state switching signal for performing the operation, a buffer circuit having the same number of addresses as the fixed storage capacity area of the nonvolatile memory, and storing rewrite data of the nonvolatile memory; and an address of the buffer circuit. A flag that is set only on a one-to-one basis and that corresponds to a rewrite data storage address of the buffer circuit; A flag circuit that, when transferring the value of the fixed storage capacity area of the memory to the buffer circuit, prohibits a transfer operation only at a corresponding address of the buffer circuit in which the flag is set, and is reset by the state switching signal; In the microcomputer including, after transferring the value of the fixed storage capacity area of the nonvolatile memory to the buffer circuit,
A prohibition circuit is provided for prohibiting resetting of the flag circuit until writing of the value of the buffer circuit into the fixed storage capacity area of the nonvolatile memory is completed. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS The details of the present invention will be specifically described with reference to the drawings. FIG. 1 is a circuit block diagram showing a microcomputer of the present invention. In FIG. 1, the same components as those in FIG. 3 are denoted by the same reference numerals, and description thereof will be omitted. In FIG. 1, reference numeral (4) denotes a latch circuit which holds the state switching signal WRT in synchronization with the clock CLK. (5) is a register, a flash memory (1)
When rewriting the information of a specific page in the address area A of
It holds the logical value "1" transferred from the internal bus (6), and holds the output signal OUT1 of the latch circuit (4).
Is reset in response to the change from the logical value “0” to the logical value “1”. The output signal OUT2 of the register (5) and the state switching signal WRT are supplied to the reset terminal of the flag circuit (3) via the OR gate (7). The operation of FIG. 1 will be described with reference to the time chart of FIG. First, when the power is turned on and all the functional blocks inside the microcomputer become operable, the program counter (8) addresses the address area A of the flash memory (1), and the microcomputer operates the flash memory (1). Performs various logical operations in accordance with the result of decoding the program instruction read from the address area A. Thereafter, when an interrupt request is generated to rewrite the program instruction in the address area A of the flash memory (1) in page units, the value of the program counter (8) jumps from the address area A to the address area B, and the microcomputer reads the address. The rewriting operation of the program instruction in the address area A is started according to the decoding result of the rewriting instruction read from the area B. Since the program instruction in the address area A is rewritten by using the rewrite instruction in the address area B, the state switching signal WRT rises when the operation enable signal * CE and the write enable signal * WE fall and the write inhibit signal WI. Is a signal that repeats a so-called intermittent high level that falls when the signal occurs. The relationship between the state switching signal WRT and the clock CLK is such that when the state switching signal WRT intermittently repeats the high level and the low level, the clock CLK is generated in synchronization with the low level of the state switching signal WRT. That is, during a period in which the state switching signal WRT repeatedly changes periodically under the influence of the write inhibit signal WI, the output signal OUT1 of the latch circuit (4) is always at the low level, and accordingly, the output signal of the register (5) is changed. OUT2 is always at a high level without being reset, and the output of the OR gate (7) becomes equal to the output signal OUT2. At this time, the flag circuit (3) is not reset. Therefore, the program data PDAT of a predetermined number of words (range of 1 to 128) is stored in the page buffer (2).
Even if A is stored, the corresponding flag of the flag circuit (3) is not reset while being set. After the storing operation of the page buffer (2) is completed,
After a lapse of a predetermined time (for example, 300 μsec), a read signal RECALL is generated, and a program instruction of a designated page in the address area A is read into the page buffer (2). However, since the flag circuit (3) acts as a gate between the address area A and the page buffer (2),
Only the program instruction of the address corresponding to the flag (logical value “0”) of the flag circuit (3) among the program instructions of the designated page of the address area A is read into the page buffer (2). Therefore, the page buffer (2) stores 128 words including the new program instruction from the mask ROM or the PROM writer and the previous program instruction from the address area A. Thereafter, when the erase signal ERASE is generated and the entire contents of the designated page in the address area A are erased, the write signal PROGRAM is generated, and during that time, the write inhibit signal WI is not generated. That is, the state switching signal W
RT remains at the rising high level in response to the first fall of the operation enable signal * CE and the write enable signal * WE after the generation of the write signal PROGRAM. Therefore, the output signal OUT1 of the latch circuit (4) changes to high level in synchronization with the first clock CLK after the generation of the write signal PROGRAM, and the output signal OUT2 of the register (5) is reset and changes to low level. . However, since the output of the OR gate (7) is equal to the state of the state switching signal WRT (always high level), the flag circuit (3) is not reset. Then, the state switching signal WR
During the high level period of T, the value of the page buffer (2) is written to the specified page in the address area A while being automatically incremented. When the rewriting operation of the designated page in the address area A is completed, the write signal PROGRAM goes low, and accordingly, the state switching signal WRT also goes low. Accordingly, since the output of the OR gate (7) becomes low level, the flag circuit (3) is reset for the first time in a series of rewriting operations of the flash memory (1). According to the embodiment of the present invention, when the program instruction of the address area A is rewritten according to the rewrite instruction of the address area B (in the case of on-board rewrite), the following operation and effect can be obtained. That is, the address area A
Since the flag circuit (3) is not reset until the rewriting of the address is completed, even if a part of the designated page of the address area A is changed, only the new program instruction to be changed is stored in the page buffer (2). Thus, even if the program instruction of the specified page in the address area A is read into the page buffer (2), the disappearance of the new program instruction can be prevented. According to the present invention, a program instruction for executing various logical operations is stored in a part of the address area, and a rewrite instruction for rewriting the program instruction is stored in the remaining address areas. When a program instruction is rewritten in accordance with a rewrite instruction in a microcomputer having a built-in nonvolatile memory, the following effects are obtained. That is, since the flag circuit is not reset until the rewriting of a part of the address area is completed, even if a part of the designated page of the part of the address area is changed, a new program instruction to be changed is sent to the buffer circuit. It is only necessary to store the program instruction, and the advantage is obtained that even if the program instruction of the specified page in a part of the address area is read into the buffer circuit, the disappearance of the new program instruction can be prevented.

【図面の簡単な説明】 【図1】本発明のマイクロコンピュータを示すブロック
図である。 【図2】図1の動作を示すタイムチャートである。 【図3】従来のマイクロコンピュータを示すブロック図
である。 【図4】PROMライタを使用する場合における状態切
換信号の変化の様子を示すタイムチャートである。 【図5】PROMライタを使用する場合における各種信
号の変化の様子を示すタイムチャートである。 【図6】内部書き換えを行う場合の状態切換信号の変化
の様子を示すタイムチャートである。 【符号の説明】 (1) フラッシュメモリ (2) ページバッファ (3) フラグ回路 (4) ラッチ回路 (5) レジスタ (7) ORゲート
BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block diagram showing a microcomputer of the present invention. FIG. 2 is a time chart showing the operation of FIG. FIG. 3 is a block diagram showing a conventional microcomputer. FIG. 4 is a time chart showing how a state switching signal changes when a PROM writer is used. FIG. 5 is a time chart showing how various signals change when a PROM writer is used. FIG. 6 is a time chart showing how a state switching signal changes when an internal rewrite is performed. [Description of References] (1) Flash memory (2) Page buffer (3) Flag circuit (4) Latch circuit (5) Register (7) OR gate

Claims (1)

(57)【特許請求の範囲】 【請求項1】 全記憶領域のうち一定記憶容量単位でデ
ータの電気消去及び書き換えが可能な不揮発性メモリ
と、前記不揮発性メモリの動作を制御する動作許可信
号、書き込み許可信号及び読み出し許可信号の状態を識
別し、前記不揮発性メモリの記憶セルを一定周期で書き
込み許可状態又は書き込み禁止状態とする為の状態切換
信号を発生する識別回路と、前記不揮発性メモリの一定
記憶容量領域と等しいアドレス数を有し、前記不揮発性
メモリの書き換えデータを格納するバッファ回路と、前
記バッファ回路のアドレスと1対1に対応し且つ前記バ
ッファ回路の書き換えデータ格納アドレスに対応する位
置のみセットされるフラグを有し、前記不揮発性メモリ
の一定記憶容量領域の値を前記バッファ回路に転送する
時、前記フラグがセットされた前記バッファ回路の対応
アドレスのみ転送動作を禁止し、前記状態切換信号でリ
セットされるフラグ回路と、を含むマイクロコンピュー
タにおいて、 前記不揮発性メモリの一定記憶容量領域の値を前記バッ
ファ回路に転送した後、前記バッファ回路の値を前記不
揮発性メモリの一定記憶容量領域に書き込み終了する
迄、前記フラグ回路のリセットを禁止する禁止回路を備
えたことを特徴とするマイクロコンピュータ。
(57) [Claim 1] A non-volatile memory capable of electrically erasing and rewriting data in a fixed storage capacity unit of an entire storage area, and an operation permission signal for controlling the operation of the non-volatile memory An identification circuit for identifying a state of a write enable signal and a read enable signal, and generating a state switching signal for setting a storage cell of the nonvolatile memory to a write enable state or a write inhibit state at a fixed period; and A buffer circuit having the same number of addresses as the fixed storage capacity area, and storing rewrite data of the nonvolatile memory, and having a one-to-one correspondence with the address of the buffer circuit and corresponding to the rewrite data storage address of the buffer circuit. A flag that is set only at the position where the data is to be transferred, and transfers the value of the fixed storage capacity area of the nonvolatile memory to the buffer circuit. A flag circuit that prohibits a transfer operation only at a corresponding address of the buffer circuit in which the flag is set and is reset by the state switching signal, wherein the value of the fixed storage capacity area of the nonvolatile memory is A microcomputer comprising a prohibition circuit for prohibiting resetting of the flag circuit until the value of the buffer circuit is transferred to the buffer circuit and is written to a fixed storage area of the nonvolatile memory.
JP5836198A 1998-03-10 1998-03-10 Microcomputer Expired - Fee Related JP3510780B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5836198A JP3510780B2 (en) 1998-03-10 1998-03-10 Microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5836198A JP3510780B2 (en) 1998-03-10 1998-03-10 Microcomputer

Publications (2)

Publication Number Publication Date
JPH11259286A JPH11259286A (en) 1999-09-24
JP3510780B2 true JP3510780B2 (en) 2004-03-29

Family

ID=13082189

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5836198A Expired - Fee Related JP3510780B2 (en) 1998-03-10 1998-03-10 Microcomputer

Country Status (1)

Country Link
JP (1) JP3510780B2 (en)

Also Published As

Publication number Publication date
JPH11259286A (en) 1999-09-24

Similar Documents

Publication Publication Date Title
EP0991081B1 (en) Emulated EEPROM memory device and corresponding method
US5991197A (en) Semiconductor memory device having data protection feature
US6434658B1 (en) Memory device operable with a small-capacity buffer memory and having a flash memory
KR100375217B1 (en) Microcontroller incorporating an electrically rewritable non-volatile memory
US5845332A (en) Non-volatile memory, memory card and information processing apparatus using the same and method for software write protect control of non-volatile memory
KR100305490B1 (en) Nonvolatile memory control circuit
JP4034971B2 (en) Memory controller and memory system device
JP3197865B2 (en) Microcomputer
JP3510780B2 (en) Microcomputer
JP2004355699A (en) Nonvolatile memory device and semiconductor memory device
JP2003051195A (en) Semiconductor memory device
US20050262291A1 (en) Method to write in a non-volatile memory and system to implement such method
JP4661369B2 (en) Memory controller
JP2000276461A (en) Microcomputer
JPH103434A (en) Semiconductor disk device and its write system
JP3028567B2 (en) Microcomputer with built-in EEPROM
JP3695931B2 (en) Microcomputer
JPH0557680B2 (en)
JP4766781B2 (en) Semiconductor memory device
KR100965079B1 (en) Nonvolatile memory device
JP5052221B2 (en) Semiconductor integrated circuit
JP3824295B2 (en) Nonvolatile semiconductor memory device
JP2021125036A (en) Data processing unit
JPH08138005A (en) Data write system for flash memory card
KR100283908B1 (en) Data scaling circuit

Legal Events

Date Code Title Description
A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20031226

LAPS Cancellation because of no payment of annual fees