JPH05233339A - Circuit for preventing malfunction of microcomputer - Google Patents

Circuit for preventing malfunction of microcomputer

Info

Publication number
JPH05233339A
JPH05233339A JP4036103A JP3610392A JPH05233339A JP H05233339 A JPH05233339 A JP H05233339A JP 4036103 A JP4036103 A JP 4036103A JP 3610392 A JP3610392 A JP 3610392A JP H05233339 A JPH05233339 A JP H05233339A
Authority
JP
Japan
Prior art keywords
mpu
input
circuit
output
rom
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
JP4036103A
Other languages
Japanese (ja)
Inventor
Kota Hashiguchi
耕太 橋口
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.)
Fujitsu General Ltd
Original Assignee
Fujitsu General 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 Fujitsu General Ltd filed Critical Fujitsu General Ltd
Priority to JP4036103A priority Critical patent/JPH05233339A/en
Publication of JPH05233339A publication Critical patent/JPH05233339A/en
Pending legal-status Critical Current

Links

Landscapes

  • Retry When Errors Occur (AREA)

Abstract

PURPOSE:To prevent malfunction from occurring due to an erroneous program by applying interruption to a microcomputer and initializing the program when a work area and an operand is read in as an operation code. CONSTITUTION:An identification code (ninth bit) of at least one or more bits can be stored by expanding the memory space of a ROM 2 which operates an MPU 1 by a loaded program. and the identification code (ninth bit) is inputted from the ROM 2 to a latch circuit 4 at a timing to read out an instruction by the MPU 1. The latch circuit 4 outputs the identification code (ninth bit) by latching with a latch pulse (M1) inputted from the MPU 1, and inputs the output to the interruption terminal of the MPU 1, and when the polarity of the output is inverted, an erroneous instruction is prevented from being executed by the MPU 1.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、マイクロコンピュータ
(以下、マイコンと略す)の誤動作防止回路に関する。
近年、マイコンが各種の機器の制御用として使用される
ようになってきているが、マイコンは、電源ノイズや、
静電ノイズ、あるいはEMI等の外来ノイズにより、誤
動作するといった問題があり、これを防止して制御回路
としての信頼性を高くする必要がある。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a malfunction prevention circuit for a microcomputer (hereinafter abbreviated as "microcomputer").
In recent years, microcomputers have come to be used for controlling various devices.
There is a problem of malfunction due to electrostatic noise or external noise such as EMI, and it is necessary to prevent this and improve the reliability of the control circuit.

【0002】[0002]

【従来の技術】従来のマイコンボードなどにおいては、
アースラインを適当に配置し、また、アースラインを太
くすることにより、電源ノイズや、静電ノイズ、あるい
はEMI等の外来ノイズからの影響を受けにくくしたり
していた。ところが防止策として充分ではなく、マイコ
ンの内部に設けられているワーク領域や、命令コード
(オペコード)と複数のオペランドで構成されている一
つの命令中のオペランドをオペコードとしてマイコンが
読み込み、間違ったプログラムによりマイコンが動作し
て、暴走するといったことがあった。
2. Description of the Related Art In conventional microcomputer boards and the like,
By properly arranging the ground line and thickening the ground line, it is difficult to be affected by power source noise, electrostatic noise, or external noise such as EMI. However, it is not enough as a preventive measure, and the microcomputer reads the work area provided inside the microcomputer or the operand in one instruction composed of the instruction code (opcode) and multiple operands as the opcode, and the wrong program Due to this, the microcomputer worked and sometimes went out of control.

【0003】[0003]

【発明が解決しようとする課題】本発明は、マイコンが
ワーク領域や、オペランドをオペコードとして読み込ん
だ場合は、マイコンに割り込みをかけプログラムを初期
化して、マイコンの誤動作を防止することを目的とす
る。
SUMMARY OF THE INVENTION It is an object of the present invention to prevent a malfunction of a microcomputer by interrupting the microcomputer to initialize the program when the microcomputer reads a work area or an operand as an operation code. ..

【0004】[0004]

