JP2899610B2 - Malfunction protection circuit of CPU clock selection supply circuit - Google Patents

Malfunction protection circuit of CPU clock selection supply circuit

Info

Publication number
JP2899610B2
JP2899610B2 JP4297618A JP29761892A JP2899610B2 JP 2899610 B2 JP2899610 B2 JP 2899610B2 JP 4297618 A JP4297618 A JP 4297618A JP 29761892 A JP29761892 A JP 29761892A JP 2899610 B2 JP2899610 B2 JP 2899610B2
Authority
JP
Japan
Prior art keywords
cpu
selection
clock
clock signal
command
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP4297618A
Other languages
Japanese (ja)
Other versions
JPH06124135A (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.)
MOTOROORA KK
Original Assignee
MOTOROORA KK
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 MOTOROORA KK filed Critical MOTOROORA KK
Priority to JP4297618A priority Critical patent/JP2899610B2/en
Publication of JPH06124135A publication Critical patent/JPH06124135A/en
Application granted granted Critical
Publication of JP2899610B2 publication Critical patent/JP2899610B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、カメラやラジオカセッ
トなど各種の電子機器の制御用として利用されるCPU
にクロック信号を選択的に供給するためのCPUクロッ
ク選択供給回路を誤動作から保護する回路に関するもの
である。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a CPU used for controlling various electronic devices such as a camera and a radio cassette.
And a circuit for protecting a CPU clock selection / supply circuit for selectively supplying a clock signal to a malfunction from malfunctioning.

【0002】[0002]

【従来の技術】カメラやラジオカセットなど各種の電子
機器を制御するために、マイクロプロセッサやマイクロ
コントローラなどと称されるCPUが汎用されている。
この種のCPUは、一般に、速度の異なる複数系統のク
ロック信号のもとで動作可能な構成となっている場合が
多い。このようなCPUに供給する複数系統のクロック
信号は、ユーザが外付けのマイクロスイッチなどを操作
して選択する場合もあるが、そのようなクロック信号を
受けるCPU自身がその処理内容に応じて適宜選択でき
る構成となっている場合もある。
2. Description of the Related Art In order to control various electronic devices such as a camera and a radio cassette, a CPU called a microprocessor or a microcontroller is widely used.
In general, this type of CPU is often configured to be able to operate under a plurality of clock signals of different speeds. In some cases, a user operates the external microswitch or the like to select a plurality of clock signals to be supplied to the CPU, but the CPU itself receiving such a clock signal appropriately selects the clock signal according to the processing content. In some cases, the configuration can be selected.

【0003】上記CPU自身が複数系統のクロック信号
の一つを選択するためのクロック選択供給回路の構成を
クロック信号が2系統の場合について例示すると、図7
に示すように、CPU10の前段に2系統のクロック供
給回路11,12を配置し、CPU10の指令に基づき
スイッチ13を切り替え、クロック信号CK1又はCK
2のうちの一方を選択的に受け取ることができるように
なっている。内蔵の電池などで動作するCPUの場合
は、必要なクロック供給回路の動作を開始させると共に
消費電力の節減などを目的として不要なクロック供給系
統の動作を随時停止できる構成となっており、クロック
供給回路11,12に対応して設置されているオン/オ
フ制御レジスタ14a,14bに動作の開始/停止を指
令するオン/オフ制御信号en1,en2をCPU10
が制御バス16を介して書き込み可能となっている。
FIG. 7 shows an example of the configuration of a clock selection / supply circuit for the CPU itself to select one of a plurality of clock signals in a case where there are two clock signals.
As shown in FIG. 2, two clock supply circuits 11 and 12 are arranged in front of the CPU 10, and the switch 13 is switched based on a command from the CPU 10 to change the clock signal CK1 or CK.
One of the two can be selectively received. In the case of a CPU that operates with a built-in battery or the like, the configuration is such that the operation of the necessary clock supply circuit can be started and the operation of the unnecessary clock supply system can be stopped at any time for the purpose of saving power consumption. CPU 10 sends on / off control signals en1 and en2 for instructing on / off control registers 14a and 14b provided corresponding to circuits 11 and 12 to start / stop the operation.
Are writable via the control bus 16.

【0004】図7のクロック信号選択供給回路では、C
PU10が制御バス16を介してクロック信号を選択す
るために、選択制御レジスタ15が設置されており、こ
の制御レジスタに“1”/“0”の選択指令selを書
き込み可能となっている。また、CPU10が現在どの
系統のクロック供給回路が動作中であるかを制御バス1
6を介して検出できるように、各クロック供給回路内に
は、Nビットカウンタと、このNビットカウンタから出
力されるキャリイ信号Cを保持することによりクロック
供給回路の動作が開始されてからNクロック周期が経過
すると“0”から“1”に立ち上がるフラグFLG1,
FLG2を出力するフリップフロップが設置されてい
る。
In the clock signal selection and supply circuit shown in FIG.
A selection control register 15 is provided for the PU 10 to select a clock signal via the control bus 16, and a selection command “sel” of “1” / “0” can be written to this control register. Also, the CPU 10 determines which clock supply circuit is currently operating by the control bus 1.
6, each clock supply circuit holds an N-bit counter and a carry signal C output from the N-bit counter, so that N clocks can be detected after the operation of the clock supply circuit is started. The flag FLG1, which rises from "0" to "1" when the cycle elapses
A flip-flop that outputs FLG2 is provided.

