JPH09293063A - Microcomputer - Google Patents

Microcomputer

Info

Publication number
JPH09293063A
JPH09293063A JP8102535A JP10253596A JPH09293063A JP H09293063 A JPH09293063 A JP H09293063A JP 8102535 A JP8102535 A JP 8102535A JP 10253596 A JP10253596 A JP 10253596A JP H09293063 A JPH09293063 A JP H09293063A
Authority
JP
Japan
Prior art keywords
address
data
address area
eeprom
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.)
Pending
Application number
JP8102535A
Other languages
Japanese (ja)
Inventor
Toru Watanabe
徹 渡辺
Susumu Yamada
進 山田
Susumu Kubota
晋 久保田
Noriyuki Ogata
紀之 小片
Masanori Okubayashi
政則 奥林
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 JP8102535A priority Critical patent/JPH09293063A/en
Priority to US08/833,295 priority patent/US5991849A/en
Priority to KR1019970013004A priority patent/KR100255568B1/en
Publication of JPH09293063A publication Critical patent/JPH09293063A/en
Pending legal-status Critical Current

Links

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)
  • Microcomputers (AREA)

Abstract

PROBLEM TO BE SOLVED: To cancel incomvenience to rewrite data already written in an address by inhibiting the data rewriting operation of a non-volatile memory unless the size of an address area in the non-volatile memory is established. SOLUTION: An external equipment is connected to a one-chip microcomputer. When address data of the address area A of EEPROM 1 is supplied from the external equipment to the one-chip microcomputer and latched by a latch circuit 4, fear that the program of the address area A is rewritten exists. Then, an address detecting circuit 18 detects that address data outputted from the latch circuit 4 belongs to the address area A of EEPROM 1, keeps a mode control signal MODE to be in a high level and inhibits that EEPROM 1 becomes the writing mode. Thus, incomvenience that data of the address area A of EEPROM 1 is rewritten is eliminated.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、フラッシュメモリ
(EEPROM)を内蔵するマイクロコンピュータに関
する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microcomputer incorporating a flash memory (EEPROM).

【0002】[0002]

【従来の技術】1チップマイクロコンピュータとは、プ
ログラムメモリ(不揮発性メモリ)を同一チップ上に集
積化したものである。前記プログラムメモリには、マス
クROM、EPROM、EEPROM等が使用される。 (1)マスクROM内蔵の場合 複数枚のマスクを1度製造してしまえば、量産効率を向
上でき且つチップ面積を小さくできる利点がある。しか
し、プログラム変更が要求されると、複数枚のマスクを
再度製造する必要があり、多くの製造時間を要して前記
要求に迅速に対応できない欠点がある。 (2)EPROM内蔵の場合 現データを紫外線消去した後に新データを書き込むこと
で、プログラム変更に迅速に対応できる利点がある。し
かし、現データが全て紫外線消去されてしまい、消去不
要であった同一データを再度書き込まなければならない
欠点がある。 (3)EEPROM内蔵の場合 現データを電気的消去した後に新データを書き込むこと
で、プログラム変更に迅速に対応できる利点がある。ま
た、現データを部分的に消去できるので、消去不要のデ
ータをそのまま残すことができる。
2. Description of the Related Art A one-chip microcomputer is a program memory (nonvolatile memory) integrated on the same chip. A mask ROM, EPROM, EEPROM or the like is used as the program memory. (1) Built-in mask ROM If a plurality of masks are manufactured once, there is an advantage that mass production efficiency can be improved and a chip area can be reduced. However, when a program change is required, it is necessary to manufacture a plurality of masks again, which requires a lot of manufacturing time and cannot meet the request promptly. (2) Built-in EPROM There is an advantage that the program change can be promptly dealt with by writing the new data after erasing the current data with ultraviolet rays. However, all of the current data is erased by ultraviolet rays, and the same data that did not need to be erased must be rewritten. (3) Built-in EEPROM By electrically erasing the current data and then writing new data, there is an advantage that the program can be promptly changed. Moreover, since the current data can be partially erased, the data that does not need to be erased can be left as it is.

【0003】さて、最近の1チップマイクロコンピュー
タは、前記各不揮発性メモリの利点を利用し、EEPR
OMを内蔵する傾向が高い。前記EEPROMは、1チ
ップマイクロコンピュータの動作制御の為のプログラム
メモリとして使用される。ここで、前記EEPROMの
アドレス領域の内、第1アドレス領域はデータ書き換え
が行われないマスクROMと同等に取り扱われる領域、
残余の第2アドレス領域は必要に応じてデータ書き換え
が行われる領域とする。
Now, the recent one-chip microcomputer utilizes the advantages of the above-mentioned non-volatile memories and uses the EEPR.
There is a high tendency to incorporate OM. The EEPROM is used as a program memory for controlling the operation of the one-chip microcomputer. Here, of the address areas of the EEPROM, the first address area is an area which is treated in the same manner as a mask ROM in which data is not rewritten,
The remaining second address area is an area where data is rewritten as necessary.

【0004】[0004]