【課題を解決するための手段】図1は、本発明の一実施
例を示す、マイコン誤動作防止回路の電気回路ブロック
図であり、同図に示すように、書き込まれたプログラム
によりMPU1を動作せしめているROM2において、
同ROM2のメモリ空間を拡張して、少なくとも1ビッ
ト以上の識別コード(図1においては、第9ビット)を
格納可能とし、前記MPU1が命令を読み出すタイミン
グで前記ROM2から前記識別コード(第9ビット)を
ラッチ回路4に入力し、同ラッチ回路4は前記MPU1
から入力されるラッチパルス(M1)で前記識別コード
(第9ビット)をラッチして出力し、同出力に基づき前
記MPU1を制御するようにしており、同出力の極性が
反転した場合、MPU1に割り込みをかけプログラムを
初期化して、MPU1が間違えた命令を実行しないよう
に防止するようにしている。
FIG. 1 is an electric circuit block diagram of a microcomputer malfunction prevention circuit showing an embodiment of the present invention. As shown in FIG. 1, the MPU 1 is operated by a written program. In ROM2,
The memory space of the ROM 2 is expanded so that an identification code of at least 1 bit (9th bit in FIG. 1) can be stored, and the identification code (9th bit) is read from the ROM 2 at the timing when the MPU 1 reads an instruction. ) Is input to the latch circuit 4, and the latch circuit 4 receives the MPU1
The identification code (9th bit) is latched and output by the latch pulse (M1) input from the MPU1, and the MPU1 is controlled based on the output. When the polarity of the output is inverted, the MPU1 is output. An interrupt is applied to initialize the program to prevent the MPU 1 from executing the wrong instruction.

【0005】[0005]

【作用】本発明は上記した構成により、ラッチ回路4か
らの出力の極性が反転した場合、MPU1に割り込みを
かけプログラムを初期化するようにしており、マイコン
がワーク領域や、オペランドをオペコードとして読み込
んで、間違ったプログラムによりマイコンが動作するの
を防止することができる。
According to the present invention, when the polarity of the output from the latch circuit 4 is reversed, the MPU 1 is interrupted to initialize the program, and the microcomputer reads the work area and the operand as an opcode. Thus, it is possible to prevent the microcomputer from operating due to an incorrect program.

【0006】[0006]

【実施例】図1は、本発明の一実施例を示す、マイコン
誤動作防止回路の電気回路ブロック図である。マイコン
は、MPUとメモリLSIと入出力装置とのつなぎ役で
あるインタフェースLSI等で構成されており、MPU
は制御部と演算部を有するCPU(中央処理装置)と、
入出力装置等を一つのLSIに組み込んだものである。
1はMPU(Micro Processer Unitの略称)であり、2
はROM(Read OnlyMemoryの略称)であり、MPU1
とROM2間はアドレスバスとデータバスで接続されて
おり、MPU1が実行するプログラムはROM2に予め
データとして書き込むようにし、MPU1でアドレスを
指定することにより、指定されたアドレスに対応したデ
ータをROM2から読み出して、指定された命令をMP
U1は実行するようにしている。図1の実施例において
は、アドレスバスは、16ビットを使用しており、従っ
て、16本の線で構成されており、データバスは、8ビ
ットのマイコンを使用した場合は、8本の線で構成され
る。ROM2のメモリ空間を拡張して、少なくとも1ビ
ット以上の識別コード(図1においては、第9ビット)
を格納可能とし、MPU1が命令を読み出すタイミング
でROM2から前記識別コード(第9ビット)を出力で
きるようにしている。
FIG. 1 is an electric circuit block diagram of a microcomputer malfunction prevention circuit showing an embodiment of the present invention. The microcomputer is composed of an MPU, a memory LSI, and an interface LSI that is a link between the input / output device and the like.
Is a CPU (central processing unit) having a control unit and a calculation unit,
The I / O device is incorporated in one LSI.
1 is MPU (abbreviation of Micro Processor Unit), and 2
Is ROM (abbreviation of Read Only Memory), and MPU1
The ROM2 and ROM2 are connected by an address bus and a data bus. The program executed by the MPU1 is written in the ROM2 in advance as data, and the MPU1 specifies the address so that the data corresponding to the specified address is read from the ROM2. Read and MP the specified instruction
U1 is trying to execute. In the embodiment shown in FIG. 1, the address bus uses 16 bits and is therefore composed of 16 lines, and the data bus uses 8 lines when an 8-bit microcomputer is used. Composed of. The memory space of the ROM2 is expanded so that an identification code of at least 1 bit or more (9th bit in FIG. 1)
Is stored, and the identification code (9th bit) can be output from the ROM 2 at the timing when the MPU 1 reads the instruction.

