JPS63178339A - Method for controlling microcomputer - Google Patents

Method for controlling microcomputer

Info

Publication number
JPS63178339A
JPS63178339A JP62010526A JP1052687A JPS63178339A JP S63178339 A JPS63178339 A JP S63178339A JP 62010526 A JP62010526 A JP 62010526A JP 1052687 A JP1052687 A JP 1052687A JP S63178339 A JPS63178339 A JP S63178339A
Authority
JP
Japan
Prior art keywords
port
output
input
microcomputer
control signal
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
Application number
JP62010526A
Other languages
Japanese (ja)
Inventor
Toshihiko Fukai
深井 敏彦
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP62010526A priority Critical patent/JPS63178339A/en
Publication of JPS63178339A publication Critical patent/JPS63178339A/en
Pending legal-status Critical Current

Links

Landscapes

  • Retry When Errors Occur (AREA)
  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To prevent a microcomputer from an abnormal operation control by comparing a control signal outputted from an arithmetic processing part and obtained before being outputted from an output-only port with a control signal inputted to a monitoring input port, and resetting plural input/out ports when these control signals are different from each other. CONSTITUTION:A control signal obtained before being outputted from the output-only port 11 is compared with a control signal inputted from the output- only port 11 to the monitoring input port by a CPU 6a, and when a difference between these control signals is detected by the CPU 6a, a reset circuit is driven. Since the difference between the control signals is generated at the time of generating abnormality in the output-only port 11 and the reset circuit is driven, an input/out port 6d is reset and the abnormality of the output-only port 11 is self-restored. Consequently, the control of a peripheral equipment can be prevented from the generation of abnormality due to the abnormality of the output-only port 11 and the reliability of microcomputer products can be improved.

Description

【発明の詳細な説明】 産業上の利用分野 本発明はマイクロコンピュータ周辺機器の発生する電気
ノイズ等によって制御装置の中枢をなすマイクロコンピ
ュータが異常動作するのを防止すルマイクロコンピュー
タの制御方法に関するものである。
DETAILED DESCRIPTION OF THE INVENTION Field of Industrial Application The present invention relates to a microcomputer control method for preventing the microcomputer, which is the core of the control device, from operating abnormally due to electrical noise generated by microcomputer peripheral equipment. It is.

従来の技術 近年、マイクロコンピュータは制御装置の中枢として広
く利用されており、マイクロコンピュータの異常動作は
制御装置さらにはこの制御装置によって制御される装置
の異常動作となるため、マイクロコンピュータの異常動
作防止が重要な課題となってきている。
BACKGROUND OF THE INVENTION In recent years, microcomputers have been widely used as the core of control devices, and abnormal operation of the microcomputer will lead to abnormal operation of the control device and the devices controlled by this control device. has become an important issue.

以下図面を参照しながら従来のマイクロコンピュータ異
常動作防止装置について説明する。第2図は従来のマイ
クロコンピュータ異常動作防止装置の構成を示すブロッ
ク図である。
A conventional microcomputer abnormal operation prevention device will be described below with reference to the drawings. FIG. 2 is a block diagram showing the configuration of a conventional microcomputer abnormal operation prevention device.

第、3図において、1はマイクロコンピュータ(以下マ
イコンと称す)で、CPU、RAM、ROMおよび複数
の入出カポ−)1aから構成されている。このマイコン
1の入出力ポートには、入力回路2と出力回路3とウォ
ッチドッグタイマ4、リセット回路5が接続されている
。前記入力回路2は、複数個の制御用のスイッチ等から
出力された信号を前記入出力ポート11Lに伝達するも
のである。前記出力回路3は、マイコン1において演算
処理され、入出力ポート1aから出力された信号をモー
タや発光素子等に伝達するものである。また、前記ウォ
ッチドッグタイマ4は、マイコン1のクロックパルスを
トリガとして、このクロックパルスが所定時間以上継続
して検知されないとき、前記リセット回路5のリセット
信号をマイコン1に入力させるものである。
In FIGS. 3 and 3, reference numeral 1 denotes a microcomputer (hereinafter referred to as microcomputer), which is composed of a CPU, a RAM, a ROM, and a plurality of input/output capacitors 1a. An input circuit 2, an output circuit 3, a watchdog timer 4, and a reset circuit 5 are connected to the input/output ports of the microcomputer 1. The input circuit 2 transmits signals output from a plurality of control switches and the like to the input/output port 11L. The output circuit 3 transmits signals that are processed by the microcomputer 1 and output from the input/output port 1a to a motor, a light emitting element, etc. Further, the watchdog timer 4 is triggered by a clock pulse of the microcomputer 1, and inputs a reset signal from the reset circuit 5 to the microcomputer 1 when this clock pulse is not detected for a predetermined period of time or more.

