JPS5816352A - Processing method in recovery mode of power supply interruption for microcomputer - Google Patents

Processing method in recovery mode of power supply interruption for microcomputer

Info

Publication number
JPS5816352A
JPS5816352A JP56114721A JP11472181A JPS5816352A JP S5816352 A JPS5816352 A JP S5816352A JP 56114721 A JP56114721 A JP 56114721A JP 11472181 A JP11472181 A JP 11472181A JP S5816352 A JPS5816352 A JP S5816352A
Authority
JP
Japan
Prior art keywords
power supply
power
interruption
program
routine
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP56114721A
Other languages
Japanese (ja)
Inventor
Minoru Ikekita
池北 実
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.)
Ishida Scales Manufacturing Co Ltd
Ishida Co Ltd
Original Assignee
Ishida Scales Manufacturing Co Ltd
Ishida Co Ltd
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 Ishida Scales Manufacturing Co Ltd, Ishida Co Ltd filed Critical Ishida Scales Manufacturing Co Ltd
Priority to JP56114721A priority Critical patent/JPS5816352A/en
Publication of JPS5816352A publication Critical patent/JPS5816352A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Power Sources (AREA)

Abstract

PURPOSE:To avoid an error of process, by starting the execution at the address following the address which is executed right before the interruption of a power supply when the interruption of the power supply is recovered. CONSTITUTION:A program is assorted into a processing routine that has no problem regardless of the interruption of a power supply and a processing routine that has a process error, etc. when the power supply is interrupted. When the power supply is interrupted, a flag Fo is set up at the head address of a program routine that has a data process error, etc. and then the flag Fo is concelled in the final address. Then a detection signal Sb is delivered to a CPU1 when the interruption of the power supply is caused or recovered. Thus the flag Fo is discriminated. In such way, the step following the step which is executed right before the power supply is interrupted when the interruption of the power supply is recovered.

Description

【発明の詳細な説明】 この発IMは、マイクロコンピュータ&C於いて電源中
断復電時に生ずるエラー等を防止する処理方法に関する
ものである。
DETAILED DESCRIPTION OF THE INVENTION This IM relates to a processing method for preventing errors and the like that occur when power is interrupted and restored in a microcomputer &C.

マイクロコンビエータを用いた装置KIAて、一連の処
理ルーチンを完了して初めて、有効となる内容のプログ
ラム実行中で、停電あるいは誤って電源スィッチOFF
する電源中断に依って、プログラムが中断された場合、
復電後にそのままプログラムの実行を続けると演算デー
タや転送データ6るい紘機械装置の動作等が、エラー等
によって無効になる場合が発生する仁とがある。。
KIA, a device using a micro combinator, is running a program that becomes valid only after a series of processing routines are completed, and the power is turned off due to a power outage or by mistake.
If the program is interrupted due to a power interruption,
If the program continues to be executed after the power is restored, the operation of the calculated data, transferred data, and other mechanical equipment may become invalid due to an error or the like. .

例えば、多歌の重量データWmを久方し、標準偏差σ難
を算出してプリントアクトする装置に於を求める演算ル
ーチンを実行する場合にっiて、p番目のデーターWp
を含む標準偏差σpを次の処理ステップで演算するとす
る。
For example, when executing an arithmetic routine that calculates the standard deviation σ of Taka's weight data Wm and calculates the weight of the print act, the p-th data Wp
It is assumed that the standard deviation σp including σp is calculated in the next processing step.

ステップ1 :データ枚1+(p−1)演算;但しp−
1はレジスターRoK記 憶されている。
Step 1: Data sheet 1 + (p-1) calculation; however, p-
1 is stored in register RoK.

ステップ2 :上記結覧を、レジスターR@に記憶する
Step 2: Store the above list in register R@.

ステップ8  :Wp!演算 但し、W1’ +Na” +”・+W111−1はレジ
スターRtK記憶されている。
Step 8: Wp! Calculation However, W1'+Na"+".+W111-1 is stored in register RtK.

ステップ6 二上記結果をレジスターRIK記憶する。Step 6: Store the above results in register RIK.

