JP2002333997A - System clock check method for microcomputer - Google Patents

System clock check method for microcomputer

Info

Publication number
JP2002333997A
JP2002333997A JP2001139787A JP2001139787A JP2002333997A JP 2002333997 A JP2002333997 A JP 2002333997A JP 2001139787 A JP2001139787 A JP 2001139787A JP 2001139787 A JP2001139787 A JP 2001139787A JP 2002333997 A JP2002333997 A JP 2002333997A
Authority
JP
Japan
Prior art keywords
system clock
microcomputer
section
cpu
abnormality
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.)
Withdrawn
Application number
JP2001139787A
Other languages
Japanese (ja)
Inventor
Hajime Kawachi
河内  肇
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.)
RB Controls Co Ltd
Original Assignee
RB Controls Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by RB Controls Co Ltd filed Critical RB Controls Co Ltd
Priority to JP2001139787A priority Critical patent/JP2002333997A/en
Publication of JP2002333997A publication Critical patent/JP2002333997A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide the system clock check method of a microcomputer capable of detecting the generation of abnormality that an arithmetic processing speed is deteriorated in a system clock part. SOLUTION: A signal outputted from a microcomputer oscillation circuit 1 is branched, and supplied to a timer part 3 as a system different from a system to be supplied to a CPU, and dummy software whose arithmetic processing time is preliminarily known is executed by the CPU, and a time required for the execution is measured by a timer part, and when not less than a prescribed time is spent on the arithmetic processing of the dummy software, it is judged that abnormality is generated.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、制御装置などに用
いられるマイコンのシステムクロック部に異常が生じた
ことを検出することのできるマイコンのシステムクロッ
クチェック方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microcomputer system clock check method capable of detecting that an abnormality has occurred in a system clock section of a microcomputer used in a control device or the like.

【0002】[0002]

【従来の技術】上記のマイコンではマイコン発振回路で
発生されたクロック信号を分岐させ、システムクロック
部とタイマー部とに供給している。システムクロック部
にはプログラムを処理する演算処理ユニット(CPU)
が設けられており、このCPUはマイコン発振回路から
供給されたクロック信号に同期してプログラムを処理す
る。
2. Description of the Related Art In the above-mentioned microcomputer, a clock signal generated by a microcomputer oscillation circuit is branched and supplied to a system clock section and a timer section. Arithmetic processing unit (CPU) that processes programs in the system clock section
The CPU processes a program in synchronization with a clock signal supplied from a microcomputer oscillation circuit.

【0003】このようなプログラムとして、例えばマイ
コンがガス器具の制御装置に内蔵されている場合には、
ガス器具の作動を制御する制御プログラムがある。この
種の制御プログラムには安全機能が組み込まれており、
例えば点火操作がされてから所定時間経過してもバーナ
に点火したことが検出されない場合には、バーナにガス
を供給するガス供給管に取り付けた安全弁を閉弁させる
機能が組み込まれている。
[0003] As such a program, for example, when a microcomputer is built in a control device of a gas appliance,
There is a control program that controls the operation of gas appliances. This type of control program incorporates safety features,
For example, if it is not detected that the burner has been ignited even if a predetermined time has elapsed after the ignition operation, a function for closing a safety valve attached to a gas supply pipe for supplying gas to the burner is incorporated.

【0004】[0004]

【発明が解決しようとする課題】上記システムクロック
部に異常が発生した場合、CPUでの演算処理が完全に
停止すると、例えばCPUの作動を常時監視しているウ
ォッチドッグタイマー回路がCPUの停止を検出し、C
PUのリセット等の所定の処理を行う。ところが、CP
Uの演算処理速度が低下するような異常が発生した場合
には、ウォッチドッグタイマー回路等の従来の対応手段
では検出することができない。そして、このようなCP
Uの演算処理速度が低下する異常が生じた場合に、上記
の点火確認機能のようにプログラム上で所定時間経過し
た後に所定の処理を行うようにプログラムされている
と、CPUが待機する時間と実際の経過時間とが一致し
ないという不具合が生じる。例えば10秒間待機するよ
うにプログラムした場合に、CPUの演算処理速度が低
下すると、実際の待機時間は10秒以上になる。
When an abnormality occurs in the system clock section and the arithmetic processing in the CPU is completely stopped, for example, a watchdog timer circuit which constantly monitors the operation of the CPU stops the CPU. Detect and C
A predetermined process such as reset of the PU is performed. However, CP
When an abnormality such as a decrease in the processing speed of U occurs, it cannot be detected by a conventional countermeasure such as a watchdog timer circuit. And such a CP
If an abnormality occurs in which the processing speed of U decreases, if the CPU is programmed to perform a predetermined process after a predetermined time elapses on the program as in the above-described ignition confirmation function, the CPU wait time and There is a problem that the actual elapsed time does not match. For example, if the CPU is programmed to wait for 10 seconds and the CPU processing speed is reduced, the actual standby time becomes 10 seconds or more.

