JP2010061393A - Microcomputer - Google Patents

Microcomputer Download PDF

Info

Publication number
JP2010061393A
JP2010061393A JP2008226328A JP2008226328A JP2010061393A JP 2010061393 A JP2010061393 A JP 2010061393A JP 2008226328 A JP2008226328 A JP 2008226328A JP 2008226328 A JP2008226328 A JP 2008226328A JP 2010061393 A JP2010061393 A JP 2010061393A
Authority
JP
Japan
Prior art keywords
cpu
refresh
storage means
data
status information
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.)
Granted
Application number
JP2008226328A
Other languages
Japanese (ja)
Other versions
JP5305076B2 (en
Inventor
Tatsuo Sumida
辰雄 住田
Shinichi Senoo
伸一 妹尾
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.)
Denso Corp
Original Assignee
Denso 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 Denso Corp filed Critical Denso Corp
Priority to JP2008226328A priority Critical patent/JP5305076B2/en
Publication of JP2010061393A publication Critical patent/JP2010061393A/en
Application granted granted Critical
Publication of JP5305076B2 publication Critical patent/JP5305076B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Power Sources (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)
  • Microcomputers (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a microcomputer refreshing a register without increasing a dark current. <P>SOLUTION: The microcomputer includes: an operation mode switch means for switching a CPU operation mode between a normal operation mode in which a CPU operates and a sleep mode in which the CPU does not operate; a main clock generation means for generating a main clock for operating the CPU; a sub-clock generation means which is disposed separately from the main clock generation means to generate a sub-clock; a first storage means for storing CPU state information including a setting state and an operation state of the CPU; a second storage means for storing CPU state information for refresh; a refresh signal generation means for generating a refresh signal at preset timing based on the sub-clock; and a data refresh means for reading the CPU state information stored in the second storage means to write it in the first storage means on the basis of the refresh signal. <P>COPYRIGHT: (C)2010,JPO&INPIT

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).

特開2000−260179号公報JP 2000-260179 A

図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.

課題を解決するための手段および発明の効果Means for Solving the Problems and Effects of the Invention

上記課題を解決するためのマイクロコンピュータは、プログラムを実行するCPUと、CPUの動作モードを、該CPUが動作している通常モードと、該CPUが停止しているスリープモードとの間で切り替える動作モード切換手段と、通常モードにて動作し、CPUを動作させるためのメインクロックを生成するメインクロック生成手段と、メインクロック生成手段とは別に設けられ、サブクロックを生成するサブクロック生成手段と、CPUの設定状態や動作状態を含むCPU状態情報を記憶する第一記憶手段と、リフレッシュ用のCPU状態情報を記憶する第二記憶手段と、スリープモードにおいて、サブクロックに基づいて予め定められたタイミングでリフレッシュ信号を生成するリフレッシュ信号生成手段と、リフレッシュ信号に基づいて、第二記憶手段に記憶されたCPU状態情報を読み出して、第一記憶手段に書き込むデータリフレッシュ手段と、を備えることを特徴とする。   A microcomputer for solving the above-described problem is an operation of 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.

また、本発明のマイクロコンピュータにおける第一記憶手段は、揮発性メモリを含んで構成され、第二記憶手段は、不揮発性メモリを含んで構成されるように構成される。   The first storage means in the microcomputer of the present invention is configured to include a volatile memory, and the second storage means is configured to include 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 content of the CPU status information that is supposed to be read is 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状態情報の内容とが、少なくとも1つ以上異なっているときに、第一記憶手段の内容を、スリープモードから通常モードに切り替えられた際に、予め定められた内容に書き換える旨のデータ再設定情報を書き込むように構成される。   In the data refresh means in the microcomputer of the present invention, 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. When the data is stored in the first storage unit, data resetting information for rewriting the content of the first storage unit to a predetermined content is written when the mode is switched from the sleep mode 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 CPU 11 that executes a program, a register 12 that includes a DRAM or SRAM for selecting and setting functions and operation modes of the microcomputer 1, and programs and data. ROM 13, RAM 14 for temporarily storing the calculation result by CPU 11, EEPROM 15 (Electrical Erasable & Programmable Read Only Memory), or a memory 15 constituted by a nonvolatile storage medium such as a flash memory Are connected via the data bus 24.

