JPH04209038A - Single-chip microcomputer - Google Patents

Single-chip microcomputer

Info

Publication number
JPH04209038A
JPH04209038A JP2340924A JP34092490A JPH04209038A JP H04209038 A JPH04209038 A JP H04209038A JP 2340924 A JP2340924 A JP 2340924A JP 34092490 A JP34092490 A JP 34092490A JP H04209038 A JPH04209038 A JP H04209038A
Authority
JP
Japan
Prior art keywords
watchdog timer
register
timer control
control register
error correction
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.)
Pending
Application number
JP2340924A
Other languages
Japanese (ja)
Inventor
Naoshi Ogura
直志 小倉
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 JP2340924A priority Critical patent/JPH04209038A/en
Publication of JPH04209038A publication Critical patent/JPH04209038A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To eliminate influence upon the operation of a watchdog timer by providing plural watchdog timer control registers and making corrections by remaining watchdog timer control registers. CONSTITUTION:A CPU #6 when writing data in a watchdog timer control register #2 writes the same data in an error correcting register #8 at the same time. An error correcting circuit 9 compares the values in the watchdog timer control register #2 and error correcting register #8 with each other and corrects the value in the control register #2 with the value of the correcting register #8 if the watchdog timer control register #2 is rewritten illegally.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はシングルチップ・マイクロコンピュータに関し
、特にシングルチップ・マイクロコンピュータの異常動
作検出回路に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a single-chip microcomputer, and more particularly to an abnormal operation detection circuit for a single-chip microcomputer.

〔従来の技術〕[Conventional technology]

従来のシングルチップ・マイクロコンピュータでは、ウ
ォッチドッグ・タイマ制御用のレジスタを1個しか持た
なかった。
Conventional single-chip microcomputers have only one register for watchdog timer control.

ウォッチドッグ・タイマとはシングルチップ・マイクロ
コンピュータの異常動作を検出するための回路で第3図
のように構成される。フリー・ランニング・タイマ#1
と、ウォッチドッグ・タイマ制御レジスタ#2とから構
成され、ウォッチドッグ・タイマ制御レジスタ#2の制
御ビット#3をセットすることでフリー・ランニング・
カウンタ#1がカウント動作を開始し、ある一定時間経
過後フリー・ランニング・カウンタ#1がオーバ・フロ
ーするとウォッチドッグ・タイマ出力信号#4を出力し
てシングルチップ・マイクロコンピュータ#5のCPU
#6に異常動作を検出したことを知らせる。フリー・ラ
ンニング・タイマ#1は、ウォッチドッグ・タイマ制御
レジスタ#2の制御ビット#7に“l”の書き込^動作
を行うことでクリアされる。第4図のようにプログラム
中に、適宜ウォッチドッグ・タイマ制御レジスタ#2の
制御ビット#7に“1″を書き込む命令を挿入すること
により、正常動作時はウォッチドッグ・タイマ出力信号
#4を発生せずプログラムが正常動作していることが確
認できる。第5図のような異常動作時にはフリー・ラン
ニング・タイマ#1がオーバ・フローする前にクリアさ
れないため、ウォッチドッグ・タイマ出力信号#4がC
PU#6に出力され異常動作検出を知らせる。
The watchdog timer is a circuit for detecting abnormal operation of a single-chip microcomputer, and is configured as shown in FIG. Free running timer #1
and watchdog timer control register #2. Free running is enabled by setting control bit #3 of watchdog timer control register #2.
Counter #1 starts counting, and when free running counter #1 overflows after a certain period of time has elapsed, watchdog timer output signal #4 is output to the CPU of single-chip microcomputer #5.
Notify #6 that an abnormal operation has been detected. Free running timer #1 is cleared by writing "l" to control bit #7 of watchdog timer control register #2. As shown in Figure 4, by inserting an instruction to write "1" into control bit #7 of watchdog timer control register #2 as appropriate in the program, watchdog timer output signal #4 is set during normal operation. You can confirm that the program is operating normally without any occurrences. During abnormal operation as shown in Figure 5, free running timer #1 is not cleared before it overflows, so watchdog timer output signal #4 is
Output to PU#6 to notify abnormal operation detection.

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

