JP3053270B2 - Power supply backup method and device - Google Patents
Power supply backup method and deviceInfo
- Publication number
- JP3053270B2 JP3053270B2 JP3253535A JP25353591A JP3053270B2 JP 3053270 B2 JP3053270 B2 JP 3053270B2 JP 3253535 A JP3253535 A JP 3253535A JP 25353591 A JP25353591 A JP 25353591A JP 3053270 B2 JP3053270 B2 JP 3053270B2
- Authority
- JP
- Japan
- Prior art keywords
- power supply
- backup
- microcomputer system
- turned
- state
- 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 - Lifetime
Links
Landscapes
- Power Sources (AREA)
- Stand-By Power Supply Arrangements (AREA)
Description
【0001】[0001]
【産業上の利用分野】本発明は主電源と補助電源を利用
し主電源がオフ時には補助電源から電源供給を受けデー
タをバックアップするマイコンシステム、あるいは主電
源がオフ時にはデータを不揮発性メモリに退避してバッ
クアップするマイコンシステム等におけるバックアップ
処理を改善した電源バックアップ方法及び装置に関す
る。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention utilizes a main power supply and an auxiliary power supply and uses a power supply from the auxiliary power supply to back up data when the main power supply is off, or saves data to a nonvolatile memory when the main power supply is off. The present invention relates to a power supply backup method and apparatus in which backup processing is improved in a microcomputer system or the like that performs backup.
【0002】[0002]
【従来の技術】従来、一般的なマイコンシステムはCP
U(Central Processing Uni
t)、ROM(Read Only Memory)や
RAM(Random Access Memory)
等のメモリ、入出力ポート、カウンタ、タイマ、システ
ムクロック発生用のクロックジェネレータ・コントロー
ラ(以下、単にCGCという)などで構成される。2. Description of the Related Art Conventionally, a general microcomputer system is a CP.
U (Central Processing Uni)
t), ROM (Read Only Memory) and RAM (Random Access Memory)
And the like, an input / output port, a counter, a timer, a clock generator / controller (hereinafter simply referred to as CGC) for generating a system clock, and the like.
【0003】このマイコンシステムの一例を図9に示
す。図9に示すマイコンシステム1は、CPU14、R
AM11、ROM12、入出力ポート13、CGC14
で構成される。この図9に示すマイコンシステムを利用
した機器では、予めROM12内に格納されているプロ
グラムによって機器を制御するデータを入出力ポート1
3を介して出力し、当該機器へ入力されるデータをRA
M11に格納し或いはこのRAM11内のデータを演算
して、さらには各処理をプログラムに従って実行して当
該機器を制御するように動作する。FIG. 9 shows an example of this microcomputer system. The microcomputer system 1 shown in FIG.
AM11, ROM12, I / O port 13, CGC14
It consists of. In the device using the microcomputer system shown in FIG. 9, data for controlling the device by a program stored in the ROM 12 in advance is transmitted to the input / output port 1.
3 and outputs the data input to the device to RA
It operates to store the data in the M11 or calculate the data in the RAM 11, and further execute each process according to a program to control the device.
【0004】例えば、マイコンシステムを利用したVT
R(Video Tape Recorder)では次
のようになっている。VTRのマイコンシステムは機器
に設けられている各種のスイッチ類を入出力ポートを通
じてつねに監視しており、あるスイッチが押された場合
にそのスイッチの意味する処理を行うように機器に働き
かける。例えば押されたスイッチがテープの再生を意味
する場合、テープの再生を行うように入出力ポートを通
じてVTRを制御する。For example, a VT using a microcomputer system
In R (Video Tape Recorder), it is as follows. The microcomputer system of the VTR constantly monitors various switches provided in the device through an input / output port, and when a certain switch is pressed, works on the device so as to perform a process corresponding to the switch. For example, when the pressed switch indicates the reproduction of the tape, the VTR is controlled through the input / output port so as to reproduce the tape.
【0005】一方、このようにマイコンシステム1を利
用した機器では、機器の主電源がオフされた場合におい
てもRAM11内に蓄えられたデータが消滅しないよう
に補助電源3を設けることがある。On the other hand, in a device utilizing the microcomputer system 1 as described above, an auxiliary power supply 3 may be provided so that data stored in the RAM 11 does not disappear even when the main power supply of the device is turned off.
【0006】例えば、図9に示すマイコンシステム1で
は、主電源は電源端子2から供給され、電池30、ダイ
オード3bによって構成される補助電源3は主電源がオ
フすると電池3aから電源が供給され、停電などもの場
合にも、RAM11内に蓄えられたデータを消滅しない
ように保護(バックアップ)している。なお、補助電源
3はマイコンシステム1をバックアップする構成になっ
ており、このマイコンシステム1が1チップICになっ
ている場合もあるし個別ICで構成される場合もある。For example, in the microcomputer system 1 shown in FIG. 9, the main power is supplied from the power supply terminal 2, and the auxiliary power supply 3 including the battery 30 and the diode 3b is supplied with power from the battery 3a when the main power is turned off. In the event of a power failure or the like, the data stored in the RAM 11 is protected (backed up) so as not to be lost. The auxiliary power supply 3 is configured to back up the microcomputer system 1, and the microcomputer system 1 may be a one-chip IC or an individual IC.
【0007】次に、この図9のシステムの動作を図5の
タイミングチャート及び図11のフローチャートを参照
して説明する。電圧検出回路6は、端子2を介して供給
される主電源がオフするとLレベルの信号を、主電源が
オン状態の時はHレベルの信号を発生するものとする。
例えば主電源がt1 でオフすると、電圧検出回路6はL
レベルの信号をCPU14に入力し、ステップS31の
割り込みを行う。Next, the operation of the system of FIG. 9 will be described with reference to the timing chart of FIG. 5 and the flowchart of FIG. The voltage detection circuit 6 generates an L-level signal when the main power supplied via the terminal 2 is turned off, and generates an H-level signal when the main power is on.
For example, when the main power supply is turned off at t 1 , the voltage detection circuit 6
The signal of the level is input to the CPU 14, and the interruption of step S31 is performed.
【0008】CPU14はこのLレベルの割り込み信号
を受け取ると、ステップS33でバックアップ状態にな
るための前処理(以下、単にバックアップ処理という)
を実行する。このバックアップ処理は、たとえばRAM
11に所定の長さのデータを書き込み中はそのデータ全
部を書き込み終えるまで書き込みを続行する処理などで
あり、その処理時間(t1 〜t3 )は例えば数百μse
c程度である。このバックアップ処理の期間は、通常動
作電圧以下の電圧である電池3aを使用しないで動作さ
せる必要があるため、図9に示すマイコンシステムの例
では、コンデンサ7を利用している。このコンデンサ7
は主電源がオン時に充電しておき、充電された電荷によ
ってバックアップ処理の期間はマイコンシステム1が動
作するようになっている。When the CPU 14 receives the L-level interrupt signal, it performs pre-processing (hereinafter simply referred to as "back-up processing") to enter the backup state in step S33.
Execute This backup processing is performed, for example, in a RAM
While data of a predetermined length is being written into the memory 11, the writing is continued until all the data has been written. The processing time (t 1 to t 3 ) is, for example, several hundred μsec.
c. During the period of the backup process, it is necessary to operate without using the battery 3a having a voltage equal to or lower than the normal operation voltage. Therefore, in the example of the microcomputer system shown in FIG. 9, the capacitor 7 is used. This capacitor 7
Is charged when the main power supply is turned on, and the microcomputer system 1 is operated during the backup process by the charged electric charge.
【0009】そしてCPU14は、このバックアップ処
理終了後、動作を停止してバックアップ状態になるよう
に、LレベルのHALT信号を出力する(t3 )。する
と、CGC15は発振を停止し、クロック出力を止め
る。これによりマイコンシステム1は、ステップS35
でバックアップ状態(HALT状態)になり電流消費が
非常に少なくなる。After the backup process is completed, the CPU 14 outputs an L-level HALT signal so as to stop the operation and enter the backup state (t 3 ). Then, the CGC 15 stops the oscillation and stops the clock output. As a result, the microcomputer system 1 proceeds to step S35.
As a result, a backup state (HALT state) is established and current consumption is extremely reduced.
【0010】例えば、電流消費はマイコンシステム1の
構成によって異なるものの、CMOS(Complem
entary Metal−Oxide Semico
nductor)を採用した場合、通常の主電源で駆動
する動作状態では、概ね数mAから数十mA或いはそれ
以上なのに対し、補助電源で駆動されるHALT状態で
は数μAから数十μA程度である。例えばIC1個あた
りの消費電流で比較してみると、東芝製Z80用クロッ
クジェネレータ/コントローラ:TMPZ84C61A
では、仕様書によれば動作時の消費電流が3mA(6M
Hz動作)なのに対し、HALT状態では十μA以下で
ある。For example, although the current consumption differs depending on the configuration of the microcomputer system 1, a CMOS (Comple
entry Metal-Oxide Semico
In the case of employing N.sub.ductor, it is about several mA to several tens mA or more in an operation state driven by a normal main power supply, whereas it is about several μA to several tens μA in a HALT state driven by an auxiliary power supply. For example, when comparing current consumption per IC, a clock generator / controller for Toshiba Z80: TMPZ84C61A
According to the specifications, the current consumption during operation is 3 mA (6 M
Hz operation), but less than 10 μA in the HALT state.
【0011】次に、主電源がオン状態になる場合の動作
に付いて説明する。まず、主電源がt4 でオンすると電
圧検出回路6でこの主電源の立ち上がりを検出して、こ
の立ち上がりエッジがCGC15に入力される。この立
ち上がりエッジを入力するとCGC15は発振を再開す
る(t5 )。Next, the operation when the main power supply is turned on will be described. First, the main power supply detects the rise of the main power supply voltage detection circuit 6 is turned on at t 4, the rising edge is input to CGC15. When this rising edge is input, the CGC 15 restarts oscillation (t 5 ).
【0012】このCGC15はクロックの発振が安定す
るまでの期間(いわゆるウォーミングアップ期間(t4
〜t5 )、通常数msから数十ms程度である)はCG
C15の外部へクロックを出力せず、CPU14へ主電
源がオンしたことをしめす割り込み信号をも出力しな
い。そして、このウォーミングアップ期間終了後、CG
C15はクロックを出力し、さらにCPU14へ主電源
がオンしたことをしめす割り込み信号を出力する。CP
U14はこの割り込み信号とクロックを受けるとHAL
T信号をHレベルにする。これによって、マイコンシス
テム1は動作状態になる。The CGC 15 has a period until the clock oscillation stabilizes (a so-called warm-up period (t 4)).
To t 5 ), which is usually several ms to several tens ms) is CG
It does not output a clock to the outside of C15, nor does it output an interrupt signal to the CPU 14 indicating that the main power supply has been turned on. After the end of the warm-up period, CG
C15 outputs a clock, and further outputs an interrupt signal to the CPU 14 indicating that the main power supply has been turned on. CP
When U14 receives this interrupt signal and clock, H14
Set the T signal to H level. As a result, the microcomputer system 1 enters an operating state.
【0013】次に、図9に示すマイコンシステム1にお
いて、主電源がオフする期間が上記バックアップ処理か
らCGCが発振を停止するまでの時間よりも短い場合の
説明を、図10に示すタイミングチャート及び図11の
フローチャートを参照して行う。Next, in the microcomputer system 1 shown in FIG. 9, a description will be given of a case where the period during which the main power supply is turned off is shorter than the time from the above-mentioned backup processing until the CGC stops oscillating. This is performed with reference to the flowchart of FIG.
【0014】図11に示すように、主電源がt41でオフ
すると電圧検出回路6よりCPU14へ割り込み信号が
出力される(ステップS31)。これを受けたCPU1
4はバックアップ処理を実行する(ステップS33)。
しかしこの図10の例では、マイコンシステム1がバッ
クアップ状態(HALT状態)になる前(t45)に再び
主電源がt43でオン状態になっている。この場合、電圧
検出回路6から立ち上がりエッジが入力される時には、
まだCPU14はバックアップ処理中である。またCG
C15もバックアップ状態(HALT状態)ではない。
この状態で電圧検出回路6から立ち上がりエッジが入力
されている。このため、CGC15からCPU14へは
割り込み信号が出力されない。そして、CPU14はバ
ックアップ処理をt45で終えるとHALTをLレベルに
する(ステップS35)。このHALTを受けたCGC
15は発振を停止し、クロック出力が止まり、このマイ
コンシステム1はバックアップ状態(HALT状態)に
なる。そして、マイコンシステム1はバックアップ状態
(HALT状態)のまま再び動作しない。[0014] As shown in FIG. 11, the main power source interrupt signal is output to the voltage detection circuit 6 from CPU14 is turned off at t 41 (step S31). CPU1 receiving this
4 executes a backup process (step S33).
However, the example of FIG. 10, again the main power before (t 45) of the microcomputer system 1 is a backup state (HALT state) is in the ON state at t 43. In this case, when a rising edge is input from the voltage detection circuit 6,
The CPU 14 is still performing the backup process. Also CG
C15 is not in the backup state (HALT state).
In this state, a rising edge is input from the voltage detection circuit 6. Therefore, no interrupt signal is output from the CGC 15 to the CPU 14. Then, CPU 14 is a HALT to L level After completion of the backup process by t 45 (step S35). CGC that received this HALT
15 stops the oscillation, the clock output stops, and the microcomputer system 1 enters a backup state (HALT state). Then, the microcomputer system 1 does not operate again in the backup state (HALT state).
【0015】[0015]
【発明が解決しようとする課題】上述したように、従来
のマイコンシステムにおいては、主電源がオフする期間
が上記バックアップ処理期間よりも短い場合、マイコン
システム1はバックアップ状態(HALT状態)になっ
たまま再び動作しなくなる。As described above, in the conventional microcomputer system, if the period during which the main power supply is turned off is shorter than the backup processing period, the microcomputer system 1 enters the backup state (HALT state). It stops operating again.
【0016】本発明は上記課題に鑑み成されたもので、
主電源がオフする期間が上記バックアップ処理期間より
も短い場合であっても、バックアップ処理から通常動作
状態へ復帰できるマイコンシステムの電源バックアップ
方法及び装置を提供することを目的とする。The present invention has been made in view of the above problems, and
An object of the present invention is to provide a power supply backup method and apparatus for a microcomputer system that can return from a backup process to a normal operation state even when a period during which a main power supply is turned off is shorter than the backup process period.
【0017】[0017]
【課題を解決するための手段】上記課題を解決するため
に本願第1の発明は、供給される電源によって駆動し該
電源がオフしたときにはバックアップ処理終了後に停止
状態とするマイコンシステムの電源バックアップ方法に
おいて、前記電源のオフによってバックアップ処理を行
い、このバックアップ処理の終了した後に当該電源がオ
フのときには停止状態とする一方、当該電源がオンとな
っているときには駆動状態に戻ることを要旨とする。According to a first aspect of the present invention, there is provided a power supply backup method for a microcomputer system which is driven by a supplied power supply and is turned off after a backup process is completed when the power supply is turned off. In the above, the backup processing is performed by turning off the power supply, and after the backup processing is completed, the power supply is turned off, and the power supply is turned off.
【0018】また、本願第2の発明は、供給される電源
によって駆動し該電源がオフしたときにはバックアップ
処理終了後に停止状態とするマイコンシステムの電源バ
ックアップ装置において、前記電源のオンとオフとを判
別する判別手段と、この判別手段によって電源のオフが
判別され、開始されたバックアップ処理の終了後に再び
当該判別手段によって電源のオンとオフとを判別したと
きに、電源がオフであるときには停止状態とし、電源が
オンであるときには駆動状態とする制御手段とを有する
ことを要旨とする。According to a second aspect of the present invention, there is provided a power supply backup device for a microcomputer system which is driven by a supplied power supply and is turned off after a backup process is completed when the power supply is turned off. The power supply is determined to be off by the determination means. When the power supply is off, when the power supply is off, the power supply is turned off. And a control means for setting a driving state when the power is on.
【0019】[0019]
【作用】本願第1の発明のマイコンシステムの電源バッ
クアップ方法は、供給される電源がオフしたときのバッ
クアップ処理終了後に当該マイコンシステムを停止状態
とする際に、このバックアップ処理の終了後に再度当該
電源の状態を確認して、オフのときには停止状態とし、
オンとなっているときには駆動状態に戻るようにしたも
のである。According to the power supply backup method for a microcomputer system of the first invention of the present application, when the microcomputer system is brought into a halt state after the backup processing when the supplied power is turned off, the power supply is re-started after the backup processing is completed. Check the status of the device, and when it is off, stop the device.
When it is on, it returns to the driving state.
【0020】また、本願第2の発明のマイコンシステム
の電源バックアップ装置は、判別手段で供給される電源
のオンとオフとを判別するようにしており、また制御手
段はこの判別手段によって電源のオフが判別されて開始
されたバックアップ処理の終了後に再度判別手段によっ
て判別された電源がオフであるときには当該マイコンシ
ステムを停止状態とし、電源がオンとなっているときに
は当該マイコンシステムを駆動状態とする。Further, the power supply backup device of the microcomputer system according to the second invention of the present application is adapted to determine whether the power supplied by the determination means is on or off, and the control means uses the determination means to turn off the power supply. When the power is again determined by the determination means after the backup process started after the determination is completed, the microcomputer system is in a stopped state, and when the power is on, the microcomputer system is in a driven state.
【0021】したがって、本願のマイコンシステムの電
源バックアップ方法及びその装置によれば、電源のオフ
によって開始されたバックアップ処理が終了するまでの
間に、電源が復帰しているような場合には当該マイコン
システムを再度駆動状態とする。Therefore, according to the power supply backup method and apparatus of the microcomputer system of the present application, when the power supply is restored before the backup process started by turning off the power supply is completed, the microcomputer is not required. Put the system back into operation.
【0022】[0022]
【実施例】以下、図1乃至図8を参照して本発明に係る
一実施例を説明する。DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment according to the present invention will be described below with reference to FIGS.
【0023】図1は本発明に係る電源バックアップ装置
を採用したマイコンシステムの一例を示すもので、図9
に示す従来のマイコンシステムと比較して判別手段とし
ての電源電圧検出回路6からの入力信号を入出力ポート
13へ入力している点が異なる。なお、市販されている
入出力ポート回路(IC)には割り込み制御回路を有し
ているものもあり、この場合は図3に示す回路構成のよ
うに、入出力ポート13から直接CPUへ割り込みを掛
けるようにしても良く、この場合電源電圧検出回路6か
らCPU14への割り込み入力は省略できる。FIG. 1 shows an example of a microcomputer system employing a power supply backup device according to the present invention.
The difference is that the input signal from the power supply voltage detection circuit 6 as the determination means is input to the input / output port 13 as compared with the conventional microcomputer system shown in FIG. Some commercially available input / output port circuits (ICs) have an interrupt control circuit. In this case, as shown in the circuit configuration of FIG. In this case, an interrupt input from the power supply voltage detection circuit 6 to the CPU 14 can be omitted.
【0024】図1に示すマイコンシステム1は、RAM
11、ROM12、入出力ポート13、CPU14、C
GC15、アドレスバスBA 、データバスBD 及びコン
トロールラインC等によって1チップで構成される。
尚、この図1では、CPU14がRAM11、ROM1
2、入出力ポート13をアクセスする場合に発生するア
ドレスをデコードして各ICをアクセス可能な状態(各
ICのイネーブル入力端子をイネーブルにした状態)に
するためのいわゆるアドレスデコーダやクロックライン
の図示はしていない。また、CPU14に入力する割り
込み要求信号も図1に示すコントロールラインCのうち
の1本であるが(他には、メモリや入出力ポートのコン
トロール信号がある)、図1では特にこの割り込み要求
信号のラインのみを図示している。The microcomputer system 1 shown in FIG.
11, ROM 12, input / output port 13, CPU 14, C
The GC 15, the address bus B A , the data bus BD, the control line C, and the like constitute one chip.
In FIG. 1, the CPU 14 has a RAM 11 and a ROM 1
2. Illustration of a so-called address decoder and a clock line for decoding an address generated when accessing the input / output port 13 to make each IC accessible (a state where an enable input terminal of each IC is enabled). I haven't. The interrupt request signal input to the CPU 14 is one of the control lines C shown in FIG. 1 (there are other control signals for a memory and an input / output port). Are shown only in FIG.
【0025】電圧検出回路6は、電源端子2を介してマ
イコンシステム1及び該電圧検出回路6に入力される電
源の電圧を監視しており、この電源の供給が停止(オ
フ)されると該電圧検出回路6から電源がオフになると
いう信号が直接CPU14へ割り込みを掛ける。これに
より、RAM11内にあるデータの図示しない不揮発性
メモリへの退避、或いは補助電源3から電源供給を受け
データを保持する等のバックアップ処理が行われる。The voltage detection circuit 6 monitors the voltage of the power supply input to the microcomputer system 1 and the voltage detection circuit 6 through the power supply terminal 2, and when the supply of the power supply is stopped (turned off), A signal that the power is turned off from the voltage detection circuit 6 directly interrupts the CPU 14. Thus, backup processing such as saving data in the RAM 11 to a non-volatile memory (not shown) or receiving power from the auxiliary power supply 3 and retaining data is performed.
【0026】バックアップコンデンサ7は、このマイコ
ンシステム1が図示しない不揮発性メモリへのデータ退
避に必要な時間は回路が動作可能な電源が必要なため、
該コンデンサに蓄積された電荷を利用している。また、
ダイオード4はこの電源を供給するためのバックアップ
コンデンサ7が電源OFF時に蓄積された電荷がマイコ
ンシステム1側へ逆流しないようにするためのものであ
る。The backup capacitor 7 requires a power supply capable of operating the circuit for the time required for the microcomputer system 1 to save data to a non-volatile memory (not shown).
The charge stored in the capacitor is used. Also,
The diode 4 is for preventing the electric charge accumulated in the backup capacitor 7 for supplying the power when the power is turned off from flowing back to the microcomputer system 1 side.
【0027】さらに、この図1に示す例では、電池3か
ら電源供給中は、マイコンシステム1を動作させないよ
うにして、バックアップ時の電源電圧は通常動作電圧
(5V)よりも低くても良い場合を想定している(たと
えばRAM11のデータ保持のための最低電源電圧は
2.5V程度である)。これは、マイコンシステム1が
1チップICになっている場合で補助電源3が全体をバ
ックアップする構成になっている場合に効果的である。
このようにCPU1を動作させなければ、補助電源3は
通常動作電圧よりも低くても良く、また、このようにバ
ックアップ時にマイコンシステム1を動作させないよう
にすることにより消費電力が小さくなるので電池3aの
容量を小さくすることが可能となる。Further, in the example shown in FIG. 1, the microcomputer system 1 is not operated while the power is supplied from the battery 3, so that the power supply voltage at the time of backup may be lower than the normal operation voltage (5V). (For example, the minimum power supply voltage for retaining data in the RAM 11 is about 2.5 V). This is effective when the microcomputer system 1 is a one-chip IC and the auxiliary power supply 3 is configured to back up the whole.
If the CPU 1 is not operated in this manner, the auxiliary power supply 3 may be lower than the normal operating voltage. In addition, by not operating the microcomputer system 1 at the time of backup, power consumption is reduced. Can be reduced.
【0028】次に、この図1に示すマイコンシステム1
のCGC15の構成及びその動作を図2及び後述する図
5を参照して説明する。CGC15の入力は電圧検出回
路6からの電源ON/OFF信号とCPU14からのH
ALT信号であり、またCGC15の出力はCPU14
へ与える電源オンを示す割り込み信号である。Next, the microcomputer system 1 shown in FIG.
The configuration and operation of the CGC 15 will be described with reference to FIG. 2 and FIG. The input of the CGC 15 is a power ON / OFF signal from the voltage detection circuit 6 and an H signal from the CPU 14.
ALT signal, and the output of CGC 15 is
This is an interrupt signal indicating that the power is turned on.
【0029】まず、主電源がt1 でオフすると、CPU
14はバックアップ処理終了後、HALTをLレベルに
する(t3 )。立ち下がりエッジ検出部151はこのH
ALTの立ち下がりエッジでLレベルの検出信号を発生
し、RSフリップフロップ154とカウンタ159をリ
セットする。するとRSフリップフロップ154出力は
Lレベルになり発振器156と水晶158とを接続する
スイッチ155を開成する。これにより発振が停止し、
クロック出力が止まる。First, when the main power supply is turned off at t 1 , the CPU
14 sets HALT to L level after the backup process is completed (t 3 ). The falling edge detection unit 151
At the falling edge of the ALT, an L level detection signal is generated, and the RS flip-flop 154 and the counter 159 are reset. Then, the output of the RS flip-flop 154 becomes L level, and the switch 155 connecting the oscillator 156 and the crystal 158 is opened. This stops oscillation,
Clock output stops.
【0030】次に、主電源がt4 でオン状態になると、
電圧検出回路6から立ち上がりエッジが入力される。こ
の信号をインバータ152で反転し、立ち下がりエッジ
検出部153では立ち下がりエッジにLレベルの検出信
号を発生する。この検出信号で、RSフリップフロップ
154はセットされ、RSフリップフロップ154出力
はHレベルになる。このRSフリップフロップ154の
Hレベルで発振器156と水晶158とを接続するスイ
ッチ155が閉成され、発振が始まり、ANDゲート1
57からクロックが出力される。次に、カウンタ159
はこのクロックをカウントしていきウォーミングアップ
期間(t4 〜t5 )のカウント(数msから数十ms程
度)の後、CPU14に対し、主電源がオンしたことを
示す割り込み信号を出力する。CPU14はこの割り込
み信号とクロックを受けるとHALT信号をHレベルに
する。これによって、マイコンシステム1は動作状態に
なる。Next, when the main power supply is turned on at t 4 ,
A rising edge is input from the voltage detection circuit 6. This signal is inverted by the inverter 152, and the falling edge detector 153 generates an L level detection signal at the falling edge. With this detection signal, the RS flip-flop 154 is set, and the output of the RS flip-flop 154 becomes H level. The switch 155 for connecting the oscillator 156 and the crystal 158 is closed at the H level of the RS flip-flop 154, oscillation starts, and the AND gate 1
A clock is output from 57. Next, the counter 159
After the warm-up period will continue to count the clock (t 4 ~t 5) (the order of several tens ms from several ms) counting, with respect to CPU 14, and outputs an interrupt signal indicating that the main power is turned on. When receiving the interrupt signal and the clock, the CPU 14 sets the HALT signal to the H level. As a result, the microcomputer system 1 enters an operating state.
【0031】次に本実施例の作用を図4に示すフローチ
ャートを参照し説明する。図4からも明らかなように、
本実施例においては、主電源がオフしステップS3のバ
ックアップ処理が終了した後に、ステップS5に進み電
圧検出回路6の出力信号レベルを確認するようにしてい
る。すなわち、このバックアップ処理終了時点で主電源
がどの様な状態であるかを確認し、もし電圧検出回路の
出力信号がHレベルならば、再び電源がオン状態に戻っ
ているものと考えられ、一方Lレベルならば主電源はオ
フのままであるものと考えられる。従って、バックアッ
プ処理終了後に、電圧検出回路の出力信号レベルを確認
し、もし電圧検出回路の出力信号がHレベルならばステ
ップS7へ進み、再び通常処理状態に復帰し、Lレベル
ならばステップS9へ進みHALT状態にする。Next, the operation of this embodiment will be described with reference to the flowchart shown in FIG. As is clear from FIG.
In the present embodiment, after the main power supply is turned off and the backup processing in step S3 is completed, the process proceeds to step S5 to check the output signal level of the voltage detection circuit 6. That is, the state of the main power supply is confirmed at the end of the backup processing. If the output signal of the voltage detection circuit is at the H level, it is considered that the power supply has returned to the on state again. If it is at the L level, it is considered that the main power supply remains off. Therefore, after the backup processing is completed, the output signal level of the voltage detection circuit is checked. If the output signal of the voltage detection circuit is at the H level, the process proceeds to step S7, and returns to the normal processing state. If the output signal is at the L level, the process proceeds to step S9. Advance to HALT state.
【0032】次に、図5及び6を参照して、本実施例の
動作を説明する。図5は実施例における通常時のタイミ
ング図であり、図6は同じく瞬間的な電源オフ時のタイ
ミング図を示すものである。Next, the operation of this embodiment will be described with reference to FIGS. FIG. 5 is a timing chart at the normal time in the embodiment, and FIG. 6 is a timing chart at the time of the momentary power-off.
【0033】図5に示す通常時におけるタイミング図で
は、主電源がt1 でオフするとCPU14はバックアッ
プ処理の実行を開始する。このバックアップ処理の期間
t1 〜t3 は、上述したように、コンデンサ7に充電さ
れた電荷によってマイコンシステムは動作し、電源電圧
はほぼ5Vに保たれている。そして、CPU14はt3
でバックアップ処理を終えると、電圧検出回路6の出力
信号レベルを確認する。通常状態では、このときには電
圧検出回路6の出力信号はLレベルになっている。そこ
でHALTをLレベルにする。このHALTを受けたC
GC15は発振を停止し、クロック出力が止まり、この
マイコンシステム1はバックアップ状態(停止状態)に
なる。[0033] In the timing diagram during the normal shown in FIG. 5, when the main power is turned off at t 1 CPU 14 starts execution of the backup process. During the backup processing period t 1 to t 3 , as described above, the microcomputer system operates by the electric charge charged in the capacitor 7, and the power supply voltage is kept at approximately 5V. Then, the CPU 14 sets t 3
After the backup process is completed, the output signal level of the voltage detection circuit 6 is confirmed. In the normal state, the output signal of the voltage detection circuit 6 is at the L level at this time. Therefore, HALT is set to L level. C who received this HALT
The GC 15 stops oscillating, the clock output stops, and the microcomputer system 1 enters a backup state (stop state).
【0034】次に、主電源がt4 でオン状態になると、
電圧検出回路6から立ち上がりエッジが入力される。こ
の信号を受けたCGC15は発振を再開し、所定期間
(t4 〜t5 )のウォーミングアップ期間(数msから
数十ms程度)の後、再びクロックを出力するととも
に、CPU14に主電源がオンしたことをしめす割り込
み信号をt5 で出力する。すると、CPU14はHAL
T信号をHレベルにし、動作状態になる。Next, when the main power supply is turned on at t 4 ,
A rising edge is input from the voltage detection circuit 6. Upon receiving this signal, the CGC 15 restarts oscillation, and after a warm-up period (about several ms to several tens ms) of a predetermined period (t 4 to t 5 ), outputs a clock again and turns on the main power supply to the CPU 14. and outputs an interrupt signal indicating that at t 5. Then, the CPU 14 sets the HAL
The T signal is set to the H level to enter the operating state.
【0035】次に、図6に示す瞬間的な電源オフ時にお
けるタイミング図では、主電源がt11でオフするとCP
U14はバックアップ処理を実行し、バックアップ処理
を終えるとt15で電圧検出回路6の出力信号レベルを確
認する。瞬間的な電源オフ時(t11〜t13)では、この
とき(t15)には電圧検出回路6の出力信号はHレベル
になっている。そこでCPU14はHALT状態にせ
ず、通常動作状態にもどる。[0035] Next, in the timing chart at the time of momentary power-off shown in FIG. 6, when the main power is turned off at t 11 CP
U14 performs the backup process, check the output signal level of the voltage detection circuit 6 at t 15 Upon completion of the backup process. In time instantaneous power-off (t 11 ~t 13), the output signal of the voltage detecting circuit 6 in this case (t 15) is in the H level. Therefore, the CPU 14 returns to the normal operation state without setting the HALT state.
【0036】すなわち、CPU14のバックアップ処理
実行後に、CPU14が電圧検出回路6からの出力信号
を確認したときに、この出力信号が依然としてLレベル
のままであれば、CPU14はバックアップ状態(HA
LT状態)になるようにとHALTをLレベルにし、こ
のHALTを受けたCGC15は発振を停止しクロック
出力を止め、マイコンシステム1はバックアップ状態
(HALT状態)になる。しかし、電圧検出回路6から
の出力信号がHレベルに戻っていれば、CPU14は通
常動作状態に戻るように処理する。That is, when the CPU 14 confirms the output signal from the voltage detection circuit 6 after the execution of the backup process by the CPU 14, if the output signal is still at the L level, the CPU 14 is in the backup state (HA).
The HALT is set to the L level so as to be in the (LT state), the CGC 15 receiving the HALT stops the oscillation and stops the clock output, and the microcomputer system 1 enters the backup state (HALT state). However, if the output signal from the voltage detection circuit 6 has returned to the H level, the CPU 14 performs processing to return to the normal operation state.
【0037】以上の説明は、補助電源3はマイコンシス
テム1をバックアップする構成になっている場合でる。
しかしながら、図7に示すマイコンシステムの様に補助
電源3が必要なRAM11にのみ補助電源3を供給する
構成としてもよい。In the above description, the auxiliary power supply 3 is configured to back up the microcomputer system 1.
However, the auxiliary power supply 3 may be supplied only to the RAM 11 that requires the auxiliary power supply 3 as in the microcomputer system shown in FIG.
【0038】この場合にも、主電源がオフすると、電圧
検出回路6はLレベルの信号をCPU14に入力する。
CPU14は、このLレベルの割り込み信号を受け取る
とバックアップ状態になるための前処理(バックアップ
処理)を実行する。このバックアップ処理は、たとえば
RAM11に所定の長さのデータを書き込み中はそのデ
ータ全部を書き込み終えるまで書き込みを続行する処理
などであり、その処理時間は例えば数百μsec程度で
ある。Also in this case, when the main power supply is turned off, the voltage detection circuit 6 inputs an L level signal to the CPU 14.
Upon receiving this L-level interrupt signal, the CPU 14 executes pre-processing (back-up processing) to enter the backup state. This backup process is, for example, a process in which while writing data of a predetermined length in the RAM 11, the writing is continued until all the data has been written, and the processing time is, for example, about several hundred μsec.
【0039】このバックアップ処理終了後、CPU14
は動作を停止して、LレベルのHALT信号を出力す
る。CGC15は、このLレベルのHALT信号を入力
すると、発振を停止し、クロック出力を止める。これに
よりRAM11以外に供給される電源の電圧が降下して
もCPU14が暴走してRAM11の内容を破壊する可
能性はなくなる。従って、このようなマイコンシステム
においても、主電源がオフする期間が上記バックアップ
処理期間よりも短い場合でも、バックアップ処理から通
常動作状態へ復帰できる。After the backup process is completed, the CPU 14
Stops the operation and outputs an L-level HALT signal. When the CGC 15 receives the L level HALT signal, the CGC 15 stops the oscillation and stops the clock output. As a result, even if the voltage of the power supply supplied to other than the RAM 11 drops, there is no possibility that the CPU 14 runs away and destroys the contents of the RAM 11. Therefore, even in such a microcomputer system, even when the period during which the main power supply is turned off is shorter than the backup processing period, the microcomputer system can return from the backup processing to the normal operation state.
【0040】また、本発明は上述したような補助電源3
の電池3aによってRAM11をバックアップする以外
に、図8のマイコンシステムに示すように不揮発性メモ
リであるEEPROM(Electrically E
rasable Programable ROM)1
6を利用したマイコンシステムにも適用できる。The present invention also relates to an auxiliary power supply 3 as described above.
In addition to backing up the RAM 11 by the battery 3a, as shown in the microcomputer system of FIG. 8, an EEPROM (Electrically E
rasable Programmable ROM) 1
6 can be applied to a microcomputer system using the same.
【0041】この場合にも、主電源がオフすると、電圧
検出回路6はLレベルの信号をCPU14に入力する。
CPU14はこのLレベルの割り込み信号を受け取ると
バックアップ状態になるための前処理(バックアップ処
理)を実行する。このバックアップ処理は、たとえEE
PROM16に所定の長さのデータを書き込み中はその
データ全部を書き込み終えるまで書き込みを続行した
り、電源オフ時のデータ消失を防止するためRAM11
内にある情報をEEPROM16へ移す処理などであ
り、その処理時間は例えば数百μsから数十ms程度で
ある。Also in this case, when the main power supply is turned off, the voltage detection circuit 6 inputs an L level signal to the CPU 14.
Upon receiving this L-level interrupt signal, the CPU 14 executes pre-processing (back-up processing) to enter the backup state. This backup process, even if EE
While data of a predetermined length is being written to the PROM 16, writing is continued until all the data has been written, or the RAM 11 is used to prevent data loss when the power is turned off.
The processing time is, for example, about several hundred μs to several tens ms.
【0042】そしてCPU14は、このバックアップ処
理終了後、動作を停止して、LレベルのHALT信号を
出力する。CGC15は、このLレベルのHALT信号
を入力すると、発振を停止し、クロック出力を止める。
これにより供給される電源の電圧が降下してもCPU1
4が暴走してEEPROM16の内容を破壊する可能性
はなくなる。従って、このようなマイコンシステムにお
いても、主電源がオフする期間が上記バックアップ処理
期間よりも短い場合でも、バックアップ処理から通常動
作状態へ復帰できる。After completion of the backup process, the CPU 14 stops the operation and outputs an L level HALT signal. When the CGC 15 receives the L level HALT signal, the CGC 15 stops the oscillation and stops the clock output.
Even if the voltage of the supplied power drops, the CPU 1
4 no longer runs away and destroys the contents of EEPROM 16. Therefore, even in such a microcomputer system, even when the period during which the main power supply is turned off is shorter than the backup processing period, the microcomputer system can return from the backup processing to the normal operation state.
【0043】[0043]
【発明の効果】以上説明したように、本発明の電源バッ
クアップ方法及びその装置は、主電源がオフする期間が
上記バックアップ処理期間よりも短い場合であっても、
バックアップ処理終了後に速やかに通常動作状態へ復帰
できる。As described above, the power supply backup method and apparatus according to the present invention can be used even when the period during which the main power supply is turned off is shorter than the backup processing period.
It is possible to return to the normal operation state immediately after the backup processing is completed.
【図1】本発明の電源バックアップ装置を採用したマイ
コンシステムの一例である。FIG. 1 is an example of a microcomputer system employing a power supply backup device of the present invention.
【図2】図1に示すマイコンシステムにおけるCGCの
回路構成を示すブロック図である。FIG. 2 is a block diagram showing a circuit configuration of a CGC in the microcomputer system shown in FIG.
【図3】本発明の電源バックアップ装置を採用したマイ
コンシステムの一例であり、割り込み制御回路を有して
いる入出力ポート回路による回路構成を示すブロック図
である。FIG. 3 is an example of a microcomputer system employing the power supply backup device of the present invention, and is a block diagram showing a circuit configuration of an input / output port circuit having an interrupt control circuit.
【図4】図1に示すマイコンシステムにおける動作を示
すフローチャートである。FIG. 4 is a flowchart showing an operation in the microcomputer system shown in FIG. 1;
【図5】図1に示すマイコンシステムの通常時における
タイミングチャートである。FIG. 5 is a timing chart of the microcomputer system shown in FIG. 1 in a normal state.
【図6】図1に示すマイコンシステムの瞬間的な電源オ
フ時におけるタイミングチャートである。FIG. 6 is a timing chart when the power supply of the microcomputer system shown in FIG. 1 is momentarily turned off.
【図7】本発明の電源バックアップ装置を採用したマイ
コンシステムの他の実施例である。FIG. 7 is another embodiment of a microcomputer system employing the power supply backup device of the present invention.
【図8】本発明の電源バックアップ装置を採用したマイ
コンシステムの他の実施例である。FIG. 8 is another embodiment of a microcomputer system employing the power supply backup device of the present invention.
【図9】従来のシステム一例である。FIG. 9 is an example of a conventional system.
【図10】従来のタイミング図の一例(瞬間的な電源オ
フ時)である。FIG. 10 is an example of a conventional timing chart (at the time of momentary power off).
【図11】従来のフローチャートの一例である。FIG. 11 is an example of a conventional flowchart.
1 マイコンシステム 2 電源入力端子 3 補助電源 4 ダイオード 6 電圧検出回路 7 コンデンサ 11 RAM 12 ROM 13 入出力ポート 14 CPU 15 CGC BA アドレスバス BD データバス C コントロールラインReference Signs List 1 microcomputer system 2 power supply input terminal 3 auxiliary power supply 4 diode 6 voltage detection circuit 7 capacitor 11 RAM 12 ROM 13 input / output port 14 CPU 15 CGC B A address bus B D data bus C control line
───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.7,DB名) G06F 1/26 ──────────────────────────────────────────────────続 き Continued on front page (58) Field surveyed (Int.Cl. 7 , DB name) G06F 1/26
Claims (2)
オフしたときにはバックアップ処理終了後に停止状態と
するマイコンシステムの電源バックアップ方法におい
て、 前記電源のオフによってバックアップ処理を行い、この
バックアップ処理の終了した後に当該電源がオフのとき
には停止状態とする一方、当該電源がオンとなっている
ときには駆動状態に戻ることを特徴とするマイコンシス
テムの電源バックアップ方法。1. A power supply backup method for a microcomputer system which is driven by a supplied power supply and is turned off after the backup processing is completed when the power supply is turned off, wherein the backup processing is performed by turning off the power supply, and the backup processing is completed. A power supply backup method for a microcomputer system, wherein when the power supply is turned off, the power supply is turned off, and when the power supply is turned on, the power supply returns to a driving state.
オフしたときにはバックアップ処理終了後に停止状態と
するマイコンシステムの電源バックアップ装置におい
て、 前記電源のオンとオフとを判別する判別手段と、 この判別手段によって電源のオフが判別され、開始され
たバックアップ処理の終了後に再び当該判別手段によっ
て電源のオンとオフとを判別したときに、電源がオフで
あるときには停止状態とし、電源がオンであるときには
駆動状態とする制御手段とを有することを特徴とするマ
イコンシステムの電源バックアップ装置。2. A power supply backup device of a microcomputer system which is driven by a supplied power supply and is brought into a stop state after a backup process when the power supply is turned off, a determination means for determining whether the power supply is on or off; When the power is off by the means, and when the power is on and off again by the determination means after the end of the started backup process, the power supply is turned off, and the power is turned off. A power supply backup device for a microcomputer system, comprising: control means for setting a driving state.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP3253535A JP3053270B2 (en) | 1991-10-01 | 1991-10-01 | Power supply backup method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP3253535A JP3053270B2 (en) | 1991-10-01 | 1991-10-01 | Power supply backup method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
JPH0594242A JPH0594242A (en) | 1993-04-16 |
JP3053270B2 true JP3053270B2 (en) | 2000-06-19 |
Family
ID=17252723
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP3253535A Expired - Lifetime JP3053270B2 (en) | 1991-10-01 | 1991-10-01 | Power supply backup method and device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP3053270B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10671139B2 (en) * | 2017-05-31 | 2020-06-02 | Quanta Computer Inc. | Operable server system when standby power of PSU fails |
-
1991
- 1991-10-01 JP JP3253535A patent/JP3053270B2/en not_active Expired - Lifetime
Also Published As
Publication number | Publication date |
---|---|
JPH0594242A (en) | 1993-04-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP3224153B2 (en) | Improved data protection system and data protection method | |
US4777626A (en) | Memory device having backup power supply | |
JPH10177563A (en) | Microcomputer with built-in flash memory | |
US5435005A (en) | Method and system for controlling resuming operation of an AC-driven computer system using an external memory | |
JP3053270B2 (en) | Power supply backup method and device | |
JPH06231053A (en) | Data saving system | |
US5831347A (en) | Apparatus for determining if the duration of a power failure exceeded predetermined limits | |
KR100382747B1 (en) | Electronics | |
JPH0795253B2 (en) | Power recovery processing method for power supplies for information processing equipment | |
JPH11353064A (en) | Portable information terminal equipment | |
JP3133492B2 (en) | Information processing device | |
JP2740685B2 (en) | Storage device backup circuit | |
JP2000040037A (en) | Data protective device, data protective method and storage medium | |
JP3087650B2 (en) | Automatic power recovery method | |
JPH0142002B2 (en) | ||
JPH09213088A (en) | Engine control device | |
JP3768565B2 (en) | DRAM controller | |
JP2909292B2 (en) | Information processing device | |
JPH05233474A (en) | Storage contents protection system | |
JPS5856177B2 (en) | magnetic bubble storage device | |
JPH11149419A (en) | Method and device for backing up data | |
JPH11175405A (en) | Memory data controller | |
JPH01195559A (en) | Back-up memory for electronic equipment | |
JPH0436426B2 (en) | ||
JPH07281794A (en) | Card interface device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20080407 Year of fee payment: 8 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090407 Year of fee payment: 9 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100407 Year of fee payment: 10 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100407 Year of fee payment: 10 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110407 Year of fee payment: 11 |
|
EXPY | Cancellation because of completion of term | ||
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120407 Year of fee payment: 12 |