【0005】[0005]

【発明が解決しようとする課題】図7に示した従来のク
ロック信号選択供給回路では、スイッチの切り替えによ
るクロック信号の選択と各クロック供給回路のオン/オ
フがすべてCPUの制御に基づいて行われる構成となっ
ている。このため、CPUのプログラム上の暴走やハー
ドウエアの誤動作などに基づき、動作停止中のクロック
供給回路の出力が誤って選択されたり、選択中のクロッ
ク信号を出力しているクロック供給回路の動作が誤って
停止されたりするとその瞬間からCPUにクロック信号
が供給されなくなり、CPUが動作不能になってしまう
という問題がある。
In the conventional clock signal selection and supply circuit shown in FIG. 7, the selection of a clock signal by switching a switch and the ON / OFF of each clock supply circuit are all performed under the control of the CPU. It has a configuration. For this reason, the output of the clock supply circuit that is not operating is erroneously selected or the operation of the clock supply circuit that is outputting the selected clock signal is stopped based on a runaway in the program of the CPU or malfunction of hardware. If the operation is stopped by mistake, the clock signal is not supplied to the CPU from that moment, which causes a problem that the CPU becomes inoperable.

【0006】通常、CPUの暴走やハードウエアの誤動
作などによって生じた動作不能状態は、ウォッチドッグ
タイマーなどによって自動的に検出され、オートリセッ
トなどによって自動的に復旧可能となっている。しかし
ながら、CPUへのクロック信号の供給を誤って停止さ
せてしまった場合には、ウォッチドッグタイマーなどに
よる自己診断・自動復旧機能も同時に停止してしまうの
で、自動的な復旧の可能性は完全に断たれてしまい、ユ
ーザがそのことに気付いてマニュアルリセットなどを行
うまで動作不能状態が持続してしまうという問題があ
る。
Normally, an inoperable state caused by a CPU runaway or hardware malfunction is automatically detected by a watchdog timer or the like, and can be automatically recovered by an automatic reset or the like. However, if the supply of the clock signal to the CPU is erroneously stopped, the self-diagnosis and automatic recovery functions such as the watchdog timer are also stopped at the same time, so the possibility of automatic recovery is completely lost. There is a problem that the inoperable state is maintained until the user notices this and performs a manual reset or the like.

【0007】[0007]

【課題を解決するための手段】本発明に係わるCPUク
ロック選択供給回路の誤動作保護回路は、CPUから供
給されるクロック選択指令が存在しないクロック信号を
選択させようとする場合には、存在するクロック信号を
選択させるようにこの選択指令を変更して選択制御レジ
スタに供給する誤選択保護回路と、CPUから供給され
るオン/オフ制御信号がCPUクロック信号として選択
中のクロック信号を出力しているクロック供給回路の動
作を停止させようとする場合には、その動作を継続させ
るようにこのオン/オフ制御信号を変更してオン/オフ
制御レジスタに供給する誤停止保護回路のうち少なくと
も一方を備えている。
According to the present invention, a malfunction protection circuit for a CPU clock selection supply circuit according to the present invention is designed to select a clock signal which does not have a clock selection command supplied from the CPU. An erroneous selection protection circuit that changes the selection command to select a signal and supplies the selection control register and an on / off control signal supplied from the CPU outputs a clock signal being selected as a CPU clock signal. When the operation of the clock supply circuit is to be stopped, at least one of an erroneous stop protection circuit for changing the on / off control signal and supplying the same to the on / off control register so as to continue the operation is provided. ing.

【0008】[0008]

【作用】誤選択保護回路は、各クロック供給回路から出
力されるクロック信号の有無を示すフラグを監視するこ
とによって現存するクロック信号を認識し、CPUが何
らかの原因により誤ってこれ以外のクロック信号を選択
させようとする場合には、現存するクロック信号を選択
させるようにこの選択指令を変更して選択制御レジスタ
に供給する。また、誤停止保護回路は、選択制御レジス
タから出力中のクロック信号選択指令を監視することに
よって現在選択中のクロック供給回路を識別し、CPU
が何らかの原因により誤って選択中のクロック供給回路
の動作を停止させようとする場合には、その動作を持続
させるようにこのオン/オフ指令を変更してオン/オフ
制御レジスタに供給する。
The erroneous selection protection circuit recognizes an existing clock signal by monitoring a flag indicating the presence or absence of a clock signal output from each clock supply circuit, and the CPU erroneously outputs another clock signal for some reason. When the user wants to make a selection, the selection command is changed so as to select an existing clock signal, and is supplied to the selection control register. Further, the false stop protection circuit identifies the currently selected clock supply circuit by monitoring the clock signal selection command being output from the selection control register, and
If the user wants to stop the operation of the clock supply circuit being selected by mistake for some reason, the on / off command is changed and supplied to the on / off control register so that the operation is continued.

【0009】上記誤選択保護回路と誤停止保護回路の少
なくとも一方、好適には双方を備えることにより、CP
Uの誤動作によってCPUクロック信号が断たれてしま
う事態が有効に回避される。
By providing at least one of the above-mentioned erroneous selection protection circuit and the erroneous stop protection circuit, preferably both, the CP
A situation in which the CPU clock signal is cut off due to a malfunction of U is effectively avoided.

