JPH0744463A - One-chip microcomputer incorporating eeprom - Google Patents
One-chip microcomputer incorporating eepromInfo
- Publication number
- JPH0744463A JPH0744463A JP18594593A JP18594593A JPH0744463A JP H0744463 A JPH0744463 A JP H0744463A JP 18594593 A JP18594593 A JP 18594593A JP 18594593 A JP18594593 A JP 18594593A JP H0744463 A JPH0744463 A JP H0744463A
- Authority
- JP
- Japan
- Prior art keywords
- eeprom
- write
- cpu
- writing
- control
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Techniques For Improving Reliability Of Storages (AREA)
- Microcomputers (AREA)
- Read Only Memory (AREA)
- Storage Device Security (AREA)
Abstract
Description
【0001】[0001]
【産業上の利用分野】本発明は、EEPROMを内蔵し
た1チップマイクロコンピュータにおいて、マイクロコ
ンピュータからEEPROMへの書き込みを制限する機
能を有するものに関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a one-chip microcomputer incorporating an EEPROM, which has a function of restricting writing from the microcomputer to the EEPROM.
【0002】[0002]
【従来の技術】従来EEPROMを内蔵したマイクロコ
ンピュータにおいては、CPU暴走時のEEPROMの
データ保護の為の書き込み禁止について提案がなされて
いたが、使用上制約を受けることがあった。例えば、特
開平3ー129446では、内蔵レジスタに書き込み禁
止領域を設定することによりEEPROMのデータ保護
を行っているが、何等かの異常によりCPUが暴走し本
来書き込み可能な領域まで書き込み禁止に設定してしま
うと、CPUの暴走を検出してもハードウェア的リセッ
ト以外に書き込み可能領域を再設定できないため自由に
書き込みが行えると言うEEPROMの特長を活用でき
なくなりEEPROM内蔵の効果が薄れてしまってい
た。2. Description of the Related Art Conventionally, in a microcomputer including an EEPROM, it has been proposed to prohibit writing to protect the data of the EEPROM when the CPU runs out of control, but it may be restricted in use. For example, in Japanese Patent Laid-Open No. 3-129446, the EEPROM data is protected by setting a write-protected area in a built-in register. However, the CPU runs away due to some abnormality and the write-protected area is set to the write-protected area. If this happens, even if a runaway of the CPU is detected, the writable area cannot be re-set except for a hardware reset, so that it is not possible to utilize the advantage of the EEPROM, and the effect of the built-in EEPROM is diminished. .
【0003】[0003]
【発明が解決しようとする課題】従来のEEPROM内
蔵のマイクロコンピュータは、プログラムにて自由にE
EPROMに書き込みを行うことが可能であった。従来
技術の項で明らかにしたように、何らかの要因でマイク
ロコンピュータが暴走した場合に備えて、内蔵データを
保護するために書き込み禁止状態にし再書き込みができ
ると言うEEPROMの特長をなくしてしまうことが現
状の対応方法であった。本発明は、自由に再書き込みが
行えると言うEEPROMの特長を活かしつつ、暴走時
の書き込みを禁止できることを可能にすることにある。A conventional microcomputer with a built-in EEPROM can be freely programmed by an E program.
It was possible to write to the EPROM. As clarified in the section of the prior art, in case the microcomputer runs out of control for some reason, it is possible to lose the feature of the EEPROM that the write-protection state is set in order to protect the internal data and rewriting is possible. It was the current response method. The present invention makes it possible to inhibit writing during a runaway while making full use of the feature of the EEPROM that rewriting can be freely performed.
【0004】[0004]
【課題を解決するための手段】本発明は、上記のような
課題に鑑みてなされたものであり、CPUが定期的に本
発明に係る制御回路にアクセスしている期間のみEEP
ROMへの書き込みを許可する機能を有することによ
り、異常動作時にはEEPROMが誤書き込みから保護
される。また、本発明によれば、通常動作時の内蔵EE
PROMの全領域への書き込みにおいて何等制約を受け
ることはない。更に、CPUからEEPROMへの書き
込みを一定期間のみ許可する手段と、許可期間以外の書
き込みに対しても書き込みアドレス・データを記憶する
手段を持つことにより、CPUの待ち時間無しにCPU
が他の処理を行うことが可能となる。The present invention has been made in view of the above problems, and the EEP is provided only while the CPU regularly accesses the control circuit according to the present invention.
By having the function of permitting writing to the ROM, the EEPROM is protected from erroneous writing during abnormal operation. Further, according to the present invention, the built-in EE during normal operation
There is no restriction on writing to the entire area of the PROM. Further, by providing means for permitting writing from the CPU to the EEPROM only for a certain period and means for storing the write address data even for the writing during the period other than the permission period, there is no waiting time for the CPU.
Can perform other processing.
【0005】[0005]
【作用】本発明によれば、上記の手段によりCPU暴走
時の内蔵EEPROMへの誤書き込みを禁止でき、それ
以外は自由にEEPROM書き換えが行える為、EEP
ROMの特長をなくすことなくデータを保護できる。According to the present invention, erroneous writing to the built-in EEPROM at the time of CPU runaway can be prohibited by the above means, and the EEPROM can be freely rewritten in other cases, so that the EEP
Data can be protected without losing the features of ROM.
【0006】[0006]
【実施例】以下、本発明の実施例を図面に基づいて説明
する。Embodiments of the present invention will be described below with reference to the drawings.
【0007】図1は本発明の概略ブロック図である。1
は内蔵CPU、2は内蔵の機能ブロック(ROM,RA
M,I/O等)、3は本発明に係る書き込み禁止及び読
み出し制御回路、4は内蔵EEPROMである。1,
2,3は、リード信号A、ライト信号B、データバスD
B、アドレスバスABにより接続されており、1ー2及
び1ー3間のデータの転送が可能である。内蔵EEPR
OM4への読み出し/書き込みは、A,B,DB,AB
の各信号により、書き込み禁止制御及び読み出し制御回
路3を経由しリードA′、ライトB′、データDB′、
アドレスAB′を通して内蔵EEPROM4がアクセス
される。また、暴走検出時にはCPU1に対して割り込
み要求Dを発生する。割り込みが受け付けられると割り
込み応答Eが返され、制御回路3は初期化される。FIG. 1 is a schematic block diagram of the present invention. 1
Is a built-in CPU, 2 is a built-in functional block (ROM, RA
M, I / O, etc.), 3 is a write inhibit / read control circuit according to the present invention, and 4 is a built-in EEPROM. 1,
2 and 3 are a read signal A, a write signal B, and a data bus D
B and an address bus AB are connected, and data transfer between 1-2 and 1-3 is possible. Built-in EEPR
Read / write to OM4 is A, B, DB, AB
By the respective signals of, the read A ', the write B', the data DB ', the write DB', and the read control circuit 3 are passed.
The built-in EEPROM 4 is accessed through the address AB '. When a runaway is detected, an interrupt request D is issued to the CPU 1. When the interrupt is accepted, the interrupt response E is returned and the control circuit 3 is initialized.
【0008】図2,3,4,5では、本発明の詳細な実
施例である。2, 3, 4, and 5 are detailed embodiments of the present invention.
【0009】図2は、暴走検出及びEEPROM書き込
み許可信号作成部であり、タイマ用リード/ライト制御
部5、タイマ制御レジスタ6、第1,第2コンペア回路
7,8、カウンタ9、書き込み制御F/F10、停止制
御F/F11及びゲート類から構成されている。FIG. 2 shows a runaway detection and EEPROM write permission signal generating section, which includes a timer read / write control section 5, a timer control register 6, first and second compare circuits 7 and 8, a counter 9, and a write control F. / F10, stop control F / F11, and gates.
【0010】初期状態において、RESET信号Fによ
り書き込み制御F/F10はクリアされ、書き込み許可
信号Jは非アクティブ状態となり、EEPROMへの書
き込みが禁止されている。また、タイマ制御レジスタ6
が初期化されることにより、カウンタ9もリセット状態
となって、カウント動作は停止している。タイマR/W
制御部5は、CPUより出力されるAB、A及びBをデ
コードし、7、8、9のリード/ライト信号を作成す
る。In the initial state, the write control F / F 10 is cleared by the RESET signal F, the write enable signal J is inactive, and writing to the EEPROM is prohibited. In addition, the timer control register 6
Is initialized, the counter 9 is also reset and the counting operation is stopped. Timer R / W
The control unit 5 decodes AB, A and B output from the CPU to create 7, 8 and 9 read / write signals.
【0011】図3にタイマR/W制御部5、タイマ制御
レジスタ6の構成を示す。リセット信号Fがアクティブ
となることで、図2に示した禁止解除Rもアクティブと
なり、タイマ制御レジスタ6及びコンペアレジスタ制御
F/F61はクリアされ、コンペア回路7、8への書き
込みは許可状態となる。7、8に設定を行った後にタイ
マ制御レジスタ6に“1”を書き込むことにより、コン
ペアレジスタ制御F/F61がセットされ、Hが非アク
ティブとなる。これにより、7、8への書き込みは禁止
され、割り込み応答Eかリセット信号Fがアクティブと
なるまでは、7、8への書き込みは行えなくなる。図3
では、7、8用のライト信号のみ示してあるが、リード
信号もアドレスデコーダ51出力とリード信号Aとの論
理積により作成できる。CPUからタイマ制御レジスタ
6に“1”を書き込み、カウンタ9が動作状態になって
いる場合に再び“1”を書き込むことにより、クリアH
及びセットH′がアクティブとなり、カウンタ9は初期
化されるとともに、書き込み制御F/F10も許可状態
となる。FIG. 3 shows the configurations of the timer R / W controller 5 and the timer control register 6. When the reset signal F becomes active, the prohibition release R shown in FIG. 2 also becomes active, the timer control register 6 and the compare register control F / F 61 are cleared, and writing to the compare circuits 7 and 8 is enabled. . By writing "1" to the timer control register 6 after setting 7 and 8, the compare register control F / F 61 is set, and H becomes inactive. As a result, writing to 7 and 8 is prohibited, and writing to 7 and 8 cannot be performed until the interrupt response E or the reset signal F becomes active. Figure 3
In the figure, only the write signals for 7 and 8 are shown, but the read signal can also be created by the logical product of the output of the address decoder 51 and the read signal A. Clear "H" by writing "1" from the CPU to the timer control register 6 and writing "1" again when the counter 9 is in the operating state.
The set H'becomes active, the counter 9 is initialized, and the write control F / F 10 is also enabled.
【0012】図4に、コンペア回路7、8の構成を示
す。コンペアレジスタライト信号により、7、8内のコ
ンペアレジスタが設定され、コンペアレジスタとカウン
タ9の各ビットの一致をとり、全ビット一致の場合に、
一致信号Kとして出力される。図4では、比較回路等は
−セット分しか示していないが、コンペア回路7、8と
もに同一の構成である。FIG. 4 shows the configuration of the compare circuits 7 and 8. A compare register in 7 and 8 is set by the compare register write signal, each bit of the compare register and the counter 9 is matched, and when all the bits match,
It is output as the coincidence signal K. In FIG. 4, only the -sets of the comparison circuits and the like are shown, but the compare circuits 7 and 8 have the same configuration.
【0013】図5に動作タイミングを示す。カウンタ9
の内容が、CPUより書き込まれた第1コンペア回路7
の内容と一致すると、一致信号Kにより、書き込み制御
F/F10はクリアされ、書き込み許可Jは非アクティ
ブ状態となり、EEPROMへの書き込みが禁止され
る。つまり、カウンタがスタートしてから第1コンペア
回路7に設定された一定期間のみ、EEPROMへの書
き込みが許可状態となる。また、1つのデータがEEP
ROMに書かれたことを示すライト終了信号Mにより、
書き込み制御F/F10をクリアし、書き込み禁止状態
になる。CPUが正常動作している場合には、第2コン
ペア回路8に設定した期間より短い一定間隔でタイマ制
御レジスタ6に“1”の書き込みを行う様にプログラム
しておけば、その度毎にカウンタ9がクリアされるとと
もに、書き込み制御F/F10がセットされ、書き込み
許可状態となる。FIG. 5 shows the operation timing. Counter 9
Contents of the first compare circuit 7 written by the CPU
If the contents of the above condition match, the write control F / F10 is cleared by the match signal K, the write permission J becomes inactive, and writing to the EEPROM is prohibited. That is, writing to the EEPROM is enabled only for a certain period set in the first compare circuit 7 after the counter starts. Also, one piece of data is EEP
By the write end signal M indicating that the data is written in the ROM,
The write control F / F10 is cleared, and the write prohibition state is set. If the CPU is operating normally, program the timer control register 6 to write "1" at a constant interval shorter than the period set in the second compare circuit 8. 9 is cleared, the write control F / F 10 is set, and the write enabled state is entered.
【0014】CPUが暴走し、タイマ制御レジスタ6に
“1”を書き込まなくなり、カウンタ9の内容が第2コ
ンペア回路8の内容と一致すると、暴走状態と認識し、
CPUに対する割り込み要求Dを発生するとともに、停
止制御F/F11をセットし、9用のカウントクロック
LをLOW状態にし、9のカウント動作を停止させる。
これにより、CPUからの割り込み応答Eが返されるま
では、9は停止状態を継続し、EEPROMへの書き込
みは一切許可されない。このことにより、CPUが正常
動作を行って、9をクリアした直後しか、EEPROM
にデータを書き込まないため、暴走時の誤った書き込み
を排除できる。When the CPU goes out of control and "1" is no longer written in the timer control register 6 and the content of the counter 9 matches the content of the second compare circuit 8, it is recognized as a runaway state,
The interrupt request D to the CPU is generated, the stop control F / F 11 is set, the count clock L for 9 is set to the LOW state, and the count operation of 9 is stopped.
As a result, until the interrupt response E is returned from the CPU, the 9 continues to be in the stopped state, and writing to the EEPROM is not permitted at all. As a result, the EEPROM operates only immediately after the CPU normally operates and clears 9.
Since no data is written to, it is possible to eliminate erroneous writing during runaway.
【0015】図6は、EEPROMに対する読み出し/
書き込み制御部である。FIG. 6 shows a read / write operation for the EEPROM.
It is a write control unit.
【0016】このブロックは、比較器付きメモリ13及
び制御部12から構成されている。13は、アドレス及
びデータ格納メモリ、データ有効を示すタグビット、入
力及び格納アドレスの一致検出用比較器から構成されて
いる。制御部12は、比較器付きメモリ13への書き込
み/読み出し位置を指定するポインタ、EEPROM書
き込みの終了を示すライト終了信号Mの発生回路等から
構成されている。This block is composed of a memory 13 with a comparator and a control unit 12. Reference numeral 13 includes an address and data storage memory, a tag bit indicating data validity, and a comparator for detecting a match between input and storage addresses. The control unit 12 is composed of a pointer for designating a writing / reading position to the memory 13 with a comparator, a generation circuit of a write end signal M indicating the end of the EEPROM writing, and the like.
【0017】EEPROMに対する書き込みが行われる
と、メモリ13に書き込み待ちのデータが無ければ、そ
のまま、データがA′,B′,DB′,AB′を通じて
EEPROMに書き込まれる。書き込み終了後、ライト
終了Mが制御部12より出力され、書き込み制御F/F
10をクリアし、書き込み禁止状態とする。メモリ13
に書き込み待ちのデータがあれば、制御部12より出力
されるメモリR/W信号Pによりラッチされ、書き込み
待ち状態となる。その際に、比較器付きメモリ内のタグ
ビットもセットされ、書き込み待ちであることを設定す
る。これにより、書き込み待ちの有無は、メモリ13内
の各タグビットの出力Qで制御部12内で判定される。
タイマ制御レジスタ6が設定され、書き込み許可状態と
なった時点で、書き込み待ちデータがメモリ13内にあ
る場合は、制御部12内の書き込みポインタが示すデー
タがEEPROMに書き込まれる。書き込みが終了する
と、12内の書き込みポインタが更新される。また、同
時にM信号がアクティブとなり、書き込み許可Jが非ア
クティブとなり、書き込みが禁止される。この様に、タ
イマをクリアしてから次のクリアまでに1つのデータし
か書かないことにより、暴走時にメモリ13に書き込ま
れたデータを誤って書き込むことを排除することができ
る。When data is written to the EEPROM, if there is no data waiting to be written in the memory 13, the data is written as it is to the EEPROM through A ', B', DB 'and AB'. After the writing is completed, the end of writing M is output from the control unit 12, and the write control F / F
10 is cleared and the write-protected state is set. Memory 13
If there is data waiting to be written in, the data is latched by the memory R / W signal P output from the control unit 12, and a write waiting state is set. At that time, the tag bit in the memory with the comparator is also set, and it is set that writing is waiting. As a result, the presence or absence of writing waiting is determined in the control unit 12 based on the output Q of each tag bit in the memory 13.
At the time when the timer control register 6 is set and the write-enabled state is reached, if the write-waiting data is in the memory 13, the data indicated by the write pointer in the control unit 12 is written in the EEPROM. When the writing is completed, the write pointer in 12 is updated. At the same time, the M signal becomes active, the write permission J becomes inactive, and writing is prohibited. In this way, by writing only one data from the time when the timer is cleared to the time when the timer is next cleared, it is possible to prevent erroneous writing of the data written in the memory 13 during a runaway.
【0018】更に、13に書かれ、EEPROMへの書
き込み待ち時に、同一アドレスに対する読み込み要求が
発生した場合、入力アドレスメモリ13内の有効記憶ア
ドレス(タグビットで判断)と、比較器で常に比較を行
っているため、同一アドレスがある場合にはメモリ13
内のデータを出力する。バッファ内にない場合には制御
部からEEPROMへのデータリードが行われる。この
機能によりデータの一貫性が保証される。Furthermore, when a read request for the same address is written in 13 while waiting for writing to the EEPROM, the effective storage address (determined by the tag bit) in the input address memory 13 and the comparator are always compared. Since it is done, if there is the same address, the memory 13
Output the data in. If it is not in the buffer, data is read from the control unit to the EEPROM. This feature ensures data consistency.
【0019】[0019]
【発明の効果】以上詳細に説明したように、本発明によ
り、通常動作時は制約を受けること無しにEEPROM
の書き込みが行え、かつCPU暴走時には誤ったデータ
が内蔵EEPROM内に書かれることを禁止でき、EE
PROM内のデータを保護することができる。As described in detail above, according to the present invention, the EEPROM is not restricted during normal operation.
Can be written, and erroneous data can be prohibited from being written in the built-in EEPROM when the CPU runs out of control.
The data in the PROM can be protected.
【図1】本発明を実施したEEPROM内蔵の1チップ
マイクロコンピュータの概略ブロック図である。FIG. 1 is a schematic block diagram of a one-chip microcomputer containing an EEPROM embodying the present invention.
【図2】暴走検出及びEEPROM書き込み許可信号作
成部の構成図である。FIG. 2 is a configuration diagram of a runaway detection and EEPROM write permission signal generation unit.
【図3】タイマR/W制御部及びタイマ制御レジスタの
詳細構成図である。FIG. 3 is a detailed configuration diagram of a timer R / W control unit and a timer control register.
【図4】コンペア回路の詳細構成図である。FIG. 4 is a detailed configuration diagram of a compare circuit.
【図5】本発明の動作タイミング図である。FIG. 5 is an operation timing chart of the present invention.
【図6】EEPROMに対する読み出し/書き込み制御
部の構成図である。FIG. 6 is a configuration diagram of a read / write control unit for the EEPROM.
1 CPU 3 書き込み禁止及び読み出し制御回路 4 EEPROM 1 CPU 3 write inhibit and read control circuit 4 EEPROM
Claims (2)
ロコンピュータにおいて、暴走検出手段と、該手段より
の暴走検出信号に基づいて、上記EEPROMへの書き
込みを禁止する手段とを設けたことを特徴とするEEP
ROM内蔵1チップマイクロコンピュータ。1. An EEPROM having a built-in EEPROM, further comprising: a runaway detecting means; and a means for inhibiting writing to the EEPROM on the basis of a runaway detection signal from the means.
1-chip microcomputer with built-in ROM.
ロコンピュータにおいて、予め設定された期間のみ上記
EEPROMへの書き込みを許可し、該許可期間以外の
期間は上記EEPROMへの書き込みを禁止する手段を
設けたことを特徴とするEEPROM内蔵1チップマイ
クロコンピュータ。2. A one-chip microcomputer having a built-in EEPROM is provided with means for permitting writing to the EEPROM only during a preset period and for inhibiting writing to the EEPROM during periods other than the permitted period. A one-chip microcomputer with a built-in EEPROM.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP18594593A JPH0744463A (en) | 1993-07-28 | 1993-07-28 | One-chip microcomputer incorporating eeprom |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP18594593A JPH0744463A (en) | 1993-07-28 | 1993-07-28 | One-chip microcomputer incorporating eeprom |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH0744463A true JPH0744463A (en) | 1995-02-14 |
Family
ID=16179635
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP18594593A Pending JPH0744463A (en) | 1993-07-28 | 1993-07-28 | One-chip microcomputer incorporating eeprom |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH0744463A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006004245A (en) * | 2004-06-18 | 2006-01-05 | Seiko Epson Corp | Integrated circuit device and electronic apparatus |
-
1993
- 1993-07-28 JP JP18594593A patent/JPH0744463A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006004245A (en) * | 2004-06-18 | 2006-01-05 | Seiko Epson Corp | Integrated circuit device and electronic apparatus |
JP4662019B2 (en) * | 2004-06-18 | 2011-03-30 | セイコーエプソン株式会社 | Integrated circuit device and electronic apparatus |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5237616A (en) | Secure computer system having privileged and unprivileged memories | |
KR0138697B1 (en) | Microcomputer | |
JPH10228421A (en) | Memory access control circuit | |
JPH11110294A (en) | Microcomputer and information processor | |
JPS6237419B2 (en) | ||
KR100204850B1 (en) | Information processing apparatus with write protection function of specific storage area | |
US20020166034A1 (en) | Protection circuit for preventing unauthorized access to the memory device of a processor | |
JP2002015584A (en) | Read/protect circuit for non-volatile memory | |
JPH0744463A (en) | One-chip microcomputer incorporating eeprom | |
US6938107B2 (en) | Microprocessor preventing erroneous writing to control register | |
JP3086052B2 (en) | EEPROM | |
JPS63317975A (en) | Write protection mechanism of magnetic disk device | |
JP3234959B2 (en) | Microcomputer and card incorporating the same | |
JPS62160554A (en) | Memory unauthorized access prevention device | |
JP3047839B2 (en) | Single-chip microcomputer | |
JPH0822419A (en) | Miswriting prevention system | |
JPS6250863B2 (en) | ||
JPH0764953A (en) | Microcomputer with built-in eeprom | |
KR940006823B1 (en) | Memory write protection circuit | |
JPS6052462B2 (en) | Memory control method | |
JP2602909B2 (en) | Write-protection method during CPU runaway | |
JPH01131941A (en) | Memory write protection method | |
JPH05334195A (en) | Information processor | |
JPS63266562A (en) | semiconductor integrated circuit | |
JPS6238743B2 (en) |