【発明が解決しようとする課題】ところで、前記EEP
ROMは書き込み済データを電気的に消去できる特性を
有しているが、第1アドレス領域はマスクROMと同等
に取り扱われる為、第1アドレス領域のデータが消去さ
れる様な誤動作は禁止する必要がある。しかしながら、
外部機器と前記1チップマイクロコンピュータとを接続
し、前記外部機器から前記1チップマイクロコンピュー
タに前記EEPROMの第1アドレス領域のアドレスデ
ータを供給した場合、前記EEPROMの第1アドレス
領域のデータ書き換えを禁止する術が無い為、前記EE
PROMの第1アドレス領域のプログラムが一部変更さ
れてしまい、この結果、前記1チップマイクロコンピュ
ータが誤動作してしまう問題があった。
By the way, the above-mentioned EEP
The ROM has a characteristic that the written data can be electrically erased. However, since the first address area is handled in the same manner as the mask ROM, it is necessary to prohibit the malfunction such that the data in the first address area is erased. There is. However,
When an external device is connected to the 1-chip microcomputer and the address data of the first address area of the EEPROM is supplied from the external device to the 1-chip microcomputer, rewriting of data in the first address area of the EEPROM is prohibited. Because there is no way to do it, EE
There is a problem that the program in the first address area of the PROM is partially changed, and as a result, the one-chip microcomputer malfunctions.

【0005】この問題を解決するには、前記外部機器か
ら前記1チップマイクロコンピュータに供給されるアド
レスデータが前記EEPROMの第1及び第2アドレス
領域の何れに属するのかを検出する手段を設け、前記ア
ドレスデータが前記第1アドレス領域に属した場合は、
前記EEPROMのデータ書き換えを禁止する様に動作
させれば良い。
In order to solve this problem, means for detecting whether the address data supplied from the external device to the one-chip microcomputer belongs to the first or second address area of the EEPROM is provided. If the address data belongs to the first address area,
It may be operated so as to prohibit the rewriting of data in the EEPROM.

【0006】一方、前記検出手段を設けたとしても、前
記EEPROMの第1アドレス領域のアドレス数は、固
定されたままであり、前記1チップマイクロコンピュー
タと接続される外部機器の種類に応じて可変することが
できない。特に、外部機器の種類によっては、前記EE
PROMの第1アドレス領域を拡大しないと、前記1チ
ップマイクロコンピュータを適用できない場合がある。
従って、前記1チップマイクロコンピュータの適用範囲
が制限されてしまう問題があった。
On the other hand, even if the detecting means is provided, the number of addresses in the first address area of the EEPROM remains fixed and varies according to the type of external equipment connected to the one-chip microcomputer. I can't. In particular, depending on the type of external device, the EE
The 1-chip microcomputer may not be applicable unless the first address area of the PROM is expanded.
Therefore, there is a problem that the applicable range of the one-chip microcomputer is limited.

【0007】この問題を解決するには、前記1チップマ
イクロコンピュータがリセット解除された時、レジスタ
から前記検出手段に、前記EEPROMの第1及び第2
アドレス領域の境とすべきアドレスを設定する様に構成
すれば良い。しかし、前記1チップマイクロコンピュー
タがリセット解除された時、何らかの要因により、前記
EEPROMの第1及び第2アドレス領域の境とすべき
アドレスが前記レジスタにセットされない恐れがある。
この場合、使用者が希望しない不定のアドレスが前記検
出手段に設定されることになる。従って、前記EEPR
OMの書き換え不要なアドレスの書き込みデータを書き
換えてしまう問題があった。
In order to solve this problem, when the one-chip microcomputer is released from reset, the first and second EEPROMs of the EEPROM are transferred from the register to the detection means.
It may be configured to set an address that should be the boundary of the address area. However, when the one-chip microcomputer is released from the reset state, an address which should be the boundary between the first and second address areas of the EEPROM may not be set in the register due to some factors.
In this case, an indeterminate address that the user does not want is set in the detection means. Therefore, the EEPR
There is a problem that the write data of the address that does not need to be rewritten in the OM is rewritten.

【0008】そこで、本発明は、マイクロコンピュータ
のリセット解除後、不揮発性メモリの第1アドレス領域
の大きさが確定していない時、不揮発性メモリのデータ
書き換え動作を禁止させるマイクロコンピュータを提供
することを目的とする。
Therefore, the present invention provides a microcomputer for prohibiting the data rewriting operation of the non-volatile memory when the size of the first address area of the non-volatile memory is not fixed after reset release of the microcomputer. With the goal.

【0009】[0009]

