JPS6225794Y2 - - Google Patents
Info
- Publication number
- JPS6225794Y2 JPS6225794Y2 JP1981127556U JP12755681U JPS6225794Y2 JP S6225794 Y2 JPS6225794 Y2 JP S6225794Y2 JP 1981127556 U JP1981127556 U JP 1981127556U JP 12755681 U JP12755681 U JP 12755681U JP S6225794 Y2 JPS6225794 Y2 JP S6225794Y2
- Authority
- JP
- Japan
- Prior art keywords
- circuit
- output
- oscillation
- cpu
- reset
- 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
Links
Landscapes
- Debugging And Monitoring (AREA)
Description
【考案の詳細な説明】
本考案はマイクロコンピユータが暴走したとき
に動作するリセツト回路に関する。[Detailed Description of the Invention] The present invention relates to a reset circuit that operates when a microcomputer goes out of control.
マイクロコンピユータ(以下マイコンと云う)
がプログラムのバグや外乱ノイズ等によつて暴走
し、プログラムが無限ループに落ち込んだり、ス
タツクが破壊されて全く関係のないアドレスに飛
んだりすることがある。 Microcomputer (hereinafter referred to as microcomputer)
The program may run out of control due to a bug in the program, disturbance noise, etc., causing the program to fall into an infinite loop, or the stack to be destroyed and the program to jump to a completely unrelated address.
従来からこのようなマイコンの暴走を防ぐため
に暴走を検知してCPUをリセツトする自動リセ
ツト回路が付属回路として取付けられている。 Conventionally, in order to prevent such a runaway of a microcomputer, an automatic reset circuit that detects runaway and resets the CPU has been installed as an accessory circuit.
本発明は、構成がより簡略で低コストであり且
つ耐ノイズ性に憂れた自動リセツト回路を提供す
るものである。 The present invention provides an automatic reset circuit which has a simpler structure, is lower in cost, and has poor noise resistance.
本考案によるマイクロコンピユータのリセツト
回路は、CPU1のクリア出力信号Aの有無を検
出する検出回路9と、2つのナンド機能素子1
1,12が縦列接続され、その接続点から一方の
素子の入力に帰還する発振用時定数回路(抵抗
R3,R4、コンデンサC2)及び他方の素子の出力か
ら上記一方の素子の入力に帰還するシユミツトト
リガ用帰還回路(抵抗R4,R5)が夫々設けられて
いる発振回路10とを具備している。 The microcomputer reset circuit according to the present invention includes a detection circuit 9 that detects the presence or absence of the clear output signal A of the CPU 1, and two NAND function elements 1.
1 and 12 are connected in series, and the oscillation time constant circuit (resistance) returns from the connection point to the input of one element.
R 3 , R 4 , capacitor C 2 ) and a Schmitt trigger feedback circuit (resistors R 4 , R 5 ) for feeding back from the output of the other element to the input of the one element. are doing.
上記検出回路9の出力を上記発振回路10の2
つのナンド機能素子11,12の夫々の入力に与
えて、この発振回路10を制御する。通常はハイ
レベルの電位が上記発振回路10から上記CPU
1のリセツト入力に与えられ、上記クリア出力信
号が欠如したとき、上記発振回路10が起動さ
れ、その発振出力が上記CPU1のリセツト入力
に与えられるように構成してある。 The output of the detection circuit 9 is converted into two of the oscillation circuits 10.
The oscillation circuit 10 is controlled by applying the signal to the inputs of the two NAND function elements 11 and 12, respectively. Normally, a high level potential is transmitted from the oscillation circuit 10 to the CPU.
When the clear output signal is absent, the oscillation circuit 10 is activated and its oscillation output is applied to the reset input of the CPU 1.
この簡単な構成により、マイクロコンピユータ
の自動リセツトを可能にし、また同時にパワーオ
ンリセツトも可能にしている。 This simple configuration allows the microcomputer to be automatically reset, and at the same time allows power-on reset.
以下本考案を従来技術と対比して説明する。 The present invention will be explained below in comparison with the prior art.
第1図は従来から用いられている自動リセツト
回路の回路図で、第2図はその動作を示すタイム
チヤートである。第1図で、CPU(中央処理装
置)1のクリア出力端子からは、1つのプログラ
ムルーチンが終了するごとにプログラムカウンタ
をクリアするクリア信号(第2図A、周期
t)が出力される。このクリア信号は負論理オア
ゲート2を介してタイマー用の外部カウンタ3の
クリア入力CLRに与えられるので、CPU1が正
常に動作しているときには、カウンタ3は周期t
でクリアされ続け、カウンタ3の出力QDが高レ
ベル“H”になることはない。 FIG. 1 is a circuit diagram of a conventionally used automatic reset circuit, and FIG. 2 is a time chart showing its operation. In FIG. 1, a clear output terminal of a CPU (central processing unit) 1 outputs a clear signal (period t in FIG. 2A) that clears a program counter every time one program routine ends. This clear signal is given to the clear input CLR of the external counter 3 for the timer via the negative logic OR gate 2, so when the CPU 1 is operating normally, the counter 3 has a period of t.
The output QD of the counter 3 will never reach the high level "H".
CPU1が異常動作して、プログラムが無限ル
ープに飛び込み、クリア信号CLRが第2図Aの
如く出なくなると、カウンタ3はタイマ用クロツ
クT−CKを計数し、周期tよりも長いT時間後
にQD出力がHレベルに立上る。この出力はイン
バータ4を介してCR時定数回路5に与えられ、
微小時間遅延されてから、オアゲート2を通つて
上記カウンタ3のクリア入力に帰還される。従つ
てカウンタ3のQD出力は低レベル“L”に戻
り、結局、第2図Bに示す検出パルスが形成され
る。この検出パルスはCPU1のプログラムが無
限ループに落込んだことを代表している。 When the CPU 1 malfunctions and the program jumps into an infinite loop, and the clear signal CLR is no longer output as shown in Figure 2 A, the counter 3 counts the timer clock T-CK, and after a time T longer than the cycle t, the counter 3 counts the timer clock T-CK. D output rises to H level. This output is given to the CR time constant circuit 5 via the inverter 4,
After being delayed by a minute time, it is fed back to the clear input of the counter 3 through the OR gate 2. Therefore, the Q D output of the counter 3 returns to the low level "L", and as a result, the detection pulse shown in FIG. 2B is formed. This detection pulse represents that the CPU1 program has fallen into an infinite loop.
第2図Bの検出パルスは、リセツト動作のチヤ
タリングを防止するシユミツト回路6を通じて第
2図Cに示すLレベルのリセツトパルスとして
CPU1のリセツト入力に与えられ、これ
によつてCPU1をリセツトし、その後リセツト
入力をHレベルに戻してCPU1を再起動させ
る。 The detection pulse shown in FIG. 2B is converted into an L-level reset pulse shown in FIG. 2C through a Schmitt circuit 6 that prevents chatter during the reset operation.
This is applied to the reset input of the CPU 1, thereby resetting the CPU 1, and then returning the reset input to the H level to restart the CPU 1.
第1図に示す自動リセツト回路は、カウンタ
3、シユミツト回路6等が必要で、更にタイマ用
クロツクT−CKの発生回路が必要であり、回路
構成が複雑でコスト高である。またCPU1が正
常に動作しているとき、タイマー用クロツクT−
CKを発生する発振器の電気的発振ノイズによつ
てCPUが誤動作する恐れもある。更に、第1図
の回路はシステムの電源を投入したときの自動リ
セツトの機能がないので、パワーオン・リセツト
の回路を別に付属させなければならない。 The automatic reset circuit shown in FIG. 1 requires a counter 3, a Schmitt circuit 6, etc., and also a generation circuit for the timer clock T-CK, resulting in a complicated circuit configuration and high cost. Also, when CPU1 is operating normally, the timer clock T-
There is also a risk that the CPU may malfunction due to electrical oscillation noise from the oscillator that generates CK. Furthermore, since the circuit of FIG. 1 does not have an automatic reset function when the system is powered on, a power-on reset circuit must be provided separately.
次に第3図は本考案の実施例の自動リセツト回
路の回路図で、第4図はその動作を示すタイムチ
ヤートである。第3図のリセツト回路は検出回路
9及び発振回路10から構成されている。CPU
1が正常に動作しているときには、既述のように
第4図Aに示すクリア信号が一定周期tで
出力されている。 Next, FIG. 3 is a circuit diagram of an automatic reset circuit according to an embodiment of the present invention, and FIG. 4 is a time chart showing its operation. The reset circuit shown in FIG. 3 is composed of a detection circuit 9 and an oscillation circuit 10. CPU
1 is operating normally, the clear signal shown in FIG. 4A is output at a constant period t, as described above.
クリア信号は検出回路9のトランジスタQ1に
与えられ、このトランジスタQ1をオン・オフさ
せる。トランジスタQ1の出力はコンデンサC1に
与えられ、第4図Bのd〜eの区間に示すよう
に、コンデンサC1が充電される。従つてd〜e
の正常動作区間ではコンデンサC1の端子電圧は
高レベルである。コンデンサC1の端子電圧は抵
抗R1,R2から成る分圧回路を介してトランジス
タQ2に与えられ、このトランジスタQ2をオンさ
せている。従つてトランジスタQ2の出力は第4
図Cに示すように低レベルになつている。 The clear signal is applied to the transistor Q 1 of the detection circuit 9, turning this transistor Q 1 on and off. The output of the transistor Q1 is applied to the capacitor C1 , and the capacitor C1 is charged as shown in the section from d to e in FIG. 4B. Therefore d~e
In the normal operating range of , the terminal voltage of capacitor C 1 is at a high level. The terminal voltage of capacitor C 1 is applied to transistor Q 2 via a voltage divider circuit consisting of resistors R 1 and R 2 to turn on transistor Q 2 . Therefore, the output of transistor Q2 is the fourth
As shown in Figure C, the level has become low.
トランジスタQ2の低レベル出力は、発振回路
10を構成しているナンドゲート11,12の
夫々の入力に発振禁止信号として与えられる。こ
れらのナンドゲート11,12は直列に結合され
ると共に、抵抗R3,R4及びコンデンサC2から成
る時定数回路がナンドゲート11の入力と出力と
の間に設けられ、無安定マルチバイブレータとし
て動作する。また抵抗R4とR5とから成る分圧回
路による帰還でシユミツトトリガ機能が付与され
ている。 The low level output of the transistor Q 2 is given as an oscillation prohibition signal to the respective inputs of NAND gates 11 and 12 forming the oscillation circuit 10. These NAND gates 11 and 12 are coupled in series, and a time constant circuit consisting of resistors R 3 and R 4 and a capacitor C 2 is provided between the input and output of the NAND gate 11, and operates as an astable multivibrator. . Additionally, a Schmitt trigger function is provided by feedback using a voltage divider circuit consisting of resistors R4 and R5 .
CPU1が異常動作して、プログラムが無限ル
ープに落ち込み、第4図Aの時点e〜iのように
クリア信号が出力されなくなると、トラン
ジスタQ1がオフし、コンデンサC1が第4図Bの
如く放電し、これによつてトランジスタQ2が第
4図Cの如くオフする。この結果、トランジスタ
Q2の出力が高レベルになり、発振回路10が動
作し始める。発振開始前には、コンデンサC2は
ナンドゲート11,12の高レベル出力で正に充
電されている。ナンドゲート11,12の入力が
第4図Cの如く時点fで高レベルになると、ナン
ドゲート11の入力が(1,1)となり、その出
力が第4図Dの如く低レベルに反転する。このた
め、コンデンサC2の端子電圧が抵抗R3を通じて
徐々に低下する。 When the CPU 1 malfunctions and the program falls into an infinite loop, and the clear signal is no longer output as shown at times e to i in Figure 4A, the transistor Q1 is turned off and the capacitor C1 is turned off as shown in Figure 4B. As a result, transistor Q2 is turned off as shown in FIG. 4C. As a result, the transistor
The output of Q2 becomes high level, and the oscillation circuit 10 starts operating. Before the start of oscillation, capacitor C 2 is positively charged by the high level outputs of NAND gates 11 and 12. When the inputs of the NAND gates 11 and 12 become high level at time f as shown in FIG. 4C, the inputs of the NAND gate 11 become (1, 1) and the output is inverted to a low level as shown in FIG. 4D. Therefore, the terminal voltage of capacitor C 2 gradually decreases through resistor R 3 .
そして一定時間T後にはナンドゲート11の入
力が(1,0)となり、出力が第4図Dの時点g
のように高レベルに復帰する。このときナンドゲ
ート12の入力は(1,1)となり、その出力が
第4図Eの時点gのように低レベルに落ちる。こ
のナンドゲート12の低レベル出力はリセツト信
号としてCPU1のリセツト入力に与えら
れ、CPU1がリセツトされる。 Then, after a certain period of time T, the input of the NAND gate 11 becomes (1, 0), and the output becomes the point g in Fig. 4D.
to return to a high level. At this time, the input of the NAND gate 12 becomes (1, 1), and its output drops to a low level as at time g in FIG. 4E. The low level output of the NAND gate 12 is applied as a reset signal to the reset input of the CPU 1, and the CPU 1 is reset.
リセツト後には、コンデンサC2がナンドゲー
トC2の高レベル出力でもつて充電され、その端
子電圧は徐々に上昇するから、一定時間後にナン
ドゲート11の入力が(1,1)となつて、その
出力が第4図Dの時点hの如く再び低レベルにな
る。この結果、ナンドゲート12の入力が(1,
0)となり、その出力が第4図Eの時点hの如く
高レベルになる。この高レベル出力はCPU1の
リセツト入力に与えられ、CPU1が再スタート
する。 After the reset, the capacitor C2 is charged with the high level output of the NAND gate C2 , and its terminal voltage gradually rises, so after a certain period of time the input of the NAND gate 11 becomes (1, 1) and its output becomes The level becomes low again as at time h in FIG. 4D. As a result, the input of the NAND gate 12 is (1,
0), and its output becomes a high level as at time h in FIG. 4E. This high level output is applied to the reset input of CPU1, and CPU1 restarts.
CPU1が再スタートしてからγ時間後には第
4図Aの時点iの如くクリア信号が出力さ
れるので、検出回路9の出力は第4図Cの時点i
の如く低レベルになり、発振回路10の動作(リ
セツト信号の発生)は禁止される。このため
CPUが再スタートしてから始めのクリア信号を
出すまでの期間γよりも、発振回路10の低レベ
ルの発振出力の期間Tが長くなるように、抵抗
R3〜R5及びコンデンサC2の定数が定められてい
る。 After γ time after the CPU 1 is restarted, a clear signal is outputted as at time i in FIG. 4A, so the output of the detection circuit 9 is at time i in FIG. 4C.
The signal becomes a low level as shown in FIG. For this reason
The resistor is connected so that the period T of the low-level oscillation output of the oscillation circuit 10 is longer than the period γ from when the CPU restarts to when it issues the first clear signal.
Constants for R 3 to R 5 and capacitor C 2 are determined.
なお抵抗R4,R5は発振回路にシユミツトトリ
ガの効果を持たせるために用いられていて、抵抗
R4とR5とで定まるレベルがナンドゲート11の
入力スレツシヨールドレベルより低下すると第4
図D,Eの時点gのようにナンドゲート11の出
力が高レベルに反転し、ナンドゲート12の出力
が低レベルに反転する。そしてナンドゲート12
の低レベル出力は抵抗R5を通じてナンドゲート
1の入力に正帰還される。このシユミツトトリガ
効果により、リセツト信号のグリツジ(チヤツタ
リング)が防止され、安定なリセツトを行うこと
ができる。 Note that resistors R 4 and R 5 are used to give the oscillation circuit a Schmitt trigger effect.
When the level determined by R 4 and R 5 falls below the input threshold level of the NAND gate 11, the fourth
As at time g in Figures D and E, the output of the NAND gate 11 is inverted to high level, and the output of NAND gate 12 is inverted to low level. and nand gate 12
The low level output of is positively fed back to the input of NAND gate 1 through resistor R5 . This shot trigger effect prevents glitches (chattering) in the reset signal and allows stable reset.
次に第4図の時点aにおいて電源スイツチをオ
ンにしたときの動作について説明する。電源オン
では、第4図A〜Dに示すように時点bで電源電
圧が立上る。このとき検出回路10の出力は第4
図Cの如く高レベルに保たれ、発振回路10が動
作する。すなわち、発振回路10のコンデンサ
C2がナンドゲート11の高レベル出力でもつて
抵抗R6を通じて充電され、ほぼT時間後にナン
ドゲート11の一つの入力がスレツシヨールドレ
ベルを越えると、その出力が時点cで低レベルに
反転する。この間の電源オンから時点cまでの区
間ではナンドゲート12の出力が低レベルに保た
れ、これによつてCPU1がリセツトされる。時
点cでナンドゲート12の出力が高レベルになる
と、CPU1がスタートし、γ時間後にクリア信
号が第4図Aの如く出力される。このクリア信号
を受けて検出回路9の出力が第4図Cの時点dの
如く低レベルになるので、これにより発振回路1
0の動作は停止され、またナンドゲート12が閉
じられてCPU1の新たなリセツトは禁止され
る。 Next, the operation when the power switch is turned on at time a in FIG. 4 will be described. When the power is turned on, the power supply voltage rises at time b as shown in FIGS. 4A to 4D. At this time, the output of the detection circuit 10 is
The signal is kept at a high level as shown in FIG. C, and the oscillation circuit 10 operates. That is, the capacitor of the oscillation circuit 10
C 2 is charged through resistor R 6 with the high level output of NAND gate 11, and when one input of NAND gate 11 exceeds the threshold level after approximately T time, its output flips to a low level at time c. During this interval from power-on to time point c, the output of the NAND gate 12 is kept at a low level, thereby resetting the CPU 1. When the output of the NAND gate 12 becomes high level at time c, the CPU 1 starts, and a clear signal is outputted after γ time as shown in FIG. 4A. In response to this clear signal, the output of the detection circuit 9 becomes low level as shown at time d in FIG.
The operation of CPU 0 is stopped, and NAND gate 12 is closed to prohibit a new reset of CPU 1.
本考案は上述の如く構成したもので、従来技術
で用いられていたクリア出力信号の欠如を検出す
るカウンタ、このカウンタのクロツクを発生する
クロツク発生器及び上記カウンタが形成するリセ
ツト信号のチヤツタリングを防止するシユミツト
回路等が不要であつて、極めて簡単な構成で低コ
ストのリセツト回路を得ることができる。また電
源オン時にも動作するので、パワーオンリセツト
回路を兼用することもできる。 The present invention is constructed as described above, and includes a counter that detects the absence of a clear output signal, a clock generator that generates a clock for this counter, and a reset signal generated by the counter that prevents chatter. This eliminates the need for a Schmitt circuit or the like, and a low-cost reset circuit can be obtained with an extremely simple configuration. Furthermore, since it operates even when the power is turned on, it can also be used as a power-on reset circuit.
第1図は従来から知られているマイコンの自動
リセツト回路の回路図、第2図は第1図の動作を
示すタイムチヤート、第3図は本考案の実施例の
自動リセツト回路の回路図、第4図は第3図の動
作を示すタイムチヤートである。
なお図面に用いられている符号で、1……
CPU、9……検出回路、10……発振回路、1
1,12……ナンドゲート、である。
FIG. 1 is a circuit diagram of a conventionally known automatic reset circuit for a microcomputer, FIG. 2 is a time chart showing the operation of FIG. 1, and FIG. 3 is a circuit diagram of an automatic reset circuit according to an embodiment of the present invention. FIG. 4 is a time chart showing the operation of FIG. 3. In addition, the symbols used in the drawings are 1...
CPU, 9...Detection circuit, 10...Oscillation circuit, 1
1, 12...Nand gate.
Claims (1)
回路と、2つのナンド機能素子が縦列接続され、
その接続点から一方の素子の入力に帰還する発振
用時定数回路及び他方の素子の出力から上記一方
の素子の入力に帰還するシユミツトトリガ用帰還
回路が夫々設けられている発振回路とを夫々具備
し、 上記検出回路の出力を上記発振回路の2つのナ
ンド機能素子の夫々の入力に与えてこの発振回路
を制御し、通常はハイレベルの電位が上記発振回
路から上記CPUのリセツト入力に与えられ、上
記クリア出力信号が欠如したとき、上記発振回路
が起動され、その発振出力が上記CPUのリセツ
ト入力に与えられるように構成したマイクロコン
ピユータのリセツト回路。[Claims for Utility Model Registration] A detection circuit that detects the presence or absence of a clear output signal of the CPU and two NAND function elements are connected in series,
Each of the oscillation circuits includes an oscillation time constant circuit that feeds back from the connection point to the input of one of the elements, and a Schmitt trigger feedback circuit that feeds back from the output of the other element to the input of the one element. , the output of the detection circuit is applied to the respective inputs of the two NAND functional elements of the oscillation circuit to control the oscillation circuit, and normally a high level potential is applied from the oscillation circuit to the reset input of the CPU; A reset circuit for a microcomputer configured such that when the clear output signal is absent, the oscillation circuit is activated and its oscillation output is applied to the reset input of the CPU.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP12755681U JPS5836448U (en) | 1981-08-28 | 1981-08-28 | Microcomputer reset circuit |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP12755681U JPS5836448U (en) | 1981-08-28 | 1981-08-28 | Microcomputer reset circuit |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS5836448U JPS5836448U (en) | 1983-03-09 |
| JPS6225794Y2 true JPS6225794Y2 (en) | 1987-07-01 |
Family
ID=29921281
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP12755681U Granted JPS5836448U (en) | 1981-08-28 | 1981-08-28 | Microcomputer reset circuit |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPS5836448U (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS58191053A (en) * | 1982-05-01 | 1983-11-08 | Diesel Kiki Co Ltd | Resetting circuit of microcomputer |
| JPH0445065Y2 (en) * | 1987-09-11 | 1992-10-23 |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS5215944B2 (en) * | 1974-12-13 | 1977-05-06 | ||
| JPS5557956A (en) * | 1978-10-25 | 1980-04-30 | Nissan Motor Co Ltd | Malfunction prevention unit of microcomputer |
-
1981
- 1981-08-28 JP JP12755681U patent/JPS5836448U/en active Granted
Also Published As
| Publication number | Publication date |
|---|---|
| JPS5836448U (en) | 1983-03-09 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP2003060490A (en) | Clock stop detection circuit and semiconductor device | |
| US4617509A (en) | Voltage regulator for a microcomputer system | |
| JPS63644A (en) | Watch dog timer circuit | |
| JPS6277653A (en) | Malfunction preventing circuit | |
| JP2722348B2 (en) | Oscillation circuit | |
| JPS58158726A (en) | Controller for microcomputer | |
| JPH0143650Y2 (en) | ||
| JPS59146349A (en) | Automatic return method of microcomputer | |
| KR900004178Y1 (en) | Reseting circuit for micro processer | |
| JPH066627Y2 (en) | Malfunction prevention circuit for momentary power failure of the sensor | |
| JPH0132139Y2 (en) | ||
| JPS6243390Y2 (en) | ||
| KR920004986Y1 (en) | Reset combined watchdog circuit | |
| JPH0313614B2 (en) | ||
| JPH0418031Y2 (en) | ||
| KR0155045B1 (en) | How to Implement Watchdog Timers in Unmanned Security Systems | |
| JPH063454Y2 (en) | Memory backup circuit | |
| JPH0334689B2 (en) | ||
| JPS59117647A (en) | Microcomputer malfunction prevention method | |
| JPH0431620Y2 (en) | ||
| JPH0431621Y2 (en) | ||
| JPH0342496Y2 (en) | ||
| JPH05218834A (en) | Reset circuit | |
| JPH0157810B2 (en) | ||
| JPH0224287Y2 (en) |