【0005】そこで本発明は、上記の問題点に鑑み、シ
ステムクロック部で演算処理速度が低下するような異常
が発生してもその異常を検出することできるマイコンの
システムクロックチェック方法を提供することを課題と
する。
SUMMARY OF THE INVENTION In view of the above problems, the present invention provides a microcomputer system clock check method capable of detecting an abnormality such as a decrease in the arithmetic processing speed in the system clock section. As an issue.

【0006】[0006]

【課題を解決するための手段】上記課題を解決するため
に本発明によるマイコンのシステムクロックチェック方
法は、マイコン発振回路から出力されるクロック信号を
システムクロック部とタイマー部とに供給するマイコン
の、システムクロック部に生じた異常を検出する方法に
おいて、システムクロック部に供給されたクロック信号
に同期して処理されるプログラムを処理させ、タイマー
部に供給されたクロック信号を用いてプログラムの処理
時間を計測し、該処理時間が予め設定された処理時間よ
り長い場合に、システムクロック部に異常が生じたと判
断することを特徴とする。
In order to solve the above problems, a microcomputer system clock check method according to the present invention comprises a microcomputer which supplies a clock signal output from a microcomputer oscillation circuit to a system clock section and a timer section. In a method of detecting an abnormality occurring in a system clock unit, a program processed in synchronization with a clock signal supplied to a system clock unit is processed, and a processing time of the program is reduced using a clock signal supplied to a timer unit. It is characterized in that when the measurement is performed and the processing time is longer than a preset processing time, it is determined that an abnormality has occurred in the system clock unit.

【0007】システムクロック部に異常が発生してシス
テムクロック部での演算処理速度が低下するとプログラ
ムを処理するために要する時間が長くなる。したがっ
て、システムクロック部でのプログラム処理時間を計測
し、システムクロック部が正常な状態でそのプログラム
を処理するのに要する時間を予め設定しておき、実際の
処理時間がその設定した時間より長くなるとシステムク
ロック部に異常が発生したと判断することができる。
When an abnormality occurs in the system clock section and the arithmetic processing speed in the system clock section decreases, the time required for processing the program increases. Therefore, the program processing time in the system clock section is measured, and the time required for processing the program in a normal state of the system clock section is set in advance, and when the actual processing time is longer than the set time. It can be determined that an abnormality has occurred in the system clock unit.

【0008】なお、このシステムクロックチェック方法
に用いるプログラムは処理時間を計測するだけのもので
あり、したがって、上記プログラムはマイコンの機能に
関係しないダミープログラムとしてもよい。
The program used in this system clock check method only measures the processing time. Therefore, the above program may be a dummy program not related to the functions of the microcomputer.

【0009】[0009]

【発明の実施の形態】図1を参照して、1はマイコン発
振回路であり、図示しない水晶発振子を備えた発振回路
を内蔵している。このマイコン発振回路1は周波数fx
の信号を発振するように設定されている。このマイコン
発振回路1から出力される周波数fxの信号は分岐さ
れ、各々プリスケーラ11に入力される。このプリスケ
ーラ11では入力された周波数fxの信号を分周し、例
えば周波数がfx、fx/2、fx/4、fx/16の
相互に周波数の相違する4種類の信号を出力する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Referring to FIG. 1, reference numeral 1 denotes a microcomputer oscillation circuit having a built-in oscillation circuit having a crystal oscillator (not shown). This microcomputer oscillation circuit 1 has a frequency fx
Is set to oscillate. The signal of the frequency fx output from the microcomputer oscillation circuit 1 is branched and input to the prescaler 11 respectively. The prescaler 11 divides the frequency of the input signal of frequency fx and outputs four types of signals having different frequencies, for example, fx, fx / 2, fx / 4, and fx / 16.