第5図のような異常動作はシングルチップ・マイクロコ
ンピュータ内部のレジスタがノイズなどの影響により不
正に書き換えられたときに発生する。したがって、ウォ
ッチドッグ・タイマ制御レジスタ#2がノイズにより不
正に書き換えられることも考えられるが、従来のウォッ
チドッグ・タイマ内蔵シングルチップ・マイクロコンピ
ュータではノイズによるウォッチドッグ・タイマ制御レ
ジスタの書き換えに対してなんら対策がとられていない
。このため異常状態が発生しても検出できない。または
検出が遅れる可能性があるためシステムに致命的なダメ
ージを与えることになりかねず、なんらかの対策が望ま
れていた。
Abnormal operation as shown in FIG. 5 occurs when registers inside a single-chip microcomputer are illegally rewritten due to noise or the like. Therefore, it is conceivable that watchdog timer control register #2 may be illegally rewritten due to noise, but conventional single-chip microcomputers with a built-in watchdog timer do nothing to prevent the watchdog timer control register #2 from being rewritten due to noise. No measures have been taken. Therefore, even if an abnormal state occurs, it cannot be detected. Otherwise, detection may be delayed, which could cause fatal damage to the system, so some kind of countermeasure was desired.

〔発明の従来技術に対する相違点〕[Differences between the invention and the prior art]

上述した従来のウォッチドッグ・タイマ内蔵のシングル
チップ・マイクロコンピュータに対し、本発明のシング
ルチップ・マイクロコンピュータは複数個のウォッチド
ッグ・タイマ制御レジスタを持ち、そのうちの1個がノ
イズなどの影響により不正に書き換えられても残りのウ
ォッチドッグ・タイマ制御レジスタにより補正され、ウ
ォッチドッグ・タイマの動作に影響を与えないという相
違点を有する。
In contrast to the conventional single-chip microcomputer with a built-in watchdog timer described above, the single-chip microcomputer of the present invention has a plurality of watchdog timer control registers, one of which is corrupted due to the influence of noise. The difference is that even if it is rewritten, it will be corrected by the remaining watchdog timer control registers and will not affect the operation of the watchdog timer.

〔課題を解決するための手段〕[Means to solve the problem]

本発明のシングルチップ・マイクロコンピュータは、ウ
ォッチドッグ・タイマを制御するレジスタを複数個持ち
、ウォッチドッグ・タイマ制御レジスタのエラー訂正回
路を有する。
The single-chip microcomputer of the present invention has a plurality of registers for controlling a watchdog timer, and has an error correction circuit for the watchdog timer control register.

〔実施例〕〔Example〕

次に本発明について図面を参照して説明する。 Next, the present invention will be explained with reference to the drawings.

第1図は本発明の実施例1の構成図である。FIG. 1 is a configuration diagram of Embodiment 1 of the present invention.

CPU#6はウォッチドッグ・タイマ制御レジスタ#2
にデータを書き込むとき、同時にエラー訂正用レジスタ
#8に対しても同じデータを書き込む。エラー訂正回路
#9はウォッチドッグ・タイマ制御レジスタ#2、エラ
ー訂正用レジスタ#8に対して書き込み動作を行ってい
るときには動作を停止しているが、その他の時には常に
ウォッチドッグ・タイマ制御レジスタ#2.エラー訂正
用レジスタ#8の値を比較し、ウォッチドッグ・タイマ
制御レジスタ#2がノイズなどにより不正に書き換えら
れた場合はエラー訂正用レジスタ#8の値によりウォッ
チドッグ・タイマ制御レジスタ#2の値を訂正する。
CPU #6 is watchdog timer control register #2
When data is written to the error correction register #8, the same data is written to the error correction register #8 at the same time. Error correction circuit #9 stops operating when writing to watchdog timer control register #2 and error correction register #8, but at other times it is always in operation. 2. The value of error correction register #8 is compared, and if watchdog timer control register #2 is illegally rewritten due to noise etc., the value of watchdog timer control register #2 is changed by the value of error correction register #8. Correct.

第2図は本発明の実施例2の構成図である。FIG. 2 is a configuration diagram of a second embodiment of the present invention.

ウォッチドッグ・タイマ制御レジスタ#2に書き込むと
同時に、書き込むデータは符号圧縮回路#10により符
号圧縮されエラー訂正用レジスタ#11に書き込まれる
At the same time as writing to the watchdog timer control register #2, the data to be written is code-compressed by the code compression circuit #10 and written to the error correction register #11.