上記構成において、入出力ポート1aに異常が発生した
場合、前記ウォッチドッグタイマ4には継続してマイコ
ン1のクロックパルスが入力されず、このクロックパル
スが所定時間以上継続して入力されないとき、リセット
回路6のリセット信号がマイコン1に伝達される。そし
て、このリセット信号によって、前記入出力ポート1a
の入力専用ポートあるいは出力専用ポートとしての設定
の変更等のイニシアル処理が行なわれるものであった。
In the above configuration, when an abnormality occurs in the input/output port 1a, the clock pulse of the microcomputer 1 is not continuously input to the watchdog timer 4, and when this clock pulse is not continuously input for a predetermined period of time or more, the watchdog timer 4 is reset. A reset signal from circuit 6 is transmitted to microcomputer 1 . Then, by this reset signal, the input/output port 1a
Initial processing such as changing the setting of the port as an input-only port or an output-only port is performed.

発明が解決しようとする問題点 しかしながら上記従来の構成では、周辺機器からのノイ
ズによって前記入出力ポート1aを中心としてマイコン
1に異常が発生したとき、マイコン1からのクロックパ
ルスはウォッチドッグタイマ4に伝達されない。しかし
、このときマイコン1に接続された周辺機器からのパル
スノイズが入出力ポート1&に印加されると、前記ウォ
ッチドッグタイマ4はこのパルスノイズをマイコンから
のクロックパルスと判断し、その結果マイコン1の異常
動作が検知されないものであった。
Problems to be Solved by the Invention However, in the conventional configuration described above, when an abnormality occurs in the microcomputer 1 mainly at the input/output port 1a due to noise from peripheral equipment, the clock pulse from the microcomputer 1 is sent to the watchdog timer 4. Not communicated. However, at this time, when pulse noise from a peripheral device connected to the microcomputer 1 is applied to the input/output port 1&, the watchdog timer 4 determines this pulse noise as a clock pulse from the microcomputer, and as a result, the microcomputer 1 No abnormal operation was detected.

本発明は上記従来の問題点と解決するもので、マイクロ
コンピュータの異常動作を防止し、マイクロコンピュー
タの製品信頼性を向上させるマイクロコンピュータの制
御方法を提供することを目的とするものである。
The present invention solves the above-mentioned conventional problems, and aims to provide a method for controlling a microcomputer that prevents abnormal operation of the microcomputer and improves product reliability of the microcomputer.

問題点を解決するだめの手段 上記目的を達成するために本発明のマイクロコンピュー
タの制御方法は、複数の入出力ポートを入力専用ポート
と出力専用ポートと監視用入力ポートのいずれかに設定
し、演算処理部から前記出力専用ポートを介して出力さ
れる制御信号を前記監視用入力ポートに入力し、かつ前
記演算処理部から出力されかつ前記出力専用ポートから
出力される以前の制御信号と、前記監視用入力ポートに
入力された制御信号を比較して、これらの制御信号が異
なるとき前記複数の入出力ポートの設定を再履行させる
ものである。
Means for Solving the Problems In order to achieve the above object, the microcomputer control method of the present invention sets a plurality of input/output ports as either an input-only port, an output-only port, or a monitoring input port, A control signal output from the arithmetic processing unit via the output-only port is input to the monitoring input port, and a control signal output from the arithmetic processing unit and before being output from the output-only port; The control signals input to the monitoring input ports are compared, and when these control signals are different, the settings of the plurality of input/output ports are re-executed.

作用 上記構成によれば、複数の入出力ポートのなかの出力専
用ポートに設定されたポートに何らかの異常が発生した
場合には、演算処理部から出力される制御信号は前記出
力専用ポートにおいて変化し、監視用入力ポートに入力
される。この制御信号の変化を比較検知することで、前
記入出力ポートの出力専用ポート、入力専用ポートおよ
び監視用入力ポートの設定が再履行され、前記入出力ポ
ートの異常状態の復旧が実行される。
Effect According to the above configuration, when some abnormality occurs in a port set as an output-only port among the plurality of input/output ports, the control signal output from the arithmetic processing section changes at the output-only port. , is input to the monitoring input port. By comparing and detecting changes in the control signals, the settings of the output-only port, input-only port, and monitoring input port of the input/output port are re-implemented, and the abnormal state of the input/output port is restored.