ステップ6  : (Wp+(Wt +Na +−+W
p  1 ))III算;但し、W1+W[←・・+w
p−1はレジスタRs K記憶されてiる。
Step 6: (Wp+(Wt +Na +-+W
p 1)) III calculation; however, W1+W[←...+w
p-1 is stored in register RsK.

ステップ7 :上記結果をレジスタRI KEmiる。Step 7: The above result is stored in register RI KEmi.

ステップ10:上記結果をレジスタRaK記憶する。Step 10: Store the above result in register RaK.

ステップ18:上記結果の平方根 次Kp=4の場合のプログラム実行中に、ステップ6で
、電源中断があった場合にりいて考える。
Step 18: Consider the case where there is a power interruption in step 6 during the program execution when the square root of the above result Kp=4.

ステップ1:データ数1+8  演算 ステップ2:上記結果をレジスタRe K記憶する1e
=4)。
Step 1: Number of data 1+8 Calculation step 2: Store the above result in register ReK 1e
=4).

ステップa:W4g演算 スフ−、プ4 : W4” + (% ” +w!” 
+wl” ) 演算ステップ5=上記結果をレジスタR
1に記憶する。
Step a: W4g operation Sfu-, Pu4: W4” + (%” +w!”
+wl”) Operation step 5 = Store the above result in register R.
Store in 1.

このステップでの処理が終っ九後に電源中断がTo?た
と仮定する。tた停電対策としては、■復電後ステップ
1からスタートする。■メモリー即ちレジスタは、電池
でバックアップされている。
Will the power be interrupted 9 minutes after this step is completed? Assume that As a countermeasure against a power outage, ① Start from step 1 after power is restored. ■Memory or registers are backed up by batteries.

の2点−1lX&けられているものとする。Assume that the two points -1lX & are eclipsed.

従って復電後は再びステップlからプログラムを実行す
るが、この時レジスタR@aR・=4になっているから
、データー敷としてti、1+4=5からはじめること
になる。この場合、問題にすべきエラーは、ステップ6
で生ずる。すなわち前回はステップ5で電源中断−fi
発生してhるのであるからレジスタRmKはWl +N
a +Na +W4  の演算結果は、は入っておらず
、従って、ここでは、Wi + (L +Na +Na
 )を演算する。
Therefore, after the power is restored, the program is executed again from step 1, but since the register R@aR.=4 at this time, it starts from ti, 1+4=5 as the data floor. In this case, the error to be concerned about is step 6
occurs in In other words, last time the power was interrupted in step 5 -fi
Since it occurs, the register RmK is Wl +N.
The calculation result of a +Na +W4 is not included, therefore, here, Wi + (L +Na +Na
) is calculated.

この結果ステップ18では、 を演算することになるdである。As a result, in step 18, is d that will be calculated.

この様なエラーの発生を防止するために従来は、電源ス
、イッチとは別にプログラムのスタートスイッチを設け
ておき、意図的な電源投入通常のスイッチOFF後の電
源スイッチON庫、電源中断後の復電かをスタートスイ
ッチの状II(ONか0FF)によつて識別していたの
である。すなわち、(1)  意図的な電源投入の場合
は、OFFになっているスタートスイッチがONされる
迄プログラムは次のステップへ進まない。更に、スター
トスイッチがONされた時には通常の処理ルーチンへ進
む。
In order to prevent such errors from occurring, conventionally, a program start switch was provided separately from the power switch, and the program start switch was set up separately from the power switch, and when the power was turned on intentionally, the power switch was turned on after the normal switch was turned off, and the power switch was turned on after the power was interrupted. Whether the power was restored or not was determined by the state of the start switch (ON or OFF). That is, (1) If the power is turned on intentionally, the program will not proceed to the next step until the start switch, which has been turned off, is turned on. Furthermore, when the start switch is turned on, the routine proceeds to a normal processing routine.

