JP2012073755A - Semiconductor device - Google Patents

Semiconductor device Download PDF

Info

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
Application number
JP2010217234A
Other languages
Japanese (ja)
Inventor
Hiroyuki Ishikawa
宏之 石川
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.)
Renesas Electronics Corp
Original Assignee
Renesas Electronics Corp
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 Renesas Electronics Corp filed Critical Renesas Electronics Corp
Priority to JP2010217234A priority Critical patent/JP2012073755A/en
Publication of JP2012073755A publication Critical patent/JP2012073755A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a semiconductor device preventing erroneous writing and erroneous erasing of a nonvolatile memory such as a flash memory.SOLUTION: A semiconductor device includes: a memory reset signal generation circuit which has a plurality of registers holding internal reset signals by positive logic and a plurality of registers holding the internal reset signals by negative logic and outputs a memory reset signal that activates when the output signals of the registers and external reset signals are inputted and any one of the signals is in a reset state and deactivates when all of the signals are not in reset states; and a nonvolatile memory in which read/write access and an erasing operation are inhibited when the memory reset signal is inputted and the memory reset signal is activated.

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 latch circuits 911 and 912 and two gates 913 and 914 that constitute a register. A reset signal supplied from a reset generation circuit (not shown) is supplied to the clear terminal CLK of the first latch circuit 911 and the set terminal SET of the second latch circuit 912. Therefore, when the reset signal is asserted, “0” is output from the output terminal Q of the first latch circuit 911, and “1” is output from the output terminal Q of the second latch circuit 912.

第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 first latch circuit 911 is supplied to the input terminal D of the second latch circuit 912. An output signal from the output terminal Q of the second latch circuit 912 is input to the first gate 913. In addition, register setting data supplied from a CPU (not shown) is also input to the first gate 913. The first gate 913 is an AND gate, and its output signal is supplied to the input terminal D of the first latch circuit 911. Therefore, the register setting data is input to the first latch circuit 911 when the output signal of the second latch circuit 912 is “1”. When the output signal of the second latch circuit 912 is “0”, the input signal of the first latch circuit 911 is “0”.

図示しないCPUから供給されるライト信号は、第2のゲート914に供給される。また、第1のラッチ回路911の出力端子Qからの出力信号も、第2のゲート914に供給される。第2のゲート914はナンド・ゲートであり、図示しない不揮発性メモリへ不揮発性メモリライト信号を出力する。特に限定しないが、この従来例では、ライト信号および不揮発性メモリライト信号は、ロー・アクティブであり、“0”のときにアサートされたことになる。なお、特に限定しないが、この従来例においてその他の信号はハイ・アクティブである。   A write signal supplied from a CPU (not shown) is supplied to the second gate 914. An output signal from the output terminal Q of the first latch circuit 911 is also supplied to the second gate 914. The second gate 914 is a NAND gate and outputs a nonvolatile memory write signal to a nonvolatile memory (not shown). Although not particularly limited, in this conventional example, the write signal and the non-volatile memory write signal are active low and asserted when “0”. Although not particularly limited, other signals in this conventional example are high active.

したがって、第1のラッチ回路911の出力信号が“1”のときに、ライト信号のアサートまたはネゲートに応じて、不揮発性メモリライト信号がアサートまたはネゲートされる。第1のラッチ回路911の出力信号が“0”のときには、不揮発性メモリライト信号は常にネゲートされた状態となる。また、図示しないCPUの書き込み命令に対して図示しない不揮発性メモリから供給されるレジスタ書き込み許可信号は、第1のラッチ回路911および第2のラッチ回路912のイネーブル端子ENに供給される。また、図示しないクロック発生回路から供給されるクロック信号は、第1のラッチ回路911および第2 のラッチ回路912のクロック端子に供給される。   Therefore, when the output signal of the first latch circuit 911 is “1”, the nonvolatile memory write signal is asserted or negated according to the assertion or negation of the write signal. When the output signal of the first latch circuit 911 is “0”, the nonvolatile memory write signal is always negated. Further, a register write permission signal supplied from a nonvolatile memory (not shown) in response to a CPU write command (not shown) is supplied to the enable terminals EN of the first latch circuit 911 and the second latch circuit 912. A clock signal supplied from a clock generation circuit (not shown) is supplied to the clock terminals of the first latch circuit 911 and the second latch circuit 912.

