JPH0782462B2 - Multi-byte data protection system in standby RAM - Google Patents

Multi-byte data protection system in standby RAM

Info

Publication number
JPH0782462B2
JPH0782462B2 JP61190202A JP19020286A JPH0782462B2 JP H0782462 B2 JPH0782462 B2 JP H0782462B2 JP 61190202 A JP61190202 A JP 61190202A JP 19020286 A JP19020286 A JP 19020286A JP H0782462 B2 JPH0782462 B2 JP H0782462B2
Authority
JP
Japan
Prior art keywords
data
address
byte data
power supply
byte
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
Application number
JP61190202A
Other languages
Japanese (ja)
Other versions
JPS6346558A (en
Inventor
宏 小川
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 Ten Ltd
Original Assignee
Denso Ten 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 Denso Ten Ltd filed Critical Denso Ten Ltd
Priority to JP61190202A priority Critical patent/JPH0782462B2/en
Publication of JPS6346558A publication Critical patent/JPS6346558A/en
Publication of JPH0782462B2 publication Critical patent/JPH0782462B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Classifications

    • Y02B60/1225

Landscapes

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

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、マイクロコンピュータのメイン電源のオン,
オフにかかわらず別系統電源から電源供給を受けて動作
するスタンバイRAMを有するマイクロコンピュータシス
テムにおいて、スタンバイRAMへ多バイトデータを書込
んでいる最中にメイン電源のオフによって書込み動作が
停止して多バイトデータが破壊されても、それを正常な
データに復元することができるスタンバイRAM内多バイ
トデータの保護方式に関する。
DETAILED DESCRIPTION OF THE INVENTION [Industrial field of application] The present invention relates to turning on a main power source of a microcomputer,
In a microcomputer system that has a standby RAM that operates by being supplied with power from a separate system power supply regardless of whether it is off or off, the writing operation is stopped by turning off the main power supply while writing multi-byte data to the standby RAM. The present invention relates to a protection method for multi-byte data in standby RAM that can restore normal data even if the byte data is destroyed.

〔従来の技術〕[Conventional technology]

近年、マイクロコンピュータシステムを組込んだ電子機
器の開発が盛んに行なわれているが、その中でも、マイ
クロコンピュータのメイン電源のオン,オフにかかわら
ず別系統電源から供給される微小電流で動作するスタン
バイRAMを備えたマイクロコンピュータシステムを採用
する電子機器が増えている。
2. Description of the Related Art In recent years, electronic devices incorporating a microcomputer system have been actively developed. Among them, a standby system that operates with a minute current supplied from a separate power supply regardless of whether the main power supply of the microcomputer is on or off. An increasing number of electronic devices have adopted a microcomputer system equipped with RAM.

このような電子機器として、自動車の内燃機関,変速装
置等を制御する自動車用電子制御機器がある。この機器
の場合、イグニッションスイッチ系統からメイン電源を
マイクロコンピュータシステムに供給し、自動車バッテ
リからイグニッションスイッチを介することなく取出し
た別系統電源を上記スタンバイRAMへ供給して、ドライ
バがイグニッションスイッチを切った後でもスタンバイ
RAMの内容が保持されるように構成されている。そし
て、上記スタンバイRAMには、その不揮発性を活かし
て、ディーラーでの診断に役立つ各種の異常モード情報
や、車両個々のバラツキを吸収するために学習した制御
量最適化の為の補正量等の重要なデータが格納されてい
る。
As such an electronic device, there is an electronic control device for an automobile that controls an internal combustion engine, a transmission, etc. of the automobile. In the case of this equipment, the main power is supplied from the ignition switch system to the microcomputer system, and the separate system power taken out from the car battery without passing through the ignition switch is supplied to the standby RAM, after the driver turns off the ignition switch. But standby
It is configured to retain the contents of RAM. The standby RAM uses its non-volatility to store various abnormal mode information that is useful for diagnosis at the dealer and the correction amount for optimization of the control amount learned to absorb the variation of each vehicle. Contains important data.

従って、スタンバイRAMに格納された上記のような重要
なデータを破壊しないようにすることは、制御機器設計
上の重要事項の一つであり、その為のスタンバイRAM内
データ保護方式として、従来、次のような方式が提案乃
至実用化されている。
Therefore, it is one of the important items in designing control equipment to prevent the above important data stored in the standby RAM from being destroyed. The following methods have been proposed or put into practical use.

従来方式1 イグニッションスイッチのオフ時つまりメイン電源のオ
フ時に、マイクロコンピュータのリセット信号をアクテ
ィブ(ACTIVE)にし、メイン電源低電圧時におけるマイ
クロコンピュータの不確定動作を防止し、主にプログラ
ムを暴走によるスタンバイRAM内データの破壊を防止す
る。
Conventional method 1 When the ignition switch is turned off, that is, when the main power supply is turned off, the reset signal of the microcomputer is activated (ACTIVE) to prevent uncertain operation of the microcomputer when the main power supply voltage is low, and the program is mainly in standby due to runaway. Prevents the destruction of data in RAM.

従来方式2 マイクロコンピュータのリセット信号がアクティブにな
る直前に、外部割込み信号をハードウェア的に発生さ
せ、その割込みプログラムの中で、リセット信号がアク
ティブになるまでダミー命令を実行し、スタンバイRAM
への書込みを実行しないようにして、スタンバイRAM内
のデータの破壊を防止する。
Conventional method 2 Immediately before the reset signal of the microcomputer becomes active, an external interrupt signal is generated by hardware, and a dummy instruction is executed in the interrupt program until the reset signal becomes active, and the standby RAM
Prevents data in the standby RAM from being destroyed by not writing to the RAM.

〔発明が解決しようとする問題点〕[Problems to be solved by the invention]

ところで、スタンバイRAM内データには、1バイトデー
タと、複数のバイトで一つの意味を持つ多バイトデータ
とがある。後者の多バイトデータ、例えば8ビットマイ
クロコンピュータにおける16ビットデータの場合、これ
をスタンバイRAMの連続する2バイトの領域に書込むと
きに2回のストア命令が実行されるが、その間にマイク
ロコンピュータの動作が停止すると、2バイトデータが
破壊されたことになる。
By the way, the data in the standby RAM includes 1-byte data and multi-byte data having a single meaning with a plurality of bytes. In the case of the latter multi-byte data, for example, 16-bit data in an 8-bit microcomputer, two store instructions are executed when this is written in a continuous 2-byte area of the standby RAM, while the microcomputer When the operation stops, the 2-byte data has been destroyed.

例えば、スタンバイRAMのアドレスnを上位バイト用,
アドレスn+1を下位バイト用とする2バイトデータが
あり、更新前の上位バイトの値が「00000001」,下位バ
イトの値が「00000000」、つまり、10進数表示で「25
6」のデータが格納されていたとする。このデータを10
進数表示で「255」の値に書換えるには、上位バイトの
値を「00000000」に、下位バイトの値を「11111111」に
書換える為に、例えば、 STA n ¥00 STA n+1 ¥FF の命令列が実行されるが、アドレスnの領域の書込み直
後にイグニッションスイッチのオフによるリセットで書
込み動作が停止した場合、アドレスn+1の値は元の
「00000000」のままになるので、アドレスnとアドレス
n+1との2バイトで表現されるデータは10進数表示で
「000」となり、真値より「255」もずれてしまうことに
なる。
For example, the address n of the standby RAM is for the upper byte,
There is 2-byte data for the lower byte at address n + 1, the value of the upper byte before updating is "00000001", and the value of the lower byte is "00000000", that is, "25" in decimal notation.
It is assumed that the data of "6" is stored. This data 10
To rewrite the value of the upper byte to "00000000" and the value of the lower byte to "11111111" in order to rewrite the value of "255" in decimal notation, for example, the command STA n \ 00 STA n + 1 \ FF Although the column is executed, if the write operation is stopped by the reset by turning off the ignition switch immediately after writing the area of the address n, the value of the address n + 1 remains the original “00000000”, so that the address n and the address n + 1. The data expressed by 2 bytes is "000" in decimal notation, which is "255" off the true value.

前述した従来方式1,2は、スタンバイRAM内の1バイトデ
ータについては、破壊を防止することは可能であるが、
上述したような多バイトデータについては、その破壊を
防止することはできず且つ正常な値に復元することもで
きない。
Although the conventional methods 1 and 2 described above can prevent the destruction of 1-byte data in the standby RAM,
The multi-byte data as described above cannot be prevented from being destroyed and cannot be restored to a normal value.

本発明はこのような事情に鑑みて為されたもので、その
目的は、スタンバイRAM内の多バイトデータ書込み中に
メイン電源のオフによって書込み動作が中断されても、
その多バイトデータを正常な値に復元することができる
スタンバイRAM内多バイトデータ保護方式を提供するこ
とにある。
The present invention has been made in view of such circumstances, and an object thereof is to stop the writing operation by turning off the main power supply during writing of multi-byte data in the standby RAM.
It is to provide a multi-byte data protection method in standby RAM that can restore the multi-byte data to a normal value.

〔問題点を解決するための手段〕[Means for solving problems]

本発明は上記目的を達成するために、メイン電源のオ
ン,オフにかかわらず別系統電源から電源供給を受けて
動作し、データバス,アドレスバス,リード/ライト信
号線を介して演算処理装置に接続されたスタンバイRAM
を有するマイクロコンピュータシステムにおいて、 前記別系統電源で動作し、前記演算処理装置が前記メイ
ン電源のオフによって動作を停止する直前のアドレスバ
ス上のアドレスを保持するアドレス保持手段と、 前記別系統電源で動作し、前記演算処理装置が前記メイ
ン電源のオフによって動作を停止する直前の前記リード
/ライト信号線上の信号を保持するリード/ライト信号
保持手段と、 前記別系統電源で動作し、前記演算処理装置が前記メイ
ン電源のオフによって動作を停止する直前に書込もうと
していた多バイトデータの全バイトを保持するデータ保
持手段とを備え、 前記演算処理装置は、前記メイン電源のオン時に、前記
リード/ライト信号保持手段にライト信号が保持され且
つ前記アドレス保持手段に保持されたアドレスが多バイ
トデータ格納アドレスに該当するという条件の成立を判
別し、該条件が成立したときは、前記スタンバイRAM内
の対応する多バイトデータを前記データ格納手段に格納
された多バイトデータに一致させる処理を行なうように
構成されている。
In order to achieve the above object, the present invention operates by receiving power supply from a separate system power supply regardless of whether the main power supply is on or off, and operates in an arithmetic processing unit via a data bus, an address bus, and a read / write signal line. Connected standby RAM
In the microcomputer system having: an address holding unit that operates by the separate power supply, holds the address on the address bus immediately before the arithmetic processing device stops the operation by turning off the main power supply, and the separate power supply. A read / write signal holding unit that operates and holds the signal on the read / write signal line immediately before the arithmetic processing device stops its operation when the main power supply is turned off; Data processing means for holding all bytes of the multi-byte data which was about to be written immediately before the device stopped its operation when the main power supply was turned off. / The write signal is held in the write signal holding means and the number of addresses held in the address holding means is large. When the condition that the byte data storage address is satisfied is determined, and when the condition is satisfied, a process of matching the corresponding multibyte data in the standby RAM with the multibyte data stored in the data storage means is performed. Is configured to do.

〔作用〕[Action]

演算処理装置がスタンバイRAM内に多バイトデータを書
込んでいる最中にメイン電源がオフされ、スタンバイRA
M内のその多バイトデータが破壊された場合、リード/
ライト信号保持手段にライト信号が保持され且つアドレ
ス保持手段に多バイトデータ格納アドレスに該当するア
ドレスが保持されることから、演算処理装置は、次のメ
イン電源のオン時に、多バイトデータの書込み中に動作
が停止したことを知り、対応するスタンバイRAM内の多
バイトデータがデータ保持手段に保持された多バイトデ
ータに一致するような処理を行なって多バイトデータを
復元する。
The main power is turned off while the processor is writing multi-byte data in the standby RAM, and the standby RA
If the multi-byte data in M is destroyed, read /
Since the write signal holding unit holds the write signal and the address holding unit holds the address corresponding to the multi-byte data storage address, the arithmetic processing unit writes the multi-byte data at the next main power-on. When the operation is stopped, the multibyte data in the corresponding standby RAM is restored by performing processing so that the multibyte data matches the multibyte data held in the data holding means.

〔実施例〕〔Example〕

次に本発明の実施例について図面を参照して説明する。 Next, embodiments of the present invention will be described with reference to the drawings.

第1図は本発明の実施例のブロック図であり、多バイト
データが2バイトデータのみからなる車載用マイクロコ
ンピュータシステムに本発明を適用した例を示し、1は
マイクロコンピュータ、2は自動車バッテリ、3はイグ
ニッションスイッチ、4はメイン電源供給用の定電圧回
路、5はスタンバイ電源供給用の定電圧回路、6はリセ
ット信号発生回路、7はクロック発生回路である。
FIG. 1 is a block diagram of an embodiment of the present invention, showing an example in which the present invention is applied to a vehicle-mounted microcomputer system in which multi-byte data is only 2-byte data, 1 is a microcomputer, 2 is an automobile battery, Reference numeral 3 is an ignition switch, 4 is a constant voltage circuit for supplying main power, 5 is a constant voltage circuit for supplying standby power, 6 is a reset signal generating circuit, and 7 is a clock generating circuit.

マイクロコンピュータ1は、演算処理装置(MPU)10
と、ROM11と、RAM12と、スタンバイRAM13と、入出力ポ
ート(I/Oポート)14と、ゲート制御回路15と、第1デ
ータレジスタ16と、第2データレジスタ17と、アドレス
ラッチ回路18と、リード/ライト信号ラッチ回路19と、
ゲート回路(G)20〜23,30,31と、ラッチ信号発生回路
24と、クロック制御回路32とを含み、MPU10と周辺回路
とは必要に応じてMPU10のデータバスDB,アドレスバスAB
およびリード信号線,ライト信号線を含むコントロール
バスCBで相互に接続されている。
The microcomputer 1 is a processing unit (MPU) 10
A ROM 11, a RAM 12, a standby RAM 13, an input / output port (I / O port) 14, a gate control circuit 15, a first data register 16, a second data register 17, an address latch circuit 18, A read / write signal latch circuit 19,
Gate circuit (G) 20-23, 30, 31 and latch signal generation circuit
24 and a clock control circuit 32, and the MPU 10 and peripheral circuits include the MPU 10 data bus DB and address bus AB as required.
And a control bus CB including a read signal line and a write signal line are connected to each other.

イグニッションスイッチ3のオンで起動される定電圧回
路4の出力電圧Vccは、リセット信号発生回路6,クロッ
ク発生回路7およびマイクロコンピュータ1のメイン電
源供給端子25に加えられ、リセット信号発生回路6は出
力電圧Vccのオン時およびオフ時にリセット信号Rを発
生してマイクロコンピュータ1のリセット端子26に加え
る。メイン電源供給端子25に加わる電圧Vccは、MPU10,R
OM11,RAM12,I/Oポート14,ゲート制御回路15等に供給さ
れ、リセット端子26に加わるリセット信号はラッチ信号
発生回路24およびMPU10等に供給される。また、クロッ
ク発生回路7で発生されるクロックはマイクロコンピュ
ータ1のクロック端子27に入力され、内部のクロック制
御回路32でシステムクロックФが生成されてラッチ信号
発生回路24およびマイクロコンピュータ1内の各部に供
給される。
The output voltage Vcc of the constant voltage circuit 4 activated by turning on the ignition switch 3 is applied to the reset signal generating circuit 6, the clock generating circuit 7 and the main power supply terminal 25 of the microcomputer 1, and the reset signal generating circuit 6 outputs the signal. When the voltage Vcc is on and off, a reset signal R is generated and applied to the reset terminal 26 of the microcomputer 1. The voltage Vcc applied to the main power supply terminal 25 is MPU10, R
The reset signal supplied to the OM 11, the RAM 12, the I / O port 14, the gate control circuit 15 and the like and applied to the reset terminal 26 is supplied to the latch signal generation circuit 24 and the MPU 10. Further, the clock generated by the clock generation circuit 7 is input to the clock terminal 27 of the microcomputer 1, and the internal clock control circuit 32 generates the system clock Φ, which is supplied to the latch signal generation circuit 24 and each part in the microcomputer 1. Supplied.

定電圧回路5は自動車バッテリ2に直結されている為、
イグニッションスイッチ3のオン,オフにかかわらず動
作し、スタンバイ電圧Vsをマイクロコンピュータ1のス
タンバイ電圧端子28に加える。この端子28に加わるスタ
ンバイ電圧Vsは、スタンバイRAM13,第1データレジスタ
16,第2データレジスタ17,アドレスラッチ回路18,リー
ド/ライト信号ラッチ回路19に供給される。
Since the constant voltage circuit 5 is directly connected to the automobile battery 2,
It operates regardless of whether the ignition switch 3 is on or off, and applies the standby voltage Vs to the standby voltage terminal 28 of the microcomputer 1. The standby voltage Vs applied to this terminal 28 is the standby RAM 13, the first data register.
16, supplied to the second data register 17, the address latch circuit 18, and the read / write signal latch circuit 19.

マイクロコンピュータ1内のゲート制御回路15は、アド
レスバスAB上のアドレスをデコードし、ゲート回路20〜
23,30,31の開閉制御を行なうものである。
The gate control circuit 15 in the microcomputer 1 decodes the address on the address bus AB, and the gate circuits 20 ...
The opening / closing control of 23, 30, 31 is performed.

また、マイクロコンピュータ1内の第1,第2データレジ
スタ16,17は、MPU10がスタンバイRAM13内の2バイトデ
ータを書換える際に、予め書換えようとする2バイトデ
ータの上位バイト,下位バイトを格納しておく為のレジ
スタであり、スタンバイ電圧Vsで動作することから、そ
の内容はイグニッションスイッチ3のオフ中にも保持さ
れる。第1,第2データレジスタ16,17への書込みは、ア
ドレスバスABに第1,第2データレジスタ16,17対応のア
ドレスを送出してゲート制御回路15によってゲート回路
20,21を開くと共にゲート回路30,31を開き、且つコント
ロールバスCBのリード/ライト信号線をライト状態にす
ることが行なわれる。また、第1,第2データレジスタ1
6,17の内容はMPUから読取り可能であり、前述と同様に
してゲート回路20,21,30,31を開き、コントロールバスC
Bのリード/ライト信号線をリード状態にすることが行
なわれる。
Further, the first and second data registers 16 and 17 in the microcomputer 1 store the upper byte and the lower byte of the 2-byte data to be rewritten when the MPU 10 rewrites the 2-byte data in the standby RAM 13. It is a register for preserving it, and since it operates at the standby voltage Vs, its contents are retained even while the ignition switch 3 is off. For writing to the first and second data registers 16 and 17, the addresses corresponding to the first and second data registers 16 and 17 are sent to the address bus AB, and the gate control circuit 15 causes the gate circuit.
20 and 21 are opened, the gate circuits 30 and 31 are opened, and the read / write signal line of the control bus CB is set to the write state. Also, the first and second data registers 1
The contents of 6,17 can be read from the MPU, open the gate circuits 20,21,30,31 in the same manner as above, and open the control bus C
The B read / write signal line is set to the read state.

ラッチ信号発生回路24は、リセット端子26に加わるリセ
ット信号がローアクティブになった後の最初のシステム
ロックФの立下がりで、例えば“0"となるラッチ信号L
を発生するもので、そのラッチ信号Lはアドレスラッチ
回路18,リード/ライト信号ラッチ回路19に与えられ
る。
The latch signal generation circuit 24 has a latch signal L that becomes, for example, “0” at the first fall of the system lock Φ after the reset signal applied to the reset terminal 26 becomes low active.
The latch signal L is given to the address latch circuit 18 and the read / write signal latch circuit 19.

アドレスラッチ回路18は、アドレスバスABの内容をラッ
チ信号Lのタイミングでラッチするものであり、リード
/ライト信号ラッチ回路19はコントロールバスCBのリー
ド/ライト信号線の状態をラッチ信号Lのタイミングで
ラッチするものである。いずれもスタンバイ電圧Vsで動
作することから、イグニッションスイッチ3のオフ中に
もその内容は保持される。アドレスラッチ回路18にラッ
チされたアドレスおよびリード/ライト信号ラッチ回路
19に保持された状態は、MPU10のアドレスバスABにそれ
ぞれアドレスラッチ回路18,リード/ライト信号ラッチ
回路19に対応するアドレスを送出してゲート制御回路15
によってゲート回路22,23を開くことで、MPU10からデー
タバスDBを介して読取り可能になっている。
The address latch circuit 18 latches the contents of the address bus AB at the timing of the latch signal L, and the read / write signal latch circuit 19 determines the state of the read / write signal line of the control bus CB at the timing of the latch signal L. It is the one to latch. Since both of them operate at the standby voltage Vs, their contents are held even when the ignition switch 3 is off. Address and read / write signal latch circuit latched in address latch circuit 18
In the state held in 19, the addresses corresponding to the address latch circuit 18 and the read / write signal latch circuit 19 are sent to the address bus AB of the MPU 10 to output the gate control circuit 15
By opening the gate circuits 22 and 23 by, it becomes possible to read from the MPU 10 via the data bus DB.

第2図はスタンバイRAM13内のデータ配置例を示す図で
あり、スタンバイRAM13に割当てられたアドレス空間の
うちC000〜C00Fまでの16バイトを合計8個の2バイトデ
ータ格納域に割当て、他を1バイトデータ格納域に割当
てた例を示す。また、各2バイトデータ内の上位バイト
は最下位ビットが偶数のアドレスに格納され、その下位
バイトは最下位ビットが奇数のアドレスに格納されてい
る。
FIG. 2 is a diagram showing an example of data arrangement in the standby RAM 13, in which 16 bytes C000 to C00F of the address space allocated to the standby RAM 13 are allocated to a total of 8 2-byte data storage areas, and the others are 1 An example of allocation to the byte data storage area is shown below. In the upper byte of each 2-byte data, the least significant bit is stored in an even-numbered address, and the lower byte is stored in an odd-numbered address.

第3図はMPU10がROM11に格納されたプログラムに従って
スタンバイRAM13内の2バイトデータを更新する際の処
理例を示し、第4図はイグニッションスイッチ3のオン
によって起動された直後に行なう処理例を示す。以下、
各図を参照して本実施例の動作を説明する。
FIG. 3 shows a processing example when the MPU 10 updates 2-byte data in the standby RAM 13 according to a program stored in the ROM 11, and FIG. 4 shows a processing example immediately after being started by turning on the ignition switch 3. . Less than,
The operation of this embodiment will be described with reference to the drawings.

MPU10は、ROM11に格納された各種のプログラムに従い、
公知のようにマイクロコンピュータ1の入出力端子29に
加わる信号をI/Oポート14を介して読込み、それに従っ
て各種の演算を実行し、演算して得た各種制御信号をI/
Oポート14を介して外部に出力している。
MPU10 follows various programs stored in ROM11,
As is well known, a signal applied to the input / output terminal 29 of the microcomputer 1 is read through the I / O port 14, various operations are executed according to the signal, and various control signals obtained by the operation are I / O.
It is output to the outside through O port 14.

そのような処理過程において、スタンバイRAM13内の2
バイトデータの更新が必要になると、従来は、その2バ
イトデータの各バイトを直ちにスタンバイRAM13に書込
むようにしていたが、本実施例では、スタンバイRAM13
に書込む前に、先ず書込もうとする2バイトデータを第
1,第2データレジスタ16,17に格納する。これは、第3
図に示すようにして行なわれる。即ち、MPU10は、スタ
ンバイRAM13の更新アドレスが前述の例ではC000〜C00F
に該当するときは、2バイトデータの更新であると判別
し(S1)、書込もうとする2バイトデータの上位バイト
をデータバスDB,ゲート回路20を介して第1データレジ
スタ16に書込み(S2)、次いで下位バイトをデータバス
DB,ゲート回路21を介して第2データレジスタ17に書込
む(S3)。そして、従来のようにスタンバイRAM13の対
応する2バイトデータの書換えを行なう(S4)。
In such a process, 2 in the standby RAM 13
In the past, when it was necessary to update the byte data, each byte of the 2-byte data was immediately written to the standby RAM 13, but in the present embodiment, the standby RAM 13 is written.
Before writing to, first write the 2-byte data to be written
1, stored in the second data registers 16 and 17. This is the third
This is performed as shown in the figure. That is, the MPU 10 has the update address of the standby RAM 13 of C000 to C00F in the above example.
If the above condition is true, it is determined that the 2-byte data has been updated (S1), and the upper byte of the 2-byte data to be written is written to the first data register 16 via the data bus DB and the gate circuit 20 ( S2), then the lower byte on the data bus
Write to the second data register 17 via the DB and gate circuit 21 (S3). Then, as in the conventional case, the corresponding 2-byte data in the standby RAM 13 is rewritten (S4).

上記2バイトデータの書換えは、例えば先ず上位バイト
の書換えを行ない、次に下位バイトの書換えを行なうよ
うに1バイトずつ行なわれる。従って、その途中にイグ
ニッションスイッチ3のオフに起因してMPU10の動作が
停止されると前述したように2バイトデータの破壊が生
じることになる。
Rewriting of the 2-byte data is performed, for example, one byte at a time so that the upper byte is rewritten first, and then the lower byte is rewritten. Therefore, if the operation of the MPU 10 is stopped due to the turning-off of the ignition switch 3 in the middle of the operation, the 2-byte data will be destroyed as described above.

第5図は、スタンバイRAM13のアドレスC000,C001に格納
された第1の2バイトデータの書換え中に、イグニッシ
ョンスイッチ3のオフに起因するリセットがマイクロコ
ンピュータ1にかけられた際の各部の様子を示すタイミ
ングチャートである。
FIG. 5 shows the state of each part when the reset caused by turning off the ignition switch 3 is applied to the microcomputer 1 during the rewriting of the first 2-byte data stored in the addresses C000 and C001 of the standby RAM 13. It is a timing chart.

イグニッションスイッチ3がオフされると、リセット信
号発生回路6から出力されているリセット信号Rは所定
時間後に“0"になり、MPU10は1マシンサイクル中の実
行中であれば、そのマシンサイクルを完了して動作を停
止する。従って、第5図に示すようにそのマシンサイク
ルが2バイトデータの上記バイトの書換えサイクルであ
れば、上記バイトの書換え後に動作を停止し、下位バイ
トの書換えは実行されない。
When the ignition switch 3 is turned off, the reset signal R output from the reset signal generating circuit 6 becomes "0" after a predetermined time, and the MPU 10 completes the machine cycle if it is executing during one machine cycle. To stop the operation. Therefore, as shown in FIG. 5, if the machine cycle is a rewriting cycle of the above-mentioned byte of 2-byte data, the operation is stopped after the above-mentioned rewriting of the byte, and the rewriting of the lower byte is not executed.

他方、リセット信号Rが“0"になると、ラッチ信号発生
回路24から出力されているラッチ信号Lは、次のクロッ
クの立下がりで“0"となり、このタイミングでアドレス
ラッチ回路18,リード/ライト信号ラッチ回路19がラッ
チ動作を行なう。この為、アドレスラッチ回路18には、
そのときアドレスバスABに出力されているアドレスC000
がラッチされ、リード/ライト信号ラッチ回路19には、
ライト状態がラッチされ、MPU10の動作停止後も保持さ
れることになる。また、前述したように、MPU10は書換
えようとするアドレスC000,C001の2バイトデータの上
位バイトを第1データレジスタ16に、下位バイトを第2
データレジスタ17に書込んでいるので、その2バイトデ
ータもMPU10の動作停止後も保持されることになる。
On the other hand, when the reset signal R becomes "0", the latch signal L output from the latch signal generating circuit 24 becomes "0" at the next falling edge of the clock, and at this timing, the address latch circuit 18, read / write The signal latch circuit 19 performs a latch operation. Therefore, in the address latch circuit 18,
Address C000 being output to address bus AB at that time
Is latched, and the read / write signal latch circuit 19
The write state will be latched and will be retained even after the MPU 10 stops operating. Further, as described above, the MPU 10 stores the upper byte of the 2-byte data of the addresses C000 and C001 to be rewritten in the first data register 16 and the lower byte in the second data.
Since the data is written in the data register 17, the 2-byte data is retained even after the operation of the MPU 10 is stopped.

その後、イグニッションスイッチ3がオンされると、MP
U10はその初期処理において第4図の処理を実行する。
先ずゲート回路23を介してリード/ラッチ信号ラッチ回
路19の内容を読込み(S10)、それがライト状態である
か否かを判別する(S11)。ライト状態でなければ次の
処理へ移行するが、ライト状態であれば、ゲート回路22
を介してアドレスラッチ回路18の内容を読取る(S1
2)。そして、この読込んだアドレスがスタンバイRAM13
内の2バイトデータ領域に相当するか否かを判別し(S1
3)、その領域以外であれば次の処理へ進むが、2バイ
トデータ領域であれば、スタンバイRAM13内の対応する
2バイトデータを、第1,第2データレジスタ16,17に格
納された2バイトデータに一致させる処理を実行する
(S14〜S18)。
After that, when the ignition switch 3 is turned on, MP
U10 executes the processing of FIG. 4 in its initial processing.
First, the contents of the read / latch signal latch circuit 19 are read through the gate circuit 23 (S10), and it is determined whether or not it is in the write state (S11). If it is not in the write state, the process proceeds to the next process, but if it is in the write state, the gate circuit 22
Read the contents of the address latch circuit 18 via (S1
2). And this read address is the standby RAM13
It is determined whether or not it corresponds to the 2-byte data area in (S1
3) If the area is other than that area, proceed to the next process, but if the area is a 2-byte data area, the corresponding 2-byte data in the standby RAM 13 is stored in the first and second data registers 16 and 17. A process for matching the byte data is executed (S14 to S18).

第5図に示したタイミングチャートの場合、リード/ラ
イト信号ラッチ回路19にはライト状態が保持され、アド
レスラッチ回路18には第1の2バイトデータの上位バイ
トのアドレスC000が格納されているので、MPU10はステ
ップS14〜S18を実行することになる。
In the case of the timing chart shown in FIG. 5, the read / write signal latch circuit 19 holds the write state, and the address latch circuit 18 stores the upper byte address C000 of the first 2-byte data. , MPU10 will perform steps S14-S18.

さて、スタンバイRAM13内の対応する2バイトデータ
を、第1,第2データレジスタ16,17に格納された2バイ
トデータに一致させる処理としては各種の処理が考えら
れ、本発明ではその方法まで限定するものではないが、
第4図にはその一例として、2バイトデータの書換え中
に動作が停止した場合、無条件に第1,第2データレジス
タ16,17の内容を対応するスタンバイRAM13のアドレスに
書込む方法を採用している。また、第1,第2データレジ
スタ16,17の書込み先アドレスを知る方法として、アド
レスラッチ回路18に格納されたアドレスと、その最下位
ビットが偶数か奇数かの条件で決定している。即ち、前
述したように2バイトデータの上位バイトは最下位ビッ
トが偶数のアドレスに格納され、下位バイトは奇数のア
ドレスに格納されるので、MPU10はアドレスラッチ回路1
8にラッチされた最下位ビットが偶数のときは、第1デ
ータレジスタ16の内容をそのラッチアドレスに相当する
スタンバイRAM13の領域に書込んだ後、第2データレジ
スタ17の内容をラッチアドレス+1に相当するスタンバ
イRAM13の領域に書込み(S14〜S16)、反対にアドレス
ラッチ回路18にラッチされた最下位ビットが奇数のとき
は、第1データレジスタ16の内容をそのラッチアドレス
−1に相当するスタンバイRAM13の領域に書込んだ後、
第2データレジスタ17の内容をラッチアドレスに相当す
るスタンバイRAM13の領域に書込む(S14,S17,S18)。従
って、第5図に示したタイミングチャートの場合、アド
レスラッチ回路18にはC000のアドレスがラッチされ、そ
の最下位ビットは偶数であるから、第1データレジスタ
16の内容がスタンバイRAM13のC000の領域に格納され、
第2データレジスタ17の内容がスタンバイRAM13のC001
の領域に格納され、未格納のまま停止したアドレスC001
の内容が真値に復元される。
Various kinds of processing are conceivable as the processing for matching the corresponding 2-byte data in the standby RAM 13 with the 2-byte data stored in the first and second data registers 16 and 17, and the present invention is limited to that method. It is not something to do,
As an example, Fig. 4 adopts the method of unconditionally writing the contents of the first and second data registers 16 and 17 to the corresponding addresses of the standby RAM 13 when the operation is stopped during the rewriting of the 2-byte data. is doing. Further, as a method of knowing the write destination address of the first and second data registers 16 and 17, the address stored in the address latch circuit 18 and the least significant bit thereof are determined to be even or odd. That is, as described above, since the least significant bit of the upper byte of the 2-byte data is stored in the even address and the lower byte is stored in the odd address, the MPU 10 operates in the address latch circuit 1.
When the least significant bit latched in 8 is an even number, the contents of the first data register 16 are written to the area of the standby RAM 13 corresponding to the latch address, and then the contents of the second data register 17 are set to the latch address + 1. Write to the area of the corresponding standby RAM 13 (S14 to S16), and conversely, if the least significant bit latched by the address latch circuit 18 is an odd number, the contents of the first data register 16 will be the standby address corresponding to the latch address-1. After writing to the area of RAM13,
The contents of the second data register 17 are written in the area of the standby RAM 13 corresponding to the latch address (S14, S17, S18). Therefore, in the case of the timing chart shown in FIG. 5, the address latch circuit 18 latches the address of C000, and the least significant bit thereof is an even number.
The contents of 16 are stored in the C000 area of the standby RAM13,
The contents of the second data register 17 is C001 of the standby RAM13.
Address C001 stored in the area
The content of is restored to its true value.

なお、第4図の処理では、第1,第2データレジスタ16,1
7の内容と、対応するスタンバイRAM13の内容とを照合す
ることなく、第1,第2データレジスタ16,17の内容を書
込むようにしたが、両者の内容が一致するかしないかを
照合し、不一致のときにのみ一致しないバイトのみ或い
は両バイトを書込むようにしても良い。
In the process of FIG. 4, the first and second data registers 16,1
The contents of 7 and the contents of the corresponding standby RAM 13 are not compared, but the contents of the first and second data registers 16 and 17 are written, but it is checked whether the contents of the two match or not. Alternatively, only when they do not match, only the unmatched bytes or both bytes may be written.

第6図はアドレスラッチ回路18の実施例の回路であり、
スタンバイ電圧Vsで動作するアドレスバスのビット数に
相当する16個のフリップフロップで構成した例を示す。
各フリップフロップ60のクロック端子CLKにはラッチ信
号Lが入力され、データ入力端子DにはアドレスバスAB
の対応するビット線A0〜A15の信号が入力され、出力端
子Qから各ビットのラッチ信号A0′〜A15′が取出され
る。
FIG. 6 shows a circuit of an embodiment of the address latch circuit 18,
An example of 16 flip-flops corresponding to the number of bits of the address bus operating at the standby voltage Vs is shown.
The latch signal L is input to the clock terminal CLK of each flip-flop 60, and the address bus AB is input to the data input terminal D.
The signals of the corresponding bit lines A 0 to A 15 are input, and the latch signals A 0 ′ to A 15 ′ of each bit are taken out from the output terminal Q.

第7図はリード/ライト信号ラッチ回路19の実施例の回
路図であり、スタンバイ電圧Vsで動作する1個のフリッ
プフロップ70を使用し、そのクロック端子CLKにラッチ
信号Lを入力し、データ入力端子Dにコントロールバス
CBのリード/ラッチ信号線の状態(R/W)を入力し、出
力端子Qからラッチ信号R/W′を取出すようにしたもの
である。
FIG. 7 is a circuit diagram of an embodiment of the read / write signal latch circuit 19, in which one flip-flop 70 operating at the standby voltage Vs is used, the latch signal L is input to its clock terminal CLK, and the data input is performed. Control bus to terminal D
The state (R / W) of the read / latch signal line of CB is input and the latch signal R / W 'is taken out from the output terminal Q.

第8図は第1データレジスタ16の実施例の回路図であ
り、第2データレジスタ17も同様の構成とすることがで
きる。この実施例のデータレジスタは、スタンバイ電圧
Vsで動作する8個のフリップフロップ80を使用し、その
クロック端子CLKに第5図に示すシステムクロックФと
ゲート回路30からのリード/ライト信号R/W30との論理
和をとるゲート回路81の出力を入力し、ゲート回路20の
出力中の各データビット線D0〜D7をデータ入力端子Dに
入力し、出力端子Qをドライバ82を介してデータビット
線D0〜D7に接続したものである。ドライバ82はリード/
ライト信号R/W30がリードのときオフ状態となり、ライ
トのときオン状態となる。なお、MPUがその動作を停止
する直前に書込もうとしていた2バイトデータの全バイ
トを保持するデータ保持手段の別の実施例としては、MP
U10がメイン電源で動作する別のレジスタにこれから書
込もうとする2バイトデータを書込み、その内容を、ス
タンバイ電圧Vsで動作する別のレジスタにラッチ信号の
タイミングでラッチする構成が考えられる。
FIG. 8 is a circuit diagram of an embodiment of the first data register 16, and the second data register 17 can have the same structure. The data register of this embodiment has a standby voltage
A gate circuit 81 which uses eight flip-flops 80 operating at Vs and takes the logical sum of the system clock Φ and the read / write signal R / W30 from the gate circuit 30 shown in FIG. The output is input, each data bit line D 0 to D 7 in the output of the gate circuit 20 is input to the data input terminal D, and the output terminal Q is connected to the data bit lines D 0 to D 7 via the driver 82. It is a thing. Driver 82 read /
When the write signal R / W30 is read, it is turned off, and when it is written, it is turned on. As another embodiment of the data holding means for holding all the bytes of the 2-byte data which the MPU was about to write immediately before stopping its operation,
A configuration is conceivable in which U10 writes the 2-byte data to be written into another register operating with the main power supply and latches the content in another register operating with the standby voltage Vs at the timing of the latch signal.

第9図はラッチ信号発生回路24の実施例の回路図であ
り、一つのフリップフロップ90を使用し、そのクロック
端子CLKにインバータ91を介して第5図のシステムクロ
ックФを入力し、データ入力端子Dにリセット信号Rを
入力し、出力端子Qからインバータ92を介してラッチ信
号を取出すようにしたものである。
FIG. 9 is a circuit diagram of an embodiment of the latch signal generating circuit 24. One flip-flop 90 is used, and the system clock Φ of FIG. 5 is input to its clock terminal CLK via an inverter 91 to input data. The reset signal R is input to the terminal D, and the latch signal is taken out from the output terminal Q via the inverter 92.

以上本発明の一実施例について説明したが、本発明は以
上の実施例にのみ限定されずその他各種の付加変更が可
能であり、2バイトデータ以外の多バイトデータ例えば
3バイトデータ,4バイトデータ等に対しても適用可能で
ある。
Although one embodiment of the present invention has been described above, the present invention is not limited to the above embodiment and various other additions and changes are possible, and multi-byte data other than 2-byte data, for example, 3-byte data, 4-byte data. It is also applicable to etc.

〔発明の効果〕〔The invention's effect〕

以上説明したように、本発明は、演算処理装置がメイン
電源のオフによって動作を停止する直前に、どのような
動作を行なっていたかをデータ保持手段,アドレス保持
手段,リード/ライト信号保持手段に保持させておき、
メイン電源のオン時にそれらの保持内容から多バイトデ
ータの書込み中に動作が停止したことを判別すると、対
応するスタンバイRAM内の多バイトデータをデータ保持
手段に保持された多バイトデータに一致させる処理を行
なうものであり、たとえスタンバイRAM内の多バイトデ
ータが破壊されていても、それを真値に復元することが
可能となる。
As described above, the present invention provides the data holding means, the address holding means, and the read / write signal holding means with what operation was being performed immediately before the arithmetic processing unit stopped its operation due to the turning off of the main power supply. Keep it
Processing to match the multibyte data in the corresponding standby RAM with the multibyte data held in the data holding means when the main power supply is turned on and if it is determined from the stored contents that the operation stopped during the writing of the multibyte data Even if the multi-byte data in the standby RAM is destroyed, it can be restored to the true value.

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

第1図は本発明の実施例のブロック図、 第2図はスタンバイRAM13内のデータ配置例を示す図、 第3図はMPU10がスタンバイRAM13内の2バイトデータを
更新する際の処理例を示す流れ図、 第4図はイグニッションスイッチ3のオンによって起動
された直後にMPU10が行なう処理例の流れ図、 第5図はスタンバイRAM13内の2バイトデータの書換え
中にイグニッションスイッチ3のオフに起因するリセッ
トがマイクロコンピュータ1にかけられた際の各部の状
態を示すタイミングチャート、 第6図はアドレスラッチ回路18の実施例の回路図、 第7図はリード/ライト信号ラッチ回路19の実施例の回
路図、 第8図は第1データレジスタ16の実施例の回路図およ
び、 第9図はラッチ信号発生回路24の実施例の回路図であ
る。 図において、1……マイクロコンピュータ、2……自動
車バッテリ、3……イグニッションスイッチ、4……メ
イン電源用の定電圧回路、5……スタンバイ電源用の定
電圧回路、6……リセット信号発生回路、7……クロッ
ク発生回路、10……演算処理装置(MPU)、11……ROM、
12……RAM、13……スタンバイRAM、14……入出力ポート
(I/Oポート)、15……ゲート制御回路、16……第1デ
ータレジスタ、17……第2データレジスタ、18……アド
レスラッチ回路、19……リード/ライト信号ラッチ回
路、20〜23,30,31……ゲート回路、24……ラッチ信号発
生回路。
FIG. 1 is a block diagram of an embodiment of the present invention, FIG. 2 is a diagram showing an example of data arrangement in the standby RAM 13, and FIG. 3 is an example of processing when the MPU 10 updates 2-byte data in the standby RAM 13. Flow chart, FIG. 4 is a flow chart of an example of processing performed by the MPU 10 immediately after the ignition switch 3 is activated by turning on the ignition switch 3, and FIG. 5 is a reset caused by turning off the ignition switch 3 during rewriting of 2 bytes of data in the standby RAM 13. 6 is a timing chart showing the state of each part when applied to the microcomputer 1, FIG. 6 is a circuit diagram of an embodiment of the address latch circuit 18, FIG. 7 is a circuit diagram of an embodiment of the read / write signal latch circuit 19, FIG. 8 is a circuit diagram of an embodiment of the first data register 16, and FIG. 9 is a circuit diagram of an embodiment of the latch signal generating circuit 24. In the figure, 1 ... Microcomputer, 2 ... Car battery, 3 ... Ignition switch, 4 ... Main power supply constant voltage circuit, 5 ... Standby power supply constant voltage circuit, 6 ... Reset signal generation circuit , 7 ... Clock generation circuit, 10 ... Arithmetic processing unit (MPU), 11 ... ROM,
12 …… RAM, 13 …… Standby RAM, 14 …… Input / output port (I / O port), 15 …… Gate control circuit, 16 …… First data register, 17 …… Second data register, 18 …… Address latch circuit, 19 ... Read / write signal latch circuit, 20-23, 30, 31 ... Gate circuit, 24 ... Latch signal generation circuit.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】メイン電源のオン,オフにかかわらず別系
統電源から電源供給を受けて動作し、データバス,アド
レスバス,リード/ライト信号線を介して演算処理装置
に接続されたスタンバイRAMを有するマイクロコンピュ
ータシステムにおいて、 前記別系統電源で動作し、前記演算処理装置が前記メイ
ン電源のオフによって動作を停止する直前の前記アドレ
スバス上のアドレスを保持するアドレス保持手段と、 前記別系統電源で動作し、前記演算処理装置が前記メイ
ン電源のオフによって動作を停止する直前の前記リード
/ライト信号線上の信号を保持するリード/ライト信号
保持手段と、 前記別系統電源で動作し、前記演算処理装置が前記メイ
ン電源のオフによって動作を停止する直前に書込もうと
していた多バイトデータの全バイトを保持するデータ保
持手段とを備え、 前記演算処理装置は、前記メイン電源のオン時に、前記
リード/ライト信号保持手段にライト信号が保持され且
つ前記アドレス保持手段に保持されたアドレスが多バイ
トデータ格納アドレスに該当するという条件の成立を判
別し、該条件が成立したときは、前記スタンバイRAM内
の対応する多バイトデータを前記データ格納手段に格納
された多バイトデータに一致させる処理を行なうように
構成されたことを特徴とするスタンバイRAM内多バイト
データの保護方式。
1. A standby RAM that operates by receiving power from another system power supply regardless of whether the main power supply is on or off and is connected to an arithmetic processing unit through a data bus, an address bus, and a read / write signal line. In the microcomputer system having, an address holding unit that operates with the separate system power supply and holds an address on the address bus immediately before the arithmetic processing device stops the operation by turning off the main power supply, and the separate system power supply A read / write signal holding unit that operates and holds the signal on the read / write signal line immediately before the arithmetic processing device stops its operation when the main power supply is turned off; All bytes of the multi-byte data that was about to be written immediately before the device stopped operating due to the main power being turned off The arithmetic processing unit stores a write signal in the read / write signal holding unit and stores an address held in the address holding unit in multi-byte data when the main power supply is turned on. When it is determined that the condition corresponding to the address is satisfied, and when the condition is satisfied, processing for matching the corresponding multi-byte data in the standby RAM with the multi-byte data stored in the data storage means is performed. A protection method for multi-byte data in standby RAM characterized by being configured.
JP61190202A 1986-08-13 1986-08-13 Multi-byte data protection system in standby RAM Expired - Lifetime JPH0782462B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP61190202A JPH0782462B2 (en) 1986-08-13 1986-08-13 Multi-byte data protection system in standby RAM

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP61190202A JPH0782462B2 (en) 1986-08-13 1986-08-13 Multi-byte data protection system in standby RAM

Publications (2)

Publication Number Publication Date
JPS6346558A JPS6346558A (en) 1988-02-27
JPH0782462B2 true JPH0782462B2 (en) 1995-09-06

Family

ID=16254154

Family Applications (1)

Application Number Title Priority Date Filing Date
JP61190202A Expired - Lifetime JPH0782462B2 (en) 1986-08-13 1986-08-13 Multi-byte data protection system in standby RAM

Country Status (1)

Country Link
JP (1) JPH0782462B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0758636B2 (en) * 1990-11-22 1995-06-21 関西日本電気株式会社 Electroluminescent lamp
JP2013250965A (en) * 2012-05-02 2013-12-12 Semiconductor Energy Lab Co Ltd Semiconductor device and driving method thereof

Also Published As

Publication number Publication date
JPS6346558A (en) 1988-02-27

Similar Documents

Publication Publication Date Title
US5568416A (en) Associative memory
US4222103A (en) Real time capture registers for data processor
US6334135B2 (en) Data processing system and register file
JP2685245B2 (en) Programmable controller
JPH0782462B2 (en) Multi-byte data protection system in standby RAM
EP0226991B1 (en) Data-processing device
US4641278A (en) Memory device with a register interchange function
JPH0362243A (en) Apparatus for quickening memory access in information processing system
US5151993A (en) Data processor performing operation on data having length shorter than one-word length
US5423052A (en) Central processing unit with switchable carry and borrow flag
EP0864983A2 (en) Computer system including memory adress management circuit for protecting memory from illegal writing
JPH08166835A (en) Clock generating circuit
JPS5821300B2 (en) Memory address information
JPH0223458A (en) Access control system for address converting table
JP3058123B2 (en) Address comparison circuit
JPS6136652B2 (en)
JP2781779B2 (en) Branch control circuit
JPH08185358A (en) Microprocessor
JPH0535472A (en) Microcomputer
JP3239042B2 (en) Microcomputer
JP2781973B2 (en) Memory content update circuit
JPH0212358A (en) Data transfer system
JP3541863B2 (en) Central processing unit
JPH08305564A (en) Microcomputer
JPH0545978B2 (en)