Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP3415381B2 - Microcomputer and electronic control unit - Google Patents
[go: Go Back, main page]

JP3415381B2 - Microcomputer and electronic control unit - Google Patents

Microcomputer and electronic control unit

Info

Publication number
JP3415381B2
JP3415381B2 JP33865496A JP33865496A JP3415381B2 JP 3415381 B2 JP3415381 B2 JP 3415381B2 JP 33865496 A JP33865496 A JP 33865496A JP 33865496 A JP33865496 A JP 33865496A JP 3415381 B2 JP3415381 B2 JP 3415381B2
Authority
JP
Japan
Prior art keywords
microcomputer
cpu
signal
output
counter
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
JP33865496A
Other languages
Japanese (ja)
Other versions
JPH10177506A (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.)
Denso Corp
Original Assignee
Denso 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 Denso Corp filed Critical Denso Corp
Priority to JP33865496A priority Critical patent/JP3415381B2/en
Publication of JPH10177506A publication Critical patent/JPH10177506A/en
Application granted granted Critical
Publication of JP3415381B2 publication Critical patent/JP3415381B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (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 configured to detect program runaway by itself, and an electronic control device equipped with the microcomputer.

【0002】[0002]

【従来の技術】従来より、自らがプログラム暴走の検出
を行うように構成されたマイクロコンピュータとして、
ウォッチドックタイマ(以下、WDTと記すこともあ
る)を内蔵したものが知られている。
2. Description of the Related Art Conventionally, as a microcomputer configured to detect a program runaway,
It is known that a watchdog timer (hereinafter, also referred to as WDT) is built in.

【0003】即ち、マイクロコンピュータに内蔵された
WDTは、マイクロコンピュータの内部クロックにより
一定周期毎にカウント動作を行うカウンタを主要部とし
ており、そのカウント値がオーバーフロー値(カウント
動作がアップカウントならば上限値であり、逆にダウン
カウントならば下限値である)に達すると、プログラム
暴走が発生したと判定して、マイクロコンピュータ内の
CPUをリセットするものである。
That is, the WDT built in the microcomputer mainly has a counter that performs a counting operation at a constant cycle by an internal clock of the microcomputer, and its count value is an overflow value (upper limit if the counting operation is up-counting. When the down count is reached, which is the lower limit value), it is determined that a program runaway has occurred, and the CPU in the microcomputer is reset.

【0004】このため、上記の如きWDTを内蔵したマ
イクロコンピュータでは、CPUがプログラムを実行す
ることによりWDTへ所定時間以内毎にアクセスしてW
DTのカウント値を所定値(例えば、WDTのカウント
動作がアップカウントならばカウンタの下限値であり、
逆にダウンカウントならばカウンタの上限値)に設定す
るようにしており、これにより、CPUがプログラムを
正常に実行している場合には、WDTからCPUへのリ
セットが行われず、プログラム暴走が発生して、CPU
からWDTへのアクセスが行われなくなった場合には、
WDTによりCPUがリセットされるようにしている。
Therefore, in the microcomputer having the WDT as described above, the CPU executes the program to access the WDT within a predetermined time, and
The DT count value is a predetermined value (for example, if the WDT count operation is up-counting, it is the lower limit value of the counter
On the contrary, if it is a down-count, it is set to the upper limit value of the counter). As a result, when the CPU is executing the program normally, the WDT is not reset to the CPU, and the program runaway occurs. And CPU
If WDT is no longer accessed from
The CPU is reset by WDT.

【0005】また、WDTを内蔵したもの以外に、例え
ば特開昭61−121140号公報に開示されているよ
うなマイクロコンピュータも提案されている。即ち、上
記公報に開示のマイクロコンピュータは、内部クロック
により一定周期毎にカウント動作を行うタイマカウンタ
を備えており、プログラムのメインルーチンにおいてサ
ブルーチンを呼ぶ命令の前に上記タイマカウンタをリセ
ットする命令(詳しくは、CPUがタイマカウンタにア
クセスしてカウント値をクリアする命令)を設けると共
に、サブルーチンにおいてメインルーチンへの復帰命令
の前に上記タイマカウンタのオーバーフローを検出する
命令を設け、サブルーチンにて上記タイマカウンタのオ
ーバーフローを検出すると、プログラムの暴走が発生し
たと判定して、予め用意された暴走対策ルーチンの実行
へ移行するようにしている。
In addition to the WDT built-in type, a microcomputer disclosed in, for example, Japanese Patent Laid-Open No. 61-121140 has been proposed. That is, the microcomputer disclosed in the above publication is provided with a timer counter that performs a counting operation at regular intervals by an internal clock, and an instruction to reset the timer counter before an instruction to call a subroutine in the main routine of the program (details) Is an instruction for the CPU to access the timer counter to clear the count value) and an instruction for detecting the overflow of the timer counter before the return instruction to the main routine in the subroutine. If the overflow of the program is detected, it is determined that a program runaway has occurred, and the process proceeds to the execution of a runaway countermeasure routine prepared in advance.

【0006】そして、上記公報に開示のマイクロコンピ
ュータによれば、サブルーチンからメインルーチンへ復
帰することができないというプログラム暴走を自分自身
で検出して、そのプログラム暴走から脱することができ
る。ところで、この種のマイクロコンピュータによれ
ば、プログラム暴走の検出及び回避を自分自身で行える
ため、電子制御装置に搭載した場合には、特に暴走検出
用の回路を設けることなくプログラム暴走を防止するこ
とができる。
According to the microcomputer disclosed in the above publication, a program runaway in which the subroutine cannot be returned to the main routine can be detected by itself, and the program runaway can be canceled. By the way, according to this kind of microcomputer, the program runaway can be detected and avoided by itself. Therefore, when the microcomputer is installed in the electronic control unit, the program runaway should be prevented without providing a circuit for runaway detection. You can

【0007】しかしながら、一般的に、電子制御装置で
は、マイクロコンピュータに外部メモリやレジスタなど
の周辺回路が接続され、マイクロコンピュータにてプロ
グラム暴走が発生した場合には、そのような周辺回路を
も初期化(リセット)してやる必要がある。
However, generally, in an electronic control device, when a peripheral circuit such as an external memory or a register is connected to a microcomputer and a program runaway occurs in the microcomputer, such a peripheral circuit is also initialized. It is necessary to change (reset) it.

【0008】そこで、プログラム暴走時にマイクロコン
ピュータの周辺回路をも初期化できるようにするために
は、マイクロコンピュータの外部側でも、プログラム暴
走が発生したかどうかを検出できるようにする必要があ
り、このためには、前述したマイクロコンピュータにお
いて、CPUが上記WDTやタイマカウンタにアクセス
する度に、当該マイクロコンピュータの出力ポートから
外部へ信号を出力するようにしておくことが考えられ
る。
Therefore, in order to be able to initialize the peripheral circuits of the microcomputer at the time of program runaway, it is necessary to be able to detect whether the program runaway has occurred even on the outside of the microcomputer. In order to achieve this, it is conceivable that in the above-mentioned microcomputer, every time the CPU accesses the WDT or the timer counter, a signal is output from the output port of the microcomputer to the outside.