なお、CPU11が本発明の動作モード切換手段に相当し、レジスタ12が本発明の第一記憶手段に相当し、ROM13が本発明の第二記憶手段に相当し、RAM14が本発明の第一記憶手段に相当し、メモリ15が本発明の第二記憶手段に相当する。また、レジスタ12に記憶された情報の少なくとも一部が本発明のCPU状態情報に相当し、さらに、RAM14に記憶された情報の少なくとも一部も本発明のCPU状態情報に相当する。   The CPU 11 corresponds to the operation mode switching means of the present invention, the register 12 corresponds to the first storage means of the present invention, the ROM 13 corresponds to the second storage means of the present invention, and the RAM 14 corresponds to the first storage means of the present invention. The memory 15 corresponds to the second storage means of the present invention. Further, at least a part of the information stored in the register 12 corresponds to the CPU state information of the present invention, and at least a part of the information stored in the RAM 14 also corresponds to the CPU state information of the present invention.

そして、マイコン1は、その外部に設けられる発振素子23とによりCPU11の動作クロックであるメインクロック信号(例えば、数MHz〜数十MHz)を生成するメイン発振回路16と、上記メインクロック信号よりも周波数が低いサブクロック信号(例えば、数十KHz)を生成するサブ発振回路18とを備えている。なお、メイン発振回路16が本発明のメインクロック生成手段に相当する。また、サブ発振回路18が本発明のサブクロック生成手段に相当する。   The microcomputer 1 includes a main oscillation circuit 16 that generates a main clock signal (for example, several MHz to several tens of MHz) that is an operation clock of the CPU 11 with an oscillation element 23 provided outside the microcomputer 1, and the main clock signal. And a sub oscillation circuit 18 that generates a sub clock signal (for example, several tens of KHz) having a low frequency. The main oscillation circuit 16 corresponds to the main clock generation means of the present invention. The sub oscillation circuit 18 corresponds to the sub clock generation means of the present invention.

また、マイコン1は、レジスタ等のリフレッシュ動作を行うリフレッシュ制御部19を備えている。リフレッシュ制御部19は、例えばPLD(Programmable Logic Device:プログラム可能論理デバイス)によって構成され、メインクロック信号およびサブクロック信号の状態に基づいて生成されるリフレッシュ信号生成部17からの信号に基づいてリフレッシュ動作を行う。なお、リフレッシュ制御部19が本発明のメモリデータリフレッシュ手段,CPU状態情報比較手段に相当する。   Further, the microcomputer 1 includes a refresh control unit 19 that performs a refresh operation of a register or the like. The refresh control unit 19 is configured by, for example, a PLD (Programmable Logic Device), and performs a refresh operation based on a signal from the refresh signal generation unit 17 generated based on the states of the main clock signal and the sub clock signal. I do. The refresh controller 19 corresponds to the memory data refresh means and CPU status information comparison means of the present invention.

図10に、リフレッシュ信号生成部17の構成を示す。リフレッシュ信号生成部17は、メイン発振回路16からのメインクロックを検出する検出回路17a,サブ発振回路18と分周回路17cとの経路の接続/遮断を行うスイッチ回路17b,サブ発振回路18からのサブクロックを分周する分周回路17cを含んで構成される。なお、リフレッシュ信号生成部17が本発明のリフレッシュ信号生成手段に相当する。また、検出回路17aが本発明のメインクロック検出手段に相当する。   FIG. 10 shows the configuration of the refresh signal generation unit 17. The refresh signal generator 17 includes a detection circuit 17a that detects a main clock from the main oscillation circuit 16, a switch circuit 17b that connects / disconnects a path between the sub oscillation circuit 18 and the frequency divider circuit 17c, and a sub oscillation circuit 18 A frequency dividing circuit 17c that divides the sub clock is included. The refresh signal generator 17 corresponds to the refresh signal generator of the present invention. The detection circuit 17a corresponds to the main clock detection means of the present invention.