【課題を解決するための手段】本発明は、前記問題点を
解決する為に成されたものであり、データを繰り返し書
き込み及び読み出しできると共に書き込み済のデータを
電気的に消去できるメモリであって,第1アドレス領域
を、残余の第2アドレス領域のデータを書き換える為の
プログラム領域に割り当てた不揮発性メモリと、前記不
揮発性メモリの第1アドレス領域又は第2アドレス領域
の何れが指定されたのかを検出し、前記不揮発性メモリ
の第1アドレス領域が指定された時、前記不揮発性メモ
リのデータ書き換え動作を禁止させるアドレス検出回路
と、マイクロコンピュータがリセット解除された時、前
記不揮発性メモリの第1アドレス領域及び第2アドレス
領域の境とすべきアドレスを、前記アドレス検出回路に
設定させる設定回路と、前記マイクロコンピュータのリ
セット解除後、何らかの要因により前記不揮発性メモリ
の第1アドレス領域及び第2アドレス領域の境とすべき
アドレスが前記設定回路から前記アドレス検出回路に設
定されない時、前記不揮発性メモリの如何なるアドレス
領域が指定される場合であっても、前記不揮発性メモリ
のデータ書き換え動作を禁止させる禁止回路と、を備え
た点である。
SUMMARY OF THE INVENTION The present invention has been made to solve the above problems, and provides a memory capable of repeatedly writing and reading data and electrically erasing written data. , A non-volatile memory in which the first address area is assigned to a program area for rewriting data of the remaining second address area, and which of the first address area and the second address area of the non-volatile memory is designated And a first address area of the non-volatile memory is designated, an address detection circuit for prohibiting the data rewriting operation of the non-volatile memory and a reset of the non-volatile memory when the microcomputer is released from reset. A setting time that causes the address detection circuit to set an address that should be the boundary between the first address area and the second address area. When the address which should be the boundary between the first address area and the second address area of the non-volatile memory is not set from the setting circuit to the address detection circuit for some reason after the reset release of the microcomputer, the non-volatile It is provided with a prohibition circuit for prohibiting the data rewriting operation of the non-volatile memory regardless of which address area of the memory is designated.

【0010】[0010]

【発明の実施の形態】本発明の詳細を図面に従って具体
的に説明する。図1は本発明のマイクロコンピュータを
示す回路ブロック図であり、1チップ上に集積化され
る。図2は図1の動作を説明する為のタイムチャートで
ある。図1において、(1)はEEPROMである。E
EPROM(1)は、データを繰り返し書き込み及び読
み出しできると共に書き込み済データを電気的に消去で
きる不揮発性メモリである。EEPROM(1)のアド
レス領域Aは、残余のアドレス領域Bのデータ書き換え
用のプログラム領域に割り当てられ、アドレス領域B
は、1チップマイクロコンピュータの動作制御等の為の
データ領域に割り当てられる。EEPROM(1)は、
アドレスデータが印加される端子AD、書き込みデータ
が印加される端子DIN、読み出しデータが出力される
端子DOUT、書き込みモード設定信号が印加される端
子WEを有している。尚、EEPROM(1)のアドレ
ス領域Aのプログラムは、外部PROMライタ(図示せ
ず)からEEPROM(1)にデータを供給することに
より容易に変更でき、プログラム変更に迅速に対応でき
る。
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, which is integrated on one chip. FIG. 2 is a time chart for explaining the operation of FIG. In FIG. 1, (1) is an EEPROM. E
The EPROM (1) is a non-volatile memory capable of repeatedly writing and reading data and electrically erasing written data. The address area A of the EEPROM (1) is allocated to the program area for data rewriting of the remaining address area B, and the address area B
Is assigned to a data area for controlling operation of the one-chip microcomputer. EEPROM (1) is
It has a terminal AD to which address data is applied, a terminal DIN to which write data is applied, a terminal DOUT to which read data is output, and a terminal WE to which a write mode setting signal is applied. The program in the address area A of the EEPROM (1) can be easily changed by supplying data from the external PROM writer (not shown) to the EEPROM (1), and the program can be quickly changed.

【0011】(2)はCPUであり、EEPROM
(1)の端子DOUTからの読み出しデータに基づいて
動作するものである。CPU(2)は、プログラムカウ
ンタ(3)、インストラクションレジスタ、インストラ
クションデコーダ、演算論理ユニット等、論理動作を実
行するのに必要な構成を含むものとする。(4)はラッ
チ回路であり、EEPROM(1)のアドレスデータの
ビット数mと等しい個数だけ設けられる。ラッチ回路
(4)のL端子はアドレスバス(5)m本を介してCP
U(2)のアドレス端子と並列接続され、C端子はCP
U(2)のクロック端子と共通接続される。即ち、ラッ
チ回路(4)は、クロックCK0に同期してアドレスデ
ータをラッチする。
(2) is a CPU, which is an EEPROM
It operates based on the read data from the terminal DOUT in (1). The CPU (2) is assumed to include a program counter (3), an instruction register, an instruction decoder, an arithmetic logic unit, and the like, which are necessary for executing a logical operation. Reference numeral (4) is a latch circuit, which is provided in a number equal to the number of bits m of the address data of the EEPROM (1). The L terminal of the latch circuit (4) is CP via the address bus (5) m lines.
U (2) address terminal is connected in parallel, C terminal is CP
It is commonly connected to the clock terminal of U (2). That is, the latch circuit (4) latches the address data in synchronization with the clock CK0.

【0012】(6)はラッチ回路であり、EEPROM
(1)の1バイトのビット数nと等しい個数だけ設けら
れる。ラッチ回路(6)のL端子はデータバス(7)n
本を介してCPU(2)のデータ端子と並列接続され、
C端子はCPU(2)の他のクロック端子と共通接続さ
れ、Q端子はEEPROM(1)の端子DINと接続さ
れる。即ち、ラッチ回路(6)は、クロックCK1に同
期して書き込みデータをラッチすると共にEEPROM
(1)に供給する。
(6) is a latch circuit, which is an EEPROM
A number equal to the bit number n of 1 byte in (1) is provided. The L terminal of the latch circuit (6) is the data bus (7) n
Connected in parallel with the data terminal of the CPU (2) via a book,
The C terminal is commonly connected to the other clock terminal of the CPU (2), and the Q terminal is connected to the terminal DIN of the EEPROM (1). That is, the latch circuit (6) latches the write data in synchronization with the clock CK1 and the EEPROM
Supply to (1).