次に、図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 first latch circuit 911 is “0”, so the nonvolatile memory write signal is “1”, that is, negated, and the nonvolatile memory has a write signal. Is not supplied. That is, data cannot be written to the nonvolatile memory. Further, the output of the second latch circuit 912 is set to “1” by the reset, and the register setting data is input to the first latch circuit 911 via the first gate 913, so that “0” or “1” is input to the register. "Can be written. Therefore, this state is a write-inhibited state.

書き込み禁止状態でレジスタに対して書き込みが行われると、レジスタ書き込み許可信号に同期して、レジスタ設定データが第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 first latch circuit 911 in synchronization with the register write permission signal. For example, if the register setting data is “1”, “1” is output from the first latch circuit 911. Therefore, when the write signal is asserted, the nonvolatile memory write output from the second gate 914 is performed. The signal is also asserted. That is, data can be written in the nonvolatile memory. Further, “1” is also latched in the second latch circuit 912 and the output of the second latch circuit 912 is “1”, so that the register can be written. Therefore, this state is a write permission state.

一方、レジスタ設定データが“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 first latch circuit 911, and “0” is output from the first latch circuit 911. Thereby, even if the write signal is asserted, the nonvolatile memory write signal output from the second gate 914 remains negated. That is, data cannot be written to the nonvolatile memory. In addition, since “0” is latched in the second latch circuit 912 and the output of the second latch circuit 912 becomes “0”, “0” is always input to the first latch circuit 911. That is, until the second latch circuit 912 is set to “1” by reset, the state in which data cannot be written to the register continues, and data cannot be written to the nonvolatile memory. Therefore, this state is an erroneous writing prevention state.

なお、書き込み禁止状態から書き込み許可状態を経て誤書き込み防止状態へ移行してもよいし、書き込み禁止状態においてレジスタに“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.

特開2004−213103号公報JP 2004-213103 A

以下の分析は本発明により与えられる。フラッシュメモリなどの不揮発性メモリを備えた半導体装置では、電源の投入や切断が緩慢であったりする場合に、不揮発性メモリに対する制御信号の状態が不安定になり、不揮発性メモリに誤ったデータが書き込まれたり、不揮発性メモリに記憶したデータが消失してしまう恐れがある。特許文献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.

本発明の一実施例による不揮発性メモリとそのリセット制御部の回路ブロック図である。1 is a circuit block diagram of a nonvolatile memory and a reset control unit thereof according to an embodiment of the present invention. 一実施例による半導体装置全体の機能ブロック図である。It is a functional block diagram of the whole semiconductor device by one Example. 一実施例による不揮発性メモリに対する制御フローチャートである。4 is a control flowchart for a nonvolatile memory according to an embodiment. 参考例によるリセット制御部の回路ブロック図である。It is a circuit block diagram of the reset control part by a reference example. 特許文献1に記載の従来のメモリ制御回路における誤書き込み防止回路の回路図である。10 is a circuit diagram of an erroneous write prevention circuit in a conventional memory control circuit described in Patent Document 1. FIG.

本発明の具体的な実施例の詳細について説明する前に、本発明の実施形態の概要について説明する。本発明の実施形態では、内部リセット信号を保持する複数の内部リセット信号保持レジスタを設ける。内部リセット信号保持レジスタを複数設けるのは、電源の投入時や切断時等に電源電圧が不安定な状態になり、かつ、不完全な状態で電源が供給されているときに、複数のレジスタが一致してリセット状態を解除する方向に反転してしまわない限り、不揮発性メモリのリセット状態が解除されるのを防ぐためである。   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 CPU 4 serving as a control unit that controls access to the entire semiconductor device 1 and the flash memory 2. The flash memory 2 is an example of a nonvolatile memory, and is a memory that stores a relatively small amount of data even after the power is shut off. In addition, the semiconductor device 1 includes a built-in RAM 5 that is a volatile memory whose stored contents are lost when the power is turned off, a built-in ROM 6 that is a read-only memory that cannot be rewritten, and peripherals that realize various functions of the semiconductor device. A circuit 7 is provided.

さらに、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 CPU 4, the flash memory 2, the RAM 5, the ROM 6, and the peripheral circuit 7 are connected to each other via an internal bus 8. In addition, the external interface unit 9 is connected to an external RAM 11 and an external ROM 12 provided outside the semiconductor device 1. The external interface unit 9 and the external RAM 11 and external ROM 12 are connected by external buses 10-1 and 10-2. For example, the built-in RAM 5 can be an SRAM that can be accessed at a relatively high speed, and the external RAM 11 can be a DRAM that can store a larger capacity. The program of the CPU 4 is stored in a memory such as the internal RAM 5, the internal ROM 6, the external RAM 11, and the external ROM 12. Although not particularly limited, in the first embodiment, the flash memory 2 does not store the program of the CPU 4.