【0009】つまり、WDTを内蔵したマイクロコンピ
ュータの場合には、CPUがプログラムを正常に実行し
ていれば、出力ポートから所定時間以内毎に信号が出力
され、プログラム暴走が発生すれば、その出力ポートか
ら信号が出力されなくなるため、当該マイクロコンピュ
ータの外部に、上記出力ポートから出力される信号を監
視して、その信号が予め定められた設定時間以内に出力
されない場合にプログラム暴走が発生したと判定する暴
走検出回路を設ければ良いのである。
That is, in the case of a microcomputer having a built-in WDT, if the CPU is executing the program normally, a signal is output from the output port every predetermined time, and if a program runaway occurs, the output is output. Since the signal is not output from the port, the signal output from the output port is monitored outside the microcomputer, and if the signal is not output within the preset time, the program runaway occurs. It is only necessary to provide a runaway detection circuit for determination.

【0010】また、上記公報に開示のWDTを備えない
マイクロコンピュータの場合でも、通常、メインルーチ
ンは定期的に実行されるため、CPUがメインルーチン
を実行して上記タイマカウンタにアクセスする度に、出
力ポートから信号を出力するようにしておくことで、外
部に設けた暴走検出回路により、マイクロコンピュータ
にてプログラム暴走が発生したことを検出できるように
なるのである。
Further, even in the case of a microcomputer not provided with the WDT disclosed in the above publication, the main routine is usually executed regularly, so that each time the CPU executes the main routine to access the timer counter, By outputting a signal from the output port, it becomes possible to detect the occurrence of program runaway in the microcomputer by the runaway detection circuit provided outside.

【0011】[0011]

【発明が解決しようとする課題】しかしながら、従来の
マイクロコンピュータにおいて、前述したように出力ポ
ートから信号を出力するためには、CPUが、上記WD
Tやタイマカウンタへのアクセス命令とは別に、出力ポ
ートから信号を出力するための操作命令を追加して実行
しなければならず、ソフトウェアの負荷(プログラムの
量及びその実行時間)が増加してしまうという問題が生
じる。
However, in the conventional microcomputer, in order to output a signal from the output port as described above, the CPU has to use the WD
In addition to the T and timer counter access instructions, an operation instruction for outputting a signal from the output port must be added and executed, which increases the load on the software (the amount of the program and its execution time). The problem arises that

【0012】しかも、CPUが内部のWDTやタイマカ
ウンタにアクセスして、出力ポートから実際に信号が出
力されるまでには、CPUが出力ポートの操作命令を実
行するのに要する時間だけ遅れが生じることとなり、マ
イクロコンピュータの外部でプログラム暴走を検出する
際の検出精度が低下してしまう。
Moreover, before the CPU accesses the internal WDT or the timer counter and the signal is actually output from the output port, there is a delay by the time required for the CPU to execute the operation command of the output port. As a result, the detection accuracy at the time of detecting the program runaway outside the microcomputer decreases.

【0013】具体的には、プログラム暴走が発生したか
否かの上記暴走検出回路における判定基準(つまり、マ
イクロコンピュータの出力ポートから信号が出力されな
くなってからプログラム暴走が発生したと判定するまで
の設定時間)を、上記遅れを考慮して設定しなければな
らず、その設定が難しくなる。この結果、前述した従来
のマイクロコンピュータを搭載した電子制御装置では、
プログラム暴走が発生した時に、マイクロコンピュータ
の周辺回路をリセットするといった正常復帰動作が最適
なタイミングからずれてしまう可能性が生じる。
Specifically, a criterion for determining whether or not a program runaway has occurred in the runaway detecting circuit (that is, from the time when a signal is no longer output from the output port of the microcomputer until the program runaway is determined to occur) (Set time) must be set in consideration of the above delay, and that setting becomes difficult. As a result, in the electronic control device equipped with the conventional microcomputer described above,
When a program runaway occurs, there is a possibility that the normal recovery operation such as resetting the peripheral circuits of the microcomputer may deviate from the optimum timing.

【0014】本発明は、こうした問題に鑑みなされたも
のであり、プログラム暴走の有無を外部で監視するため
の信号を、ソフトウェアの負荷を増加させることなく且
つ遅れを生じることなく、出力することができるマイク
ロコンピュータと、そのマイクロコンピュータを備え、
プログラム暴走の発生時に最適なタイミングで正常復帰
動作を行うことができる電子制御装置と、を提供するこ
とを目的としている。
The present invention has been made in view of these problems, and it is possible to output a signal for externally monitoring the presence or absence of program runaway without increasing the load of software and without causing a delay. And a microcomputer that can
It is an object of the present invention to provide an electronic control device capable of performing a normal return operation at an optimum timing when a program runaway occurs.

【0015】[0015]

【課題を解決するための手段、及び発明の効果】上記目
的を達成するためになされた請求項1もしくは請求項3
記載の本発明のマイクロコンピュータは、CPUと、
一定周期毎にカウント動作を行うと共に、CPUからア
ドレスバス及びデータバスを介してライトアクセス及び
リードアクセスが可能なカウンタとを備えており、この
マイクロコンピュータでは、CPUがプログラムを実行
することにより前記カウンタへ所定時間以内毎にライト
アクセスして該カウンタに初期値としての所定値を書き
込む。そして、当該マイクロコンピュータは、前記カウ
ンタの値に基づきプログラム暴走が発生したか否かを判
定して、プログラム暴走の発生を検出すると、プログラ
ム暴走から脱するための動作を行う。
[Means for Solving the Problems and Effects of the Invention] Claim 1 or Claim 3 made to achieve the above object.
The microcomputer of the present invention includes a CPU according to,
The microcomputer is provided with a counter that performs a count operation at regular intervals and is capable of write access and read access from the CPU via an address bus and a data bus. In this microcomputer, the counter is executed by the CPU executing a program. Write access is made to the counter every predetermined time and a predetermined value as an initial value is written in the counter. Then, the microcomputer determines whether or not the program runaway has occurred based on the value of the counter, and when detecting the occurrence of the program runaway, performs the operation for exiting the program runaway.

【0016】尚、カウンタの値に基づきプログラム暴走
の有無を判定し、プログラム暴走の検出時にプログラム
暴走から脱するための動作を行う、という機能は、内蔵
のWDTにより実現される構成でも良いし、また、前述
した公報に記載されたマイクロコンピュータのように、
CPUがプログラムを実行することで実現される構成で
も構わない。
The function of determining the presence or absence of program runaway based on the value of the counter and performing the operation for exiting the program runaway when the program runaway is detected may be realized by a built-in WDT. Further, like the microcomputer described in the above-mentioned publication,
The configuration may be realized by the CPU executing the program.

【0017】ここで特に、請求項1に記載の本発明のマ
イクロコンピュータは、前記CPUから前記カウンタへ
のライトアクセスが行われたことを検出すると共に、前
記カウンタへのライトアクセスを検出する度に、当該マ
イクロコンピュータの外部へ信号を出力する信号出力回
路を備えている。
Here, in particular, the microcomputer of the present invention according to claim 1 detects that a write access is made from the CPU to the counter, and every time a write access to the counter is detected. A signal output circuit for outputting a signal to the outside of the microcomputer is provided.

【0018】つまり、このマイクロコンピュータでは、
CPUがカウンタへライトアクセスする度に、信号出力
回路が、CPUの動作とは独立して、外部に信号を出力
する。そして、当該マイクロコンピュータから上記信号
が所定時間以内毎に出力されるか否かを監視すること
で、プログラム暴走の有無を検出することができる。
That is, in this microcomputer,
Each time the CPU makes a write access to the counter, the signal output circuit outputs a signal to the outside independently of the operation of the CPU. Then, the presence or absence of program runaway can be detected by monitoring whether or not the signal is output from the microcomputer every predetermined time.

