JP2814800B2 - Microcomputer - Google Patents

Microcomputer

Info

Publication number
JP2814800B2
JP2814800B2 JP3314983A JP31498391A JP2814800B2 JP 2814800 B2 JP2814800 B2 JP 2814800B2 JP 3314983 A JP3314983 A JP 3314983A JP 31498391 A JP31498391 A JP 31498391A JP 2814800 B2 JP2814800 B2 JP 2814800B2
Authority
JP
Japan
Prior art keywords
stop
signal
watchdog timer
instruction
interrupt
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
JP3314983A
Other languages
Japanese (ja)
Other versions
JPH05257751A (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.)
NEC Corp
Original Assignee
NEC Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NEC Corp filed Critical NEC Corp
Priority to JP3314983A priority Critical patent/JP2814800B2/en
Publication of JPH05257751A publication Critical patent/JPH05257751A/en
Application granted granted Critical
Publication of JP2814800B2 publication Critical patent/JP2814800B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Microcomputers (AREA)

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、マイクロコンピュータ
に関し、特にマイクロコンピュータのシステム異常を検
出するウォッチドッグタイマに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microcomputer, and more particularly to a watchdog timer for detecting a microcomputer abnormality.

【0002】[0002]

【従来の技術】従来のマイクロコンピュータには、プロ
グラムの暴走及びシステムの異常等に対処するためのウ
ォッチドッグタイマを内蔵しているものがある。
2. Description of the Related Art Some conventional microcomputers have a built-in watchdog timer for coping with program runaway and system abnormalities.

【0003】ウォッチドッグタイマはカウント値のクリ
ア手段を備え、カウント値のオーバーフロー情報を出力
するカウンタにより構成される。ウォッチドッグタイマ
のカウンタスタート命令を実行してカウントをスタート
させ、カウント値がオーバーフローする前に、プログラ
ムの流れの中でウォッチドッグタイマのカウント値をク
リアする命令(以下ウォッチドッグタイマ・クリア命令
と記す)を実行することにより、ウォッチドッグタイマ
のカウント値をオーバーフローさせないことで、プログ
ラムが正常に動作していることを確認するものである。
プログラムの暴走及びシステムの異常等が発生し、ウォ
ッチドッグタイマ・クリア命令が実行されないときは、
カウント値のオーバーフローを生じ、マイクロコンピュ
ータの中央処理装置(以下、CPUと記す)がウォッチ
ドッグタイマのカウント値のオーバーフローを検出し、
異常等に対する処理ルーチンを実行することで、ユーザ
ーはマイクロコンピュータのシステム全体の信頼度を高
めることができる。
[0003] The watchdog timer is provided with a counter for clearing the count value and is constituted by a counter which outputs overflow information of the count value. Executes the watchdog timer counter start instruction to start counting, and clears the watchdog timer count value in the program flow before the count value overflows (hereinafter referred to as the watchdog timer clear instruction). ) Is executed to prevent the count value of the watchdog timer from overflowing, thereby confirming that the program is operating normally.
If a program runaway or system error occurs and the watchdog timer clear instruction is not executed,
An overflow of the count value occurs, and a central processing unit (hereinafter referred to as a CPU) of the microcomputer detects an overflow of the count value of the watchdog timer,
By executing a processing routine for an abnormality or the like, the user can increase the reliability of the entire microcomputer system.

【0004】更に、ウォッチドッグタイマ・クリア命令
は、プログラムの暴走によって不用意にカウント値のク
リアがかからないように、特殊なコード構成を取ってい
る場合がある。例えば、 RSTWDT #imm8(1),#imm8
(2) という構成をとるウォッチドッグタイマ・クリア命令
は、2バイト命令で3バイト目と4バイト目のオペレー
ションコード、#imm8(1)と#imm8(2)が
お互いに補数であるときに、ウォッチドッグタイマのカ
ウント値をクリアする方法をとっている。プログラムの
暴走等により3バイト目と4バイト目のオペレーション
コードがお互に補数でない場合は、ソフトウェア割込み
が発生し、CPUが異常に対する処理ルーチンを実行す
る。
Further, the watchdog timer clear instruction may have a special code configuration so that the count value is not inadvertently cleared due to a program runaway. For example, RSTWDT # imm8 (1), # imm8
The watchdog timer clear instruction having the configuration of (2) is a 2-byte instruction, and when the operation codes of the third and fourth bytes are # imm8 (1) and # imm8 (2) are complements of each other, The watchdog timer count value is cleared. If the third and fourth byte operation codes are not complements due to a program runaway or the like, a software interrupt occurs, and the CPU executes a processing routine for the abnormality.

