JPS63165905A - Initialization system for output port of microcomputer - Google Patents

Initialization system for output port of microcomputer

Info

Publication number
JPS63165905A
JPS63165905A JP31259186A JP31259186A JPS63165905A JP S63165905 A JPS63165905 A JP S63165905A JP 31259186 A JP31259186 A JP 31259186A JP 31259186 A JP31259186 A JP 31259186A JP S63165905 A JPS63165905 A JP S63165905A
Authority
JP
Japan
Prior art keywords
microcomputer
output port
output
reset
reset 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
JP31259186A
Other languages
Japanese (ja)
Inventor
Akira Miyazaki
晃 宮崎
Jiro Masuda
舛田 次郎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Denso Ten Ltd
Original Assignee
Denso Ten 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 Denso Ten Ltd filed Critical Denso Ten Ltd
Priority to JP31259186A priority Critical patent/JPS63165905A/en
Publication of JPS63165905A publication Critical patent/JPS63165905A/en
Pending legal-status Critical Current

Links

Landscapes

  • Control By Computers (AREA)

Abstract

PURPOSE:To realize the initialization of an output port even through a system clock is discontinued and to prevent the runaway of a device to be controlled, by forcibly resetting a register set at the preceding stage of the output port when a reset signal is supplied. CONSTITUTION:A reset input terminal RESET is connected to a set terminal of a set-priority flip-flop FF3 via an inverter IN1. Thus, the FF3 is set regardless of a system clock 02 when a reset signal is supplied. As a result, the logical value '1' is outputted from the Q output of the FF3 and a field effect transistor FET is turned off, i.e., initialized via an inverter IN2. This initialization state is continued as long as the clock is kept discontinued even though no reset signal exists.

Description

【発明の詳細な説明】 産業上の利用分野 本発明はマイクロコンピュータにおける出力ポートの初
期化に関するものであり、特にマイクロコンピュータに
リセット信号が入力された場合、クロック停止状態であ
っても出力ポートの初期化を確実に可能とした初期化方
式に関するものである。
DETAILED DESCRIPTION OF THE INVENTION Field of Industrial Application The present invention relates to the initialization of an output port in a microcomputer. In particular, when a reset signal is input to a microcomputer, the output port is initialized even when the clock is stopped. This invention relates to an initialization method that reliably enables initialization.