【0010】[0010]

【実施例】図1は、本発明の一実施例に係わるクロック
信号選択供給回路の誤動作保護回路の構成を、保護対象
のクロック信号選択供給回路と、このクロック選択供給
回路からCPUクロック信号を受けるCPUと共に示す
ブロック図であり、10はCPU、11,12はクロッ
ク供給回路、13はスイッチ、14a,14bはオン/
オフ制御レジスタ、15は選択制御レジスタ、20は誤
動作保護回路である。この誤動作保護回路20は、誤選
択保護回路21と誤停止保護回路22とから構成されて
いる。
FIG. 1 shows a configuration of a malfunction protection circuit of a clock signal selection / supply circuit according to an embodiment of the present invention. The clock signal selection / supply circuit to be protected and a CPU clock signal received from the clock selection / supply circuit. 10 is a block diagram shown together with a CPU, 10 is a CPU, 11 and 12 are clock supply circuits, 13 is a switch, and 14a and 14b are ON / OFF.
An OFF control register, 15 is a selection control register, and 20 is a malfunction protection circuit. The malfunction protection circuit 20 includes a malfunction selection protection circuit 21 and a malfunction stop protection circuit 22.

【0011】クロック供給回路11は、アンドゲート1
1a,インバータ11b,Nビットカウンタ11c及び
フリップフロップ11dから構成されており、外付けの
水晶振動子などから外部クロック入力端子17に供給さ
れるクロック信号ck1’を受け、オン/オフ指令EN
1によって選択的に開かれるアンドゲート11aとイン
バータ11bとを通過させることによりCPU10への
クロック信号CK1としてスイッチ13の一方の入力端
子に供給する。Nビットカウンタ11cは、インバータ
11bから出力されるクロック信号CK1をカウント
し、2N 個のクロック信号をカウントするとオバーフロ
ーしてキャリイ信号Cを出力する。フリップフロップ1
1dはこのキャリイ信号を保持することによりクロック
信号CK1の有無を示すフラグFLG1が“0”から
“1”に立ち上がる。なお、このフラグFLG1は、オ
ン/オフ指令EN1の“0”への立ち下がり時に“0”
に初期設定される。
The clock supply circuit 11 includes an AND gate 1
1a, an inverter 11b, an N-bit counter 11c, and a flip-flop 11d, receives a clock signal ck1 'supplied from an external crystal oscillator or the like to an external clock input terminal 17, and receives an on / off command EN.
The clock signal CK1 to the CPU 10 is supplied to one input terminal of the switch 13 by passing through the AND gate 11a and the inverter 11b which are selectively opened by 1. The N-bit counter 11c counts the clock signal CK1 output from the inverter 11b, and upon counting 2 N clock signals, overflows and outputs the carry signal C. Flip-flop 1
In 1d, the flag FLG1, which indicates the presence or absence of the clock signal CK1, rises from "0" to "1" by holding the carry signal. The flag FLG1 is set to "0" when the on / off command EN1 falls to "0".
Initially set to

【0012】クロック供給回路12は、上述のクロック
供給回路11と同様の構成となっており、煩雑化を避け
るため図示は省略するが、外部クロック入力端子18に
供給されるクロック信号ck2’を受け、オン/オフ指
令EN2によって選択的に開される内蔵のアンドゲート
とインバータとを通過させることによりCPU10への
クロック信号CK2としてスイッチ13の他方の入力端
子に供給する。このクロック信号CK2をカウントする
内蔵のNビットカウンタとそのオバーフローによって発
生するキャリイ信号Cを保持するフリップフロップとに
よってクロック信号CK2の有無を示すフラグFLG2
が“0”から“1”に立ち上がる。なお、このフラグF
LG2は、オン/オフ指令EN2の“0”への立ち下が
り時に“0”に初期設定される。クロック信号CK1と
CK2とは、通常周期が異なり得る。
The clock supply circuit 12 has the same configuration as the above-described clock supply circuit 11, and receives a clock signal ck2 'supplied to an external clock input terminal 18, although not shown in the figure to avoid complication. The clock signal CK2 to the CPU 10 is supplied to the other input terminal of the switch 13 by passing through a built-in AND gate selectively opened by the on / off command EN2 and an inverter. A flag FLG2 indicating the presence / absence of the clock signal CK2 is provided by a built-in N-bit counter for counting the clock signal CK2 and a flip-flop for holding the carry signal C generated by the overflow.
Rises from “0” to “1”. This flag F
LG2 is initialized to "0" when the on / off command EN2 falls to "0". The clock signals CK1 and CK2 may have different normal periods.