【0005】また、マイクロコンピュータは低消費電力
を図るスタンバイ機能として、システムクロックを停止
させるSTOP状態がある。STOP命令を実行するこ
とにより、全てのクロックが停止し、応用システム全体
が停止してSTOP状態となる。STOP状態に入った
ウォッチドッグタイマはカウントを停止する。
The microcomputer has a STOP state in which a system clock is stopped as a standby function for reducing power consumption. Executing the STOP instruction stops all clocks, stops the entire application system, and enters the STOP state. The watchdog timer that has entered the STOP state stops counting.

【0006】図5は従来のマイクロコンピュータの構成
例を示すブロック図である。図5のマイクロコンピュー
タは、システム全体を制御するCPU1と、割込みを制
御する割込み制御回路2と、システムクロック30を発
生するクロック発生回路3と、スタンバイ機能を制御す
るスタンバイ機能制御回路5bと、プログラムの異常を
検出するウォッチドッグタイマ6とを有する。
FIG. 5 is a block diagram showing a configuration example of a conventional microcomputer. The microcomputer shown in FIG. 5 includes a CPU 1 for controlling the entire system, an interrupt control circuit 2 for controlling an interrupt, a clock generation circuit 3 for generating a system clock 30, a standby function control circuit 5b for controlling a standby function, and a program. And a watchdog timer 6 for detecting an abnormality in.

【0007】CPU1は、STOP命令を実行すること
を示すSTOPオーダー32をスタンバイ制御回路5b
へ出力する。割込み制御回路2は割込みを受けて、CP
U1へ割込みが発生したことを知らせる割込み発生信号
31を出力する。クロック発生回路3は、各機能ブロッ
クへシステムクロックを出力する。スタンバイ機能制御
回路5bは、STOP状態を起動するSTOP_A信号
37をクロック発生回路3へ出力する。
[0007] The CPU 1 sends a STOP order 32 indicating execution of a STOP instruction to the standby control circuit 5b.
Output to The interrupt control circuit 2 receives the interrupt and
An interrupt generation signal 31 for notifying U1 that an interrupt has occurred is output. The clock generation circuit 3 outputs a system clock to each functional block. The standby function control circuit 5b outputs a STOP_A signal 37 for activating the STOP state to the clock generation circuit 3.

【0008】マイクロコンピュータがSTOP状態に入
る時は、CPU1はSTOP命令を解読して、STOP
オーダ32を”1”にする。STOPオーダ32を入力
したスタンバイ制御回路5bは、STOP_A信号37
を”1”とする。STOP_A信号37を入力したクロ
ック発生回路3は、システムクロック30を停止する。
システムクロック30を入力してカウント動作をしてい
るウォッチドッグタイマ6は、カウントを停止する。
When the microcomputer enters the STOP state, the CPU 1 decodes the STOP instruction and
The order 32 is set to “1”. The standby control circuit 5b having received the STOP order 32 outputs the STOP_A signal 37.
Is “1”. The clock generation circuit 3 that has received the STOP_A signal 37 stops the system clock 30.
The watchdog timer 6 that performs the counting operation by inputting the system clock 30 stops counting.

【0009】通常使用状態で、CPU1がウォッチドッ
グタイマ・クリア命令を実行して、ウォッチドッグタイ
マ・クリア信号37を”1”にすると、ウォッチドッグ
タイマ6のカウント値をクリアし、カウントを再開す
る。CPU1がウォッチドッグタイマ・クリア命令を読
み出したときに、プログラムの暴走等により、命令コー
ドが特殊なコード構成をとることができないときは、ソ
フトウェア割込みが発生する。このソフトウェア割込み
によって、CPU1がプログラムの異常に対処する。
In a normal use state, when the CPU 1 executes the watchdog timer clear instruction to set the watchdog timer clear signal 37 to "1", the count value of the watchdog timer 6 is cleared and the count is restarted. . If the instruction code cannot take a special code configuration due to a program runaway when the CPU 1 reads the watchdog timer clear instruction, a software interrupt occurs. With this software interrupt, the CPU 1 responds to a program error.

【0010】[0010]

【発明が解決しようとする課題】上述した従来のマイク
ロコンピュータでは、ウォッチドッグタイマのカウント
値がオーバーフローしないように、プログラム中に特殊
なプログラム構成をとるウォッチドッグタイマ・クリア
命令を挿入することで、CPUがプログラムの暴走に対
処できるようになっている。しかしながら、ウォッチド
ッグタイマ・クリア命令を実行する前に、プログラムの
暴走によりSTOP命令が実行されてSTOP状態に入
ると、ウォッチドッグタイマはカウントを停止してしま
うので、プログラムが正常に動作していないことをウォ
ッチドッグタイマのカウント値のオーバーフローによっ
て検出することができない。また、他の手段を用いて、
プログラムの暴走を検出することもできない。
In the above-mentioned conventional microcomputer, a watchdog timer clear instruction having a special program configuration is inserted into a program so that the count value of the watchdog timer does not overflow. The CPU can deal with runaway of the program. However, if the STOP instruction is executed due to the program runaway and the STOP state is entered before the watchdog timer clear instruction is executed, the watchdog timer stops counting, and the program is not operating normally. Cannot be detected by overflow of the count value of the watchdog timer. Also, using other means,
Nor can it detect program runaway.