【0007】4はラッチ回路であり、同ラッチ回路4の
データ入力端子(DATA)に前記識別コード(第9ビ
ット)を入力し、MPU1から出力されるラッチパルス
(M1)を同ラッチ回路4のクロックパルス入力端子
(CK)に入力し、同ラッチ回路4の出力(Q)はMP
U1の割り込み端子(NMI)に入力している。ラッチ
回路4としては、例えば、フリップフロップ回路を使用
することができる。ラッチ回路4は、ラッチパルス(M
1)により識別コード(第9ビット)ラッチして出力
し、同出力に基づきMPU1を制御するようにしてお
り、同出力の極性が反転した場合、MPU1に割り込み
をかけMPU1が実行しようとしているプログラムを初
期化し、間違ったプログラムによりマイコンが動作する
のを防止する。3はアドレスデコードであり、ロジック
回路を使用し、前記アドレスバスを分岐させてアドレス
デコード3に入力しており、出力はROM2のチップセ
レクト端子(CS)に入力して、ROM2の動作及び停
止を制御するようにし、ROM2に書き込まれたデータ
をMPU1内の指定のレジスタに読み出せるようにして
いる。また、アドレスデコード3からの出力を前記ラッ
チ回路4のリセット端子(リセット)に入力して、RO
M2を動作させるタイミングで同ラッチ回路4をリセッ
トできるようにしている。
Reference numeral 4 denotes a latch circuit, which inputs the identification code (9th bit) to a data input terminal (DATA) of the latch circuit 4 and outputs a latch pulse (M1) output from the MPU 1 to the latch circuit 4. It is input to the clock pulse input terminal (CK) and the output (Q) of the latch circuit 4 is MP.
It is input to the interrupt terminal (NMI) of U1. As the latch circuit 4, for example, a flip-flop circuit can be used. The latch circuit 4 outputs a latch pulse (M
The identification code (9th bit) is latched and output according to 1), and the MPU1 is controlled based on the output. If the polarity of the output is inverted, the program that interrupts the MPU1 and is executed by the MPU1 To prevent the microcomputer from operating with an incorrect program. Reference numeral 3 denotes an address decode, which uses a logic circuit to branch the address bus and input it to the address decode 3. The output is input to the chip select terminal (CS) of the ROM 2 to operate and stop the ROM 2. The data written in the ROM 2 can be read out to a designated register in the MPU 1. Further, the output from the address decode 3 is input to the reset terminal (reset) of the latch circuit 4, and RO
The latch circuit 4 can be reset at the timing of operating M2.

【0008】図2(A)及び(B)は、本発明のマイコ
ン誤動作防止回路の動作タイミング・チャートであり、
例えば、マイコンとして汎用のZ80を使用したとす
る。マイコンが実行する一つの命令は、一つのオペコー
ドと最大六つのオペランドからなり、オペコードとオペ
ランドは最大M6サイクルのマシンサイクルとして定義
される。MPU1が実行する命令として、Aレジスタに
16進数の10を転送せよという命令が入力されたとす
る。この場合、MPU1とROM2間に使用される命令
は、3E・10となり、3EはM1サイクルのオペコー
ドを示し、10はM2サイクルのオペランドを示し、こ
の命令は2バイトで構成されることとなる。
2A and 2B are operation timing charts of the microcomputer malfunction prevention circuit of the present invention.
For example, assume that a general-purpose Z80 is used as the microcomputer. One instruction executed by the microcomputer consists of one opcode and up to six operands, and the opcode and operands are defined as machine cycles of up to M6 cycles. It is assumed that an instruction to transfer hexadecimal 10 is input to the A register as an instruction to be executed by the MPU 1. In this case, the instruction used between the MPU 1 and the ROM 2 is 3E · 10, 3E indicates the operation code of the M1 cycle, 10 indicates the operand of the M2 cycle, and this instruction is composed of 2 bytes.