【0013】クロック供給回路11は、オン/オフ制御
レジスタ14aに保持されるオン/オフ指令EN1が
“1”になると内蔵のアンドゲート11aが導通してク
ロック信号の供給動作を開始し、オン/オフ指令EN1
が“0”になると内蔵のアンドゲート11aが閉じられ
てクロック供給動作を停止する。これと同時に、Nビッ
トカウンタ11cとフリップフロップ11dがクリアさ
れる。同様に、クロック供給回路12は、オン/オフ制
御レジスタ14bに保持されるオン/オフ指令EN2が
“1”になると内蔵のアンドゲートが導通してクロック
信号の供給動作を開始し、オン/オフ指令EN2が
“0”になると内蔵のアンドゲートが閉じられてクロッ
ク供給動作を停止し,内蔵のNビットカウントとそのキ
ャリイ信号を受けるフリップフロップをクリアする。ク
ロック供給回路11,12内のNビットカウンタは、ク
ロック供給開始直後の不安定なクロック信号がCPU1
0に供給されるのを回避するため、N周期経過後に対応
のクロック信号CK1,CK2の存在をフラグFLG
1,FLG2の“0”から“1”への立ち上がりによっ
て表示するためのものである。
When the ON / OFF command EN1 held in the ON / OFF control register 14a becomes "1", the clock supply circuit 11 turns on the built-in AND gate 11a to start the operation of supplying a clock signal. OFF command EN1
Becomes "0", the built-in AND gate 11a is closed to stop the clock supply operation. At the same time, the N-bit counter 11c and the flip-flop 11d are cleared. Similarly, when the on / off command EN2 held in the on / off control register 14b becomes “1”, the clock supply circuit 12 turns on the built-in AND gate to start the clock signal supply operation and turn on / off. When the command EN2 becomes "0", the built-in AND gate is closed to stop the clock supply operation, and the flip-flop receiving the built-in N-bit count and its carry signal is cleared. The N-bit counters in the clock supply circuits 11 and 12 output an unstable clock signal immediately after the start of the clock supply.
0, the presence of the corresponding clock signals CK1 and CK2 is determined by the flag FLG after the elapse of N cycles.
1, for displaying by the rising of FLG2 from "0" to "1".

【0014】CPU10は、クロック供給回路11,1
2から出力されるフラグFLG1,FLG2を制御バス
16を介して読取ることにより、どのクロック信号が存
在中なのかを認識し、制御バス16と誤選択保護回路2
1とを介して選択制御レジスタ15に1ビットの選択指
令(sel)を書き込むことによってスイッチ13を切
り替え、クロック信号CK1,CK2の一方をCPUク
ロック信号として選択する。また、CPU10は、クロ
ック選択指令SELを制御バス16を介して読取ること
により、クロック供給回路11,12の出力のどちらが
CPUクロック信号として選択中であるかを認識し、制
御バス16と誤停止保護回路22とを介してオン/オフ
制御レジスタ14a,14bに1ビットのオン/オフ指
令(en1,en2)を書き込むことにより、必要なク
ロック供給回路の動作を開始もしくは継続させ、あるい
は不要なクロック供給回路の動作を停止させる。
The CPU 10 includes clock supply circuits 11, 1
By reading the flags FLG1 and FLG2 output from the control bus 16 via the control bus 16, it is possible to recognize which clock signal is present, and the control bus 16 and the erroneous selection protection circuit 2
The switch 13 is switched by writing a 1-bit selection command (sel) to the selection control register 15 via 1 to select one of the clock signals CK1 and CK2 as the CPU clock signal. Further, the CPU 10 reads the clock selection command SEL via the control bus 16 to recognize which of the outputs of the clock supply circuits 11 and 12 is being selected as the CPU clock signal. By writing 1-bit ON / OFF commands (en1, en2) to the ON / OFF control registers 14a, 14b via the circuit 22, the operation of the necessary clock supply circuit is started or continued, or unnecessary clock supply is performed. Stop the operation of the circuit.

【0015】誤動作保護回路20内の誤選択保護回路2
1は、CPU10のプログラム上の暴走やハードウエア
の誤動作などによって動作停止中のクロック供給回路の
出力が誤ってCPUクロック信号として選択されること
がないように保護するための回路である。この誤選択保
護回路21は、図2に示すように、アンドゲート31,
32,33と、オアゲート34と、インバータ35とか
ら構成されている。フラグFLG1の“1”/“0”に
よってクロック信号CK1の有/無が示されると共に、
フラグFLG2の“1”/“0”によってクロック信号
CK2の有/無が示される。また、選択指令selの
“0”によってCPU10によるクロック信号CK1の
選択が指令され、選択指令selの“1”によってCP
U10によるクロック信号CK2の選択が指令される。
信号SELは、この誤選択保護回路21から出力される
保護された選択指令であり、その“0”によっクロック
信号CK1の選択が指令され、その“1”によっクロッ
ク信号CK2の選択が指令される。
False selection protection circuit 2 in malfunction protection circuit 20
Reference numeral 1 denotes a circuit for protecting the output of the clock supply circuit whose operation is stopped due to a program runaway of the CPU 10 or a malfunction of hardware from being erroneously selected as a CPU clock signal. As shown in FIG. 2, the erroneous selection protection circuit 21 includes an AND gate 31,
32, 33, an OR gate 34, and an inverter 35. The presence / absence of the clock signal CK1 is indicated by “1” / “0” of the flag FLG1, and
The presence / absence of the clock signal CK2 is indicated by “1” / “0” of the flag FLG2. In addition, the selection of the clock signal CK1 by the CPU 10 is instructed by the selection command sel “0”, and the selection command sel “1” causes CP
The selection of the clock signal CK2 by U10 is instructed.
The signal SEL is a protected selection command output from the erroneous selection protection circuit 21. Selection of the clock signal CK1 is commanded by "0", and selection of the clock signal CK2 is commanded by "1". Is done.