従来の技術 この種マイクロコンピュータ(以下、マイコンと称す)
は各種機器の制御用に利用されている。   ゛例えば
、第3図にはマイコンが自動車の定速走行制御に利用さ
れているシステム例を示す。このシステムでは、コント
ロールスイッチC8Wが操作され、入カポ−)IF5を
介してマイコン1がセット情報を読み取ると、その時点
での車速を入カポ−zpiから読み込み、目標車速とし
て保持する。以降、入カポ−)IPIから読み取った現
車速と目標車速との差に応じ制御対象となっているアク
チュエータ2内のコントロールバルブ3のオン/オフ比
(デユーティ比)を演算し、その演算結果を出力ポート
OP1に与える。これにより、トランジスタQ1、Q2
、Q3が演算結果に基づく時間帯だけオンし、アクチュ
エータ2内のソレノイド4に通電し、コントロールバル
ブ3を動かし、負圧をアクチュエータに導入する。ソレ
ノイドに通電されていない時は、図示の如く大気圧がア
クチュエータに導入されており、負圧導入は遮断される
。そこで、アクチュエータのダイヤフラムは大気圧の導
入時間と負圧4人時間で決まる平均的な気圧により図の
左側に引っ張られ、スロットルバルブ5の開度を決め、
自動車の車速を制御する。そこで、マイコンが暴走し、
出力ポートOPiより異常出力、例えば、トランジスタ
Q1をいつまでもオンにしてお(と、その間アクチュエ
ータ2のソレノイド4は通電され、スロットルバルブ5
が全開になり、自動車の暴走になってしまう。これを防
止するためにコンピュータ分野では良く知られているウ
ォッチドッグタイマーWDTを設け、マイコンが正常動
作している時は出力ポートOP2より一定時間内にパル
スが出力されるので、これを監視している。マイコン1
に異常が発生し、例えばスタックデータの破壊等により
無限ループに陥ると出カポ−1−OP 2からパルス出
力がなくなり、ウォッチドッグタイマーWDTからリセ
ット信号が出力され、マイコンのリセット入力端子RE
SETに与えられる。これによりマイコン内ではレジス
タ類を初期化し、出力ポートOPIの出力も初期化(ハ
イインピーダンス状態)することにより、アクチュエー
タ2内のソレノイド4の通電を停止させ、自動車の暴走
を防いでいる。所謂、フェイルセーフ機能を有している
Conventional technologyThis type of microcomputer (hereinafter referred to as microcomputer)
is used to control various devices. For example, FIG. 3 shows an example of a system in which a microcomputer is used to control constant speed driving of an automobile. In this system, when the control switch C8W is operated and the microcomputer 1 reads the set information via the input capo IF5, the vehicle speed at that time is read from the input capo zpi and held as the target vehicle speed. Hereinafter, the on/off ratio (duty ratio) of the control valve 3 in the actuator 2 to be controlled is calculated according to the difference between the current vehicle speed read from the IPI and the target vehicle speed, and the calculation result is It is applied to output port OP1. As a result, transistors Q1 and Q2
, Q3 are turned on only during the time period based on the calculation results, energizes the solenoid 4 in the actuator 2, moves the control valve 3, and introduces negative pressure into the actuator. When the solenoid is not energized, atmospheric pressure is introduced into the actuator as shown in the figure, and the introduction of negative pressure is cut off. Therefore, the diaphragm of the actuator is pulled to the left in the figure by the average pressure determined by the introduction time of atmospheric pressure and the time of four negative pressure people, and determines the opening degree of the throttle valve 5.
Control the vehicle speed. Then, the microcomputer went out of control,
If there is an abnormal output from the output port OPi, for example, if the transistor Q1 is kept on forever (during that time, the solenoid 4 of the actuator 2 is energized and the throttle valve 5
The car goes into full throttle and the car goes out of control. In order to prevent this, a watchdog timer WDT, which is well known in the computer field, is installed, and when the microcontroller is operating normally, pulses are output from output port OP2 within a certain period of time, so this is monitored. There is. Microcomputer 1
If an abnormality occurs, for example, the stack data is destroyed, resulting in an infinite loop, there will be no pulse output from output port 1-OP2, a reset signal will be output from the watchdog timer WDT, and the reset input terminal RE of the microcontroller will be output.
given to SET. This initializes the registers in the microcomputer and also initializes the output of the output port OPI (to a high impedance state), thereby stopping the energization of the solenoid 4 in the actuator 2 and preventing the vehicle from running out of control. It has a so-called fail-safe function.

ところが、マイコンはクロックによって動作するもので
あり、クロックが停止すると、マイコンにリセット信号
が与えられてもリセット処理がなされず、出カポ−)O
P 1が初期化されないため自動車の暴走を招く場合が
ある。
However, the microcontroller operates based on a clock, and if the clock stops, even if a reset signal is given to the microcontroller, the reset process will not be performed, and the output capacitor will not be processed.
Since P1 is not initialized, the car may run out of control.

このリセット処理に関連する従来のマイコン回路を示し
たのが第4図であり、第5図(A)内にクロック正常時
のタイムチャートを示し、第5図(B)にクロック異常
時のタイムチャートを示す。
Figure 4 shows a conventional microcomputer circuit related to this reset process, Figure 5 (A) shows a time chart when the clock is normal, and Figure 5 (B) shows the time chart when the clock is abnormal. Show chart.

又、第5図において、第4図と同一符号のものは第4図
の対応する部分の信号状態を示す。これらの図を参照し
ながらマイコン動作の説明を行う。
Further, in FIG. 5, the same reference numerals as in FIG. 4 indicate signal states of corresponding parts in FIG. The operation of the microcomputer will be explained with reference to these figures.

第4図の発振回路12は水晶発振子11からの信号を受
信し、正確なりロックを作成する。このクロックはシス
テムクロック発生回路13により分周され、マイコン1
内で使用するに適したシステムクロックφ1、φ2とし
てマイコン1内の各部へ供給される。第4図では、シス
テムクロックφ1がフリップフロップFFIおよびアン
ド回路ANDを通してフリップフロップFF2のクロッ
ク入力端子に供給され、システムクロックφ2はフリッ
プフロップFF3に供給されている。
The oscillation circuit 12 in FIG. 4 receives the signal from the crystal oscillator 11 and creates an accurate lock. This clock is frequency-divided by the system clock generation circuit 13, and the microcomputer 1
The system clocks φ1 and φ2 suitable for use within the microcomputer 1 are supplied to each section within the microcomputer 1. In FIG. 4, system clock φ1 is supplied to the clock input terminal of flip-flop FF2 through flip-flop FFI and AND circuit AND, and system clock φ2 is supplied to flip-flop FF3.

ここで、内部データは、バス構成によりマイコン内各部
と共通利用されるものであり、フリップフロップFF2
へ取込むべきデータがバス上に存在するとき出力命令が
出されシステムクロックφ1のタイミングでフリップフ
ロップFF2へ蓄積される。この蓄積結果はシステムク
ロックφ2でフリップフロップFF3に移され、出力ポ
ート0P1から出力される。具体的には、前述した目標
車速と現車速から演算で求められたコントロールバルブ
制御用のデユーティ比に基づき出力ポートOPIをオー
プン状態からロー状態或いはロー状態からオープン状態
に変化させるとき、上記内部データおよび出力命令が出
される。
Here, the internal data is used in common with various parts within the microcontroller due to the bus configuration, and is shared by the flip-flop FF2.
When data to be taken in is present on the bus, an output command is issued and stored in flip-flop FF2 at the timing of system clock φ1. This accumulation result is transferred to the flip-flop FF3 at the system clock φ2 and output from the output port 0P1. Specifically, when changing the output port OPI from the open state to the low state or from the low state to the open state based on the duty ratio for control valve control calculated from the target vehicle speed and the current vehicle speed, the internal data is and an output command is issued.

第5図(A)、(B)では、出力状態がオープン状態か
らロー状態に変化されるときの処理がLO出力状態とし
て示しである。
In FIGS. 5(A) and 5(B), the process when the output state is changed from the open state to the low state is shown as the LO output state.

以上の動作を行う中にあって、マイコン誤動作により前
述のウォッチドッグタイマよりリセット信号が端子RE
SET!与えられると、リセット処理が行われる。即ち
、システムクロックφ1でフリップフロップFFIがセ
ットされ、その出力(内部リセット信号)でマイコン内
部のレジスタ類が初期化される。それと共に、内部リセ
ット信号はインバータINIを介してフリップフロ7プ
FF2のセット入力に与えられ、フリップフロップFF
2をセット状態にする。これにより、フリップフロップ
FF3のQ出力はインバータIN2を介して電界効果ト
ランジスタFETをオフにし、出力ポートOP 1をオ
ープン状態、即ち初期化する。
During the above operations, a reset signal is sent from the watchdog timer to the terminal RE due to a malfunction of the microcomputer.
SET! If given, a reset process is performed. That is, the flip-flop FFI is set by the system clock φ1, and the registers inside the microcomputer are initialized by its output (internal reset signal). At the same time, the internal reset signal is applied to the set input of flip-flop FF2 via the inverter INI, and
2 to the set state. As a result, the Q output of the flip-flop FF3 turns off the field effect transistor FET via the inverter IN2, thereby opening the output port OP1, that is, initializing it.

これらのタイムチャートを示したのが、第5図(A)の
リセット処理部である。この初期化によりスロットルバ
ルブは閉じた状態となり、自動車の8走は防がれる。
These time charts are shown in the reset processing section of FIG. 5(A). This initialization brings the throttle valve into a closed state and prevents the car from running eight times.

発明が解決しようとする問題点 ところが、マイコン1内でクロックが停止状態になると
、前述のウォッチドッグタイマより、端子RESETに
リセット信号が与えらるが、フリップフロップFFIで
受付けられず、従って、内部リセット信号が出力されな
い。このとき、レジスタ類の動作もクロック停止直前の
状態で停止している。この停止状態が第5図(B)に示
す如くフリップフロップFF3のリセット状態であった
とすると、電界効果トランジスタFETはオン状態を保
ち、出力ポートOPIからはアクチュエータのソレノイ
ドを駆動する信号が出されたままの状態となる。そこで
、スロットルバルブは全開になり、自動車の暴走を引き
起こす。
Problem to be Solved by the Invention However, when the clock is stopped in the microcomputer 1, a reset signal is given to the terminal RESET from the watchdog timer mentioned above, but it is not accepted by the flip-flop FFI, and therefore the internal Reset signal is not output. At this time, the operations of the registers are also stopped just before the clock stops. Assuming that this stopped state is a reset state of the flip-flop FF3 as shown in FIG. 5(B), the field effect transistor FET remains on, and a signal to drive the actuator solenoid is output from the output port OPI. It will remain as it is. The throttle valve then opens fully, causing the car to run out of control.

この様に、ウォッチドッグタイマでマイコン異常を検出
してもリセット処理が役に立たず、自動車等の制御装置
を非常に危険な状態に導く可能性があった。本発明は、
かかる問題点を改善したものである。
In this way, even if the watchdog timer detects an abnormality in the microcomputer, the reset process is useless, potentially putting the control device of an automobile or the like in a very dangerous state. The present invention
This problem has been improved.

問題点を解決するための手段 本発明は上記問題点を改善するために、リセット入力端
子に与えられる信号を出力ポート前段のレジスタ(FF
3)に伝達する経路を設け、リセット入力端子にリセッ
ト信号が入力されたとき、該経路を介して該レジスタを
強制的に初期化することにより出力ポートを初期化する
ようにしたものである。
Means for Solving the Problems In order to improve the above problems, the present invention transfers the signal applied to the reset input terminal to a register (FF) in front of the output port.
3), and when a reset signal is input to the reset input terminal, the output port is initialized by forcibly initializing the register via the path.

