JP2012073755A - Semiconductor device - Google Patents
Semiconductor device Download PDFInfo
- Publication number
- JP2012073755A JP2012073755A JP2010217234A JP2010217234A JP2012073755A JP 2012073755 A JP2012073755 A JP 2012073755A JP 2010217234 A JP2010217234 A JP 2010217234A JP 2010217234 A JP2010217234 A JP 2010217234A JP 2012073755 A JP2012073755 A JP 2012073755A
- Authority
- JP
- Japan
- Prior art keywords
- reset signal
- memory
- data
- internal reset
- internal
- 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.)
- Withdrawn
Links
Images
Landscapes
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
Description
本発明は、不揮発性メモリを内蔵する半導体装置に関する。特に、フラッシュメモリを内蔵する半導体装置に関する。 The present invention relates to a semiconductor device incorporating a nonvolatile memory. In particular, the present invention relates to a semiconductor device incorporating a flash memory.
フラッシュメモリなどの不揮発性メモリを備えた半導体装置では、ノイズや電源の瞬断などにより記憶データが書き換えられてしまうおそれがあることが知られている。このような誤書き込みを防ぐため、例えば、内部に不揮発性メモリを用いたUSBメモリなどのメモリシステムとしては、半導体装置の外部にライトプロテクトスイッチを設け、ライトプロテクトスイッチの設定により誤書き込みを防ぐことも行われている。しかし、これらは、半導体装置の外部に誤書き込みを防ぐセキュリティシステムを設けたり、ライトプロテクトスイッチを人為的に操作する等の取り扱いが必要になったりする。 In a semiconductor device provided with a non-volatile memory such as a flash memory, it is known that stored data may be rewritten due to noise or a power supply interruption. In order to prevent such erroneous writing, for example, as a memory system such as a USB memory using a nonvolatile memory inside, a write protection switch is provided outside the semiconductor device, and the erroneous writing is prevented by setting the write protection switch. Has also been done. However, these require handling such as providing a security system for preventing erroneous writing outside the semiconductor device or manually operating a write protect switch.
また、特許文献1には、不揮発性メモリを備えた半導体装置の内部にノイズや電源瞬断などによる誤書き込みを防止する機能を備えたメモリ制御回路が記載されている。図5は、特許文献1に記載の従来の不揮発性メモリに対する誤書き込み防止回路の回路図である。図5に示す誤書き込み防止回路は、たとえばレジスタを構成する2個のラッチ回路911、912および2個のゲート913、914を備えている。図示しないリセット発生回路から供給されるリセット信号は、第1のラッチ回路911のクリア端子CLKおよび第2のラッチ回路912のセット端子SETに供給される。したがって、リセット信号がアサートされると、第1のラッチ回路911の出力端子Qからは“0”が出力され、第2のラッチ回路912の出力端子Qからは“1”が出力される。
Patent Document 1 describes a memory control circuit having a function of preventing erroneous writing due to noise or instantaneous power interruption in a semiconductor device having a nonvolatile memory. FIG. 5 is a circuit diagram of an erroneous write prevention circuit for the conventional nonvolatile memory described in Patent Document 1. In FIG. The erroneous write prevention circuit shown in FIG. 5 includes, for example, two
第1のラッチ回路911の出力端子Qからの出力信号は、第2のラッチ回路912の入力端子Dに供給される。第2のラッチ回路912の出力端子Qからの出力信号は、第1のゲート913に入力される。また、図示しないCPUから供給されるレジスタ設定データも、第1のゲート913に入力される。第1のゲート913はアンド・ゲートであり、その出力信号は第1のラッチ回路911の入力端子Dに供給される。したがって、第2のラッチ回路912の出力信号が“1”のときに、レジスタ設定データが第1のラッチ回路911に入力される。第2のラッチ回路912の出力信号が“0”のときには、第1のラッチ回路911の入力信号は“0”である。
An output signal from the output terminal Q of the
図示しないCPUから供給されるライト信号は、第2のゲート914に供給される。また、第1のラッチ回路911の出力端子Qからの出力信号も、第2のゲート914に供給される。第2のゲート914はナンド・ゲートであり、図示しない不揮発性メモリへ不揮発性メモリライト信号を出力する。特に限定しないが、この従来例では、ライト信号および不揮発性メモリライト信号は、ロー・アクティブであり、“0”のときにアサートされたことになる。なお、特に限定しないが、この従来例においてその他の信号はハイ・アクティブである。
A write signal supplied from a CPU (not shown) is supplied to the
したがって、第1のラッチ回路911の出力信号が“1”のときに、ライト信号のアサートまたはネゲートに応じて、不揮発性メモリライト信号がアサートまたはネゲートされる。第1のラッチ回路911の出力信号が“0”のときには、不揮発性メモリライト信号は常にネゲートされた状態となる。また、図示しないCPUの書き込み命令に対して図示しない不揮発性メモリから供給されるレジスタ書き込み許可信号は、第1のラッチ回路911および第2のラッチ回路912のイネーブル端子ENに供給される。また、図示しないクロック発生回路から供給されるクロック信号は、第1のラッチ回路911および第2 のラッチ回路912のクロック端子に供給される。
Therefore, when the output signal of the
次に、図5に記載の従来の誤書き込み防止回路の動作について説明する。まず、リセット信号がアサートされると、第1のラッチ回路911の出力は“0”となるので、不揮発性メモリライト信号は“1”、すなわちネゲートされた状態となり、不揮発性メモリにはライト信号が供給されない。つまり、不揮発性メモリにデータを書き込むことはできない。また、リセットにより第2のラッチ回路912の出力が“1”となり、レジスタ設定データが第1のゲート913を介して第1のラッチ回路911に入力されるので、レジスタに“0”または“1”を書き込むことが可能である。したがって、この状態が書き込み禁止状態である。
Next, the operation of the conventional erroneous write prevention circuit shown in FIG. 5 will be described. First, when the reset signal is asserted, the output of the
書き込み禁止状態でレジスタに対して書き込みが行われると、レジスタ書き込み許可信号に同期して、レジスタ設定データが第1のラッチ回路911にラッチされる。たとえば、レジスタ設定データが“1”であれば、第1のラッチ回路911から“1”が出力されるので、ライト信号がアサートされると、第2のゲート914から出力される不揮発性メモリライト信号もアサートされる。つまり、不揮発性メモリにデータを書き込むことができる。また、第2のラッチ回路912にも“1”がラッチされ、第2のラッチ回路912の出力が“1”であるので、レジスタへの書き込みが可能な状態のままである。したがって、この状態が書き込み許可状態である。
When writing to the register is performed in the write prohibited state, the register setting data is latched by the
一方、レジスタ設定データが“0”であれば、第1のラッチ回路911に“0”がラッチされ、第1のラッチ回路911から“0”が出力される。それによって、ライト信号がアサートされても、第2のゲート914から出力される不揮発性メモリライト信号はネゲートされたままになる。つまり、不揮発性メモリにデータを書き込むことはできない。また、第2のラッチ回路912に“0”がラッチされ、第2のラッチ回路912の出力が“0”になるので、第1のラッチ回路911には常に“0”が入力される。つまり、リセットにより第2のラッチ回路912を“1”にセットするまでは、レジスタへの書き込みができない状態がつづき、不揮発性メモリにデータを書き込むことができない。したがって、この状態が誤書き込み防止状態である。
On the other hand, if the register setting data is “0”, “0” is latched in the
なお、書き込み禁止状態から書き込み許可状態を経て誤書き込み防止状態へ移行してもよいし、書き込み禁止状態においてレジスタに“0”を書き込むことにより、書き込み禁止状態から誤書き込み防止状態へ直接移行してもよい。 It should be noted that the state may be shifted from the write-inhibited state to the erroneous write-prevented state through the write-permitted state. Also good.
以下の分析は本発明により与えられる。フラッシュメモリなどの不揮発性メモリを備えた半導体装置では、電源の投入や切断が緩慢であったりする場合に、不揮発性メモリに対する制御信号の状態が不安定になり、不揮発性メモリに誤ったデータが書き込まれたり、不揮発性メモリに記憶したデータが消失してしまう恐れがある。特許文献1のように、誤書き込み防止用のレジスタを設けても、電源の投入や切断が緩慢であったりする場合は、ラッチ回路に保持しているデータ自体が不定になり、かつ、ライト信号等の制御信号の状態も不定になると誤った書き込み動作が行われたり、意図せぬ消去動作が行われる可能性がある。 The following analysis is given by the present invention. In a semiconductor device equipped with a non-volatile memory such as a flash memory, when the power is turned on or off slowly, the state of the control signal for the non-volatile memory becomes unstable, and erroneous data is stored in the non-volatile memory. There is a risk that data written or stored in the nonvolatile memory may be lost. Even if a register for preventing erroneous writing is provided as in Patent Document 1, if the power is turned on or off slowly, the data held in the latch circuit becomes indefinite and the write signal If the state of the control signal becomes indefinite, an erroneous write operation may be performed or an unintended erase operation may be performed.
本発明の1つの側面による半導体装置は、それぞれ内部リセット信号を保持して内部リセット保持信号を出力する複数の内部リセット信号保持レジスタと、外部リセット信号又は前記複数の内部リセット信号保持レジスタがそれぞれ出力する複数の内部リセット保持信号のいずれかがリセット状態を示しているときに活性化し、前記外部リセット信号及び前記複数の内部リセット保持信号のいずれも非リセット状態のときに非活性化するメモリリセット信号を出力するメモリリセット信号生成回路と、前記メモリリセット信号を入力し、前記メモリリセット信号が活性化しているときにリードライトアクセス、消去動作が禁止され、前記メモリリセット信号が非活性化しているときに、リードライトアクセス、消去動作が許可される不揮発性メモリと、を備える。 A semiconductor device according to one aspect of the present invention outputs a plurality of internal reset signal holding registers each holding an internal reset signal and outputting an internal reset holding signal, and an external reset signal or the plurality of internal reset signal holding registers, respectively. A memory reset signal that is activated when any one of the plurality of internal reset holding signals indicates a reset state, and is deactivated when both the external reset signal and the plurality of internal reset holding signals are in a non-reset state When the memory reset signal is input and the memory reset signal is activated, read / write access and erase operations are prohibited, and the memory reset signal is deactivated Non-volatile that allows read / write access and erase operations Provided Mori and, the.
本発明によれば、電源の投入や切断時等にレジスタの保持するデータが不定になったとしても、複数の内部リセット信号保持レジスタの保持しているデータがすべて一致してリセット解除にならない限り、不揮発性メモリに対して意図せざるライトアクセスや消去動作が行われることがないので、不揮発性メモリに対する誤書き込みや誤消去の発生を防ぐことができる。 According to the present invention, even if the data held in the register becomes indefinite when the power is turned on or off, etc., as long as all the data held in the plurality of internal reset signal holding registers match and the reset is not released. Since an unintended write access and erasing operation are not performed on the nonvolatile memory, it is possible to prevent erroneous writing and erasing on the nonvolatile memory.
本発明の具体的な実施例の詳細について説明する前に、本発明の実施形態の概要について説明する。本発明の実施形態では、内部リセット信号を保持する複数の内部リセット信号保持レジスタを設ける。内部リセット信号保持レジスタを複数設けるのは、電源の投入時や切断時等に電源電圧が不安定な状態になり、かつ、不完全な状態で電源が供給されているときに、複数のレジスタが一致してリセット状態を解除する方向に反転してしまわない限り、不揮発性メモリのリセット状態が解除されるのを防ぐためである。 Before describing specific examples of the present invention in detail, an outline of an embodiment of the present invention will be described. In the embodiment of the present invention, a plurality of internal reset signal holding registers for holding internal reset signals are provided. Multiple internal reset signal holding registers are provided when the power supply voltage becomes unstable when the power is turned on or off, and when the power is supplied in an incomplete state. This is to prevent the reset state of the non-volatile memory from being released unless they are matched and reversed in the direction of releasing the reset state.
不完全な状態で電源が供給されているときに、リセット信号が解除され、かつ、書き込み信号や消去信号が不安定な状態であると、不揮発メモリの誤書き込みや誤消去が発生する恐れがある。本発明の実施形態によれば、内部リセット信号を保持する複数のレジスタがすべて一致してリセット解除にならない限り、不揮発性メモリはリセット状態になる。また、不揮発性メモリはリセット状態のとき、たとえ書き込み信号や消去信号がアクティブになったとしても、不揮発性メモリへのアクセスは禁止され、不揮発性メモリは安定した状態に保持される。したがって、内部リセット信号保持レジスタの保持しているデータが不定になるような状態が発生した場合においても、内部リセット信号保持レジスタを複数設けることにより確率的に全部が一致してリセット解除の方向にデータが転び、リセットが解除され、不揮発性メモリに対する誤書き込み、誤消去が発生することを防ぐことができる。 When power is supplied in an incomplete state, if the reset signal is canceled and the write signal or erase signal is unstable, there is a risk of erroneous writing or erasing of the nonvolatile memory. . According to the embodiment of the present invention, the nonvolatile memory is in the reset state unless all of the plurality of registers holding the internal reset signal coincide with each other and the reset is released. Further, when the nonvolatile memory is in the reset state, even if a write signal or an erase signal becomes active, access to the nonvolatile memory is prohibited and the nonvolatile memory is held in a stable state. Therefore, even when a situation occurs in which the data held in the internal reset signal holding register becomes indeterminate, by providing a plurality of internal reset signal holding registers, all of them are matched in a probabilistic manner in the direction of reset release. It is possible to prevent data from falling, resetting being released, and erroneous writing and erroneous erasure to the nonvolatile memory.
特に、内部リセット信号を正論理で保持するレジスタと負論理で保持するレジスタを設けることが好ましい。複数のレジスタが不定となった場合に、一致してリセット状態を解除する方向に反転してしまうのを防ぐためである。 In particular, it is preferable to provide a register for holding the internal reset signal with positive logic and a register for holding with negative logic. This is to prevent inversion in the direction of canceling the reset state when the plurality of registers become indefinite.
以下、実施例に即して詳細に説明する。 Hereinafter, a detailed description will be given in accordance with examples.
[実施例1全体の構成]
図2は、実施例1の半導体装置全体の機能ブロック図である。半導体装置1は、半導体装置1全体やフラッシュメモリ2に対するアクセスを制御する制御部となるCPU4を備えている。フラッシュメモリ2は不揮発性メモリの一例であり、比較的小容量のデータを電源遮断後も記憶するメモリである。また、半導体装置1は、電源が遮断されると記憶内容が失われる揮発性メモリである内蔵RAM5と、書き換えのできない読出し専用のメモリである内蔵ROM6と、半導体装置の様々な機能を実現する周辺回路7を備えている。
[Configuration of Example 1 as a whole]
FIG. 2 is a functional block diagram of the entire semiconductor device according to the first embodiment. The semiconductor device 1 includes a
さらに、CPU4、フラッシュメモリ2、RAM5、ROM6、周辺回路7は、内部バス8を介して相互に接続されている。また、外部インターフェース部9を介して半導体装置1の外部に設けられた外部RAM11、外部ROM12に接続されている。外部インターフェース部9と外部RAM11、外部ROM12との間は、外部バス10−1、10−2によって接続される。例えば、内蔵RAM5には、比較的高速にアクセスができるSRAMを用い、外部RAM11には、より大容量が記憶できるDRAMを用いることもできる。なお、CPU4のプログラムは、内蔵RAM5や内蔵ROM6、外部RAM11、外部ROM12等のメモリに格納される。特に限定されないが、この実施例1では、フラッシュメモリ2には、CPU4のプログラムは格納しない。
Further, the
また、半導体装置1には、外部リセット端子が設けられ、外部から半導体装置1全体を初期設定するリセット信号が入力される。なお、半導体装置1には、外部リセット端子以外にも、クロック端子やデータの入出力端子、制御信号入力端子等が設けられているが、図2では記載を省略している。外部リセット端子から入力された外部リセット信号はCPU4に接続されると共にリセット制御部3に接続される。
Further, the semiconductor device 1 is provided with an external reset terminal, and a reset signal for initially setting the entire semiconductor device 1 is input from the outside. In addition to the external reset terminal, the semiconductor device 1 is provided with a clock terminal, a data input / output terminal, a control signal input terminal, and the like, which are not shown in FIG. An external reset signal input from the external reset terminal is connected to the
リセット制御部3は、フラッシュメモリ2にメモリリセット信号を出力し、このメモリリセット信号の論理レベルによってフラッシュメモリ2のリセット状態を制御する。また、リセット制御部3には、CPU4から内部リセット信号が接続されている。CPU4は内部リセット信号によりフラッシュメモリ2のリセット状態を制御することができる。外部リセット信号がアクティブになると、リセット制御部3は、無条件にフラッシュメモリをリセット状態に設定する。また、外部リセット信号がアクティブになるとCPU4もリセットされる。
The
また、CPU4は、内部リセット信号をアクティブにすることによりフラッシュメモリをリセット状態に設定することができる。半導体装置1が動作しているときは、リセット制御部3には、システムクロックが常時供給され、外部リセット信号または内部リセット信号のいずれかがアクティブになるとフラッシュメモリ2はリセット状態に設定される。また、外部リセット信号、内部リセット信号のいずれもが、非活性状態(インアクティブ)になるとフラッシュメモリのリセット状態は解除される。また、半導体装置1の動作が停止してシステムクロックが停止すると、リセット制御部3はリセット信号の状態を保持する。
Further, the
フラッシュメモリ2は、リセット制御部3が出力するメモリリセット信号がアクティブのときは、リセット信号以外のフレッシュメモリ2に対する制御信号の論理レベルにかかわらず、安定したリセット状態となり、リードライトアクセスや消去動作が禁止される。また、メモリリセット信号がインアクティブであるときは、フラッシュメモリ2に対する他の制御信号の論理レベルによって、フラッシュメモリ2に対するリードライトアクセスや消去動作が可能となる。
When the memory reset signal output from the
[実施例1のリセット制御部と不揮発性メモリの構成]
図1は、実施例1の不揮発性メモリ(フラッシュメモリ)2とそのリセット制御部3のより詳細な回路ブロック図である。図1において、外部リセット信号EX_RSTBは、データフリップフロップ34のデータ入力端子D、及びメモリリセット信号生成回路(論理AND回路)31に接続される。外部リセット信号EX_RSTBは、アクティブロウの信号である。
[Configuration of Reset Control Unit and Nonvolatile Memory of First Embodiment]
FIG. 1 is a more detailed circuit block diagram of the nonvolatile memory (flash memory) 2 and its
また、データフリップフロップ34のデータ出力端子Qは、データフリップフロップ35のデータ入力端子Dに接続される。さらに、データフリップフロップ35のデータ出力端子Qは、n個の第1内部リセット信号保持レジスタ32−1〜32−nとn個の第2内部リセット信号保持レジスタ33−1〜33−nの、それぞれ、第1のデータ入力端子に接続される。なお、データフリップフロップ34と35には、それぞれクロック信号として半導体装置1の動作時に供給され、半導体装置1の動作停止時には供給が停止されるシステムクロック信号System_Clockが接続されている。
The data output terminal Q of the data flip-
図1において、各第1内部リセット信号保持レジスタ32−1〜32−nと各第2内部リセット信号保持レジスタ33−1〜33−nには、それぞれ第2のデータ入力端子が設けられ、各第2のデータ入力端子には、内部リセット信号CTRL2が接続される。内部リセット信号CTRL2は、CPU4が出力する制御信号(フラッシュメモリ2に対する内部リセット信号)であり、アクティブロウの信号である。各第1内部リセット信号保持レジスタ32−1〜32−nはリセット信号を正論理で保持するレジスタであり、各第2内部リセット信号保持レジスタ33−1〜33−nはリセット信号を負論理で保持するレジスタである。第1内部リセット信号保持レジスタと第2内部リセット信号保持レジスタの数はそれぞれn個である。nの数は、多いほど誤書き込みが生じる可能性を減じることが出来るが、nの数が多いほど回路規模は大きくなるので、5〜10程度の値であることが好ましい。詳細は後で詳しく説明する。
In FIG. 1, each of the first internal reset signal holding registers 32-1 to 32-n and the second internal reset signal holding registers 33-1 to 33-n is provided with a second data input terminal. An internal reset signal CTRL2 is connected to the second data input terminal. The internal reset signal CTRL2 is a control signal (internal reset signal for the flash memory 2) output from the
各第1内部リセット信号保持レジスタ32−1〜32−n、第2内部リセット信号保持レジスタ33−1〜33−nは、それぞれ第1のデータ入力端子に接続されたデータフリップフロップ35のデータ出力端子Qの出力信号と、第2のデータ入力端子に接続された内部リセット信号CTRL2の論理ANDを取る論理AND回路36と、リセット信号の論理を保持するデータフリップフロップ回路37を備えている。
Each of the first internal reset signal holding registers 32-1 to 32-n and the second internal reset signal holding registers 33-1 to 33-n outputs data output from the data flip-
データフリップフロップ回路37にリセット信号の論理を負論理で保持する第2内部リセット信号保持レジスタ33−1〜33−nは、論理AND回路36の出力信号がそのまま内部のデータフリップフロップ回路37のデータ入力端子Dに接続され、データフリップフロップ回路37のデータ出力端子Qの出力信号がそのまま内部リセット保持信号として出力される。また、データフリップフロップ回路37にリセット信号の論理を正論理で保持する第1内部リセット信号保持レジスタ32−1〜32−nは、それぞれ、論理AND回路36の出力信号をインバータ38で反転してデータフリップフロップ回路37のデータ入力端子Dに接続され、データフリップフロップ回路37のデータ出力端子Qの出力信号がインバータ39で反転されて内部リセット保持信号として出力される。
In the second internal reset signal holding registers 33-1 to 33-n for holding the logic of the reset signal in the data flip-
なお、第1内部リセット信号保持レジスタ32−1〜32-n及び第2内部リセット信号保持レジスタ33−1〜33−nの各データフリップフロップ回路37には、クロック信号としてシステムクロック信号System_Clockが接続され、システムクロック信号System_Clockに同期して常時データが更新される。ただし、電源が維持されている場合であっても、CPU2が停止し、半導体装置1全体の動作が停止しているときは、システムクロック信号System_Clockも停止し、データフリップフロップ回路37に維持しているデータは保持される。
A system clock signal System_Clock is connected as a clock signal to each data flip-
メモリリセット信号生成回路31は、外部リセット信号EX_RSTBと各第1内部リセット信号保持レジスタと各第2内部リセット信号保持レジスタがそれぞれ保持する内部リセット保持信号との論理ANDを取る回路である。メモリリセット信号生成回路31は、アクティブロウのメモリリセット信号MRBを出力する。すなわち、メモリリセット信号生成回路31は、外部リセット信号EX_RSTBと各第1内部リセット信号保持レジスタと各第2内部リセット信号保持レジスタがそれぞれ保持する内部リセット保持信号のうち、少なくとも一つがロウレベルを出力した場合には、ロウレベルを出力し、メモリリセット信号MRBを活性化させる。また、外部リセット信号EX_RSTBと各内部リセット保持信号が一致してハイレベルを出力した場合には、ハイレベルを出力し、メモリリセット信号MRBを非活性化させる。
The memory reset
メモリリセット信号MRBはリセット制御部3全体の出力信号となり、フラッシュメモリ2のリセット端子RESETBに接続される。フラッシュメモリ2のリセット端子RESETBはアクティブロウのメモリリセット信号MRBの入力端子であり、ロウレベルが入力されるとフラッシュメモリ2は他の制御信号COMMAND、アドレス信号ADR、データ信号DATAの論理レベルの如何にかかわらず、データのリードライトや消去が禁止され、内部のデータを安定した状態で保持する。一方、リセット端子RESETBにハイレベルが入力されると、他の制御信号COMMAND、アドレス信号ADR、データ信号DATAの論理レベルによってリードライト動作や一括消去動作等のフラッシュメモリ2に対する外部からのアクセスが可能となる。
The memory reset signal MRB becomes an output signal of the entire
[実施例1と参考例1の比較]
ここで、図1に示す実施例1のリセット制御部3の効果を説明するため、参考例となる図4のリセット制御部300について説明する。図4に示す参考例では、図1に示す実施例1と構成がほぼ同一である部分については、実施例1と同一の符号を付し、詳細な説明は省略する。
[Comparison between Example 1 and Reference Example 1]
Here, in order to explain the effect of the
図4において、フラッシュメモリ2の構成は図1に示す実施例1と同一である。図1に示す実施例1の複数の第1内部リセット信号保持レジスタ32−1〜32−nと第2内部リセット信号保持レジスタ33−1〜33−nが、図4の参考例1では、論理AND回路331とデータフリップフロップ332に置き換わり、図1のメモリリセット信号生成回路31が図4では論理AND回路333に置き換わっている。
In FIG. 4, the configuration of the
図4のリセット制御部300によれば、データフリップフロップ332によって、内部リセット信号CTRL2または、外部リセット信号EX_RSTBによるリセット信号を保持し、これと外部リセット信号EX_RSTBとの論理ANDを取ってメモリリセット信号として出力している。
4, the data flip-
図4の参考例1のリセット制御部300は、基本的な機能としては、リセット信号の保持をデータフリップフロップ332により保持し、内部リセット信号または外部リセット信号によりフラッシュメモリに対してリセットを行うことができるので、データフリップフロップ332に保持されているデータが常に正しいのであれば、この参考例の回路でも問題は生じない。すなわち、電源切断時や電源投入時に、データフリップフロップ332の出力が常にロウレベルを維持することができれば、フラッシュメモリ2をリセット状態に維持できるので問題は生じないが、電源切断時に電源が不安定な状態になれば、データフリップフロップ332のデータが反転する恐れが生じる。また、電源投入時に電源投入が緩慢であり、パワーオンリセットが働かなかった場合、外部リセット信号を入力するまでは、データフリップフロップ332のデータは不定になる。すると、フラッシュメモリ2はリセット状態が解除され、他の制御信号等の論理レベルによっては、誤書き込みや誤消去が発生する恐れがある。
As a basic function, the
一方、図1に示す実施例1のリセット制御部3は、内部リセット信号を2n個の内部リセット信号保持レジスタ32−1〜32−n、33−1〜33−nによって保持している。そして、フラッシュメモリ2に対するリセット信号が解除されるのは、2n個の内部リセット信号保持レジスタのすべてがリセット解除で状態が一致した場合のみである。したがって、電源投入時に電源投入が緩慢であり、パワーリセットが働かなかった場合であって、内部リセット信号保持レジスタの保持データが不定となった場合に、2n個の内部リセット信号保持レジスタが一致してリセット解除となる可能性は低い。よって、回路の状態が不定となった場合には、フラッシュメモリはリセット状態に維持される可能性が高く、誤書き込みや誤消去が発生する可能性を低くすることができる。
On the other hand, the
ここで、2n個設ける内部リセット信号保持レジスタの数について説明する。内部リセット信号を正論理で保持する第1内部リセット信号保持レジスタと負論理で保持する第2内部リセット信号保持レジスタの数を同数のnとして、第1内部リセット信号保持レジスタと第2内部リセット信号保持レジスタのペアをn組設けるとする。 Here, the number of 2n internal reset signal holding registers provided will be described. The first internal reset signal holding register and the second internal reset signal are set to the same number n of the first internal reset signal holding register holding the internal reset signal with positive logic and the second internal reset signal holding register holding with the negative logic. It is assumed that n holding register pairs are provided.
電源切断時や電源投入時等に内部回路の状態が不定になった場合、内部リセット信号保持レジスタが保持するデータについてハイレベル(リセットが解除される方向)に転ぶ確率をp(0≦p≦1)とすると、各ペアに対して不具合が発生する方向(リセットが解除される方向)に値が転ぶ確率は、p・(1−p)で表される。すべてのペアが不具合発生方向に値が転ぶ確率は、{p・(1−p)}nで表される。ここで、p・(1−p)の最大値は、0≦p≦1の範囲では、1/4(p=1/2の時)である。したがって、式(1)が成立する。 When the state of the internal circuit becomes indefinite when the power is turned off or the power is turned on, the probability that the data held in the internal reset signal holding register will change to high level (direction in which reset is released) is p (0 ≦ p ≦ Assuming 1), the probability that the value changes in the direction in which a failure occurs for each pair (the direction in which reset is released) is represented by p · (1−p). The probability that all pairs change their values in the failure occurrence direction is represented by {p · (1-p)} n . Here, the maximum value of p · (1−p) is ¼ (when p = ½) in the range of 0 ≦ p ≦ 1. Therefore, Formula (1) is materialized.
{p・(1−p)}n≦(1/4)n 式(1) {P · (1-p)} n ≦ (1/4) n formula (1)
不具合が発生する方向に内部リセット信号保持レジスタがすべて転ぶ確率を1000ppm(=10−3)以下に抑え込みたい場合は、(1/4)n≦10−3を満たす最小の整数nを求めるとn=5となる。よって、第1内部リセット信号保持レジスタ及び第2内部リセット信号保持レジスタの数をそれぞれ5以上に設定すれば、保持レジスタの保持するデータがすべて不定になったときに、誤ってリセット信号が解除されてしまう確率を1000ppm以下にすることができる。なお、リセットが解除されても、必ず誤書き込みや誤消去が発生する訳ではないので、実際に誤書き込みや誤消去が発生する確率は、さらに低くなる。 When it is desired to suppress the probability that all the internal reset signal holding registers fall in the direction in which the malfunction occurs to 1000 ppm (= 10 −3 ) or less, the minimum integer n satisfying (1/4) n ≦ 10 −3 is obtained. = 5. Therefore, if the number of first internal reset signal holding registers and the number of second internal reset signal holding registers is set to 5 or more, the reset signal is canceled by mistake when all the data held in the holding registers becomes indefinite. It is possible to reduce the probability of being 1000 ppm or less. Even if the reset is released, erroneous writing or erroneous erasure does not always occur, so the probability of actual erroneous writing or erroneous erasure is further reduced.
さらに、不具合が発生する方向に内部リセット信号保持レジスタがすべて転ぶ確率を1ppm(=10−6)以下に抑え込みたい場合は、(1/4)n≦10−6を満たす最小の整数nを求めるとn=10となる。よって、第1内部リセット信号保持レジスタ及び第2内部リセット信号保持レジスタの数をそれぞれ10以上に設定すれば、誤ってリセット信号が解除されてしまう確率を1ppm以下にすることができる。 Further, when it is desired to suppress the probability that all the internal reset signal holding registers fall in the direction in which the malfunction occurs to 1 ppm (= 10 −6 ) or less, the minimum integer n satisfying (1/4) n ≦ 10 −6 is obtained. And n = 10. Therefore, if the numbers of the first internal reset signal holding registers and the second internal reset signal holding registers are set to 10 or more, the probability that the reset signal is erroneously canceled can be reduced to 1 ppm or less.
[実施例1の動作]
次に、さらに詳しく実施例1の動作について説明する。図3は、実施例1による不揮発性メモリ2に対する制御フローチャートである。図3のフローチャートにおいて、半導体装置1に電源が接続され電源が投入された後、ステップS1で外部リセットにより半導体装置1全体が初期化される。このステップS1は、半導体装置1を含めたシステムとして、パワーオンリセット機能が備わっている場合には、パワーオンリセットにより行われる。システムにパワーオンリセットの機能が備わっていても、電源の立ち上がりが緩慢である等の理由でパワーオンリセットの機能がうまく働かなかった場合には、外部リセット端子から改めて外部リセット信号が入力される。
[Operation of Embodiment 1]
Next, the operation of the first embodiment will be described in more detail. FIG. 3 is a control flowchart for the
なお、パワーオンリセットが働いた場合を除いて、電源が接続されてから、ステップS1により半導体装置1全体が初期化されるまでは、複数の内部リセット信号保持レジスタのうち、少なくとも1つがリセット状態に転んでいれば、フラッシュメモリ2はリセット状態に保持される。従って、半導体装置1が初期設定されるまでの間にフラッシュメモリ2が誤書き込みや誤消去されることを防ぐことができる。なお、ステップS1は半導体装置1の外部から入力される外部リセット信号に基づく動作であるが、以下のステップS2以降の処理はすべて、CPU4がフラッシュメモリ2に関連して実行する処理である。
Note that at least one of the plurality of internal reset signal holding registers is in a reset state from when the power supply is connected until the entire semiconductor device 1 is initialized in step S1 except when the power-on reset is activated. The
ステップS2では、CPUが動作を開始し、フラッシュメモリ2のリセット状態を解除する。なお、ここでフラッシュメモリ2のリセット状態を解除するのは、フラッシュメモリのデータを読み出す必要があるからである。もし、フラッシュメモリ2に対するアクセスが必要ない場合は、フラッシュメモリに対するリセット状態を保持しておけばよい。
In step S2, the CPU starts operation and releases the reset state of the
ステップS3では、フラッシュメモリ2から揮発性メモリへデータを転送する。好ましくは、フラッシュメモリ2のすべてのアドレスのデータを揮発性メモリへあらかじめデータを転送する。ここでフラッシュメモリのすべてのアドレスのデータを揮発性メモリへ転送するのは、後で説明するように一端、揮発性メモリにすべてのデータを転送した後は、フラッシュメモリをリセット状態に設定してアクセス禁止にして、フラッシュメモリに代えて、揮発性メモリから転送されたデータをリードできるようにするためである。好ましくは、フラッシュメモリ2は、データ容量が比較的小規模なメモリであり、フラッシュメモリ2に格納されているデータをすべて揮発性メモリの特定のアドレスに転送する。転送するアドレスはあらかじめ回路により固定されていてもよいし、CPUがプログラムによって自由に設定できるようにしてもよい。
In step S3, data is transferred from the
なお、フラッシュメモリのデータを転送する揮発性メモリとして、内蔵RAM5を用いる場合は、内蔵RAM5が、CPU4が必要とするフラッシュメモリ以外のデータやプログラム等も格納可能な汎用的なリードライトメモリであるならば、あらかじめ、フラッシュメモリのデータを転送するアドレスを決めておく必要がある。また、揮発性メモリとして、内蔵RAM5(図2参照)の他にフラッシュメモリのコピーデータ保持専用の揮発性メモリを設け、そのコピーデータ保持専用の揮発性メモリにフラッシュメモリのコピーデータを転送してもよい。この揮発性メモリは、RAMの他、フリップフロップやレジスタ等により構成されているメモリであってもよい。さらには、半導体装置1に内蔵する揮発性メモリに代えて、外部RAM11等の半導体装置1の外部に設けた揮発性メモリにフラッシュメモリのコピーデータを転送してもよい。
When the built-in
次にステップS4では、CPU4は、内部リセット信号をアクティブにして、フラッシュメモリをリセット状態に再設定する。ここで、フラッシュメモリをリセット状態に再設定するのは、フラッシュメモリのデータをプロテクトして誤書き込みや誤消去が発生することを防ぐためである。フラッシュメモリはリセット状態に設定されると、外部からのアクセスは禁止され、保持されているデータを安定したストレスのない状態で保護する。
Next, in step S4, the
次に、ステップS5では、フラッシュメモリに格納したデータに対する読出し要求があるか否かをチェックする。読出し要求がなければステップS7へ進み、読出し要求がある場合は、ステップS6へ進む。ステップS6では、フラッシュメモリ2から直接のデータ読出しを行わず、ステップS3で、あらかじめフラッシュメモリ1から揮発性メモリに転送したおいたデータから読出しを行う。
Next, in step S5, it is checked whether or not there is a read request for data stored in the flash memory. If there is no read request, the process proceeds to step S7, and if there is a read request, the process proceeds to step S6. In step S6, data is not directly read from the
ステップS7では、フラッシュメモリに対する書込み要求があるか否かチェックする。書込み要求がなければ、CPU4は他の処理を行い、処理が終わるとステップS5へ戻る。ステップS7でフラッシュメモリに対する書込み要求があると判断したときは、ステップS9へ進む。
In step S7, it is checked whether or not there is a write request for the flash memory. If there is no write request, the
ステップS9では、CPU4は、フラッシュメモリのデータを更新する前にフラッシュメモリのデータのコピーが保存されている揮発性メモリに対して書き込みを行う。続いて、ステップS10では、フラッシュメモリ2に対するライトアクセスを可能にするため、CPU4は、内部リセット信号CTRL2にハイレベルを出力してフラッシュメモリ2のリセットを解除する。続いてステップS11では、揮発性メモリのデータをフラッシュメモリ2へデータ転送を行い、フラッシュメモリ2のデータを更新する。
In step S9, the
ステップS11でフラッシュメモリ2のデータを更新した後は、ステップS4に戻り、フラッシュメモリ2をリセット状態に戻す。フラッシュメモリ2をリセット状態に戻すことにより、フラッシュメモリに対する誤書き込みや誤消去が発生しないようにフラッシュメモリ2のデータをプロテクトする。その後は、ステップS5に戻り、必要な処理を行う。他にCPU4の実行が必要な処理がなければ、必要な処理が生じるまで待機する。
After updating the data in the
なお、上記の実施例では、フラッシュメモリが比較的小容量であり、CPUのプログラム自体は、フラッシュメモリには、設けない例について説明したが、例えば、図3に記載したプログラムのみを内蔵ROM6に搭載し、それ以外のプログラムをフラッシュメモリに搭載し、システムリセット時には、フラッシュメモリに格納されたプログラムを内蔵RAM5に転送し、内蔵RAM5に転送されたプログラムをCPU4が実行するようにすれば、いわゆるフラッシュメモリを内蔵した1チップマイクロコントローラ、1チップマイクロコンピュータ等に本発明を応用することも可能である。
In the above embodiment, the flash memory has a relatively small capacity, and the CPU program itself has not been provided in the flash memory. However, for example, only the program shown in FIG. If other programs are installed in the flash memory and the system is reset, the program stored in the flash memory is transferred to the built-in
なお、本発明の全開示(請求の範囲を含む)の枠内において、さらにその基本的技術思想に基づいて、実施形態ないし実施例の変更・調整が可能である。また、本発明の請求の範囲の枠内において種々の開示要素の多様な組み合わせないし選択が可能である。すなわち、本発明は、請求の範囲を含む全開示、技術的思想にしたがって当業者であればなし得るであろう各種変形、修正を含むことは勿論である。 It should be noted that the embodiments and examples can be changed and adjusted within the scope of the entire disclosure (including claims) of the present invention and based on the basic technical concept. Various combinations and selections of various disclosed elements are possible within the scope of the claims of the present invention. That is, the present invention of course includes various variations and modifications that could be made by those skilled in the art according to the entire disclosure including the claims and the technical idea.
1:半導体装置
2:フラッシュメモリ(不揮発性メモリ)
3、300:リセット制御部
4:CPU(制御部)
5:内蔵RAM(揮発性メモリ)
6:内蔵ROM
7:周辺回路
8:内部バス
9:外部インターフェース部
10−1、10−2:外部バス
11:外部RAM
12:外部ROM
31:メモリリセット信号生成回路(論理AND回路)
32−1〜32−n:第1内部リセット信号保持レジスタ
33−1〜33−n:第2内部リセット信号保持レジスタ
34、35、37、332:データフリップフロップ回路
36、331、333:論理AND回路
38、39:インバータ
911:第1のラッチ回路
912:第2のラッチ回路
913:第1のゲート
914:第2のゲート
1: Semiconductor device 2: Flash memory (nonvolatile memory)
3, 300: Reset control unit 4: CPU (control unit)
5: Built-in RAM (volatile memory)
6: Built-in ROM
7: Peripheral circuit 8: Internal bus 9: External interface unit 10-1, 10-2: External bus 11: External RAM
12: External ROM
31: Memory reset signal generation circuit (logical AND circuit)
32-1 to 32-n: first internal reset signal holding register 33-1 to 33-n: second internal reset
Claims (13)
外部リセット信号又は前記複数の内部リセット信号保持レジスタがそれぞれ出力する複数の内部リセット保持信号のいずれかがリセット状態を示しているときに活性化し、前記外部リセット信号及び前記複数の内部リセット保持信号のいずれも非リセット状態のときに非活性化するメモリリセット信号を出力するメモリリセット信号生成回路と、
前記メモリリセット信号を入力し、前記メモリリセット信号が活性化しているときにリードライトアクセス、消去動作が禁止され、前記メモリリセット信号が非活性化しているときに、リードライトアクセス、消去動作が許可される不揮発性メモリと、
を備えることを特徴とする半導体装置。 A plurality of internal reset signal holding registers each holding an internal reset signal and outputting an internal reset holding signal;
Activated when either an external reset signal or a plurality of internal reset holding signals output by the plurality of internal reset signal holding registers respectively indicate a reset state, and the external reset signal and the plurality of internal reset holding signals A memory reset signal generation circuit that outputs a memory reset signal that is deactivated when both are in a non-reset state;
When the memory reset signal is input and the memory reset signal is activated, read / write access and erase operations are prohibited. When the memory reset signal is deactivated, read / write access and erase operations are permitted. Non-volatile memory,
A semiconductor device comprising:
制御部と、
をさらに備え、
前記制御部は、
前記不揮発性メモリからデータを読み出す場合に、
前記内部リセット信号を非活性化して前記複数の内部リセット信号保持レジスタをいずれも非リセット状態に設定して前記不揮発性メモリのリセット状態を解除し、
前記不揮発性メモリのリセット状態を解除した後、前記不揮発性メモリのデータを前記揮発性メモリに転送し、
前記揮発性メモリに転送した後、前記内部リセット信号を活性化して前記複数の内部リセット信号保持レジスタをいずれもリセット状態に設定して前記不揮発性メモリへのアクセスを禁止し、
前記不揮発性メモリからの読み出しに代えて、前記揮発性メモリから前記揮発性メモリに転送されたデータを読み出すことを特徴とする請求項1乃至7いずれか1項記載の半導体装置。 A volatile memory for temporarily storing data read from the nonvolatile memory;
A control unit;
Further comprising
The controller is
When reading data from the non-volatile memory,
Deactivating the internal reset signal and setting all the internal reset signal holding registers to a non-reset state to release the reset state of the nonvolatile memory;
After releasing the reset state of the nonvolatile memory, the nonvolatile memory data is transferred to the volatile memory,
After transferring to the volatile memory, the internal reset signal is activated to set the plurality of internal reset signal holding registers to a reset state, thereby prohibiting access to the nonvolatile memory,
8. The semiconductor device according to claim 1, wherein data transferred from the volatile memory to the volatile memory is read instead of reading from the nonvolatile memory.
前記制御部は、次に不揮発性メモリからのデータの読出しが必要になった場合、不揮発性メモリのリセット状態を維持したまま、前記不揮発性メモリからの読み出しに代えて、前記揮発性メモリから前記転送されたデータを読み出すことを特徴とする請求項8記載の半導体装置。 The volatile memory retains data transferred from the non-volatile memory unless the power is turned off,
When the controller next needs to read data from the non-volatile memory, the control unit maintains the reset state of the non-volatile memory, and instead of reading from the non-volatile memory, the control unit reads the data from the volatile memory. 9. The semiconductor device according to claim 8, wherein the transferred data is read out.
前記不揮発性メモリのデータを更新する場合に、
前記内部リセット信号を非活性化して前記複数の内部リセット信号保持レジスタをいずれも非リセット状態に設定して前記不揮発性メモリのリセット状態を解除し、
前記リセット状態を解除した後に前記不揮発性メモリのデータを更新し、
前記データの更新の後に、前記内部リセット信号を活性化して前記複数の内部リセット信号保持レジスタをいずれもリセット状態に設定して前記不揮発性メモリへのアクセスを禁止することを特徴とする請求項8又は9記載の半導体装置。 The controller is
When updating the data in the nonvolatile memory,
Deactivating the internal reset signal and setting all the internal reset signal holding registers to a non-reset state to release the reset state of the nonvolatile memory;
Update the data in the nonvolatile memory after releasing the reset state,
9. The update of the internal reset signal is performed after the update of the data, and all of the plurality of internal reset signal holding registers are set to a reset state to prohibit access to the nonvolatile memory. Or 9. The semiconductor device according to 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010217234A JP2012073755A (en) | 2010-09-28 | 2010-09-28 | Semiconductor device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010217234A JP2012073755A (en) | 2010-09-28 | 2010-09-28 | Semiconductor device |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2012073755A true JP2012073755A (en) | 2012-04-12 |
Family
ID=46169874
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2010217234A Withdrawn JP2012073755A (en) | 2010-09-28 | 2010-09-28 | Semiconductor device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2012073755A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20200139294A (en) * | 2019-06-03 | 2020-12-14 | 윈본드 일렉트로닉스 코포레이션 | Delayed Reset for Code Execution from memory Device |
-
2010
- 2010-09-28 JP JP2010217234A patent/JP2012073755A/en not_active Withdrawn
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20200139294A (en) * | 2019-06-03 | 2020-12-14 | 윈본드 일렉트로닉스 코포레이션 | Delayed Reset for Code Execution from memory Device |
KR102300822B1 (en) * | 2019-06-03 | 2021-09-10 | 윈본드 일렉트로닉스 코포레이션 | Delayed Reset for Code Execution from memory Device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5535547B2 (en) | Secure memory interface | |
US7616507B2 (en) | Microprocessor boot-up controller, nonvolatile memory controller, and information processing system | |
US8041912B2 (en) | Memory devices with data protection | |
CN111226215B (en) | Transparent attached flash memory security | |
US20060090053A1 (en) | Program-controlled unit | |
US20060112246A1 (en) | Program-controlled unit | |
US10303386B2 (en) | Data processing device and method for saving power in a data processing device | |
US10908991B2 (en) | Bit error protection in cache memories | |
US11816039B2 (en) | Multi-mode protected memory | |
US20060080497A1 (en) | Program-controlled unit | |
KR100614639B1 (en) | Memory system with lockable buffer memory and information processing system including the same | |
JP5622429B2 (en) | Microcomputer | |
JP2004038569A (en) | Data protection system for nonvolatile memory | |
US9275709B2 (en) | Electronic apparatus | |
JP4822620B2 (en) | Semiconductor integrated circuit | |
JP2012073755A (en) | Semiconductor device | |
JP2008040585A (en) | Microcomputer | |
JPH03204053A (en) | Read-only memory | |
KR20110078171A (en) | Bootable volatile memory appratus, memory module having it, and processing system, and method for booting processing system using it | |
US20140281159A1 (en) | Memory controller | |
KR20080112601A (en) | Memory device sharing bootram and dataram and system booting method including the memory device | |
JP4202116B2 (en) | Memory control circuit, memory device and microcomputer | |
JP3918089B2 (en) | Memory protection circuit | |
CN112417528A (en) | Method and electronic device for managing security library supporting data storage | |
JP5823000B2 (en) | Microcomputer |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20131203 |