【0010】2はシステムクロック部であり、図示しな
い中央演算処理ユニット(CPU)の作動クロック信号
を生成する。そして、プリスケーラ11から出力される
信号の中からセレクタ12は周波数fxの信号を選択し
てシステムクロック部2に供給する。これによりCPU
は周波数fxの信号に同期して演算処理を行う。
Reference numeral 2 denotes a system clock section, which generates an operation clock signal for a central processing unit (CPU) not shown. Then, the selector 12 selects a signal of the frequency fx from the signals output from the prescaler 11 and supplies the selected signal to the system clock unit 2. This allows the CPU
Performs arithmetic processing in synchronization with a signal of frequency fx.

【0011】一方、3はシステムクロック部2から完全
に独立したタイマー部であって、周波数fx/4の信号
がセレクタ12を介して供給されている。このタイマー
部3内には、周波数fx/4の信号を入力し、1周期毎
に積算するタイマーを内蔵している。そして積算値が所
定の値に到達すると一旦積算値を0にリセットしたあ
と、所定の値まで積算を繰り返す。
On the other hand, reference numeral 3 denotes a timer unit completely independent of the system clock unit 2, and a signal of a frequency fx / 4 is supplied via a selector 12. The timer unit 3 has a built-in timer for inputting a signal of the frequency fx / 4 and integrating the signal for each cycle. When the integrated value reaches a predetermined value, the integrated value is once reset to 0, and the integration is repeated up to the predetermined value.

【0012】図2及び図3を参照して、図2に示すフロ
ーが開始されると最初にタイマー部3内のタイマーの積
算値を読み取る(S1)。続いて、ダミーソフトを実行
する(S2)。このダミーソフトはシステムクロック部
2の生成する作動クロック信号に同期して演算処理を行
うCPUによって実行される。このダミーソフトの内容
は、CPUが周波数fxの信号に同期して実行した場合
に所定時間を要するようにプログラムされている。
Referring to FIGS. 2 and 3, when the flow shown in FIG. 2 is started, first, the integrated value of the timer in the timer section 3 is read (S1). Subsequently, dummy software is executed (S2). This dummy software is executed by a CPU that performs arithmetic processing in synchronization with an operation clock signal generated by the system clock unit 2. The contents of the dummy software are programmed so that a predetermined time is required when the CPU executes the program in synchronization with the signal of the frequency fx.

【0013】ダミーソフトの実行が終了すると再びタイ
マー部3内のタイマーの積算値を読み取る(S3)。上
記のようにS1で読み取った積算値に対してS3で読み
取った積算値は、ダミーソフトの実行時間の間に新たに
積算された値が増加している。そのため、S3で読み取
った積算値とS1で読み取った積算値との差ΔTを求め
(S4)、このΔTと予め設定した値αとを比較する
(S5)。このαはCPUがダミーソフトを正常な演算
処理速度で実行した場合に要する時間に対応した値であ
る。したがって、ΔTがαと同じか小さい場合には問題
はないが、ΔTがαより大きい場合にはシステムクロッ
ク部2に何らかの異常が発生し、CPUが世紀の演算処
理速度より遅い速度で演算処理を行っていることを示
す。従来のウォッチドッグタイマーでは演算処理が停止
しない限り異常の発生を検出できないが、本発明の場合
には、ΔTがαより大きい場合にはステップS6に進
み、所定のエラー処理を行うようにした。
When the execution of the dummy software is completed, the integrated value of the timer in the timer section 3 is read again (S3). As for the integrated value read in S3 with respect to the integrated value read in S1 as described above, the newly integrated value increases during the execution time of the dummy software. Therefore, a difference ΔT between the integrated value read in S3 and the integrated value read in S1 is obtained (S4), and this ΔT is compared with a preset value α (S5). Α is a value corresponding to the time required when the CPU executes the dummy software at a normal operation processing speed. Therefore, there is no problem when ΔT is equal to or smaller than α. However, when ΔT is larger than α, some abnormality occurs in the system clock unit 2 and the CPU executes the arithmetic processing at a speed lower than the arithmetic processing speed of the century. Indicate what you are doing. The conventional watchdog timer cannot detect the occurrence of an abnormality unless the arithmetic processing is stopped. However, in the case of the present invention, when ΔT is larger than α, the process proceeds to step S6, and a predetermined error process is performed.

【0014】[0014]