(2)  スタートスイッチがONKなっ良状態で、電
源が社入る場合、すなわち、電源中断後の復電時には、
エラー等が生じない様にあらかじめ辿められたルーチン
を実行する。
(2) When the start switch is ON and the power is turned on, that is, when the power is restored after a power interruption,
Executes a pre-traced routine to avoid errors.

様になっていたのである。It looked like this.

しかしながら、この方法では、電源投入や切断の度に2
個のスイッチを操作せねばならず、操作が煩雑になるこ
とや、部品点数の増加による信頼性低下や、コストアッ
プ等が問題となる。IK。
However, with this method, two
Problems include having to operate individual switches, making the operation complicated, reducing reliability due to an increase in the number of parts, and increasing costs. I.K.

上記のような処理エラーの発生を防止する手段として、
復電4iKプログラムの先願番地、すなわち前述の例に
よると、データ数1から実行する方法も考えられるが、
この場合は非常な時間のロスをともなうのである。
As a means to prevent the occurrence of processing errors such as those mentioned above,
According to the earlier application address of the power recovery 4iK program, that is, according to the above example, it is possible to execute from the data number 1, but
In this case, a huge amount of time is lost.

この発明は上記従来の欠点を除去した地理方法を得るこ
とを目的とするものである。
The object of the present invention is to obtain a geographical method that eliminates the above-mentioned conventional drawbacks.