【0011】本発明はかかる問題点に鑑みてなされたも
のであって、プログラムの暴走等により本来期待されて
いないSTOP命令が実行されてしまう前にCPUがシ
ステムの異常を検出し、更に、前記プログラムの暴走等
に対処できるマイクロコンピュータを提供することを目
的とする。
The present invention has been made in view of such a problem, and a CPU detects a system abnormality before a STOP instruction which is not originally expected is executed due to a runaway of a program or the like, and It is an object of the present invention to provide a microcomputer capable of coping with runaway of a program.

【0012】[0012]

【課題を解決するための手段】本発明に係るマイクロコ
ンピュータは、中央処理装置と、割込みを制御する割込
み制御回路と、システム全体にシステムクロックを供給
するクロック発生回路と、低消費電力を実現するための
スタンバイ制御回路と、ウォッチドッグタイマを有する
マイクロコンピュータにおいて、ウォッチドッグタイマ
のカウント値をクリアする命令の直後にSTOP命令が
実行したことを記憶する記憶回路と、前記記憶回路の内
容とスタンバイ状態を起動させる信号とのレベルを比較
する手段と、前記比較手段の結果が一致する時はスタン
バイ状態に入り、一致しない時は割込み処理を要求する
手段とを備えたことを特徴とする。
A microcomputer according to the present invention realizes a central processing unit, an interrupt control circuit for controlling an interrupt, a clock generation circuit for supplying a system clock to the entire system, and low power consumption. Control circuit, a microcomputer having a watchdog timer, and a storage circuit for storing that the STOP instruction is executed immediately after the instruction for clearing the count value of the watchdog timer, and the contents of the storage circuit and the standby state And a means for comparing the level with a signal for activating the program, and a means for entering a standby state when the result of the comparing means matches, and for requesting an interrupt processing when the result does not match.

【0013】[0013]

【作用】本発明のマイクロコンピュータにおいては、ス
タンバイ制御回路5aは、STOP命令でSTOP状態
を起動するSTOP_A信号37を”1”にする。ウォ
ッチドッグタイマ・クリア命令とSTOP命令が連続し
て実行されたときにSRフリップフロップ13の出力
が”1”になる。SRフリップフロップ13とSTOP
_A信号37が共に”1”である場合は、STOP_B
信号38を”1”にし、クロック発生回路3にシステム
クロックの発生を停止させる。SRフリップフロップ1
3が”0”でSTOP_A信号37が”1”である場合
は、割込み要求信号35aが”1”となる。また、クロ
ック発生回路3がシステムクロックを停止しない。
In the microcomputer according to the present invention, the standby control circuit 5a sets the STOP_A signal 37 which activates the STOP state by a STOP instruction to "1". When the watchdog timer clear instruction and the STOP instruction are executed successively, the output of the SR flip-flop 13 becomes "1". SR flip-flop 13 and STOP
If both _A signals 37 are “1”, STOP_B
The signal 38 is set to "1" to cause the clock generation circuit 3 to stop generating the system clock. SR flip-flop 1
When 3 is "0" and the STOP_A signal 37 is "1", the interrupt request signal 35a becomes "1". Further, the clock generation circuit 3 does not stop the system clock.

【0014】従って、本来期待されないSTOP命令が
実行されてもウォッチドッグタイマが停止することな
く、ウォッチドッグタイマのカウント値のオーバーフロ
ーによってシステムの異常を検出することができる。
Therefore, even if a STOP instruction that is not expected is executed, the watchdog timer does not stop, and an abnormality in the system can be detected by overflow of the count value of the watchdog timer.

【0015】[0015]

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

【0016】図1は、本発明の実施例に係るマイクロコ
ンピュータを示すブロック図である。図1に示すマイク
ロコンピュータは、システム全体を制御するCPU1
と、各割込みを処理する割込み制御回路2と、システム
クロック30を発生するクロック発生回路3と、ウォッ
チドッグタイマ・クリア命令とSTOP命令が連続して
実行されたことを検出するSTOP信号制御回路4a
と、スタンバイ機能を制御するスタンバイ制御回路5a
とを有する。
FIG. 1 is a block diagram showing a microcomputer according to an embodiment of the present invention. The microcomputer shown in FIG. 1 has a CPU 1 for controlling the entire system.
An interrupt control circuit 2 for processing each interrupt; a clock generation circuit 3 for generating a system clock 30; and a STOP signal control circuit 4a for detecting that a watchdog timer clear instruction and a STOP instruction are continuously executed.
And a standby control circuit 5a for controlling a standby function
And

