JPH01293448A - Microcomputer - Google Patents

Microcomputer

Info

Publication number
JPH01293448A
JPH01293448A JP63124272A JP12427288A JPH01293448A JP H01293448 A JPH01293448 A JP H01293448A JP 63124272 A JP63124272 A JP 63124272A JP 12427288 A JP12427288 A JP 12427288A JP H01293448 A JPH01293448 A JP H01293448A
Authority
JP
Japan
Prior art keywords
address
execution
started
microcomputer
activation
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.)
Granted
Application number
JP63124272A
Other languages
Japanese (ja)
Other versions
JPH0727480B2 (en
Inventor
Takashi Naiki
崇 内貴
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.)
Rohm Co Ltd
Original Assignee
Rohm Co Ltd
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 Rohm Co Ltd filed Critical Rohm Co Ltd
Priority to JP63124272A priority Critical patent/JPH0727480B2/en
Publication of JPH01293448A publication Critical patent/JPH01293448A/en
Publication of JPH0727480B2 publication Critical patent/JPH0727480B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To automatically detect the fact that an execution is normally started from a prescribed address to be started at the time of activation by checking the contents of a consistent condition storage means at a prescribed check timing after the activation. CONSTITUTION:When the execution is started from a normal execution starting address at the time of the activation, an address consistency detecting means 2 detects a consistent condition, and stores it into a consistent condition memory means 3. On the other hand, when the execution is started from the address other than the normal execution starting address at the time of the activation, since the address consistency detecting means 2 does not detect the consistent condition, the consistent condition memory means 3 remains in the inconsistent condition. Thus, by checking the contents of the consistent condition memory means 3 at the prescribed check timing after the activation, whether or not the execution is started from the normal execution starting address can be detected.

Description

【発明の詳細な説明】 ta)産業上の利用分野 この発明はメモリにストアされたプログラムを順次実行
するマイクロコンピュータに関スる。
DETAILED DESCRIPTION OF THE INVENTION ta) Industrial Application Field This invention relates to a microcomputer that sequentially executes programs stored in memory.

Cb)従来の技術 一般に、マイクロコンビ二一夕は所定の処理内容をRO
Mなどに予め書き込んでおくことによって、特定の処理
を行うコントローラとして種々の電子機器内に組み込ま
れている。
Cb) Conventional technology In general, microcombiners carry out predetermined processing contents by RO.
By writing it in advance to M or the like, it is incorporated into various electronic devices as a controller that performs specific processing.

このようなマイクロコンピュータを用いて電子機器など
の制御を行う装置を設計する際に特に注意すべき点は、
如何にして異常動作の発生を防止するかである。マイク
ロコンピュータが異常動作する原因は主に瞬時停電や外
来雑音などであるが、このような影響を受けないように
、一般にハードウェアに対策が講じられている。しかし
ながら電源電圧の変動が緩慢であったり、予期せぬ強力
な雑音が発生する場合があり、ハードウェアによる対策
だけでは異常動作に対する十分な信頼性が確保できない
場合があった。
When designing a device that uses such a microcomputer to control electronic devices, the following points should be noted:
The problem is how to prevent abnormal operations from occurring. The main causes of abnormal operation of microcomputers are instantaneous power outages, external noise, etc., but measures are generally taken in the hardware to prevent such influences. However, there are cases where the power supply voltage fluctuates slowly or unexpectedly strong noise occurs, and it is not always possible to ensure sufficient reliability against abnormal operation using hardware measures alone.