【0009】(A)図において、上段の波形はMPU1
からROM2に、アドレスバスを通して伝えられる命令
であり、2段目の波形M1は、MPU1から出力される
クロックパルスであり、3段目の波形第9ビットデータ
は、ROM2から読み出されたデータであり、最下段の
波形NMIは、ラッチ回路4の出力を示している。この
場合には、クロックパルスM1の立ち上がりでラッチ回
路4に入力される第9ビットデータをラッチして出力す
るようにしており、ラッチ回路4からの出力はHレベル
を維持するため、MPU1の割り込み端子(NMI)へ
の入力はHレベルとなり、MPU1は入力された命令を
実行する。例えば、(B)図に示すように、ノイズ等に
より誤動作要因が発生し、M2サイクルをオペコード
(M1)サイクルとして、ROM2からMPU1が実行
する命令を読み出した場合、MPU1は誤動作や、暴走
をおこすこととなる。
In FIG. 3A, the upper waveform is MPU1.
From the ROM 2 to the ROM 2 through the address bus, the second-stage waveform M1 is a clock pulse output from the MPU 1, and the third-stage waveform 9th bit data is data read from the ROM 2. Yes, the waveform NMI at the bottom shows the output of the latch circuit 4. In this case, the ninth bit data input to the latch circuit 4 is latched and output at the rising edge of the clock pulse M1, and the output from the latch circuit 4 is maintained at the H level. The input to the terminal (NMI) becomes H level, and the MPU 1 executes the input instruction. For example, as shown in FIG. 6B, a malfunction factor is generated by noise or the like, and when an instruction executed by the MPU1 is read from the ROM2 with the M2 cycle as an operation code (M1) cycle, the MPU1 malfunctions or runs out of control. It will be.

【0010】この場合には、クロックパルスM1の立ち
上がりでラッチ回路4に入力される第9ビットデータを
ラッチして出力するようにしており、ラッチ回路4から
の出力はLレベルとなり出力の極性が反転し、MPU1
の割り込み端子(NMI)をLレベルにするため、MP
U1に割り込みをかけプログラムを初期化して、間違っ
たプログラムによりMPU1が動作するのを防止する。
MPU1が、マイコンの内部に設けられているワーク領
域をオペコードとして読み込んだ場合も、前記と同様
に、ラッチ回路4からの出力はLレベルとなり出力の極
性が反転し、MPU1の割り込み端子(NMI)に割り
込みをかけ、プログラムを初期化して、間違ったプログ
ラムによりMPU1が動作するのを防止する。図3は、
マイコンの初期化手順を示す、フローチャートであり、
同図に示すように、MPU1は割り込み端子NMIに割
り込みがかけられると、実行中のプログラムを中断し、
NMI信号をリセットし、MPU1の各レジスタの入力
をリセットして、プログラムを初期化して終了する。
In this case, the ninth bit data input to the latch circuit 4 is latched and output at the rising edge of the clock pulse M1, and the output from the latch circuit 4 becomes L level and the output polarity is Invert, MPU1
MP to set the interrupt terminal (NMI) of L level to
The U1 is interrupted to initialize the program and prevent the MPU1 from operating due to a wrong program.
Even when the MPU1 reads the work area provided inside the microcomputer as an operation code, the output from the latch circuit 4 becomes the L level and the polarity of the output is inverted in the same manner as described above, and the MPU1 interrupt terminal (NMI) Is interrupted and the program is initialized to prevent the MPU 1 from operating due to a wrong program. Figure 3
It is a flow chart which shows the initialization procedure of a microcomputer,
As shown in the figure, when the interrupt terminal NMI is interrupted, the MPU 1 interrupts the program being executed,
The NMI signal is reset, the input of each register of the MPU 1 is reset, and the program is initialized and terminated.