【0016】図3は、図2の誤選択保護回路21によっ
て実現される入出力の信号の関係を示すものである。図
3を参照すれば、フラグFLG1が“1”でかつフラグ
FLG2が“0”の場合、すなわちクロック信号CK1
のみが存在する場合には、CPU10からの選択指令s
elの内容とは無関係に選択指令SEL’が“0”にな
り、これが選択制御レジスタ15に選択指令SELとし
て保持されることにより唯一存在するクロック信号CK
1の選択が指令される。これとは逆に、フラグFLG1
が“0”でかつフラグFLG2が“1”の場合、すなわ
ちクロック信号CK2のみが存在する場合には、CPU
10からの選択指令selの内容とは無関係に選択指令
SEL’が“1”になり、これが選択制御レジスタ15
に選択指令SELとして保持されることにより唯一存在
するクロック信号CK2の選択が指令される。また、フ
ラグFLG1とフラグFLG2が共に“1”の場合、す
なわちクロック信号CK1とCK2の双方が存在する場
合には、CPU10からの選択指令selの内容に従っ
た選択指令SEL’が出力され、これが選択制御レジス
タ15に選択指令SELとして保持される。
FIG. 3 shows the relationship between input and output signals realized by the erroneous selection protection circuit 21 of FIG. Referring to FIG. 3, when the flag FLG1 is "1" and the flag FLG2 is "0", that is, when the clock signal CK1
When only the command exists, the selection command s from the CPU 10
The selection command SEL ′ becomes “0” irrespective of the content of the signal “el”, and this is held in the selection control register 15 as the selection command SEL.
1 is instructed. Conversely, the flag FLG1
Is “0” and the flag FLG2 is “1”, that is, when only the clock signal CK2 exists, the CPU
The selection command SEL 'becomes "1" irrespective of the content of the selection command sel from the selector control register sel.
Is held as the selection command SEL, the selection of the only existing clock signal CK2 is commanded. When both the flag FLG1 and the flag FLG2 are “1”, that is, when both the clock signals CK1 and CK2 are present, the selection command SEL ′ according to the content of the selection command sel from the CPU 10 is output, and this is output. The selection control register 15 holds the selection command SEL.

【0017】このように、クロック信号CK1又はCK
2の一方のみが存在する場合には、唯一存在するクロッ
ク信号を選択するようにCPU10からの選択指令se
lが変更されるので、CPU10からの選択指令がプロ
グラム上の暴走やハードウエアの誤動作などによって存
在しないクロック信号を誤って選択してしまうことが有
効に防止される。
As described above, the clock signal CK1 or CK
If only one of the clock signals exists, a selection command se from the CPU 10 selects the only clock signal that exists.
Since 1 is changed, it is effectively prevented that the selection command from the CPU 10 erroneously selects a non-existent clock signal due to a program runaway or hardware malfunction.

【0018】誤動作保護回路20内の誤停止保護回路2
2は、CPU10のプログラム上の暴走やハードウエア
の誤動作などによってCPUクロック信号を供給中のク
ロック供給回路の動作を誤って停止させることがないよ
うに保護するための回路である。この誤停止保護回路2
2は、図4に示すように、オアゲート41,42と、イ
ンバータ43とから構成されている。en1の“1”/
“0”によってクロック供給回路11の動作の開始/停
止がCPU10によって指令され、en2の“1”/
“0”によってクロック供給回路12の動作の開始/停
止がCPU10によって指令される。
Erroneous stop protection circuit 2 in malfunction protection circuit 20
Reference numeral 2 denotes a circuit for protecting the operation of the clock supply circuit which is supplying the CPU clock signal from being erroneously stopped due to a program runaway of the CPU 10 or a malfunction of hardware. This false stop protection circuit 2
2 includes OR gates 41 and 42 and an inverter 43, as shown in FIG. “1” for en1 /
The start / stop of the operation of the clock supply circuit 11 is instructed by the CPU 10 by “0”, and “1” /
The CPU 10 instructs start / stop of the operation of the clock supply circuit 12 by “0”.

【0019】図5は、図4の誤停止保護回路22によっ
て実現される入出力の信号の関係を示すものである。図
5を参照すれば、選択指令SELが“0”の場合、すな
わちクロック信号CK1がCPUクロック信号として選
択中の場合には、CPU10からのオン/オフ指令en
lの内容とは無関係にオン/オフ指令EN1’は“1”
になり、これがオン/オフ制御レジスタ14aに保持さ
れることによりクロック供給回路11に対するオン/オ
フ指令EN1は“1”になる。また、CPUクロック信
号を供給していないクロック供給回路12に対するオン
/オフ指令EN2’(従ってEN2)はCPU10から
のオン/オフ制御指令に従って変更される。
FIG. 5 shows the relationship between input and output signals realized by the false stop protection circuit 22 of FIG. Referring to FIG. 5, when the selection command SEL is “0”, that is, when the clock signal CK1 is being selected as the CPU clock signal, the on / off command en from the CPU 10 is provided.
The ON / OFF command EN1 'is "1" regardless of the contents of l.
The ON / OFF command EN1 to the clock supply circuit 11 becomes "1" by being held in the ON / OFF control register 14a. Further, the on / off command EN2 ′ (and thus EN2) for the clock supply circuit 12 that does not supply the CPU clock signal is changed according to the on / off control command from the CPU 10.

