JP2008217105A - Program runaway prevention device of microcomputer, and electronic equipment - Google Patents
Program runaway prevention device of microcomputer, and electronic equipment Download PDFInfo
- Publication number
- JP2008217105A JP2008217105A JP2007049873A JP2007049873A JP2008217105A JP 2008217105 A JP2008217105 A JP 2008217105A JP 2007049873 A JP2007049873 A JP 2007049873A JP 2007049873 A JP2007049873 A JP 2007049873A JP 2008217105 A JP2008217105 A JP 2008217105A
- Authority
- JP
- Japan
- Prior art keywords
- microcomputer
- program
- time
- reset
- detection
- 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
Images
Landscapes
- Debugging And Monitoring (AREA)
Abstract
Description
本発明は、プログラム暴走防止装置及び電子機器に関し、より詳細には、電源が電池から供給されるマイクロコンピュータのプログラム暴走を防止するプログラム暴走防止装置、及びそれを備えた電子機器に関する。 The present invention relates to a program runaway prevention apparatus and an electronic apparatus, and more particularly to a program runaway prevention apparatus for preventing program runaway of a microcomputer to which power is supplied from a battery, and an electronic apparatus including the program runaway prevention apparatus.
従来から、AV(オーディオビジュアル)機器や調理機器をはじめとする家電製品や、都市ガス、LPガス、水道用のメータや集中監視装置など、様々な電子機器にマイクロコンピュータ(以下、マイコンという)が搭載され、それにより電子機器が制御されている。 Conventionally, microcomputers (hereinafter referred to as microcomputers) are used in various electronic devices such as home appliances such as AV (audio visual) devices and cooking appliances, city gas, LP gas, water meters, and centralized monitoring devices. It is mounted and the electronic equipment is controlled by it.
マイコン搭載の電子機器は、外来ノイズ等の外部要因によりマイコンのプログラムが暴走することがあり、従来からこのプログラム暴走を検出する装置が提案されている。例えば、特許文献1には、ウォッチドックタイマ等の暴走検出用タイマによる暴走検出動作の信頼性を高めることを目的とした組込マイコンの暴走検出装置が開示されている。
一方で、図4で例示したような、特に主たる電源が電池20単一で駆動している電子機器2にあっては、制御部(マイコン)21のプログラム暴走によりアクティブ状態が継続して電池容量切れを起こす問題が深刻となっている。
On the other hand, especially in the
しかしながら、特許文献1に記載の技術をはじめとする従来の技術では、マイコンの機能であるウォッチドックタイマ機能により自己のプログラム暴走を監視しているが、暴走検出はできるものの、暴走自体を引き起こしているマイコン自身或いはそのマイコンを搭載した電子機器の機能では必ずしも自動的にリセットできるものではない。
However, in the conventional techniques including the technique described in
従って、ユーザが電子機器の電源OFFボタン又はリセットボタンを押下するか、プログラムに対するリセット操作を行わなければならないが、上述のごとく電池駆動の場合、プログラム暴走を検出してユーザに報知したとしてもユーザが気づかずに電池容量切れを起こしてしまう可能性がある。 Therefore, the user must press the power-off button or reset button of the electronic device or perform a reset operation on the program. However, as described above, even if the battery run is detected and the user is detected and notified to the user, May cause the battery to run out without being noticed.
本発明は、上述のごとき実情に鑑みてなされたものであり、暴走中のマイコン内プログラムを確実にリセットし、電池の容量切れを防止することが可能なプログラム暴走防止装置、並びに、その装置及びマイコンを備えた電子機器の提供を、その目的とする。 The present invention has been made in view of the above circumstances, and a program runaway prevention device capable of reliably resetting a program in a microcomputer that is running out of control and preventing a battery from running out of capacity, and its device and The purpose is to provide an electronic device equipped with a microcomputer.
上述のごとき課題を解決するために、本発明の第1の技術手段は、電池から電源が供給されるマイクロコンピュータにおけるプログラムの暴走を防止するプログラム暴走防止装置であって、前記マイクロコンピュータに流れ込む電流が所定値以上であることを検出する電流検出手段と、該電流検出手段からの検出信号の出力時間を計測する検出時間計測手段と、該検出時間計測手段で計測した出力時間が所定時間に達したときに、前記マイクロコンピュータに対し、前記プログラムのリセットを要求するリセット信号を出力するリセット手段とを有し、前記検出時間計測手段は、前記所定時間に達する前に前記マイクロコンピュータからキャンセル信号を受信した場合、前記計測をキャンセルして再開する手段を有することを特徴としたものである。 In order to solve the above-described problems, a first technical means of the present invention is a program runaway prevention apparatus for preventing a program runaway in a microcomputer supplied with power from a battery, wherein current flowing into the microcomputer Current detecting means for detecting that is equal to or greater than a predetermined value, detection time measuring means for measuring the output time of the detection signal from the current detecting means, and the output time measured by the detection time measuring means reaches a predetermined time. A reset means for outputting a reset signal for requesting resetting of the program to the microcomputer, and the detection time measuring means outputs a cancel signal from the microcomputer before the predetermined time is reached. Characterized by having means for canceling and restarting the measurement when received A.
第2の技術手段は、第1の技術手段におけるプログラム暴走防止装置を備えた電子機器であって、前記電池と前記マイクロコンピュータとを備え、前記マイクロコンピュータで制御されることを特徴としたものである。 The second technical means is an electronic device provided with the program runaway prevention device in the first technical means, comprising the battery and the microcomputer, and controlled by the microcomputer. is there.
第3の技術手段は、第2の技術手段において、前記マイクロコンピュータは、前記プログラムが、前記リセット手段において使用する前記所定時間に達する前に処理を完了するか否かを判定する完了時間判定手段と、該判定の結果、完了しないと判定された場合に、前記所定時間に達する前に前記キャンセル信号を前記検出時間計測手段に対して送信するキャンセル手段とを有し、前記完了時間判定手段は、前記プログラムの開始時点及び該開始時点から前記所定時間間隔で、前記判定を実行することを特徴としたものである。 According to a third technical means, in the second technical means, the microcomputer determines whether or not the program completes processing before the program reaches the predetermined time used in the reset means. And a cancellation means for transmitting the cancellation signal to the detection time measuring means before reaching the predetermined time when it is determined that the completion is not completed as a result of the determination, the completion time determination means The determination is executed at the start time of the program and at the predetermined time interval from the start time.
本発明によれば、暴走中のマイコン内プログラムを確実にリセットし、電池の容量切れを防止することが可能となる。 According to the present invention, it is possible to reliably reset the program in the microcomputer during the runaway and prevent the battery from running out.
図1は、本発明の一実施形態に係る電子機器の構成例を示すブロック図で、図中、1は、電子機器である。また、図2は、図1の電子機器におけるマイコンに流れ込む動作モード別の電流値を説明するための図である。 FIG. 1 is a block diagram illustrating a configuration example of an electronic device according to an embodiment of the present invention, where 1 is the electronic device. FIG. 2 is a diagram for explaining the current value for each operation mode flowing into the microcomputer in the electronic apparatus of FIG.
図1で例示する電子機器1は、電池10を単一電源とし、制御部としてのマイコン11が駆動する機器である。電子機器1としては、携帯電話機、携帯情報端末(PDA)、ノート型パーソナルコンピュータ(ノートPC)、リモコン、カメラ、さらには各種機器内の制御装置などをはじめ、ガス、水道、電気事業の分野においても集中監視装置又はメータなど、様々な機器が適用可能である。
The
また、電池10は一次電池であっても二次電池であっても適用できる。なお、電子機器1は、電池10をマイコン11の主たる電源としていればよく、他の電源が図示しない他の部位に供給されていても同様に適用できる。
The
マイコン11にはプログラムが実行可能に組み込まれている。例えば、マイコン11は、CPU等の演算処理装置、プログラム格納領域としてのROM、作業領域としてのRAM等のハードウェアを備え、ROMやハードディスクに実行対象のプログラムを格納しておくとよい。これにより、CPU等の演算処理装置がROM等に格納された実行対象のプログラムをRAM上に読み出して実行することができる。
A program is incorporated in the
電子機器1は、マイコン11及び電池10の他に、本発明に係るプログラム暴走防止装置の一例として、マイコン11に流れ込む電流Iを監視する電流検出部12と、或る一定期間をカウントするタイマ部13とを備える。
In addition to the
ところで、マイコン11の動作モードは、プログラムが高速で動作を行っているアクティブ状態と、低速で動作或いは機能が停止しているスタンバイ状態(非アクティブ状態)とに分けることができる。マイコン11で消費している電流は、図2に示すように、例えばアクティブ状態でmAオーダ、スタンバイ状態でμAオーダである。
By the way, the operation mode of the
電流検出部12は、マイコン11の動作モードがアクティブ状態であるときの電流を検出し、タイマ部13のカウンタを動作させ、タイマ部13はマイコン11からのキャンセル信号がなく、且つカウンタが一定期間経過した場合に、マイコン11へリセットを行う。
The
このように、本発明に係るプログラム暴走防止装置は、電流検出部12で例示したように、マイコン11に流れ込む電流が所定値以上であることを検出する電流検出手段を備える。所定値としては、マイコン11がアクティブ状態のときの電流値とスタンバイ状態のときの電流値との間の値を採用するとよい。換言すると、どのような状態をアクティブ状態とするかは、所定値によって任意に決めることができる。
As described above, the program runaway prevention apparatus according to the present invention includes current detection means for detecting that the current flowing into the
また、本発明に係るプログラム暴走防止装置は、タイマ部13で例示したように、電流検出部12からの検出信号の出力時間を計測する検出時間計測手段と、そこで計測した出力時間が所定時間に達したときに、マイコン11に対し、プログラムのリセットを要求するリセット信号を出力するリセット手段とを備える。ここで、検出時間計測手段は、上述の所定時間に達する前にマイコン11からキャンセル信号を受信した場合、上述の計測をキャンセルして再開する手段を有する。この手段は、例えばタイマ部13のカウントをキャンセルする手段を指す。
Further, the program runaway prevention apparatus according to the present invention, as exemplified by the timer unit 13, is a detection time measuring means for measuring the output time of the detection signal from the
次に、マイコン11が発するキャンセル信号について説明する。マイコン11は、実行対象のプログラムが、上述の所定時間(リセット手段において使用する所定時間)に達する前に処理を完了するか否かを判定する完了時間判定手段と、その判定の結果、完了しないと判定された場合に、上述の所定時間に達する前に、上述のキャンセル信号をプログラム暴走防止装置側の検出時間計測手段に対して送信するキャンセル手段とを有する。そして、完了時間判定手段は、実行対象のプログラムの開始時点及びその開始時点から所定時間間隔で定期的に判定を実行するものとする。
Next, a cancel signal generated by the
マイコン11で使用するこの所定時間は、タイマ部13のカウンタを参照して得てもよいし、マイコン11内に別途カウンタを設けておきそのカウンタを参照して得てもよい。また、処理の完了は、アクティブ状態の電流が必要となる処理の完了、すなわち上述の所定値以上の電流が流れ込む処理の完了を指す。仮に、実行対象のプログラムの暴走により、完了時間判定も実行できなくなった場合には、所定時間前に処理完了するときと同様に、キャンセル信号を発しないため、タイマ部13側でリセット信号を発することができる。
The predetermined time used in the
また、マイコン11は、プログラム暴走時にリセット信号を受信した場合に実行対象のプログラムのリセットを実行するリセット実行手段を備える。例えば、リセット信号を受信したときに実行中のプログラムを読み込んだRAM等の作業領域を開放し、そのプログラムを終了させることで、プログラムのリセットが可能である。但し、ここでのリセット実行により、実行対象のプログラムは再度読み出されて実行されるようにすることが好ましく、その場合には併せて、後述の暴走防止用プログラム(特にこのリセットに係わるプログラム)は再度実行されるようにしておく。実行対象のプログラムが再度実行できないようにリセットが実行される場合には、ユーザに対して何らかの通知を行うことが好ましい。
In addition, the
また、ユーザがプログラムリセット操作を手動で行ったときに送信するリセット信号と同様のリセット信号をタイマ部13がマイコン11に伝送するようにしておくことで、上述のリセット実行手段は、ユーザ操作に基づくリセット信号の受信時に行うのと同じ処理を実行する手段としても既定できる。 Further, the reset execution means described above can be operated by the user operation by allowing the timer unit 13 to transmit a reset signal similar to the reset signal transmitted when the user manually performs the program reset operation. It can also be defined as a means for executing the same processing as that performed when receiving a reset signal based thereon.
マイコン11における上述した完了時間判定手段、キャンセル手段、及びリセット実行手段は、マイコン11をそれら手段として機能させるためのマイコン11側の暴走防止用プログラムとして組み込んでもよい。マイコン11への組込方法としては、例えば、実行対象(暴走防止対象)となるプログラムとは別に実行可能に格納するか、或いは実行対象となり得るプログラムのそれぞれに付属させておくとよい。
The above-described completion time determination means, cancellation means, and reset execution means in the
図3は、図1の電子機器におけるプログラム暴走防止処理を説明するためのタイミング例を示す図である。以下、図3を参照して、タイマ部13がカウントを5回を行ったときにマイコン11へリセットを行うタイミング例を挙げ、本発明のプログラム暴走防止処理について説明する。
FIG. 3 is a diagram illustrating a timing example for explaining the program runaway prevention process in the electronic apparatus of FIG. Hereinafter, the program runaway prevention process of the present invention will be described with reference to FIG. 3 by giving an example of timing for resetting the
まず、マイコン11がアクティブ状態となった場合、電流検出部12が所定値以上の電流を検出し、その検出信号をタイマ部13へ知らせ、タイマ部13がカウントを開始する。
First, when the
マイコン11は、アクティブ状態がタイマ部13のカウント以内の時間で処理が可能と判定した場合、そのまま処理を終了し、スタンバイ状態へ戻る。マイコン11がスタンバイ状態となることで、電流検出部12からの検出信号はOFFとなり、タイマ部13はカウントをリセットして停止する。図3では、カウント4でスタンバイ状態になった例を示している。
If the
一方、マイコン11は、アクティブ状態がタイマ部13のカウント以上の時間で処理する場合は、タイマ部13へキャンセル信号を送り、タイマ部13はカウントをリセットし再カウントを開始する。マイコン11は、処理が終了するまで、一定周期でタイマ部13のカウンタをキャンセルする。図3では、マイコン11がキャンセル信号を2度発し、3度目の2カウント目でスタンバイ状態になった例を示している。
On the other hand, when the
また、外来ノイズ等による外部要因によってマイコン11のプログラムが暴走した場合は、アクティブ状態を電流検出部12が検出し、その検出信号をタイマ部13へ知らせ、タイマ部13がカウントを開始する。図3の例では、アクティブ状態が4カウント目まではプログラム暴走/非暴走によるものであるかの判断はつかないが、5カウント目で、プログラム暴走によるものであると判断できる。プログラム暴走によりマイコン11からのキャンセル信号がなくなり、カウンタが一定期間(5カウント)経過すると、タイマ部13はマイコン11へ外部リセットを行う。マイコン11は、この外部リセットの信号を受けてプログラム暴走がクリアし、正常に動作を開始することができる。
When the program of the
以上、本発明に係るプログラム暴走防止装置及びそれを備えた電子機器によれば、外来ノイズ等によるプログラム暴走をマイコン自身に流れ込む電流で監視し、異常時間経過した場合に強制的にマイコンに対して外部リセットを行うことによりプログラムを正常に復帰させるため、電子機器の電池容量切れを防止することができる。このような容量切れ防止は、電子機器が普段からユーザが操作をあまり行わない、例えばガスメータや水道メータなどに最も有益となる。 As described above, according to the program runaway prevention apparatus and the electronic apparatus equipped with the same according to the present invention, the program runaway due to external noise or the like is monitored by the current flowing into the microcomputer itself, and when the abnormal time has elapsed, the microcomputer is forcibly Since the program is normally restored by performing an external reset, it is possible to prevent the battery capacity of the electronic device from running out. Such prevention of running out of capacity is most beneficial for a gas meter or a water meter, for example, in which an electronic device is not normally operated by a user.
1…電子機器、10…電池、11…制御部(マイコン)、12…電流検出部、13…タイマ部。
DESCRIPTION OF
Claims (3)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007049873A JP2008217105A (en) | 2007-02-28 | 2007-02-28 | Program runaway prevention device of microcomputer, and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2007049873A JP2008217105A (en) | 2007-02-28 | 2007-02-28 | Program runaway prevention device of microcomputer, and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2008217105A true JP2008217105A (en) | 2008-09-18 |
Family
ID=39837116
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2007049873A Pending JP2008217105A (en) | 2007-02-28 | 2007-02-28 | Program runaway prevention device of microcomputer, and electronic equipment |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2008217105A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012208739A (en) * | 2011-03-30 | 2012-10-25 | Nec Saitama Ltd | Terminal device, and freeze detection method and control method therefor |
WO2015111106A1 (en) * | 2014-01-27 | 2015-07-30 | カルソニックカンセイ株式会社 | Processor control apparatus and processor control method |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH11203173A (en) * | 1998-01-16 | 1999-07-30 | Nec Eng Ltd | Watch dog timer circuit |
JP2004326629A (en) * | 2003-04-28 | 2004-11-18 | Fujitsu Ten Ltd | Abnormality monitoring device |
JP2007018177A (en) * | 2005-07-06 | 2007-01-25 | Seiko Epson Corp | Processing state monitoring method, processing state monitoring program, recording medium and image display device |
-
2007
- 2007-02-28 JP JP2007049873A patent/JP2008217105A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH11203173A (en) * | 1998-01-16 | 1999-07-30 | Nec Eng Ltd | Watch dog timer circuit |
JP2004326629A (en) * | 2003-04-28 | 2004-11-18 | Fujitsu Ten Ltd | Abnormality monitoring device |
JP2007018177A (en) * | 2005-07-06 | 2007-01-25 | Seiko Epson Corp | Processing state monitoring method, processing state monitoring program, recording medium and image display device |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012208739A (en) * | 2011-03-30 | 2012-10-25 | Nec Saitama Ltd | Terminal device, and freeze detection method and control method therefor |
WO2015111106A1 (en) * | 2014-01-27 | 2015-07-30 | カルソニックカンセイ株式会社 | Processor control apparatus and processor control method |
JP2015141445A (en) * | 2014-01-27 | 2015-08-03 | カルソニックカンセイ株式会社 | Control device and control method for processor |
US9904352B2 (en) | 2014-01-27 | 2018-02-27 | Calsonic Kansei Corporation | Processor control apparatus and processor control method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6140213B2 (en) | Method, apparatus, and system for monitoring and reacting to exposure of electronic devices to moisture | |
BRPI0715665A2 (en) | system frame number evaluator (sfn) | |
KR20100038956A (en) | Method and appratus for battery gaging in portable terminal | |
JP2008211919A (en) | Battery exhaustion detecting system and radio communication apparatus | |
TWI502351B (en) | Electronic apparatus and preventing data lost method thereof | |
JP2019168421A (en) | Micro computer gas meter | |
JP2013183633A (en) | Electronic device, and power failure protection device and method applied to said electronic device | |
JP2008217105A (en) | Program runaway prevention device of microcomputer, and electronic equipment | |
JP2021166101A (en) | Alarm and alarm apparatus | |
JP2011045176A (en) | Uninterruptible power supply unit, application program, computer system, backup processing method and program | |
JP2007215313A (en) | Energy saving support system | |
TWI631458B (en) | Motherboard and computer system thereof | |
JP5438667B2 (en) | Microprocessor intermittent error detection method | |
JP2010204916A (en) | Test system and test method | |
JP2009003757A (en) | Time monitor, method and program | |
JP6593745B2 (en) | Data driven processor | |
JP2005198434A (en) | Remote control device | |
JP2008134680A (en) | Fire alarm | |
KR20170065239A (en) | Surveillance method and apparatus | |
JP2010166151A (en) | Wireless communication device, information processing apparatus, and operation cycle setting method and operation cycle monitoring method of wireless communication device | |
JP2019185337A (en) | Watch dog timer monitoring system | |
JP6377897B2 (en) | Alarm | |
JP7117948B2 (en) | Electronics | |
JP6859677B2 (en) | Terminal equipment | |
JP4248963B2 (en) | Timing device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20100223 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20101118 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20110823 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20110824 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20111220 |