検出回路17aは、メインクロックを検出したときには、スイッチ回路17bをオフ状態とし、サブ発振回路18と分周回路17cとの経路が遮断状態となり、分周回路17cからは信号は出力されない。一方、メインクロックを検出しないきとには、スイッチ回路17bをオン状態とし、サブ発振回路18と分周回路17cとの経路の経路が接続状態となり、分周回路17cからはサブクロックが分周された信号が出力される。   When the detection circuit 17a detects the main clock, the switch circuit 17b is turned off, the path between the sub oscillation circuit 18 and the frequency dividing circuit 17c is cut off, and no signal is output from the frequency dividing circuit 17c. On the other hand, when the main clock is not detected, the switch circuit 17b is turned on, the path between the sub oscillation circuit 18 and the frequency dividing circuit 17c is connected, and the sub clock is divided from the frequency dividing circuit 17c. Is output.

図1に戻り、CPU11は、特定の命令を実行することによってマイコン1の動作モードを、少なくともCPU11およびメイン発振回路が動作する通常動作モードと、CPU11およびメイン発振回路16の動作を停止させ、通常動作モードよりも消費電力量が少ないスリープモードに切り替え制御することができるようになっている。   Returning to FIG. 1, the CPU 11 executes a specific command to stop the operation mode of the microcomputer 1, at least the normal operation mode in which the CPU 11 and the main oscillation circuit operate, and the operation of the CPU 11 and the main oscillation circuit 16. It is possible to control to switch to the sleep mode, which consumes less power than the operation mode.

よって、リフレッシュ信号生成部17は、スリープモードにおいてのみ、サブクロックが分周された信号を出力する。   Therefore, the refresh signal generation unit 17 outputs a signal obtained by dividing the sub clock only in the sleep mode.

また、マイコン1は、モータやLCD等の外部アクチュエータを駆動するためのドライバ20,シリアル通信を行うシリアル通信部21,外部との信号の入出力を行うための汎用入出力ポートを含む入出力部22等を含むこともある。   The microcomputer 1 includes an input / output unit including a driver 20 for driving an external actuator such as a motor and an LCD, a serial communication unit 21 for serial communication, and a general-purpose input / output port for inputting / outputting signals to / from the outside. 22 etc. may be included.

電源回路25は、例えばバッテリ等の外部電源装置から、マイコン1の各部に電源を供給するためのものである(各部への結線は省略)。   The power supply circuit 25 is for supplying power to each part of the microcomputer 1 from an external power supply device such as a battery (connection to each part is omitted).

図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 sub oscillation circuit 18. The sub oscillation circuit 18 is configured by a known CR oscillation circuit. FIG. 2 shows an example in which the sub oscillation circuit 18 is configured by a Wien bridge type oscillation circuit. In addition, a Salza oscillation circuit or a phase shift oscillation circuit may be used. In the example of FIG. 2, resistors R1 and R2, capacitors C1 and C2, and an operational amplifier OP are basic components of the oscillation circuit. The resistor R3 is for amplitude stabilization, and the resistor R4 is a resistor for amplitude adjustment. The oscillation frequency f of the sub clock signal output from the output terminal SIN OUT is f = 1 / {2π × (C1 × C2 × R1 × R2) 1/2 }.

図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 CPU 11 and the main oscillation circuit 16 are stopped, and the normal mode is shifted to the sleep mode (S13). Step S12 will be described later. During the sleep mode, the main oscillation circuit 16 is stopped, but the sub oscillation circuit 18 is operating. Further, the sub oscillation circuit 18 is preferably stopped in the normal mode from the viewpoint of reducing power consumption.