また、半導体装置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 CPU 4 and to the reset control unit 3.

リセット制御部3は、フラッシュメモリ2にメモリリセット信号を出力し、このメモリリセット信号の論理レベルによってフラッシュメモリ2のリセット状態を制御する。また、リセット制御部3には、CPU4から内部リセット信号が接続されている。CPU4は内部リセット信号によりフラッシュメモリ2のリセット状態を制御することができる。外部リセット信号がアクティブになると、リセット制御部3は、無条件にフラッシュメモリをリセット状態に設定する。また、外部リセット信号がアクティブになるとCPU4もリセットされる。   The reset control unit 3 outputs a memory reset signal to the flash memory 2 and controls the reset state of the flash memory 2 according to the logic level of the memory reset signal. An internal reset signal is connected to the reset control unit 3 from the CPU 4. The CPU 4 can control the reset state of the flash memory 2 by an internal reset signal. When the external reset signal becomes active, the reset control unit 3 unconditionally sets the flash memory to the reset state. Further, when the external reset signal becomes active, the CPU 4 is also reset.

また、CPU4は、内部リセット信号をアクティブにすることによりフラッシュメモリをリセット状態に設定することができる。半導体装置1が動作しているときは、リセット制御部3には、システムクロックが常時供給され、外部リセット信号または内部リセット信号のいずれかがアクティブになるとフラッシュメモリ2はリセット状態に設定される。また、外部リセット信号、内部リセット信号のいずれもが、非活性状態(インアクティブ)になるとフラッシュメモリのリセット状態は解除される。また、半導体装置1の動作が停止してシステムクロックが停止すると、リセット制御部3はリセット信号の状態を保持する。   Further, the CPU 4 can set the flash memory to the reset state by activating the internal reset signal. When the semiconductor device 1 is operating, the reset control unit 3 is always supplied with a system clock, and when either the external reset signal or the internal reset signal becomes active, the flash memory 2 is set to the reset state. Further, when both the external reset signal and the internal reset signal are inactivated (inactive), the reset state of the flash memory is released. When the operation of the semiconductor device 1 is stopped and the system clock is stopped, the reset control unit 3 holds the state of the reset signal.

フラッシュメモリ2は、リセット制御部3が出力するメモリリセット信号がアクティブのときは、リセット信号以外のフレッシュメモリ2に対する制御信号の論理レベルにかかわらず、安定したリセット状態となり、リードライトアクセスや消去動作が禁止される。また、メモリリセット信号がインアクティブであるときは、フラッシュメモリ2に対する他の制御信号の論理レベルによって、フラッシュメモリ2に対するリードライトアクセスや消去動作が可能となる。   When the memory reset signal output from the reset control unit 3 is active, the flash memory 2 is in a stable reset state regardless of the logic level of the control signal for the fresh memory 2 other than the reset signal, and read / write access and erase operations are performed. Is prohibited. Further, when the memory reset signal is inactive, read / write access to the flash memory 2 and erase operation can be performed according to the logic level of other control signals for the flash memory 2.

