JP5305076B2 - Microcomputer - Google Patents
Microcomputer Download PDFInfo
- Publication number
- JP5305076B2 JP5305076B2 JP2008226328A JP2008226328A JP5305076B2 JP 5305076 B2 JP5305076 B2 JP 5305076B2 JP 2008226328 A JP2008226328 A JP 2008226328A JP 2008226328 A JP2008226328 A JP 2008226328A JP 5305076 B2 JP5305076 B2 JP 5305076B2
- Authority
- JP
- Japan
- Prior art keywords
- cpu
- storage means
- refresh
- status information
- data
- 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Power Sources (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
- Microcomputers (AREA)
Description
本発明は、マイクロコンピュータに関し、特にCPUが停止しているときのレジスタ,メモリのリフレッシュ動作に関するものである。 The present invention relates to a microcomputer, and more particularly to a register / memory refresh operation when a CPU is stopped.
車両において、各部の電子制御化に伴い、電子制御装置(以下、ECU:Electronic Control Unitと略称する)が数多く搭載されるようになっているが、消費電力も増加し、バッテリの負担も増大している。そこで、通常動作モードと、該通常動作モードよりも消費電力量が少ないスリープモードとの間で切り替えが可能なマイクロコンピュータを用いることで、ECUが非動作時のときには、マイクロコンピュータをスリープモードとして、消費電力量を抑制している。 A lot of electronic control devices (hereinafter abbreviated as ECU: Electronic Control Unit) have been installed in vehicles in accordance with electronic control of each part. However, power consumption has increased and the burden on the battery has increased. ing. Therefore, by using a microcomputer that can be switched between the normal operation mode and the sleep mode that consumes less power than the normal operation mode, when the ECU is not operating, the microcomputer is set to the sleep mode. Power consumption is suppressed.
従来、スリープモード時に、CPUの動作に関する設定を保持するレジスタの記憶内容がノイズ等の影響で変わること(レジスタのデータ化け)によるシステム誤作動を防止するために、定期的にレジスタリフレッシュを行っている。図8に、従来技術によるレジスタリフレッシュの実施例のタイミングチャートを示す。レジスタリフレッシュタイミングTmが到来したときに、CPUの状態はスリープモード(CPU停止状態)から通常モード(CPU動作状態)に切り替わり、レジスタリフレッシュRmを行う。そして、レジスタリフレッシュRmを行った後に、CPUの状態は通常モードからスリープモードに切り替わる。 Conventionally, in the sleep mode, to prevent system malfunction due to changes in the memory contents of the registers that hold settings related to CPU operation due to the effects of noise (register data corruption), register refresh is performed periodically. Yes. FIG. 8 shows a timing chart of an embodiment of register refresh according to the prior art. When the register refresh timing Tm arrives, the CPU state is switched from the sleep mode (CPU stopped state) to the normal mode (CPU operating state), and the register refresh Rm is performed. Then, after performing the register refresh Rm, the CPU state is switched from the normal mode to the sleep mode.
また、光ディスク再生装置においても、スリープモードで処理を一時停止するときに、DRAMの内容を保持しつつ消費電力を低減するリフレッシュ回路が考案されている(特許文献1参照)。 Also in an optical disk reproducing apparatus, a refresh circuit has been devised that reduces power consumption while retaining the contents of a DRAM when processing is suspended in a sleep mode (see Patent Document 1).
図8の例では、CPU動作時にメインクロックを用いたレジスタリフレッシュRmを実施することで、レジスタのデータ化けを回避している。暗電流(ECU非動作時の消費電流)低減を図るためには、レジスタリフレッシュタイミングすなわち低消費電力動作時間Tmを長くすることは有効である。しかし、CPU動作時のレジスタリフレッシュの間隔(すなわちTm)が長くなるため、レジスタのデータ化けによるシステムへの悪影響を及ぼす確率が高くなる。そのため、積極的な低消費電力動作を行うことができず、暗電流増加の一因となっている。 In the example of FIG. 8, register data corruption is avoided by performing a register refresh Rm using the main clock during the CPU operation. In order to reduce the dark current (current consumption when the ECU is not operating), it is effective to increase the register refresh timing, that is, the low power consumption operation time Tm. However, since the register refresh interval (i.e., Tm) during the CPU operation becomes long, the probability of adverse effects on the system due to garbled register data increases. For this reason, active low power consumption operation cannot be performed, which contributes to an increase in dark current.
上記問題を背景として、本発明の課題は、暗電流を増加させることなくレジスタのリフレッシュを行うことが可能なマイクロコンピュータを提供することにある。 With the above problem as a background, an object of the present invention is to provide a microcomputer capable of refreshing a register without increasing dark current.
上記課題を解決するためのマイクロコンピュータは、プログラムを実行するCPUと、CPUの動作モードを、該CPUが動作している通常モードと、該CPUが停止しているスリープモードとの間で切り替える動作モード切換手段と、通常モードにて動作し、CPUを動作させるためのメインクロックを生成するメインクロック生成手段と、メインクロック生成手段とは別に設けられ、サブクロックを生成するサブクロック生成手段と、CPUの設定状態や動作状態を含むCPU状態情報を記憶する第一記憶手段と、リフレッシュ用のCPU状態情報を記憶する第二記憶手段と、スリープモードにおいて、サブクロックに基づいて予め定められたタイミングでリフレッシュ信号を生成するリフレッシュ信号生成手段と、リフレッシュ信号に基づいて、第二記憶手段に記憶されたCPU状態情報を読み出して、第一記憶手段に書き込むデータリフレッシュ手段と、を備えることを特徴とする。 A microcomputer for solving the above-described problem is an operation for switching a CPU that executes a program and an operation mode of the CPU between a normal mode in which the CPU is operating and a sleep mode in which the CPU is stopped. A mode switching unit, a main clock generating unit that operates in a normal mode and generates a main clock for operating the CPU, a sub clock generating unit that is provided separately from the main clock generating unit and generates a sub clock; First storage means for storing CPU state information including the CPU setting state and operation state, second storage means for storing CPU state information for refresh, and timing determined in advance based on the subclock in the sleep mode Refresh signal generating means for generating a refresh signal at the Zui and reads the CPU state information stored in the second storage means, characterized in that it comprises a data refreshing means for writing in the first storage means.
上記構成においては、低消費電力動作時(スリープモード時)にはメインクロックは停止するが、サブクロックは動作し続けている。これを利用することで、低消費電力動作時のレジスタ(第一記憶手段)のリフレッシュを実現することができる。これにより、低消費電力動作時のレジスタのデータ化けの心配がなくなり、積極的な低消費電力動作を行うことで、暗電流低減が見込める。また、上記構成においては、リフレッシュは、CPU動作時には実行されない。そのため、CPU動作時はソフトウェアによるレジスタ書き換えに影響を与えることがないため、ECUの動作に影響を及ぼすことはない。 In the above configuration, the main clock is stopped during the low power consumption operation (sleep mode), but the sub clock continues to operate. By utilizing this, it is possible to realize the refresh of the register (first storage means) during the low power consumption operation. As a result, there is no fear of register data being garbled during the low power consumption operation, and the dark current can be reduced by performing the active low power consumption operation. In the above configuration, refresh is not executed during CPU operation. For this reason, during CPU operation, there is no effect on register rewriting by software, so that the operation of the ECU is not affected.
また、本発明のマイクロコンピュータにおける第一記憶手段は、揮発性メモリを含んで構成され、第二記憶手段は、不揮発性メモリを含んで構成されるように構成される。 In the microcomputer of the present invention, the first storage means includes a volatile memory, and the second storage means includes a nonvolatile memory.
揮発性メモリを用いてデータの保持を行う場合、常にデータ保持用の電圧を印加しているが、データ化けを確実に防止することはできない。また、不揮発性メモリは、データ化けの可能性が低く、リフレッシュ用のデータを保持するのに好適である。上記構成によって、レジスタ等に揮発性メモリを用いた場合でも、レジスタのデータ化けの可能性がより小さくなる。また、RAMを第一記憶手段として用いる場合にも、データ化けの心配がより小さくなる。 When data is held using a volatile memory, a data holding voltage is always applied, but data corruption cannot be reliably prevented. In addition, the non-volatile memory is less likely to be garbled and is suitable for holding refresh data. With the above configuration, even when a volatile memory is used as a register or the like, the possibility of register data being garbled becomes smaller. In addition, when the RAM is used as the first storage unit, there is less concern about data corruption.
また、本発明のマイクロコンピュータにおけるリフレッシュ信号生成手段は、メインクロックを検出するメインクロック検出手段を含み、メインクロックを検出したときにはリフレッシュ信号を生成せず、メインクロックを検出しないときにリフレッシュ信号を生成するように構成される。 The refresh signal generating means in the microcomputer of the present invention includes a main clock detecting means for detecting the main clock, and does not generate a refresh signal when the main clock is detected, and generates a refresh signal when the main clock is not detected. Configured to do.
上記構成によって、リフレッシュは、CPU動作時には実行されない。一方、スリープモード時には確実に実行される。そのため、CPU動作時はソフトウェアによるレジスタ書き換えに影響を与えることがないため、ECUの動作に影響を及ぼすことはない。 With the above configuration, refresh is not executed during CPU operation. On the other hand, it is reliably executed in the sleep mode. For this reason, during CPU operation, there is no effect on register rewriting by software, so that the operation of the ECU is not affected.
また、本発明のマイクロコンピュータにおける第二記憶手段には、予めバックアップ用のCPU状態情報が記憶されており、データリフレッシュ手段は、第二記憶手段から、バックアップ用のCPU状態情報を読み出して、第一記憶手段に書き込むように構成される。 The second storage means in the microcomputer of the present invention stores CPU status information for backup in advance, and the data refresh means reads the CPU status information for backup from the second storage means, It is configured to write to one storage means.
上記構成によって、レジスタ等においてデータ化けが発生したときにおいても、データの内容を復旧することができる。 With the above structure, the contents of data can be recovered even when data corruption occurs in a register or the like.
また、本発明のマイクロコンピュータにおける第二記憶手段は、CPUの動作モードが、通常モードからスリープモードに切り替えられる直前の、第一記憶手段に記憶されているCPU状態情報を記憶し、データリフレッシュ手段は、第二記憶手段から、通常モードからスリープモードに切り替えられる直前のCPU状態情報を読み出して、第一記憶手段に書き込むように構成される。 The second storage means in the microcomputer of the present invention stores the CPU status information stored in the first storage means immediately before the operation mode of the CPU is switched from the normal mode to the sleep mode, and the data refresh means Is configured to read from the second storage means the CPU status information immediately before switching from the normal mode to the sleep mode and write it to the first storage means.
上記構成によって、レジスタ等においてデータ化けが発生したときにおいても、データの内容を復旧することができ、さらに、スリープモードから通常モードに切り替ったときには、CPUは、通常モードからスリープモードに切り替えられる直前の状態から動作するため、ECUの動作を円滑なものとすることができる。 With the above configuration, even when data corruption occurs in a register or the like, the data contents can be restored, and when the sleep mode is switched to the normal mode, the CPU is switched from the normal mode to the sleep mode. Since it operates from the immediately preceding state, the operation of the ECU can be made smooth.
また、本発明のマイクロコンピュータは、第一記憶手段に記憶されたCPU状態情報の内容と、第二記憶手段に記憶されたCPU状態情報の内容とを比較するCPU状態情報比較手段を備え、データリフレッシュ手段は、CPU状態情報の内容の比較結果に基づいて、第二記憶手段からCPU状態情報を読み出して、第一記憶手段に書き込むように構成される。 The microcomputer of the present invention further comprises CPU state information comparing means for comparing the contents of the CPU state information stored in the first storage means with the contents of the CPU state information stored in the second storage means, and the data The refresh unit is configured to read the CPU state information from the second storage unit and write it to the first storage unit based on the comparison result of the contents of the CPU state information.
上記構成によって、リフレッシュの対象を選択・限定することができるため、リフレッシュ時間を短縮することができる。また、リフレッシュが不要な領域に書き込みを行わないため、書き込みの際にデータが化けるということも発生しない。 With the above configuration, the refresh target can be selected and limited, so that the refresh time can be shortened. In addition, since writing is not performed in an area that does not require refreshing, data is not garbled during writing.
また、本発明のマイクロコンピュータにおけるデータリフレッシュ手段は、第一記憶手段に記憶されたCPU状態情報の内容と、第二記憶手段に記憶されたCPU状態情報の内容とが異なっているときに、異なっているとされたCPU状態情報の内容のみを、第二記憶手段から読み出して前記第一記憶手段に書き込むように構成される。 Further, the data refresh means in the microcomputer of the present invention is different when the contents of the CPU status information stored in the first storage means and the contents of the CPU status information stored in the second storage means are different. Only the contents of the CPU status information that is supposed to be read are read from the second storage means and written to the first storage means.
上記構成によって、CPU状態情報の内容とが異なっているもののみを書き換えるため、リフレッシュに要する時間を短縮することができる。また、リフレッシュが不要な領域に書き込みを行わないため、書き込みの際にデータが化けるということも発生しない。 With the above configuration, since only the contents different from the contents of the CPU state information are rewritten, the time required for refresh can be shortened. In addition, since writing is not performed in an area that does not require refreshing, data is not garbled during writing.
また、上記課題を解決するためのマイクロコンピュータは、プログラムを実行するCPUと、CPUの動作モードを、該CPUが動作している通常モードと、該CPUが停止しているスリープモードとの間で切り替える動作モード切換手段と、通常モードにて動作し、CPUを動作させるためのメインクロックを生成するメインクロック生成手段と、メインクロック生成手段とは別に設けられ、サブクロックを生成するサブクロック生成手段と、CPUの設定状態や動作状態を含むCPU状態情報を記憶する第一記憶手段と、リフレッシュ用のCPU状態情報を記憶する第二記憶手段と、スリープモードにおいて、サブクロックに基づいて予め定められたタイミングで所定の信号を生成する信号生成手段と、所定の信号に基づいて、第一記憶手段に記憶されたCPU状態情報の内容と、第二記憶手段に記憶されたCPU状態情報の内容とを比較するCPU状態情報比較手段と、所定の信号に基づいて、第一記憶手段に記憶されたCPU状態情報の内容と、第二記憶手段に記憶されたCPU状態情報の内容とが、少なくとも1つ以上異なっているときに、第一記憶手段に記憶されている全てのCPU状態情報の内容を、スリープモードから通常モードに切り替えられた際に、予め定められた内容に書き換える旨のデータ再設定情報を書き込むデータ再設定情報書込手段と、を備えることを特徴とする。
In addition, a microcomputer for solving the above-described problem is a CPU that executes a program and an operation mode of the CPU between a normal mode in which the CPU is operating and a sleep mode in which the CPU is stopped. An operation mode switching means for switching, a main clock generating means for operating in the normal mode and generating a main clock for operating the CPU, and a sub clock generating means for generating a sub clock provided separately from the main clock generating means And first storage means for storing CPU state information including the setting state and operation state of the CPU, second storage means for storing CPU state information for refresh, and predetermined in a sleep mode based on the subclock. Signal generating means for generating a predetermined signal at a predetermined timing and a first memory based on the predetermined signal And contents of the CPU status information stored in stages, and the CPU status information comparison means for comparing the contents of the CPU state information stored in the second storage means, based on a predetermined signal, stored in the first storage means The contents of all the CPU status information stored in the first storage means when the contents of the CPU status information differ from at least one of the CPU status information contents stored in the second storage means. Is provided with data resetting information writing means for writing data resetting information for rewriting to a predetermined content when the sleep mode is switched to the normal mode .
上記構成によって、スリープモード時にデータ化けが発生したときには、データのリフレッシュは行われないが、スリープモードから通常モードに切り替えられた際に、実質的にデータのリフレッシュが行われ、暗電流も増加せず、ECUの動作に影響を及ぼすことはない。 With the above configuration, when data corruption occurs in the sleep mode, the data is not refreshed, but when the sleep mode is switched to the normal mode, the data is substantially refreshed and the dark current increases. Therefore, the operation of the ECU is not affected.
また、本発明のマイクロコンピュータにおけるサブクロック生成手段は、CR発振回路を含むように構成される。 Further, the sub clock generation means in the microcomputer of the present invention is configured to include a CR oscillation circuit.
CR発振回路は、C(コンデンサ),R(抵抗),トランジスタあるいはオペアンプ等で構成され、水晶発振子が不要である。上記構成によって、比較的安価でサブクロック生成手段を構成することが可能となる。また、CR発振回路は集積化が可能なため、マイクロコンピュータに内蔵することも可能である。さらに、水晶発振子を用いた発振回路に比べて、消費電流が少ないので、スリープモードでの動作に適している。 The CR oscillation circuit is composed of C (capacitor), R (resistance), transistor, operational amplifier or the like, and does not require a crystal oscillator. With the above configuration, it is possible to configure the sub clock generation means at a relatively low cost. Further, since the CR oscillation circuit can be integrated, it can be incorporated in a microcomputer. Furthermore, since current consumption is small compared to an oscillation circuit using a crystal oscillator, it is suitable for operation in a sleep mode.
以下、本発明のマイクロコンピュータを、図面を参照しながら説明する。本発明のマイクロコンピュータは、例えば、車両に搭載されたECUに用いられる。車両では暗電流が多いと、バッテリの消耗を早めるため、本発明のマイクロコンピュータを用いることで、暗電流を低減でき、バッテリの消耗を抑えることができる。 The microcomputer of the present invention will be described below with reference to the drawings. The microcomputer of the present invention is used in, for example, an ECU mounted on a vehicle. When the vehicle has a large amount of dark current, battery consumption is accelerated. Therefore, by using the microcomputer of the present invention, dark current can be reduced and battery consumption can be suppressed.
図1に、マイクロコンピュータ(以下、マイコンと略称する)1およびその周辺構成を示す。マイコン1は、基本的な構成要素として、プログラムを実行するCPU11,マイコン1の機能や動作モードを選択して設定するためのDRAMあるいはSRAMで構成されるレジスタ12,プログラムやデータが予め格納されるROM13,CPU11による演算結果を一時記憶するためのRAM14,EEPROM(Electrical Erasable & Programmable Read Only Memory:電気的消去・プログラム可能・読出し専用メモリ)あるいはフラッシュメモリ等の不揮発性記憶媒体で構成されるメモリ15等が、データバス24を介して接続されている。
FIG. 1 shows a microcomputer (hereinafter abbreviated as a microcomputer) 1 and its peripheral configuration. The microcomputer 1 stores, as basic components, a
なお、CPU11が本発明の動作モード切換手段に相当し、レジスタ12が本発明の第一記憶手段に相当し、ROM13が本発明の第二記憶手段に相当し、RAM14が本発明の第一記憶手段に相当し、メモリ15が本発明の第二記憶手段に相当する。また、レジスタ12に記憶された情報の少なくとも一部が本発明のCPU状態情報に相当し、さらに、RAM14に記憶された情報の少なくとも一部も本発明のCPU状態情報に相当する。
The
そして、マイコン1は、その外部に設けられる発振素子23とによりCPU11の動作クロックであるメインクロック信号(例えば、数MHz〜数十MHz)を生成するメイン発振回路16と、上記メインクロック信号よりも周波数が低いサブクロック信号(例えば、数十KHz)を生成するサブ発振回路18とを備えている。なお、メイン発振回路16が本発明のメインクロック生成手段に相当する。また、サブ発振回路18が本発明のサブクロック生成手段に相当する。
The microcomputer 1 includes a
また、マイコン1は、レジスタ等のリフレッシュ動作を行うリフレッシュ制御部19を備えている。リフレッシュ制御部19は、例えばPLD(Programmable Logic Device:プログラム可能論理デバイス)によって構成され、メインクロック信号およびサブクロック信号の状態に基づいて生成されるリフレッシュ信号生成部17からの信号に基づいてリフレッシュ動作を行う。なお、リフレッシュ制御部19が本発明のメモリデータリフレッシュ手段,CPU状態情報比較手段に相当する。
Further, the microcomputer 1 includes a
図10に、リフレッシュ信号生成部17の構成を示す。リフレッシュ信号生成部17は、メイン発振回路16からのメインクロックを検出する検出回路17a,サブ発振回路18と分周回路17cとの経路の接続/遮断を行うスイッチ回路17b,サブ発振回路18からのサブクロックを分周する分周回路17cを含んで構成される。なお、リフレッシュ信号生成部17が本発明のリフレッシュ信号生成手段に相当する。また、検出回路17aが本発明のメインクロック検出手段に相当する。
FIG. 10 shows the configuration of the refresh
検出回路17aは、メインクロックを検出したときには、スイッチ回路17bをオフ状態とし、サブ発振回路18と分周回路17cとの経路が遮断状態となり、分周回路17cからは信号は出力されない。一方、メインクロックを検出しないきとには、スイッチ回路17bをオン状態とし、サブ発振回路18と分周回路17cとの経路の経路が接続状態となり、分周回路17cからはサブクロックが分周された信号が出力される。
When the
図1に戻り、CPU11は、特定の命令を実行することによってマイコン1の動作モードを、少なくともCPU11およびメイン発振回路が動作する通常動作モードと、CPU11およびメイン発振回路16の動作を停止させ、通常動作モードよりも消費電力量が少ないスリープモードに切り替え制御することができるようになっている。
Returning to FIG. 1, the
よって、リフレッシュ信号生成部17は、スリープモードにおいてのみ、サブクロックが分周された信号を出力する。
Therefore, the refresh
また、マイコン1は、モータやLCD等の外部アクチュエータを駆動するためのドライバ20,シリアル通信を行うシリアル通信部21,外部との信号の入出力を行うための汎用入出力ポートを含む入出力部22等を含むこともある。
The microcomputer 1 includes an input / output unit including a
電源回路25は、例えばバッテリ等の外部電源装置から、マイコン1の各部に電源を供給するためのものである(各部への結線は省略)。
The
図2に、サブ発振回路18の構成例を示す。サブ発振回路18は、周知のCR発振回路により構成される。図2は、サブ発振回路18をウィーンブリッジ型発振回路で構成した例である。他に、ザルツァ型発振回路,移相型発振回路を用いてもよい。図2の例では、抵抗R1,R2、コンデンサC1,C2、オペアンプOPが、発振回路の基本構成要素である。また、抵抗R3は振幅安定化用、抵抗R4は振幅調整用の抵抗である。出力端子SIN OUTから出力されるサブクロック信号の発振周波数fは、f=1/{2π×(C1×C2×R1×R2)1/2}となる。
FIG. 2 shows a configuration example of the
図3に、データリフレッシュ動作における、マイコン1の動作の流れを示す。まず、スリープモードに移行する命令が実行されたか否かを判定する。スリープモード移行命令が実行されたとき(S11:Yes)、少なくともCPU11およびメイン発振回路16の動作を停止して、通常モードからスリープモードに移行する(S13)。なお、ステップS12については後述する。スリープモード中は、メイン発振回路16は停止しているが、サブ発振回路18は動作している。また、サブ発振回路18は、消費電力低減の面から、通常モード時には停止している方が望ましい。
FIG. 3 shows an operation flow of the microcomputer 1 in the data refresh operation. First, it is determined whether or not an instruction for shifting to the sleep mode has been executed. When the sleep mode transition command is executed (S11: Yes), at least the operations of the
スリープモード中は、通常モードに移行する命令が実行されたか否かを判定する。例えば、スリープモード中にシリアル通信部20においてデータを受信した場合、あるいは入出力部22で予め定められた信号を検出した場合、シリアル通信部20あるいは入出力部22からCPU11にウェイクアップ信号が送られる。このウェイクアップ信号が通常モード移行命令に相当する。通常モード移行命令が実行されたとき(S14:Yes)、メイン発振回路16およびCPU11の動作を開始してスリープモードから通常モードに移行する(S17)。
During the sleep mode, it is determined whether or not an instruction for shifting to the normal mode has been executed. For example, when data is received by the
一方、通常モード移行命令が実行されずスリープモードが継続中のとき(S14:No)、リフレッシュタイミング(図9のRsに相当)が到来したか否かを判定する。リフレッシュ信号生成部17には、メインクロックとサブクロックの両方が入力されているが、上述のとおり、メイン発振回路16が動作していてメインクロックが入力されているとき(すなわち通常モード時)には、リフレッシュ制御部19に対して何も出力しない。一方、メイン発振回路16が停止してメインクロックが入力されないとき(すなわちスリープモード時)には、サブクロックに基づいて、例えば分周処理を行ってリフレッシュタイミング信号をリフレッシュ制御部19に対して出力する。
On the other hand, when the normal mode transition command is not executed and the sleep mode is continuing (S14: No), it is determined whether or not the refresh timing (corresponding to Rs in FIG. 9) has arrived. Although both the main clock and the sub clock are input to the refresh
リフレッシュタイミングが到来したとき(S15:Yes)、例えばレジスタ12のデータリフレッシュ動作(S16)を実行する(後述)。
When the refresh timing arrives (S15: Yes), for example, a data refresh operation (S16) of the
図4を用いて、図3のステップS16に相当するデータリフレッシュ動作について、レジスタ12に記憶されている内容のリフレッシュを例に挙げて説明する。なお、本動作は、リフレッシュ制御部19において行われる。まず、ROM13に予め記憶されているリフレッシュ情報を1つあるいは複数読み出す(S31)。
With reference to FIG. 4, the data refresh operation corresponding to step S16 in FIG. 3 will be described by taking the refresh of the contents stored in the
図5に、ROM13に記憶されているリフレッシュ情報の一例を示す。リフレッシュ情報はレジスタのアドレスと、その設定内容であるデータとが関連付けて記憶されている。図4に戻り、リフレッシュ制御部19は、リフレッシュ情報に含まれるアドレスを指定して、そのアドレスに対応付けられたデータをレジスタ12に書き込む(S32)。
FIG. 5 shows an example of refresh information stored in the
そして、全データ、あるいは予め定められたアドレス範囲または予め定められた個数のデータの書き込みが完了したとき(S33:Yes)、本動作を終了する。 Then, when the writing of all the data, or a predetermined address range or a predetermined number of data is completed (S33: Yes), this operation is terminated.
図4の例では、ROM13に予め記憶されているリフレッシュ情報を用いてレジスタのリフレッシュを行っていたが、マイコン1がスリープモードに移行する直前のデータを記憶し、その記憶内容をリフレッシュ情報として用いてもよい。以下にその動作の概要を説明する。
In the example of FIG. 4, the register is refreshed using the refresh information stored in advance in the
まず、図3のマイコン1の動作において、スリープモードに移行する命令が実行されたか否かを判定して、スリープモード移行命令が実行されたとき(S11:Yes)、レジスタ12のデータをメモリ15に退避する(S12)。その後、CPU11およびメイン発振回路16の動作を停止して通常モードからスリープモードに移行する(S13)。以降の動作は、図3と同様である。
First, in the operation of the microcomputer 1 in FIG. 3, it is determined whether or not an instruction to shift to the sleep mode is executed, and when the sleep mode shift instruction is executed (S11: Yes), the data in the
図4のデータリフレッシュ動作においては、ステップS31においてROM13からではなくメモリ15からリフレッシュ情報を読み出す。その他の動作は図4と同様である。
In the data refresh operation of FIG. 4, refresh information is read from the
メモリ15に記憶したリフレッシュ情報を用いて、リフレッシュ動作を行う構成において、レジスタ12の他にRAM14のリフレッシュを行うことも可能である。RAM14は、少なくとも一部の領域がSRAMあるいはデータを保持可能なDRAMで構成されていることもある。このため、スリープモード時にはRAM14のこれらの領域においてデータ化けが発生する可能性もある。以下にその動作の概要を説明する。
In the configuration where the refresh operation is performed using the refresh information stored in the
まず、図3のマイコン1の動作において、スリープモードに移行する命令が実行されたか否かを判定して、スリープモード移行命令が実行されたとき(S11:Yes)、RAM14のデータをメモリ15に退避する(S12)。その後、メイン発振回路16およびCPU11の動作を停止して通常モードからスリープモードに移行する(S13)。以降の動作は、図3と同様である。
First, in the operation of the microcomputer 1 in FIG. 3, it is determined whether or not an instruction to shift to the sleep mode is executed, and when the sleep mode shift instruction is executed (S11: Yes), the data in the
図4のデータリフレッシュ動作においては、ステップS31においてROM13からではなくメモリ15からリフレッシュ情報を読み出し、ステップS32では、読み出したデータをRAM14に書き込む。その他の動作は図4と同様である。
In the data refresh operation of FIG. 4, refresh information is read from the
図6を用いて、図3のステップS16に相当するデータリフレッシュ動作の別例について、レジスタ12に記憶されている内容のリフレッシュを例に挙げて説明する。まず、ROM13に予め記憶されているリフレッシュ情報(ROMデータ)を例えば1つ読み出す(S51)。次に、読み出したフレッシュ情報に含まれるアドレスに相当するレジスタ12のデータ(レジスタデータ)を読み出す(S52)。
With reference to FIG. 6, another example of the data refresh operation corresponding to step S <b> 16 in FIG. 3 will be described by taking the refresh of the contents stored in the
そして、読み出したROMデータおよびレジスタデータの内容を比較する(S53)。比較の結果、両者が一致しているとき(S54:Yes)、データ化けが発生していないのでステップS56(後述)へ移る。一方、両者が一致していないとき(S54:No)、データ化けが発生したとして、読み出したROMデータをレジスタ12の該当するアドレス領域へ書き込む(S55)。このとき、レジスタ12の予め定められた領域に予め定められたデータ(初期化コード:本発明のデータ再設定情報)を書き込む構成としてもよい。
Then, the contents of the read ROM data and register data are compared (S53). As a result of the comparison, if the two match (S54: Yes), since data corruption has not occurred, the process proceeds to step S56 (described later). On the other hand, when the two do not match (S54: No), it is determined that data corruption has occurred, and the read ROM data is written into the corresponding address area of the register 12 (S55). At this time, a predetermined data (initialization code: data reset information of the present invention) may be written in a predetermined area of the
そして、全データ、あるいは予め定められたアドレス範囲または予め定められた個数のデータの書き込みが完了したとき(S56:Yes)、本動作を終了する。 Then, when the writing of all data, or a predetermined address range or a predetermined number of data is completed (S56: Yes), this operation is terminated.
図7を用いて、レジスタ12の予め定められた領域に予め定められたデータ(初期化コード)が書き込まれた構成における、マイコン1の通常モードへの移行動作について説明する。なお、本動作は、マイコン1がスリープモードとなっていることが前提となる。
The transition operation to the normal mode of the microcomputer 1 in a configuration in which predetermined data (initialization code) is written in a predetermined area of the
まず、図3と同様に、通常モードに移行する命令が実行されたか否かを判定する。通常モード移行命令が実行されたとき(S71:Yes)、メイン発振回路16およびCPU11の動作を開始してスリープモードから通常モードに移行する(S72)。次に、レジスタ12の予め定められた領域の内容を読み出す(S73)。
First, as in FIG. 3, it is determined whether or not an instruction for shifting to the normal mode has been executed. When the normal mode shift command is executed (S71: Yes), the
そして、その読み出した内容が初期化コードか否かを判定する。初期化コードであるとき(S74:Yes)、レジスタ12の全ての内容あるいは予め定められた範囲の内容を初期化する(S75)。初期化の方法は、以下のいずれを用いてもよい。
・ROM13に予め記憶されているレジスタ初期化データ(リフレッシュ情報でもよい)をレジスタ12に書き込む。
・ROM13に記憶されてCPU11が実行するプログラムに含まれるレジスタ初期化処理を実行し、レジスタ初期化処理に含まれる初期化データをレジスタ12に書き込む。
Then, it is determined whether or not the read content is an initialization code. When it is an initialization code (S74: Yes), all the contents of the
Write register initialization data (may be refresh information) stored in advance in the
A register initialization process included in a program stored in the
図6の構成においても、マイコン1がスリープモードに移行する直前のデータを記憶し、その記憶内容をリフレッシュ情報として用いることが可能である。この場合、図3ではステップS12を実行して、レジスタデータをメモリ15に退避してリフレッシュ情報を作成する。そして、図6のステップS51では、メモリ15に記憶されたリフレッシュ情報を読み出す。
In the configuration of FIG. 6 as well, it is possible to store data immediately before the microcomputer 1 shifts to the sleep mode and use the stored contents as refresh information. In this case, in FIG. 3, step S12 is executed to save the register data in the
また、図6の構成においても、RAM14のリフレッシュを行うことが可能である。この場合、図3ではステップS12を実行して、RAM14のデータをメモリ15に退避してリフレッシュ情報を作成する。そして、図6のステップS51では、メモリ15に記憶されたリフレッシュ情報を読み出し、ステップS52ではRAM14のデータを読み出す。
Also in the configuration of FIG. 6, the
また、図6の構成において、メモリ15に記憶されたリフレッシュ情報とRAM14のデータとを比較した結果、両者の内容が異なってデータ化けが発生している場合(S54:No)、レジスタ12と同様に、RAM14の所定領域に初期化コードを書き込み、図7のようなRAM初期化処理を行ってもよい。
In the configuration of FIG. 6, when the refresh information stored in the
図8に、従来技術によるレジスタリフレッシュ動作に関するタイミングチャートを示す。また、図9に、本発明の構成によるレジスタリフレッシュ動作に関するタイミングチャートを示す。図8の例では、レジスタのリフレッシュRmを行う度にCPU11を動作させなければならず、低消費電力動作時間Tmが継続せず、Tmの延べ時間も長くならないが、図9の例では、レジスタのリフレッシュRsを行うためにCPU11を動作させる必要がないので、低消費電力動作時間Tsを、継続時間,延べ時間とも図8のTmよりも長くすることができる。無論、RAM14のデータのリフレッシュも同様に行うことができる。
FIG. 8 shows a timing chart relating to a register refresh operation according to the prior art. FIG. 9 is a timing chart regarding the register refresh operation according to the configuration of the present invention. In the example of FIG. 8, the
上述の図3〜図6の例では、レジスタ12のみ、あるいはRAM14のみのリフレッシュを行っているが、レジスタ12およびRAM14の両方をリフレッシュしてもよい。例えば、図4において、まず、レジスタ12のリフレッシュを行い、続いてRAM14のリフレッシュを行う。無論、レジスタ12のリフレッシュ動作とRAM14のリフレッシュ動作とを別個のものとしてもよい。
In the example of FIGS. 3 to 6 described above, only the
また、リフレッシュタイミング(Rs)が到来したときに、レジスタ12のリフレッシュとRAM14のリフレッシュとを交互に行ってもよい。
Further, when the refresh timing (Rs) arrives, the refresh of the
以上、本発明の実施の形態を説明したが、これらはあくまで例示にすぎず、本発明はこれらに限定されるものではなく、特許請求の範囲の趣旨を逸脱しない限りにおいて、当業者の知識に基づく種々の変更が可能である。 Although the embodiments of the present invention have been described above, these are merely examples, and the present invention is not limited to these embodiments, and the knowledge of those skilled in the art can be used without departing from the spirit of the claims. Various modifications based on this are possible.
1 マイクロコンピュータ(マイコン)
11 CPU(動作モード切換手段)
12 レジスタ(第一記憶手段)
13 ROM(第二記憶手段)
14 RAM(第一記憶手段)
15 メモリ(第二記憶手段)
16 メイン発振回路(メインクロック生成手段)
17 リフレッシュ信号生成部(リフレッシュ信号生成手段,CPU状態情報比較手段)
17a 検出回路(メインクロック検出手段)
17b スイッチ回路
17c 分周回路
18 サブ発振回路(サブクロック生成手段)
19 リフレッシュ制御部(メモリデータリフレッシュ手段)
23 発振素子
1 Microcomputer (microcomputer)
11 CPU (operation mode switching means)
12 registers (first storage means)
13 ROM (second storage means)
14 RAM (first storage means)
15 Memory (second storage means)
16 Main oscillation circuit (main clock generation means)
17 Refresh signal generator (refresh signal generator, CPU status information comparator)
17a Detection circuit (main clock detection means)
19 Refresh control unit (memory data refresh means)
23 Oscillator
Claims (9)
前記CPUの動作モードを、該CPUが動作している通常モードと、該CPUが停止しているスリープモードとの間で切り替える動作モード切換手段と、
前記通常モードにて動作し、前記CPUを動作させるためのメインクロックを生成するメインクロック生成手段と、
前記メインクロック生成手段とは別に設けられ、サブクロックを生成するサブクロック生成手段と、
前記CPUの設定状態や動作状態を含むCPU状態情報を記憶する第一記憶手段と、
リフレッシュ用の前記CPU状態情報を記憶する第二記憶手段と、
前記スリープモードにおいて、前記サブクロックに基づいて予め定められたタイミングでリフレッシュ信号を生成するリフレッシュ信号生成手段と、
前記リフレッシュ信号に基づいて、前記第二記憶手段に記憶された前記CPU状態情報を読み出して、前記第一記憶手段に書き込むデータリフレッシュ手段と、
を備えることを特徴とするマイクロコンピュータ。 A CPU for executing the program;
An operation mode switching means for switching an operation mode of the CPU between a normal mode in which the CPU is operating and a sleep mode in which the CPU is stopped;
Main clock generating means that operates in the normal mode and generates a main clock for operating the CPU;
A sub-clock generation unit that is provided separately from the main clock generation unit and generates a sub-clock;
First storage means for storing CPU state information including a setting state and an operation state of the CPU;
Second storage means for storing the CPU status information for refresh;
Refresh signal generating means for generating a refresh signal at a predetermined timing based on the sub-clock in the sleep mode;
Based on the refresh signal, data refresh means for reading the CPU status information stored in the second storage means and writing to the first storage means;
A microcomputer comprising:
前記第二記憶手段は、不揮発性メモリを含んで構成される請求項1に記載のマイクロコンピュータ。 The first storage means includes a volatile memory,
The microcomputer according to claim 1, wherein the second storage unit includes a nonvolatile memory.
前記メインクロックを検出したときには前記リフレッシュ信号を生成せず、前記メインクロックを検出しないときに前記リフレッシュ信号を生成する請求項1または請求項2に記載のマイクロコンピュータ。 The refresh signal generation means includes main clock detection means for detecting the main clock,
3. The microcomputer according to claim 1, wherein the refresh signal is not generated when the main clock is detected, and the refresh signal is generated when the main clock is not detected.
前記データリフレッシュ手段は、前記第二記憶手段から、前記バックアップ用のCPU状態情報を読み出して、前記第一記憶手段に書き込む請求項1ないし請求項3のいずれか1項に記載のマイクロコンピュータ。 In the second storage means, CPU status information for backup is stored in advance,
4. The microcomputer according to claim 1, wherein the data refresh unit reads out the CPU status information for backup from the second storage unit and writes it to the first storage unit. 5.
前記データリフレッシュ手段は、前記第二記憶手段から、前記通常モードから前記スリープモードに切り替えられる直前の前記CPU状態情報を読み出して、前記第一記憶手段に書き込む請求項1ないし請求項4のいずれか1項に記載のマイクロコンピュータ。 The second storage means stores the CPU state information stored in the first storage means immediately before the operation mode of the CPU is switched from the normal mode to the sleep mode,
5. The data refresh unit according to claim 1, wherein the data refresh unit reads out the CPU state information immediately before switching from the normal mode to the sleep mode from the second storage unit, and writes the read CPU state information into the first storage unit. 2. The microcomputer according to item 1.
前記データリフレッシュ手段は、前記CPU状態情報の内容の比較結果に基づいて、前記第二記憶手段からCPU状態情報を読み出して、前記第一記憶手段に書き込む請求項1ないし請求項5のいずれか1項に記載のマイクロコンピュータ。 CPU status information comparing means for comparing the content of the CPU status information stored in the first storage means with the content of the CPU status information stored in the second storage means,
6. The data refresh unit according to claim 1, wherein the data refresh unit reads out the CPU state information from the second storage unit based on a comparison result of the contents of the CPU state information and writes the CPU state information in the first storage unit. The microcomputer according to item.
前記CPUの動作モードを、該CPUが動作している通常モードと、該CPUが停止しているスリープモードとの間で切り替える動作モード切換手段と、
前記通常モードにて動作し、前記CPUを動作させるためのメインクロックを生成するメインクロック生成手段と、
前記メインクロック生成手段とは別に設けられ、サブクロックを生成するサブクロック生成手段と、
前記CPUの設定状態や動作状態を含むCPU状態情報を記憶する第一記憶手段と、
リフレッシュ用の前記CPU状態情報を記憶する第二記憶手段と、
前記スリープモードにおいて、前記サブクロックに基づいて予め定められたタイミングで所定の信号を生成する信号生成手段と、
前記所定の信号に基づいて、前記第一記憶手段に記憶されたCPU状態情報の内容と、前記第二記憶手段に記憶されたCPU状態情報の内容とを比較するCPU状態情報比較手段と、
前記所定の信号に基づいて、前記第一記憶手段に記憶されたCPU状態情報の内容と、前記第二記憶手段に記憶されたCPU状態情報の内容とが、少なくとも1つ以上異なっているときに、前記第一記憶手段に記憶されている全てのCPU状態情報の内容を、前記スリープモードから前記通常モードに切り替えられた際に、予め定められた内容に書き換える旨のデータ再設定情報を書き込むデータ再設定情報書込手段と、
を備えることを特徴とするマイクロコンピュータ。 A CPU for executing the program;
An operation mode switching means for switching an operation mode of the CPU between a normal mode in which the CPU is operating and a sleep mode in which the CPU is stopped;
Main clock generating means that operates in the normal mode and generates a main clock for operating the CPU;
A sub-clock generation unit that is provided separately from the main clock generation unit and generates a sub-clock;
First storage means for storing CPU state information including a setting state and an operation state of the CPU;
Second storage means for storing the CPU status information for refresh;
A signal generating means for generating a predetermined signal at a predetermined timing based on the sub-clock in the sleep mode;
CPU status information comparing means for comparing the content of the CPU status information stored in the first storage means with the content of the CPU status information stored in the second storage means based on the predetermined signal;
When at least one or more of the contents of the CPU status information stored in the first storage means and the contents of the CPU status information stored in the second storage means are different based on the predetermined signal Data for writing data resetting information to rewrite the contents of all CPU state information stored in the first storage means to predetermined contents when the sleep mode is switched to the normal mode Resetting information writing means;
A microcomputer comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008226328A JP5305076B2 (en) | 2008-09-03 | 2008-09-03 | Microcomputer |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008226328A JP5305076B2 (en) | 2008-09-03 | 2008-09-03 | Microcomputer |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2010061393A JP2010061393A (en) | 2010-03-18 |
JP5305076B2 true JP5305076B2 (en) | 2013-10-02 |
Family
ID=42188129
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008226328A Expired - Fee Related JP5305076B2 (en) | 2008-09-03 | 2008-09-03 | Microcomputer |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5305076B2 (en) |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0628053A (en) * | 1992-07-09 | 1994-02-04 | Fujitsu Ltd | Electronic apparatus having stand-by mode |
JP4387122B2 (en) * | 1996-11-21 | 2009-12-16 | 株式会社日立製作所 | Low power processor |
JP3588267B2 (en) * | 1999-03-05 | 2004-11-10 | 三洋電機株式会社 | Refresh circuit and control circuit of optical disk reproducing apparatus using the same |
JP4151566B2 (en) * | 2003-02-25 | 2008-09-17 | 株式会社デンソー | Microcomputer |
JP4724461B2 (en) * | 2005-05-17 | 2011-07-13 | Okiセミコンダクタ株式会社 | System LSI |
JP4535170B2 (en) * | 2007-10-19 | 2010-09-01 | 株式会社デンソー | Microcomputer system |
JP2009265880A (en) * | 2008-04-24 | 2009-11-12 | Denso Corp | Microcomputer, and external register data processing method therefor |
-
2008
- 2008-09-03 JP JP2008226328A patent/JP5305076B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2010061393A (en) | 2010-03-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8046615B2 (en) | Microcomputer system with reduced power consumption | |
JP4535170B2 (en) | Microcomputer system | |
JP4750564B2 (en) | Reset signal generation circuit | |
JP4665846B2 (en) | Microcomputer and electronic control device | |
CN103403808B (en) | The semiconductor devices of the misoperation of the nonvolatile memory preventing power supply all standing from causing | |
US20100088503A1 (en) | Microcontroller | |
US7003382B2 (en) | Electronic control unit for a vehicle | |
JP5328525B2 (en) | Semiconductor device | |
JP5305076B2 (en) | Microcomputer | |
JP2009265880A (en) | Microcomputer, and external register data processing method therefor | |
JP2008196441A (en) | Control device for vehicle | |
CN108255633B (en) | Storage control method and storage device | |
US20110004745A1 (en) | Method of Controlling a Measurement Instrument | |
TWI602190B (en) | Memory control method and memory device | |
KR101031417B1 (en) | Micro Processor Unit with non-volatile memory register and control method therefor | |
JP6159668B2 (en) | Vehicle control device | |
JP2006350930A (en) | Control circuit and information processor | |
JP4026924B2 (en) | Electronic control unit for automobile | |
JP2005128613A (en) | Image forming device | |
JP2010102434A (en) | Missing data recovery device | |
KR100887499B1 (en) | Save mistake rehabilitation method of operation time counter to use fram in electron control system for vehicles | |
JP2009212736A (en) | Semiconductor integrated circuit | |
JPH09213088A (en) | Engine controller | |
JP2012198954A (en) | Semiconductor memory device and method for controlling the same | |
JP2019149088A (en) | Information processor and information processing method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20110809 |
|
RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20121003 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20130327 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20130328 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20130521 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20130530 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20130612 |
|
LAPS | Cancellation because of no payment of annual fees |