【0013】ANDゲート(8)(9)及びORゲート
(10)は切換回路を構成する。該切換回路は、ラッチ
回路(4)と等しい個数mだけ設けられる。ANDゲー
ト(8)の一方の入力端子はプログラムカウンタ(3)
の出力端子と接続され、ANDゲート(9)の一方の入
力端子はラッチ回路(4)のQ端子と接続され、ORゲ
ート(10)の出力端子はEEPROM(1)の端子A
Dと接続される。即ち、切換回路は、後述する選択信号
SELECTに応じて、プログラムカウンタ(3)又は
ラッチ回路(4)の何れか一方のアドレスデータをEE
PROM(1)に供給する。
The AND gates (8) and (9) and the OR gate (10) form a switching circuit. The switching circuits are provided by the same number m as the latch circuits (4). One input terminal of the AND gate (8) is a program counter (3)
Of the AND gate (9), one input terminal of the AND gate (9) is connected to the Q terminal of the latch circuit (4), and the output terminal of the OR gate (10) is the terminal A of the EEPROM (1).
Connected with D. That is, the switching circuit EE sets the address data of either the program counter (3) or the latch circuit (4) according to the selection signal SELECT which will be described later.
Supply to PROM (1).

【0014】(11)はメモリ制御回路である。EEP
ROM(1)からアドレス領域Bのデータ書き換えを開
始するプログラム命令が読み出された時、CPU(2)
は該プログラム命令を解読してスタートパルスSTAR
Tを出力する。メモリ制御回路(11)は、スタートパ
ルスSTARTの立ち下がりを検出し、ここから時間T
1だけ経過した後に時間T2だけローレベルとなるモー
ド制御信号MODEを出力し、EEPROM(1)の端
子WEに供給する。従って、EEPROM(1)は、モ
ード制御信号MODEがローレベルとなる期間T2の
み、書き込みモードに設定される。尚、期間T2は、E
EPROM(1)が指定されたアドレスにデータを書き
込む為に必要十分な時間に設定されている。メモリ制御
回路(11)は、モード制御信号MODEの立ち上がり
を検出し、エンドパルスENDを出力する。メモリ制御
回路(11)は、スタートパルスSTARTの立ち下が
りからエンドパルスENDの立ち下がりまでの期間の
み、ローレベルとなる選択信号SELECTを出力す
る。従って、前記切換回路は、選択信号SELECTが
ローレベルとなる期間のみ、プログラムカウンタ(3)
の出力を遮断し、ラッチ回路(4)の出力をEEPRO
M(1)の端子ADに供給する。
(11) is a memory control circuit. EEP
When the program instruction for starting the data rewriting of the address area B is read from the ROM (1), the CPU (2)
Decodes the program command to start pulse STAR
Output T. The memory control circuit (11) detects the trailing edge of the start pulse START, and the time T
A mode control signal MODE that goes low for a time T2 after a lapse of 1 is output and supplied to the terminal WE of the EEPROM (1). Therefore, the EEPROM (1) is set to the write mode only during the period T2 when the mode control signal MODE is at the low level. The period T2 is E
The EPROM (1) is set to a time necessary and sufficient for writing data to the specified address. The memory control circuit (11) detects the rising edge of the mode control signal MODE and outputs an end pulse END. The memory control circuit (11) outputs the selection signal SELECT that becomes a low level only during the period from the fall of the start pulse START to the fall of the end pulse END. Therefore, the switching circuit has the program counter (3) only while the selection signal SELECT is at a low level.
The output of the latch circuit (4) and the output of the latch circuit (4) is EEPRO.
It is supplied to the terminal AD of M (1).

【0015】(12)はCPU制御回路である。EEP
ROM(1)の1命令の実行時間はμsec単位である
が、EEPROM(1)のデータ書き込み時間はmse
c単位と非常に長い。そこで、EEPROM(1)が書
き込みモードとなる期間T2は、CPU(2)がEEP
ROM(1)の端子DOUTの不定出力の影響を受ける
のを禁止し、プログラムカウンタ(3)の値を現状のま
ま停止させる必要がある。CPU制御回路(12)は、
スタートパルスSTARTの立ち下がりからエンドパル
スENDの立ち下がりまでの期間のみ、禁止信号INH
を出力する。CPU(2)は、禁止信号INHを検出
し、前記禁止動作を行う。
(12) is a CPU control circuit. EEP
The execution time of one instruction of the ROM (1) is a unit of μsec, but the data writing time of the EEPROM (1) is mse.
Very long with c units. Therefore, during the period T2 when the EEPROM (1) is in the write mode, the CPU (2) is in the EEP.
It is necessary to prohibit the influence of the indefinite output of the terminal DOUT of the ROM (1) and stop the value of the program counter (3) as it is. The CPU control circuit (12)
Only during the period from the fall of the start pulse START to the fall of the end pulse END, the inhibit signal INH
Is output. The CPU (2) detects the prohibition signal INH and performs the prohibition operation.