エラー訂正回路#12はウォッチドッグ・タイマ制御レ
ジスタ#2.エラー訂正用レジスタ#11に対して書き
込み動作を行っているときには動作を停止しているが、
その他の時には常にウォッチドッグ・タイマ制御レジス
タ#2.エラー訂正用レジスタ#11の値を比較しウォ
ッチドッグ・タイマ制御レジスタ#2がノイズなどによ
り不正に書き換えられた場合はエラー訂正用レジスタ#
11の値によりウォッチドッグ・タイマ制御レジスタ#
2の値を訂正する。
Error correction circuit #12 includes watchdog timer control register #2. Although the operation is stopped while writing to error correction register #11,
At all other times, watchdog timer control register #2. Compare the value of error correction register #11, and if watchdog timer control register #2 has been illegally rewritten due to noise etc., error correction register #11 is compared.
The value of watchdog timer control register #11
Correct the value of 2.

〔発明の効果〕〔Effect of the invention〕

以上説明したように、本発明はウォッチドッグ・タイマ
制御レジスタを複数個もつことにより、ウォッチドッグ
・タイマ制御レジスタがノイズなどの影響で不正に書き
換えられても正常にウォッチドッグ・タイマを動作させ
ることができるため、シングルチップ・マイクロコンピ
ュータを用いたシステムの安全性をより高めることが可
能である。
As explained above, by having a plurality of watchdog timer control registers, the present invention allows the watchdog timer to operate normally even if the watchdog timer control register is illegally rewritten due to noise or the like. This makes it possible to further improve the safety of systems using single-chip microcomputers.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の実施例1の構成図、第2図は本発明の
実施例2の構成図、第3図は従来技術の構成図、第4図
は正常動作時のプログラムの流れの例、第5図は異常動
作時のプログラムの流れの例である。 1・・・・・・フリー・ランニング・タイマ、2・旧・
・ウォッチドッグ・タイマ制御レジスタ、3・・・・・
・制御ビット、4・・・・・・ウォッチドッグ・タイマ
出力信号、5・・・・・・シングルチップ・マイクロコ
ンピュータ、6・・・・・・CPU、7・・・・・・制
御ビット、8・・・・・・エラー訂正用レジスタ、9・
・・・・・エラー訂正回路、10・・団・符号圧縮回路
、11・・・・・・エラー訂正用レジスタ、12・・・
・・・エラー訂正回路。 代理人 弁理士  内 原   音 射1図 r−−−−−−−−−−−−−−−−+++−″′″−
−+′″−−−−−コ■ l フッ−・ブシニングータイ78、エラーを丁正mレ
ジスタど、ウォッチトンク・タイ7皆趨甲し)スタ  
    タ、エラーtriIす、山^23、書ル昨ビヅ
ト 4、ウォッチドッグ・タイマエカ4!、9シシシグルチ
ソ2°・マイクロコンビ1−夕1、、cPt) 7−制置pヒ゛ット 1、フッ−・ランニシグ・タイ′?         
lρ、符号万ノ目同J42 ウォッチドツクタイマ棉i
t卸t、シ゛ヌタ    ff  エラー會T正mレジ
スク3・1鯉ヒ゛ツト               
   l?、エラー訂正回路44、ウオッチドレグ・タ