【0011】[0011]

【発明の効果】以上説明したように、本発明によれば、
マイコンが間違ったプログラムを読み出して実行するの
を防止する、マイコン誤動作防止回路を提供することが
でき、マイコンを用いた制御回路の信頼性向上に寄与す
るところが大きい。
As described above, according to the present invention,
It is possible to provide a microcomputer malfunction prevention circuit that prevents the microcomputer from reading and executing an erroneous program, which greatly contributes to improving the reliability of the control circuit using the microcomputer.

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

【図1】本発明の一実施例を示す、マイコン誤動作防止
回路の電気回路ブロック図である。
FIG. 1 is an electric circuit block diagram of a microcomputer malfunction prevention circuit showing an embodiment of the present invention.

【図2】(A)及び(B)は、本発明のマイコン誤動作
防止回路の動作タイミング・チャートである。
2A and 2B are operation timing charts of the microcomputer malfunction prevention circuit of the present invention.

【図3】マイコンの初期化手順を示す、フローチャート
である。
FIG. 3 is a flowchart showing an initialization procedure of a microcomputer.

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

1 MPU 2 ROM 3 アドレスデコード 4 ラッチ回路 1 MPU 2 ROM 3 Address decode 4 Latch circuit

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 書き込まれたプログラムによりMPUを
動作せしめているROMにおいて、同ROMのメモリ空
間を拡張して、少なくとも1ビット以上の識別コードを
格納可能とし、前記MPUが命令を読み出すタイミング
で前記ROMから前記識別コードを出力しラッチ回路に
入力し、同ラッチ回路は前記MPUから入力されるラッ
チパルスで前記識別コードをラッチして出力し、同出力
を前記MPUの割り込み端子に入力して、同出力の極性
が反転した場合、同MPUに割り込みをかけプログラム
を初期化して、同MPUが間違えた命令を実行しないよ
うに防止することを特徴とするマイクロコンピュータ誤
動作防止回路。
1. A ROM operating an MPU by a written program to expand a memory space of the ROM so that an identification code of at least 1 bit or more can be stored, and the MPU reads the instruction at the timing. The identification code is output from the ROM and input to a latch circuit. The latch circuit latches and outputs the identification code with a latch pulse input from the MPU, and the same output is input to an interrupt terminal of the MPU. A microcomputer malfunction prevention circuit, characterized in that, when the polarity of the output is reversed, the MPU is interrupted to initialize a program so that the MPU does not execute a wrong instruction.
【請求項2】 前記ラッチ回路がフリップフロップ回路
からなり、同フリップフロップ回路のデータ入力端子に
前記識別コードを入力し、クロックパルス入力端子に前
記ラッチパルスを入力し、同フリップフロップ回路から
の出力を前記MPUの割り込み端子に入力して、前記M
PUを制御することを特徴とする請求項1記載のマイク
ロコンピュータ誤動作防止回路。
2. The latch circuit comprises a flip-flop circuit, the identification code is input to a data input terminal of the flip-flop circuit, the latch pulse is input to a clock pulse input terminal, and an output from the flip-flop circuit is input. Is input to the interrupt terminal of the MPU, and the M
2. The microcomputer malfunction prevention circuit according to claim 1, which controls the PU.
【請求項3】 前記MPUと前記ROM間とを接続して
いるアドレスバスを分岐させてロジック回路に入力し、
同ロジック回路からの制御信号を前記ROMのチップセ
レクト端子に入力して、同ROMの動作及び停止を制御
しているロジック回路において、同ロジック回路から出
力を前記ラッチ回路のリセット端子に入力して、前記R
OMを動作せしめるタイミングで前記ラッチ回路をリセ
ットすることを特徴とする請求項1又は2記載のマイク
ロコンピュータ誤動作防止回路。
3. An address bus connecting between the MPU and the ROM is branched and input to a logic circuit,
The control signal from the logic circuit is input to the chip select terminal of the ROM, and in the logic circuit controlling the operation and stop of the ROM, the output from the logic circuit is input to the reset terminal of the latch circuit. , Said R
3. The microcomputer malfunction prevention circuit according to claim 1, wherein the latch circuit is reset at a timing at which the OM is operated.
JP4036103A 1992-02-24 1992-02-24 Circuit for preventing malfunction of microcomputer Pending JPH05233339A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4036103A JPH05233339A (en) 1992-02-24 1992-02-24 Circuit for preventing malfunction of microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4036103A JPH05233339A (en) 1992-02-24 1992-02-24 Circuit for preventing malfunction of microcomputer