実施例 以下、本発明の一実施例のマイクロコンピュータの制御
方法について第1図を参照しながら説明する。
Embodiment Hereinafter, a microcomputer control method according to an embodiment of the present invention will be explained with reference to FIG.

第1図は本発明の一実施例の制御方法に供するマイクロ
コンピュータ異常動作防止装置のブロック図である。第
1図において、6はマイクロコンピュータ(以下マイコ
ンと称す)であり、このマイコン6は、演算処理部たと
えばcptrea、記憶部であるRAM6b、ROM6
cおよび複数の入出カポ−)6dとからなシ、この入出
カポ−トロdには、入力回路7、出力回路8、およびリ
セット回路9が接続されている。前記入出カポ−トロd
は入力ポートおよび出力ポートとしての機能を兼ね備え
ており、マイコン6のcPUeaからの信号によって入
カポ−14るいは出力ポートとして設定される。前記入
力回路7は入出カポ−トロdのうち入力専用ポート1o
として設定されたポートに接続され、かつ入力側には複
数個のスイッチ等の入力装置が接続されている。また前
記出力回路は入出カポ−)adのうち出力専用ポート1
1として設定されたポートに接続され、かつ出力側には
モータや発光素子等が接続されている。:。
FIG. 1 is a block diagram of a microcomputer abnormal operation prevention device used in a control method according to an embodiment of the present invention. In FIG. 1, 6 is a microcomputer (hereinafter referred to as microcomputer), and this microcomputer 6 includes an arithmetic processing unit such as cptrea, a storage unit RAM 6b, and a ROM 6.
An input circuit 7, an output circuit 8, and a reset circuit 9 are connected to this input/output capo d. Previous input/output capotro d
has a function as an input port and an output port, and is set as an input port 14 or an output port by a signal from cPUea of the microcomputer 6. The input circuit 7 is an input-only port 1o of the input/output port d.
A plurality of input devices such as switches are connected to the input side. In addition, the output circuit is an output-only port 1 of the input/output capo (AD).
It is connected to the port set as 1, and a motor, a light emitting element, etc. are connected to the output side. :.

また前記複数の入出カポ−)6(1のなかの前記出力専
用ポート11と同数の入出力ポートは監視用入力ポート
12として設定され、そして前記出力専用ポート11と
監視用入力ポート12はそれぞれ対抗させて接続されて
いる。前記CPU6aから出力される前記モータ等の駆
動制御を行なう制(御信号は、前記出力専用ポート11
から出力されるとともに、前記RAMebに記憶され、
そして出力専用ポート11から監視用入力ポート12に
入力された制御信号とcpvstにおいて比較される。
In addition, the input/output ports of the plurality of input/output ports 6 (1) having the same number as the output-only ports 11 are set as monitoring input ports 12, and the output-only ports 11 and the monitoring input ports 12 are respectively set as monitoring input ports 12. The control signal for controlling the drive of the motor, etc. output from the CPU 6a is output from the output-only port 11.
is output from and stored in the RAMeb,
Then, it is compared with the control signal input from the output-only port 11 to the monitoring input port 12 at cpvst.

前記リセット回路9は、使用者が操作するかもしくは前
記マイコン6のCPUeaからの駆動信号によって動作
し、リセット信号をマイコン6に印加する。このリセッ
ト信号によって前記マイコン6のCPUeaは、前記入
出カポ−)adの入力専用ポート1o、出力専用ポート
11および監視用入力ポート12の設定の再履行を行な
うものである。
The reset circuit 9 is operated by a user or driven by a drive signal from the CPUea of the microcomputer 6, and applies a reset signal to the microcomputer 6. In response to this reset signal, the CPUea of the microcomputer 6 reconfigures the input-only port 1o, the output-only port 11, and the monitoring input port 12 of the input/output capo (ad).

上記構成について以下にその動作を説明する。The operation of the above configuration will be explained below.

前記出力回路8に接続されたたとえばモータを゛制御す
る制御信号S。は、前記CPUeaから出力専用ポート
11に出力され出力回路8に伝達されるとともにRAM
5bに記憶され、また出力専用ポート11から監視用入
力ポート12に入力される。
A control signal S for controlling a motor, for example, connected to the output circuit 8. is outputted from the CPUea to the output-only port 11, transmitted to the output circuit 8, and also stored in the RAM.
5b, and is also input from the output-only port 11 to the monitoring input port 12.

ここで出力回路に伝達された制御信号を制御信号s1、
RAM6bに記憶された制御信号を制御信号S2、そし
て監視用入力ポート12に入力された制御信号と制御信
号S3として以下説明する。
Here, the control signal transmitted to the output circuit is the control signal s1,
The control signal stored in the RAM 6b will be described below as a control signal S2, and the control signal and control signal S3 input to the monitoring input port 12.

前記制御信号S2 と制御信号S5はともにCPU61
Lに入力され、そして比較される。前記出力専用ポート
11に異常が発生していない場合、前記制御信号S2 
 と制御信号S5は一致し、前記モータは制御信号S1
 にもとづいて駆動制御される。
Both the control signal S2 and the control signal S5 are sent to the CPU 61.
input into L and compared. If no abnormality has occurred in the output-only port 11, the control signal S2
and the control signal S5 match, and the motor is controlled by the control signal S1.
The drive is controlled based on

それぞれの制御信号は全て同一なものである。また、前
記出力専用ポート11に異常が発生した場合、前記制御
信号S4.S3は制御信号S。と異なる信号となり、前
記CPUeaにおいて比較、検知され、CPUeaは制
御信号S2 と制御信号S3の差異にもとづいて前記リ
セット回路9を駆動させる、)このリセット回路9のリ
セット信号にもとづいて、CPU6aは各入出カポ−1
−eaの設定を再履行する。
All control signals are the same. Further, when an abnormality occurs in the output-only port 11, the control signal S4. S3 is a control signal S. Based on the reset signal of the reset circuit 9, the CPU 6a drives the reset circuit 9 based on the difference between the control signal S2 and the control signal S3. Ideku capo-1
- Re-implement the ea settings.