この発明はマイクロコンビ、−夕を用いた機器に於ける
プログラムを (1)電源中断があってt問題とならない処理ルーチン
と、 (2)電源中断があれば処理エラー等を生じるルーチン 02つに分類し、前記(1)のルーチンで電源中断が生
じても、特別な処理を施すこと社せず、前記(りのルー
チンで電源中断が生じて復電した時Kt;j、電源中断
直前に実行したステップの次のステップから実行するこ
とKよって処理エラーの発生を防止する@にしたことを
主たる特徴とするものであって、以下更KW#シく説明
する。
This invention divides a program in a device using a microcombi into two parts: (1) a processing routine that does not cause any problems even if there is a power interruption, and (2) a routine that causes a processing error or the like if there is a power interruption. If a power interruption occurs in the routine (1) above, no special processing is required; when the power is restored in the routine (1) above, The main feature is that the step is executed from the next step after the executed step, thereby preventing the occurrence of processing errors, and will be further explained below.

まず、プログラムを前述02つの種類に分類する丸めに
、電源中断が起ると、データー地理エツー等のiじるプ
ログラムルーチンの先頭番地で7ラグFe2にたて、最
終番地で、フラグF・をおろす様にしておき、電源中断
時及び、復電時に以下の様な処理を行なう。
First, when a power interruption occurs to classify programs into the two types mentioned above, a 7-lag Fe2 is set at the first address of the program routine such as data geography etc., and a flag F is set at the last address. When the power is interrupted and when the power is restored, perform the following processing.

(1)電源中断時の地理 (si)電源検出S(船からの電源OFFの検出信号に
よj+cFUKIPJシ込みをかけると割シ込み直前の
プログラム番地の次の番地がRAMK退避させ次に、(
b)以下の割り込み処理ルーチンに入る。
(1) Geographic (si) power supply detection S (when the power is interrupted at the time of power interruption) (j+cFUKIPJ input is applied to the power OFF detection signal from the ship, the address next to the program address immediately before the interrupt is saved to RAMK, and then (
b) Enter the following interrupt processing routine.

(b)鈎記の7ラグF・が立っているか否かを識別し、
7クグF・が立っていれば、以下の(C)〜(f)のス
テップへ進む。
(b) Identify whether the 7-lug F of the hook is standing or not,
If 7kg F. stands, proceed to steps (C) to (f) below.

(c) CP IJ内のレジスタ類、スタックポインタ
等の内容をRAMに退避する。
(c) Save the contents of registers, stack pointer, etc. in the CP IJ to RAM.

(d)復電後処理72グF1を立てる。(d) Set the post-power restoration processing 72 flag F1.

(*)RAMの書き込み/読み出しを不能にする。(*) Disable writing/reading of RAM.

(f)CPUを停止する。(f) Stop the CPU.

Q) 復電時の処理 (龜)電源検出部が、復電を検知するとまず、RAMを
書き込み/読み出し可能にする。
Q) Processing when power is restored (Q) When the power supply detection unit detects power restoration, it first enables writing/reading of the RAM.

(b)ブラダF1が立っているか否かを判別する。(b) Determine whether the bladder F1 is standing.

7ラグF1が立っている場合線、次のステップ(c)〜
(@)へ進み、立1てiなければ、通常の処理プログラ
ムルーチンへ進む。
If 7 lag F1 is standing line, next step (c)~
Proceed to (@), and if it does not stand 1, proceed to the normal processing program routine.

(C)スタックポインタ、レジスタ類を回復する。(C) Restore the stack pointer and registers.

(d)復電7ツグFlをおろす。(d) Lower power restoration 7tsug Fl.

(e)電源中断直前のプログラム番地の次のグログツム
番地から実行する。例えば、前述標準偏差を求める例で
いえば、(L +Wt +Wl +W4 )を求めるス
テップ6から再開する。
(e) Execute from the program address next to the program address immediately before power interruption. For example, in the example of calculating the standard deviation mentioned above, the process restarts from step 6 where (L + Wt + Wl + W4) is calculated.

向上E(1)(d)のステップは、(1) (c)のス
テップの藺に入っても目的な達成できる。更に、上記(
2)(d)のステップも、(2)(C)のステップの前
に入ってもよい。
Improvement E Steps (1) and (d) can achieve the objective even if steps (1) and (c) are involved. Furthermore, the above (
Step 2)(d) may also be performed before step (2)(C).

第1図はこの発明を実施する装置の1実施例である。図
中、(1)はCPU、(2)はROM、(3)はRAM
、(4)は定電圧回路、(5)はプリンター等の表示装
置、(6)はレジスターであって、データー1mが、1
時記憶される。(1)はRA M (8)、レジスタ(
6)をバックアップする電池、そして(8)は電源検出
部であって、電源中断があった時、あるいは、復電した
時に検知信号5bt−CI’U(1)に出力する。尚意
図的な電源停止や電源投入によっても上記検知信号sb
を出力することはもちろんであるが、この場合通常、7
クグF・が立っていない時に電源停止が行なわれるので
フラグF1は立てない、従って電源投入時はFlが立っ
ていないので通常のl&理プリグラムルーチンや一実行
される。
FIG. 1 shows one embodiment of an apparatus for carrying out the invention. In the figure, (1) is the CPU, (2) is the ROM, and (3) is the RAM.
, (4) is a constant voltage circuit, (5) is a display device such as a printer, and (6) is a register, where 1 m of data is 1
time is remembered. (1) is RAM (8), register (
6) is a battery for backing up, and (8) is a power supply detection unit, which outputs a detection signal to 5bt-CI'U (1) when there is a power interruption or when the power is restored. In addition, the above detection signal sb may also be caused by intentional power stoppage or power on.
Of course, it is possible to output 7, but in this case usually 7
Since the power is stopped when F is not set, the flag F1 is not set. Therefore, when the power is turned on, since Fl is not set, the normal l&processor program routine is executed.

更KSaは1ドルス信号、Sdはデータ信号、Scs、
Sc! は制御信号である・ 以上、記述した様にこの発明は、電源中断後の復電時に
、中断直前の実行番地の次の番地から実行する様になっ
ているので処理エラーを生ずるこトナく、イイクロコン
ビエータを用いた機番を作動させることができるのであ
る。
Furthermore, KSa is a 1 dollar signal, Sd is a data signal, Scs,
Sc! is a control signal. As described above, in the present invention, when the power is restored after a power interruption, execution is executed from the address next to the execution address immediately before the interruption, so there is no possibility of a processing error. It is possible to operate a machine number using the Ikro Combiator.

【図面の簡単な説明】[Brief explanation of drawings]

第1図はこの発明の方法を実施する装置に−するもので
6る。 (1)−CPU、    (2)・・・ROM。
FIG. 1 shows an apparatus for carrying out the method of the present invention. (1)-CPU, (2)...ROM.

Claims (1)

【特許請求の範囲】[Claims] マイクロコンビエータを用いた機1!に&けるプログラ
ムを、(1)電源中断があっても問題とならない処理ル
ーチンと、(幻電源中断があれに、!&理エラー等を生
じるルーチンの2つに分類し、前記(8)のルーチンを
実行中に、電源中断が生じ、次に復電し九時に、電源中
断直前に実行し九ステップの次のステップから実行する
様にし九ことを特徴とするマイクロコンビエータに1に
ける電源中断復電時の地理方法。
Machine 1 using a micro combinator! Programs that can be used in the process are classified into two categories: (1) processing routines that do not cause problems even if there is a power interruption, and (routines that cause errors, etc. even if there is a phantom power interruption). While the routine is being executed, a power interruption occurs, and when the power is restored at 9 o'clock, the routine is executed immediately before the power interruption and the next step of the 9 steps is executed. Geographic method during power interruption and restoration.
JP56114721A 1981-07-21 1981-07-21 Processing method in recovery mode of power supply interruption for microcomputer Pending JPS5816352A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP56114721A JPS5816352A (en) 1981-07-21 1981-07-21 Processing method in recovery mode of power supply interruption for microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP56114721A JPS5816352A (en) 1981-07-21 1981-07-21 Processing method in recovery mode of power supply interruption for microcomputer

Publications (1)

Publication Number Publication Date
JPS5816352A true JPS5816352A (en) 1983-01-31

Family

ID=14644950

Family Applications (1)

Application Number Title Priority Date Filing Date
JP56114721A Pending JPS5816352A (en) 1981-07-21 1981-07-21 Processing method in recovery mode of power supply interruption for microcomputer

Country Status (1)

Country Link
JP (1) JPS5816352A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63208465A (en) * 1987-02-25 1988-08-29 Toshiba Silicone Co Ltd Low hardness silicon rubber roll

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS4918441A (en) * 1972-06-10 1974-02-18
JPS554651A (en) * 1978-06-26 1980-01-14 Sharp Corp Electronic unit of stored program system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS4918441A (en) * 1972-06-10 1974-02-18
JPS554651A (en) * 1978-06-26 1980-01-14 Sharp Corp Electronic unit of stored program system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63208465A (en) * 1987-02-25 1988-08-29 Toshiba Silicone Co Ltd Low hardness silicon rubber roll

Similar Documents

Publication Publication Date Title
US5317752A (en) Fault-tolerant computer system with auto-restart after power-fall
EP3770765B1 (en) Error recovery method and apparatus
US5003458A (en) Suspended instruction restart processing system based on a checkpoint microprogram address
US5680599A (en) Program counter save on reset system and method
US5146569A (en) System for storing restart address of microprogram, determining the validity, and using valid restart address to resume execution upon removal of suspension
EP0125797A1 (en) Interrupt signal handling apparatus
JPS5816352A (en) Processing method in recovery mode of power supply interruption for microcomputer
US11042143B2 (en) Method and device for detecting errors occurring during computing data models in safety-critical systems
JP3357777B2 (en) Program control system
JPH0126086B2 (en)
JPH06348535A (en) Abnormality generation history storage device
JPS6026588A (en) Data recorder for elevator
KR19990057809A (en) Error prevention system
JPS62281781A (en) Monitoring method for accident information
JPH07302201A (en) Pipeline arithmetic data diagnostic device
JPS6146535A (en) Pseudo error setting control system
EP0610856A1 (en) Error recovery mechanism for software visible registers in computer systems
JPH0687213B2 (en) Data processing device
JPH0814779B2 (en) Initialization method for arithmetic and control unit
JPS6393023A (en) Service interruption processing circuit
JPS593796A (en) Checking method of data in memory
JPS63153646A (en) Error recovery system
JPH07113866B2 (en) Real-time clock module management device
JPH0273447A (en) Log-on method for local cpu
JPS58192151A (en) Interruption controlling circuit