Publications (1)

Publication Number Publication Date
JPH05233339A true JPH05233339A (en) 1993-09-10

Family

ID=12460436

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4036103A Pending JPH05233339A (en) 1992-02-24 1992-02-24 Circuit for preventing malfunction of microcomputer

Country Status (1)

Country Link
JP (1) JPH05233339A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS50119010U (en) * 1974-03-14 1975-09-29
JPS6090158U (en) * 1983-11-25 1985-06-20 戸田 薫 Suction pipe that can adjust to the tilt of the container
JPS60144957U (en) * 1984-03-09 1985-09-26 高圧化工株式会社 Spray pump suction pipe
JPS60179361U (en) * 1984-05-10 1985-11-28 株式会社吉野工業所 small manual sprayer
JPS63200858A (en) * 1987-02-11 1988-08-19 ヘンケル・コマンデイートゲゼルシヤフト・アウフ・アクチエン Foaming device using no injection gas

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS50119010U (en) * 1974-03-14 1975-09-29
JPS6090158U (en) * 1983-11-25 1985-06-20 戸田 薫 Suction pipe that can adjust to the tilt of the container
JPS60144957U (en) * 1984-03-09 1985-09-26 高圧化工株式会社 Spray pump suction pipe
JPS60179361U (en) * 1984-05-10 1985-11-28 株式会社吉野工業所 small manual sprayer
JPS63200858A (en) * 1987-02-11 1988-08-19 ヘンケル・コマンデイートゲゼルシヤフト・アウフ・アクチエン Foaming device using no injection gas

Similar Documents

Publication Publication Date Title
US4236204A (en) Instruction set modifier register
US4450519A (en) Psuedo-microprogramming in microprocessor in single-chip microprocessor with alternate IR loading from internal or external program memories
US4870562A (en) Microcomputer capable of accessing internal memory at a desired variable access time
US5138706A (en) Password protected enhancement configuration register for addressing an increased number of adapter circuit boards with target machine emulation capabilities
KR900002438B1 (en) Inter-processor connecting system
US4153942A (en) Industrial control processor
JPH05233339A (en) Circuit for preventing malfunction of microcomputer
JP3172214B2 (en) Status mode setting method
KR940011040B1 (en) Microcomputer
KR940001268B1 (en) Data process with check function of undefined addressing over each command
JP2000322282A (en) Microcomputer
JP3547012B2 (en) Microcomputer
CN113311931B (en) Double-reset vector 8-bit MCU (microprogrammed control Unit) architecture convenient for IAP (inter Access Point) and method thereof
JP2002325459A (en) Pulse width modulation signal generator
JPH02186448A (en) Integrated circuit with debugging environment
JPH08249227A (en) Data processor and control method of electronic apparatus
EP1086417A2 (en) Method and system for updating user memory in emulator systems
JPH09231195A (en) Micro computer
KR100230184B1 (en) Memory table look-up device and method
JP3525582B2 (en) Bit operation circuit
KR100432242B1 (en) Interrupt generator of parallel in/output system
WO2007121616A1 (en) A method for protecting the program information of a program processor
JP3647078B2 (en) Processor
KR19990008906U (en) Watchdog timer output control
JPH0377158A (en) Microprocessor