【0017】CPU1は、STOP信号制御回路4aへ
ウォッチドッグタイマ・クリア信号37と各実行命令の
終了を示すエンド信号34と、STOP信号制御回路4
aの情報を初期化するリセット信号33と、スタンバイ
制御回路5aに対しSTOP命令を実行することを示す
STOPオーダ32とを出力し、また、スタンバイ制御
回路5aへSTOPオーダ32を出力している。割込み
制御回路2は、CPU1へ割込み処理を要求する割込み
発生信号31を出力している。クロック発生回路3は、
各機能へシステムクロック30を出力している。STO
P信号制御回路4aは、論理積ゲート(以下ANDゲー
トと記す)24へSTOP_A信号37を制御するST
OP許可信号36を出力する。ANDゲート24は、ク
ロック発生回路3へSTOP状態を起動させるSTOP
_B信号38を出力し、また、スタンバイ制御回路5a
へSTOP_A信号37と比較するためにSTOP_B
信号38を出力する。
The CPU 1 sends to the STOP signal control circuit 4a a watchdog timer clear signal 37, an end signal 34 indicating the end of each execution instruction, and a STOP signal control circuit 4a.
It outputs a reset signal 33 for initializing the information a, a STOP order 32 indicating that the STOP command is to be executed to the standby control circuit 5a, and outputs the STOP order 32 to the standby control circuit 5a. The interrupt control circuit 2 outputs an interrupt generation signal 31 for requesting the CPU 1 to perform an interrupt process. The clock generation circuit 3
The system clock 30 is output to each function. STO
The P signal control circuit 4a controls the AND gate 24 (hereinafter referred to as an AND gate) 24 to control the STOP_A signal 37
An OP permission signal 36 is output. The AND gate 24 causes the clock generation circuit 3 to activate the STOP state.
_B signal 38, and the standby control circuit 5a
STOP_B to compare with STOP_A signal 37
The signal 38 is output.

【0018】STOP信号制御回路4aの内部は、ウォ
ッチドッグタイマ6と、CPU1が出力したウォッチド
ッグタイマ・クリア信号37を入力するSRフリップフ
ロップ(以下SRF/Fと記す)11と、1命令実行毎の
終了タイミングを示すエンド信号34とSRF/F11の
出力を入力するANDゲート21と、ANDゲート21
の出力を入力するSRF/F12と、SRF/F12の信号を
遅延させるディレイ回路27と、エンド信号34とディ
レイ回路27の出力とリセット信号33を入力するAN
DORゲート22と、SRF/F12の出力とSTOPオ
ーダー32を入力するANDゲート23と、ANDゲー
ト23の出力を入力するSRF/F13で構成される。
The STOP signal control circuit 4a includes a watchdog timer 6, an SR flip-flop (hereinafter referred to as SRF / F) 11 for inputting a watchdog timer clear signal 37 output from the CPU 1, and an instruction for each instruction execution. AND gate 21 that inputs an end signal 34 indicating the end timing of the SRF / F11 and the output of the SRF / F11,
, The delay circuit 27 for delaying the signal of the SRF / F12, the end signal 34, the output of the delay circuit 27, and the input of the reset signal 33.
It comprises a DOR gate 22, an AND gate 23 for inputting the output of the SRF / F12 and the STOP order 32, and an SRF / F13 for inputting the output of the AND gate 23.

【0019】SRF/F13の出力であるSTOP許可信
号36はスタンバイ制御回路5aが出力したSTOP_
A信号37と共にANDゲート24に入力されている。
The STOP permission signal 36 which is the output of the SRF / F 13 is a STOP_ signal output from the standby control circuit 5a.
The signal is input to the AND gate 24 together with the A signal 37.

【0020】スタンバイ制御回路5аは、STOP_Α
信号とSTOP_Β信号38を比較して一致しない時は
割込み要求信号35aを″1″にする機能が従来のスタ
ンバイ制御回路5bに追加してある。STOP_Α信号
37とSTOP_Β信号38が一致するときは、スタン
バイ制御回路5aは、割込み要求信号35aを″0″に
したままである。
The standby control circuit 5 、
The function of setting the interrupt request signal 35a to "1" when the signal and the STOP_ # signal 38 do not match is added to the conventional standby control circuit 5b. When the STOP_ # signal 37 matches the STOP_ # signal 38, the standby control circuit 5a keeps the interrupt request signal 35a at "0".