【0019】従って、請求項1に係る本発明のマイクロ
コンピュータによれば、プログラム暴走の有無を外部で
監視するための信号を、ソフトウェアの負荷を増加させ
ることなく且つ遅れを生じることなく、出力することが
できる。尚、請求項2に記載のように、信号出力回路
は、前記信号として、所定のパルス幅を有するパルス信
号を出力するように構成しても良い。また、請求項3に
記載の本発明のように、信号出力回路は、前記CPUか
ら前記カウンタへのライトアクセスが行われたことを検
出すると共に、前記カウンタへのライトアクセスを検出
する度にレベルが反転する信号を当該マイクロコンピュ
ータの外部へ出力するように構成することができる。
た、請求項の信号出力回路として、請求項4に記載の
如きトグル出力回路を用いれば、小規模な回路構成で前
述の効果を得ることができる。
Therefore, according to the microcomputer of the first aspect of the present invention, a signal for externally monitoring the presence or absence of program runaway is output without increasing the load of software and without causing a delay. be able to. Incidentally, as described in claim 2, the signal output circuit, and with the signal, it may be configured to output a pulse signal having a predetermined pulse width. Also, in claim 3.
According to the present invention described above, the signal output circuit is the CPU.
The write access to the counter from the
And write access to the counter is detected.
The signal whose level inverts each time
It can be configured to output to the outside of the data. Further, if the toggle output circuit according to the fourth aspect is used as the signal output circuit according to the third aspect , the above-described effect can be obtained with a small-scale circuit configuration.

【0020】一方、このような本発明のマイクロコンピ
ュータを用いて電子制御装置を構成する場合には、請求
項5に記載のように、当該マイクロコンピュータの信号
出力回路から出力される信号を監視し、該信号が予め定
められた設定時間以内に出力されない場合に、もしくは
請求項6に記載のように、該信号のレベルが予め定めら
れた設定時間以内に反転しない場合に、前記マイクロコ
ンピュータにてプログラム暴走が発生したと判定する暴
走検出手段を設ければ、マイクロコンピュータの外部側
でも、プログラム暴走が発生したか否かを検出できる。
On the other hand, when an electronic control unit is constructed using such a microcomputer of the present invention, the signal output from the signal output circuit of the microcomputer is monitored as described in claim 5. , If the signal is not output within a preset time, or
According to claim 6, the level of the signal is predetermined.
If the program runaway detecting means for determining that the program runaway has occurred in the microcomputer when it is not reversed within the set time set, it is possible to detect whether the program runaway has occurred even on the outside of the microcomputer. .

【0021】そして、このような電子制御装置におい
て、マイクロコンピュータに外部メモリやレジスタなど
の周辺回路が接続される場合には、請求項に記載のよ
うに、暴走検出手段が、マイクロコンピュータにてプロ
グラム暴走が発生したと判定すると上記周辺回路を初期
化するように構成すれば良い。このようにすれば、プロ
グラム暴走が発生した場合に、マイクロコンピュータは
自分自身でプログラム暴走から脱し(正常復帰し)、マ
イクロコンピュータの周辺回路は暴走検出手段により初
期化されるため、当該電子制御装置の機能全体を正常復
帰させることができる。
[0021] In such an electronic control device, when the peripheral circuits such as an external memory or a register in the microcomputer is connected, as described in claim 7, the loop detection means, by the microcomputer The peripheral circuit may be initialized when it is determined that a program runaway has occurred. With this configuration, when a program runaway occurs, the microcomputer itself escapes from the program runaway (returns to the normal state), and the peripheral circuit of the microcomputer is initialized by the runaway detecting means, so that the electronic control device concerned. The entire function of can be restored to normal.

【0022】しかも、前述したように、本発明のマイク
ロコンピュータからは、プログラム暴走の有無を外部で
監視するための信号が、CPUからカウンタへのアクセ
スに対して遅れを生じることなく出力されるため、プロ
グラム暴走が発生したか否かを判定するための暴走検出
手段における前記設定時間の最適値を、容易に設定する
ことができる。
Moreover, as described above, the microcomputer of the present invention outputs a signal for externally monitoring the presence or absence of program runaway without delay from the CPU accessing the counter. It is possible to easily set the optimum value of the set time in the runaway detection means for determining whether or not the program runaway has occurred.

【0023】よって、請求項に記載の電子制御装置に
よれば、プログラム暴走の発生時に、マイクロコンピュ
ータの周辺回路を初期化(リセット)するという正常復
帰動作を最適なタイミングで行うことができるようにな
る。また、この電子制御装置において、請求項に記載
のように、暴走検出手段が、前記周辺回路と共にマイク
ロコンピュータを初期化するように構成すれば、万が
一、マイクロコンピュータが自分自身で正常復帰できな
い場合にも、マイクロコンピュータは暴走検出手段によ
って初期化されるため、当該電子制御装置全体の正常復
帰を一層確実に行うことができるようになる。
Therefore, according to the electronic control unit of the seventh aspect , when the program runaway occurs, the normal recovery operation of initializing (resetting) the peripheral circuits of the microcomputer can be performed at an optimum timing. become. Further, in this electronic control unit, if the runaway detecting means is configured to initialize the microcomputer together with the peripheral circuit as described in claim 8 , in the unlikely event that the microcomputer cannot recover normally by itself. In addition, since the microcomputer is initialized by the runaway detecting means, it becomes possible to more reliably restore the normal operation of the entire electronic control device.

【0024】もちろん、初期化の必要な周辺回路がマイ
クロコンピュータに接続されない電子制御装置の場合に
は、請求項に記載のように、暴走検出手段が、マイク
ロコンピュータにてプログラム暴走が発生したと判定す
るとマイクロコンピュータを初期化するように構成すれ
ば良い。つまり、万が一、マイクロコンピュータが自分
自身で正常復帰できない場合にも、マイクロコンピュー
タは暴走検出手段によって初期化されることとなるた
め、正常復帰が一層確実になる。
Of course, in the case of an electronic control device in which the peripheral circuit requiring initialization is not connected to the microcomputer, it is said that the runaway detection means causes a program runaway in the microcomputer as described in claim 9. If it is determined, the microcomputer may be initialized. In other words, even if the microcomputer cannot return to normal by itself, the microcomputer will be initialized by the runaway detecting means, so that normal return will be more reliable.

【0025】[0025]

【発明の実施の形態】以下、本発明の実施形態について
図面を用いて説明する。尚、本発明の実施形態は、下記
のものに何ら限定されることなく、本発明の技術的範囲
に属する限り、種々の形態を採り得ることは言うまでも
ない。
BEST MODE FOR CARRYING OUT THE INVENTION Embodiments of the present invention will be described below with reference to the drawings. It is needless to say that the embodiment of the present invention is not limited to the following and can take various forms within the technical scope of the present invention.