【0016】(13)はクロックジェネレータであり、
クロックCKをCPU(2)に供給する。CPU(2)
は、クロックCKを基に、1チップマイクロコンピュー
タを動作させる為のシステムクロックを作成する。以
下、図1の動作を図2のタイムチャートを基に説明す
る。尚、初期状態では、モード制御信号MODE及び選
択信号SELECTはハイレベルであり、EEPROM
(1)は、プログラムカウンタ(3)でアドレス指定さ
れる読み出しモードに設定されているものとする。ま
た、プログラム命令Xはアドレスデータをラッチ回路
(4)にラッチさせる命令、プログラム命令X+1は書
き込みデータをラッチ回路(6)にラッチさせる命令、
プログラム命令X+2はEEPROM(1)にデータを
書き込ませる命令である。
(13) is a clock generator,
The clock CK is supplied to the CPU (2). CPU (2)
Creates a system clock for operating the one-chip microcomputer based on the clock CK. Hereinafter, the operation of FIG. 1 will be described based on the time chart of FIG. In the initial state, the mode control signal MODE and the selection signal SELECT are high level, and the EEPROM
It is assumed that (1) is set to the read mode addressed by the program counter (3). A program instruction X is an instruction to cause the latch circuit (4) to latch the address data, and a program instruction X + 1 is an instruction to cause the latch circuit (6) to latch the write data.
The program command X + 2 is a command for writing data in the EEPROM (1).

【0017】EEPROM(1)の端子DOUTからプ
ログラム命令Xが読み出されると、該プログラム命令X
がCPU(2)で解読され、アドレスデータがクロック
CK0に同期してラッチ回路(4)にラッチされる。プ
ログラムカウンタ(3)が所定値インクリメントされ、
EEPROM(1)の端子DOUTからプログラム命令
X+1が読み出されると、該プログラム命令X+1がC
PU(2)で解読され、書き込みデータがクロックCK
1に同期してラッチ回路(6)にラッチされる。
When the program command X is read from the terminal DOUT of the EEPROM (1), the program command X
Is decoded by the CPU (2), and the address data is latched in the latch circuit (4) in synchronization with the clock CK0. The program counter (3) is incremented by a predetermined value,
When the program instruction X + 1 is read from the terminal DOUT of the EEPROM (1), the program instruction X + 1 is C
The data is decoded by PU (2) and the write data is clocked by CK.
It is latched by the latch circuit (6) in synchronization with 1.

【0018】プログラムカウンタ(3)が所定値インク
リメントされ、EEPROM(1)の端子DOUTから
プログラム命令X+2が読み出されると、該プログラム
命令X+2はCPU(2)で解読される。すると、スタ
ートパルスSTARTが発生する。選択信号SELEC
TはスタートパルスSTARTの立ち下がりを受けてロ
ーレベルに変化する。モード選択信号MODEは、スタ
ートパルスSTARTの立ち下がりから時間T0が経過
した後に時間T1だけローレベルに変化し、その後、ハ
イレベルに復帰する。エンドパルスENDはモード制御
信号MODEのハイレベルへの復帰を受けて発生する。
前記選択信号SELECTはエンドパルスENDの立ち
下がりを受けてハイレベルに変化する。
When the program counter (3) is incremented by a predetermined value and the program instruction X + 2 is read from the terminal DOUT of the EEPROM (1), the program instruction X + 2 is decoded by the CPU (2). Then, the start pulse START is generated. Selection signal SELECT
T changes to low level in response to the fall of the start pulse START. The mode selection signal MODE changes to the low level for the time T1 after the time T0 has elapsed from the fall of the start pulse START, and then returns to the high level. The end pulse END is generated in response to the return of the mode control signal MODE to the high level.
The selection signal SELECT changes to high level in response to the fall of the end pulse END.

【0019】従って、EEPROM(1)のアドレス領
域Bのデータを書き換える期間は禁止信号INHが発生
し、これより、CPU(2)は、EEPROM(1)の
端子DOUTの不定出力の影響を無視でき、且つ、前記
システムクロックを停止させてプログラムカウンタ
(3)の値をスタートパルスSTARTが発生した時の
まま保持できる。この結果、EEPROM(1)のデー
タ書き換え時におけるCPU(2)の誤動作を防止でき
る。
Therefore, the inhibit signal INH is generated during the period in which the data in the address area B of the EEPROM (1) is rewritten, so that the CPU (2) can ignore the influence of the undefined output of the terminal DOUT of the EEPROM (1). Moreover, the value of the program counter (3) can be held as it is when the start pulse START is generated by stopping the system clock. As a result, malfunction of the CPU (2) at the time of rewriting the data of the EEPROM (1) can be prevented.