【発明の効果】以上の説明から明らかなように、本発明
は、CPUの演算処理速度が低下するという従来のウォ
ッチドッグタイマーでは検出できない異常が発生した場
合であっても、その異常の発生を検出することができ
る。
As is apparent from the above description, the present invention can prevent the occurrence of an abnormality even if an abnormality occurs that cannot be detected by the conventional watchdog timer, that is, the operation processing speed of the CPU is reduced. Can be detected.

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

【図1】本発明の一実施の形態の構成を示す図FIG. 1 is a diagram showing a configuration of an embodiment of the present invention.

【図2】異常検出を行うためのフロー図FIG. 2 is a flowchart for performing abnormality detection.

【図3】タイマー部内での積算を説明するための図FIG. 3 is a diagram for explaining integration in a timer unit;

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

1 マイコン発振回路 2 システムクロック部 3 タイマー部 1 microcomputer oscillation circuit 2 system clock section 3 timer section

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 マイコン発振回路から出力されるクロ
ック信号をシステムクロック部とタイマー部とに供給す
るマイコンの、システムクロック部に生じた異常を検出
する方法において、システムクロック部に供給されたク
ロック信号に同期して処理されるプログラムを処理さ
せ、タイマー部に供給されたクロック信号を用いてプロ
グラムの処理時間を計測し、該処理時間が予め設定され
た処理時間より長い場合に、システムクロック部に異常
が生じたと判断することを特徴とするマイコンのシステ
ムクロックチェック方法。
1. A method for detecting an abnormality occurring in a system clock section of a microcomputer for supplying a clock signal output from a microcomputer oscillation circuit to a system clock section and a timer section, the clock signal supplied to the system clock section. Process the program to be processed in synchronization with the timer, measure the processing time of the program using the clock signal supplied to the timer section, if the processing time is longer than the preset processing time, the system clock section A method of checking a system clock of a microcomputer, which determines that an abnormality has occurred.
【請求項2】 上記プログラムはマイコンの機能に関
係しないダミープログラムであることを特徴とする請求
項1記載のマイコンのシステムクロックチェック方法。
2. The method according to claim 1, wherein the program is a dummy program not related to the function of the microcomputer.
JP2001139787A 2001-05-10 2001-05-10 System clock check method for microcomputer Withdrawn JP2002333997A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001139787A JP2002333997A (en) 2001-05-10 2001-05-10 System clock check method for microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001139787A JP2002333997A (en) 2001-05-10 2001-05-10 System clock check method for microcomputer

Publications (1)

Publication Number Publication Date
JP2002333997A true JP2002333997A (en) 2002-11-22

Family

ID=18986505

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001139787A Withdrawn JP2002333997A (en) 2001-05-10 2001-05-10 System clock check method for microcomputer

Country Status (1)

Country Link
JP (1) JP2002333997A (en)

Similar Documents

Publication Publication Date Title
US8909971B2 (en) Clock supervision unit
TWI801526B (en) Fail-safe clock monitor with fault injection
WO2007018530A1 (en) System and method for detecting transducer failure in refrigerant systems
US8311169B2 (en) Automatic frequency monitoring circuit, electronic device, automatic frequency monitoring method, and automatic frequency monitoring program
JP2003248598A (en) Micro-controller and method for detecting micro- controller trouble
JP2002333997A (en) System clock check method for microcomputer
JP4248963B2 (en) Timing device
US20190050033A1 (en) Methods, systems and apparatus for dynamic temperature aware functional safety
CN100363904C (en) CPU temperature sensing and correction device and method
JP2005321949A (en) Starting method and starting device of computer, and computer system
JP2002041493A (en) Microcomputer
US20060200275A1 (en) Apparatus and method for regulating temperature of a central processing unit
US20060153008A1 (en) Control device and control method capable of external synchronization
JP7138506B2 (en) Digital signal processing circuit
JP2008182818A (en) Method and apparatus for detecting isolated operation and power line conditioner
JPH1144404A (en) Combustion controller for boiler
JPH0371301A (en) Malfunction preventing method for microcomputer control apparatus
JP6266190B2 (en) Multiplex system
JP2832599B2 (en) Pachinko machine control device
JP2010003199A (en) Semiconductor integrated circuit device
JPH09198280A (en) Method for generating pulse for system monitoring and real time operating system provided with pulse generation function for monitoring
JPS62233854A (en) Detecting circuit for clock abnormality of processor
JP2023074675A (en) Safety PLC
JP3992522B2 (en) Detector
JP4083954B2 (en) Anomaly monitoring apparatus and anomaly monitoring method

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20080805