イVエヵ詰ノツ5 シシク冗テツク・マイクロコンピュ
−タ乙、CPU 7 @穆pビット 第3図 !、29− ラシニシゲ・タイマ ? ウォッチドッグ・タイマ制稗9しシスタ3 舊lI
替9ど、ト 4 ウォッチトンク・タイマ出力信号 5、シングルチップ′・マイクa′:Iシヒ゛ニータロ
、CPI/ 7、豐j修pピット 第4図 第5図 19i
Fig. 1 is a block diagram of the first embodiment of the present invention, Fig. 2 is a block diagram of the second embodiment of the present invention, Fig. 3 is a block diagram of the prior art, and Fig. 4 shows the flow of the program during normal operation. For example, FIG. 5 is an example of a program flow during abnormal operation. 1... Free running timer, 2. Old.
・Watchdog timer control register, 3...
・Control bit, 4...Watchdog timer output signal, 5...Single chip microcomputer, 6...CPU, 7...Control bit, 8...Error correction register, 9.
...Error correction circuit, 10...Group code compression circuit, 11...Error correction register, 12...
...Error correction circuit. Agent Patent Attorney Hara Uchi Figure 1r------------------+++-'''''-
−+′″−−−−−■ l Fu-Bushining tie 78, the error is corrected in the m register, watchtonk tie 7 all over)
Ta, Error triIsu, Yama^23, Shoruru Saibizuto 4, Watchdog Timer Eka 4! , 9 shishi glutiso 2°・micro combination 1-e 1,, cPt) 7-set p hit 1, fu-runisig tie'?
lρ, code J42 watchdog timer i
t wholesale t, signuta ff error meeting
l? , error correction circuit 44, watch leg tie V error notch 5 redundant technology microcomputer 2, CPU 7 @M p bit Figure 3! , 29- Rashinishige timer? Watchdog timer system 9 and Sista 3
Replacement 9d, t4 Watchtonk timer output signal 5, single chip' microphone a': Ishihini taro, CPI/7, 萐j repair pit Fig. 4 Fig. 5 Fig. 19i

Claims (1)

【特許請求の範囲】[Claims] ウォッチドッグ・タイマを内蔵したシングルチップ・マ
イクロコンピュータにおいて、ウォッチドッグ・タイマ
を制御するレジスタを複数個持ち、ウォッチドッグ・タ
イマ制御レジスタのエラー訂正回路を持つことを特徴と
するシングルチップ・マイクロコンピュータ。
A single-chip microcomputer with a built-in watchdog timer, the single-chip microcomputer having a plurality of registers for controlling the watchdog timer and an error correction circuit for the watchdog timer control register.
JP2340924A 1990-11-30 1990-11-30 Single-chip microcomputer Pending JPH04209038A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2340924A JPH04209038A (en) 1990-11-30 1990-11-30 Single-chip microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2340924A JPH04209038A (en) 1990-11-30 1990-11-30 Single-chip microcomputer

Publications (1)

Publication Number Publication Date
JPH04209038A true JPH04209038A (en) 1992-07-30

Family

ID=18341554

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2340924A Pending JPH04209038A (en) 1990-11-30 1990-11-30 Single-chip microcomputer

Country Status (1)

Country Link
JP (1) JPH04209038A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004531819A (en) * 2001-05-10 2004-10-14 ギーゼッケ ウント デフリエント ゲーエムベーハー Method for protecting a computer from manipulation of register contents and computer for implementing the method
GB2503459A (en) * 2012-06-26 2014-01-01 Nordic Semiconductor Asa Multiple hardware registers for watchdog timer preventing erroneous microprocessor system reset

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004531819A (en) * 2001-05-10 2004-10-14 ギーゼッケ ウント デフリエント ゲーエムベーハー Method for protecting a computer from manipulation of register contents and computer for implementing the method
GB2503459A (en) * 2012-06-26 2014-01-01 Nordic Semiconductor Asa Multiple hardware registers for watchdog timer preventing erroneous microprocessor system reset
US10191793B2 (en) 2012-06-26 2019-01-29 Nordic Semiconductor Asa Microprocessor device with reset timer

Similar Documents

Publication Publication Date Title
JPH04211843A (en) Microprocessor device
JPH04209038A (en) Single-chip microcomputer
JP2006523868A (en) Program-controlled unit and method
JP6332134B2 (en) Memory diagnostic circuit
JP2004038541A (en) Memory check system, memory check method, signal processor, memory check method of signal processor, and memory check program
JPS6039255A (en) Reset circuit of watchdog timer
JPH1115661A (en) Self-diagnosis method for cpu
JPS6121695Y2 (en)
JP2001242901A (en) Device for detecting malfunction of programmable controller
JP3081234B2 (en) How to check CPU board
JPH07182251A (en) Microprocessor
JPH08166891A (en) Fault tolerant computer system
JPH04178839A (en) Microprocessor
JPS57111809A (en) Retry control system
JPH0498326A (en) Microprocessor
JPH02148233A (en) Microcomputer
JPH02155048A (en) Majority circuit
JPS63265337A (en) Fault detecting circuit for processor device
JPH0527994A (en) Erroneous output prevention method for digital equipment
JPH02141833A (en) Information processor
JPS59160896A (en) Detection and correction system of memory error
JPH0535608A (en) Control storage inspecting and correcting circuit
JPH03282738A (en) Information processor
JPS63275090A (en) Memory writing controller
JPS63316138A (en) Information processor