作   用 上記の如く、構成することによりリセット入力端子にリ
セット信号が入力されると、システムクロックの動作と
は無関係に出力段のレジスタ(FF3)を初期化し、そ
れにより出カポ−)OP 1が初期化状態になり、自動
車の暴走等を防止することができる。
Operation As described above, when a reset signal is input to the reset input terminal by the configuration, the output stage register (FF3) is initialized regardless of the operation of the system clock, and as a result, the output capacitor (OP1) is The system enters an initialized state and can prevent the car from running out of control.

発明の実施例 第1図は本発明の一実施例を示すものであり、第4図と
同一符号は同一機能を示す。又、第2図は第1図の各部
のタイムチャートを示す。ここで、クロック正常時のマ
イコン動作については、第4図の従来例と同様であるが
、異なるのはリセット入力端子RESETがインバータ
INIを介してセット優先型のフリップフロップFF3
のセット端子に接続されている点である。これにより、
リセット入力端子RESETにリセット信号(論理値“
0”)が入力されたとき、フリップフロップFF3はシ
ステムクロックφ2に無関係にセット状態にされる。そ
の結集、フリップフロップFF3のQ出力からは論理値
”l”が出力され、インパークIN2を介して電界効果
トランジスタFETをオフ状態、即ち、初期化状態にす
る。
Embodiment of the Invention FIG. 1 shows an embodiment of the present invention, and the same reference numerals as in FIG. 4 indicate the same functions. Further, FIG. 2 shows a time chart of each part of FIG. 1. Here, the microcomputer operation when the clock is normal is the same as the conventional example shown in FIG. 4, but the difference is that the reset input terminal RESET is connected to the set priority type flip-flop FF3 via the inverter
This is the point connected to the set terminal of. This results in
A reset signal (logical value “
0"), the flip-flop FF3 is set to a set state regardless of the system clock φ2. As a result, the Q output of the flip-flop FF3 outputs a logic value "1", and the logic value "1" is output via the impark IN2. The field effect transistor FET is turned off, that is, into an initialized state.

従って、第2図に示す如くクロック停止時、フリップフ
ロップFF3のQ出力が論理値“0”となって、出カポ
−)OP 1をロー状態に保持していても、リセット信
号の到来により出力ポートOPIはオーブン状態、即ち
、初期化状態になる。
Therefore, as shown in Fig. 2, when the clock is stopped, the Q output of the flip-flop FF3 becomes a logic value "0", and even if the output capacitor (OP1) is held in a low state, the output is output due to the arrival of the reset signal. The port OPI is in an oven state, ie, an initialization state.