【0026】まず、図1は、本実施形態の電子制御装置
の構成を表す概略構成図である。この電子制御装置は、
車両に搭載されたエンジンの制御を行うものであり、図
1に示すように、エンジン制御用の処理を行うシングル
チップマイクロコンピュータ(以下、マイコンという)
2と、車両に搭載されたバッテリからの電圧(通常、約
12V)VB を受けて、マイコン2及びマイコン2に接
続された外部メモリや入出力回路などの図示しない周辺
回路へ電源電圧VCC(本実施形態では、5V±0.25
V)を供給する電源回路4と、電源回路4からの電源電
圧VCCがマイコン2やその周辺回路に供給すべき規定電
圧(例えば、4.75V)に立ち上がるまでの間、或い
は、電源回路4からの電源電圧VCCが上記規定電圧より
も低下した時に、マイコン2及びその周辺回路にシステ
ムリセット信号RESを出力して、それらを初期化する
電源IC6とを備えている。
First, FIG. 1 is a schematic configuration diagram showing the configuration of the electronic control unit of the present embodiment. This electronic control unit
As shown in FIG. 1, a single-chip microcomputer (hereinafter, referred to as a microcomputer) that controls an engine mounted on a vehicle and performs processing for engine control.
2 and the voltage (usually about 12V) VB from the battery mounted on the vehicle, the power supply voltage VCC (main) is supplied to the microcomputer 2 and peripheral circuits (not shown) such as external memory and input / output circuits connected to the microcomputer 2. In the embodiment, 5V ± 0.25
V) for supplying the power supply circuit 4 and the power supply voltage Vcc from the power supply circuit 4 until the power supply voltage VCC rises to a specified voltage (for example, 4.75 V) to be supplied to the microcomputer 2 and its peripheral circuits, or from the power supply circuit 4. When the power supply voltage V.sub.CC of the power supply voltage V.sub.CC is lower than the specified voltage, the power supply IC6 for outputting the system reset signal RES to the microcomputer 2 and its peripheral circuits to initialize them is provided.

【0027】そして、電源IC6は、マイコン2から後
述するように出力される出力信号OUTを監視して、そ
の出力信号OUTが予め設定された設定時間T1以内に
立ち上がらない場合に、マイコン2及びその周辺回路に
システムリセット信号RESを出力する、暴走検出手段
としてのウォッチドックタイマ機能も有している。
Then, the power supply IC 6 monitors the output signal OUT outputted from the microcomputer 2 as described later, and when the output signal OUT does not rise within the preset time T1, the microcomputer 2 and its It also has a watchdog timer function as a runaway detecting means for outputting the system reset signal RES to the peripheral circuits.

【0028】次に、マイコン2は、図示しないROMに
予め格納されたプログラムを実行するCPU10と、C
PU10に接続されたアドレスバス12及びデータバス
14と、当該マイコン2の内部クロックCKWにより一
定周期毎にダウンカウント動作を行うダウンカウンタ1
6と、このダウンカウンタ16の内部状態(ステータス
情報)を記憶すると共に、ダウンカウンタ16のカウン
ト値が「0」になると、CPU10にてプログラム暴走
が発生したと判定して、CPU10へ内部リセット信号
RTを出力するステータスレジスタ18とを備えてい
る。
Next, the microcomputer 2 executes a program stored in advance in a ROM (not shown) and a CPU 10,
An address bus 12 and a data bus 14 connected to the PU 10, and a down counter 1 that performs a down count operation at regular intervals by an internal clock CKW of the microcomputer 2.
6 and the internal state (status information) of the down counter 16, and when the count value of the down counter 16 becomes "0", it is determined that the program runaway has occurred in the CPU 10, and the internal reset signal is sent to the CPU 10. The status register 18 for outputting RT is provided.

【0029】そして、上記ダウンカウンタ16は、CP
U10がプログラムを実行することにより所定時間TS
以内毎にライトアクセスされ、このCPU10からのラ
イトアクセスにより、ダウンカウント動作の初期値とし
ての所定値Nがセットされるようになっている。
The down counter 16 is CP
U10 executes the program for a predetermined time TS
The write access is performed every time, and the write access from the CPU 10 sets a predetermined value N as an initial value of the down count operation.

【0030】尚、上記所定時間TS は、ダウンカウンタ
16にセットされる所定値Nに内部クロックCKWの周
期TCKW を乗じた時間(N×TCKW )よりも短く設定さ
れている。また、電源IC6側の前述した設定時間T1
は、上記時間(N×TCKW )以上で、且つ、上記所定時
間TS を2倍した時間(2×TS )以上に設定されてい
る。
The predetermined time Ts is set shorter than the time (N.times.TCKW) obtained by multiplying the predetermined value N set in the down counter 16 by the period TCKW of the internal clock CKW. Further, the above-mentioned set time T1 on the power IC 6 side
Is set to be equal to or longer than the time (N.times.TCKW) and equal to or longer than the time (2.times.TS) obtained by doubling the predetermined time TS.

【0031】つまり、マイコン2の内部では、ダウンカ
ウンタ16とステータスレジスタ18とにより、CPU
10の動作を監視するウォッチドックタイマが構成され
ており、以下の説明では、改めて、ダウンカウンタ16
をDCT16と称し、ステータスレジスタ18をWSR
18と称す。
That is, in the microcomputer 2, the down counter 16 and the status register 18 are used to control the CPU.
A watchdog timer that monitors the operation of the counter 10 is configured. In the following description, the down counter 16
Is called DCT16 and status register 18 is WSR
It is called 18.

【0032】ここで、CPU10からDCT(ダウンカ
ウンタ)16へのライトアクセスについて、具体的に説
明する。まず、マイコン2の内部では、図2に示すよう
に、互いの位相が半周期ずれた2つの内部クロックCK
1,CK2が生成されており、CPU10は、内部クロ
ックCK2の2周期毎に、アドレスバス12へ出力する
アドレスAを変化させるように構成されている。そして
更に、CPU10は、アドレスAが変化した後の内部ク
ロックCK2の2発目の周期で、ライト信号Wを出力す
ると共に、データバス14へデータDaを出力するよう
に構成されている。
Here, the write access from the CPU 10 to the DCT (down counter) 16 will be specifically described. First, inside the microcomputer 2, as shown in FIG. 2, two internal clocks CK whose phases are shifted from each other by a half cycle.
1, CK2 are generated, and the CPU 10 is configured to change the address A output to the address bus 12 every two cycles of the internal clock CK2. Further, the CPU 10 is configured to output the write signal W and the data Da to the data bus 14 in the second cycle of the internal clock CK2 after the address A is changed.

【0033】そして、上記のようなタイミング関係に基
づき、CPU10が、アドレスバス12へDCT16に
対応するアドレス(本実施形態では、[0412h])
を出力すると共に、ライト信号Wを出力すると、図1に
示すアンド回路20からDCT16へ書き込み信号が出
力されて、DCT16が書き込み可能状態となり、更に
その状態で、CPU10がデータバス14へDCT16
にセットすべき上記所定値NをデータDaとして出力す
れば、その出力した所定値NがDCT16に書き込まれ
る。
Then, based on the above timing relationship, the CPU 10 sends the address corresponding to the DCT 16 to the address bus 12 ([0412h] in this embodiment).
In addition to outputting the write signal W, a write signal is output from the AND circuit 20 shown in FIG. 1 to the DCT 16 to put the DCT 16 in the writable state, and in this state, the CPU 10 sends the DCT 16 to the data bus 14.
When the predetermined value N to be set to is output as the data Da, the output predetermined value N is written in the DCT 16.

