JPH1021101A - Microcomputer device - Google Patents
Microcomputer deviceInfo
- Publication number
- JPH1021101A JPH1021101A JP8188971A JP18897196A JPH1021101A JP H1021101 A JPH1021101 A JP H1021101A JP 8188971 A JP8188971 A JP 8188971A JP 18897196 A JP18897196 A JP 18897196A JP H1021101 A JPH1021101 A JP H1021101A
- Authority
- JP
- Japan
- Prior art keywords
- clock
- timer circuit
- timer
- program
- cpu
- 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
Links
Landscapes
- Debugging And Monitoring (AREA)
- Test And Diagnosis Of Digital Computers (AREA)
- Microcomputers (AREA)
Abstract
(57)【要約】
【課題】 CPUに供給されるクロックの速度に狂いが
生じていたり、あるいは周辺ハードウェアに供給される
クロックの速度に狂いが生じているような場合にも、こ
れを的確に診断する機能を備えたマイクロコンピュータ
装置を提供する。
【解決する手段】 第1のクロック供給系を介して供給
されるクロックを基準としてCPUにて一定のプログラ
ムを実行することにより計測された計測時間と、第2の
クロック供給系を介して供給されるクロックを基準とし
て前記タイマ回路で計測された計測時間とを照合し、そ
の照合結果に基づいて異常の有無を判定する。
(57) [Summary] [Problem] Even when the speed of a clock supplied to a CPU is irregular or the speed of a clock supplied to peripheral hardware is irregular, this is accurately determined. And a microcomputer device having a diagnostic function. SOLUTION: A measurement time measured by executing a predetermined program by a CPU with reference to a clock supplied through a first clock supply system, and a measurement time supplied through a second clock supply system. The measured time is compared with the time measured by the timer circuit on the basis of the clock which is used as a reference, and the presence or absence of abnormality is determined based on the result of the comparison.
Description
【0001】[0001]
【発明の属する技術分野】本発明は、自己診断機能を内
蔵したマイクロコンピュータ装置にかかり、特にいわゆ
るハードウェアタイマで計測された計測時間とソフトウ
ェアタイマで計測された計測時間との照合結果に基づい
て異常の有無を診断する機能を備えたマイクロコンピュ
ータ装置に関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microcomputer device having a built-in self-diagnosis function, and more particularly to a microcomputer device based on a comparison result of a measurement time measured by a so-called hardware timer and a measurement time measured by a software timer. The present invention relates to a microcomputer device having a function of diagnosing the presence or absence of an abnormality.
【0002】[0002]
【従来の技術】この種のマイクロコンピュータ装置に
は、CPU,ROM,RAM,周辺ハードウェア等の回
路要素をワンチップに集積化したいわゆるワンチップマ
イクロコンピュータ等と称されるものと、それら回路要
素をそれぞれ個別部品として一枚の回路基板上に搭載し
たいわゆるマイコンボード等と称されるものが知られて
いる。いずれの構成のマイクロコンピュータ装置におい
ても、CPUの動作用クロックと周辺ハードウェア用の
動作クロックとは別々のクロック供給系を介して供給さ
れるのが通例である。これは、CPUの動作タイムと周
辺ハードウェアの動作タイムとは必ずしも一致しないか
らである。2. Description of the Related Art A microcomputer device of this type includes a so-called one-chip microcomputer in which circuit elements such as a CPU, a ROM, a RAM, and peripheral hardware are integrated into one chip, What is called a so-called microcomputer board or the like in which are mounted on a single circuit board as individual components are known. In any of the microcomputer devices having the above configurations, the operation clock for the CPU and the operation clock for the peripheral hardware are generally supplied through separate clock supply systems. This is because the operation time of the CPU does not always coincide with the operation time of the peripheral hardware.
【0003】すなわち、外部水晶発信回路等から生成さ
れたクロックは、メインシステムクロック発生回路を経
由して適当な速度に調整された後、CPUへ至るクロッ
ク供給系と、周辺ハードウェアへ至るクロック供給系と
に送り出される。これらのクロック供給系には、与えら
れたクロックに基づいて分周比の異なる複数系統のクロ
ック信号を生成するためのプリスケーラや、それらプリ
スケーラから生成された複数系統のクロックの1つを選
択するためのセレクタ等が含まれている。That is, a clock generated from an external crystal oscillation circuit or the like is adjusted to an appropriate speed via a main system clock generation circuit, and then a clock supply system to the CPU and a clock supply to peripheral hardware. Sent to the system. These clock supply systems are used to select a prescaler for generating a plurality of clock signals having different division ratios based on a given clock, and to select one of the plurality of clocks generated from the prescaler. And the like are included.
【0004】ところで、この種のマイクロコンピュータ
装置における動作異常を診断するための手段としては、
いわゆるウォッチ・ドッグ・タイマ回路を用いた故障診
断方法が従来より知られている。この故障診断方法にあ
っては、予め一巡実行時間が規定された制御プログラム
中に、特定の出力ポートに対してON信号並びにOFF
信号を交互に出力するようにポートON命令並びにポー
トOFF命令を挿入する一方、この出力ポートから得ら
れる周期的なパルス列の周期をウォッチ・ドッグ・タイ
マにより監視し、これが規定時間を超えた場合CPUに
対して強制的にリセットをかけるようにしたものであ
る。By the way, as means for diagnosing abnormal operation in this type of microcomputer device,
A failure diagnosis method using a so-called watch dog timer circuit has been conventionally known. In this failure diagnosis method, an ON signal and an OFF signal are supplied to a specific output port in a control program in which a cycle execution time is specified in advance.
While a port ON command and a port OFF command are inserted so as to output signals alternately, the period of a periodic pulse train obtained from this output port is monitored by a watch dog timer. Is forcibly reset.
【0005】[0005]
【発明が解決しようとする課題】しかしながら、このよ
うな従来のウォッチ・ドッグ・タイマ回路を用いた故障
診断方法にあっては、マイクロコンピュータ装置の信頼
性を極度に追求しようとした場合、CPU並びに周辺ハ
ードウェアのそれぞれに対して、規定速度のクロックが
正常に供給されていることを確認する必要が生ずる。す
なわち、クロック速度の狂いは、各クロック供給系を構
成する分周回路やセレクタ等にビット固着が生じた場合
等に多く発生する。However, in such a fault diagnosis method using the conventional watch dog timer circuit, if the reliability of the microcomputer device is to be extremely pursued, the CPU and the CPU need not be used. It is necessary to confirm that a clock of a specified speed is normally supplied to each of the peripheral hardware. That is, the clock speed deviation often occurs when bits are fixed in a frequency dividing circuit, a selector, or the like constituting each clock supply system.
【0006】この発明の目的とするところは、CPUに
供給されるクロックの速度に狂いが生じていたり、ある
いは周辺ハードウェアに供給されるクロックの速度に狂
いが生じているような場合にも、これを的確に診断する
機能を備えたマイクロコンピュータ装置を提供すること
にある。An object of the present invention is to provide a method for controlling the speed of a clock supplied to a CPU or the speed of a clock supplied to peripheral hardware. An object of the present invention is to provide a microcomputer device having a function of accurately diagnosing this.
【0007】[0007]
【課題を解決するための手段】この出願の請求項1に記
載の発明は、プログラムを実行するためのCPUと、前
記プログラムを介して利用可能なタイマ回路と、前記C
PUに対してクロックを供給するための第1のクロック
供給系と、前記タイマ回路を含む周辺ハードウェアに対
してクロックを供給するための第2のクロック供給系と
を備えたマイクロコンピュータ装置であって、前記マイ
クロコンピュータ装置のシステムプログラムには、当該
マイクロコンピュータ装置の状態を診断するための診断
処理が組み込まれており、前記診断処理は、前記第1の
クロック供給系を介して供給されるクロックを基準とし
て前記CPUにて一定のプログラムを実行することによ
り計測された計測時間と、前記第2のクロック供給系を
介して供給されるクロックを基準として前記タイマ回路
で計測された計測時間とを照合し、その照合結果に基づ
いて異常の有無を判定する処理を含む、ことを特徴とす
るマイクロコンピュータ装置にある。According to a first aspect of the present invention, there is provided a CPU for executing a program, a timer circuit usable through the program,
A microcomputer device comprising: a first clock supply system for supplying a clock to a PU; and a second clock supply system for supplying a clock to peripheral hardware including the timer circuit. The system program of the microcomputer device incorporates a diagnosis process for diagnosing a state of the microcomputer device, and the diagnosis process is performed by a clock supplied through the first clock supply system. The measurement time measured by executing a predetermined program in the CPU with reference to the measurement time measured by the timer circuit with reference to the clock supplied through the second clock supply system. Collating and determining whether there is an abnormality based on the collation result. In the over the other apparatus.
【0008】この請求項1に記載の発明にあっては、第
1のクロック供給系を介して供給されるクロックを基準
としてCPUにて一定のプログラムを実行することによ
り計測された(いわゆる、ソフトウェアタイマ処理にて
計測された)計測時間と、第2のクロック供給系を介し
て供給されるクロックを基準としてタイマ回路で計測さ
れた(いわゆる、ハードウェアタイマにより計測され
た)計測時間とを照合し、その照合結果に基づいて異常
の有無を判定している。According to the first aspect of the present invention, the measurement is performed by executing a predetermined program by the CPU with reference to a clock supplied via the first clock supply system (so-called software). The measured time (measured by the timer process) is compared with the measured time measured by the timer circuit (measured by the so-called hardware timer) with reference to the clock supplied through the second clock supply system. Then, the presence or absence of an abnormality is determined based on the collation result.
【0009】ここで、ハードウェアタイマ処理にて計測
された計測時間とソフトウェアタイマ処理にて計測され
た計測時間との照合は、いずれを基準にして行ってもよ
い。すなわち、タイマ回路で一定時間を計測し、これに
よりタイマ割り込みがかかった時点において、ソフトウ
ェアタイマにおける計測時間を読み込んで両者を照合し
てもよいし、逆にソフトウェアタイマ処理にて一定時間
が計測されるのに応答して、ハードウェアタイマの計測
時間を読み込み、両者を照合しても良いであろう。Here, the comparison of the measurement time measured by the hardware timer processing with the measurement time measured by the software timer processing may be performed based on any of them. In other words, the timer circuit measures a certain period of time, and when a timer interrupt occurs, the measurement time of the software timer may be read and compared with each other. Alternatively, the fixed time may be measured by the software timer process. In response to this, the measurement time of the hardware timer may be read, and the two may be compared.
【0010】尚、『プログラムを実行するためのCP
U』とあるのは、この種のCPUにおける一般的な機能
を包括的に規定したものに過ぎない。すなわち、この種
のCPUにおいては、一般にプログラムカウンタを歩進
させつつROM等から命令を順次に読み出し、これをA
LU(Arithmetic and Logical Unit)等を用いて実行す
ることにより、プログラムにより規定された機能を実現
するものである。[0010] Note that "CP for executing a program"
"U" is merely a comprehensive definition of general functions in this type of CPU. That is, in this type of CPU, generally, instructions are sequentially read from a ROM or the like while a program counter is incremented, and this is read out by A
The functions defined by the program are realized by executing the program using an LU (Arithmetic and Logical Unit) or the like.
【0011】又、『プログラムを介して利用可能なタイ
マ回路』とあるのは、この種のマイクロコンピュータ装
置においては、外部タイマ回路を使用するための幾つか
の命令語が予め用意されており、それらの命令語を用い
て任意の時間の計測が可能となっている。ここで、周知
の如く、この種のタイマ回路における計測時間は、所定
の命令語を用いることによって、任意の時点でCPUに
読みこみが可能となっている。The "timer circuit which can be used via a program" means that in this type of microcomputer device, several command words for using an external timer circuit are prepared in advance. Arbitrary time can be measured using those command words. Here, as is well known, the measurement time in this type of timer circuit can be read into the CPU at any time by using a predetermined instruction word.
【0012】又、『タイマ回路を含む周辺ハードウェ
ア』とあるのは、この種のマイクロコンピュータ装置に
おいては、タイマ回路の他に、CPUの動作を支援する
ための各種のハードウェア回路が含まれるのが通例であ
るため、それらを包括的に規定したものである。そし
て、この請求項1に記載の発明によれば、第1のクロッ
ク供給系並びに第2のクロック供給系のそれぞれを構成
する分周回路やセレクタ等にビット固着故障等が存在す
れば、それらを経由して供給されるクロックに基づく2
つの計測時間に差異が生ずるため、それらの照合結果に
基づいて異常の有無を判定することができる。The term "peripheral hardware including a timer circuit" includes various hardware circuits for supporting the operation of the CPU in addition to the timer circuit in this type of microcomputer device. Since these are customary, they are comprehensively defined. According to the first aspect of the present invention, if any of the frequency dividing circuits and the selectors constituting the first clock supply system and the second clock supply system has a bit fixation failure, etc. 2 based on the clock supplied via
Since there is a difference between the two measurement times, the presence or absence of an abnormality can be determined based on the result of the comparison.
【0013】この出願の請求項2に記載の発明は、プロ
グラムを実行するためのCPUと、前記プログラムを介
して利用可能なタイマ回路と、前記CPUに対してクロ
ックを供給するための第1のクロック供給系と、前記タ
イマ回路に対してクロックを供給するための第2のクロ
ック供給系とを備えたマイクロコンピュータ装置であっ
て、前記マイクロコンピュータ装置のシステムプログラ
ムには、当該マイクロコンピュータ装置の状態を診断す
るための診断処理が組み込まれており、前記診断処理
は、前記タイマ回路を起動して計時動作を行わせるため
のタイマ回路起動処理と、前記タイマ回路の起動とほぼ
同時に起動されて所定の目標時間を計時するソフトウェ
アタイマ処理と、前記ソフトウェアタイマ処理にて計時
動作が完了するのに応答して、前記タイマ回路の経過時
間を読み込み、これを前記ソフトウェアタイマの目標時
間と照合する照合処理と、前記照合処理における照合結
果に基づいて、異常の有無を判定する判定処理とからな
る、ことを特徴とするマイクロコンピュータ装置にあ
る。According to a second aspect of the present invention, there is provided a CPU for executing a program, a timer circuit usable via the program, and a first circuit for supplying a clock to the CPU. A microcomputer device comprising a clock supply system and a second clock supply system for supplying a clock to the timer circuit, wherein a system program of the microcomputer device includes a state of the microcomputer device. A diagnostic process for diagnosing the timer is incorporated. The diagnostic process includes a timer circuit activation process for activating the timer circuit to perform a clocking operation, and a predetermined process that is activated almost simultaneously with the activation of the timer circuit. Software timer processing for measuring the target time of In response, the elapsed time of the timer circuit is read, a collation process for collating this with the target time of the software timer, and a determination process for determining the presence or absence of an abnormality based on the collation result in the collation process, A microcomputer device characterized by the above-mentioned.
【0014】この請求項2に記載の発明では、ソフトウ
ェアタイマ処理にて計測された計測時間を基準とし、ハ
ードウェアタイマ処理にて計測された計測時間を読み込
んで両者を照合することにより、異常の有無を判定して
いる。According to the second aspect of the present invention, the measurement time measured by the software timer processing is used as a reference, and the measurement time measured by the hardware timer processing is read and compared with each other. The presence or absence has been determined.
【0015】ここで、『タイマ回路の起動とほぼ同時
に』とあるのは、逐次直列実行方式であるマイクロコン
ピュータ処理の原理からして、全く同時に両者を起動す
ることは困難であることを考慮したためである。もちろ
ん、これらの起動は1命令実行時間の遅れをもって行う
ことが最も好ましいであろう。Here, "almost at the same time as the activation of the timer circuit" means that it is difficult to activate both at exactly the same time from the principle of microcomputer processing which is a serial execution method. It is. Of course, these activations are most preferably performed with a delay of one instruction execution time.
【0016】又、『ソフトウェアタイマ処理にて計時動
作が完了するのに応答して、前記タイマ回路の計時時間
を読み込み』とあることから、前述したように、このマ
イクロコンピュータ装置にあっては、一般に知られてい
るように、任意の時点において所定の命令語を用いるこ
とにより、外部タイマ回路の計測時間の読み込みが可能
となっている。As described above, since "the time measured by the timer circuit is read in response to the completion of the time measurement operation in the software timer process", as described above, in this microcomputer device, As is generally known, by using a predetermined instruction word at an arbitrary time, it is possible to read the measurement time of the external timer circuit.
【0017】又、『照合処理における照合結果に基づい
て、異常の有無を判定する』とあるのは、もちろん、照
合一致か若しくは不一致かに基づいて異常の有無を判定
するのであるが、その際の判定においては、一定の許容
幅が設定されている。すなわち、いかに両クロックが正
常であっても、2つの計測系において計測された計測時
間がビット単位で完全に一致することは有り得ないであ
ろう。The expression "determining the presence / absence of an abnormality based on the result of the collation in the collation process" means that the presence / absence of an abnormality is determined based on whether the collation matches or does not match. Is determined, a certain allowable width is set. In other words, no matter how both clocks are normal, it is unlikely that the measurement times measured in the two measurement systems completely match in bit units.
【0018】そして、この請求項2に記載の発明によれ
ば、タイマ割込処理を起動させることなく、両計測時間
の照合処理が可能となるため、計測時間の照合信頼性が
向上する。According to the second aspect of the present invention, since the collation processing of both measurement times can be performed without activating the timer interruption processing, the collation reliability of the measurement time is improved.
【0019】この出願の請求項3に記載の発明は、前記
診断処理は、システムプログラム中のイニシャライズ処
理にて実行されることを特徴とする請求項1若しくは請
求項2に記載のマイクロコンピュータ装置にある。According to a third aspect of the present invention, in the microcomputer device according to the first or second aspect, the diagnosis processing is executed by an initialization processing in a system program. is there.
【0020】この請求項3に記載の発明では、上述した
診断処理を、システムプログラム中のイニシャライズ処
理にて実行させている。According to the third aspect of the present invention, the above-described diagnosis processing is executed by an initialization processing in a system program.
【0021】ここで、『イニシャライズ処理』とあるの
は、当業者には良く知られているように、電源投入直後
において、本来の制御プログラムへ移行する前に実行さ
れる処理であって、通常は各種のフラグやレジスタの初
期設定を行ったり、必要な故障診断処理等を実行するも
のである。Here, the "initialization process" is a process executed immediately after power-on and before shifting to the original control program, as is well known to those skilled in the art. Performs initialization of various flags and registers, and executes necessary failure diagnosis processing.
【0022】そして、この請求項3に記載の発明によれ
ば、電源投入のたびに、2系統のクロック供給系のそれ
ぞれを診断することができ、マイクロコンピュータ装置
における信頼性を著しく向上させることができる。According to the third aspect of the present invention, it is possible to diagnose each of the two clock supply systems each time the power is turned on, thereby significantly improving the reliability of the microcomputer device. it can.
【0023】この出願の請求項4に記載の発明は、前記
診断処理は、当該CPUに対する割り込みを禁止した状
態において実行されることを特徴とする請求項1若しく
は請求項2に記載のマイクロコンピュータ装置にある。According to a fourth aspect of the present invention, in the microcomputer device according to the first or second aspect, the diagnostic processing is executed in a state in which an interrupt to the CPU is disabled. It is in.
【0024】この請求項4に記載の発明では、上述した
診断処理を、CPUに対する割り込みを禁止した状態に
おいて実行させている。According to the present invention, the above-described diagnostic processing is executed in a state where interruption to the CPU is prohibited.
【0025】ここで、このような割込処理の禁止は、当
該診断処理を挟んでその前後に、割込禁止命令と割込許
可命令とを挿入することで行われるであろう。Here, such prohibition of the interrupt processing will be performed by inserting an interrupt prohibition instruction and an interrupt permission instruction before and after the diagnostic processing.
【0026】そして、この請求項4に記載の発明によれ
ば、ソフトウェアタイマ処理の最中に他の割込みが入り
込まないため、ソフトウェアタイマ処理にて計測される
計測時間の精度が保証されることとなる。According to the fourth aspect of the present invention, since no other interrupt enters during the software timer processing, the accuracy of the measurement time measured by the software timer processing is guaranteed. Become.
【0027】この出願の請求項5に記載の発明は、前記
診断処理は、前記第2のクロック供給系を経由して前記
タイマ回路に対して最も高速なクロックを供給した状態
において行われることを特徴とする請求項1若しくは請
求項2に記載のマイクロコンピュータ装置にある。According to a fifth aspect of the present invention, the diagnostic processing is performed in a state where the fastest clock is supplied to the timer circuit via the second clock supply system. A microcomputer device according to claim 1 or claim 2.
【0028】この請求項5に記載の発明にあっては、上
述した診断処理を、外部タイマ回路に対して最も高速な
クロックを供給した状態において行わせている。According to the fifth aspect of the present invention, the above-described diagnostic processing is performed in a state where the fastest clock is supplied to the external timer circuit.
【0029】ここで、『最も高速なクロック』とあるの
は、この種のクロック供給系においては、通常プリスケ
ーラやセレクタ等が挿入され、複数系統の速度の異なる
クロックの中の1つを任意にCPUからの制御で選択で
きることを考慮したものである。Here, "the fastest clock" means that in this type of clock supply system, a prescaler, a selector, etc. are usually inserted, and one of a plurality of clocks having different speeds can be arbitrarily selected. This is in consideration of the fact that it can be selected under the control of the CPU.
【0030】そして、この請求項5に記載の発明によれ
ば、タイマ回路における計時動作は最も高速なクロック
を用いて行われるため、高精度な計測時間を用いて信頼
性の高い故障診断を行うことが可能となる。According to the fifth aspect of the present invention, since the clocking operation in the timer circuit is performed using the fastest clock, a highly reliable failure diagnosis is performed using a highly accurate measurement time. It becomes possible.
【0031】[0031]
【発明の実施の形態】以下、この発明の好ましい実施の
形態につき、添付図面を参照して詳細に説明する。Preferred embodiments of the present invention will be described below in detail with reference to the accompanying drawings.
【0032】周知の如く、この種のマイクロコンピュー
タ装置は、プログラムを実行するためのCPUと、プロ
グラムを格納するためのROMと、ワーキングエリア等
として使用されるRAMと、入出力のためのインタフェ
ース回路と、タイマ処理を実行するための外部タイマ回
路等により構成されており、CPUではプログラムカウ
ンタに従ってROMから命令を順次に読み出すと共に、
これをALUを用いてかつRAM内のワーキングエリア
を利用して実行すると共に、その最終実行結果をインタ
フェース回路を介して外部へと出力するのが一般的であ
る。このようなマイクロコンピュータの基本的な動作に
ついては、各種の文献において種々公知であるため、説
明は省略し、以下本発明の要部であるクロック供給系の
構成、タイマ回路の構成、並びにシステムプログラムの
構成を中心として説明する。As is well known, a microcomputer of this type includes a CPU for executing a program, a ROM for storing the program, a RAM used as a working area and the like, and an interface circuit for input / output. And an external timer circuit for executing a timer process. The CPU sequentially reads instructions from the ROM in accordance with a program counter,
Generally, this is executed using an ALU and using a working area in a RAM, and the final execution result is output to the outside via an interface circuit. The basic operation of such a microcomputer is widely known in various documents, and therefore, description thereof is omitted. Hereinafter, the configuration of a clock supply system, the configuration of a timer circuit, and the system program which are the main parts of the present invention The configuration will be mainly described.
【0033】本発明にかかるマイクロコンピュータ装置
のクロック供給系の構成を図1に示す。同図に示される
マイクロコンピュータ装置はいわゆるワンチップ・マイ
クロコンピュータ等と称されるものであり、図示しない
が、CPU、ROM、RAM、周辺ハードウェアをワン
チップに集積化して構成されており、クロックに関して
は外部に設けられた水晶発信回路等から供給されてい
る。FIG. 1 shows the configuration of the clock supply system of the microcomputer device according to the present invention. The microcomputer device shown in the figure is a so-called one-chip microcomputer or the like. Although not shown, the microcomputer device is configured by integrating a CPU, a ROM, a RAM, and peripheral hardware on a single chip. Is supplied from an externally provided crystal oscillation circuit or the like.
【0034】すなわち、ワンチップマイクロコンピュー
タ1の外部には水晶発信回路で構成されたクロック源2
が設けられており、このクロック源2から出力されるク
ロック信号は、ワンチップ・マイクロコンピュータ1に
導入された後、メイン・システムクロック発生回路3へ
と供給される。That is, a clock source 2 composed of a crystal oscillation circuit is provided outside the one-chip microcomputer 1.
The clock signal output from the clock source 2 is supplied to the one-chip microcomputer 1 and then to the main system clock generating circuit 3.
【0035】メイン・システムクロック発生回路3は、
クロック源2から供給されるクロックの周波数を適当に
調整した後、クロック信号fxとして出力する。このク
ロック信号fxは、更に2系統に分岐された後、一方は
その後段に設けられたセレクタ4の入力端子I1へと供
給され、他方は分周回路5によって2分周され、クロッ
ク信号fx/2としてセレクタ4の他方の入力端子I2
へと供給される。The main system clock generating circuit 3
After appropriately adjusting the frequency of the clock supplied from the clock source 2, the clock signal fx is output. After this clock signal fx is further divided into two systems, one is supplied to an input terminal I1 of a selector 4 provided at the subsequent stage, and the other is divided by two by a frequency dividing circuit 5, and the clock signal fx / 2, the other input terminal I2 of the selector 4
Supplied to.
【0036】セレクタ4は、図示しないCPUからの指
令により切替制御を行うように構成されており、そのた
めセレクタ4の出力端子Oからは、2つの入力端子I
1,I2のいずれかに供給されたクロック信号が、クロ
ック信号fxxとして出力される。このクロック信号f
xxは、更に2系統に分岐された後、その一方はCPU
へ至る第1のクロック供給系Aへと、また他方は周辺ハ
ードウェアへ至る第2のクロック供給系Bへと送り出さ
れる。The selector 4 is configured to perform switching control in accordance with a command from a CPU (not shown). Therefore, the output terminal O of the selector 4 has two input terminals I
The clock signal supplied to one of I1, I2 is output as the clock signal fxx. This clock signal f
xx is further branched into two systems, one of which is a CPU
To the first clock supply system A leading to the peripheral hardware and to the second clock supply system B leading to the peripheral hardware.
【0037】第1のクロック供給系Aは、クロック信号
fxxに基づいて、分周比の異なる4系統のクロック信
号fxx/24 ,fxx/23 ,fxx/22 ,fxx
/2を生成するプリスケーラ6と、このプリスケーラ6
で生成された4系統のクロック信号並びにセレクタ4か
ら出力されるクロック信号fxxから、その1つを選択
するためのセレクタ7が含まれている。すなわち、周知
の如く、プリスケーラ6はT型フリップフロップを多段
従属接続して構成されており、その出力端子O1〜O4
からは、各従属段の出力が並列に外部へと出力される。
プリスケーラ6の出力端子O1〜O4からの出力信号
は、セレクタ7の入力端子I1〜I4へと供給され、加
えてセレクタ4の出力端子Oから出力されるクロック信
号fxxはセレクタ7の入力端子I5へと供給されてい
る。セレクタ7は、先のセレクタ4と同様に、図示しな
いCPUからの指令により切替制御を行うように構成さ
れており、その出力端子Oからは入力端子I1〜I5へ
と供給されたクロック信号のいずれかがCPUクロック
fcpuとして出力され、このクロック信号fcpuが
図示しないCPUのクロック入力端子へと動作用クロッ
クとして供給されることとなる。The first clock supply system A, based on the clock signal fxx, has four clock signals fxx / 2 4 , fxx / 2 3 , fxx / 2 2 , fxx with different division ratios.
/ 2, and the prescaler 6
And a selector 7 for selecting one of the clock signals fxx output from the selector 4 and the four clock signals generated by the selector 4. That is, as is well known, the prescaler 6 is formed by cascade-connecting T-type flip-flops, and has output terminals O1 to O4.
, The output of each subordinate stage is output to the outside in parallel.
The output signals from the output terminals O1 to O4 of the prescaler 6 are supplied to the input terminals I1 to I4 of the selector 7, and the clock signal fxx output from the output terminal O of the selector 4 is also supplied to the input terminal I5 of the selector 7. Is supplied. The selector 7 is configured to perform switching control according to a command from a CPU (not shown), similarly to the selector 4 described above, and any one of the clock signals supplied from its output terminal O to the input terminals I1 to I5. Is output as a CPU clock fcpu, and this clock signal fcpu is supplied as an operating clock to a clock input terminal of a CPU (not shown).
【0038】他方、第2のクロック供給系Bには、先に
説明したプリスケーラ6と同様な構成を有するプリスケ
ーラ8が含まれており、このプリスケーラ8から得られ
る複数系統のクロック信号は、タイマ回路を含む周辺ハ
ードウェアへと供給されている。尚、ここでは図示して
いないが、周辺ハードウェアを構成する各タイマ回路等
の手前には、先に説明したセレクタ7と同様な構成を有
するセレクタがそれぞれ配置されており、図示しないC
PUからの指令により、それらタイマ回路等のクロック
利用機器に対するクロック信号を予め用意された複数種
類のクロック信号の中から選択させることが可能になさ
れている。すなわち、CPUで実行されるべきプログラ
ムにおいて、所定の命令語を使用してクロックを選択す
ることにより、それらタイマ回路並びにクロック利用機
器の使用クロックを、例えば、高速、中速、低速に任意
に切替えが可能になされている。On the other hand, the second clock supply system B includes a prescaler 8 having a configuration similar to that of the prescaler 6 described above. A plurality of clock signals obtained from the prescaler 8 are supplied to a timer circuit. To peripheral hardware, including: Although not shown here, a selector having the same configuration as the selector 7 described above is arranged in front of each timer circuit and the like constituting the peripheral hardware.
According to a command from the PU, a clock signal for a clock-using device such as a timer circuit can be selected from a plurality of types of clock signals prepared in advance. That is, in the program to be executed by the CPU, by selecting a clock using a predetermined instruction word, the clock used by the timer circuit and the clock-using device can be arbitrarily switched to, for example, high speed, medium speed, or low speed. Has been made possible.
【0039】次に、本発明の要部であるタイマ回路を含
むタイマ割込回路の構成を図2のロジックシンボル図に
示す。このタイマ割込回路は、同一構成からなる2系統
のタイマ割込回路から構成されている。Next, a configuration of a timer interrupt circuit including a timer circuit which is a main part of the present invention is shown in a logic symbol diagram of FIG. This timer interrupt circuit is composed of two systems of timer interrupt circuits having the same configuration.
【0040】すなわち、第1のタイマ割込回路は、カウ
ントクロックφ1を基準として時間計測動作を行い、か
つその計測時間をプログラムにて参照することが可能な
タイマ回路TM1と、タイマ回路TM1と比較されるべ
き目標時間をプログラムを介して書き込むことが可能な
コンペアレジスタCR1と、タイマ回路TM1の計測時
間とコンペアレジスタCR1の計測目標時間とが一致す
ると“1”にセットされ、かつその内容をプログラムに
て参照が可能な割込フラグIF1と、プログラムにて
“1”若しくは“0”に操作することが可能な割込マス
クフラグMK1と、割込マスクフラグMK1が“1”に
セットされているときに、割込フラグIF1の内容が出
力されることを禁止するための割込禁止ゲートG11
と、プログラムにて“1”若しくは“0”に操作するこ
とが可能な割込イネーブルフラグIEの出力で制御され
る割込許可ゲートG12とから構成されている。That is, the first timer interrupt circuit performs a time measurement operation with reference to the count clock φ1 and compares the measured time with a timer circuit TM1 and a timer circuit TM1. A compare register CR1 in which a target time to be written can be written via a program, is set to "1" when the measured time of the timer circuit TM1 matches the measured target time of the compare register CR1, and its contents are programmed. , An interrupt mask flag MK1 that can be set to “1” or “0” by a program, and an interrupt mask flag MK1 are set to “1”. At this time, an interrupt prohibition gate G11 for prohibiting the output of the content of the interrupt flag IF1 from being output.
And an interrupt enable gate G12 controlled by the output of an interrupt enable flag IE that can be set to "1" or "0" by a program.
【0041】同様にして第2のタイマ割込回路は、カウ
ントクロックφ2を基準として時間計測動作を行い、か
つその計測時間をプログラムにて参照することが可能な
タイマ回路TM2と、タイマ回路TM2と比較されるべ
き計測目標時間をプログラムにて書き込むことが可能な
コンペアレジスタCR2と、タイマ回路TM2の計測時
間とコンペアレジスタCR2の計測目標時間とが一致し
たときにセットされ、かつその内容をプログラムにて参
照が可能な割込フラグIF2と、プログラムにて“1”
若しくは“0”に操作することが可能な割込マスクフラ
グMK2と、割込マスクフラグMK2が“1”にセット
されているとき、割込フラグIF2の内容が出力される
ことを禁止するための割込禁止ゲートG21と、前述し
た割込イネーブルフラグIEにより制御される割込許可
ゲートG22とから構成されている。そして、割込許可
ゲートG12,G22から出力される信号は、タイマT
M1一致割込信号S1,タイマTM2一致割込信号S2
として、図示しないCPUの割込入力部へと供給され、
これによりプログラム実行中にいわゆるタイマ割込みが
かかることとなる。Similarly, the second timer interrupt circuit performs a time measurement operation on the basis of the count clock φ2, and can refer to the measured time by a program. A compare register CR2 in which a measurement target time to be compared can be written by a program, is set when the measurement time of the timer circuit TM2 coincides with the measurement target time of the compare register CR2, and its contents are stored in the program. Flag IF2 that can be referred to as “1” by the program
Alternatively, an interrupt mask flag MK2 that can be set to “0” and a signal for prohibiting output of the contents of the interrupt flag IF2 when the interrupt mask flag MK2 is set to “1”. It comprises an interrupt prohibition gate G21 and an interrupt permission gate G22 controlled by the above-described interrupt enable flag IE. The signals output from the interrupt permission gates G12 and G22 are
M1 match interrupt signal S1, timer TM2 match interrupt signal S2
Is supplied to an interrupt input unit (not shown) of the CPU.
As a result, a so-called timer interrupt occurs during execution of the program.
【0042】尚、上述した回路において、カウントクロ
ックφ1,φ2は、図1で説明した第2のクロック供給
系Bを経由して供給される複数系統のクロック信号の1
つであり、前述したようにプログラム中において所定の
クロック選択命令を使用することにより、例えば高速ク
ロック,中速クロック,低速クロック等のように任意に
切替えが可能に構成されている。後述する本発明の診断
処理においては、カウントクロックφ1としてそのうち
の最も高速なクロックが選択されている。In the circuit described above, the count clocks φ1 and φ2 correspond to one of a plurality of clock signals supplied via the second clock supply system B described with reference to FIG.
That is, as described above, by using a predetermined clock selection instruction in a program, it is possible to arbitrarily switch between a high-speed clock, a medium-speed clock, a low-speed clock, and the like. In the diagnostic processing of the present invention described later, the fastest clock is selected as the count clock φ1.
【0043】次に、本発明にかかる診断処理の構成を図
3のフローチャートを参照して順次系統的に説明する。
同図に示されるプログラムは電源導入直後のイニシャラ
イズ処理として実行されるものである。Next, the configuration of the diagnostic processing according to the present invention will be sequentially and systematically described with reference to the flowchart of FIG.
The program shown in the figure is executed as initialization processing immediately after the power supply is introduced.
【0044】すなわち、同図において処理が開始される
と、まず割込禁止処理が実行される(ステップ20
1)。この割込禁止処理では、図2に示される割込イネ
ーブルフラグIEを“0”にリセットすることによっ
て、割込許可ゲートG12,G22を閉じると共に、そ
の他、タイマ割込以外の全ての割込回路についても同様
に割り込みがかからないように該当するゲートを閉じ
る。That is, when the process is started in the figure, first, an interrupt prohibition process is executed (step 20).
1). In this interrupt prohibition process, the interrupt enable flags IE shown in FIG. 2 are reset to "0" to close the interrupt permission gates G12 and G22, and all other interrupt circuits other than the timer interrupt. In the same way, the corresponding gate is closed so as not to interrupt.
【0045】次いで、タイマTM1クロック設定処理が
実行されると(ステップ202)、先に説明した図示し
ないセレクタをプログラムを介して制御することによ
り、最も高速なクロックがカウントクロックφ1として
選択される。ここでは、このような最も高速なクロック
として0.4μsのクロックが選択されている。Next, when the timer TM1 clock setting process is executed (step 202), the highest-speed clock is selected as the count clock φ1 by controlling the above-described selector (not shown) through a program. Here, a clock of 0.4 μs is selected as such a fastest clock.
【0046】次いで、タイマTM1スタート処理が実行
されると(ステップ203)、図示しないタイマスター
ト/ストップフラグを“1”にセットすることにより、
タイマ回路TM1に対する起動がかけられる。尚、この
種のタイマスタート/ストップフラグについては、当業
者には良く知られているように、この種のマイクロコン
ピュータ装置において広く利用されているものであり、
このフラグをプログラムにおいて“0”にリセットする
とタイマ回路TM1はクリアされた状態で停止すること
となり、また“1”にセットするとそのセット時点から
計測動作を開始するものである。Next, when the timer TM1 start process is executed (step 203), a timer start / stop flag (not shown) is set to "1",
Activation of the timer circuit TM1 is performed. This type of timer start / stop flag is widely used in this type of microcomputer device, as is well known to those skilled in the art.
When this flag is reset to "0" in the program, the timer circuit TM1 is stopped in a cleared state, and when set to "1", the measuring operation is started from the set point.
【0047】次いで、ソフトタイマ処理が実行されると
(ステップ204)、所定の目標時間(ここでは、1.
7234ms)を計時するソフトウェアタイマ処理が行
われる。尚、この種のソフトウェアタイマ処理の詳細に
ついては、各種文献等において当業者に広く知られてお
り、すなわち一巡実行時間が規定されている一定のプロ
グラムを繰り返し実行することによって、目標時間を計
測するものである。又、このときCPUの動作クロック
としては0.2μsのクロックが使用されている。Next, when the soft timer process is executed (step 204), a predetermined target time (here, 1.
7234 ms). The details of this type of software timer processing are widely known to those skilled in the art in various documents and the like, that is, the target time is measured by repeatedly executing a fixed program in which the cycle execution time is defined. Things. At this time, a clock of 0.2 μs is used as the operation clock of the CPU.
【0048】次いで、タイマTM1計測値の読み込み処
理が実行されると(ステップ205)、それまでタイマ
回路TM1で計測されてきた経過時間が読み込まれ、こ
の経過時間はレジスタtm1に格納される。すなわち、
先に説明したように、タイマ回路TM1の計測値は、プ
ログラムにおいて所定の命令語を用いることにより、任
意に読み込みが可能となされており、このようにして読
み込まれた経過時間を図示しないRAMのワーキングエ
リアに設けられたレジスタtm1に格納するのである。Next, when reading processing of the timer TM1 measurement value is executed (step 205), the elapsed time measured by the timer circuit TM1 is read, and the elapsed time is stored in the register tm1. That is,
As described above, the measurement value of the timer circuit TM1 can be arbitrarily read by using a predetermined instruction word in the program, and the elapsed time thus read is stored in a RAM (not shown). It is stored in a register tm1 provided in the working area.
【0049】次いで、タイマTM1のストップ処理が実
行されると(ステップ206)、先に説明したスタート
/ストップフラグは“0”にリセットされ、これにより
タイマ回路TM1の計測動作は零リセットされた状態で
停止されることとなる。Next, when the stop processing of the timer TM1 is executed (step 206), the start / stop flag described above is reset to "0", whereby the measuring operation of the timer circuit TM1 is reset to zero. Will be stopped.
【0050】次いで、計測時間の照合処理が実行される
と(ステップ207)、タイマ回路TM1を用いたハー
ドウェアタイマ処理にて計測された計測時間とステップ
204のソフトウェアタイマ処理にて計測された計測時
間との照合が所定の許容幅をもって行われる。ここで、
ソフトウェアタイマ処理における目標時間である1.7
234msは、0.4μsのクロックにて計測すると、
4308.5クロック(1.7234ms/0.4μ
s)に相当する。そのため、上述した計測時間の照合
は、タイマ回路TM1にて計測された計測時間が、所定
の下限値10CBh(=4299クロック)と所定の上
限値10DFh(=4319クロック)との間に入って
いるか否かを判定することにより行われる。Next, when the measurement time comparison process is executed (step 207), the measurement time measured by the hardware timer process using the timer circuit TM1 and the measurement time measured by the software timer process of step 204 are executed. Collation with time is performed with a predetermined tolerance. here,
1.7 which is the target time in software timer processing
234 ms is measured with a clock of 0.4 μs,
438.5 clocks (1.7234 ms / 0.4μ)
s). Therefore, the above-described measurement time comparison is performed by checking whether the measurement time measured by the timer circuit TM1 falls between the predetermined lower limit 10CBh (= 4299 clocks) and the predetermined upper limit 10DFh (= 4319 clocks). It is performed by determining whether or not it is.
【0051】ここで、ハードウェアタイマ処理にて計測
された計測時間tm1が所定の上下限値内に納まってい
ると判定されると(ステップ207YES)、割込許可
処理が実行されて(ステップ208)、タイマ割込処理
のみならずその他全ての割込処理の禁止が解かれ、診断
処理を終了して、本来の目的とするメインルーチン処理
(制御処理等)への移行が行われる。これに対して、ハ
ードウェアタイマ処理にて計測された計測時間tm1が
所定の上下限値から外れていると判定されると(ステッ
プ207NO)、所定の異常時処理が実行され(ステッ
プ209)、その旨を外部へ報知したり、必要な安全の
ための処理等が実行されることとなる。Here, if it is determined that the measurement time tm1 measured by the hardware timer process falls within the predetermined upper and lower limit values (step 207 YES), an interrupt permission process is executed (step 208). The prohibition of not only the timer interrupt process but also all other interrupt processes is released, the diagnostic process is terminated, and a shift to the original main routine process (control process, etc.) is performed. On the other hand, if it is determined that the measurement time tm1 measured by the hardware timer process is out of the predetermined upper and lower limit values (NO in step 207), a predetermined abnormal time process is executed (step 209). That fact is notified to the outside, and necessary safety processing and the like are executed.
【0052】このように以上の実施の形態によれば、タ
イマ回路TM1を起動して計時動作を行わせるためのタ
イマ回路起動処理(ステップ203)と、タイマ回路T
M1の起動とほぼ同時に起動されて所定の目標時間を計
時するソフトウェアタイマ処理(ステップ204)と、
ソフトウェアタイマ処理にて計時動作が完了するのに応
答して、タイマ回路TM1の経過時間を読み込み(ステ
ップ205)、これをソフトウェアタイマ回路の目標時
間(1.7234ms)と照合する照合処理(ステップ
207)を設けたものであり、そのためCPUへクロッ
クを供給するための第1のクロック供給系A若しくはタ
イマ回路TM1を含む周辺ハードウェアへクロックを供
給するための第2のクロック供給系Bにおいて、プリス
ケーラやセレクタにビット固着故障等が生じたことを原
因として、動作クロックの速度に狂いが生じたような場
合には、照合処理(ステップ207)において照合不一
致が生じることにより、そのような異常を的確に診断す
ることができる。As described above, according to the above-described embodiment, the timer circuit activation process (step 203) for activating the timer circuit TM1 to perform the clocking operation is performed.
A software timer process (step 204) that is started almost simultaneously with the start of M1 and counts a predetermined target time;
In response to the completion of the timekeeping operation in the software timer process, the elapsed time of the timer circuit TM1 is read (step 205), and this is compared with the target time (1.7234 ms) of the software timer circuit (step 207). Therefore, in the first clock supply system A for supplying a clock to the CPU or the second clock supply system B for supplying a clock to peripheral hardware including the timer circuit TM1, a prescaler is provided. In the case where the speed of the operation clock is deviated due to the occurrence of a bit stuck failure or the like in the selector or the selector, such an abnormality is accurately detected by a verification mismatch (step 207). Can be diagnosed.
【0053】又、以上の実施の形態においては、診断処
理を挟んでその前後に割込禁止処理(ステップ201)
と割込許可処理(ステップ208)とを設けて、ソフト
ウェアタイマ処理の途中で何らかの割り込みが入ること
を禁止しているため、ソフトウェアタイマ処理にて計測
される計測時間の精度を確実に保証することができ、診
断の信頼性を確かなものとすることができる。In the above embodiment, an interrupt prohibition process is performed before and after the diagnostic process (step 201).
And an interrupt permitting process (step 208) to prevent any interruption during the software timer process, so that the accuracy of the measurement time measured by the software timer process is reliably guaranteed. And the reliability of the diagnosis can be assured.
【0054】更に、以上の実施の形態では、ハードウェ
アタイマ処理にて利用されるクロックとして最も高速な
クロック(0.4μs)を採用しているため、ハードウ
ェアタイマ処理における計測精度も高く、それらが相俟
って一層信頼性の高い診断処理を実現している。Further, in the above embodiment, since the highest clock (0.4 μs) is used as the clock used in the hardware timer processing, the measurement accuracy in the hardware timer processing is high, and This realizes a more reliable diagnosis process.
【0055】尚、以上の実施の形態においては、ソフト
ウェアタイマ処理(ステップ204)において所定時間
(1.7234ms)が計測完了するのに応答して、ハ
ードウェアタイマ処理における経過時間を読み込み、そ
の後両者を照合するという手法を採用したが、逆に、ハ
ードウェアタイマ処理にて所定時間が計測完了するのに
応答してタイマ割込を発生させ、この割込処理の中にお
いてソフトウェアタイマ処理の経過時間を読み込み、そ
の後両者を照合することによっても、同様な異常診断を
行うことができると考えられる。In the above embodiment, in response to the completion of the measurement of the predetermined time (1.7234 ms) in the software timer process (step 204), the elapsed time in the hardware timer process is read. On the other hand, a timer interrupt is generated in response to completion of measurement of a predetermined time in the hardware timer process, and the elapsed time of the software timer process is included in the interrupt process. It is considered that a similar abnormality diagnosis can be performed by reading both and then comparing them.
【0056】[0056]
【発明の効果】以上の説明で明らかなように、この発明
によれば、CPUに供給されるクロックの速度に狂いが
生じていたり、あるいは周辺ハードウェアに供給される
クロックの速度に狂いが生じているような場合にも、こ
れを的確に診断する機能を備えたマイクロコンピュータ
装置を提供することができるという効果がある。As is apparent from the above description, according to the present invention, the clock supplied to the CPU has an irregular speed or the clock supplied to the peripheral hardware has an irregular speed. In such a case, there is an effect that a microcomputer device having a function of accurately diagnosing this can be provided.
【図1】本発明にかかるマイクロコンピュータ装置にお
けるクロック供給系の構成を説明するためのブロック図
である。FIG. 1 is a block diagram for explaining a configuration of a clock supply system in a microcomputer device according to the present invention.
【図2】本発明の要部であるタイマ回路を含むタイマ割
込回路の構成を示すロジックシンボル図である。FIG. 2 is a logic symbol diagram showing a configuration of a timer interrupt circuit including a timer circuit which is a main part of the present invention.
【図3】本発明にかかる診断処理の詳細を示すフローチ
ャートである。FIG. 3 is a flowchart showing details of a diagnosis process according to the present invention.
1 ワンチップマイクロコンピュータ 2 クロック源 3 メイン・システムクロック発生回路 4 セレクタ 5 分周回路 6 プリスケーラ 7 セレクタ 8 プリスケーラ A 第1のクロック供給系 B 第2のクロック供給系 TM1,TM2 タイマ回路 CR1,CR2 コンペアレジスタ IF1,IF2 割込フラグ MK1,MK2 割込マスクフラグ G11,G21 割込禁止ゲート G12,G22 割込許可ゲート IE 割込イネーブルフラグ DESCRIPTION OF SYMBOLS 1 One-chip microcomputer 2 Clock source 3 Main system clock generation circuit 4 Selector 5 Divider circuit 6 Prescaler 7 Selector 8 Prescaler A 1st clock supply system B 2nd clock supply system TM1, TM2 Timer circuit CR1, CR2 Compare Register IF1, IF2 Interrupt flag MK1, MK2 Interrupt mask flag G11, G21 Interrupt inhibit gate G12, G22 Interrupt enable gate IE Interrupt enable flag
───────────────────────────────────────────────────── フロントページの続き (72)発明者 小島 浩孝 大阪府大阪市中央区城見一丁目4番24号 日本電気ホームエレクトロニクス株式会社 内 (72)発明者 大田 淳朗 埼玉県和光市中央一丁目4番1号 株式会 社本田技術研究所内 (72)発明者 林 達生 埼玉県和光市中央一丁目4番1号 株式会 社本田技術研究所内 ──────────────────────────────────────────────────続 き Continuing on the front page (72) Inventor Hirotaka Kojima 1-4-24 Shiromi, Chuo-ku, Osaka-shi, Osaka Within NEC Home Electronics Co., Ltd. No. 1 In Honda R & D Co., Ltd. (72) Inventor Tatsuo Hayashi Incorporated in Honda R & D Co., Ltd.
Claims (5)
前記プログラムを介して利用可能なタイマ回路と、前記
CPUに対してクロックを供給するための第1のクロッ
ク供給系と、前記タイマ回路を含む周辺ハードウェアに
対してクロックを供給するための第2のクロック供給系
とを備えたマイクロコンピュータ装置であって、 前記マイクロコンピュータ装置のシステムプログラムに
は、当該マイクロコンピュータ装置の状態を診断するた
めの診断処理が組み込まれており、 前記診断処理は、 前記第1のクロック供給系を介して供給されるクロック
を基準として前記CPUにて一定のプログラムを実行す
ることにより計測された計測時間と、前記第2のクロッ
ク供給系を介して供給されるクロックを基準として前記
タイマ回路で計測された計測時間とを照合し、その照合
結果に基づいて異常の有無を判定する処理を含む、 ことを特徴とするマイクロコンピュータ装置。1. A CPU for executing a program,
A timer circuit usable through the program; a first clock supply system for supplying a clock to the CPU; and a second clock supply system for supplying a clock to peripheral hardware including the timer circuit. A clock supply system, wherein a diagnostic process for diagnosing a state of the microcomputer device is incorporated in a system program of the microcomputer device. A measurement time measured by executing a predetermined program in the CPU with reference to a clock supplied through the first clock supply system, and a clock supplied through the second clock supply system. The measured time measured by the timer circuit is collated as a reference, and if there is an abnormality based on the collation result. The includes determining process, the microcomputer system, characterized in that.
前記プログラムを介して利用可能なタイマ回路と、前記
CPUに対してクロックを供給するための第1のクロッ
ク供給系と、前記タイマ回路に対してクロックを供給す
るための第2のクロック供給系とを備えたマイクロコン
ピュータ装置であって、 前記マイクロコンピュータ装置のシステムプログラムに
は、当該マイクロコンピュータ装置の状態を診断するた
めの診断処理が組み込まれており、 前記診断処理は、 前記タイマ回路を起動して計時動作を行わせるためのタ
イマ回路起動処理と、 前記タイマ回路の起動とほぼ同時に起動されて所定の目
標時間を計時するソフトウェアタイマ処理と、 前記ソフトウェアタイマ処理にて計時動作が完了するの
に応答して、前記タイマ回路の経過時間を読み込み、こ
れを前記ソフトウェアタイマの目標時間と照合する照合
処理と、 前記照合処理における照合結果に基づいて、異常の有無
を判定する判定処理とからなる、 ことを特徴とするマイクロコンピュータ装置。2. A CPU for executing a program,
A timer circuit available through the program, a first clock supply system for supplying a clock to the CPU, and a second clock supply system for supplying a clock to the timer circuit. In the microcomputer device, a diagnostic process for diagnosing a state of the microcomputer device is incorporated in a system program of the microcomputer device, and the diagnostic process activates the timer circuit. A timer circuit starting process for causing the timer circuit to perform a time counting operation; a software timer process being started almost simultaneously with the start of the timer circuit to count a predetermined target time; and a time counting operation being completed by the software timer process. In response, the elapsed time of the timer circuit is read, and is read by the software timer. A matching process for matching time, based on the collation result in the matching process, and a determination processing of determining whether there is an abnormality, the microcomputer system, characterized in that.
のイニシャライズ処理にて実行されることを特徴とする
請求項1若しくは請求項2に記載のマイクロコンピュー
タ装置。3. The microcomputer device according to claim 1, wherein the diagnosis process is performed by an initialization process in a system program.
り込みを禁止した状態において実行されることを特徴と
する請求項1若しくは請求項2に記載のマイクロコンピ
ュータ装置。4. The microcomputer device according to claim 1, wherein the diagnosis process is executed in a state in which an interrupt to the CPU is disabled.
給系を経由して前記タイマ回路に対して最も高速なクロ
ックを供給した状態において行われることを特徴とする
請求項1若しくは請求項2に記載のマイクロコンピュー
タ装置。5. The diagnosis process according to claim 1, wherein the diagnosis process is performed in a state where the fastest clock is supplied to the timer circuit via the second clock supply system. The microcomputer device according to claim 1.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP8188971A JPH1021101A (en) | 1996-06-27 | 1996-06-27 | Microcomputer device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP8188971A JPH1021101A (en) | 1996-06-27 | 1996-06-27 | Microcomputer device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH1021101A true JPH1021101A (en) | 1998-01-23 |
Family
ID=16233138
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP8188971A Pending JPH1021101A (en) | 1996-06-27 | 1996-06-27 | Microcomputer device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH1021101A (en) |
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6925576B2 (en) | 2000-09-01 | 2005-08-02 | Yazaki Corporation | Control unit and multiplex communication system using the same |
| JP2006260421A (en) * | 2005-03-18 | 2006-09-28 | Hitachi Ltd | Clock abnormality monitoring method and apparatus |
| JP2008021229A (en) * | 2006-07-14 | 2008-01-31 | Nec Electronics Corp | Timing control circuit and timer abnormality detecting method |
| JP2008229392A (en) * | 2008-06-30 | 2008-10-02 | Sanyo Product Co Ltd | Pinball game machine |
| JP2008294786A (en) * | 2007-05-25 | 2008-12-04 | Nippon Seiki Co Ltd | Pulse generator |
| JP2008299731A (en) * | 2007-06-01 | 2008-12-11 | Panasonic Corp | Semiconductor integrated circuit, information processing system |
| JP2010061470A (en) * | 2008-09-04 | 2010-03-18 | Denso Corp | Processing device and electronic unit |
-
1996
- 1996-06-27 JP JP8188971A patent/JPH1021101A/en active Pending
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6925576B2 (en) | 2000-09-01 | 2005-08-02 | Yazaki Corporation | Control unit and multiplex communication system using the same |
| JP2006260421A (en) * | 2005-03-18 | 2006-09-28 | Hitachi Ltd | Clock abnormality monitoring method and apparatus |
| JP2008021229A (en) * | 2006-07-14 | 2008-01-31 | Nec Electronics Corp | Timing control circuit and timer abnormality detecting method |
| JP2008294786A (en) * | 2007-05-25 | 2008-12-04 | Nippon Seiki Co Ltd | Pulse generator |
| JP2008299731A (en) * | 2007-06-01 | 2008-12-11 | Panasonic Corp | Semiconductor integrated circuit, information processing system |
| JP2008229392A (en) * | 2008-06-30 | 2008-10-02 | Sanyo Product Co Ltd | Pinball game machine |
| JP2010061470A (en) * | 2008-09-04 | 2010-03-18 | Denso Corp | Processing device and electronic unit |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US4796211A (en) | Watchdog timer having a reset detection circuit | |
| US5377200A (en) | Power saving feature for components having built-in testing logic | |
| CN107430167B (en) | Semiconductor device and diagnostic test method | |
| KR100296984B1 (en) | Monitoring System For Electronic Control System | |
| JPH0220816B2 (en) | ||
| US4866713A (en) | Operational function checking method and device for microprocessors | |
| JPS5833576B2 (en) | Computer system failure diagnosis device | |
| EP0488281B1 (en) | Test mode setting arrangement for use in microcomputer | |
| JP4178210B2 (en) | Game machine | |
| JPH0876873A (en) | Driving device of microcomputer | |
| JP5983588B2 (en) | Abnormality judgment device for vehicle microcomputer | |
| JP4226108B2 (en) | Digital signal processor and processor self-test method | |
| JP3308669B2 (en) | System control unit | |
| JP2018041492A (en) | Microcomputer | |
| JPH1021112A (en) | Microcomputer device | |
| EP4592847A1 (en) | Dual timing circuit | |
| JP3124912B2 (en) | Timer device | |
| JPS6256539B2 (en) | ||
| JP7083728B2 (en) | Self-diagnosis device, semiconductor device and self-diagnosis method | |
| JP3609601B2 (en) | Timer circuit with self-diagnosis function | |
| JPH10283219A (en) | Information processor start system | |
| JPH0814779B2 (en) | Initialization method for arithmetic and control unit | |
| JPH11284505A (en) | Timer circuit | |
| EP0584917A2 (en) | System and method for testing a programmable logic | |
| SU960826A1 (en) | Digital unit checking device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20050803 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20050809 |
|
| A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20060124 |