この初期化状態は、リセット信号が無くなっても、クロ
ックが停止している限り、継続される。
This initialization state continues even if the reset signal is removed as long as the clock is stopped.

そのため、アクチュエータの負圧は導入されず、大気圧
が導入され続け、スロットルバルブは全閉状態となって
自動車の暴走が防止される。
Therefore, the negative pressure of the actuator is not introduced, but atmospheric pressure continues to be introduced, and the throttle valve is fully closed to prevent the vehicle from running out of control.

尚、本実施例ではリセット信号を論理値“0”としたた
めインバータINIを必要としたが、リセット信号を論
理値“1”で与える構成にすれば、インバータINIは
省略することもできる。
In this embodiment, the inverter INI is required because the reset signal has a logic value of "0", but the inverter INI can be omitted if the reset signal is provided with a logic value of "1".

又、インバータIN2についても、フリップフロップF
F3の一ロー出力を利用すれば省略することもできる。
Also, regarding the inverter IN2, the flip-flop F
It can be omitted by using the first row output of F3.

更に、本実施例では、リセット入力端子RESETから
フリップフロップFF3に到る経路をマイコン内部に設
けたが、この経路はマイコン外部に設けることもできる
Further, in this embodiment, a path from the reset input terminal RESET to the flip-flop FF3 is provided inside the microcomputer, but this path can also be provided outside the microcomputer.