スリープモード中は、通常モードに移行する命令が実行されたか否かを判定する。例えば、スリープモード中にシリアル通信部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 serial communication unit 20 during the sleep mode or when a predetermined signal is detected by the input / output unit 22, a wake-up signal is sent from the serial communication unit 20 or the input / output unit 22 to the CPU 11. It is done. This wake-up signal corresponds to a normal mode transition command. When the normal mode shift command is executed (S14: Yes), the main oscillation circuit 16 and the CPU 11 are started to shift from the sleep mode to the normal mode (S17).

一方、通常モード移行命令が実行されずスリープモードが継続中のとき(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 signal generation unit 17, as described above, when the main oscillation circuit 16 is operating and the main clock is input (that is, in the normal mode). Outputs nothing to the refresh control unit 19. On the other hand, when the main oscillation circuit 16 is stopped and the main clock is not input (that is, in the sleep mode), for example, frequency division processing is performed based on the sub clock and a refresh timing signal is output to the refresh control unit 19. To do.

リフレッシュタイミングが到来したとき(S15:Yes)、例えばレジスタ12のデータリフレッシュ動作(S16)を実行する(後述)。   When the refresh timing arrives (S15: Yes), for example, a data refresh operation (S16) of the register 12 is executed (described later).

図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 register 12 as an example. This operation is performed in the refresh control unit 19. First, one or a plurality of refresh information stored in advance in the ROM 13 is read (S31).

図5に、ROM13に記憶されているリフレッシュ情報の一例を示す。リフレッシュ情報はレジスタのアドレスと、その設定内容であるデータとが関連付けて記憶されている。図4に戻り、リフレッシュ制御部19は、リフレッシュ情報に含まれるアドレスを指定して、そのアドレスに対応付けられたデータをレジスタ12に書き込む(S32)。   FIG. 5 shows an example of refresh information stored in the ROM 13. The refresh information is stored in association with the register address and the data which is the setting content. Returning to FIG. 4, the refresh control unit 19 designates an address included in the refresh information, and writes data associated with the address to the register 12 (S32).

そして、全データ、あるいは予め定められたアドレス範囲または予め定められた個数のデータの書き込みが完了したとき(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 ROM 13. However, the data immediately before the microcomputer 1 enters the sleep mode is stored, and the stored content is used as the refresh information. May be. The outline of the operation will be described below.

まず、図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 register 12 is stored in the memory 15. (S12). Thereafter, the operations of the CPU 11 and the main oscillation circuit 16 are stopped and the normal mode is shifted to the sleep mode (S13). The subsequent operation is the same as in FIG.

図4のデータリフレッシュ動作においては、ステップS31においてROM13からではなくメモリ15からリフレッシュ情報を読み出す。その他の動作は図4と同様である。   In the data refresh operation of FIG. 4, refresh information is read from the memory 15 instead of the ROM 13 in step S31. Other operations are the same as those in FIG.

メモリ15に記憶したリフレッシュ情報を用いて、リフレッシュ動作を行う構成において、レジスタ12の他にRAM14のリフレッシュを行うことも可能である。RAM14は、少なくとも一部の領域がSRAMあるいはデータを保持可能なDRAMで構成されていることもある。このため、スリープモード時にはRAM14のこれらの領域においてデータ化けが発生する可能性もある。以下にその動作の概要を説明する。   In the configuration where the refresh operation is performed using the refresh information stored in the memory 15, the RAM 14 can be refreshed in addition to the register 12. The RAM 14 may be composed of SRAM or DRAM capable of holding data at least in a part of the area. Therefore, data corruption may occur in these areas of the RAM 14 during the sleep mode. The outline of the operation will be described below.

まず、図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 RAM 14 is stored in the memory 15. Retreat (S12). Thereafter, the operations of the main oscillation circuit 16 and the CPU 11 are stopped, and the normal mode is shifted to the sleep mode (S13). The subsequent operation is the same as in FIG.

図4のデータリフレッシュ動作においては、ステップS31においてROM13からではなくメモリ15からリフレッシュ情報を読み出し、ステップS32では、読み出したデータをRAM14に書き込む。その他の動作は図4と同様である。   In the data refresh operation of FIG. 4, refresh information is read from the memory 15 instead of the ROM 13 in step S31, and the read data is written to the RAM 14 in step S32. Other operations are the same as those in FIG.

図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 register 12 as an example. First, for example, one piece of refresh information (ROM data) stored in advance in the ROM 13 is read (S51). Next, the data (register data) of the register 12 corresponding to the address included in the read fresh information is read (S52).

そして、読み出した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 resetting information of the present invention) may be written in a predetermined area of the register 12.

そして、全データ、あるいは予め定められたアドレス範囲または予め定められた個数のデータの書き込みが完了したとき(S56:Yes)、本動作を終了する。   Then, when the writing of all the 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 register 12 will be described with reference to FIG. This operation is based on the premise that the microcomputer 1 is in the sleep mode.

まず、図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 main oscillation circuit 16 and the CPU 11 are started to shift from the sleep mode to the normal mode (S72). Next, the contents of a predetermined area of the register 12 are read (S73).

そして、その読み出した内容が初期化コードか否かを判定する。初期化コードであるとき(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 register 12 or the contents of a predetermined range are initialized (S75). Any of the following initialization methods may be used.
Write register initialization data (may be refresh information) stored in advance in the ROM 13 to the register 12.
A register initialization process included in a program stored in the ROM 13 and executed by the CPU 11 is executed, and initialization data included in the register initialization process is written to the register 12.

図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 memory 15 and create refresh information. In step S51 of FIG. 6, the refresh information stored in the memory 15 is read out.

また、図6の構成においても、RAM14のリフレッシュを行うことが可能である。この場合、図3ではステップS12を実行して、RAM14のデータをメモリ15に退避してリフレッシュ情報を作成する。そして、図6のステップS51では、メモリ15に記憶されたリフレッシュ情報を読み出し、ステップS52ではRAM14のデータを読み出す。   Also in the configuration of FIG. 6, the RAM 14 can be refreshed. In this case, in FIG. 3, step S12 is executed to save the data in the RAM 14 in the memory 15 and create refresh information. In step S51 of FIG. 6, the refresh information stored in the memory 15 is read, and in step S52, data in the RAM 14 is read.

また、図6の構成において、メモリ15に記憶されたリフレッシュ情報とRAM14のデータとを比較した結果、両者の内容が異なってデータ化けが発生している場合(S54:No)、レジスタ12と同様に、RAM14の所定領域に初期化コードを書き込み、図7のようなRAM初期化処理を行ってもよい。   In the configuration of FIG. 6, when the refresh information stored in the memory 15 and the data in the RAM 14 are compared with each other and the contents are different and data corruption occurs (S54: No), the same as the register 12 Alternatively, an initialization code may be written in a predetermined area of the RAM 14 to perform a RAM initialization process as shown in FIG.

図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 CPU 11 must be operated every time the register refresh Rm is performed, and the low power consumption operation time Tm does not continue, and the total time of Tm does not increase. Since it is not necessary to operate the CPU 11 to perform the refresh Rs, the low power consumption operation time Ts can be made longer than the Tm in FIG. Of course, the data in the RAM 14 can be refreshed in the same manner.

上述の図3〜図6の例では、レジスタ12のみ、あるいはRAM14のみのリフレッシュを行っているが、レジスタ12およびRAM14の両方をリフレッシュしてもよい。例えば、図4において、まず、レジスタ12のリフレッシュを行い、続いてRAM14のリフレッシュを行う。無論、レジスタ12のリフレッシュ動作とRAM14のリフレッシュ動作とを別個のものとしてもよい。   In the example of FIGS. 3 to 6 described above, only the register 12 or only the RAM 14 is refreshed, but both the register 12 and the RAM 14 may be refreshed. For example, in FIG. 4, first, the register 12 is refreshed, and then the RAM 14 is refreshed. Of course, the refresh operation of the register 12 and the refresh operation of the RAM 14 may be made separate.

また、リフレッシュタイミング(Rs)が到来したときに、レジスタ12のリフレッシュとRAM14のリフレッシュとを交互に行ってもよい。   Further, when the refresh timing (Rs) arrives, the refresh of the register 12 and the refresh of the RAM 14 may be performed alternately.

以上、本発明の実施の形態を説明したが、これらはあくまで例示にすぎず、本発明はこれらに限定されるものではなく、特許請求の範囲の趣旨を逸脱しない限りにおいて、当業者の知識に基づく種々の変更が可能である。   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.

マイクロコンピュータの構成例を示す図。The figure which shows the structural example of a microcomputer. サブ発振回路の構成例を示す図。The figure which shows the structural example of a sub oscillation circuit. データリフレッシュ動作を説明するフロー図。The flowchart explaining data refresh operation | movement. 図3のデータリフレッシュ動作の詳細を説明するフロー図。FIG. 4 is a flowchart for explaining details of a data refresh operation of FIG. 3. リフレッシュ情報の一例を示す図。The figure which shows an example of refresh information. データリフレッシュ動作の別例を説明するフロー図。The flowchart explaining another example of data refresh operation | movement. レジスタ初期化時のマイコンの動作を説明するフロー図。The flowchart explaining operation | movement of the microcomputer at the time of register initialization. 従来技術によるレジスタリフレッシュの動作例を示すタイミングチャート。9 is a timing chart showing an example of register refresh operation according to the prior art. 本発明の構成によるレジスタリフレッシュの動作例を示すタイミングチャート。6 is a timing chart showing an example of register refresh operation according to the configuration of the present invention. リフレッシュ信号生成部の構成例を示す図。The figure which shows the structural example of a refresh signal production | generation part.

符号の説明Explanation of symbols

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)
17b switch circuit 17c frequency dividing circuit 18 sub oscillation circuit (sub clock generation means)
19 Refresh control unit (memory data refresh means)
23 Oscillator

Claims (9)

プログラムを実行するCPUと、
前記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;
A main clock generating means which operates in the normal mode and generates a main clock for operating the CPU;
A sub-clock generating means that is provided separately from the main clock generating means,
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;
Data refresh means for reading out the CPU status information stored in the second storage means based on the refresh signal and writing it 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状態情報が記憶されており、
前記データリフレッシュ手段は、前記第二記憶手段から、前記バックアップ用の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の動作モードが、前記通常モードから前記スリープモードに切り替えられる直前の、前記第一記憶手段に記憶されている前記CPU状態情報を記憶し、
前記データリフレッシュ手段は、前記第二記憶手段から、前記通常モードから前記スリープモードに切り替えられる直前の前記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状態情報の内容とを比較するCPU状態情報比較手段を備え、
前記データリフレッシュ手段は、前記CPU状態情報の内容の比較結果に基づいて、前記第二記憶手段からCPU状態情報を読み出して、前記第一記憶手段に書き込む請求項1ないし請求項5のいずれか1項に記載のマイクロコンピュータ。
CPU status information comparing means for comparing the contents of the CPU status information stored in the first storage means with the contents 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状態情報の内容のみを、前記第二記憶手段から読み出して前記第一記憶手段に書き込む請求項6に記載のマイクロコンピュータ。   The data refresh means 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. 7. The microcomputer according to claim 6, wherein only the contents of the CPU status information are read from the second storage means and written to the first storage means. 前記データリフレッシュ手段は、前記第一記憶手段に記憶されたCPU状態情報の内容と、前記第二記憶手段に記憶されたCPU状態情報の内容とが、少なくとも1つ以上異なっているときに、前記第一記憶手段に記憶されている全てのCPU状態情報の内容を、前記スリープモードから前記通常モードに切り替えられた際に、予め定められた内容に書き換える旨のデータ再設定情報を書き込む請求項6に記載のマイクロコンピュータ。   The data refresh means, when the content of the CPU status information stored in the first storage means and the content of the CPU status information stored in the second storage means are different from each other, 7. The data reset information for rewriting 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. A microcomputer according to 1. 前記サブクロック生成手段は、CR発振回路を含む請求項1ないし請求項8のいずれか1項に記載のマイクロコンピュータ。   The microcomputer according to any one of claims 1 to 8, wherein the sub-clock generation means includes a CR oscillation circuit.
JP2008226328A 2008-09-03 2008-09-03 Microcomputer Expired - Fee Related JP5305076B2 (en)

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 true JP2010061393A (en) 2010-03-18
JP5305076B2 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)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0628053A (en) * 1992-07-09 1994-02-04 Fujitsu Ltd Electronic apparatus having stand-by mode
JP2000260179A (en) * 1999-03-05 2000-09-22 Sanyo Electric Co Ltd Refresh circuit and control circuit of optical disk reproducing device using the same
JP2004096073A (en) * 1996-11-21 2004-03-25 Hitachi Ltd Low-power processor
JP2004280783A (en) * 2003-02-25 2004-10-07 Denso Corp Microcomputer
JP2006323469A (en) * 2005-05-17 2006-11-30 Oki Electric Ind Co Ltd System lsi
JP2009116851A (en) * 2007-10-19 2009-05-28 Denso Corp Microcomputer system
JP2009265880A (en) * 2008-04-24 2009-11-12 Denso Corp Microcomputer, and external register data processing method therefor

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0628053A (en) * 1992-07-09 1994-02-04 Fujitsu Ltd Electronic apparatus having stand-by mode
JP2004096073A (en) * 1996-11-21 2004-03-25 Hitachi Ltd Low-power processor
JP2000260179A (en) * 1999-03-05 2000-09-22 Sanyo Electric Co Ltd Refresh circuit and control circuit of optical disk reproducing device using the same
JP2004280783A (en) * 2003-02-25 2004-10-07 Denso Corp Microcomputer
JP2006323469A (en) * 2005-05-17 2006-11-30 Oki Electric Ind Co Ltd System lsi
JP2009116851A (en) * 2007-10-19 2009-05-28 Denso Corp Microcomputer system
JP2009265880A (en) * 2008-04-24 2009-11-12 Denso Corp Microcomputer, and external register data processing method therefor

Also Published As

Publication number Publication date
JP5305076B2 (en) 2013-10-02

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
JP2007287022A (en) Information storage method for electronic control device
US20090167377A1 (en) Semiconductor storage device and resetting method for a semiconductor storage device
JP5328525B2 (en) Semiconductor device
JP5305076B2 (en) Microcomputer
JP5691943B2 (en) Memory voltage controller
JP2009265880A (en) Microcomputer, and external register data processing method therefor
US20160162358A1 (en) Microcontroller
JP2008310896A (en) Nonvolatile memory device, nonvolatile memory system, and method for controlling nonvolatile memory device
US20110004745A1 (en) Method of Controlling a Measurement Instrument
JP2008196441A (en) Control device for vehicle
CN108255633B (en) Storage control method and storage device
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
JP2015014825A (en) Power supply control device, electrical device, and image forming device
JP2012033222A (en) Semiconductor memory device and its control method
JP4026924B2 (en) Electronic control unit for automobile
JP2005128613A (en) Image forming device
JP2010102434A (en) Missing data recovery device
JP2000337210A (en) Electronic control device

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