JPH0743658B2 - Software runaway monitoring timer - Google Patents
Software runaway monitoring timerInfo
- Publication number
- JPH0743658B2 JPH0743658B2 JP63272217A JP27221788A JPH0743658B2 JP H0743658 B2 JPH0743658 B2 JP H0743658B2 JP 63272217 A JP63272217 A JP 63272217A JP 27221788 A JP27221788 A JP 27221788A JP H0743658 B2 JPH0743658 B2 JP H0743658B2
- Authority
- JP
- Japan
- Prior art keywords
- reset
- bit
- binary counter
- signal
- bit binary
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Lifetime
Links
Landscapes
- Debugging And Monitoring (AREA)
- Electronic Switches (AREA)
Description
【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、マイクロコンピュータの周辺ハードウェアに
関し、特にカウント値がオーバーフローするシステム・
リセット信号を発生させる機能をもつソフトウェアの暴
走監視タイマの回路構成に関する。Description: TECHNICAL FIELD The present invention relates to peripheral hardware of a microcomputer, and more particularly to a system / system in which a count value overflows.
The present invention relates to a circuit configuration of a software runaway monitoring timer having a function of generating a reset signal.
従来、この種のタイマは、主に第5図に示すように、K
ビット・バイナリ・カウンタ5−1およびリセット制御
部5−2から構成されていた。Conventionally, this type of timer has been used as shown in FIG.
It was composed of a bit binary counter 5-1 and a reset controller 5-2.
第5図の従来のソフトウェアの暴走監視タイマを具体例
で説明すると、以下のようになる。The conventional software runaway monitoring timer shown in FIG. 5 will be described below with reference to a specific example.
まず、マイクロコンピュータに対し、外部から与えられ
るリセット信号によりシステム・リセットが行なわれる
際、端子5−3にロウ・レベルが加わるものとする。す
ると、リセット時には、リセット制御部5−2からはロ
ウ・レベルの信号が出力される。従って、ロウ・アクテ
ィブのリセット端子をもつkビット・バイナリ・カウン
タ5−1のカウント値は0に初期化される。First, it is assumed that a low level is applied to the terminal 5-3 when the system is reset to the microcomputer by an externally applied reset signal. Then, at the time of reset, the reset control unit 5-2 outputs a low-level signal. Therefore, the count value of the k-bit binary counter 5-1 having the row active reset terminal is initialized to zero.
端子5−4は、ソフトウェアにより(K)ビット・バイ
ナリ・カウンタをリセットする命令で実行する際にロウ
・レベルとなる端子で、それ以外の時はハイ・レベルと
なっている。The terminal 5-4 is a terminal which becomes a low level when it is executed by an instruction for resetting the (K) bit binary counter by software, and is a high level otherwise.
この状態で、端子5−5にマイクロコンピュータの命令
サイクルに対して充分長い周期のクロックを加える。す
ると、マイクロコンピュータが何命令か実行するとビッ
ト・バイナリ・カウンタ5−1のカウント値が+1され
る。そして、カウント値がオーバーフローする前に
(K)ビット・バイナリ・カウンタ5−1をリセットす
る命令、即ち、端子5−4をロウ・レベルにする命令を
実行する。In this state, a clock having a sufficiently long cycle with respect to the instruction cycle of the microcomputer is applied to the terminals 5-5. Then, when the microcomputer executes some instructions, the count value of the bit binary counter 5-1 is incremented by one. Then, an instruction to reset the (K) -bit binary counter 5-1 before the count value overflows, that is, an instruction to set the terminal 5-4 to the low level is executed.
つまり、マイクロコンピュータが実行する命令の何ステ
ップか毎に、(K)ビット・バイナリ・カウンタ5−1
をリセットする命令を入れるという事である。以上によ
り端子5−6は常にロウ・レベルに保たれる。もし、何
らかの理由で(K)ビット・バイナリ・カウンタ5−1
がリセットされずにオーバーフローして端子5−6がハ
イ・レベルになった場合は、ソフトウェアが暴走した為
にkビット・バイナリ・カウンタのリセットを行なう命
令が実行されなかったと判断する。That is, the (K) -bit binary counter 5-1 is used for every step of the instruction executed by the microcomputer.
It is to put an instruction to reset. As a result, the terminals 5-6 are always kept at the low level. If for some reason (K) bit binary counter 5-1
If is not reset and overflows and the terminal 5-6 goes to a high level, it is determined that the instruction for resetting the k-bit binary counter has not been executed because the software has runaway.
具体的には、マイクロコンピュータの回路構成として、
端子5−6がハイ・レベルになると、マイクロコンピュ
ータに対して外部からリセット信号が加えられると同等
のシステム・リセット信号を発生させる様にしておく。
従って、プログラムが暴走しつづける時間は、(K)ビ
ット・バイナリ・カウンタ5−1がオーバー・フローす
るまでの時間だけという事になる。Specifically, as the circuit configuration of the microcomputer,
When the terminals 5-6 become high level, a system reset signal equivalent to the external reset signal applied to the microcomputer is generated.
Therefore, the time that the program continues to run away is only the time until the (K) -bit binary counter 5-1 overflows.
しかし、この方式の従来のソフトウェアの暴走監視タイ
マは、以下の場合は、暴走を検出する事ができないとい
う欠点がある。However, the conventional software runaway monitoring timer of this system has a drawback that it cannot detect runaway in the following cases.
それは、(K)ビット・バイナリ・カウンタ5−1をリ
セットする命令を含む暴走無限ループに入ってしまった
場合であり、(K)ビット・バイナリ・カウンタ5−1
がオーバーフローしない為、マイクロコンピュータの外
部からリセット信号を与えない限り、暴走しつづけると
いう欠点がある。That is, if the runaway endless loop including the instruction to reset the (K) -bit binary counter 5-1 is entered, and the (K) -bit binary counter 5-1 is entered.
Since it does not overflow, it has the drawback that it will continue to run away unless a reset signal is applied from outside the microcomputer.
本発明の目的は、上記欠点に除去し、暴走無限ループに
入った場合にも、実行している命令が暴走無限ループに
なっている事を判断し、システム・リセット信号を発生
させる回路を提供することに有る。An object of the present invention is to eliminate the above-mentioned drawbacks and provide a circuit for generating a system reset signal by determining that an instruction being executed is in a runaway infinite loop even when the runaway infinite loop is entered. There is to do.
本発明のソフトウェアの暴走監視タイマの特徴は、シス
テム・クロックを分周して得られたカウント・クロック
を計数するとともに、その計数結果がオーバーフローす
る以前に所定の命令でリセットされ、オーバーフローし
たときにはリセット信号を発生するKビット・バイナリ
・カウンタを有し、前記オーバーフロー時のリセット信
号に応答してマイクロコンピュータにシステム・リセッ
トをかけるようにしたソフトウェアの暴走監視タイマに
おいて、前記Kビット・バイナリ・カウンタが前記所定
の命令でリセットされ、そのリセット毎に第Lビット目
から第Mビット目(0≦L≦M<K)までのリセット直
前の計数値出力がそれぞれ対応するNビット・シフトレ
ジスタに格納されてシフトされ、これらNビット・シフ
トレジスタの各ビット値がそれぞれ同一値になるとシス
テム・リセット信号を発生する第1のリセット制御手
段、または前記リセット直前の計数値出力がそれぞれ対
応するD型フリップ・フロップに格納されこの格納され
た値と次のリセット時の直前の計数値とがそれぞれ一致
する毎にこの一致信号がnビット・バイナリ・カウンタ
に供給されて計数され、あらかじめ定めた所定値になる
とシステム・リセット信号を発生する第2のリセット制
御手段のいずれか一方を備え、プログラムの暴走が無限
ループとなり、かつそのループの中に前記Kビット・バ
イナリ・カウンタをリセットする前記所定の命令が含ま
れているとき、この命令が少なくともN回実行される毎
に前記リセット直前の計数値出力が常に同一値であれ
ば、その後に実行される前記所定の命令によるリセット
を前記第1または前記第2のリセット制御手段のいずれ
か一方で無効にして前記Kビット・バイナリ・カウンタ
をオーバーフローさせ前記無限ループから抜けることに
ある 〔実施例〕 次に、本発明について図面を参照して説明する。The feature of the runaway monitoring timer of the software of the present invention is that the count clock obtained by dividing the system clock is counted, and the count result is reset by a predetermined instruction before overflow, and reset when overflow occurs. In a software runaway monitoring timer having a K-bit binary counter for generating a signal and for performing a system reset on the microcomputer in response to the reset signal at the time of overflow, the K-bit binary counter is The count value output from the Lth bit to the Mth bit (0 ≦ L ≦ M <K) immediately before resetting is stored in the corresponding N-bit shift register at each reset. Shifted in each bit of each of these N-bit shift registers. First reset control means for generating a system reset signal when the respective set values become the same value, or the count value output immediately before the reset is stored in the corresponding D-type flip-flop, and the stored value and the next value are stored. The second reset control for generating the system reset signal when the coincidence signal is supplied to the n-bit binary counter for counting every time the count value immediately before the reset coincides with each other, and reaches a predetermined value. When any one of the means is provided and the runaway of the program is an infinite loop, and the predetermined instruction for resetting the K-bit binary counter is included in the loop, the instruction is executed at least N times. Each time the count value output immediately before the reset is always the same value, the predetermined command executed thereafter According to the present invention, the reset according to the first or second reset control means is invalidated to cause the K-bit binary counter to overflow and exit from the infinite loop. A description will be given with reference to the drawings.
第1図は本発明の第1の実施例の回路図であり、本実施
例はバイナリ・カウンタを構成するフリップ・フロップ
の個数K=7,バイナリ・カウンタのビット列のうちレジ
スタに格納するビット列の最下位のビット番号L=1,バ
イナリ・カウンタのビット列のうちレジスタに格納する
ビット列の最上位のビット番号M=5,命令によるバイナ
リ・カウンタのリセット回数の設定値N=3に選んだ場
合の例である。FIG. 1 is a circuit diagram of a first embodiment of the present invention. In this embodiment, the number K of flip-flops constituting a binary counter is K = 7, and the bit string to be stored in a register among the bit strings of the binary counter. When the lowest bit number L = 1, the highest bit number M = 5 of the bit string stored in the register of the binary counter bit string, and the set value N = 3 of the number of times the binary counter is reset by an instruction are selected. Here is an example.
端子1−5は、マイクロコンピュータに対して外部より
リセット信号を与える事によりロウ・レベルになり、リ
セットの解除とともにハイ・レベルになるものとする。
即ち、マイクロコンピュータのシステム・リセット時に
ロウ・レベルになる。端子1−5がロウ・レベルになる
と、2入力ANDゲート1−6の出力もロウ・レベルにな
る。すると、端子1−5が直接ロウ・アクティブのリセ
ット端子に接続されたD型フリップ・フロップ1−71〜
1−75,1−81〜1−85,1−91〜1−95は一例としてそれ
ぞれ3ビット・レジスタを構成しており、これらのQ出
力がロウ・レベルとなり、また2入力ANDゲート1−6
の出力がロウ・アクティブのリセット端子に接続された
7ビット・バイナリ・カウンタ1−1のカウント値が0
にリセットされる。従って、3入力ANDゲート1−101〜
1−105および3入力NORゲート1−111〜1−115のそれ
ぞれの3本の入力全てがロウ・レベルとなり、結果とし
てORゲート1−121〜1−125の出力がハイ・レベルに、
5入力NANDゲート1−13の出力がロウ・レベルに、2入
力NANDゲート1−17の出力がハイ・レベルにそれぞれ固
定される。The terminals 1-5 are set to a low level by externally applying a reset signal to the microcomputer, and are set to a high level when the reset is released.
That is, it becomes low level when the system of the microcomputer is reset. When the terminal 1-5 goes low, the output of the 2-input AND gate 1-6 also goes low. Then, the terminals 1-5 are directly connected to the row active reset terminals, and the D-type flip-flops 1-71 to
1-75, 1-81 to 1-85, 1-91 to 1-95 each constitute a 3-bit register as an example, the Q output of these is low level, and the 2-input AND gate 1- 6
The output value of the 7-bit binary counter 1-1 connected to the reset terminal of low active is 0.
Is reset to. Therefore, 3-input AND gate 1-101-
1-105 and 3-input NOR gates 1-131 to 1-115 all have a low level, and as a result, the outputs of the OR gates 1-121 to 1-125 are high level.
The output of the 5-input NAND gate 1-13 is fixed to the low level and the output of the 2-input NAND gate 1-17 is fixed to the high level.
マイクロコンピュータのシステム・リセットが解除さ
れ、端子1−5の論理値はハイ・レベルになると、2入
力ANDゲート1−6の出力はハイ・レベルとなり、7ビ
ット・バイナリ・カウンタ1−1およびD型フリップ・
フロップ1−71〜1−75,1−81〜1−85,1−91〜1−95
のリセットが解除される。リセットが解除されると、7
ビット・バイナリ・カウンタ1−1は、端子1−4に与
えられるクロックによって開始する。このクロックは、
システム・クロックを分周してつくる低い周波数のクロ
ックである。また、同時に、マイクロコンピュータは命
令の実行を開始する。マイクロコンピュータの命令セッ
トの中には、あらかじめ7ビット・バイナリ・カウンタ
1−1をリセットする命令を用意しておき、制御および
演算等を行なう命令の所々にそう入して7ビット・バイ
ナリ・カウンタ1−1がオーバーフローしない様にリセ
ットする。When the system reset of the microcomputer is released and the logic value of the terminal 1-5 becomes high level, the output of the 2-input AND gate 1-6 becomes high level and the 7-bit binary counter 1-1 and D Mold flip
Flop 1-71 to 1-75, 1-81 to 1-85, 1-91 to 1-95
Reset is released. When reset is released, 7
The bit binary counter 1-1 is started by the clock applied to the terminals 1-4. This clock is
It is a low-frequency clock generated by dividing the system clock. At the same time, the microcomputer starts executing instructions. An instruction set for resetting the 7-bit binary counter 1-1 is prepared in advance in the instruction set of the microcomputer, and the instruction is inserted everywhere in the instruction for performing control and operation, and the 7-bit binary counter is inserted. Reset so that 1-1 does not overflow.
リセットを行なう為のハード上の手続きは以下の通りで
ある。The hardware procedure for resetting is as follows.
7ビット・バイナリ・カウンタ1−1をリセットする命
令を実行すると、第3図に示すタイミングでAとBの信
号を発生する様に、マイクロ・コンピュータのハードを
構成し、A信号を端子1−15に、また、B信号を端子1
−14に与える。今、7ビット・バイナリ・カウンタ1−
1の第1ビットに注目すると、信号Aによって第1ビッ
トのQ出力の値がD型フリップ・フロップ1−75に格納
され、同時に、D型フリップ・フロップ1−75のQ出力
の値がD型フリップ・フロップ1−85に、また、1−85
の値が1−95にそれぞれ格納される。同様の手続きが、
第2ビットから第5ビットにも適用される。即ち、信号
Aによって、7ビット・バイナリ・カウンタ1−1のカ
ウント値の第1ビットから第5ビットの値が、D型フリ
ップ・フロップ1−75〜1−71へ転送される。When the instruction to reset the 7-bit binary counter 1-1 is executed, the hardware of the microcomputer is configured so that the signals A and B are generated at the timing shown in FIG. 15 and B signal to terminal 1
Give to -14. 7-bit binary counter 1-
Focusing on the first bit of 1, the value of the Q output of the first bit is stored in the D-type flip-flop 1-75 by the signal A, and at the same time, the value of the Q output of the D-type flip-flop 1-75 is D. Type flip-flop 1-85, also 1-85
Are stored in 1-95, respectively. Similar procedure
The same applies to the second to fifth bits. That is, the value of the first bit to the fifth bit of the count value of the 7-bit binary counter 1-1 is transferred to the D-type flip-flops 1-75 to 1-71 by the signal A.
転送が完了すると、信号Bがハイ・レベルになる以前の
5入力NANDゲート1−13の出力が決定する。例えば、
今、D型フリップ・フロップ1−75〜1−71のQ出力の
値が順にハイ,ロウ,ハイ,ロウ,ハイのレベルである
とする。すると、先のシステム・リセットによってD型
フリップ・フロップ1−85〜1−81,1−95〜1−91のQ
出力はロウ・レベルであるので、2入力ORゲート1−12
5〜1−121の出力は順にロウ,ハイ,ロウ,ハイ,ロウ
のレベルとなり、5入力NANDゲート1−13の出力はハイ
・レベルになる。従って、信号Bによって、2入力NAND
ゲート1−17の出力がロウ・レベルに、また2入力AND
ゲート1−6の出力もロウ・レベルとなり、7ビット・
バイナリ・カウンタ1−1のカウント値が0にリセット
される。When the transfer is completed, the output of the 5-input NAND gate 1-13 before the signal B goes high is determined. For example,
Now, it is assumed that the Q output values of the D-type flip-flops 1-75 to 1-71 are high, low, high, low, and high in order. Then, the Q of the D-type flip-flops 1-85 to 1-81 and 1-95 to 1-91 is reset by the previous system reset.
Since the output is low level, 2-input OR gate 1-12
The outputs of 5 to 1-121 sequentially become low, high, low, high, and low levels, and the output of the 5-input NAND gate 1-13 becomes high level. Therefore, with signal B, 2-input NAND
The output of the gate 1-17 is low level, and the two inputs are AND
The output of the gates 1-6 also goes low, and 7 bits
The count value of the binary counter 1-1 is reset to 0.
万一、7ビット・バイナリ・カウンタ1−1のカウント
値がオーバーフローしてしまった場合、マイクロコンピ
ュータの命令実行のシーケンスがくずれ、暴走してしま
ったとして、端子1−16から出力されるハイ・レベル信
号をもとにしてマイクロコンピュータにシステム・リセ
ットをかける。これは、従来の回路の動作と同一であ
る。もし、プログラムの暴走が無限ループとなり、か
つ、そのループの中に7ビット・バイナリ・カウンタ1
−1をリセットする命令が含まれていた場合は、次のよ
うな動作となる。In the unlikely event that the count value of the 7-bit binary counter 1-1 overflows, the sequence of instruction execution of the microcomputer is broken and it is considered that it has run out of control. A system reset is applied to the microcomputer based on the level signal. This is the same as the operation of the conventional circuit. If the program runaway becomes an infinite loop, and the 7-bit binary counter 1
If the instruction to reset -1 is included, the operation is as follows.
無限ループを形成するという事は、7ビット・バイナリ
・カウンタ1−1がリセットされる時のカウント値も常
に同一であると考えられる。すると、今まで説明してき
た手続きをとると、第1ビットに関してはD型フリップ
・フロップ1−75と、1−85と、1−95のQ出力が無限
ループを3回まわると一致する。第2ビットから第5ビ
ットについても同様である。すると、結果として、2入
力ORゲート1−125〜1−121の出力が全てハイ・レベル
となり、5入力NANDゲート1−13の出力がロウ・レベル
となる。従って、無限ループの3周目の7ビット・バイ
ナリ・カウンタ1−1をリセットする命令の信号Bは、
2入力NANDゲート1−17の信号Bが入力されるもう一方
の側が、ロウ・レベルであるので、2入力NANDゲート1
−17の出力はハイ・レベルのままとなり、7ビット・バ
イナリ・カウンタ1−1はリセットされず、オーバーフ
ローして端子1−16がハイ・レベルとなってシステムリ
セットがかかり、無限ループを抜けることができる。The formation of an infinite loop means that the count value when the 7-bit binary counter 1-1 is reset is always the same. Then, when the procedure described so far is taken, the Q outputs of the D-type flip-flops 1-75, 1-85, and 1-95 match the first bit through the infinite loop three times. The same applies to the second bit to the fifth bit. As a result, the outputs of the 2-input OR gates 1-125 to 1-121 are all at the high level and the outputs of the 5-input NAND gate 1-13 are at the low level. Therefore, the signal B of the instruction to reset the 7-bit binary counter 1-1 on the third round of the infinite loop is
Since the other side of the 2-input NAND gate 1-17 to which the signal B is input is low level, the 2-input NAND gate 1
The output of -17 remains high level, the 7-bit binary counter 1-1 is not reset, it overflows, the terminal 1-16 becomes high level, the system is reset, and the infinite loop is exited. You can
本実施例において、D型フリップ・フロップに第0ビッ
トの内容を格納しないのは、無限ループの1回の時間が
ループをまわる毎に多少違っても無限ループと判断でき
るようにする処置であり、また、第6ビットを格納しな
いのは、オーバーフローしない限り、第6ビットのQ出
力がハイ・レベルにならないからである。In the present embodiment, the fact that the contents of the 0th bit is not stored in the D flip-flop is a measure for making it possible to judge that the time of one infinite loop is an infinite loop even if the time of the loop is slightly different. The reason why the sixth bit is not stored is that the Q output of the sixth bit does not become high level unless it overflows.
本回路の性質として、同一の周期で7ビット・バイナリ
・カウンタ1−1がリセットされると、それが正常な命
令実行のシーケンスであっても、暴走したと判断してし
まう点があげられる。従って、7ビット・バイナリ・カ
ウンタ1−1のリセット命令の実行は不定期に行なわな
ければならない。A characteristic of this circuit is that if the 7-bit binary counter 1-1 is reset in the same cycle, it is determined that the runaway has occurred even if it is a normal instruction execution sequence. Therefore, the reset command for the 7-bit binary counter 1-1 must be executed irregularly.
第2図は、本発明の第2の実施例の回路図であり、本実
施例はK,L,M,Nの値をそれぞれ、7,1,5,5に選んだ場合の
例である。FIG. 2 is a circuit diagram of the second embodiment of the present invention, which is an example in which the values of K, L, M and N are selected to be 7, 1, 5 and 5, respectively. .
端子2−5は、通常ハイ・レベルでマイクロコンピュー
タのシステム・リセット時にロウ・レベルとなるものと
する。端子2−5がロウ・レベルとなると、2入力AND
ゲート2−6の出力もロウ・レベルとなり、7ビット・
バイナリ・カウンタの2−1のカウント値が0に、ま
た、D型フリップ・フロップ2−71〜2−75のQ出力お
よびフリップ・フロップ2−14,2−15,2−16で構成され
る3ビット・バイナリ・カウンタのQ出力がロウ・レベ
ルにリセットされる。従って、EXNORゲート2−81〜2
−85の出力がハイ・レベルに、5入力ANDゲートの出力
がハイ・レベルに、3入力NANDゲート2−17の出力がハ
イ・レベルに、それぞれ固定される。The terminal 2-5 is normally at high level and at low level at system reset of the microcomputer. When the terminal 2-5 becomes low level, 2-input AND
The output of the gate 2-6 becomes low level and 7 bits
The binary counter 2-1 has a count value of 0, and is composed of the Q outputs of the D-type flip-flops 2-71 to 2-75 and the flip-flops 2-14, 2-15, 2-16. The Q output of the 3-bit binary counter is reset to low level. Therefore, EXNOR gates 2-81-2
The output of −85 is fixed to the high level, the output of the 5-input AND gate is fixed to the high level, and the output of the 3-input NAND gate 2-17 is fixed to the high level.
システム・リセットが解除されると、端子2−5はハイ
・レベルとなり、7ビット・バイナリ・カウンタ2−1,
D型フリップ・フロップ2−71〜2−75およびバイナリ
・フリップ・フロップ2−14,2−15,2−16のリセットが
解除される。リセットが解除されると、7ビット・バイ
ナリ・カウンタ2−1は、端子2−4に与えられるクロ
ックによってカウントを開始する。同時に、マイクロ・
コンピュータは命令の実行を開始する。そして、第一の
実施例と同様に、7ビット・バイナリ・カウンタ2−1
をリセットる命令によってオーバーフローしないように
する。When the system reset is released, the terminal 2-5 goes high and the 7-bit binary counter 2-1
The D-type flip-flops 2-71 to 2-75 and the binary flip-flops 2-14, 2-15, 2-16 are released from reset. When the reset is released, the 7-bit binary counter 2-1 starts counting by the clock applied to the terminal 2-4. At the same time, micro
The computer begins executing instructions. Then, as in the first embodiment, the 7-bit binary counter 2-1 is used.
Don't overflow due to a reset instruction.
リセットを行なう手続きについて第一の実施例とは異な
り、以下のようになる。The reset procedure is as follows, unlike the first embodiment.
7ビット・バイナリ・カウンタ2−1をリセットする命
令を実行すると、第4図に示すタイミングでA,B,Cの信
号を発生する様に、マイクロコンピュータのハードを構
成し、A信号を端子2−20に、B信号を端子2−21に、
C信号を端子2−22に、それぞれ与える。EXNOR2−81〜
2−85は、先にリセットされたD型フリップ・フロップ
2−71〜2−75のQ出力と、カウントをつづける7ビッ
ト・バイナリ・カウンタ2−1の第1のビットから第5
ビットの値とを逐時比較し、一致したらハイ・レベルを
出力する。When the instruction to reset the 7-bit binary counter 2-1 is executed, the hardware of the microcomputer is configured so that the signals A, B and C are generated at the timing shown in FIG. -20, B signal to terminal 2-21,
The C signal is applied to terminals 2-22, respectively. EXNOR2-81 ~
2-85 is the first to fifth bits of the 7-bit binary counter 2-1 that keeps counting with the Q outputs of the D-type flip-flops 2-71 to 2-75 that were previously reset.
The bit value is compared with each other, and if they match, a high level is output.
従って、5入力ANDゲート2−9は、その比較を行なう
全ビットが一致したらハイ・レベルを出力する。5入力
ANDゲート2−9の出力が確定している状態で信号Aが
ハイ・レベルになり、再びロウ・レベルになると、5入
力ANDゲート2−9の出力がハイ・レベルであれば、2
入力ANDゲート2−11の出力は信号Aと同一の信号が現
れる。また、2入力ANDゲート2−13の出力はハイ・レ
ベルのままとなる。逆に、5入力ANDゲート2−9の出
力がロウ・レベルであれば、2入力ANDゲート2−11の
出力はロウ・レベルのままとなり、2入力ANDゲート2
−13の出力には信号Aの反転の信号が現れる。Therefore, the 5-input AND gate 2-9 outputs a high level when all the bits to be compared match. 5 inputs
If the signal A goes high and then goes low again while the output of the AND gate 2-9 is fixed, if the output of the 5-input AND gate 2-9 is high, 2
The same signal as the signal A appears at the output of the input AND gate 2-11. Also, the output of the 2-input AND gate 2-13 remains at the high level. Conversely, if the output of the 5-input AND gate 2-9 is low level, the output of the 2-input AND gate 2-11 remains low level, and the 2-input AND gate 2
An inverted signal of the signal A appears at the output of -13.
即ち、信号Aによって7ビット・バイナリ・カウンタ2
−1のカウント値とD型フリップ・フロップの格納値が
一致すると、バイナリ・フリップ・フロップ2−14〜2
−16で構成するバイナリカウンタのカウント値を+1と
する。一致しない時は、カウント値を0にリセットす
る。次に、信号Bによって、今、比較した7ビット・バ
イナリ・カウンタ2−1のカウント値の第1ビット目か
ら第5ビット目までの値をD型フリップ・フロップ2−
71〜2−75に転送する。最後に、信号Cによって7ビッ
ト・バイナリ・カウンタ2−1をリセットする。信号C
が入力される2入力NANDゲート2−10のもう一方の入力
には、3入力NANDゲート2−17の出力が接続されてお
り、D型フリップ・フロップ2−14〜2−16のQ出力が
順にハイ,ロウ,ハイのレベルになっている時にのみ3
入力NANDゲート2−17の出力がロウ・レベルとなる。即
ち、通常の状態においては、信号Cによって、7ビット
・バイナリ・カウンタ2−1がリセットされることにな
る。That is, the 7-bit binary counter 2 is generated by the signal A.
If the count value of -1 and the stored value of the D-type flip-flop match, the binary flip-flops 2-14 to 2-2
The count value of the binary counter composed of -16 is set to +1. When they do not match, the count value is reset to 0. Next, with the signal B, the values from the first bit to the fifth bit of the compared count value of the 7-bit binary counter 2-1 are compared with the D-type flip-flop 2-.
Transfer to 71 to 2-75. Finally, the signal C resets the 7-bit binary counter 2-1. Signal C
To the other input of the 2-input NAND gate 2-10, the output of the 3-input NAND gate 2-17 is connected, and the Q outputs of the D-type flip-flops 2-14 to 2-16 are 3 only when the levels are high, low, high
The output of the input NAND gate 2-17 becomes low level. That is, in the normal state, the signal C resets the 7-bit binary counter 2-1.
ここで、第一の実施例と同様にプログラムが暴走し、7
ビット・バイナリ・カウンタ2−1をリセットする命令
を含む無限ループに入った場合を考える。Here, as in the first embodiment, the program runs away,
Consider the case of entering an infinite loop containing an instruction to reset the bit binary counter 2-1.
7ビット・バイナリ・カウンタ2−1の第1ビットから
第5ビットの値が同一の値で5回リセットされると、バ
イナリフリップ・フロップ2−14〜2−16のQ出力の値
が順にハイ,ロウ,ハイのレベルとなり、3入力NANDゲ
ート2−17の出力がロウ・レベルになる。すると、6回
目の7ビット・バイナリ・カウンタ2−1のリセット命
令を実行しても、2入力NANDゲート2−10の出力は、ハ
イ・レベルに固定され、7ビット・バイナリ・カウンタ
2−1はリセットされず、オーバーフローをおこして端
子2−23をハイ・レベルにし、第一の実施例と同様にシ
ステム・リセットをかける。When the value of the 1st bit to the 5th bit of the 7-bit binary counter 2-1 is reset 5 times with the same value, the value of the Q output of the binary flip-flops 2-14 to 2-16 sequentially becomes high. , Low, high level, and the output of the 3-input NAND gate 2-17 becomes low level. Then, even if the sixth reset command of the 7-bit binary counter 2-1 is executed, the output of the 2-input NAND gate 2-10 is fixed at the high level, and the 7-bit binary counter 2-1 is fixed. Is not reset but overflows to bring the terminal 2-23 to a high level, and a system reset is applied as in the first embodiment.
以上のようにして、無限ループから抜けることができ
る。In this way, you can exit the infinite loop.
以上説明したように本発明は、マイクロコンピュータの
システムクロックを分周してつくるカウント・クロック
によりカウントをつづけるKビット・バイナリ・カウン
タが所定の命令でリセットされ、そのリセット毎に第L
ビット目から第Mビット目(0≦L≦M<K)までのリ
セット直前の計数値出力がそれぞれ対応するNビット・
シフトレジスタに格納されてシフトされ、これらNビッ
ト・シフトレジスタの各ビット値がそれぞれ同一値にな
るとシステム・リセット信号を発生する第1のリセット
制御手段、または前記リセット直前の計数値出力がそれ
ぞれ対応するD型フリップ・フロップに格納されこの格
納された値と次のリセット時の直前の計数値とがそれぞ
れ一致する毎にこの一致信号がnビット・バイナリ・カ
ウンタに供給されて計数され、あらかじめ定めた所定値
になるとシステム・リセット信号を発生する第2のリセ
ット制御手段のいずれか一方を備えるので、プログラム
の暴走が無限ループとなり、かつそのループの中に前記
Kビット・バイナリ・カウンタをリセットする前記所定
の命令が含まれているとき、この命令が少なくともN回
実行される毎に前記リセット直前の計数値出力が常に同
一値であれば、その後に実行される前記所定の命令によ
るリセットを第1または第2のリセット制御手段のいず
れか一方で無効にしてKビット・バイナリ・カウンタを
オーバーフローさせることができる。したがって、従来
の暴走監視タイマの機能に加えてプログラムの暴走がK
ビット・バイナリ・カウンタをリセットする命令を含む
無限ループであっても、その無限ループから抜けること
ができ、かつプログラムの暴走を検出できる効果があ
る。As described above, according to the present invention, the K-bit binary counter that keeps counting by the count clock generated by dividing the system clock of the microcomputer is reset by a predetermined instruction, and the L-th binary counter is reset at each reset.
The N-bit corresponding to the count value output immediately before the reset from the bit-th bit to the M-th bit (0 ≦ L ≦ M <K)
First reset control means for generating a system reset signal when the bit values of the N-bit shift registers stored in the shift register have the same value, or the count value output just before the reset, respectively, correspond to each other. Each time the stored value stored in the D-type flip-flop and the count value immediately before the next reset match, the match signal is supplied to the n-bit binary counter to be counted and predetermined. Since either one of the second reset control means for generating a system reset signal when the predetermined value is reached is provided, the runaway of the program becomes an infinite loop, and the K-bit binary counter is reset in the loop. When the predetermined instruction is included, every time this instruction is executed at least N times, If the count value output immediately before reset is always the same value, the reset by the predetermined instruction executed thereafter is invalidated by either the first or second reset control means, and the K-bit binary counter is set. Can overflow. Therefore, in addition to the conventional runaway monitoring timer function, program runaway
Even an infinite loop including an instruction to reset the bit binary counter can be exited from the infinite loop, and a program runaway can be detected.
従って、マイクロコンピュータにより制御を行なう系に
おける動作を信頼性をより向上する事ができる。Therefore, the reliability of the operation of the system controlled by the microcomputer can be further improved.
第1図および第2図は本発明の第1および第2の実施例
の回路図、第3図は第1の実施例で使用する信号のタイ
ミング図、第4図は第2の実施例で使用する信号のタイ
ミング図、第5図は従来の例の回路図である。 1−1……7ビット・バイナリ・カウンタ、1−2……
バイナリ・カウンタ1−1がリセットされる直前の第1
ビットから第5ビットの値を格納するレジスタ、1−3
……リセット制御部、1−4……システム・クロックを
分周してつくるカウント・クロック入力端子、1−5…
…マイクロコンピュータのシステム・リセット時にロウ
・レベルになる端子、1−6……2入力ANDゲート、1
−71〜1−75,1−81〜1−85,1−91〜1−95……R端子
がロウ・レベルになるとQ出力がロウ・レベルにリセッ
トされ、C端子に与えられる信号の立下がりエッジでD
端子から入力されるデータがQ端子へ伝わるD型フリッ
プ・フロップ、1−101〜1−105……3入力ANDゲー
ト、1−111〜1−115……3入力NORゲート、1−121〜
1−125……2入力ORゲート、1−13……5入力NANDゲ
ート、1−14……バイナリ・カウンタ1−1をリセット
する命令を実行する際、第3図の信号Bが与えられる端
子、1−15……1−14と同様に信号Aが与えられる端
子、1−16……バイナリ・カウンタの最高位ビットのQ
出力端子、1−17……2入力NANDゲート、2−1……7
ビット・バイナリ・カウンタ、2−1……バイナリ・カ
ウンタ・2−1がリセットされる直前の第1ビットから
第5ビットの値を格納するレジスタ、2−3……リセッ
ト制御部、2−4……カウント・クロック入力端子、2
−5……マイクロコンピュータのシステム・リセット時
にロウ・レベルになる端子、2−6……2入力ANDゲー
ト、2−71〜2−75……D型フリップ・フロップ、2−
81〜2−85……EXNORゲート(排他的論理和の反転)2
−9……5入力ANDゲート、2−10……入力NANDゲー
ト、2−11……2入力ANDゲート、2−12……インバー
タ、2−13……2入力ANDゲート、2−14,2−15,2−16
……C,C端子に反転関係のクロックを入れ、C端子に与
えられるクロックの立上りエッジ毎に、Q出力を反転ま
た、R端子にロウ・レベルの信号を与えるとQ出力がロ
ウ・レベルにリセットされるバイナリ・フリップ・フロ
ップ、2−17……3入力NANDゲート、2−18……2入力
NANDゲート、2−19……インバータ、2−20……バイナ
リ・カウンタ2−1をリセットする命令を実行する際、
第4図の信号Aが与えられる端子、2−21……1−20と
同様に信号Bが与えられる端子、2−22……1−20と同
様に信号Cが与えられる端子、2−23……バイナリ・カ
ウンタの最高位ビットのQ出力端子、5−1……(K)
ビット・バイナリ・カウンタ、5−2……リセット制御
部、5−3……マイクロコンピュータのシステム・リセ
ット時にロウ・レベルになる端子、5−4……kビット
・バイナリ・カウンタをリセットする命令を実行する
と、一時的にロウ・レベルとなる端子、5−5……カウ
ント・クロック入力端子、5−6……バイナリ・カウン
タの最高位ビットのQ出力。1 and 2 are circuit diagrams of the first and second embodiments of the present invention, FIG. 3 is a timing chart of signals used in the first embodiment, and FIG. 4 is a second embodiment. FIG. 5 is a timing diagram of signals used, and FIG. 5 is a circuit diagram of a conventional example. 1-1 …… 7-bit binary counter 1-2 ……
The first just before the binary counter 1-1 is reset
Register that stores the value of the 5th bit from bit 1-3
...... Reset controller, 1-4 …… Count clock input terminal that divides the system clock, 1-5…
… Terminals that go low when microcomputer system is reset, 1-6 …… 2-input AND gate, 1
-71 to 1-75, 1-81 to 1-85, 1-91 to 1-95 ... When the R terminal becomes low level, the Q output is reset to low level and the signal applied to the C terminal rises. D on the falling edge
D-type flip-flop in which data input from the terminal is transmitted to the Q terminal, 1-101 to 1-105 …… 3 input AND gate, 1-111 to 1-115 …… 3 input NOR gate, 1-121∼
1-125 ... 2-input OR gate, 1-13 ... 5-input NAND gate, 1-14 ... Terminal to which signal B of FIG. 3 is given when executing an instruction to reset the binary counter 1-1 , 1-15 ... the terminal to which the signal A is given in the same manner as 1-14, 1-16 ... the most significant bit Q of the binary counter
Output terminal, 1-17 …… 2 input NAND gate, 2-1 …… 7
Bit binary counter, 2-1 ... Register for storing values of 1st bit to 5th bit immediately before resetting binary counter 2-1 2-3 ... Reset control unit, 2-4 ...... Count clock input terminals, 2
-5 ... a terminal that becomes low level when the system of the microcomputer is reset, 2-6 ... 2-input AND gate, 2-71 to 2-75 ... D-type flip-flop, 2-
81 to 2-85 …… EXNOR gate (inversion of exclusive OR) 2
-9 ... 5-input AND gate, 2-10 ... input NAND gate, 2-11 ... 2-input AND gate, 2-12 ... inverter, 2-13 ... 2-input AND gate, 2-14,2 -15,2-16
...... Inverting related clocks are input to the C and C terminals, and the Q output is inverted at every rising edge of the clock applied to the C terminal. Also, when a low level signal is applied to the R terminal, the Q output becomes low level. Binary flip-flop to be reset, 2-17 …… 3 input NAND gate, 2-18 …… 2 input
NAND gate, 2-19 ... Inverter, 2-20 ... When executing the instruction to reset the binary counter 2-1
The terminal to which the signal A of FIG. 4 is applied, the terminal to which the signal B is applied similarly to 2-21 ... 1-20, the terminal to which the signal C is applied similarly to 2-22 ... 1-20, 2-23 ...... Q output terminal of the most significant bit of the binary counter, 5-1 (K)
Bit-binary counter, 5-2 ... Reset control section, 5-3 ... Terminal that goes to low level at system reset of microcomputer, 5-4 ... Command to reset k-bit binary counter When executed, it temporarily becomes low level, 5-5 ... Count clock input terminal, 5-6 ... Q output of highest bit of binary counter.
Claims (1)
ウント・クロックを計数するとともに、この計数結果が
オーバーフローする以前に所定の命令でリセットされ、
オーバーフローしたときにはリセット信号を発生するK
ビット・バイナリ・カウンタを有し、前記オーバーフロ
ー時のリセット信号に応答してマイクロコンピュータに
システム・リセットをかけるようにしたソフトウェアの
暴走監視タイマにおいて、前記Kビット・バイナリ・カ
ウンタが前記所定の命令でリセットされ、そのリセット
毎に第Lビット目から第Mビット目(0≦L≦M<K)
までのリセット直前の計数値出力がそれぞれ対応するN
ビット・シフトレジスタに格納されてシフトされ、これ
らNビット・シフトレジスタの各ビット値がそれぞれ同
一値になるとシステム・リセット信号を発生する第1の
リセット制御手段、または前記リセット直前の計数値出
力がそれぞれ対応するD型フリップ・フロップに格納さ
れこの格納された値と次のリセット時の直前の計数値と
がそれぞれ一致する毎にこの一致信号がnビット・バイ
ナリ・カウンタに供給されて計数され、あらかじめ定め
た所定値になるとシステム・リセット信号を発生する第
2のリセット制御手段のいずれか一方を備え、プログラ
ムの暴走が無限ループとなり、かつそのループの中に前
記Kビット・バイナリ・カウンタをリセットする前記所
定の命令が含まれているとき、この命令が少なくともN
回実行される毎に前記リセット直前の計数値出力が常に
同一値であれば、その後に実行される前記所定の命令に
よるリセットを前記第1または第2のリセット制御手段
のいずれか一方で無効にして前記Kビット・バイナリ・
カウンタをオーバーフローさせ前記無限ループから抜け
ることを特徴とするソフトウェアの暴走監視タイマ。1. A count clock obtained by dividing a system clock is counted and reset by a predetermined instruction before the count result overflows,
K that generates a reset signal when overflow occurs
In a software runaway monitoring timer having a bit binary counter and adapted to perform a system reset on a microcomputer in response to a reset signal at the time of overflow, the K bit binary counter is It is reset, and at every reset, the Lth bit to the Mth bit (0 ≦ L ≦ M <K)
Count value output just before resetting corresponds to N
The first reset control means for generating a system reset signal when the bit values stored in the bit shift register are shifted and the respective bit values of these N bit shift registers have the same value, or the count value output just before the reset is output. This coincidence signal is supplied to the n-bit binary counter and counted each time the stored value stored in the corresponding D-type flip-flop and the stored count value immediately before the next reset coincide with each other. One of the second reset control means for generating a system reset signal when it reaches a predetermined value is provided, and the runaway of the program becomes an infinite loop, and the K-bit binary counter is reset in the loop. If the predetermined instruction to execute is included, this instruction is at least N
If the count value output immediately before the reset is always the same value every time it is executed, the reset by the predetermined command executed thereafter is invalidated by either the first or the second reset control means. The above K-bit binary
A software runaway monitoring timer characterized by overflowing a counter and exiting from the infinite loop.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP63272217A JPH0743658B2 (en) | 1988-10-27 | 1988-10-27 | Software runaway monitoring timer |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP63272217A JPH0743658B2 (en) | 1988-10-27 | 1988-10-27 | Software runaway monitoring timer |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH02118741A JPH02118741A (en) | 1990-05-07 |
| JPH0743658B2 true JPH0743658B2 (en) | 1995-05-15 |
Family
ID=17510745
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP63272217A Expired - Lifetime JPH0743658B2 (en) | 1988-10-27 | 1988-10-27 | Software runaway monitoring timer |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0743658B2 (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7417799B2 (en) | 2003-08-04 | 2008-08-26 | Genoa Color Technologies Ltd. | Multi-primary color display |
| US8885120B2 (en) | 2001-06-11 | 2014-11-11 | Genoa Color Technologies Ltd. | Liquid crystal display device using a color-sequential method wherein the number of different colored LEDs is less than the number of primary colors used in the display |
| US9196203B2 (en) | 2001-06-11 | 2015-11-24 | Samsung Display Co., Ltd. | Device and system for a multi-color sequential LCD panel wherein the number of colors in a sequence of display colors is greater than the number of LED colors |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS6133552A (en) * | 1984-07-25 | 1986-02-17 | Nec Corp | Information processor |
| JPS6359637A (en) * | 1986-08-29 | 1988-03-15 | Nec Corp | Processor operation monitoring circuit |
-
1988
- 1988-10-27 JP JP63272217A patent/JPH0743658B2/en not_active Expired - Lifetime
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8885120B2 (en) | 2001-06-11 | 2014-11-11 | Genoa Color Technologies Ltd. | Liquid crystal display device using a color-sequential method wherein the number of different colored LEDs is less than the number of primary colors used in the display |
| US9196203B2 (en) | 2001-06-11 | 2015-11-24 | Samsung Display Co., Ltd. | Device and system for a multi-color sequential LCD panel wherein the number of colors in a sequence of display colors is greater than the number of LED colors |
| US7417799B2 (en) | 2003-08-04 | 2008-08-26 | Genoa Color Technologies Ltd. | Multi-primary color display |
Also Published As
| Publication number | Publication date |
|---|---|
| JPH02118741A (en) | 1990-05-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US4179737A (en) | Means and methods for providing greater speed and flexibility of microinstruction sequencing | |
| US5684728A (en) | Data processing system having a saturation arithmetic operation function | |
| US4462072A (en) | Clock system having a stall capability to enable processing of errors | |
| JPS6338725B2 (en) | ||
| GB2241799A (en) | Supervision of microprocessors | |
| JPH0743658B2 (en) | Software runaway monitoring timer | |
| JPH1117531A (en) | Digital delay circuit and digital PLL circuit | |
| JPH057738B2 (en) | ||
| US4206458A (en) | Numerical display system for electronic instrument | |
| JPH083514B2 (en) | Counter test equipment | |
| JPS5935533B2 (en) | Asynchronous numerical control counter | |
| JPH0113129B2 (en) | ||
| JP2924968B2 (en) | Time interactive simulation device | |
| US4468133A (en) | Electronic timepiece | |
| JPS593563A (en) | Timer for evaluation of computer system | |
| EP0305530A1 (en) | High-speed floating point arithmetic unit | |
| JPH04255028A (en) | microprocessor | |
| JP3070014B2 (en) | Shift circuit | |
| JP3225613B2 (en) | Microcomputer | |
| JPS6049938B2 (en) | Microprogram loop control device | |
| JP3085690B2 (en) | Central processing unit | |
| CN119829492A (en) | A control circuit and electronic device for interrupt signal | |
| RU1789977C (en) | Uniform structure register | |
| JPS62271022A (en) | Microprogram controller | |
| SU1663607A1 (en) | Digital function generator |