【0020】逆に、選択指令SELが“1”の場合、す
なわちクロック信号CK2がCPUクロック信号として
選択中の場合には、CPU10からのオン/オフ指令e
n2の内容とは無関係にオン/オフ指令EN2’は
“1”になり、これがオン/オフ制御レジスタ15aに
保持されることによりクロック供給回路12に対するオ
ン/オフ指令EN2は“1”になる。また、CPUクロ
ック信号を供給していないクロック供給回路11に対す
るオン/オフ指令EN1はCPU10からのオン/オフ
制御指令に従って変更される。
Conversely, when the selection command SEL is "1", that is, when the clock signal CK2 is being selected as the CPU clock signal, the on / off command e from the CPU 10 is output.
The on / off command EN2 'becomes "1" irrespective of the content of n2, and is held in the on / off control register 15a, so that the on / off command EN2 for the clock supply circuit 12 becomes "1". The on / off command EN1 for the clock supply circuit 11 to which the CPU clock signal is not supplied is changed according to the on / off control command from the CPU 10.

【0021】このように、CPUクロック信号を供給中
のクロック供給回路に対するCPU10からのオン/オ
フ指令は、このクロック供給回路がCPUクロック信号
の供給を持続できるように誤停止保護回路22によって
変更される。この結果、CPU10からのオン/オフ指
令がプログラム上の暴走やハードウエアの誤動作などに
よってCPUクロック信号供給中のクロック供給回路の
動作を誤って停止させてしまうという不測の事態が有効
に防止される。
As described above, the ON / OFF command from the CPU 10 to the clock supply circuit supplying the CPU clock signal is changed by the erroneous stop protection circuit 22 so that the clock supply circuit can continue to supply the CPU clock signal. You. As a result, an unexpected situation in which the on / off command from the CPU 10 erroneously stops the operation of the clock supply circuit during the supply of the CPU clock signal due to a program runaway or a hardware malfunction may be effectively prevented. .

【0022】図6は、図1の回路に付加される異常動作
検出回路の構成の一例を示す回路図である。この異常動
作検出回路は、排他的論理和ゲート51,52,53
と、オアゲート54と、フリップフロップ55と、アン
ドゲート56とから構成されている。排他的論理和ゲー
ト51は、CPU10が発した選択指令selと誤選択
保護回路21から実際に出力された選択指令との不一致
が発生したこと、すなわち何らかの異常によって選択保
護回路21が機能したことを検出するとその出力を
“0”から“1”に立ち上げる。また、排他的論理和ゲ
ート52は、CPU10が発したオン/オフ指令enl
と誤停止保護回路22から実際に出力されたオン/オフ
指令EN1との不一致が発生したことを検出すると出力
を“0”から“1”に立ち上げる。更に、排他的論理和
ゲート53は、CPU10が発したオン/オフ指令en
2と誤停止保護回路22から実際に出力されたオン/オ
フ指令EN2との不一致を検出すると出力を“0”から
“1”に立ち上げる。
FIG. 6 is a circuit diagram showing an example of the configuration of the abnormal operation detection circuit added to the circuit of FIG. The abnormal operation detecting circuit includes exclusive OR gates 51, 52, 53
, An OR gate 54, a flip-flop 55, and an AND gate 56. The exclusive OR gate 51 determines that a mismatch has occurred between the selection command sel issued by the CPU 10 and the selection command actually output from the erroneous selection protection circuit 21, that is, that the selection protection circuit 21 has functioned due to some abnormality. Upon detection, the output rises from "0" to "1". The exclusive OR gate 52 is provided with an on / off command enl issued by the CPU 10.
When it is detected that a mismatch has occurred with the ON / OFF command EN1 actually output from the erroneous stop protection circuit 22, the output is raised from "0" to "1". Further, the exclusive OR gate 53 is provided with an on / off command en issued by the CPU 10.
2 is detected, the output is raised from “0” to “1” when a mismatch between the ON / OFF command EN2 actually output from the false stop protection circuit 22 is detected.

【0023】排他的論理和ゲート51,52,53の一
つから出力される不一致検出信号“1”は、オアゲート
54を通してフリップフロップ55に供給され、CPU
10が制御バス16を介して発したライト指令Wによっ
てこのフリップフロップ55に保持され、何らかの原因
による異常動作の発生を示す信号ERとして制御バス1
6上に出力される。この信号ERは、CPU10が選択
指令selやオン/オフ指令en1,en2を発するた
びに制御バス16上に出力される割り込み許可信号IN
TENによって開かれるアンドゲート56を通して、C
PU10に対する割り込み要求INTを発生する。この
割り込み要求INTを受け付たCPU10は、適宜な自
己診断ルーチンを実行することにより、上記不一致が生
じた異常動作の原因を究明し、必要に応じて内部データ
などを変更する。このように、図6の回路を付加するこ
とにより、誤動作保護回路20が機能したことをCPU
10に通知することができ、必要な診断を行う機会をC
PU10に与えることができる。
The mismatch detection signal "1" output from one of the exclusive OR gates 51, 52, 53 is supplied to a flip-flop 55 through an OR gate 54, and is supplied to the CPU.
10 is held in the flip-flop 55 by a write command W issued via the control bus 16, and is supplied to the control bus 1 as a signal ER indicating occurrence of abnormal operation due to some cause.
6 is output. This signal ER is generated by an interrupt enable signal IN output on the control bus 16 each time the CPU 10 issues a selection command sel or on / off commands en1 and en2.
Through AND gate 56 opened by TEN, C
An interrupt request INT to the PU 10 is generated. The CPU 10 that has received the interrupt request INT executes an appropriate self-diagnosis routine to determine the cause of the abnormal operation in which the mismatch has occurred, and changes internal data and the like as necessary. Thus, by adding the circuit of FIG. 6, the fact that the malfunction protection circuit 20 has functioned can be determined by the CPU.
10 and the opportunity to make the necessary diagnosis
PU10.