【0021】図2及び図3は、プログラムの暴走がない
場合におけるウォッチドッグタイマ・クリア命令とST
OP命令を実行したときのタイミング図である。図2
は、ウォッチドッグタイマ・クリア 命令を実行した直
後にSTOP命令を実行した場合で、STOP状態に入
る条件である。これに対し、図3は、ウォッチドッグタ
イマ・クリア 命令を実行した直後にSTOP以外の命
令(例としてNOP命令)を実行し、その後にSTOP
命令を実行した場合で、STOP状態に入れない条件で
ある。
FIGS. 2 and 3 show a watchdog timer clear instruction and ST when there is no program runaway.
FIG. 7 is a timing chart when an OP instruction is executed. FIG.
Is a condition for entering the STOP state when the STOP instruction is executed immediately after the watchdog timer clear instruction is executed. On the other hand, in FIG. 3, an instruction other than the STOP (for example, a NOP instruction) is executed immediately after the watchdog timer clear instruction is executed, and thereafter the STOP is executed.
This is a condition in which the STOP state cannot be entered when the instruction is executed.

【0022】図2及び図3におけるWDTはウォッチド
ッグタイマ・クリア命令、STOPはSTOP命令を表
わす。実行サイクルは各命令の実行期間を示す。
In FIGS. 2 and 3, WDT denotes a watchdog timer clear instruction, and STOP denotes a STOP instruction. The execution cycle indicates the execution period of each instruction.

【0023】図1と図2を用いて、マイクロコンピュ−
タがSTOP状態に入る場合について説明する。CPU
1が予めリセット信号33で初期化し、SRF/F11,
12,13の出力の初期値は、いずれも" 0" である。
ウォッチドッグタイマ・クリア 信号37が" 1" にな
ると、SRF/F11は" 1" にセットされる。次にウォ
ッチドッグタイマ・クリア命令実行時のエンド信号34
が”1”になると、ANDゲート21の出力は”1”と
なり、SRF/F12を”1”にセットする。SRF/F12
の”1”である出力はディレイ回路27によって遅延さ
れ、ANDORゲート22に入力する。STOPオーダ
ー32が”1”になると、ANDゲート23の出力は”
1”となって、SRF/F13を”1”にセットする。S
TOP命令実行時にエンド信号34が”1”になると、
ANDORゲート22の出力は”1”となって、SRF/
F11とSRF/F12を”0”にリセットする。STOP
_Α信号37が”1”になると、SRF/F13の出力で
あるSTOP許可信号36は”1”であるので、AND
ゲート24の出力STOP_B信号38が”1”とな
り、クロック発生回路3がシステムクロック30の発生
を停止する。
Referring to FIG. 1 and FIG.
The case where the data enters the STOP state will be described. CPU
1 is initialized by a reset signal 33 in advance, and SRF / F11,
The initial values of the outputs 12 and 13 are both "0".
When the watchdog timer clear signal 37 becomes "1", the SRF / F11 is set to "1". Next, the end signal 34 when the watchdog timer clear instruction is executed
Becomes "1", the output of the AND gate 21 becomes "1", and the SRF / F12 is set to "1". SRF / F12
Is delayed by the delay circuit 27 and input to the ANDOR gate 22. When the STOP order 32 becomes “1”, the output of the AND gate 23 becomes “1”.
It becomes "1", and sets the SRF / F13 to "1".
When the end signal 34 becomes “1” during execution of the TOP instruction,
The output of the ANDOR gate 22 becomes "1" and SRF /
F11 and SRF / F12 are reset to "0". STOP
When the _ $ signal 37 becomes "1", the STOP permission signal 36 which is the output of the SRF / F 13 is "1".
The output STOP_B signal 38 of the gate 24 becomes "1", and the clock generation circuit 3 stops generating the system clock 30.

【0024】一方、スタンバイ制御回路5aはSTOP
_Α信号37とSTOP_B信号38とを比較するが、
この場合両者が一致しているので、STOP要求割込み
信号35aを”0”のままとする。従って、マイクロコ
ンピュータはSTOP状態に入る。なお、STOP状態
解除時に、CPU1はリセット信号33でSRF/F13
を”0”にリセットする。
On the other hand, the standby control circuit 5a
_Α signal 37 and STOP_B signal 38 are compared,
In this case, since they match, the STOP request interrupt signal 35a is kept at "0". Therefore, the microcomputer enters the STOP state. When the STOP state is released, the CPU 1 sends the reset signal 33 to the SRF / F 13
Is reset to “0”.