【0034】尚、[]内の「h」は、その「h」の前の
数字が16進数による表現であることを示している。ま
た、WSR(ステータスレジスタ)18も、CPU10
によりライトアクセスが可能である。即ち、CPU10
がアドレスバス12へWSR18に対応するアドレス
(本実施形態では、[0418h])を出力すると共
に、ライト信号Wを出力すると、アンド回路22からW
SR18へ書き込み信号が出力されて、WSR18が書
き込み可能状態となり、更にその状態で、CPU10が
データバス14へWSR18にセットすべきデータ値を
出力すれば、その出力したデータ値がWSR18に書き
込まれる。尚、詳しい説明は省略するが、DCT16及
びWSR18は、CPU10によるリードアクセスも可
能である。
The "h" in [] indicates that the number before the "h" is a hexadecimal number. Further, the WSR (status register) 18 is also connected to the CPU 10
Allows write access. That is, the CPU 10
Outputs the address ([0418h] in this embodiment) corresponding to the WSR 18 to the address bus 12 and outputs the write signal W, the AND circuit 22 outputs W.
When the write signal is output to the SR 18, the WSR 18 becomes the writable state, and further, when the CPU 10 outputs the data value to be set in the WSR 18 to the data bus 14, the output data value is written in the WSR 18. Although not described in detail, the DCT 16 and the WSR 18 can also be read-accessed by the CPU 10.

【0035】このマイコン2において、CPU10がプ
ログラムを正常に実行していれば、図3に示す如く、所
定時間TS 以内毎にCPU10からDCT16へライト
アクセスが行われて、DCT16のカウント値が所定値
Nに更新される。よって、この正常時には、WSR18
からCPU10へ内部リセット信号RTが出力されな
い。
In the microcomputer 2, if the CPU 10 normally executes the program, as shown in FIG. 3, the CPU 10 makes a write access to the DCT 16 within a predetermined time Ts, and the count value of the DCT 16 is a predetermined value. Updated to N. Therefore, in this normal state, WSR18
Does not output the internal reset signal RT to the CPU 10.

【0036】これに対し、CPU10にてプログラム暴
走が発生した場合には、CPU10からDCT16へラ
イトアクセスが行われなくなり、やがて、DCT16の
カウント値が「0」になる。すると、WSR18からC
PU10へ内部リセット信号RTが出力され、これによ
り、CPU10がリセットされて、プログラム暴走から
脱することとなる。
On the other hand, when the program runaway occurs in the CPU 10, the CPU 10 does not perform write access to the DCT 16, and eventually the count value of the DCT 16 becomes "0". Then WSR18 to C
The internal reset signal RT is output to the PU 10, whereby the CPU 10 is reset and the program runs out of control.

【0037】ここで特に、本実施形態の電子制御装置で
は、プログラム暴走が発生したか否かをマイコン2の外
部側でも監視するために、前述した電源IC6を設けて
おり、このことに対応して、マイコン2の内部には、C
PU10がDCT16へライトアクセスを行う度に、C
PU10の動作とは独立して電源IC6へ出力信号OU
Tを出力する信号出力回路24が設けられている。
Here, in particular, in the electronic control unit of the present embodiment, in order to monitor whether or not the program runaway has occurred also on the external side of the microcomputer 2, the above-mentioned power supply IC 6 is provided, which corresponds to this. In the inside of the microcomputer 2, C
Each time the PU 10 makes a write access to the DCT 16, C
Output signal OU to power supply IC 6 independent of the operation of PU 10.
A signal output circuit 24 that outputs T is provided.

【0038】即ち、図1に示すように、この信号出力回
路24は、前述した内部クロックCK1とCPU10か
らのアドレスA及びライト信号Wとを入力して、CPU
10からのアドレスAがDCT16に対応する[041
2h]であり、且つ、CPU10からライト信号Wが出
力されている時に、内部クロックCK1を出力し、そう
でなければ、ロウレベルを出力するアンド回路30を備
えている。
That is, as shown in FIG. 1, the signal output circuit 24 receives the above-mentioned internal clock CK1, the address A and the write signal W from the CPU 10, and outputs the signal to the CPU.
Address A from 10 corresponds to DCT 16 [041
2h] and when the write signal W is output from the CPU 10, the AND circuit 30 outputs the internal clock CK1 and outputs a low level otherwise.

【0039】更に、信号出力回路24は、アンド回路3
0の出力C1がクロック端子Cに入力されたDタイプ−
フリップフロップ(以下、DFFという)32と、この
DFF32の出力端子Qにデータ端子Dが接続され、ク
ロック端子Cに内部クロックCK2が入力されたDFF
34と、DFF34の出力端子Qから出力される信号を
反転してDFF32のデータ端子Dに入力させるインバ
ータ36と、DFF34の出力端子Qから出力される信
号を反転させた信号を、上記出力信号OUTとして当該
マイコン2の外部(即ち、電源IC6)へ出力するイン
バータ38とを備えている。
Further, the signal output circuit 24 is an AND circuit 3.
D type in which the output C1 of 0 is input to the clock terminal C
A flip-flop (hereinafter referred to as DFF) 32 and a DFF in which a data terminal D is connected to an output terminal Q of the DFF 32 and an internal clock CK2 is input to a clock terminal C
34, an inverter 36 for inverting the signal output from the output terminal Q of the DFF 34 and inputting it to the data terminal D of the DFF 32, and a signal obtained by inverting the signal output from the output terminal Q of the DFF 34, the output signal OUT And an inverter 38 for outputting to the outside of the microcomputer 2 (that is, the power supply IC 6).

【0040】そして、上記2つのDFF32,34のリ
セット端子Rには、電源IC6から当該マイコン2に出
力されるシステムリセット信号RESが入力されてい
る。尚、本実施形態の信号出力回路24は、2つのイン
バータ36,38を備えているが、例えば、インバータ
36の方を削除して、インバータ38の出力をDFF3
2のデータ端子Dに入力するようにしても良い。
The system reset signal RES output from the power supply IC 6 to the microcomputer 2 is input to the reset terminals R of the two DFFs 32 and 34. Although the signal output circuit 24 of the present embodiment includes two inverters 36 and 38, for example, the inverter 36 is deleted and the output of the inverter 38 is changed to the DFF3.
The data may be input to the second data terminal D.

【0041】このように構成された信号出力回路24に
おいては、電源IC6からシステムリセット信号RES
が出力されると、DFF32,34がリセットされる。
よって、DFF34の出力端子Qから出力される信号を
インバータ38により反転した出力信号OUTの初期レ
ベルは、ハイレベルである。
In the signal output circuit 24 thus constructed, the system reset signal RES is supplied from the power supply IC 6.
Is output, the DFFs 32 and 34 are reset.
Therefore, the initial level of the output signal OUT obtained by inverting the signal output from the output terminal Q of the DFF 34 by the inverter 38 is the high level.

【0042】そして、システムリセット信号RESによ
るリセットが行われた後、図2に示すように、CPU1
0がDCT16にライトアクセスして、アドレスバス1
2上のアドレスAが[0412h]となり且つライト信
号Wが出力され(ライト信号Wがハイレベルになり)、
この状態で内部クロックCK1がロウレベルからハイレ
ベルに立ち上がると、アンド回路30の出力C1も立ち
上がる。
After the reset by the system reset signal RES, as shown in FIG.
0 has write access to DCT16, and address bus 1
The address A on 2 becomes [0412h] and the write signal W is output (the write signal W becomes high level),
When the internal clock CK1 rises from the low level to the high level in this state, the output C1 of the AND circuit 30 also rises.

