JP2010079600A - Microcomputer and method for protecting sram data - Google Patents
Microcomputer and method for protecting sram data Download PDFInfo
- Publication number
- JP2010079600A JP2010079600A JP2008247131A JP2008247131A JP2010079600A JP 2010079600 A JP2010079600 A JP 2010079600A JP 2008247131 A JP2008247131 A JP 2008247131A JP 2008247131 A JP2008247131 A JP 2008247131A JP 2010079600 A JP2010079600 A JP 2010079600A
- Authority
- JP
- Japan
- Prior art keywords
- sram
- cpu
- reset signal
- microcomputer
- asynchronous reset
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims description 13
- 230000003111 delayed effect Effects 0.000 claims abstract description 12
- 230000001934 delay Effects 0.000 claims abstract description 6
- 230000003068 static effect Effects 0.000 claims abstract description 4
- 230000004044 response Effects 0.000 claims description 3
- 230000008859 change Effects 0.000 description 5
- 230000007423 decrease Effects 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 230000004043 responsiveness Effects 0.000 description 2
- 230000000717 retained effect Effects 0.000 description 2
- 238000013500 data storage Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 230000014759 maintenance of location Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
Landscapes
- Microcomputers (AREA)
Abstract
Description
本発明は、SRAM(Static Random Acess Memory)を備えたマイクロコンピュータに関し、特に、このようなマイクロコンピュータの非同期リセット時におけるSRAMのデータ保護技術に関する。 The present invention relates to a microcomputer provided with SRAM (Static Random Access Memory), and more particularly, to a data protection technique of SRAM at the time of asynchronous reset of such a microcomputer.
SRAMは、供給される電圧が所定の電圧(以下RAM保持電圧という)より低くなると記憶内容が失われる揮発性半導体メモリであるため、一般的に、テンポラリデータ記憶装置として使用される。 An SRAM is a volatile semiconductor memory in which stored contents are lost when a supplied voltage becomes lower than a predetermined voltage (hereinafter referred to as a RAM holding voltage). Therefore, the SRAM is generally used as a temporary data storage device.
一方、SRAMは、高い応答性及び安価という利点がある。また、電池により電源が供給されるリモートコントローラの場合、電池交換時や、電池の寿命による電圧低下の場合を除き、通常、RAM保持電圧以上の電源電圧が供給されていると共に、様々な設定など記憶装置に保持したい内容が失われたとしてもユーザにより再設定が可能である。そのため、リモートコントローラを構成するマイクロコンピュータ(以下マイコンという)において、テンポラリデータの記憶にのみならず、上述した設定内容の記憶にもSRAMが使用されている。 On the other hand, SRAM has advantages of high response and low cost. In addition, in the case of a remote controller that is powered by a battery, a power supply voltage higher than the RAM holding voltage is usually supplied, and various settings, etc., except when the battery is replaced or when the voltage drops due to battery life Even if the content to be stored in the storage device is lost, it can be reset by the user. Therefore, in a microcomputer (hereinafter referred to as a microcomputer) constituting a remote controller, an SRAM is used not only for storing temporary data but also for storing the above-described setting contents.
このようなマイコンにおいて、通常、SRAMを設定データ領域とテンポラリデータ領域に分けて使用する。設定データ領域は、上述した設定内容、すなわち一度設定したら、後の動作時に変更が不要であり、読出しのみが行われるデータの記憶に供され、テンポラリデータ領域は、マイコン動作時におけるテンポラリデータの記憶に供され、リード/ライトがなされる。 In such a microcomputer, the SRAM is usually divided into a setting data area and a temporary data area. The setting data area is used to store the above-described setting contents, that is, once set, it does not need to be changed during subsequent operations, and is used only for reading data. The temporary data area stores temporary data during microcomputer operation. And read / write.
SRAMがデータの保持を前提としない揮発性メモリであるため、SRAMを設けたシステムにおいて、通常、非同期リセットの発生時に記憶データが破壊されることを想定して、非同期リセットが発生すると、SRAMのアドレスなどが初期化される。しかし、リモートコントローラのマイコンにおいても同じようにすると、非同期リセットが発生する度に再設定が必要になり、ユーザにとって煩雑である。安全性を保ちながら、ユーザの利便性を図るために、リモートコントローラのマイコンにおけるSRAMの取扱いについて様々な工夫がなされている。 Since SRAM is a volatile memory that does not assume data retention, in a system provided with SRAM, when an asynchronous reset occurs, assuming that stored data is normally destroyed when an asynchronous reset occurs, Addresses are initialized. However, if the same is applied to the microcomputer of the remote controller, resetting is required every time an asynchronous reset occurs, which is cumbersome for the user. In order to improve the convenience of the user while maintaining safety, various ideas have been made regarding the handling of the SRAM in the microcomputer of the remote controller.
例えば、電源電圧がRAM保持電圧以上である限りSRAMに記憶されたデータが保持されることを利用して、CPUCentral Processing Unit)のレジスタにSRAMのデータが破壊されているか否かを示すRAM保持フラグを設け、非同期リセット後にこのRAM保持フラグを参照してアドレスの初期化をするか否かを決定する手法がある。図6を参照して説明する。 For example, using the fact that the data stored in the SRAM is held as long as the power supply voltage is equal to or higher than the RAM holding voltage, the RAM holding flag indicating whether or not the SRAM data is destroyed in the register of the CPU Central Processing Unit) There is a method for determining whether or not to initialize an address by referring to this RAM holding flag after asynchronous reset. This will be described with reference to FIG.
図6は、リモートコントローラの電源ON後の電圧変化例を示す。期間毎にマイコンの動作を説明する。なお、以下の説明において、POC(Power On Clear)電圧は、マイコンが正常動作するための最低電圧であり、リモードコントローラに供給される電源電圧がPOC電圧より低くなるとシステムリセットが生じる。また、この場合のシステムリセットはPOCという。なお、RAM保持電圧は、マイコンにおけるSRAMが記憶内容を保持するための最低電圧である。 FIG. 6 shows an example of voltage change after the remote controller is powered on. The operation of the microcomputer will be described for each period. In the following description, the POC (Power On Clear) voltage is the lowest voltage for normal operation of the microcomputer, and a system reset occurs when the power supply voltage supplied to the remote controller becomes lower than the POC voltage. The system reset in this case is called POC. The RAM holding voltage is the lowest voltage for the SRAM in the microcomputer to hold the stored contents.
<期間(1)>
乾電池のセットにより電源電圧が上昇するがPOC(Power On Clear)より低いため、マイコンが動作しない。RAM保持フラグも、初期状態の「0」のままである。
<Period (1)>
The power supply voltage rises due to the setting of the dry battery, but the microcomputer does not operate because it is lower than POC (Power On Clear). The RAM holding flag also remains “0” in the initial state.
<期間(2)>
電源電圧がPOC以上になる。これにより、リセットが解除され、マイコンが動作する。ユーザにより設定がなされると、設定内容は設定データ領域に記憶され、RAM保持フラグは、初期状態の「0」から「1」に書き換えられる。
<Period (2)>
The power supply voltage becomes POC or higher. Thereby, the reset is released and the microcomputer operates. When the setting is made by the user, the setting content is stored in the setting data area, and the RAM holding flag is rewritten from “0” in the initial state to “1”.
この期間において、何らかの弾みで電源電圧が下降するが、POC電圧以上であるため、マイコンは通常動作を続け、RAM保持フラグも「1」のままである。CPUは、ユーザからの操作指示(ボタンの押下など)に応じた処理を行う。処理に際しては、設定データ領域から設定データを読み出すと共に、テンポラリデータのリード/ライトにテンポラリデータ領域を使用する。 During this period, the power supply voltage drops for some reason, but since it is equal to or higher than the POC voltage, the microcomputer continues normal operation and the RAM holding flag remains “1”. The CPU performs processing according to an operation instruction (such as pressing a button) from the user. In the processing, the setting data is read from the setting data area, and the temporary data area is used for reading / writing the temporary data.
<期間(3)>
電源電圧がPOC電圧よりも低くなり、非同期リセットであるPOCが発生する。しかし、最も低い電圧(A点の電圧)でも、RAM保持電圧より高いため、RAM保持フラグは、「1」のままに維持される。
その後、電源電圧が上昇するが、POC電圧より低いため、マイコンは動作しない。
<Period (3)>
The power supply voltage becomes lower than the POC voltage, and POC that is an asynchronous reset occurs. However, since the lowest voltage (the voltage at the point A) is higher than the RAM holding voltage, the RAM holding flag is maintained at “1”.
Thereafter, the power supply voltage increases, but the microcomputer does not operate because it is lower than the POC voltage.
<期間(4)>
電源電圧がPOC電圧以上になるため、リセットが解除される。RAM保持フラグが「1」であるため、CPUは、SRAMのアドレスの初期化を行わない。従って、ユーザによる再設定の必要も無い。
<Period (4)>
Since the power supply voltage becomes equal to or higher than the POC voltage, the reset is released. Since the RAM holding flag is “1”, the CPU does not initialize the SRAM address. Therefore, there is no need for resetting by the user.
その後、電源電圧が下がるものの、POC電圧以上であるため、非同期リセットが発生しない。RAM保持フラグも「1」のままである。 After that, although the power supply voltage decreases, the asynchronous reset does not occur because it is equal to or higher than the POC voltage. The RAM holding flag remains “1”.
<期間(5)>
電源電圧がさらに低下し、POC電圧よりも低くなった時点で、非同期リセットが発生する。また、電源電圧が下がり続け、B点においてRAM保持電圧よりも低くなる。この時点でRAM保持フラグは、「0」にセットされる。
その後、電源電圧が上昇するが、POC電圧より低いため、マイコンは動作しない。
<Period (5)>
Asynchronous reset occurs when the power supply voltage further decreases and becomes lower than the POC voltage. In addition, the power supply voltage continues to drop and becomes lower than the RAM holding voltage at point B. At this time, the RAM holding flag is set to “0”.
Thereafter, the power supply voltage increases, but the microcomputer does not operate because it is lower than the POC voltage.
<期間(6)>
電源電圧がPOC電圧以上になるため、リセットが解除される。しかし、RAM保持フラグが「0」であるため、CPUは、SRAMのアドレスの初期化を行う。従って、ユーザによる再設定が必要になる。
<Period (6)>
Since the power supply voltage becomes equal to or higher than the POC voltage, the reset is released. However, since the RAM holding flag is “0”, the CPU initializes the SRAM address. Therefore, resetting by the user is required.
こうすることにより、電源電圧がRAM保持電圧より低くなっていなければ、非同期リセットが発生しても、ユーザによる再設定の必要を無くすことができる。 In this way, if the power supply voltage is not lower than the RAM holding voltage, it is possible to eliminate the need for resetting by the user even if an asynchronous reset occurs.
ところで、CPUがSRAMのテンポラリデータ領域に対して書込みまたは消去を行っている最中に非同期リセットが発生したとき、SRAMのアドレス選択が不安定になる場合があり、他のアドレスの領域に対する誤書込みまたは誤消去が生じる可能性がある。これでは、設定データ領域の誤消去や誤書込みも生じうる。そのため、リモートコントローラ用のマイコンの仕様として、RAM保持フラグが設けられていながらも、CPUによる書込または消去中に非同期リセットが生じた場合、SRAMのデータ保持状態を「不定」とすることが多い。開発者は、CPUによるSRAMの書込みまたは消去の最中にシステムリセットが発生した場合における、SRAMに記憶されたデータの取り扱いについて、安全性とユーザの利便性のジレンマに陥る。 By the way, when an asynchronous reset occurs while the CPU is writing or erasing the temporary data area of the SRAM, the address selection of the SRAM may become unstable, and erroneous writing to an area of another address Or erroneous erasure may occur. In this case, erroneous erasure or erroneous writing of the setting data area may occur. Therefore, as a specification of a microcomputer for a remote controller, even if a RAM holding flag is provided, if an asynchronous reset occurs during writing or erasing by the CPU, the data holding state of the SRAM is often “undefined”. . The developer falls into the safety and user convenience dilemma regarding the handling of data stored in the SRAM when a system reset occurs during the writing or erasing of the SRAM by the CPU.
他方、特許文献1には、フラッシュメモリの分野において、書込みおよび消去シーケンスの実行中にシステムリセットが発生した場合の誤消去及び誤書込みを回避する手法が開示されている。
しかし、応答性、コスト、回路規模などの視点から、データが保持されることを前提とするフラッシュメモリをリモートコントローラのマイコンに用いることは非現実である。保持したい設定データの記憶にSRAMを用いながらも、ユーザの利便性を高めると共に、安全性を確実に保てる技術が望まれている。 However, from the viewpoint of responsiveness, cost, circuit scale, etc., it is unrealistic to use a flash memory on the premise that data is retained for a microcomputer of a remote controller. There is a demand for a technology that can improve the convenience for the user and can ensure safety while using the SRAM for storing the setting data to be held.
本発明の1つの態様は、マイクロコンピュータである。このマイクロコンピュータは、SRAMと、CPUと、SRAMデータ保護部を備える。 One embodiment of the present invention is a microcomputer. The microcomputer includes an SRAM, a CPU, and an SRAM data protection unit.
SRAMデータ保護部は、非同期リセット信号に同期してSRAMの動作を停止させると共に、非同期リセット信号を、SRAMの動作停止の後まで遅延させてCPUに出力する。 The SRAM data protection unit stops the operation of the SRAM in synchronization with the asynchronous reset signal, and outputs the asynchronous reset signal to the CPU with a delay until after the SRAM operation stops.
なお、上記態様のマイクロコンピュータを装置やシステム、SRAMに記憶されたデータの保護方法に置き換えて表現したものも、本発明の態様として有効である。 It is also effective as an aspect of the present invention to replace the microcomputer of the above aspect with a method for protecting data stored in an apparatus, system, or SRAM.
本発明の技術によれば、マイクロコンピュータにおいて、保持したい設定データなどの記憶にSRAMを用いながらも、ユーザの利便性を高めると共に、安全性を確実に保てる。 According to the technology of the present invention, in the microcomputer, while using the SRAM for storing setting data to be held, the convenience of the user can be improved and the safety can be reliably maintained.
以下、図面を参照して本発明の実施の形態を説明する。説明の明確化のため、以下の記載及び図面は、適宜、省略、及び簡略化がなされている。各図面において同一の構成または機能を有する構成要素および相当部分には、同一の符号を付し、その説明を省略する。
また、以下の各実施の形態は、CPUがSRAMへの書込中及び/または消去中に非同期リセットが発生した場合におけるSRAMの誤書込み及び/または誤消去を回避可能なものであるが、説明上の便宜のため、CPUによるSRAMの「書込み」と「消去」を概して「書込み」と表記して説明する。そのため、以下の説明及び説明に用いた図面において、「書込み」は、「消去」も含む。
<第1の実施の形態>
Embodiments of the present invention will be described below with reference to the drawings. In order to clarify the explanation, the following description and drawings are omitted and simplified as appropriate. In the drawings, components having the same configuration or function and corresponding parts are denoted by the same reference numerals, and description thereof is omitted.
Each of the following embodiments can avoid erroneous writing and / or erasure of the SRAM when an asynchronous reset occurs while the CPU is writing to and / or erasing the SRAM. For convenience, the “writing” and “erasing” of the SRAM by the CPU will be generally described as “writing”. Therefore, in the following description and the drawings used for the description, “writing” includes “erasing”.
<First Embodiment>
図1は、本発明の第1の実施の形態にかかるマイコン100を示す。マイコン100は、電子機器例えばテレビ機のリモートコントローラに備えられ、SRAM110と、CPU120と、リセット制御部130と、設定データ保護部140を有する。
FIG. 1 shows a
マイコン100において、SRAM110と、CPU120と、リセット制御部130は、同用途のマイコンに設けられたものと同一であり、設定データ保護部140は、本発明の特徴部分である。
In the
SRAM110は、設定データ領域112とテンポラリデータ領域114に分けられている。設定データ領域112は、ユーザにより設定され、設定後にはリモートコントローラの動作中に変更が不要な設定データを記憶しており、テンポラリデータ領域114は、リモートコントローラの動作中の一時記憶領域である。
The
CPU120は、リモートコントローラのユーザ入力部(例えばボタンなど)を介してユーザが行った設定をSRAM110の設定データ領域112に書き込み、その後、リモートコントローラのユーザ入力部からの入力などに応じた処理を行う。処理に際して、CPU120は、SRAM110の設定データ領域112に対してはリードを行い、テンポラリデータ領域114に対してはリード/ライトを行う。
The
リセット制御部130は、マイコン100の非同期リセットを制御するものであり、非同期リセットをする必要がある際に、リセット信号S1を出力する。本実施の形態において、リセット信号S1が通常Highであり、非同期リセットが生じたときにLowとなる。なお、非同期リセットをする必要がある場合としては、例えば、図示しないウォッチドッグタイマ(暴走検出タイマ)により暴走を検出したとき、POC(Power On Clear)が発生したとき、図示しないリセット端子からリセット入力がなされたときなどを挙げることができる。
The
設定データ保護部140は、非同期リセットが生じたときにCPU120による設定データ領域112への誤書込みを防ぎ、設定データを保護するものであり、ANDゲート150と、遅延部160と、クロック制御部170と、ANDゲート180を備える。
The setting
マイコン100における各信号の変化例を示す図2を参照しながら、設定データ保護部140の動作を詳細に説明する。
The operation of the setting
遅延部160は、遅延素子162とORゲート164を備える。遅延素子162は、リセット制御部130からのリセット信号S1を遅延させてORゲート164に出力する。ORゲート164は、遅延素子162の出力と、リセット制御部130からのリセット信号S1が入力され、それらの論理和となるCPUリセット信号S2をCPU120に出力する。また、本実施の形態において、遅延素子162は、リセット信号S1を、次のサイクルの終了まで遅延させる。その結果、遅延部160は、リセット信号S1の立下りを、次のサイクルの終了まで遅延させると共に、その後、リセット信号S1の立上りに合わせてCPUリセット信号S2を立ち上げる。
The
図2に示すように、タイミングt0において、非同期リセットの発生によりリセット信号S1が立ち下がるが、CPUリセット信号S2は、次のサイクルの終了タイミングt1で立ち下がる。 As shown in FIG. 2, the reset signal S1 falls due to the occurrence of an asynchronous reset at timing t0, but the CPU reset signal S2 falls at the end timing t1 of the next cycle.
クロック制御部170は、CPU120がSRAM110への書込みに合わせてSRAM110へのクロックとアドレスを供給する。以下、クロック制御部170がSRAM110に供する信号をSRAM書込信号Wという。
The
従来の同種類のマイコンにおいて、通常、クロック制御部は、非同期リセットが発生したときに動作を停止し、CPUとSRAMへのクロック供給を同時に停止する。そのため、CPUによるSRAMの書込み中に非同期リセットが発生すると、SRAMのアドレス選択が不安定になり、設定データ領域の誤書込みが生じうる。 In a conventional microcomputer of the same type, the clock controller normally stops its operation when an asynchronous reset occurs, and simultaneously stops the clock supply to the CPU and SRAM. For this reason, if an asynchronous reset occurs during the writing of the SRAM by the CPU, the address selection of the SRAM becomes unstable, and the setting data area may be erroneously written.
本実施の形態において、クロック制御部170は、リセット信号S1の代わりに遅延部160からのCPUリセット信号S2が入力され、非同期リセットが発生してないときには、従来のクロック制御部と同様な動作をする。非同期リセットが発生した際に、リセット信号S1の立下りではなく、リセット信号S1の立下りを遅延させて得たCPUリセット信号S2の立下りのタイミングでSRAM書込信号Wの供給を停止する。図2に示すように、SRAM書込信号Wは、タイミングt1でLowになる。
In the present embodiment, the
ANDゲート150は、SRAM制御部として機能し、リセット信号S1とSRAM書込信号Wが入力され、それらの論理積となるSRAM書込_リセット信号WRをSRAM110に出力する。これにより、図2に示すように、非同期リセットが発生していないときには、SRAM書込_リセット信号WRがSRAM書込信号Wに同期してHigh/Lowになり、非同期リセットが発生したときすなわちリセット信号S1が立ち下がるタイミングt0でLowになる。その後、次のサイクルの終了タイミングt1まで、SRAM書込信号WがHighになっても、SRAM書込_リセット信号WRがLowに維持され、SRAM110はクロック信号の供給が中止され、停止状態が維持される。
The AND
設定データ保護部140のこのような構成により、非同期リセットが生じ、リセット信号S1が立ち下がるときに(図2に示すタイミングt0)、SRAM110へのクロック供給が直ちに中止され、SRAM110は動作停止する一方、CPU120とクロック制御部170は、次のサイクルの終了タイミングt1まで動作し続けることになる。そのため、CPU120によるSRAM110の書込み中に非同期リセットが生じても、SRAM110のアドレス選択が不安定になることに起因する設定データ領域112のデータの破壊を防ぐことができる。
<第2の実施の形態>
With this configuration of the setting
<Second Embodiment>
図3は、本発明の第2の実施の形態にかかるマイコン200を示す。マイコン200も、マイコン100と同様にリモートコントローラに備えられたものである。マイコン200における、図1に示すマイコン100のものと同様の構成または機能を有する部分について、マイコン100のものと同一の符号を付与すると共に、それらの詳細な説明を省略する。
FIG. 3 shows a
図3に示すように、マイコン200は、SRAM110と、CPU120と、リセット制御部130と、設定データ保護部240を有する。マイコン200において、設定データ保護部240がマイコン100における設定データ保護部140と異なる点を除き、他の各機能ブロックはマイコン100のものと同様である。また、設定データ保護部240においては、設定データ保護部140のANDゲート150の代わりにANDゲート252とORゲート254を設けた点を除き、他の各部分は、設定データ保護部140と同様である。
As illustrated in FIG. 3, the
ANDゲート252は、ANDゲート180からのSRAM書込信号Wと、ORゲート254の出力が入力され、それらの論理積をSRAM書込_リセット信号WRとしてSRAM110に出力する。ORゲート254は、リセット制御部130からのリセット信号S1と、ANDゲート252の出力すなわちSRAM書込_リセット信号WRが入力され、それらの論理和をANDゲート252に出力する。
The AND
図4は、本実施の形態のマイコン200における各信号の変化例を示す。図2と比較すると分かるように、非同期リセットが発生していないときに、マイコン200における各信号は、マイコン100における各信号と同様である。非同期リセットが発生してリセット信号S1が立ち下がるときに、CPUリセット信号S2、SRAM書込信号Wは、マイコン100における相対応する信号と同様であるが、SRAM書込_リセット信号WRは、マイコン100の場合のSRAM書込_リセット信号WRより立下りが遅れ、現在のサイクルの終了タイミングで立ち下がる。
FIG. 4 shows a change example of each signal in the
マイコン200の設定データ保護部240のこのような構成によって、SRAM書込_リセット信号WRは、現在のサイクルの終了タイミングで立ち下がり、その後、その後、次のサイクルの終了タイミングt1まで、SRAM書込信号WがHighになっても、SRAM書込_リセット信号WRがLowに維持され、SRAM110はクロック信号の供給が中止され、停止状態が維持される。そのため、マイコン100における設定データ保護部140と同様の効果を得ることができる。
<第3の実施の形態>
With such a configuration of the setting
<Third Embodiment>
図5は、本発明の第3の実施の形態にかかるマイコン300を示す。マイコン300も、マイコン100と同様にリモートコントローラに備えられたものである。マイコン300における、図1に示すマイコン100のものと同様の構成または機能を有する部分について、マイコン100のものと同一の符号を付与すると共に、それらの詳細な説明を省略する。
FIG. 5 shows a
図5に示すように、マイコン300は、SRAM110と、CPU120と、リセット制御部130と、設定データ保護部340を有する。マイコン300において、設定データ保護部340がマイコン100における設定データ保護部140と異なる点を除き、他の各機能ブロックはマイコン100のものと同様である。また、設定データ保護部340においては、リセット信号S1と、遅延部160からの信号とのいずれを選択してCPU120とクロック制御部170に出力する点を除き、設定データ保護部140と同様である。
As shown in FIG. 5, the
セレクタ350は、SRAM書込信号Wと、リセット信号S1と、遅延部160により遅延させられた信号(図1におけるCPUリセット信号S2と同じ)とが入力され、SRAM書込信号Wに基づいて、リセット信号S1と、遅延部160からの信号のいずれを選択してCPUリセット信号S2としてCPU120とクロック制御部170に出力する。選択に際して具体的には、SRAM書込信号Wが、CPU120がSRAM110に対して書込みをしている最中であることを示すときに遅延部160からの信号を選択し、CPU120がSRAM110に対して書込みをしている最中ではないことを示すときにリセット信号S1を選択する。
The
すなわち、本実施の形態において、CPU120がSRAM110に対して書込みをしていないときに非同期リセットが生じた場合には、CPU120とクロック制御部170に出力されるCPUリセット信号S2は、遅延させられていないリセット信号S1である一方、CPU120がSRAM110に対して書込みをしている最中に非同期リセットが生じた場合には、CPU120とクロック制御部170に出力されるCPUリセット信号S2は、遅延部160により立下りが遅延させられたリセット信号S1である。そのため、図1に示すマイコン100と同様な効果を得ることができると共に、CPU120がSRAM110に書込みをしていない場合にはリセットを迅速に行うことができる。
That is, in this embodiment, when an asynchronous reset occurs when the
以上の説明から分かるように、本発明にかかる技術は、SRAMを設定データ領域とテンポラリデータ領域に分けて使用するマイコンにおいて、非同期リセットが生じた際に、SRAMへのクロック供給を中止してSRAMの動作を停止させた後に、CPUのリセットを行うことによって、CPUがSRAMへの書込み中に非同期リセットが発生した場合の誤書込みを防ぐことができる。そのため、電源電圧がSRAM保持電圧にならない限り、SRAMに記憶された設定データの再入力をしなくて済み、利便性を図りながら、確実に安全性を保つことができる。 As can be seen from the above description, in the microcomputer according to the present invention, which uses the SRAM divided into the setting data area and the temporary data area, the clock supply to the SRAM is stopped when the asynchronous reset occurs. By resetting the CPU after stopping the operation, it is possible to prevent erroneous writing when an asynchronous reset occurs while the CPU writes to the SRAM. Therefore, as long as the power supply voltage does not become the SRAM holding voltage, it is not necessary to re-input the setting data stored in the SRAM, and safety can be reliably maintained while ensuring convenience.
ここで本発明の技術と特許文献1の技術を比較してみる。特許文献1の技術は、フラッシュメモリの誤書込みの回避に関する技術である。フラッシュメモリは、電源供給が途絶えても記憶データが保持される不揮発性メモリであることに対して、本発明の対象とするSRAMは、電源供給が途絶えると記憶データを失うSRAMである。そのため、SRAM内のデータ保護を検討する際に、フラッシュメモリの技術を参照することは考えにくい。本願発明者も、本発明が成された後に技術分野を広げて調査を行ったときに初めて特許文献1に気付いた。すなわち、本発明の技術の分野の当業者は、SRAMのデータ保護に関する技術開発を行うに当たり、フラッシュメモリの分野の技術を参照することは考えられないから、特許文献1に開示された技術が、本発明の技術と相似しているとしても、本発明の特許性を否定することができない。
Here, the technique of the present invention and the technique of
また、フラッシュメモリは、CPUの動作より遅く、CPUの書込みに応答して該書込みを完成させるまである程度の時間(通常、100カウント程度)が必要である。そのため、特許文献1に開示された技術のように、システムリセット信号(上述した実施形態におけるリセット信号S1に相当する)を遅延させてフラッシュメモリに出力して、現在の書込みを完成させるようにすることにより、フラッシュメモリの誤書き込みを回避することが可能である。一方、本発明の対象とするSRAMは、フラッシュメモリと異なり、高い応答性を有し、CPUの動作とほぼ同じ速度で書込みが完了できる。そのため、特許文献1の技術を適用し、リセット信号S1を遅延させてSRAMに出力するようにしても、SRAMの誤書込みを防ぐことが困難である。
The flash memory is slower than the operation of the CPU, and requires a certain amount of time (usually about 100 counts) until the writing is completed in response to the writing by the CPU. Therefore, as in the technique disclosed in
以上、実施の形態をもとに本発明を説明した。実施の形態は例示であり、本発明の主旨から逸脱しない限り、さまざまな変更、増減を加えてもよい。これらの変更、増減が加えられた変形例も本発明の範囲にあることは当業者に理解されるところである。 The present invention has been described above based on the embodiment. The embodiment is an exemplification, and various changes and increases / decreases may be added without departing from the gist of the present invention. It will be understood by those skilled in the art that modifications to which these changes and increases / decreases are also within the scope of the present invention.
例えば、上述した実施形態は、リモートコントローラに備えられたマイコンを例にしている。電子レンジ(MICROWAVE OVEN)などの家庭用電子機器の場合、電源コンセントに常時接続されている場合が多く、またタイマーの設定など保持したい設定内容が失われたとしてもユーザにより再設定が可能である。そのため、これらの家庭用電子機器に設けられた制御用のマイコンにおいて、テンポラリデータの記憶のみならず、保持したい設定内容の記憶にもSRAMが用いられることが考えられる。このようなマイコンにも本発明の技術を適用することができ、また、適用することにより、本発明の効果を得ることができる。 For example, in the above-described embodiment, a microcomputer provided in a remote controller is taken as an example. In the case of household electronic devices such as a microwave oven (MICROWAVE OVEN), it is often connected to a power outlet at all times, and can be reset by the user even if settings such as timer settings are lost. . For this reason, in the control microcomputer provided in these home electronic devices, it is conceivable that the SRAM is used not only for storing temporary data but also for storing setting contents to be retained. The technology of the present invention can be applied to such a microcomputer, and the effects of the present invention can be obtained by applying the technology.
100 マイコン 110 SRAM
112 設定データ領域 114 テンポラリデータ領域
120 CPU 130 リセット制御部
140 設定データ保護部 150 ANDゲート
160 遅延部 162 遅延素子
164 ORゲート 170 クロック制御部
180 ANDゲート 200 マイコン
240 設定データ保護部 252 ANDゲート
254 ORゲート 300 マイコン
340 設定データ保護部 350 セレクタ
S1 リセット信号 S2 CPUリセット信号
W SRAM書込信号 WR SRAM書込_リセット信号
100
112
Claims (8)
CPU(Central Processing Unit)と、
非同期リセット信号に同期して前記SRAMの動作を停止させると共に、前記非同期リセット信号を、前記SRAMの動作停止の後まで遅延させて前記CPUに出力するSRAMデータ保護部とを備えることを特徴とするマイクロコンピュータ。 SRAM (Static Random Access Memory),
CPU (Central Processing Unit),
An SRAM data protection unit that stops the operation of the SRAM in synchronization with an asynchronous reset signal and delays the asynchronous reset signal until after the operation of the SRAM is stopped, and outputs the SRAM data protection unit to the CPU. Microcomputer.
前記CPUによる前記SRAMへのアクセスに合わせて、前記SRAMに動作クロックを供給するクロック供給部と、
前記非同期リセット信号に応じて、前記クロック供給部からの前記動作クロックをオフするSRAM制御部と、
前記非同期リセット信号を遅延させて前記CPUに出力する遅延部とを備えることを特徴とする請求項1または2に記載のマイクロコンピュータ。 The SRAM data protection unit
A clock supply unit for supplying an operation clock to the SRAM in accordance with the access to the SRAM by the CPU;
An SRAM control unit that turns off the operation clock from the clock supply unit in response to the asynchronous reset signal;
The microcomputer according to claim 1, further comprising a delay unit that delays the asynchronous reset signal and outputs the delayed reset signal to the CPU.
前記SRAM制御部は、前記非同期リセット信号と、前記クロック供給部からの動作クロックとの論理積を前記SRAMに出力するANDゲートであることを特徴とする請求項3に記載のマイクロコンピュータ。 The asynchronous reset signal is a signal that becomes Low only when an asynchronous reset occurs,
4. The microcomputer according to claim 3, wherein the SRAM control unit is an AND gate that outputs a logical product of the asynchronous reset signal and an operation clock from the clock supply unit to the SRAM.
前記SRAM制御部は、ANDゲートとORゲートを有し、
前記ANDゲートは、前記非同期リセット信号と、前記ORゲートの出力との論理積を前記SRAMに出力し、
前記ORゲートは、前記クロック供給部からの動作クロックと、前記ANDゲートの出力との論理和を前記ANDゲートに出力することを特徴とする請求項3に記載のマイクロコンピュータ。 The asynchronous reset signal is a signal that becomes Low only when an asynchronous reset occurs,
The SRAM control unit has an AND gate and an OR gate,
The AND gate outputs a logical product of the asynchronous reset signal and the output of the OR gate to the SRAM,
4. The microcomputer according to claim 3, wherein the OR gate outputs a logical sum of an operation clock from the clock supply unit and an output of the AND gate to the AND gate.
該セレクタは、非同期リセットが生じた際に前記CPUが前記SRAMに対する書込み中または消去中であるときにのみ、前記遅延部により遅延させられた非同期リセット信号を選択することを特徴とする請求項3から5のいずれか1項に記載のマイクロコンピュータ。 The SRAM data protection unit further includes a selector that selects one of the asynchronous reset signal and the asynchronous reset signal delayed by the delay unit and outputs the selected signal to the CPU.
4. The selector selects an asynchronous reset signal delayed by the delay unit only when the CPU is writing or erasing the SRAM when an asynchronous reset occurs. 6. The microcomputer according to any one of items 1 to 5.
非同期リセット信号に同期して前記SRAMの動作を停止させると共に、前記非同期リセット信号を、前記SRAMの動作停止の後までに遅延させて前記CPUに出力することを特徴とするSRAMデータ保護方法。 In a microcomputer provided with SRAM (Static Random Access Memory) and CPU (Central Processing Unit),
An SRAM data protection method comprising: stopping the operation of the SRAM in synchronization with an asynchronous reset signal, and outputting the asynchronous reset signal to the CPU with a delay until after the operation of the SRAM is stopped.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2008247131A JP2010079600A (en) | 2008-09-26 | 2008-09-26 | Microcomputer and method for protecting sram data |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2008247131A JP2010079600A (en) | 2008-09-26 | 2008-09-26 | Microcomputer and method for protecting sram data |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2010079600A true JP2010079600A (en) | 2010-04-08 |
Family
ID=42209966
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2008247131A Pending JP2010079600A (en) | 2008-09-26 | 2008-09-26 | Microcomputer and method for protecting sram data |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2010079600A (en) |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS61279962A (en) * | 1985-06-05 | 1986-12-10 | Mitsubishi Electric Corp | information processing equipment |
| JPH02253454A (en) * | 1989-03-28 | 1990-10-12 | Pfu Ltd | memory protection circuit |
| JPH05127780A (en) * | 1991-11-01 | 1993-05-25 | Hitachi Ltd | Semiconductor integrated circuit |
| JPH06231279A (en) * | 1993-02-05 | 1994-08-19 | Hitachi Ltd | Microcomputer |
| JP2003131951A (en) * | 2001-10-19 | 2003-05-09 | Sanyo Electric Co Ltd | Control circuit for non-volatile memory |
| JP2003296198A (en) * | 2002-03-29 | 2003-10-17 | Sanyo Electric Co Ltd | Control circuit for nonvolatile memory |
-
2008
- 2008-09-26 JP JP2008247131A patent/JP2010079600A/en active Pending
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS61279962A (en) * | 1985-06-05 | 1986-12-10 | Mitsubishi Electric Corp | information processing equipment |
| JPH02253454A (en) * | 1989-03-28 | 1990-10-12 | Pfu Ltd | memory protection circuit |
| JPH05127780A (en) * | 1991-11-01 | 1993-05-25 | Hitachi Ltd | Semiconductor integrated circuit |
| JPH06231279A (en) * | 1993-02-05 | 1994-08-19 | Hitachi Ltd | Microcomputer |
| JP2003131951A (en) * | 2001-10-19 | 2003-05-09 | Sanyo Electric Co Ltd | Control circuit for non-volatile memory |
| JP2003296198A (en) * | 2002-03-29 | 2003-10-17 | Sanyo Electric Co Ltd | Control circuit for nonvolatile memory |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN104810055B (en) | Flash chip read-write control circuit and method, AMOLED application circuits | |
| CN104981789A (en) | Apparatuses and methods for variable latency memory operations | |
| JP2010086523A (en) | Secure memory interface | |
| JP5981906B2 (en) | Image forming apparatus | |
| JP2016118815A (en) | Nonvolatile memory device | |
| US9575535B2 (en) | Integrated circuit and operation method thereof | |
| TW202141484A (en) | Secure memory device, secure memory system and method of managing temper detection | |
| JP5622429B2 (en) | Microcomputer | |
| JP4624008B2 (en) | MEMORY DEVICE HAVING WRITE-PROTECTABLE BUFFER MEMORY AND INFORMATION PROCESSING SYSTEM INCLUDING THE SAME | |
| JP2008310896A (en) | Nonvolatile memory device, nonvolatile memory system, and method for controlling nonvolatile memory device | |
| JP2001075941A (en) | Microcomputer with built-in flash memory and operating method thereof | |
| JP6220244B2 (en) | Electronics | |
| JP2010079600A (en) | Microcomputer and method for protecting sram data | |
| CN109147847B (en) | Semiconductor device and flash memory control method | |
| JP6340291B2 (en) | Information processing device | |
| JP3998452B2 (en) | Nonvolatile memory control circuit | |
| JP2012033222A (en) | Semiconductor memory device and its control method | |
| CN104282343A (en) | Semiconductor system and method for reparing the same | |
| US7310277B2 (en) | Non-volatile semiconductor storage device with specific command enable/disable control signal | |
| JP2010015477A (en) | Flash memory control device and flash memory control method | |
| JP3832117B2 (en) | Programmable controller backup data protection method and programmable controller | |
| JP4103452B2 (en) | Data input control device for serial EEPROM | |
| JP2002099468A (en) | Writing control circuit | |
| JP5823000B2 (en) | Microcomputer | |
| JP2006331233A (en) | Memory controller, flash memory system, and control method for flash memory |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20110401 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20121228 |
|
| A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20130521 |