【0025】次に、図1と図3を用いてマイクロコンピ
ュータがSTOP状態に入れない場合について説明す
る。CPU1が予めリセット信号33で初期化し、SR
F/F11,12,13の出力の初期値はいずれも”0”
である。ウォッチドッグタイマ・クリア信号37が”
1”になると、SRF/F11は”1”にセットされる。
次にウォッチドッグタイマ・クリア命令実行後のエンド
信号34が”1”になると、ANDゲート21は”1”
となり、SRF/F12を”1”にセットする。SRF/F1
2の”1”である出力はディレイ回路27によって遅延
され、ANDORゲート22に入力する。NOP命令実
行時にエンド信号34が”1”になると、ANDORゲ
ート22の出力は”1”となって、SRF/F11とSRF
/F12を”0”にリセットする。STOPオーダ32
が”1”になっても、SRF/F12の出力は”0”であ
るので、ANDゲート23の出力は”0”となり、SR
F/F13の出力であるSTOP許可信号36は”0”の
ままである。STOP_Α信号37が”1”になっても
ANDゲート24の出力であるSTOP_B信号38
は”0”のままである。
Next, a case where the microcomputer cannot enter the STOP state will be described with reference to FIGS. The CPU 1 initializes in advance with a reset signal 33,
The initial values of the outputs of F / Fs 11, 12, and 13 are all "0"
It is. Watchdog timer clear signal 37
When it becomes "1", the SRF / F11 is set to "1".
Next, when the end signal 34 after executing the watchdog timer clear instruction becomes “1”, the AND gate 21 becomes “1”.
And the SRF / F12 is set to "1". SRF / F1
The output “1” of 2 is delayed by the delay circuit 27 and input to the ANDOR gate 22. When the end signal 34 becomes "1" during execution of the NOP instruction, the output of the ANDOR gate 22 becomes "1", and the SRF / F11 and SRF
/ F12 is reset to "0". STOP order 32
Is "1", the output of the SRF / F12 is "0", so the output of the AND gate 23 is "0",
The STOP permission signal 36 output from the F / F 13 remains "0". Even if the STOP_Α signal 37 becomes “1”, the STOP_B signal 38 which is the output of the AND gate 24
Remains "0".

【0026】従って、クロック発生回路3はシステムク
ロックを発生し続け、マイクロコンピュ−タはSTOP
状態に入れない。一方、スタンバイ制御回路は、STO
P_Α信号37とSTOP_B信号38とを比較して一
致しないので、STOP要求割込み信号35aを”1”
とする。
Accordingly, the clock generation circuit 3 continues to generate the system clock, and the microcomputer
Do not enter the state. On the other hand, the standby control circuit
Since the P_Α signal 37 and the STOP_B signal 38 do not match, the STOP request interrupt signal 35a is set to “1”.
And

【0027】その後、割込み制御回路2からの割込み発
生信号31によってCPU1は、正しくSTOP命令が
実行されていないとして、割込み処理を行なう。
Thereafter, the CPU 1 performs an interrupt process on the basis of the interrupt generation signal 31 from the interrupt control circuit 2 on the assumption that the STOP instruction has not been correctly executed.

【0028】次に、図4を参照して、本発明の第2の実
施例について説明する。
Next, a second embodiment of the present invention will be described with reference to FIG.

【0029】先の第1の実施例では、割込み要求信号3
5аをスタンバイ制御回路5аから出力したが、第2の
実施例では、STOP信号制御回路4bから割込み要求
信号35bを出力する。第2の実施例のスタンバイ制御
回路5bは、従来のスタンバイ制御回路と同じである。
In the first embodiment, the interrupt request signal 3
Although 5a is output from the standby control circuit 5a, in the second embodiment, the interrupt request signal 35b is output from the STOP signal control circuit 4b. The standby control circuit 5b of the second embodiment is the same as the conventional standby control circuit.

【0030】一方、STOP信号制御回路4bは、ST
OPオ−ダ32を入力するSRF/F14とSRF/F13の
出力を入力するインバ−タ26と、インバ−タ26の出
力とSRF/F14の出力を入力するANDゲ−ト25
と、ANDゲ−ト25の出力を入力する割込み発生回路
15が追加されている。割込み発生回路15は、割込み
制御回路2へ、割込み要求信号35bを割込み要求信号
35аと同じ機能とタイミングで出力する。他の機能
は、STOP信号制御回路4аと同じである。
On the other hand, the STOP signal control circuit 4b
An inverter 26 for receiving the outputs of the SRF / F 14 and SRF / F 13 for inputting the OP order 32, and an AND gate 25 for receiving the output of the inverter 26 and the output of the SRF / F 14.
And an interrupt generation circuit 15 for inputting the output of the AND gate 25. The interrupt generation circuit 15 outputs the interrupt request signal 35b to the interrupt control circuit 2 with the same function and timing as the interrupt request signal 35a. Other functions are the same as those of the STOP signal control circuit 4a.

【0031】SRF/F11,12,13のタイミングは
第1の実施例と同じであるので、STOP信号制御回路
4bより割込み要求信号35bが出力される動作だけを
説明する。SRF/F14は、SRF/F11,12,13と
同様にリセット信号33で″0″にリセットされるの
で、出力初期値は、″0″である。
Since the timings of the SRF / Fs 11, 12, and 13 are the same as in the first embodiment, only the operation in which the STOP signal control circuit 4b outputs the interrupt request signal 35b will be described. Since the SRF / F 14 is reset to “0” by the reset signal 33 similarly to the SRF / Fs 11, 12, and 13, the initial output value is “0”.