[実施例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 reset control unit 3 according to the first embodiment. In FIG. 1, an external reset signal EX_RSTB is connected to a data input terminal D of a data flip-flop 34 and a memory reset signal generation circuit (logic AND circuit) 31. The external reset signal EX_RSTB is an active low signal.

また、データフリップフロップ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-flop 34 is connected to the data input terminal D of the data flip-flop 35. Further, the data output terminal Q of the data flip-flop 35 has n first internal reset signal holding registers 32-1 to 32-n and n second internal reset signal holding registers 33-1 to 33-n. Each is connected to a first data input terminal. The data flip-flops 34 and 35 are connected to a system clock signal System_Clock that is supplied as a clock signal when the semiconductor device 1 is operating and is stopped when the operation of the semiconductor device 1 is stopped.

図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 CPU 4, and is an active low signal. Each of the first internal reset signal holding registers 32-1 to 32-n is a register that holds the reset signal with a positive logic, and each of the second internal reset signal holding registers 33-1 to 33-n is a negative logic of the reset signal. It is a register to hold. The number of first internal reset signal holding registers and second internal reset signal holding registers is n. The larger the number of n, the lower the possibility of erroneous writing. However, the larger the number of n, the larger the circuit scale, so a value of about 5 to 10 is preferable. Details will be described later.

各第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-flop 35 connected to the first data input terminal. A logic AND circuit 36 that takes a logical AND of the output signal of the terminal Q and the internal reset signal CTRL2 connected to the second data input terminal, and a data flip-flop circuit 37 that holds the logic of the reset signal are provided.

データフリップフロップ回路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-flop circuit 37 as negative logic, the output signal of the logical AND circuit 36 is the data of the internal data flip-flop circuit 37 as it is. The output signal of the data output terminal Q of the data flip-flop circuit 37 connected to the input terminal D is output as it is as an internal reset holding signal. The first internal reset signal holding registers 32-1 to 32-n that hold the logic of the reset signal in the data flip-flop circuit 37 are inverted by the inverter 38, respectively. Connected to the data input terminal D of the data flip-flop circuit 37, the output signal of the data output terminal Q of the data flip-flop circuit 37 is inverted by the inverter 39 and output as an internal reset holding signal.

なお、第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-flop circuit 37 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. The data is constantly updated in synchronization with the system clock signal System_Clock. However, even when the power is maintained, when the CPU 2 is stopped and the operation of the entire semiconductor device 1 is stopped, the system clock signal System_Clock is also stopped and maintained in the data flip-flop circuit 37. Data is retained.

メモリリセット信号生成回路31は、外部リセット信号EX_RSTBと各第1内部リセット信号保持レジスタと各第2内部リセット信号保持レジスタがそれぞれ保持する内部リセット保持信号との論理ANDを取る回路である。メモリリセット信号生成回路31は、アクティブロウのメモリリセット信号MRBを出力する。すなわち、メモリリセット信号生成回路31は、外部リセット信号EX_RSTBと各第1内部リセット信号保持レジスタと各第2内部リセット信号保持レジスタがそれぞれ保持する内部リセット保持信号のうち、少なくとも一つがロウレベルを出力した場合には、ロウレベルを出力し、メモリリセット信号MRBを活性化させる。また、外部リセット信号EX_RSTBと各内部リセット保持信号が一致してハイレベルを出力した場合には、ハイレベルを出力し、メモリリセット信号MRBを非活性化させる。   The memory reset signal generation circuit 31 is a circuit that takes a logical AND of the external reset signal EX_RSTB, each first internal reset signal holding register, and each internal reset holding signal held by each second internal reset signal holding register. The memory reset signal generation circuit 31 outputs an active-low memory reset signal MRB. That is, the memory reset signal generation circuit 31 outputs at least one of the external reset signal EX_RSTB, the internal reset holding signals held by the first internal reset signal holding registers, and the second internal reset signal holding registers. In this case, the low level is output and the memory reset signal MRB is activated. When the external reset signal EX_RSTB matches each internal reset holding signal and outputs a high level, the high level is output and the memory reset signal MRB is deactivated.

メモリリセット信号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 reset control unit 3 and is connected to the reset terminal RESETB of the flash memory 2. The reset terminal RESETB of the flash memory 2 is an input terminal for an active-low memory reset signal MRB. When a low level is input, the flash memory 2 determines the logic level of other control signals COMMAND, address signal ADR, and data signal DATA. Regardless, data read / write and erasure are prohibited, and the internal data is held in a stable state. On the other hand, when a high level is input to the reset terminal RESETB, external access to the flash memory 2 such as a read / write operation or a batch erase operation is possible depending on the logic levels of other control signals COMMAND, address signal ADR, and data signal DATA. It becomes.

[実施例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 reset control unit 3 of the first embodiment shown in FIG. 1, the reset control unit 300 of FIG. 4 as a reference example will be described. In the reference example shown in FIG. 4, the same reference numerals as those in the first embodiment are given to portions that are substantially the same as those in the first embodiment shown in FIG. 1, and detailed description thereof is omitted.

図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 flash memory 2 is the same as that of the first embodiment shown in FIG. 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 of the first embodiment shown in FIG. The AND circuit 331 and the data flip-flop 332 are replaced, and the memory reset signal generation circuit 31 in FIG. 1 is replaced with the logical AND circuit 333 in FIG.

図4のリセット制御部300によれば、データフリップフロップ332によって、内部リセット信号CTRL2または、外部リセット信号EX_RSTBによるリセット信号を保持し、これと外部リセット信号EX_RSTBとの論理ANDを取ってメモリリセット信号として出力している。   4, the data flip-flop 332 holds a reset signal based on the internal reset signal CTRL2 or the external reset signal EX_RSTB, and takes a logical AND of the reset signal and the external reset signal EX_RSTB. As output.

図4の参考例1のリセット制御部300は、基本的な機能としては、リセット信号の保持をデータフリップフロップ332により保持し、内部リセット信号または外部リセット信号によりフラッシュメモリに対してリセットを行うことができるので、データフリップフロップ332に保持されているデータが常に正しいのであれば、この参考例の回路でも問題は生じない。すなわち、電源切断時や電源投入時に、データフリップフロップ332の出力が常にロウレベルを維持することができれば、フラッシュメモリ2をリセット状態に維持できるので問題は生じないが、電源切断時に電源が不安定な状態になれば、データフリップフロップ332のデータが反転する恐れが生じる。また、電源投入時に電源投入が緩慢であり、パワーオンリセットが働かなかった場合、外部リセット信号を入力するまでは、データフリップフロップ332のデータは不定になる。すると、フラッシュメモリ2はリセット状態が解除され、他の制御信号等の論理レベルによっては、誤書き込みや誤消去が発生する恐れがある。   As a basic function, the reset control unit 300 of Reference Example 1 in FIG. 4 holds the reset signal by the data flip-flop 332 and resets the flash memory by the internal reset signal or the external reset signal. Therefore, if the data held in the data flip-flop 332 is always correct, the circuit of this reference example does not cause a problem. That is, if the output of the data flip-flop 332 can always be maintained at a low level when the power is turned off or turned on, the flash memory 2 can be maintained in the reset state, so that no problem occurs, but the power is unstable when the power is turned off. If this happens, the data in the data flip-flop 332 may be inverted. In addition, when the power is turned on slowly when the power is turned on and the power-on reset does not work, the data in the data flip-flop 332 is indefinite until an external reset signal is input. Then, the flash memory 2 is released from the reset state, and erroneous writing or erroneous erasure may occur depending on the logic level of other control signals.

一方、図1に示す実施例1のリセット制御部3は、内部リセット信号を2n個の内部リセット信号保持レジスタ32−1〜32−n、33−1〜33−nによって保持している。そして、フラッシュメモリ2に対するリセット信号が解除されるのは、2n個の内部リセット信号保持レジスタのすべてがリセット解除で状態が一致した場合のみである。したがって、電源投入時に電源投入が緩慢であり、パワーリセットが働かなかった場合であって、内部リセット信号保持レジスタの保持データが不定となった場合に、2n個の内部リセット信号保持レジスタが一致してリセット解除となる可能性は低い。よって、回路の状態が不定となった場合には、フラッシュメモリはリセット状態に維持される可能性が高く、誤書き込みや誤消去が発生する可能性を低くすることができる。   On the other hand, the reset control unit 3 according to the first embodiment illustrated in FIG. 1 holds an internal reset signal by 2n internal reset signal holding registers 32-1 to 32-n and 33-1 to 33-n. Then, the reset signal for the flash memory 2 is canceled only when all of the 2n internal reset signal holding registers are in the reset state and the states coincide with each other. Therefore, when the power is turned on slowly when the power is turned on and the power reset does not work, and the data held in the internal reset signal holding register becomes indefinite, the 2n internal reset signal holding registers match. It is unlikely that reset will be released. Therefore, when the circuit state becomes indefinite, the flash memory is highly likely to be maintained in the reset state, and the possibility of erroneous writing or erroneous erasure can be reduced.

ここで、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)}で表される。ここで、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)}≦(1/4) 式(1) {P · (1-p)} n ≦ (1/4) n formula (1)

