JP3695931B2 - Microcomputer - Google Patents

Microcomputer Download PDF

Info

Publication number
JP3695931B2
JP3695931B2 JP03013698A JP3013698A JP3695931B2 JP 3695931 B2 JP3695931 B2 JP 3695931B2 JP 03013698 A JP03013698 A JP 03013698A JP 3013698 A JP3013698 A JP 3013698A JP 3695931 B2 JP3695931 B2 JP 3695931B2
Authority
JP
Japan
Prior art keywords
data
flash memory
nonvolatile memory
write
address area
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
JP03013698A
Other languages
Japanese (ja)
Other versions
JPH11232175A (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 JP03013698A priority Critical patent/JP3695931B2/en
Publication of JPH11232175A publication Critical patent/JPH11232175A/en
Application granted granted Critical
Publication of JP3695931B2 publication Critical patent/JP3695931B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Storage Device Security (AREA)
  • Stored Programmes (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、データを一括又は部分的(ページ単位等)に電気消去でき且つデータを繰り返し書き込み及び読み出しできる不揮発性メモリ(フラッシュメモリ等)を内蔵したマイクロコンピュータに関する。
【0002】
【従来の技術】
1チップマイクロコンピュータは各種論理演算を実行する為のプログラムメモリを内蔵するが、大半の1チップマイクロコンピュータはマスクROMを内蔵してプログラムメモリとして機能させているのが現状である。この理由は、マスクROMが1チップマイクロコンピュータを小型化及び低価格化できる構造上の利点を有する為である。しかし、マスクROMは、集積後のプログラム内容が誤っていた場合、新たなプログラム開発を必要とする為、開発費が高くなると共に納期が遅れる欠点も有する。
【0003】
そこで、最近の1チップマイクロコンピュータは、データの電気消去及びデータの書き込み読み出しが可能な不揮発性メモリ(フラッシュメモリ)をマスクROMの代わりに内蔵し、マスクROMの欠点を補える様になっている。
図3は従来のマイクロコンピュータを示す回路ブロック図である。
図3において、(1)はクロックジェネレータであり、発振回路(水晶、セラミック等の発振振動子を設けた自走発振又は他走発振の何れでもよい)の発振クロックが供給され、発振クロックに分周等の論理処理を施して各種論理演算を実行する為のシステムクロックを発生するものである。
【0004】
(2)はフラッシュメモリ(不揮発性メモリ)であり、データを一括又は部分的(例えばページ(128ワード)単位)に電気消去でき且つデータを繰り返し書き込み及び読み出しできる特性を有する。フラッシュメモリ(2)はマイクロコンピュータのプログラムメモリとして機能し、アドレス領域Aの内部セルには各種論理演算を実行させる為のプログラム命令が格納され、アドレス領域Bの内部セルにはアドレス領域Aのプログラム命令を書き換える為の書き換え命令が格納されている。フラッシュメモリ(2)は、通常はアドレス領域Aが指定され、アドレス領域Aのプログラム内容を書き換える為の割り込み要求が発生した時のみアドレス領域Bが指定される様にアドレス領域Aからジャンプする。マイクロコンピュータは、フラッシュメモリ(2)のアドレス領域Aから読み出されたプログラム命令の解読結果に従って各種論理演算動作を実行し、一方、フラッシュメモリ(2)のアドレス領域Bから読み出された書き換え命令の解読結果に従って、アドレス領域Aの内容の書き換え動作を実行する。尚、フラッシュメモリ(2)のアドレス領域Aの書き換えデータは、マイクロコンピュータの内部に事前準備する方法(マスクROMを別途設けてテーブルデータとして格納する方法等)、又は、マイクロコンピュータの外部から供給する方法(PROMライタから供給する方法等)の何れでも良い。
【0005】
フラッシュメモリ(2)は、データ記憶用内部セルの他に、以下の周辺回路を含む。即ち、(3)はアドレスデコーダであり、フラッシュメモリ(2)をアドレス指定する為のアドレスデータ(mビット)を解読するものである。(4)は検出回路であり、フラッシュメモリ(2)のアドレス領域Aのプログラム命令が使用者の意思に反して誤って書き換えられる不都合を防止するものである。詳しくは、検出回路(4)は、複数のレジスタ(5)及びデコーダ(6)を含む。複数のレジスタ(5)は、フラッシュメモリ(2)のアドレス領域Aのプログラム命令(ページ単位)を書き換えようとする前段階で、使用者が予め用意した保護データ(AAH、55H等)を格納するものである。デコーダ(6)は、複数のレジスタ(5)の値が使用者の意図する値であるかどうかを解読し、複数のレジスタ(5)の全ての値が正しい場合はフラッシュメモリ(2)の書き換え動作を許可し、複数のレジスタ(5)の値が1つでも誤っている場合はフラッシュメモリ(2)の書き換え動作を禁止する様な論理構造となっている。(7)はページバッファ(スタティックRAM等の揮発性メモリ)であり、フラッシュメモリ(2)のアドレス領域Aのプログラム命令を1ページ単位で書き換える為の128ワードの記憶容量を有する。ページバッファ(7)は、自らをアドレス指定する為のインクリメント機能を有する。書き換えデータは、ページバッファ(7)に一旦格納された後、フラッシュメモリ(2)のアドレス領域Aの指定ページに書き込まれる。
(8)は識別回路であり、フラッシュメモリ(2)のアドレスA領域の内部セルを書き込み可能状態に設定する為の制御信号WRTを発生する。フラッシュメモリ(2)は、制御信号WRTがハイレベル(論理値「1」)となることによって書き込み可能状態となる。また、制御信号WRTは検出回路(4)にも供給され、複数のレジスタ(5)の値は、制御信号WRTがローレベル(論理値「0」)となることによってリセットされる。
【0006】
(9)は制御回路であり、フラッシュメモリ(2)のアドレス領域Aのプログラム命令の解読結果に従って動作し、識別回路(8)に対し、フラッシュメモリ(2)の為の動作許可信号*CE、書き込み許可信号*WE、読み出し許可信号*OE、書き込み禁止信号WIを供給するものである。識別回路(8)は、動作許可信号*CE及び書き込み許可信号*WEがローレベルに変化したことを検出して制御信号WRTをハイレベルとし、書き込み禁止信号WIが発生したことを検出して制御信号WRTをローレベルとする。尚、書き込み禁止信号WIは、フラッシュメモリ(2)のアドレス領域Bのプログラム命令の解読結果に従って、動作許可信号*CE及び書き込み許可信号*WEがローレベルに変化してから一定時間経過後に発生する。詳しくは、書き込み禁止信号WIは、動作許可信号*CE及び書き込み許可信号*WEがハイレベルに変化した直後から動作許可信号*CE及び読み出し許可信号*OEがローレベルに変化する迄の期間で発生する。
【0007】
(10)はCPUであり、フラッシュメモリ(2)のアドレス領域A及びBから読み出されたプログラム命令の解読結果に従って、各種論理演算動作を実行するものであり、ALU、ACC、各種レジスタ等を含む。(11)はプログラムカウンタであり、フラッシュメモリ(2)をアドレス指定する為のアドレスデータ(mビット)を発生するものである。プログラムカウンタ(11)は、フラッシュメモリ(2)から命令を読み出す時に使用する。(12)はm個のラッチ回路であり、フラッシュメモリ(2)のアドレス領域Bから読み出された書き換え命令の解読結果に従って、CPU(10)が発生するアドレス領域Aの一部領域を指定する為のアドレスデータ(mビット)をクロックCK0に同期してラッチするものである。同様に、(13)はm個のラッチ回路であり、フラッシュメモリ(2)のアドレス領域Aの書き換え用の新規プログラムデータ(nビット)をクロックCK1に同期してラッチするものである。ラッチ回路(12)(13)は、フラッシュメモリ(2)のアドレス領域Aのプログラム命令を書き換む時に使用する。ANDゲート(14)(15)及びORゲート(16)から成る切換回路は、プログラムカウンタ(11)又はラッチ回路(12)の何れか一方のアドレスデータをフラッシュメモリ(2)に切換出力するものである。(17)は選択回路であり、切換回路に切り換えを指示する為の選択信号SELECTを供給するものである。即ち、選択信号SELECTは、プログラムカウンタ(11)の値をフラッシュメモリ(2)に供給する時にハイレベルとなり、ラッチ回路(12)のQ端子の値をフラッシュメモリ(2)に供給する時にローレベルとなる。
【0008】
切換回路から切換出力されるアドレスデータは、フラッシュメモリ(2)をアドレス指定する為にアドレスデコーダ(3)に供給され且つ複数のレジスタ(5)を選択する為に検出回路(4)にも供給されるが、アドレスデコーダ(3)及び検出回路(4)が同時動作することがない為、何ら問題ない。ラッチ回路(13)から出力されるプログラムデータは複数のレジスタ(5)及びアドレス領域Aの内部セルに供給される。
【0009】
制御回路(9)の出力と識別回路(8)の出力との関係は図4のタイムチャートに示す通りである。即ち、制御信号WRTは書き込み禁止信号WIの作用でハイレベル及びローレベルを繰り返し、フラッシュメモリ(2)を書き込み可能状態又は読み出し可能状態に設定できる様になっている。
【0010】
【発明が解決しようとする課題】
ところで、フラッシュメモリ(2)が書き込み状態の場合、動作許可信号*CEが立ち下がった時点でアドレス指定を行い、動作許可信号*CEが立ち上がった時点でデータ書き込みを行うシーケンスである。その為、複数のレジスタ(5)に保護データを格納しても、複数のレジスタ(5)の内容は制御信号WRTがローレベルに変化する都度リセットされてしまい、これでは検出回路(4)を設けた意味がない。図3のマイクロコンピュータは、誤書き換え防止機能のないものと等価に過ぎない。
【0011】
そこで、本発明は、不揮発性メモリのプログラム内容が誤って書き換えられる不都合を防止できるマイクロコンピュータを提供することを目的とする。
【0012】
【課題を解決するための手段】
本発明は、前記問題点を解決する為に成されたものであり、データの電気消去及びデータの書き込み読み出しが可能な特性を有する不揮発性メモリを内蔵したマイクロコンピュータであって、前記不揮発性メモリが書き込みモードの時、前記不揮発性メモリを誤書き込みから保護する為の保護データが格納される保持回路と、前記保持回路の格納値の状態を検出し、前記格納値が正常である場合は前記不揮発性メモリのデータ書き換えを許可し、前記格納値が異常である場合は前記不揮発性メモリのデータ書き換えを禁止させる検出回路と、動作許可信号、書き込み許可信号、読み出し許可信号、書き込み禁止信号の状態変化を検出し、前記動作許可信号及び前記書き込み許可信号が第1論理レベルとなった時、前記不揮発性メモリの内部セルを書き込み可能状態とする為の制御信号を出力して前記不揮発性メモリを書き込みモードとし、前記動作許可信号及び前記書き込み許可信号が第1論理レベルとなった状態で前記書き込み禁止信号が発生した時、前記制御信号の出力を禁止すると共に前記保持回路の格納値をリセットし、前記動作許可信号及び前記読み出し許可信号が第1論理レベルとなった時、前記不揮発性メモリを読み出しモードとする識別回路と、前記保持回路が保護データを格納開始してから前記不揮発性メモリがデータ書き換えを終了する迄の間、前記制御信号を無視して前記不揮発性メモリを書き込みモードとする為の強制設定信号を出力する強制設定回路と、を備えたことを特徴とする。
【0013】
前記制御信号及び前記強制設定信号の論理和出力で前記不揮発性メモリ及び前記保持回路の状態を制御することを特徴とする。
【0014】
【発明の実施の形態】
本発明の詳細を図面に従って具体的に説明する。
図1は本発明のマイクロコンピュータを示す回路ブロック図である。尚、図1を説明する際、図3と同一素子については同一番号を記すと共にその説明を省略するものとする。
【0015】
図1において、(18)はフラグであり、制御回路(9)に内蔵され、制御信号WRTの状態と関係なくフラッシュメモリ(2)を強制的に書き込みモードとする為の強制設定信号PLが、フラッシュメモリ(2)のアドレス領域Bの書き換え命令の解読結果に従って設定されるものである。フラグ(18)は制御信号WRTが立ち下がった時にリセットされる。制御信号WRT及び強制設定信号PLはORゲート(19)を介して検出回路(4)のリセット端子に供給される。
【0016】
図1の動作を図2のタイムチャートを用いて説明する。
先ず、フラッシュメモリ(2)のアドレス領域Aのプログラム命令を書き換える為の割込み要求が発生すると、プログラムカウンタ(11)がアドレス領域Bを指定する為のアドレスデータを切換回路を介してアドレスデコーダ(3)に供給し、フラグ(18)の値はアドレス領域Bから読み出された書き換え命令の解読結果に従ってハイレベルとなる。これより、ORゲート(19)の出力は強制設定信号PLを優先し制御信号WRTの変化を無視してハイレベルとなり、検出回路(4)はリセット解除状態となる。そして、動作許可信号*CE及び書き込み許可信号*WEが立ち下がった時、複数のレジスタ(5)の何れか1つをアドレス指定し、その後、動作許可信号*CE及び書き込み許可信号*WEが立ち上がった時、アドレス指定された何れか1つのレジスタ(5)に保護データを格納し、その後、制御信号WRTが立ち下がる迄の期間でデコーダ(6)はそのレジスタ(5)の格納値が使用者の意図する値であるかどうかを解読する。複数のレジスタ(5)の数だけ、アドレス指定、保護データ格納、解読の一連の動作を繰り返す。複数のレジスタ(5)の格納値が1つでも使用者の意図する値と異なる場合は、フラッシュメモリ(2)のアドレス領域Aのプログラム命令が使用者の意思に反して誤書き換えされるものと判断し、書き換え動作を禁止する。一方、複数のレジスタ(5)の格納値が全て使用者の意図する値である場合は、フラッシュメモリ(2)のアドレス領域Aのプログラム命令の書き換え動作を許可する。これに伴い、ページバッファ(7)がインクリメント動作を開始し、1ページ(128ワード)分の新規プログラムデータが内部のROMテーブル又は外部のPROMライタから供給され書き込まれる。ページバッファ(7)の書き込みが終了すると、その後、動作許可信号*CE及び読み出し許可信号*OEがローレベルとなる期間において、フラッシュメモリ(2)のアドレス領域Bから読み出されたプログラム命令の解読結果に従って、ページバッファ(7)の内容をフラッシュメモリ(2)のアドレス領域Aに書き込む動作を開始する。詳しくは、動作許可信号*CE及び書き込み許可信号*WEが立ち下がると、書き込み禁止信号WIがローレベルに固定され制御信号WRTはページバッファ(7)からフラッシュメモリ(2)のアドレス領域Aの特定ページへの書き込み動作が終了する迄ハイレベルに固定される。この間、選択信号SELECTはローレベルに固定される。フラグ(18)の値は制御信号WRTの立ち下がりでリセットされる。よって、フラッシュメモリ(2)のアドレス領域Aのプログラム書き換え動作が終了すると、フラッシュメモリ(2)は制御信号WRTで制御される状態に戻る。
【0017】
以上より、強制設定信号PLの作用効果によって、複数の全レジスタ(5)に対するアドレス指定、保護データ格納、解読の一連の動作を実行でき、フラッシュメモリ(2)のアドレス領域Aのプログラム命令が誤書き換えされる不都合を防止できる。
【0018】
【発明の効果】
本発明によれば、強制設定信号の作用効果によって、複数の全保持回路に対するアドレス指定、保護データ格納、解読の一連の動作を実行でき、不揮発性メモリのプログラム命令が何らかの誤動作の影響で使用者の意思に反して誤書き換えされる様な不都合を防止できる利点が得られる。
【図面の簡単な説明】
【図1】本発明のマイクロコンピュータを示す回路ブロック図である。
【図2】図1の動作を示すタイムチャートである。
【図3】従来のマイクロコンピュータを示す回路ブロック図である。
【図4】図3の動作を示すタイムチャートである。
【符号の説明】
(2) フラッシュメモリ
(4) 検出回路
(5) レジスタ
(6) デコーダ
(7) ページバッファ
(8) 識別回路
(9) 制御回路
(18) フラグ
(19) ORゲート
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a microcomputer having a built-in nonvolatile memory (flash memory or the like) that can electrically erase data collectively or partially (page unit or the like) and can repeatedly write and read data.
[0002]
[Prior art]
One-chip microcomputers have a built-in program memory for executing various logical operations, but most one-chip microcomputers have a built-in mask ROM and function as a program memory. This is because the mask ROM has a structural advantage that enables the one-chip microcomputer to be reduced in size and price. However, since the mask ROM requires a new program development if the program content after integration is incorrect, it has a drawback that the development cost increases and the delivery time is delayed.
[0003]
Therefore, recent one-chip microcomputers have built-in a non-volatile memory (flash memory) capable of electrical erasure of data and writing / reading of data in place of the mask ROM to compensate for the disadvantages of the mask ROM.
FIG. 3 is a circuit block diagram showing a conventional microcomputer.
In FIG. 3, reference numeral (1) denotes a clock generator, which is supplied with an oscillation clock of an oscillation circuit (which may be either free-running oscillation or other-running oscillation provided with an oscillation oscillator such as crystal or ceramic), and is divided into oscillation clocks. A system clock is generated for performing various logical operations by performing logical processing such as circumference.
[0004]
(2) is a flash memory (nonvolatile memory), which has the characteristics that data can be electrically erased all at once or partially (for example, in units of pages (128 words)), and data can be repeatedly written and read. The flash memory (2) functions as a program memory of the microcomputer. Program commands for executing various logical operations are stored in the internal cells in the address area A, and the program in the address area A is stored in the internal cells in the address area B. A rewrite instruction for rewriting the instruction is stored. The flash memory (2) 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 (2), while the rewrite instruction read from the address area B of the flash memory (2). In accordance with the result of decoding, the rewriting operation of the contents of the address area A is executed. The rewrite data in the address area A of the flash memory (2) is supplied from the outside of the microcomputer by a method of preparing in advance inside the microcomputer (a method of separately providing a mask ROM and storing it as table data). Any of the methods (a method of supplying from a PROM writer, etc.) may be used.
[0005]
The flash memory (2) includes the following peripheral circuits in addition to the internal cell for data storage. In other words, (3) is an address decoder, which decodes address data (m bits) for addressing the flash memory (2). (4) is a detection circuit, which prevents inconvenience that the program instruction in the address area A of the flash memory (2) is erroneously rewritten against the intention of the user. Specifically, the detection circuit (4) includes a plurality of registers (5) and a decoder (6). The plurality of registers (5) store protection data (AAH, 55H, etc.) prepared in advance by the user at the stage before rewriting the program instruction (page unit) in the address area A of the flash memory (2). Is. The decoder (6) decodes whether or not the values of the plurality of registers (5) are values intended by the user, and rewrites the flash memory (2) if all the values of the plurality of registers (5) are correct. The logical structure is such that the operation is permitted and the rewrite operation of the flash memory (2) is prohibited when even one of the values of the plurality of registers (5) is incorrect. (7) is a page buffer (volatile memory such as static RAM), and has a storage capacity of 128 words for rewriting program instructions in the address area A of the flash memory (2) in units of one page. The page buffer (7) has an increment function for addressing itself. The rewritten data is temporarily stored in the page buffer (7) and then written to the designated page in the address area A of the flash memory (2).
(8) is an identification circuit for generating a control signal WRT for setting the internal cell in the address A area of the flash memory (2) to a writable state. The flash memory (2) is in a writable state when the control signal WRT becomes high level (logical value “1”). The control signal WRT is also supplied to the detection circuit (4), and the values of the plurality of registers (5) are reset when the control signal WRT becomes low level (logic value “0”).
[0006]
(9) is a control circuit, which operates according to the result of decoding the program instruction in the address area A of the flash memory (2), to the identification circuit (8), an operation permission signal * CE for the flash memory (2), A write enable signal * WE, a read enable signal * OE, and a write inhibit signal WI are supplied. The identification circuit (8) detects that the operation enable signal * CE and the write enable signal * WE have changed to a low level, sets the control signal WRT to a high level, and detects that the write inhibit signal WI has been generated and performs control. The signal WRT is set to low level. The write inhibit signal WI is generated after a predetermined time has elapsed since the operation enable signal * CE and the write enable signal * WE are changed to the low level according to the result of decoding the program instruction in the address area B of the flash memory (2). . Specifically, the write inhibit signal WI is generated in a period from immediately after the operation enable signal * CE and the write enable signal * WE change to the high level until the operation enable signal * CE and the read enable signal * OE change to the low level. To do.
[0007]
(10) is a CPU, which executes various logical operation operations according to the result of decoding the program instructions read from the address areas A and B of the flash memory (2). ALU, ACC, various registers, etc. Including. (11) is a program counter for generating address data (m bits) for addressing the flash memory (2). The program counter (11) is used when reading an instruction from the flash memory (2). (12) is m latch circuits, and designates a partial area of the address area A generated by the CPU (10) according to the result of decoding the rewrite instruction read from the address area B of the flash memory (2). Address data (m bits) is latched in synchronization with the clock CK0. Similarly, (13) is m latch circuits which latch new program data (n bits) for rewriting the address area A of the flash memory (2) in synchronization with the clock CK1. The latch circuits (12) and (13) are used when the program instruction in the address area A of the flash memory (2) is rewritten. The switching circuit comprising AND gates (14) and (15) and an OR gate (16) switches and outputs the address data of either the program counter (11) or the latch circuit (12) to the flash memory (2). is there. (17) is a selection circuit that supplies a selection signal SELECT for instructing the switching circuit to perform switching. That is, the selection signal SELECT becomes high level when the value of the program counter (11) is supplied to the flash memory (2), and low level when the value of the Q terminal of the latch circuit (12) is supplied to the flash memory (2). It becomes.
[0008]
The address data switched from the switching circuit is supplied to the address decoder (3) for addressing the flash memory (2) and also to the detection circuit (4) for selecting a plurality of registers (5). However, there is no problem because the address decoder (3) and the detection circuit (4) do not operate simultaneously. Program data output from the latch circuit (13) is supplied to a plurality of registers (5) and internal cells in the address area A.
[0009]
The relationship between the output of the control circuit (9) and the output of the identification circuit (8) is as shown in the time chart of FIG. In other words, the control signal WRT can be repeatedly set to the high level and the low level by the action of the write inhibit signal WI so that the flash memory (2) can be set to a writable state or a readable state.
[0010]
[Problems to be solved by the invention]
By the way, when the flash memory (2) is in the write state, the address designation is performed when the operation permission signal * CE falls, and the data is written when the operation permission signal * CE rises. Therefore, even if the protection data is stored in the plurality of registers (5), the contents of the plurality of registers (5) are reset each time the control signal WRT changes to the low level. There is no meaning provided. The microcomputer shown in FIG. 3 is only equivalent to one without an erroneous rewrite prevention function.
[0011]
SUMMARY OF THE INVENTION An object of the present invention is to provide a microcomputer that can prevent inconvenience that a program content in a nonvolatile memory is rewritten erroneously.
[0012]
[Means for Solving the Problems]
The present invention has been made to solve the above problems, and is a microcomputer incorporating a nonvolatile memory having characteristics capable of electrical erasing of data and writing / reading of data, wherein the nonvolatile memory Is in the write mode, a holding circuit for storing protection data for protecting the nonvolatile memory from erroneous writing, and a state of a stored value of the holding circuit are detected, and when the stored value is normal, A detection circuit that permits data rewriting of the nonvolatile memory and prohibits data rewriting of the nonvolatile memory when the stored value is abnormal, and states of an operation permission signal, a write permission signal, a read permission signal, and a write prohibition signal When a change is detected and the operation enable signal and the write enable signal become the first logic level, the internal memory of the nonvolatile memory is set. When the non-volatile memory is set to the write mode by outputting a control signal for making the write enable state, and the write inhibit signal is generated when the operation enable signal and the write enable signal are at the first logic level. An identification circuit that prohibits the output of the control signal and resets the stored value of the holding circuit, and sets the nonvolatile memory in the read mode when the operation permission signal and the read permission signal become the first logic level. And a compulsory setting signal for ignoring the control signal and setting the nonvolatile memory in a write mode from when the holding circuit starts storing protection data until the nonvolatile memory finishes data rewriting. And a compulsory setting circuit for outputting.
[0013]
The state of the nonvolatile memory and the holding circuit is controlled by a logical sum output of the control signal and the forced setting signal.
[0014]
DETAILED DESCRIPTION OF THE INVENTION
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 the description of FIG. 1, the same elements as those of FIG. 3 are denoted by the same reference numerals and the description thereof is omitted.
[0015]
In FIG. 1, (18) is a flag, which is built in the control circuit (9), and a forcible setting signal PL for forcibly setting the flash memory (2) to the write mode regardless of the state of the control signal WRT is It is set according to the result of decoding the rewrite command in the address area B of the flash memory (2). The flag (18) is reset when the control signal WRT falls. The control signal WRT and the forced setting signal PL are supplied to the reset terminal of the detection circuit (4) via the OR gate (19).
[0016]
The operation of FIG. 1 will be described with reference to the time chart of FIG.
First, when an interrupt request for rewriting the program command in the address area A of the flash memory (2) is generated, the address data for the program counter (11) to specify the address area B is sent via the switching circuit to the address decoder (3 ) And the value of the flag (18) becomes high level according to the result of decoding the rewrite instruction read from the address area B. As a result, the output of the OR gate (19) takes priority over the forcible setting signal PL and ignores the change in the control signal WRT, and the detection circuit (4) enters the reset release state. When the operation enable signal * CE and the write enable signal * WE fall, any one of the plurality of registers (5) is addressed, and then the operation enable signal * CE and the write enable signal * WE rise. When the protection data is stored in one of the addressed registers (5), the decoder (6) stores the stored value in the register (5) until the control signal WRT falls. Decipher whether the value is the intended value. A series of operations of address designation, protection data storage, and decryption are repeated by the number of the plurality of registers (5). If even one stored value of the plurality of registers (5) is different from the value intended by the user, the program command in the address area A of the flash memory (2) is erroneously rewritten against the user's intention. Judgment and rewrite operation are prohibited. On the other hand, when all the stored values of the plurality of registers (5) are values intended by the user, the rewrite operation of the program instruction in the address area A of the flash memory (2) is permitted. Accordingly, the page buffer (7) starts an increment operation, and new program data for one page (128 words) is supplied from the internal ROM table or the external PROM writer and written therein. When the writing of the page buffer (7) is completed, the program instruction read from the address area B of the flash memory (2) is decoded during the period when the operation enable signal * CE and the read enable signal * OE are at the low level. According to the result, the operation of writing the contents of the page buffer (7) into the address area A of the flash memory (2) is started. Specifically, when the operation enable signal * CE and the write enable signal * WE fall, the write inhibit signal WI is fixed at a low level, and the control signal WRT specifies the address area A of the flash memory (2) from the page buffer (7). It is fixed at the high level until the page write operation is completed. During this time, the selection signal SELECT is fixed at a low level. The value of the flag (18) is reset at the falling edge of the control signal WRT. Therefore, when the program rewrite operation in the address area A of the flash memory (2) is completed, the flash memory (2) returns to the state controlled by the control signal WRT.
[0017]
As described above, due to the effect of the forcible setting signal PL, a series of operations of address designation, protection data storage, and decryption for all the plurality of registers (5) can be executed, and the program instruction in the address area A of the flash memory (2) is erroneous Inconvenience of being rewritten can be prevented.
[0018]
【The invention's effect】
According to the present invention, a series of operations of address designation, protection data storage, and decryption for all the holding circuits can be executed by the effect of the forcible setting signal, and the program instruction of the nonvolatile memory is affected by some malfunction. There is an advantage that it is possible to prevent inconveniences such as erroneous rewriting against the will of the user.
[Brief description of the drawings]
FIG. 1 is a circuit block diagram showing a microcomputer of the present invention.
FIG. 2 is a time chart showing the operation of FIG. 1;
FIG. 3 is a circuit block diagram showing a conventional microcomputer.
4 is a time chart showing the operation of FIG. 3;
[Explanation of symbols]
(2) Flash memory (4) Detection circuit (5) Register (6) Decoder (7) Page buffer (8) Identification circuit (9) Control circuit (18) Flag (19) OR gate

Claims (1)

データの電気的消去及びデータの書き込み読み出しが可能な、一定記憶量の複数ブロックから成る不揮発性メモリを内蔵したマイクロコンピュータであって、
前記不揮発性メモリを誤書き込みから保護するための保護データが格納されるレジスタと、
前記保護データを検知し、前記不揮発性メモリを書き込み許可状態とするデコーダと、
前記一定記憶容量の複数ブロックの1ブロック分の格納容量を有し、前記書き込み許可状態に応じて、前記不揮発性メモリに書き込みデータを一旦格納するページバッファ回路と、
前記書き込みデータが前記ページバッファ回路から前記不揮発性メモリ内の1ブロックに移送される間、前記保護データが格納される前記レジスタをリセットする制御信号は前記マイクロコンピュータからの命令を解読した結果に応答して出力される強制設定信号によって無視され、前記レジスタに対し前記制御信号は無効となることで前記レジスタに格納された前記保護データを維持する強制設定回路と、を備えることを特徴とするマイクロコンピュータ。
A microcomputer having a built-in nonvolatile memory composed of a plurality of blocks having a fixed storage capacity capable of electrical data erasing and data writing / reading,
A register storing protection data for protecting the nonvolatile memory from erroneous writing;
A decoder that detects the protection data and sets the nonvolatile memory in a write-enabled state;
A page buffer circuit having a storage capacity for one block of the plurality of blocks having the constant storage capacity, and temporarily storing write data in the nonvolatile memory in accordance with the write permission state;
While the write data is transferred from the page buffer circuit to one block in the nonvolatile memory, a control signal for resetting the register in which the protection data is stored responds to a result of decoding a command from the microcomputer. And a forcible setting circuit that maintains the protection data stored in the register when the control signal is ignored for the register and is ignored by the forcible setting signal output. Computer.
JP03013698A 1998-02-12 1998-02-12 Microcomputer Expired - Fee Related JP3695931B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP03013698A JP3695931B2 (en) 1998-02-12 1998-02-12 Microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP03013698A JP3695931B2 (en) 1998-02-12 1998-02-12 Microcomputer

Publications (2)

Publication Number Publication Date
JPH11232175A JPH11232175A (en) 1999-08-27
JP3695931B2 true JP3695931B2 (en) 2005-09-14

Family

ID=12295364

Family Applications (1)

Application Number Title Priority Date Filing Date
JP03013698A Expired - Fee Related JP3695931B2 (en) 1998-02-12 1998-02-12 Microcomputer

Country Status (1)

Country Link
JP (1) JP3695931B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4734582B2 (en) * 2005-07-04 2011-07-27 日本電産サンキョー株式会社 Non-volatile memory data update method, control device, and data update program

Also Published As

Publication number Publication date
JPH11232175A (en) 1999-08-27

Similar Documents

Publication Publication Date Title
KR100408223B1 (en) A method and apparatus for hardware block locking in a nonvolatile memory
KR100375217B1 (en) Microcontroller incorporating an electrically rewritable non-volatile memory
KR100444537B1 (en) Data processor
US5890191A (en) Method and apparatus for providing erasing and programming protection for electrically erasable programmable read only memory
US7493484B2 (en) Method and apparatus for executing the boot code of embedded systems
US7155589B2 (en) Permanent memory block protection in a flash memory device
KR100305490B1 (en) Nonvolatile memory control circuit
US7580281B2 (en) Flash memory device with write protection
JPH10301855A (en) Semiconductor device and electronic equipment
US7249231B2 (en) Semiconductor memory with access protection scheme
US20100023780A1 (en) Flash device security method utilizing a check register
CN110968254A (en) Partition protection method and device for nonvolatile memory
US20040186947A1 (en) Access control system for nonvolatile memory
JP2002015584A (en) Read/protect circuit for non-volatile memory
JP3197865B2 (en) Microcomputer
JP3695931B2 (en) Microcomputer
JP2005107608A (en) Electronic device, nonvolatile memory, and method for rewriting data of nonvolatile memory
JP4031693B2 (en) Nonvolatile memory and data storage device having the same
JP2000276461A (en) Microcomputer
JP3028567B2 (en) Microcomputer with built-in EEPROM
JP3510780B2 (en) Microcomputer
JP4118023B2 (en) Memory control circuit
JP4848126B2 (en) Microcomputer, data protection method for nonvolatile memory in microcomputer
JP2004227509A (en) Storage means readout method and storage means readout circuit
JPH11232245A (en) Microcomputer

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040302

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040423

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050329

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050526

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20050621

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050628

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

Free format text: PAYMENT UNTIL: 20080708

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20090708

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20090708

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100708

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20110708

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20110708

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20120708

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20130708

Year of fee payment: 8

LAPS Cancellation because of no payment of annual fees