【0032】次に、図2を参照してSTOP状態に入る
場合について説明する。STOP命令実行時にSTOP
オ−ダ32が″1″となるとSRF/F14は″1″にセ
ットされる。SRF/F13の出力であるSTOP許可信
号36は″1″であるから、インバ−タ25の出力は″
0″となる。SRF/F14の出力とインバ−タ26の出
力を入力したANDゲ−ト25の出力は″0″となる。
ANDゲ−ト25の出力を入力した割込み発生回路15
は、STOP許可信号36が″1″で、かつSTOPオ
−ダ32が″1″であるので、割込み要求信号35b
は″0″のままである。STOP_Β信号38は、″
1″であるので、マイクロコンピュ−タはSTOP状態
に入る。
Next, a case where the STOP state is entered will be described with reference to FIG. STOP when executing STOP instruction
When the order 32 becomes "1", the SRF / F 14 is set to "1". Since the STOP permission signal 36 output from the SRF / F 13 is "1", the output of the inverter 25 is "1".
The output of the AND gate 25 to which the output of the SRF / F 14 and the output of the inverter 26 are input becomes "0".
Interrupt generation circuit 15 receiving the output of AND gate 25
Since the STOP permission signal 36 is "1" and the STOP order 32 is "1", the interrupt request signal 35b
Remains "0". The STOP_ $ signal 38 is
Since it is 1 ", the microcomputer enters the STOP state.

【0033】次に、図3を参照してSTOP状態に入れ
ない場合について説明する。STOP命令実行時にST
OPオ−ダが″1″となると、SRF/F14はSRF/F1
3と同じタイミングで″1″にセットされる。SRF/F
13の出力であるSTOP許可信号36は″0″である
から、インバ−タ25の出力は″1″となり、ANDゲ
−ト24の出力は″1″となる。割込み発生回路15
は、STOP許可信号36が″0″で、かつSTOPオ
−ダ32が″1″であるので、割込み要求信号35b
を″1″とする。このとき、STOP_Β信号38は″
0″であるので、STOP状態に入れない。
Next, a case where the STOP state cannot be set will be described with reference to FIG. ST when executing STOP instruction
When the OP order becomes "1", SRF / F14 becomes SRF / F1.
It is set to "1" at the same timing as 3. SRF / F
Since the STOP permission signal 36, which is the output of 13, is "0", the output of the inverter 25 becomes "1" and the output of the AND gate 24 becomes "1". Interrupt generation circuit 15
Since the STOP permission signal 36 is "0" and the STOP order 32 is "1", the interrupt request signal 35b
Is set to "1". At this time, the STOP_Β signal 38 becomes “
Since it is 0 ", it cannot enter the STOP state.

【0034】第1の実施例と同様に割込み要求信号35
bが″1″になると、割込み制御回路2は割込み発生信
号31を″1″とし、CPUIは割込み処理を行なう。
As in the first embodiment, an interrupt request signal 35
When b becomes "1", the interrupt control circuit 2 sets the interrupt generation signal 31 to "1", and CPUI performs an interrupt process.

【0035】[0035]

【発明の効果】本発明のマイクロコンピュータによれ
ば、ウォッチドッグタイマ・クリア命令とSTOP命令
を連続して実行してはじめて、STOP状態に入る。従
って、プログラムの暴走等により本来期待されていない
STOP命令が誤って実行されてしまう前にCPUがシ
ステムの異常を検出できる。また、前記システムの異常
に対処する割込み処理を行なうことができる。これによ
り、システムの信頼度が高いマイクロコンピュータを提
供することができる。
According to the microcomputer of the present invention, the STOP state is entered only after the watchdog timer clear instruction and the STOP instruction are executed successively. Therefore, the CPU can detect a system abnormality before a STOP instruction that is not expected originally is erroneously executed due to a program runaway or the like. Further, an interrupt process for coping with an abnormality of the system can be performed. Thereby, a microcomputer with high system reliability can be provided.

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

【図1】本発明の第1の実施例に係るマイクロコンピュ
ータを示すブロック図である。
FIG. 1 is a block diagram showing a microcomputer according to a first embodiment of the present invention.

【図2】同じくそのマイクロコンピュータがSTOP状
態に入る場合のタイミング図である。
FIG. 2 is a timing chart when the microcomputer enters a STOP state.

【図3】同じくそのマイクロコンピュータがSTOP状
態に入れない場合のタイミング図である。
FIG. 3 is a timing chart when the microcomputer cannot enter the STOP state.

【図4】本発明の第2の実施例に係るマイクロコンピュ
ータを示すブロック図である。
FIG. 4 is a block diagram showing a microcomputer according to a second embodiment of the present invention.

【図5】従来のマイクロコンピュータの一例を示すブロ
ック図である。
FIG. 5 is a block diagram illustrating an example of a conventional microcomputer.

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