そこで、異常動作が発生したとき、これを直ちに検知し
て動作を停止または再起動させる手段も利用されている
。たとえばウオッチドグタイマによって異常動作の発生
を検知することが行われている。これは所定bit数の
カウンタとこのカウンタを一定時間間隔でカウントアツ
プするタイミング信号を発生する回路およびカウント値
が所定値に達したときマイクロコンピュータをリセット
する回路を設けておき、プログラムの実行中に所定時間
間隔で前記タイマをリセットする処理を挿入しておくも
のである。したがってプログラムが正常に動作している
ときは、タイマがタイムアツプすることがなくマイクロ
コンピュータがリセットされることはないが、何らかの
原因で異常動作すれば、プログラムが正しく実行されな
いため、タイマをリセ・ノドする処理が実行されずに一
定時間経過したとき前記タイマがタイムアツプしてマイ
クロコンピュータが強制的にリセットされる。
Therefore, when an abnormal operation occurs, means are also used to immediately detect this and stop or restart the operation. For example, a watchdog timer is used to detect the occurrence of an abnormal operation. This is done by providing a counter with a predetermined number of bits, a circuit that generates a timing signal to count up this counter at fixed time intervals, and a circuit that resets the microcomputer when the count value reaches a predetermined value. A process for resetting the timer at predetermined time intervals is inserted. Therefore, when the program is running normally, the timer will not time up and the microcomputer will not be reset. However, if it runs abnormally for some reason, the program will not run correctly and the timer will not be reset. When a certain period of time elapses without any processing being executed, the timer times up and the microcomputer is forcibly reset.

(C)発明が解決しようとする課題 ところが、このようなウオッチドグタイマを用いて異常
動作を検知する従来のマイクロコンピュータにおいては
次のような問題があった。
(C) Problems to be Solved by the Invention However, conventional microcomputers that use such a watchdog timer to detect abnormal operations have the following problems.

第2図はマイクロコンピュータの処理手順の一例を表す
フローチャートである。マイクロコンピュータに電源が
投入されてACL回路が作動すれば、マイクロコンピュ
ータは自動的に実行開始アドレスから実行を開始し、先
ず所定の初期設定を行い、その後、処理Aを行う(nl
−=n2)。続いてウオッチドグタイマのタイマをリセ
ットして所定の条件判断を行う(n3−n4)。この判
断がNoであれば処理Bを行って再びn2へ戻る(n5
→n2)。n4の条件判断でYESとなれば処理Cを行
いタイマをリセットする(n6−n7)。このように適
当なタイミングでタイマをリセットすればウオッチドグ
タイマによる強制的なリセットが掛けられないが、もし
何らかの原因でマイクロコンピュータの起動時にプログ
ラムの途中から実行を開始したような場合、条件によっ
ては完全な暴走は行わずに、タイマをリセットする処理
を正常に行うことがある。例えば、第2図に示した例で
は、nlの初期設定が行われずに、n 2から実行が開
始され、02〜n5のループを実行することがある。し
かしなからnlの初期設定が行われていないために、n
4の条件判断が常にNOとなって、このループを永久に
繰り返すといったことも起こり得る。このような問題を
解消するためには起動時の実行開始アドレスが正常であ
ることを本灸出するためのプログラムを設けておくこと
が必要であるが、そのためにはプログラム全体が複雑化
し、その容量も増大するという問題があった。
FIG. 2 is a flowchart showing an example of the processing procedure of the microcomputer. When the microcomputer is powered on and the ACL circuit is activated, the microcomputer automatically starts execution from the execution start address, first performs predetermined initial settings, and then performs process A (nl
-=n2). Subsequently, the timer of the watchdog timer is reset and a predetermined condition is determined (n3-n4). If this judgment is No, perform process B and return to n2 again (n5
→n2). If the condition judgment at n4 is YES, processing C is performed and the timer is reset (n6-n7). If you reset the timer at an appropriate timing in this way, you will not be forced to reset by the watchdog timer, but if for some reason the microcomputer starts running from the middle of the program, depending on the conditions, The timer may be reset normally without causing a complete runaway. For example, in the example shown in FIG. 2, execution may start from n2 without initializing nl, and a loop from 02 to n5 may be executed. However, because the initial settings of nl have not been performed, nl
It is also possible that the conditional judgment in step 4 is always NO and this loop is repeated forever. In order to solve this kind of problem, it is necessary to create a program to confirm that the execution start address at startup is normal, but this requires the entire program to become complicated and There was also the problem of increased capacity.

この発明の目的は起動時に正常なアドレスから実行が開
始されているか否かを検出できるようにして、異常動作
の続行を防止できるようにしたマイクロコンピュータを
提供することにある。
SUMMARY OF THE INVENTION An object of the present invention is to provide a microcomputer that can detect whether or not execution is started from a normal address at startup, thereby preventing the continuation of abnormal operations.