不具合が発生する方向に内部リセット信号保持レジスタがすべて転ぶ確率を1000ppm(=10−3)以下に抑え込みたい場合は、(1/4)≦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)≦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 nonvolatile memory 2 according to the first embodiment. In the flowchart of FIG. 3, after power is connected to the semiconductor device 1 and the power is turned on, the entire semiconductor device 1 is initialized by an external reset in step S1. If the system including the semiconductor device 1 has a power-on reset function, this step S1 is performed by a power-on reset. Even if the system is equipped with a power-on reset function, if the power-on reset function does not work properly due to slow power-up, etc., an external reset signal is input again from the external reset terminal. .

なお、パワーオンリセットが働いた場合を除いて、電源が接続されてから、ステップ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 flash memory 2 is held in the reset state. Therefore, it is possible to prevent the flash memory 2 from being erroneously written or erased before the semiconductor device 1 is initialized. Note that step S1 is an operation based on an external reset signal input from the outside of the semiconductor device 1, but all the processes after step S2 are processes executed by the CPU 4 in relation to the flash memory 2.

ステップS2では、CPUが動作を開始し、フラッシュメモリ2のリセット状態を解除する。なお、ここでフラッシュメモリ2のリセット状態を解除するのは、フラッシュメモリのデータを読み出す必要があるからである。もし、フラッシュメモリ2に対するアクセスが必要ない場合は、フラッシュメモリに対するリセット状態を保持しておけばよい。   In step S2, the CPU starts operation and releases the reset state of the flash memory 2. Note that the reset state of the flash memory 2 is released here because it is necessary to read the data in the flash memory. If access to the flash memory 2 is not required, the reset state for the flash memory may be held.