【0024】以上、好適には誤選択保護回路21と誤停
止保護回路22の双方を設置する構成を例示した。しか
しながら、回路規模の低減などの目的から上記保護回路
のいずれか一方だけを設置することによっても従来回路
に比べれば誤動作の発生確率を低減できる。
In the above, the configuration in which both the erroneous selection protection circuit 21 and the erroneous stop protection circuit 22 are preferably provided has been exemplified. However, by providing only one of the above protection circuits for the purpose of reducing the circuit scale, etc., the probability of occurrence of a malfunction can be reduced as compared with the conventional circuit.

【0025】また、クロック供給回路が2個の場合につ
いて本発明を例示したが、一般にはクロック供給回路が
3個以上である場合にも本発明を適用できる。
Although the present invention has been described with respect to the case where there are two clock supply circuits, the present invention can be generally applied to a case where there are three or more clock supply circuits.

【0026】[0026]

【発明の効果】本発明に係わるCPUクロック選択供給
回路の誤動作保護回路は、上述のような構成であるか
ら、CPUのプログラム上の暴走やハードウエア回路の
誤動作によってCPUクロック信号が断たれてしまう事
態が有効に回避される。
Since the malfunction protection circuit of the CPU clock selection supply circuit according to the present invention has the above-described configuration, the CPU clock signal is cut off due to a runaway in the CPU program or malfunction of the hardware circuit. The situation is effectively avoided.

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

【図1】本発明の一実施例の誤動作保護回路の構成を保
護対象のクロック選択供給回路とこの選択供給回路から
クロック信号の供給を受けるCPUと共に示すブロック
図である。
FIG. 1 is a block diagram showing a configuration of a malfunction protection circuit according to an embodiment of the present invention, together with a clock selection supply circuit to be protected and a CPU receiving a clock signal from the selection supply circuit;

【図2】図1の誤選択保護回路21の構成の一例を示す
回路図である。
FIG. 2 is a circuit diagram showing an example of a configuration of an erroneous selection protection circuit 21 of FIG.

【図3】図2の論理回路図の論理関係を示す概念図であ
る。
FIG. 3 is a conceptual diagram showing a logical relationship of the logic circuit diagram of FIG. 2;

【図4】図1の誤停止保護回路22の構成の一例を示す
回路図である。
FIG. 4 is a circuit diagram showing an example of a configuration of an erroneous stop protection circuit 22 of FIG. 1;

【図5】図4の論理回路の論理関係を示す概念図であ
る。
FIG. 5 is a conceptual diagram showing a logical relationship of the logic circuit of FIG.

【図6】図1に付加される異常動作発生検出回路の構成
の一例を示す回路図である。
FIG. 6 is a circuit diagram showing an example of a configuration of an abnormal operation occurrence detection circuit added to FIG. 1;

【図7】従来のクロック選択供給回路の構成をCPUと
共にブロック図である。
FIG. 7 is a block diagram showing a configuration of a conventional clock selection supply circuit together with a CPU.

【符号の説明】[Explanation of symbols]

10 CPU 11,12 クロック供給回路 14a,14b オン/オフ制御レジスタ 15 選択制御レジスタ 16 制御バス 20 誤動作保護回路 21 誤選択保護回路 22 誤停止保護回路 10 CPU 11,12 Clock supply circuit 14a, 14b ON / OFF control register 15 Selection control register 16 Control bus 20 Malfunction protection circuit 21 False selection protection circuit 22 False stop protection circuit