【0043】すると、この時には、DFF32のデータ
端子Dにインバータ36からハイレベルの信号が入力さ
れているため、DFF32の出力端子QからDFF34
のデータ端子Dに出力される信号(以下、DFF32の
出力という)Q1がロウレベルからハイレベルに変化
し、次に、内部クロックCK1の半周期遅れで内部クロ
ックCK2が立ち上がると、DFF34の出力端子Qか
ら出力される信号がロウレベルからハイレベルに変化し
て、出力信号OUTがハイレベルからロウレベルに反転
する。
Then, at this time, since a high level signal is input from the inverter 36 to the data terminal D of the DFF 32, the output terminal Q of the DFF 32 to the DFF 34.
When the signal Q1 (hereinafter referred to as the output of the DFF 32) output to the data terminal D of the DFF 34 changes from the low level to the high level, and then the internal clock CK2 rises with a half cycle delay of the internal clock CK1, the output terminal Q of the DFF 34 The output signal OUT changes from low level to high level, and the output signal OUT is inverted from high level to low level.

【0044】そして、図2に示す如く、CPU10が次
回にDCT16へライトアクセスを行った時には、DF
F32のデータ端子Dにインバータ36からロウレベル
の信号が入力されているため、内部クロックCK1の立
ち上がりタイミングでDFF32の出力Q1がハイレベ
ルからロウレベルに変化し、次に、内部クロックCK1
の半周期遅れで内部クロックCK2が立ち上がると、D
FF34の出力端子Qから出力される信号がハイレベル
からロウレベルに変化して、出力信号OUTがロウレベ
ルからハイレベルに反転する。
Then, as shown in FIG. 2, when the CPU 10 next makes a write access to the DCT 16, the DF
Since the low-level signal is input from the inverter 36 to the data terminal D of F32, the output Q1 of the DFF 32 changes from the high level to the low level at the rising timing of the internal clock CK1, and then the internal clock CK1.
When the internal clock CK2 rises with a half cycle delay of
The signal output from the output terminal Q of the FF 34 changes from high level to low level, and the output signal OUT is inverted from low level to high level.

【0045】以後は、上記動作が繰り返されることによ
り、図3に示すように、CPU10がDCT16へライ
トアクセスを行う度に、出力信号OUTがレベル反転す
る。つまり、本実施形態の信号出力回路24は、DCT
16へのライトアクセスが行われる度に出力信号OUT
のレベルが反転する、所謂トグル出力回路となってい
る。
Thereafter, by repeating the above operation, the level of the output signal OUT is inverted every time the CPU 10 makes a write access to the DCT 16, as shown in FIG. That is, the signal output circuit 24 of the present embodiment uses the DCT
Output signal OUT every time write access to 16 is performed
It is a so-called toggle output circuit in which the level of is inverted.

【0046】そして、このようにマイコン2から出力さ
れる出力信号OUTは、電源IC6によって監視され、
この出力信号OUTが設定時間T1以内に立ち上がらな
ければ、マイコン2にてプログラム暴走が発生したと判
断されて、電源IC6からマイコン2及びその周辺回路
にシステムリセット信号RESが出力される。
The output signal OUT output from the microcomputer 2 is monitored by the power supply IC 6,
If the output signal OUT does not rise within the set time T1, the microcomputer 2 determines that a program runaway has occurred, and the power supply IC 6 outputs the system reset signal RES to the microcomputer 2 and its peripheral circuits.

【0047】これにより、マイコン2にてプログラム暴
走が発生した時に、マイコン2の周辺回路も初期化され
る。また、何等かの原因でマイコン2が内蔵のウォッチ
ドックタイマ(DCT16及びWSR18)により自分
自身で初期化できない場合でも、マイコン2は電源IC
6により初期化されることとなる。
As a result, when a program runaway occurs in the microcomputer 2, the peripheral circuit of the microcomputer 2 is also initialized. In addition, even if the microcomputer 2 cannot initialize itself by the built-in watchdog timer (DCT16 and WSR18) for some reason, the microcomputer 2 can still be powered by the power supply IC.
It will be initialized by 6.

【0048】以上詳述したように、本実施形態の電子制
御装置では、マイコン2自身が、自己に内蔵されたDC
T16及びWSR18の働きにより、プログラム暴走の
有無を検出し、更に、マイコン2の外部でも、電源IC
6により、マイコン2からの出力信号OUTが設定時間
T1以内に立ち上がるか否かを監視することでプログラ
ム暴走の有無を検出するようにしている。
As described above in detail, in the electronic control unit of the present embodiment, the microcomputer 2 itself has a DC built in itself.
By the action of T16 and WSR18, the presence or absence of program runaway is detected, and even outside the microcomputer 2, the power IC
6, the presence or absence of program runaway is detected by monitoring whether the output signal OUT from the microcomputer 2 rises within the set time T1.

【0049】そして特に、本実施形態のマイコン2で
は、プログラム暴走の有無を外部で監視するための出力
信号OUTを、CPU10がプログラムを実行すること
で出力するようにしているのではなく、CPU10とは
別に設けた信号出力回路24が、CPU10からDCT
16へのライトアクセスを検出して、その検出の度に当
該マイコン2の外部へ上記出力信号OUTを出力するよ
うにしている。
In particular, in the microcomputer 2 of this embodiment, the CPU 10 does not output the output signal OUT for externally monitoring the presence or absence of program runaway by the CPU 10 executing the program. A signal output circuit 24, which is separately provided, is provided from the CPU 10 to the DCT
A write access to 16 is detected, and the output signal OUT is output to the outside of the microcomputer 2 each time it is detected.

【0050】よって、このマイコン2によれば、上記出
力信号OUTを、ソフトウェアの負荷を全く増加させる
ことなく出力することができる。しかも、CPU10が
プログラムを実行することで出力信号OUTを出力する
ようにした場合には、図4に例示するように、CPU1
0がDCT16へのライトアクセスを行ってから信号が
実際に出力されるまでに、プログラム実行分の遅れ時間
tが生じることとなるが、本実施形態のマイコン2によ
れば、図3に示すように、CPU10のDCT16への
ライトアクセスに対して遅れを生じることなく、出力信
号OUTを出力することができる。
Therefore, according to the microcomputer 2, the output signal OUT can be output without increasing the software load at all. Moreover, when the CPU 10 outputs the output signal OUT by executing the program, as shown in FIG.
0 causes a delay time t for program execution after the write access to the DCT 16 until the signal is actually output. According to the microcomputer 2 of the present embodiment, as shown in FIG. In addition, the output signal OUT can be output without causing a delay with respect to the write access to the DCT 16 of the CPU 10.

【0051】このため、プログラム暴走が発生したか否
かの電源IC6における判定基準(即ち、上記設定時間
T1)を、上記遅れ時間tを考慮することなく設定する
ことができ、その最適設定が極めて容易となる。この結
果、プログラム暴走が発生した時に、マイコン2及びそ
の周辺回路をシステムリセット信号RESによりリセッ
トする、といった装置全体の正常復帰動作を最適なタイ
ミングで行うことができるようになる。
Therefore, the criterion for determining whether or not the program runaway has occurred in the power supply IC 6 (that is, the set time T1) can be set without considering the delay time t, and its optimum setting is extremely high. It will be easy. As a result, when a program runaway occurs, the microcomputer 2 and its peripheral circuits are reset by the system reset signal RES, so that the normal recovery operation of the entire apparatus can be performed at an optimum timing.