【0020】さて、図1において、(14)はRSフリ
ップフロップであり、S端子には1チップマイクロコン
ピュータの為のリセット信号RESET(ハイアクティ
ブ)が印加され、R端子には立ち下がり検出回路(1
5)を介して書き込みパルスWRITE(ハイアクティ
ブ)が印加される。即ち、RSフリップフロップ(1
4)は、前記1チップマイクロコンピュータがリセット
されている時にセットされ、前記1チップマイクロコン
ピュータがリセット解除された後、書き込みパルスWR
ITEが立ち下がった時にリセットされる。(16)は
ANDゲートであり、一方の入力端子にはRSフリップ
フロップ(14)のQ端子の出力STOPが印加され、
他方の入力端子には書き込みパルスWRITEが印加さ
れる。即ち、ANDゲート(16)からは、前記1チッ
プマイクロコンピュータがリセット解除された後、書き
込みパルスWRITEが何回発生したとしても1回のみ
通過される。(17)はレジスタであり、ANDゲート
(16)から出力される書き込みパルスWRITEに同
期して、EEPROM(1)のアドレス領域Aの最終ア
ドレスデータがセットされるものである。即ち、レジス
タ(17)は、前記1チップマイクロコンピュータがリ
セット解除された後、プログラム命令が実行されること
により、EEPROM(1)のアドレス領域Aの最終ア
ドレスデータが1回のみセットされる。
Now, in FIG. 1, (14) is an RS flip-flop, a reset signal RESET (high active) for a one-chip microcomputer is applied to the S terminal, and a falling detection circuit ( 1
A write pulse WRITE (high active) is applied via 5). That is, the RS flip-flop (1
4) is set when the one-chip microcomputer is reset, and the write pulse WR is set after the one-chip microcomputer is released from reset.
It is reset when ITE falls. (16) is an AND gate, the output STOP of the Q terminal of the RS flip-flop (14) is applied to one input terminal,
The write pulse WRITE is applied to the other input terminal. That is, from the AND gate (16), the write pulse WRITE is passed only once, no matter how many times it is generated after the reset of the one-chip microcomputer is released. Reference numeral (17) is a register for setting the final address data of the address area A of the EEPROM (1) in synchronization with the write pulse WRITE output from the AND gate (16). That is, in the register (17), the final address data of the address area A of the EEPROM (1) is set only once by executing the program instruction after the reset of the one-chip microcomputer is released.

【0021】(18)はアドレス検出回路であり、レジ
スタ(17)から出力されるEEPROM(1)のアド
レス領域Aの最終アドレスデータと、ラッチ回路(4)
から出力されるアドレスデータとを比較し、この比較結
果に基づき、メモリ制御回路(11)を制御するもので
ある。さて、EEPROM(1)のアドレス領域Aはア
ドレス領域Bのデータを書き換える為のプログラム領域
の為、アドレス領域Aのデータが書き換えられる様な不
具合が生じてはならない。前記1チップマイクロコンピ
ュータ内部で、EEPROM(1)のアドレス領域Bの
データを書き換える場合は、アドレス領域Aのデータが
書き換えられる様な不都合は生じない。ところが、外部
機器と前記1チップマイクロコンピュータとを接続し、
前記外部機器から前記1チップマイクロコンピュータに
EEPROM(1)のアドレス領域Aのアドレスデータ
が供給されラッチ回路(4)にラッチされた場合、アド
レス領域Aのプログラムが書き換えられてしまう恐れが
ある。そこで、アドレス検出回路(18)は、ラッチ回
路(4)から出力されるアドレスデータがEEPROM
(1)のアドレス領域Aに属していることを検出し、モ
ード制御信号MODEをハイレベルのままとし、EEP
ROM(1)が書き込みモードとなるのを禁止する。こ
れより、EEPROM(1)のアドレス領域Aのデータ
が書き換えられる不具合を解消できる。
Reference numeral (18) is an address detection circuit, which outputs the final address data of the address area A of the EEPROM (1) output from the register (17) and the latch circuit (4).
The memory control circuit (11) is controlled based on the comparison result with the address data output from the memory. Since the address area A of the EEPROM (1) is a program area for rewriting the data of the address area B, the problem that the data of the address area A is rewritten should not occur. When the data in the address area B of the EEPROM (1) is rewritten inside the one-chip microcomputer, the problem that the data in the address area A is rewritten does not occur. However, connecting an external device to the 1-chip microcomputer,
When the address data of the address area A of the EEPROM (1) is supplied from the external device to the one-chip microcomputer and latched by the latch circuit (4), the program of the address area A may be rewritten. Therefore, the address detection circuit (18) outputs the address data output from the latch circuit (4) to the EEPROM.
Detecting that it belongs to the address area A of (1), the mode control signal MODE is kept at the high level, and the EEP
The ROM (1) is prohibited from entering the write mode. As a result, it is possible to solve the problem that the data in the address area A of the EEPROM (1) is rewritten.

【0022】また、レジスタ(17)に任意のアドレス
データをセットできる為、EEPROM(1)のデータ
書き換え禁止領域、即ち、アドレス領域Aを拡大又は縮
小できる。例えば、外部機器がパーソナルコンピュータ
の場合、パーソナルコンピュータはEEPROM(1)
のアドレス領域Bのプログラムに基づいて動作するが、
パーソナルコンピュータは複雑且つ多数の動作を行う
為、EEPROM(1)のアドレス領域Aを拡大する必
要がある。これより、インターフェースされる外部機器
の種類に応じて、EEPROM(1)のアドレス領域A
の大きさを可変でき、前記1チップマイクロコンピュー
タの適用範囲が拡大されて汎用性が向上する。
Since any address data can be set in the register (17), the data rewrite prohibited area of the EEPROM (1), that is, the address area A can be enlarged or reduced. For example, when the external device is a personal computer, the personal computer is an EEPROM (1).
It operates based on the program in address area B of
Since the personal computer performs complicated and many operations, it is necessary to enlarge the address area A of the EEPROM (1). As a result, the address area A of the EEPROM (1) is changed according to the type of external device to be interfaced.
, The range of application of the one-chip microcomputer is expanded and versatility is improved.