発明の詳細 な説明した本発明によれば、クロック停止時も確実に出
カポ−)OPIの初期化が図れ、マイコンで制御される
被制御装置が暴走等危険な状態に陥ることが確実に防げ
る。
According to the present invention, which has been described in detail, the output (OPI) can be reliably initialized even when the clock is stopped, and a controlled device controlled by a microcomputer can be reliably prevented from falling into a dangerous state such as runaway. .

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

第1図は本発明の一実施例を示す図であり、第2図はそ
のタイムチャート、第3図はマイコンで制御される定速
走行装置のシステム図、第4図は従来例、第5図は従来
例のタイムチャートを示し、第5図(A)はクロック正
常時のタイムチャート、第5図(B)はクロック停止時
のタイムチャートを夫々示す。 図中、FFI〜FF3はフリップフロップ、φ11φ2
はシステムクロック、 OPIは出力ポート、 RESETはリッセト入力端子を示す。
Fig. 1 is a diagram showing an embodiment of the present invention, Fig. 2 is a time chart thereof, Fig. 3 is a system diagram of a constant speed traveling device controlled by a microcomputer, Fig. 4 is a conventional example, and Fig. 5 is a diagram showing an embodiment of the present invention. The figures show time charts of a conventional example, with FIG. 5(A) showing a time chart when the clock is normal, and FIG. 5(B) showing a time chart when the clock is stopped. In the figure, FFI to FF3 are flip-flops, φ11φ2
indicates the system clock, OPI indicates the output port, and RESET indicates the reset input terminal.

Claims (2)