───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.6,DB名) G06F 1/04 - 1/14 ──────────────────────────────────────────────────続 き Continuation of front page (58) Field surveyed (Int.Cl. 6 , DB name) G06F 1/04-1/14

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】CPUと、このCPUに供給するためのク
ロック信号の出力端子を有する複数のクロック供給回路
と、前記各クロック供給回路に動作の開始/停止を指令
するために前記CPUから供給されるオン/オフ指令を
保持するオン/オフ制御レジスタと、前記各クロック供
給回路の出力端子におけるクロック信号の有無を検出し
その有無を示すフラグとして保持するクロック有無検出
手段と、前記各クロック供給回路の出力端子の一つを選
択して前記CPUのクロック信号入力端子に接続するス
イッチ手段と、このスイッチ手段に前記選択動作を指令
するために前記CPUから供給される選択指令を保持す
る選択制御レジスタとを備えたCPUクロック選択供給
回路を誤動作から保護するための回路であって、 前記選択制御レジスタの前段に設置され、前記クロック
有無検出手段に保持中のクロック信号の有無を示すフラ
グの組合せに基づき前記CPUから供給される選択指令
が存在しないクロック信号を選択させようとする場合に
は、存在するクロック信号を選択させるようにこの選択
指令を変更して前記選択制御レジスタに供給する誤選択
保護回路と、 前記オン/オフ制御レジスタの前段に設置され、前記選
択制御レジスタに保持中の選択指令に基づき前記CPU
から供給されるオン/オフ指令が選択中のクロック信号
を出力しているクロック供給回路の動作を停止させよう
とする場合には、その動作を継続させるようにこのオン
/オフ指令を変更して前記オン/オフ制御レジスタに供
給する誤停止保護回路との一方又は双方を備えたことを
特徴とするCPUクロック選択供給回路の誤動作保護回
路。
1. A CPU, a plurality of clock supply circuits each having an output terminal for a clock signal to be supplied to the CPU, and a clock signal supplied from the CPU to instruct each of the clock supply circuits to start / stop operation. An on / off control register for holding an on / off command, a clock presence / absence detection means for detecting the presence / absence of a clock signal at an output terminal of each clock supply circuit, and holding as a flag indicating the presence / absence of the clock signal, Switch means for selecting one of the output terminals and connecting to the clock signal input terminal of the CPU, and a selection control register for holding a selection command supplied from the CPU for instructing the switch means for the selection operation. A circuit for protecting the CPU clock selection supply circuit from malfunctioning, comprising: A clock signal that is provided at the previous stage and exists when there is an attempt to select a clock signal for which there is no selection command supplied from the CPU based on a combination of flags indicating the presence / absence of a clock signal held by the clock presence / absence detection means. An erroneous selection protection circuit that changes this selection command so as to select a clock signal and supplies it to the selection control register; and a selection command provided before the on / off control register and held in the selection control register. Based on the CPU
In order to stop the operation of the clock supply circuit that is outputting the clock signal selected by the on / off command supplied from the CPU, the on / off command is changed so that the operation is continued. A malfunction protection circuit for a CPU clock selection / supply circuit, comprising: one or both of a malfunction stop protection circuit supplied to the on / off control register.
【請求項2】 請求項1において、 前記CPUから供給される選択指令についての前記変更
の有無と、前記CPUから供給されるオン/オフ指令に
ついての前記変更の有無の少なくとも一方を検出し前記
CPUに通知する手段を備えたことを特徴とするCPU
クロック選択供給回路の誤動作保護回路。
2. The CPU according to claim 1, wherein at least one of the presence or absence of the change in the selection command supplied from the CPU and the presence or absence of the change in the on / off command supplied from the CPU is detected. CPU provided with means for notifying to CPU
Malfunction protection circuit for clock selection supply circuit.
JP4297618A 1992-10-09 1992-10-09 Malfunction protection circuit of CPU clock selection supply circuit Expired - Fee Related JP2899610B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4297618A JP2899610B2 (en) 1992-10-09 1992-10-09 Malfunction protection circuit of CPU clock selection supply circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4297618A JP2899610B2 (en) 1992-10-09 1992-10-09 Malfunction protection circuit of CPU clock selection supply circuit

Publications (2)

Publication Number Publication Date
JPH06124135A JPH06124135A (en) 1994-05-06
JP2899610B2 true JP2899610B2 (en) 1999-06-02

Family

ID=17848892

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4297618A Expired - Fee Related JP2899610B2 (en) 1992-10-09 1992-10-09 Malfunction protection circuit of CPU clock selection supply circuit

Country Status (1)

Country Link
JP (1) JP2899610B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001142559A (en) 1999-11-17 2001-05-25 Mitsubishi Electric Corp Microcomputer

Also Published As

Publication number Publication date
JPH06124135A (en) 1994-05-06

Similar Documents

Publication Publication Date Title
US4752930A (en) Watch dog timer
US5440603A (en) Watch-dog timer circuit and a microcomputer equipped therewith
EP0679981A2 (en) Reset circuit of electronic device
EP0715259B1 (en) Watchdog timer lock-up prevention circuit
US7149915B2 (en) Microcomputer using a shared counter
JP3460736B2 (en) Clock control circuit
JP2899610B2 (en) Malfunction protection circuit of CPU clock selection supply circuit
US5546588A (en) Method and apparatus for preventing a data processing system from entering a non-recoverable state
US5349669A (en) Data write control means
US7454649B2 (en) Marginless status determination circuit
JP2734243B2 (en) Watchdog timer
EP0406442B1 (en) Data write control means
JP2928418B2 (en) Semiconductor integrated circuit
KR100442290B1 (en) A circuit for controlling program counter
JPH01319834A (en) Data processor
JP3752970B2 (en) One-chip microcomputer device having a normal operation mode and a plurality of low power consumption operation modes
JP3216200B2 (en) Data memory write control circuit
JP2994642B2 (en) Data processing device
JPH05151027A (en) Watch dog timer
JPH063423A (en) Semiconductor circuit
JPS6158064A (en) Micorprocessor control system having memory writing protecting function
JP2001101019A (en) Register protecting circuit
JP2000172535A (en) Controller
JPH05241966A (en) Memory controller
JPH0743258A (en) Failure detector for event driven type processor

Legal Events

Date Code Title Description
R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080319

Year of fee payment: 9

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090319

Year of fee payment: 10

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100319

Year of fee payment: 11

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100319

Year of fee payment: 11

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110319

Year of fee payment: 12

LAPS Cancellation because of no payment of annual fees