【0023】また、(19)はANDゲートであり、一
方の入力端子にはスタートパルスSTARTが印加さ
れ、他方の入力端子には信号STOPが反転印加され
る。通常、前記1チップマイクロコンピュータのリセッ
ト解除後、書き込みパルスWRITEが発生する為、R
Sフリップフロップ(14)のQ端子の出力STOPは
論理値「0」となる。従って、ANDゲート(19)が
開き、CPU(3)からメモリ制御回路(11)及びC
PU制御回路(12)にスタートパルスSTARTが常
に供給され、EEPROM(1)のデータ書き換え動作
は何ら不都合なく実行されることになる。
Further, (19) is an AND gate, to which a start pulse START is applied to one input terminal and a signal STOP is inverted and applied to the other input terminal. Normally, after the reset release of the one-chip microcomputer, a write pulse WRITE is generated.
The output STOP of the Q terminal of the S flip-flop (14) has a logical value "0". Therefore, the AND gate (19) is opened and the CPU (3) causes the memory control circuit (11) and C
The start pulse START is constantly supplied to the PU control circuit (12), and the data rewriting operation of the EEPROM (1) is executed without any inconvenience.

【0024】ところが、前記1チップマイクロコンピュ
ータのリセット解除後、何らかの要因により、書き込み
パルスWRITEが発生しなかった場合、RSフリップ
フロップ(14)のQ端子の出力STOPは論理値
「1」のままとなる。従って、ANDゲート(19)が
閉じ、メモリ制御回路(11)にスタートパルスSTA
RTが供給されなくなり、EEPROM(1)のデータ
書き換え動作は禁止される。即ち、EEPROM(1)
の書き換え不要なアドレスの書き込み済データを書き換
えてしまう不都合を解消できる。
However, after the reset release of the one-chip microcomputer, if the write pulse WRITE is not generated for some reason, the output STOP of the Q terminal of the RS flip-flop (14) remains the logical value "1". Become. Therefore, the AND gate (19) is closed and the memory control circuit (11) receives the start pulse STA.
Since RT is no longer supplied, the data rewriting operation of the EEPROM (1) is prohibited. That is, the EEPROM (1)
It is possible to solve the inconvenience of rewriting the written data of the address that does not require rewriting.

【0025】[0025]

【発明の効果】本発明によれば、マイクロコンピュータ
のリセット解除後、何らかの要因により、アドレス検出
回路に不揮発性メモリの第1及び第2アドレス領域の境
とすべきアドレスが設定されない場合、不揮発性メモリ
のデータ書き換え動作を禁止でき、即ち、不揮発性メモ
リの書き換え不要なアドレスの書き込み済データを書き
換えてしまう不都合を解消できる利点が得られる。
According to the present invention, if the address which should be the boundary between the first and second address areas of the non-volatile memory is not set in the address detection circuit for some reason after the reset release of the microcomputer, the non-volatile There is an advantage that the data rewriting operation of the memory can be prohibited, that is, the inconvenience of rewriting the written data of the address of the non-volatile memory where rewriting is unnecessary.

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

【図1】本発明のマイクロコンピュータを示す回路ブロ
ック図である。
FIG. 1 is a circuit block diagram showing a microcomputer of the present invention.

【図2】図1の動作を説明する為のタイムチャートであ
る。
FIG. 2 is a time chart for explaining the operation of FIG.

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

(1) EEPROM (11) メモリ制御回路 (14) RSフリップフロップ (15) 立ち下がり検出回路 (16)(19) ANDゲート (17) レジスタ (18) アドレス検出回路 (1) EEPROM (11) Memory control circuit (14) RS flip-flop (15) Fall detection circuit (16) (19) AND gate (17) Register (18) Address detection circuit