この設定の再履行ののち、cpUe2Lからは再び制御
信号が出力されるが、前記出力専用ポート11の異常が
復旧された場合、CPU61Lによる制御が続行される
。また異常が復旧されず、前記リセット信号が反復され
て所定時間CPU6aに入力された場合、前記CPU6
2Lはマイコン6への電源の供給を停止させるものであ
る。
After re-implementing this setting, the cpUe2L outputs a control signal again, but if the abnormality in the output-only port 11 is recovered, control by the CPU 61L is continued. Further, if the abnormality is not recovered and the reset signal is repeatedly input to the CPU 6a for a predetermined period of time, the CPU 6a
2L is for stopping the power supply to the microcomputer 6.

上記実施例によれば、前記出力専用ポート11から出力
される以前の制御信号と前記出力専用ポート11から監
視用入力ポートに入力された制御信号とをCPU6aに
おいて比較し、前記CPUe&に制御信号の差異が検知
されたときリセット回路を動作させる構成によって、前
記出力専用ポート11に異常が発生した場合、前記制御
信号に差異が生じ、リセット回路が駆動されるために、
入出カポ−)adの設定が再履行され、出力専用ポート
11の異常の自己復旧が行なわれる。また入出カポ−)
6dの設定の再履行で復旧が所定時間なされないときは
マイコン6への電源の供給が停止される。その結果、出
力専用ポート11の異常による周辺機器制御の異常が防
止され、マイコンの製品信頼性が高められるものである
According to the above embodiment, the CPU 6a compares the previous control signal outputted from the output-only port 11 and the control signal inputted from the output-only port 11 to the monitoring input port, and the control signal is sent to the CPUe&. Due to the configuration in which the reset circuit is operated when a difference is detected, when an abnormality occurs in the output-only port 11, a difference occurs in the control signal and the reset circuit is driven.
The settings of the input/output capo (AD) are re-executed, and self-recovery of the abnormality of the output-only port 11 is performed. In addition, Kapo-)
If recovery is not performed for a predetermined time by re-implementing the settings 6d, the power supply to the microcomputer 6 is stopped. As a result, abnormalities in peripheral device control due to abnormalities in the output-only port 11 are prevented, and product reliability of the microcomputer is improved.

発明の効果 本発明によれば、演算処理部から出力されかつ出力専用
ポートから出力される以前の制御信号と、前記出力専用
ポートから出力され監視用入力ポートに入力された制御
信号とを比較して、これらの制御信号が異なるとき複数
の入出力ポートの入力専用ポート、出力専用ポートおよ
び監視用入力ポートの設定を再履行させる方法によって
、前記出力専用ポートの異常によるマイクロコンピュー
タの異常な動作制御を防止することができ、その結果、
マイクロコンピュータによる制御の信頼性を高められる
ものである。
Effects of the Invention According to the present invention, a previous control signal outputted from the arithmetic processing unit and outputted from the output-only port is compared with a control signal outputted from the output-only port and inputted to the monitoring input port. By using a method that re-executes the settings of input-only ports, output-only ports, and monitoring input ports of multiple input/output ports when these control signals are different, abnormal operation control of the microcomputer due to an abnormality of the output-only ports can be prevented. can be prevented, and as a result,
This increases the reliability of control by a microcomputer.

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