ステップS3では、フラッシュメモリ2から揮発性メモリへデータを転送する。好ましくは、フラッシュメモリ2のすべてのアドレスのデータを揮発性メモリへあらかじめデータを転送する。ここでフラッシュメモリのすべてのアドレスのデータを揮発性メモリへ転送するのは、後で説明するように一端、揮発性メモリにすべてのデータを転送した後は、フラッシュメモリをリセット状態に設定してアクセス禁止にして、フラッシュメモリに代えて、揮発性メモリから転送されたデータをリードできるようにするためである。好ましくは、フラッシュメモリ2は、データ容量が比較的小規模なメモリであり、フラッシュメモリ2に格納されているデータをすべて揮発性メモリの特定のアドレスに転送する。転送するアドレスはあらかじめ回路により固定されていてもよいし、CPUがプログラムによって自由に設定できるようにしてもよい。   In step S3, data is transferred from the flash memory 2 to the volatile memory. Preferably, data of all addresses in the flash memory 2 is transferred in advance to the volatile memory. Here, the data of all addresses of the flash memory is transferred to the volatile memory as described later. After all the data is transferred to the volatile memory, the flash memory is set to the reset state. This is because the access is prohibited and the data transferred from the volatile memory can be read instead of the flash memory. Preferably, the flash memory 2 is a memory having a relatively small data capacity, and all the data stored in the flash memory 2 is transferred to a specific address of the volatile memory. The address to be transferred may be fixed in advance by a circuit, or the CPU may be freely set by a program.

なお、フラッシュメモリのデータを転送する揮発性メモリとして、内蔵RAM5を用いる場合は、内蔵RAM5が、CPU4が必要とするフラッシュメモリ以外のデータやプログラム等も格納可能な汎用的なリードライトメモリであるならば、あらかじめ、フラッシュメモリのデータを転送するアドレスを決めておく必要がある。また、揮発性メモリとして、内蔵RAM5(図2参照)の他にフラッシュメモリのコピーデータ保持専用の揮発性メモリを設け、そのコピーデータ保持専用の揮発性メモリにフラッシュメモリのコピーデータを転送してもよい。この揮発性メモリは、RAMの他、フリップフロップやレジスタ等により構成されているメモリであってもよい。さらには、半導体装置1に内蔵する揮発性メモリに代えて、外部RAM11等の半導体装置1の外部に設けた揮発性メモリにフラッシュメモリのコピーデータを転送してもよい。   When the built-in RAM 5 is used as the volatile memory for transferring the data in the flash memory, the built-in RAM 5 is a general-purpose read / write memory that can store data, programs, and the like other than the flash memory required by the CPU 4. Then, it is necessary to determine in advance an address for transferring data in the flash memory. In addition to the built-in RAM 5 (see FIG. 2), a volatile memory dedicated to holding the copy data of the flash memory is provided as the volatile memory, and the copy data of the flash memory is transferred to the volatile memory dedicated to holding the copy data. Also good. The volatile memory may be a memory configured by a flip-flop, a register, or the like in addition to the RAM. Further, the copy data of the flash memory may be transferred to a volatile memory provided outside the semiconductor device 1 such as the external RAM 11 instead of the volatile memory built in the semiconductor device 1.