───────────────────────────────────────────────────── フロントページの続き (72)発明者 小片 紀之 大阪府守口市京阪本通2丁目5番5号 三 洋電機株式会社内 (72)発明者 奥林 政則 大阪府守口市京阪本通2丁目5番5号 三 洋電機株式会社内 ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Noriyuki Kogata 2-5-5 Keihan Hon-dori, Moriguchi-shi, Osaka Sanyo Electric Co., Ltd. (72) Masanori Okubayashi 2-chome, Keihan-hondori, Moriguchi-shi, Osaka No. 5-5 Sanyo Electric Co., Ltd.

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 データを繰り返し書き込み及び読み出し
できると共に書き込み済のデータを電気的に消去できる
メモリであって,第1アドレス領域を、残余の第2アド
レス領域のデータを書き換える為のプログラム領域に割
り当てた不揮発性メモリと、 前記不揮発性メモリの第1アドレス領域又は第2アドレ
ス領域の何れが指定されたのかを検出し、前記不揮発性
メモリの第1アドレス領域が指定された時、前記不揮発
性メモリのデータ書き換え動作を禁止させるアドレス検
出回路と、 マイクロコンピュータがリセット解除された時、前記不
揮発性メモリの第1アドレス領域及び第2アドレス領域
の境とすべきアドレスを、前記アドレス検出回路に設定
させる設定回路と、 前記マイクロコンピュータのリセット解除後、何らかの
要因により前記不揮発性メモリの第1アドレス領域及び
第2アドレス領域の境とすべきアドレスが前記設定回路
から前記アドレス検出回路に設定されない時、前記不揮
発性メモリの如何なるアドレス領域が指定される場合で
あっても、前記不揮発性メモリのデータ書き換え動作を
禁止させる禁止回路と、 を備えたことを特徴とするマイクロコンピュータ。
1. A memory capable of repeatedly writing and reading data and electrically erasing written data, wherein a first address area is assigned to a program area for rewriting data of a remaining second address area. The non-volatile memory and whether the first address area or the second address area of the non-volatile memory is designated, and when the first address area of the non-volatile memory is designated, the non-volatile memory And an address detection circuit that prohibits the data rewriting operation of the microcomputer, and causes the address detection circuit to set an address that should be a boundary between the first address area and the second address area of the nonvolatile memory when the microcomputer is released from reset. After the resetting of the setting circuit and the microcomputer, When an address to be used as a boundary between the first address area and the second address area of the nonvolatile memory is not set in the address detection circuit by the setting circuit, any address area of the nonvolatile memory is designated. And a prohibition circuit for prohibiting a data rewriting operation of the non-volatile memory.
【請求項2】 前記設定回路は、前記マイクロコンピュ
ータがリセット解除された時のみ書き込みパルスを発生
する発生回路と、前記不揮発性メモリの第1アドレス領
域及び第2アドレス領域の境とすべきアドレスデータが
前記書き込みパルスによりセットされ、前記アドレス検
出回路に出力するレジスタと、を備えて成ることを特徴
とする請求項1記載のマイクロコンピュータ。
2. The setting circuit generates a write pulse only when the microcomputer is released from reset, and the address data to be the boundary between the first address area and the second address area of the nonvolatile memory. 2. The microcomputer according to claim 1, further comprising: a register which is set by the write pulse and which is output to the address detection circuit.
【請求項3】 前記発生回路の出力が、前記マイクロコ
ンピュータのリセット中とリセット後とで同一の時、当
該発生回路の出力により、前記不揮発性メモリのデータ
書き換えを禁止させることを特徴とする請求項2記載の
マイクロコンピュータ。
3. The data rewriting of the non-volatile memory is prohibited by the output of the generation circuit when the output of the generation circuit is the same during and after resetting of the microcomputer. The microcomputer according to Item 2.
JP8102535A 1996-04-10 1996-04-24 Microcomputer Pending JPH09293063A (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP8102535A JPH09293063A (en) 1996-04-24 1996-04-24 Microcomputer
US08/833,295 US5991849A (en) 1996-04-10 1997-04-08 Rewriting protection of a size varying first region of a reprogrammable non-volatile memory
KR1019970013004A KR100255568B1 (en) 1996-04-10 1997-04-09 Microcomputer having a reloadable non-volatile memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8102535A JPH09293063A (en) 1996-04-24 1996-04-24 Microcomputer

Publications (1)

Publication Number Publication Date
JPH09293063A true JPH09293063A (en) 1997-11-11

Family

ID=14329985

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8102535A Pending JPH09293063A (en) 1996-04-10 1996-04-24 Microcomputer

Country Status (1)

Country Link
JP (1) JPH09293063A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006133982A (en) * 2004-11-04 2006-05-25 Sanyo Electric Co Ltd Microcomputer and method for protecting data of nonvolatile memory in microcomputer

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006133982A (en) * 2004-11-04 2006-05-25 Sanyo Electric Co Ltd Microcomputer and method for protecting data of nonvolatile memory in microcomputer

Similar Documents

Publication Publication Date Title
KR100375217B1 (en) Microcontroller incorporating an electrically rewritable non-volatile memory
KR100255568B1 (en) Microcomputer having a reloadable non-volatile memory
US6578124B1 (en) Serial command port method, circuit, and system including main and command clock generators to filter signals of less than a predetermined duration
JP2009086988A (en) Memory card
KR100299542B1 (en) Microcomputer using nonvolatile memory
US6948041B2 (en) Permanent memory block protection in a flash memory device
JP7228657B2 (en) semiconductor storage device
JP2006127648A (en) Nonvolatile storage device and electronic device
JP3053301B2 (en) Semiconductor integrated circuit and IC card
JP4624008B2 (en) MEMORY DEVICE HAVING WRITE-PROTECTABLE BUFFER MEMORY AND INFORMATION PROCESSING SYSTEM INCLUDING THE SAME
JP2004038569A (en) Data protection system for nonvolatile memory
US5991207A (en) Circuit configuration having a number of electronic circuit components
JP2006107326A (en) Semiconductor integrated circuit
JPH09293063A (en) Microcomputer
JPH09282302A (en) Microcomputer
US20210373645A1 (en) Semiconductor storing apparatus and flash memory operation method
JP3439018B2 (en) Microcomputer
JP4655244B2 (en) End configuration based on first valid command
JP3679496B2 (en) Microcomputer
JPH09251447A (en) Microcomputer
JPH09282181A (en) Microcomputer
TWI713039B (en) Semiconductor storing apparatus and flash memory operation method
CN113724767B (en) Semiconductor memory device and flash memory operation method
JP2854610B2 (en) Portable electronic devices
WO2008028401A1 (en) Device and method for closing internal modes/functions of integrated circuit