【0052】また、本実施形態のマイコン2に設けられ
た信号出力回路24は、アンド回路30により、CPU
10からのアドレスAが[0412h]であり、且つ、
CPU10からライト信号Wが出力されていることを検
出して、CPU10からDCT16へのライトアクセス
を検出するようにしており、このため非常に小規模な回
路構成で前述した効果を得ることができる。
Further, the signal output circuit 24 provided in the microcomputer 2 of the present embodiment uses the AND circuit 30 to control the CPU.
Address A from 10 is [0412h], and
The CPU 10 detects the output of the write signal W to detect the write access from the CPU 10 to the DCT 16, so that the above-described effect can be obtained with a very small circuit configuration.

【0053】尚、本実施形態では、マイコン2に外部メ
モリなどの周辺回路が接続されていることを想定してい
るため、電源IC6から周辺回路へもシステムリセット
信号RESを出力するようにしているが、リセットの必
要な周辺回路が存在しない場合には、電源IC6により
マイコン2だけをリセットするように構成することがで
きる。
In this embodiment, since it is assumed that the microcomputer 2 is connected to a peripheral circuit such as an external memory, the power supply IC 6 outputs the system reset signal RES to the peripheral circuit. However, when there is no peripheral circuit that needs to be reset, only the microcomputer 2 can be reset by the power supply IC 6.

【0054】また、本実施形態の信号出力回路24は、
CPU10からDCT16へのライトアクセスが行われ
る度に出力信号OUTのレベルが反転するトグル出力回
路であったが、信号出力回路24は、CPU10からD
CT16へのライトアクセスが行われる度に、出力信号
OUTとして所定パルス幅のパルス信号を出力する、所
謂短パルス出力回路であっても、全く同様の効果を得る
ことができる。
Further, the signal output circuit 24 of the present embodiment is
The signal output circuit 24 is a toggle output circuit in which the level of the output signal OUT is inverted each time a write access is performed from the CPU 10 to the DCT 16.
Even with a so-called short pulse output circuit that outputs a pulse signal having a predetermined pulse width as the output signal OUT each time a write access to the CT 16 is performed, the same effect can be obtained.

【0055】一方、上記実施形態では、マイコン2が、
その内部にウォッチドックタイマ(DCT16及びWS
R18)を備えるものであったが、前述した特開昭61
−121140号公報に開示されているように、CPU
10が、プログラムの実行により、DCT16のカウン
ト値を読み出すと共に、その読み出したカウント値に基
づきプログラム暴走の有無を判定するようにしても良
い。
On the other hand, in the above embodiment, the microcomputer 2
Watchdog timer (DCT16 and WS)
R18), but the above-mentioned JP-A-61
As disclosed in Japanese Patent Laid-Open No. 121140
The program 10 may read the count value of the DCT 16 by executing the program, and determine whether or not the program has runaway based on the read count value.

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

【図1】 実施形態の電子制御装置の構成を表す概略構
成図である。
FIG. 1 is a schematic configuration diagram illustrating a configuration of an electronic control device according to an embodiment.

【図2】 図1のマイコン内に設けられた信号出力回路
の動作を説明するタイムチャートである。
2 is a time chart explaining the operation of a signal output circuit provided in the microcomputer of FIG.

【図3】 実施形態の効果を説明する説明図である。FIG. 3 is an explanatory diagram illustrating an effect of the embodiment.

【図4】 従来技術の問題を説明する説明図である。FIG. 4 is an explanatory diagram illustrating a problem of a conventional technique.

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