第1図は本発明の一実施例に供するマイクロコンピュー
タ異常動作防止装置のブロック図、第2図は従来のマイ
クロコンピュータ異常動作防止装置のブロック図である
。 6・・・・・・マイクロコンピュータ、6a・・・・・
・CP U。 6d・・・・・・入出力ポート、1o・・・・・・出力
専用ポート、11・・・・・・入力専用ポート、12・
・・・・・監視用入力ポート。 代理人の氏名 弁理士 中 尾 敏 男 ほか1名6−
 マイクロコンピュータ 6d−人田方ポート 10−一人力専用ざ一ト 11−出力専用ポート 12 一監視用入力ポート 第1図
FIG. 1 is a block diagram of a microcomputer abnormal operation prevention device according to an embodiment of the present invention, and FIG. 2 is a block diagram of a conventional microcomputer abnormal operation prevention device. 6...Microcomputer, 6a...
・CPU. 6d...Input/output port, 1o...Output-only port, 11...Input-only port, 12.
...Input port for monitoring. Name of agent: Patent attorney Toshio Nakao and 1 other person6-
Microcomputer 6d - Hitodakata port 10 - Single-person power use port 11 - Output only port 12 - Monitoring input port Fig. 1

Claims (1)

【特許請求の範囲】[Claims] 複数の入出力ポートを入力専用ポートと出力専用ポート
と監視用入力ポートのいずれかに設定し、演算処理部か
ら前記出力専用ポートを介して出力される制御信号を前
記監視用入力ポートに入力し、かつ前記演算処理部から
出力されかつ前記出力専用ポートから出力される以前の
制御信号と、前記監視用入力ポートに入力された制御信
号を比較して、これらの制御信号が異なるとき前記複数
の入出力ポートの設定を再履行させるマイクロコンピュ
ータの制御方法。
A plurality of input/output ports are set as either an input-only port, an output-only port, or a monitoring input port, and a control signal output from the arithmetic processing unit via the output-only port is input to the monitoring input port. , and compares the previous control signal outputted from the arithmetic processing unit and outputted from the output-only port with the control signal inputted to the monitoring input port, and when these control signals are different, the plurality of A microcomputer control method for resetting input/output ports.
JP62010526A 1987-01-20 1987-01-20 Method for controlling microcomputer Pending JPS63178339A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP62010526A JPS63178339A (en) 1987-01-20 1987-01-20 Method for controlling microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP62010526A JPS63178339A (en) 1987-01-20 1987-01-20 Method for controlling microcomputer

Publications (1)

Publication Number Publication Date
JPS63178339A true JPS63178339A (en) 1988-07-22

Family

ID=11752694

Family Applications (1)

Application Number Title Priority Date Filing Date
JP62010526A Pending JPS63178339A (en) 1987-01-20 1987-01-20 Method for controlling microcomputer

Country Status (1)

Country Link
JP (1) JPS63178339A (en)

Similar Documents

Publication Publication Date Title
JPS60263235A (en) Microcomputer system
JPS63178339A (en) Method for controlling microcomputer
JPH06324721A (en) Method for detecting falling-off of connection unit
JPS622685Y2 (en)
JPS62168204A (en) Digital controller
JPH0612294A (en) Monitor device
JP2749994B2 (en) Numerical control unit
JPS6343770B2 (en)
JPH02130658A (en) Fault processing system
JPH04260942A (en) Watchdog timer
JP2002123301A (en) Controller
JPS62123531A (en) Cpu supervisory unit
JPH01292512A (en) Monitoring controller for power supply part
JPS63155337A (en) Runaway detecting circuit for microcomputer device
JPS5834855B2 (en) Computer monitoring method
JPH0526098B2 (en)
JPH02115967A (en) Microcomputer resetting method
JPS6158020A (en) Initializing system
JPS63298646A (en) Resetting control circuit
JPH04369740A (en) Controller with watch dog timer
JPH01302438A (en) Watch dog timer circuit
JPS60221845A (en) Microcomputer system
JPS6136811A (en) Programmable controller
JPH09319408A (en) Interrupt signal monitor circuit and programmable controller
JPH0667937A (en) Cpu monitor circuit