次にステップS4では、CPU4は、内部リセット信号をアクティブにして、フラッシュメモリをリセット状態に再設定する。ここで、フラッシュメモリをリセット状態に再設定するのは、フラッシュメモリのデータをプロテクトして誤書き込みや誤消去が発生することを防ぐためである。フラッシュメモリはリセット状態に設定されると、外部からのアクセスは禁止され、保持されているデータを安定したストレスのない状態で保護する。   Next, in step S4, the CPU 4 activates the internal reset signal and resets the flash memory to the reset state. Here, the flash memory is reset to the reset state in order to protect the data in the flash memory and prevent erroneous writing and erasing. When the flash memory is set in the reset state, external access is prohibited, and the stored data is protected in a stable and stress-free state.

次に、ステップ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 flash memory 2, but in step S3, data is read from the data previously transferred from the flash memory 1 to the volatile memory.

ステップ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 CPU 4 performs other processing and returns to step S5 when the processing is completed. If it is determined in step S7 that there is a write request to the flash memory, the process proceeds to step S9.

ステップS9では、CPU4は、フラッシュメモリのデータを更新する前にフラッシュメモリのデータのコピーが保存されている揮発性メモリに対して書き込みを行う。続いて、ステップS10では、フラッシュメモリ2に対するライトアクセスを可能にするため、CPU4は、内部リセット信号CTRL2にハイレベルを出力してフラッシュメモリ2のリセットを解除する。続いてステップS11では、揮発性メモリのデータをフラッシュメモリ2へデータ転送を行い、フラッシュメモリ2のデータを更新する。   In step S9, the CPU 4 writes to the volatile memory in which a copy of the data in the flash memory is stored before updating the data in the flash memory. Subsequently, in step S10, in order to enable write access to the flash memory 2, the CPU 4 outputs a high level to the internal reset signal CTRL2 to release the reset of the flash memory 2. Subsequently, in step S11, the data in the volatile memory is transferred to the flash memory 2, and the data in the flash memory 2 is updated.

ステップS11でフラッシュメモリ2のデータを更新した後は、ステップS4に戻り、フラッシュメモリ2をリセット状態に戻す。フラッシュメモリ2をリセット状態に戻すことにより、フラッシュメモリに対する誤書き込みや誤消去が発生しないようにフラッシュメモリ2のデータをプロテクトする。その後は、ステップS5に戻り、必要な処理を行う。他にCPU4の実行が必要な処理がなければ、必要な処理が生じるまで待機する。   After updating the data in the flash memory 2 in step S11, the process returns to step S4, and the flash memory 2 is returned to the reset state. By returning the flash memory 2 to the reset state, the data in the flash memory 2 is protected so that erroneous writing or erasing to the flash memory does not occur. After that, it returns to step S5 and performs necessary processing. If there is no other process that needs to be executed by the CPU 4, the process waits until the necessary process occurs.

なお、上記の実施例では、フラッシュメモリが比較的小容量であり、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 RAM 5 and the program transferred to the built-in RAM 5 is executed by the CPU 4. The present invention can also be applied to a one-chip microcontroller with a built-in flash memory, a one-chip microcomputer, or the like.