2…マイクロコンピュータ(マイコン) 4…電源回
路 6…電源IC 10…CPU 12…アドレスバス 14…データバス 16…ダウンカウンタ(DCT) 18…ステータスレジスタ(WSR) 20,22,
30…アンド回路 24…信号出力回路 32,34…Dタイプ−フリッ
プフロップ(DFF) 36,38…インバータ
2 ... Microcomputer 4 ... Power supply circuit 6 ... Power supply IC 10 ... CPU 12 ... Address bus 14 ... Data bus 16 ... Down counter (DCT) 18 ... Status register (WSR) 20, 22,
30 ... AND circuit 24 ... Signal output circuit 32, 34 ... D type-flip-flop (DFF) 36, 38 ... Inverter

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 平4−260942(JP,A) 特開 平1−319834(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06F 11/30 ─────────────────────────────────────────────────── ─── Continuation of the front page (56) References JP-A-4-260942 (JP, A) JP-A-1-319834 (JP, A) (58) Fields investigated (Int.Cl. 7 , DB name) G06F 11/30

Claims (9)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 CPUと、一定周期毎にカウント動作を
行うと共に、前記CPUからアドレスバス及びデータバ
スを介してライトアクセス及びリードアクセスが可能な
カウンタとを備え、前記CPUがプログラムを実行する
ことにより前記カウンタへ所定時間以内毎にライトアク
セスして該カウンタに初期値としての所定値を書き込
み、 更に、前記カウンタの値に基づきプログラム暴走が発生
したか否かを判定して、プログラム暴走の発生を検出す
ると、プログラム暴走から脱するための動作を行うよう
に構成されたマイクロコンピュータであって、 前記CPUから前記カウンタへのライトアクセスが行わ
れたことを検出すると共に、前記カウンタへのライトア
クセスを検出する度に、当該マイクロコンピュータの外
部へ信号を出力する信号出力回路を備えたこと、 を特徴とするマイクロコンピュータ。
1. A CPU and a counter capable of performing a count operation at regular intervals and having write access and read access from the CPU via an address bus and a data bus, wherein the CPU executes a program. The write-access to the counter is performed at every predetermined time by writing a predetermined value as an initial value to the counter, and it is determined based on the value of the counter whether or not the program runaway occurs, and the program runaway occurs. Is detected, the microcomputer configured to perform an operation for exiting the program runaway, detects that the CPU has performed write access to the counter, and also performs write access to the counter. A signal that outputs a signal to the outside of the microcomputer each time Microcomputer, further comprising a power circuit, the said.
【請求項2】 請求項1に記載のマイクロコンピュータ
において、 前記信号出力回路は、前記信号として、所定のパルス幅
を有するパルス信号を出力するように構成されているこ
と、 を特徴とするマイクロコンピュータ。
2. The microcomputer according to claim 1, wherein the signal output circuit is configured to output a pulse signal having a predetermined pulse width as the signal. .
【請求項3】 CPUと、一定周期毎にカウント動作を
行うと共に、前記CPUからアドレスバス及びデータバ
スを介してライトアクセス及びリードアクセスが可能な
カウンタとを備え、前記CPUがプログラムを実行する
ことにより前記カウンタへ所定時間以内毎にライトアク
セスして該カウンタに初期値としての所定値を書き込
み、 更に、前記カウンタの値に基づきプログラム暴走が発生
したか否かを判定して、プログラム暴走の発生を検出す
ると、プログラム暴走から脱するための動作を行うよう
に構成されたマイクロコンピュータであって、 前記CPUから前記カウンタへのライトアクセスが行わ
れたことを検出すると共に、 前記カウンタへのライトア
クセスを検出する度にレベルが反転する信号を当該マイ
クロコンピュータの外部へ出力する信号出力回路を備え
こと、 を特徴とするマイクロコンピュータ。
3. A CPU and a counting operation at regular intervals
At the same time, the CPU sends the address bus and data bus
Write access and read access are possible via
A counter, and the CPU executes a program
This allows the counter to write to the counter every predetermined time.
Access and write a predetermined value as an initial value to the counter
See further program runaway occurs based on the value of the counter
Whether or not the program has run out is detected.
Then, perform the action to get out of the program runaway
And a write access from the CPU to the counter.
And detects that the, the My signals level every time detecting the write access to the counter is inverted
Equipped with a signal output circuit that outputs to the outside of the black computer
A microcomputer characterized by:
【請求項4】 請求項に記載のマイクロコンピュータ
において、 前記信号出力回路は、 前記CPUから前記カウンタへのライトアクセスを検出
する手段として、前記CPUから前記アドレスバスに出
力されるアドレスと、前記CPUからデータの書き込み
を指示するために出力されるライト信号と、前記CPU
が前記ライト信号を出力している期間中に1回立ち上が
る内部クロックとを入力し、前記CPUからのアドレス
が前記カウンタに対応したアドレスであり、且つ、前記
CPUから前記ライト信号が出力されている時に、前記
内部クロックを出力するアンド回路を備えると共に、そ
のアンド回路から前記内部クロックが出力される度に出
力信号のレベルが反転するトグル出力回路であること、 を特徴とするマイクロコンピュータ。
4. The microcomputer according to claim 3 , wherein the signal output circuit serves as means for detecting a write access from the CPU to the counter, and an address output from the CPU to the address bus; A write signal output from the CPU to instruct writing of data, and the CPU
Input an internal clock that rises once during the period in which the write signal is being output, the address from the CPU is the address corresponding to the counter, and the write signal is being output from the CPU. A microcomputer comprising: an AND circuit that outputs the internal clock, and a toggle output circuit that inverts the level of the output signal every time the internal clock is output from the AND circuit.
【請求項5】 請求項1もしくは請求項2に記載のマイ
クロコンピュータと、 該マイクロコンピュータの前記信号出力回路から出力さ
れる信号を監視し、該信号が予め定められた設定時間以
内に出力されない場合に、前記マイクロコンピュータに
てプログラム暴走が発生したと判定する暴走検出手段
と、 を備えたことを特徴とする電子制御装置。
5. The microcomputer according to claim 1 or 2, and a signal output from the signal output circuit of the microcomputer is monitored, and the signal is not output within a predetermined set time. An electronic control device further comprising: a runaway detecting unit that determines that a program runaway has occurred in the microcomputer.
【請求項6】6. 請求項3もしくは請求項4に記載のマイMy according to claim 3 or claim 4.
クロコンピュータと、Black computer, 該マイクロコンピュータの前記信号出力回路から出力さOutput from the signal output circuit of the microcomputer
れる信号を監視し、該信号のレベルが予め定められた設Signal is monitored and the level of the signal is set to a predetermined value.
定時間以内に反転しない場合に、前記マイクロコンピュIf it does not reverse within a fixed time,
ータにてプログラム暴走が発生したと判定する暴走検出Runaway detection to determine that a program runaway has occurred on the computer
手段と、Means and を備えたことを特徴とする電子制御装置。An electronic control device comprising:
【請求項7】 請求項5もしくは請求項6に記載の電子
制御装置において、 前記暴走検出手段は、前記マイクロコンピュータにてプ
ログラム暴走が発生したと判定すると、当該電子制御装
置内にて前記マイクロコンピュータに接続された周辺回
路を初期化するように構成されていること、 を特徴とする電子制御装置。
7. The electronic control device according to claim 5, wherein, when the runaway detecting means determines that a program runaway has occurred in the microcomputer, the microcomputer is run in the electronic control device. The electronic control unit is configured to initialize the peripheral circuit connected to the.
【請求項8】 請求項に記載の電子制御装置におい
て、 前記暴走検出手段は、前記周辺回路と共に前記マイクロ
コンピュータを初期化するように構成されていること、
を特徴とする電子制御装置。
8. The electronic control device according to claim 7 , wherein the runaway detecting unit is configured to initialize the microcomputer together with the peripheral circuit,
An electronic control device characterized by:
【請求項9】 請求項5もしくは請求項6に記載の電子
制御装置において、 前記暴走検出手段は、前記マイクロコンピュータにてプ
ログラム暴走が発生したと判定すると、前記マイクロコ
ンピュータを初期化するように構成されていること、 を特徴とする電子制御装置。
9. The electronic control device according to claim 5, wherein the runaway detection unit initializes the microcomputer when the runaway detecting unit determines that a program runaway has occurred in the microcomputer. The electronic control unit is characterized by being.
JP33865496A 1996-12-18 1996-12-18 Microcomputer and electronic control unit Expired - Fee Related JP3415381B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP33865496A JP3415381B2 (en) 1996-12-18 1996-12-18 Microcomputer and electronic control unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP33865496A JP3415381B2 (en) 1996-12-18 1996-12-18 Microcomputer and electronic control unit

Publications (2)

Publication Number Publication Date
JPH10177506A JPH10177506A (en) 1998-06-30
JP3415381B2 true JP3415381B2 (en) 2003-06-09

Family

ID=18320219

Family Applications (1)

Application Number Title Priority Date Filing Date
JP33865496A Expired - Fee Related JP3415381B2 (en) 1996-12-18 1996-12-18 Microcomputer and electronic control unit

Country Status (1)

Country Link
JP (1) JP3415381B2 (en)

Also Published As

Publication number Publication date
JPH10177506A (en) 1998-06-30

Similar Documents

Publication Publication Date Title
US6012154A (en) Method and apparatus for detecting and recovering from computer system malfunction
US6438709B2 (en) Method for recovering from computer system lockup condition
US5576650A (en) Reset circuit of electronic device
JP2758742B2 (en) Malfunction detection method
JP2696511B2 (en) Return method from power down mode
JP2004086451A (en) Semiconductor integrated circuit
JP2013137835A (en) Microcomputer and method of operation thereof
JPH07134678A (en) Ram protective device
JPH05225067A (en) Important-memory-information protecting device
JP3056131B2 (en) System reset method
US6321289B1 (en) Apparatus for automatically notifying operating system level applications of the occurrence of system management events
US6463492B1 (en) Technique to automatically notify an operating system level application of a system management event
US5546588A (en) Method and apparatus for preventing a data processing system from entering a non-recoverable state
JP3415381B2 (en) Microcomputer and electronic control unit
JP2002189615A (en) Watchdog timer, information processing device, expansion board for watchdog timer, system initialization method, and storage medium
JPH11259340A (en) Reactivation control circuit for computer
JPH08339308A (en) Digital processor
JPH1097357A (en) Data processor and data processing system
JP2830522B2 (en) Watchdog timer
JPH06214831A (en) Abnormality detector for central processing unit
JP2928418B2 (en) Semiconductor integrated circuit
JP3951371B2 (en) Watchdog timer and microcomputer
JP3724034B2 (en) Control circuit for production equipment
JP2001188687A (en) Microcomputer
JP3172981B2 (en) Unused memory space access error detection circuit

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090404

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100404

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100404

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110404

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120404

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120404

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130404

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130404

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140404

Year of fee payment: 11

LAPS Cancellation because of no payment of annual fees