【特許請求の範囲】[Claims] (1)リセット入力端子にリセット信号が与えられると
、マイクロコンピュータに内蔵されたレジスタ類を初期
化するマイクロコンピュータにおいて、リセット入力端
子に与えられる信号を出力ポート前段のレジスタに伝達
する経路を設け、リセット入力端子にリセット信号が入
力されたとき、該経路を介して出力ポート前段のレジス
タを強制的に初期化することにより出力ポートを初期化
するようにしたことを特徴とするマイロクコンピュータ
における出力ポート初期化方式。
(1) In a microcomputer that initializes registers built into the microcomputer when a reset signal is applied to the reset input terminal, a path is provided to transmit the signal applied to the reset input terminal to the register at the stage before the output port, An output in a microcomputer, characterized in that when a reset signal is input to a reset input terminal, the output port is initialized by forcibly initializing the register in the previous stage of the output port via the path. Port initialization method.
(2)出力ポート前段のレジスタをセット優先型のフリ
ップフロップで構成したことを特徴とする特許請求の範
囲第1項記載のマイクロコンピュータにおける出力ポー
ト初期化方式。
(2) The output port initialization method in a microcomputer according to claim 1, wherein the register at the front stage of the output port is constituted by a set priority type flip-flop.
JP31259186A 1986-12-27 1986-12-27 Initialization system for output port of microcomputer Pending JPS63165905A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP31259186A JPS63165905A (en) 1986-12-27 1986-12-27 Initialization system for output port of microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP31259186A JPS63165905A (en) 1986-12-27 1986-12-27 Initialization system for output port of microcomputer

Publications (1)

Publication Number Publication Date
JPS63165905A true JPS63165905A (en) 1988-07-09

Family

ID=18031041

Family Applications (1)

Application Number Title Priority Date Filing Date
JP31259186A Pending JPS63165905A (en) 1986-12-27 1986-12-27 Initialization system for output port of microcomputer

Country Status (1)

Country Link
JP (1) JPS63165905A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5812004A (en) * 1981-07-15 1983-01-24 Nippon Denso Co Ltd Controller for car
JPS6175901A (en) * 1984-08-22 1986-04-18 ゼネラル・エレクトリツク・カンパニイ Control circuit

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5812004A (en) * 1981-07-15 1983-01-24 Nippon Denso Co Ltd Controller for car
JPS6175901A (en) * 1984-08-22 1986-04-18 ゼネラル・エレクトリツク・カンパニイ Control circuit

Similar Documents

Publication Publication Date Title
US4796211A (en) Watchdog timer having a reset detection circuit
EP0134241B1 (en) System and method for stabilizing asynchronous state machines
US5394450A (en) Circuit for performing arithmetic operations
US6166564A (en) Control circuit for clock enable staging
US4542506A (en) Control system having a self-diagnostic function
US5892373A (en) Distributed gated clock driver
JPS63165905A (en) Initialization system for output port of microcomputer
EP0277767B1 (en) Dynamic cmos current surge control
EP0635940A2 (en) Assertive latching flip-flop
EP0403047B1 (en) A frequency divider circuit
US4962352A (en) Abnormal watching device and method for microcomputer
US5353093A (en) Control system for an apparatus using a microcomputer
JP2734243B2 (en) Watchdog timer
US6882695B1 (en) Data transmission line used continuously connected in plurality of stages in asynchronous system
JPS6020224A (en) Semiconductor integrated circuit device
JPS62196704A (en) On/off controlling circuit for sequence control
US4464773A (en) Dynamic synchronous binary counter with stages of identical design
JP3453762B2 (en) Sequencer
KR880001838B1 (en) Two-speed motor control
JPS631112A (en) Integrated circuit device
KR940003496Y1 (en) Circuit for transmitting data
JP2664109B2 (en) Real-time port
KR19980066705A (en) Reset Circuit with Noise Rejection
JPH0799434A (en) Low power consumption circuit
JPS62185406A (en) Flip-flop logic circuit