なお、本発明の全開示(請求の範囲を含む)の枠内において、さらにその基本的技術思想に基づいて、実施形態ないし実施例の変更・調整が可能である。また、本発明の請求の範囲の枠内において種々の開示要素の多様な組み合わせないし選択が可能である。すなわち、本発明は、請求の範囲を含む全開示、技術的思想にしたがって当業者であればなし得るであろう各種変形、修正を含むことは勿論である。   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 signal holding register 34, 35, 37, 332: data flip-flop circuit 36, 331, 333: logical AND Circuits 38 and 39: Inverter 911: First latch circuit 912: Second latch circuit 913: First gate 914: Second gate

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記載の半導体装置。   2. The semiconductor device according to claim 1, wherein the plurality of internal reset signal holding registers are initialized to a reset state by activation of the external reset signal. 前記複数の内部リセット信号保持レジスタは、前記内部リセット保持信号を正論理で保持する複数の第1内部リセット信号保持レジスタと、前記内部リセット保持信号を負論理で保持する複数の第2内部リセット信号保持レジスタと、を備えることを特徴とする請求項1又は2記載の半導体装置。   The plurality of internal reset signal holding registers include a plurality of first internal reset signal holding registers that hold the internal reset holding signal with positive logic, and a plurality of second internal reset signals that hold the internal reset holding signal with negative logic. 3. The semiconductor device according to claim 1, further comprising a holding register. 前記複数の第1内部リセット信号保持レジスタの数と、前記複数の第2内部リセット信号レジスタの数と、が同数であることを特徴とする請求項3記載の半導体装置。   4. The semiconductor device according to claim 3, wherein the number of the plurality of first internal reset signal holding registers is the same as the number of the plurality of second internal reset signal registers. 前記複数の第1内部リセット信号保持レジスタの数及び前記複数の第2内部リセット信号保持レジスタの数が共に5個以上であることを特徴とする請求項3又は4記載の半導体装置。   5. The semiconductor device according to claim 3, wherein the number of the plurality of first internal reset signal holding registers and the number of the plurality of second internal reset signal holding registers are both five or more. 前記複数の第1内部リセット信号保持レジスタの数及び前記複数の第2内部リセット信号保持レジスタの数が共に10個以上であることを特徴とする請求項3又は4記載の半導体装置。   5. The semiconductor device according to claim 3, wherein the number of the plurality of first internal reset signal holding registers and the number of the plurality of second internal reset signal holding registers are both 10 or more. 前記複数の内部リセット信号保持レジスタは、それぞれ、動作時には常時クロック信号が入力され、前記内部リセット信号及び前記外部リセット信号の論理レベルによって常時データが更新されるデータフリップフロップであることを特徴とする請求項1乃至6いずれか1項記載の半導体装置。   Each of the plurality of internal reset signal holding registers is a data flip-flop in which a clock signal is always input during operation, and data is constantly updated according to the logic levels of the internal reset signal and the external reset signal. The semiconductor device according to claim 1. 前記不揮発性メモリから読み出したデータを一時的に保存する揮発性メモリと、
制御部と、
をさらに備え、
前記制御部は、
前記不揮発性メモリからデータを読み出す場合に、
前記内部リセット信号を非活性化して前記複数の内部リセット信号保持レジスタをいずれも非リセット状態に設定して前記不揮発性メモリのリセット状態を解除し、
前記不揮発性メモリのリセット状態を解除した後、前記不揮発性メモリのデータを前記揮発性メモリに転送し、
前記揮発性メモリに転送した後、前記内部リセット信号を活性化して前記複数の内部リセット信号保持レジスタをいずれもリセット状態に設定して前記不揮発性メモリへのアクセスを禁止し、
前記不揮発性メモリからの読み出しに代えて、前記揮発性メモリから前記揮発性メモリに転送されたデータを読み出すことを特徴とする請求項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.
前記揮発性メモリが、RAM、ラッチ回路、フリップフロップ回路、レジスタ回路のいずれかであることを特徴とする請求項8乃至10いずれか1項記載の半導体装置。   11. The semiconductor device according to claim 8, wherein the volatile memory is any one of a RAM, a latch circuit, a flip-flop circuit, and a register circuit. 前記揮発性メモリについて、前記半導体装置に内蔵する揮発性メモリに代えて、前記半導体装置の外部に接続された揮発性メモリを用いることを特徴とする請求項8乃至11いずれか1項記載の半導体装置。   12. The semiconductor according to claim 8, wherein a volatile memory connected to the outside of the semiconductor device is used instead of the volatile memory built in the semiconductor device. apparatus. 前記不揮発性メモリがフラッシュメモリであることを特徴とする請求項1乃至12いずれか1項記載の半導体装置。   The semiconductor device according to claim 1, wherein the nonvolatile memory is a flash memory.
JP2010217234A 2010-09-28 2010-09-28 Semiconductor device Withdrawn JP2012073755A (en)

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)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20200139294A (en) * 2019-06-03 2020-12-14 윈본드 일렉트로닉스 코포레이션 Delayed Reset for Code Execution from memory Device

Cited By (2)

* Cited by examiner, † Cited by third party
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
US7464259B2 (en) Microprocessor boot-up controller, nonvolatile memory controller, and information processing system
JP5535547B2 (en) Secure memory interface
US20090089526A1 (en) Memory devices with data protection
US20060090053A1 (en) Program-controlled unit
US20060112246A1 (en) Program-controlled unit
CN111226215B (en) Transparent attached flash memory security
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
US9275709B2 (en) Electronic apparatus
JP4822620B2 (en) Semiconductor integrated circuit
JP2012073755A (en) Semiconductor device
JP2008040585A (en) Microcomputer
JPH03204053A (en) Read-only memory
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
US12001689B2 (en) Transparently attached flash memory security
JP3918089B2 (en) Memory protection circuit
CN112417528A (en) Method and electronic device for managing security library supporting data storage
JP5823000B2 (en) Microcomputer
CN118132000A (en) Transparent attached flash memory security

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