((0課題を解決するための手段 この発明のマイクロコンピュータは、起動時の正常な実
行開始アドレスを記憶する手段と、この正常な実行開始
アドレスとプログラムカウンタの内容との一致検出を行
うアドレス一致検出手段と、 このアドレス一致検出手段が一致状態を検出したことを
記憶する一致状態記憶手段と、起動後の所定のチェック
タイミングで前記一致状態記憶手段の内容をチェックす
る記憶内容チェック手段と、 を備えたことを特徴としている。
((0) Means for Solving the Problems The microcomputer of the present invention includes means for storing a normal execution start address at startup, and an address matching means for detecting a match between the normal execution start address and the contents of a program counter. a detecting means; a matching state storing means for storing that the address matching detecting means has detected a matching state; and a storage content checking means for checking the contents of the matching state storing means at a predetermined check timing after activation. It is characterized by the fact that it is equipped with

(e)作用 この発明のマイクロコンピュータにおいては、起動時の
正常な実行開始アドレスを記憶する手段が設けられてい
て、アドレス−故検出手段は正常な実行開始アドレスと
プログラムカウンタの内容との一致検出を行う。また、
一致状態記憶手段はアドレス一致検出手段が一致状態を
検出したことを記憶し、記憶内容チェック手段は、起動
後の所定のタイミングで一致状態記憶手段の内容をチェ
ックする。したがって、起動時に正常な実行開始アドレ
スから実行が開始されたなら、アドレス一致検出手段が
一致状態を検出して、これが一致状態記憶手段に記憶さ
れるが、起動時に正常な実行開始アドレス以外のアドレ
スから実行が開始されたなら、アドレス一致検出手段は
一致状態を検出しないため、一致状態記憶手段は不一致
状態のままとなる。
(e) Effect The microcomputer of the present invention is provided with means for storing a normal execution start address at startup, and the address error detection means detects a match between the normal execution start address and the contents of the program counter. I do. Also,
The match state storage means stores that the address match detection means has detected a match state, and the storage content check means checks the contents of the match state storage means at a predetermined timing after activation. Therefore, if execution is started from a normal execution start address at startup, the address match detection means will detect a match state and this will be stored in the match state storage means, but at startup, an address other than the normal execution start address will be detected. If execution is started from , the address match detection means does not detect a match state, so the match state storage means remains in a mismatch state.

これにより、起動後の所定のチj−ツタタイミングで前
記一致状態記憶手段の内容をチェックすれば、正常な実
行開始アドレスから実行が開始されたか否かを検知する
ことができる。たとえばこの記憶内容チェック手段の結
果によってマイクロコンピュータを強制的にリセットさ
せるように回路を構成しておくことによって、正常な実
行開始アドレスから強制的に実行を開始させることがで
きる。
Thereby, by checking the contents of the coincidence state storage means at a predetermined check timing after startup, it is possible to detect whether or not execution has started from a normal execution start address. For example, by configuring a circuit to forcibly reset the microcomputer based on the result of the memory content checking means, execution can be forcibly started from a normal execution start address.

(f)実施例 第1図はこの発明の実施例でるあマイクロコンピュータ
の主要部の回路図である。図において1はプログラムカ
ウンタ、2はN ORゲート、3はラッチ回路、4はイ
ンバータ、5はANDゲートである。プログラムカウン
タ1は図に示した例では10bit構成であり、CPU
が実行すべき命令のアドレスが格納され、命令の実行段
階に自動的にカウントアツプ(+1)される。但し、ジ
ャンプ命令の場合は実行段階でジャンプ先のアドレスが
格納される。NORゲート2はプログラムカウンタlの
各bitの否定論理和を求める。したがってプログラム
カウンタ1の内容がoooo。
(f) Embodiment FIG. 1 is a circuit diagram of the main part of a microcomputer which is an embodiment of the present invention. In the figure, 1 is a program counter, 2 is an NOR gate, 3 is a latch circuit, 4 is an inverter, and 5 is an AND gate. In the example shown in the figure, program counter 1 has a 10-bit configuration, and the CPU
The address of the instruction to be executed is stored, and is automatically counted up (+1) at the instruction execution stage. However, in the case of a jump instruction, the jump destination address is stored during the execution stage. NOR gate 2 calculates the negative OR of each bit of program counter l. Therefore, the contents of program counter 1 are oooo.

oooooであるときにのみ、その出力を1とする。ラ
ッチ回路3はNORゲート2の出力状態を一時記憶する
。ANDゲート5はラッチ回路3の否定信号とプログラ
ムカウンタ1の第2bit  (最下位bitから31
)it目)との論理積を求め、その結果をマイクロコン
ピュータのリセット(8号として発生させる。
The output is set to 1 only when oooooo. The latch circuit 3 temporarily stores the output state of the NOR gate 2. The AND gate 5 outputs the negation signal of the latch circuit 3 and the second bit of the program counter 1 (from the lowest bit to 31
) and the it-th), and the result is generated as a microcomputer reset (No. 8).

以上に示した構成においてNORゲート2はこの発明に
係る「正常な実行開始アドレスを記憶する手段」および
「アドレス一致検出手段」に相当し、ラッチ回路3は「
一致状態記憶手段」に相当し、A N Dゲート5は「
記憶内容チェック手段」に相当している。すなわち、先
ずマイクロコンピュータに電源が投入されてACL (
オートクリア)回路が作動すれば、プログラムカウンタ
1の内容がooooooooooとなるため、NORゲ
ート2の出力が1となりラッチ回路3にその状態が記憶
される。したがってインバータ4の出力は0である。こ
のため、その後プログラムが順次実行されて、プログラ
ムカウンタ1の第2bitが1となってもANDゲート
5の出力はOのままでありリセットは行われない。
In the configuration shown above, the NOR gate 2 corresponds to "means for storing a normal execution start address" and "address coincidence detection means" according to the present invention, and the latch circuit 3 corresponds to "means for storing a normal execution start address" and "means for detecting address coincidence" according to the present invention.
The A N D gate 5 corresponds to “coincidence state storage means”, and the A N D gate 5 corresponds to “coincidence state storage means”.
It corresponds to "memory content checking means". That is, first, the power is turned on to the microcomputer and the ACL (
When the auto clear (auto clear) circuit is activated, the content of the program counter 1 becomes ooooooooooo, so the output of the NOR gate 2 becomes 1, and this state is stored in the latch circuit 3. Therefore, the output of inverter 4 is zero. Therefore, even if the second bit of the program counter 1 becomes 1 as the programs are sequentially executed thereafter, the output of the AND gate 5 remains O and no reset is performed.

もし起動時に正常な実行開始アドレスすなわちoooo
ooooooから実行が開始されなかった場合はNOR
ゲート2の出力が1となり、ラッチ回路3にその状態が
記憶される。その後プログラムカウンタの第2bitの
内容が1となれば、ANDゲート5の出力が1となって
マイクロコンピュータ全体に強制的にリセットが掛けら
れる。
If the normal execution start address at startup i.e. oooo
NOR if execution did not start from ooooooo
The output of the gate 2 becomes 1, and the state is stored in the latch circuit 3. After that, when the content of the second bit of the program counter becomes 1, the output of the AND gate 5 becomes 1, and the entire microcomputer is forcibly reset.

これによりプログラムカウンタ1の内容が000ooo
ooooとなって、正常なアドレスから実行が開始され
る。
This changes the contents of program counter 1 to 000ooo
oooo, and execution starts from the normal address.

なお、実施例では異常な状態を検出したときマイクロコ
ンピュータ全体を強制的にリセットする例であったが、
その他に、例えばプログラムを停止させるとともに異常
状態を報知するように構成しても良い。
In addition, in the example, the entire microcomputer was forcibly reset when an abnormal state was detected, but
Alternatively, for example, the program may be stopped and an abnormal state may be notified.

(g1発明の効果 以上のようにこの発明によれば、起動時に開始すべき所
定のアドレスから正常に実行が開始されたことを自動的
に検出できるようにしたため、プログラムが複雑化した
り、その容量が増大することなく異常な動作状態を検知
することができ、異常動作にともなう事故を防止するこ
とができる。
(Effects of g1 Invention As described above, according to this invention, it is possible to automatically detect that execution has started normally from a predetermined address that should be started at startup. It is possible to detect an abnormal operating condition without increasing the amount of noise, and it is possible to prevent accidents caused by abnormal operation.

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

第1図はこの発明の実施例であるマイクロコンピュータ
の主要部の構成を示す回路図である。第2図はウオッチ
ドグタイマを用いた従来のマイクロコンビ二一夕の行う
処理手順の一例を表すフローチャートである。
FIG. 1 is a circuit diagram showing the configuration of the main parts of a microcomputer that is an embodiment of the present invention. FIG. 2 is a flowchart showing an example of a processing procedure performed by a conventional micro-combiner using a watchdog timer.

Claims (1)

【特許請求の範囲】[Claims] (1)起動時の正常な実行開始アドレスを記憶する手段
と、 この正常な実行開始アドレスとプログラムカウンタの内
容との一致検出を行うアドレス一致検出手段と、 このアドレス一致検出手段が一致状態を検出したことを
記憶する一致状態記憶手段と、 起動後の所定のチェックタイミングで前記一致状態記憶
手段の内容をチェックする記憶内容チェック手段と、 を備えたことを特徴とするマイクロコンピュータ。
(1) means for storing a normal execution start address at startup; address match detection means for detecting a match between this normal execution start address and the contents of the program counter; and the address match detection means detects a matching state. 1. A microcomputer comprising: a coincidence state storage means for storing information about the coincidence state storage means; and a storage content checking means for checking the contents of the coincidence state storage means at a predetermined check timing after startup.
JP63124272A 1988-05-20 1988-05-20 Microcomputer Expired - Fee Related JPH0727480B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63124272A JPH0727480B2 (en) 1988-05-20 1988-05-20 Microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63124272A JPH0727480B2 (en) 1988-05-20 1988-05-20 Microcomputer

Publications (2)

Publication Number Publication Date
JPH01293448A true JPH01293448A (en) 1989-11-27
JPH0727480B2 JPH0727480B2 (en) 1995-03-29

Family

ID=14881231

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63124272A Expired - Fee Related JPH0727480B2 (en) 1988-05-20 1988-05-20 Microcomputer

Country Status (1)

Country Link
JP (1) JPH0727480B2 (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5828341U (en) * 1981-08-17 1983-02-23 三菱電機株式会社 Computer program execution confirmation device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5828341U (en) * 1981-08-17 1983-02-23 三菱電機株式会社 Computer program execution confirmation device

Also Published As

Publication number Publication date
JPH0727480B2 (en) 1995-03-29

Similar Documents

Publication Publication Date Title
US8954801B2 (en) Microcomputer and method of operation thereof
US6438709B2 (en) Method for recovering from computer system lockup condition
JP2696511B2 (en) Return method from power down mode
JPH01293448A (en) Microcomputer
JPH11259340A (en) Reactivation control circuit for computer
US6567930B1 (en) Method and apparatus for controlling writing of flash EEPROM by microcomputer
JPH01288934A (en) Double microcomputer system runaway preventing circuit
JP2659067B2 (en) Microcomputer reset circuit
JP4647276B2 (en) Semiconductor circuit device
JP2814800B2 (en) Microcomputer
JP2504502B2 (en) Integrated circuit card
JPS62106552A (en) Loop detector
JPH06103480B2 (en) Blackout processor
JPH0120775B2 (en)
JPS63138437A (en) Program control system
KR100442290B1 (en) A circuit for controlling program counter
JPS61278953A (en) Method for checking error in ram
JP2003044324A (en) Method, device and program for confirming abnormality detection
KR0155045B1 (en) Watch dog timmer of self-service guard system
JPH05189258A (en) Microcomputer
JPH05143478A (en) Device for protecting contents of non-volatile memory
JPH01245322A (en) Power failure control circuit for microprocessor
KR100269348B1 (en) Radio lan system having auto-restarting circuit
JP2001242901A (en) Device for detecting malfunction of programmable controller
JPH0358205A (en) Microcomputer

Legal Events

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