1;CPU 2;割込み制御回路 3;クロック発生回路 4;STOP信号制御回路 5a,5b;スタンバイ制御回路 6;ウォッチドッグタイマ 11,12,13,14;SRフリップフロップ 15;割込み発生回路 21,23,24,25;ANDゲート 22;ANDORゲート 26;インバータ 27;ディレイ回路 30;システムクロック 31;割込み発生信号 32;STOPオーダ 33;リセット信号 34;エンド信号 35a,35b;割込み要求信号 36;STOP許可信号 37;STOP_A信号 38;STOP_B信号 1; CPU 2: interrupt control circuit 3: clock generation circuit 4: STOP signal control circuit 5a, 5b; standby control circuit 6; watchdog timer 11, 12, 13, 14; SR flip-flop 15; interrupt generation circuit 21, 23 , 24, 25; AND gate 22, ANDOR gate 26; inverter 27, delay circuit 30, system clock 31, interrupt generation signal 32, STOP order 33, reset signal 34, end signal 35a, 35b, interrupt request signal 36, STOP permission Signal 37; STOP_A signal 38; STOP_B signal

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 中央処理装置と、割込みを制御する割込
み制御回路と、システム全体にシステムクロックを供給
するクロック発生回路と、低消費電力を実現するための
スタンバイ制御回路と、ウォッチドッグタイマとを有す
るマイクロコンピュータにおいて、ウォッチドッグタイ
マのカウント値をクリアする命令の直後にSTOP命令
が実行したことを記憶する記憶回路と、前記記憶回路の
内容とスタンバイ状態を起動させる信号とのレベルを比
較する手段と、前記比較手段の結果が一致するときはス
タンバイ状態に入り、一致しないときは割込み処理を要
求する手段とを備えたことを特徴とするマイクロコンピ
ュータ。
1. A central processing unit, an interrupt control circuit for controlling an interrupt, a clock generation circuit for supplying a system clock to the entire system, a standby control circuit for realizing low power consumption, and a watchdog timer. A memory circuit for storing that a STOP instruction has been executed immediately after an instruction for clearing a count value of a watchdog timer, and means for comparing the level of the content of the storage circuit with a signal for activating a standby state. And a means for requesting an interrupt process when the results of the comparing means match, and when the results of the comparing means do not match.
JP3314983A 1991-11-28 1991-11-28 Microcomputer Expired - Fee Related JP2814800B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3314983A JP2814800B2 (en) 1991-11-28 1991-11-28 Microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3314983A JP2814800B2 (en) 1991-11-28 1991-11-28 Microcomputer

Publications (2)

Publication Number Publication Date
JPH05257751A JPH05257751A (en) 1993-10-08
JP2814800B2 true JP2814800B2 (en) 1998-10-27

Family

ID=18060012

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3314983A Expired - Fee Related JP2814800B2 (en) 1991-11-28 1991-11-28 Microcomputer

Country Status (1)

Country Link
JP (1) JP2814800B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4353081B2 (en) 2004-11-29 2009-10-28 セイコーエプソン株式会社 Electronic device and control method thereof
JP2014016840A (en) * 2012-07-10 2014-01-30 Toyota Industries Corp Watchdog timer circuit

Also Published As

Publication number Publication date
JPH05257751A (en) 1993-10-08

Similar Documents

Publication Publication Date Title
US4791557A (en) Apparatus and method for monitoring and controlling the prefetching of instructions by an information processing system
US5630107A (en) System for loading PLL from bus fraction register when bus fraction register is in either first or second state and bus unit not busy
US6378022B1 (en) Method and apparatus for processing interruptible, multi-cycle instructions
US5541943A (en) Watchdog timer lock-up prevention circuit
JP3202497B2 (en) Information processing device
US6968410B2 (en) Multi-threaded processing of system management interrupts
JP2814800B2 (en) Microcomputer
JP7276755B2 (en) Processing speed matching circuit and microprocessor
JP5012562B2 (en) Microcomputer
JPH0756774A (en) Watching timer
KR100442290B1 (en) A circuit for controlling program counter
JP3090065B2 (en) Microcomputer
JPH05224966A (en) Instruction malfunction preventing system
JP2665043B2 (en) CPU runaway detection circuit
JP2870083B2 (en) Microcomputer with built-in watchdog timer
JPH0623953B2 (en) Arithmetic control method
JP2006099654A (en) Semiconductor circuit apparatus
JP3129873B2 (en) Microcomputer
JPH0444132A (en) Circuit and system for detection of runaway
JP2830522B2 (en) Watchdog timer
JPH06131218A (en) Cpu control system
JPH0535892A (en) Microcomputer
JPH0555905B2 (en)
JPH087679B2 (en) Microprocessor
JPS62226233A (en) Microcomputer

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees