JPH047755A - One-chip microcomputer - Google Patents

One-chip microcomputer

Info

Publication number
JPH047755A
JPH047755A JP2108873A JP10887390A JPH047755A JP H047755 A JPH047755 A JP H047755A JP 2108873 A JP2108873 A JP 2108873A JP 10887390 A JP10887390 A JP 10887390A JP H047755 A JPH047755 A JP H047755A
Authority
JP
Japan
Prior art keywords
stack pointer
chip microcomputer
stack
value
pointer
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
JP2108873A
Other languages
Japanese (ja)
Inventor
Masuzo Hirose
広瀬 益三
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 JP2108873A priority Critical patent/JPH047755A/en
Publication of JPH047755A publication Critical patent/JPH047755A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To prevent such a defective situation where the function of a one-chip microcomputer is stopped with occurrence of the external noises and the function of an equipment is set in a disable state by providing a stack pointer allowable range storage part and a stack pointer monitoring part. CONSTITUTION:A stack pointer allowable range storing part 8 secures an allowable range of a stack pointer 6, and a stack pointer monitoring part 9 compares the value of the part 8 with the value of the pointer 6 and produces a reset signal when the value of the pointer 6 exceeds its allowable range. If the abnormality of the pointer 6 is confirmed through the monitoring, a one-chip microcomputer is forcibly reset. Thus it is possible to evade such a defective situation where a stack area is shifted due to the external noises, etc., and overlaps a user data area to disturb the normal operation of the one-chip microcomputer and to set the function of the microcomputer in a disable state. Then the reliability of the microcomputer is improved.

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明は、ビデオテープレコーダ等に利用されるワンチ
ップマイクロコンピュータに関するものである。
DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention relates to a one-chip microcomputer used in video tape recorders and the like.

(従来の技術) 近年、ビデオテープレコーダ等の民生機器の高機能化や
高操作性実現のために大規模なワンチップマイクロコン
ピュータが用いられるにともない、プログラム開発を容
易にするために構造化プログラミング技法が利用されて
きており、これを可能とするために、スタック機能がワ
ンチップマイクロコンピュータに搭載されてきている。
(Prior art) In recent years, as large-scale one-chip microcomputers have been used to improve functionality and achieve high operability in consumer equipment such as video tape recorders, structured programming has become popular to facilitate program development. techniques have been utilized and stacking functionality has been incorporated into one-chip microcomputers to enable this.

以下、図面を参照しながら、上述したワンチップマイク
ロコンピュータの動作例について説明する。第5図は従
来のスタック機能付きのワンチップマイクロコンピュー
タの構成図を示す。第5図において、■はプログラムを
記憶するリードオンリメモリ(以下ROMと呼ぶ)、2
は命令レジスタ部、3は命令制御部、4はプログラムの
実行アドレスを示すプログラムカウンタ、5は各種の情
報や割り込みやサブルーチンコール時のリターンアドレ
スや引数1己憶に利用されるランダムアクセスメモリ(
以下RAMと呼ぶ)であり、6はスタックのアドレスを
示すスタックポインタである。以下、その動作について
、プログラムカウンタを例にとって説明する。スタック
はF I LO(First  InL ast  O
ut)方式のメモリで、入力の順番にデータを積み重ね
てゆき、出力の指令があると最後に入力されたものを最
初にして入力と逆の順番でデータを出力する形式のメモ
リである。ワンチップマイクロコンピュータでは、サブ
ルーチンコールや割り込みが発生すると、その時点のプ
ログラムカウンタ4の値をRAM5に書き込むとともに
Hereinafter, an example of the operation of the one-chip microcomputer described above will be described with reference to the drawings. FIG. 5 shows a configuration diagram of a conventional one-chip microcomputer with a stack function. In FIG. 5, ■ is a read-only memory (hereinafter referred to as ROM) that stores programs;
3 is an instruction register section, 3 is an instruction control section, 4 is a program counter that indicates the execution address of the program, and 5 is a random access memory (1) used for storing various information, interrupts, return addresses when calling subroutines, and arguments 1.
6 is a stack pointer indicating the address of the stack. The operation will be explained below using a program counter as an example. The stack is FI LO (First InL ast O
ut) type memory, in which data is accumulated in the order of input, and when an output command is given, the data is output in the reverse order of input, with the last input first. In a one-chip microcomputer, when a subroutine call or an interrupt occurs, the value of the program counter 4 at that time is written to the RAM 5.

スタックポインタ6の値を+1する。次に、サブルーチ
ンコールや割り込みから復帰するときには、スタックポ
インタ6の値の示すRAM5よりプログラムカウンタの
値を読み出し、プログラムカウンタ4に入力し、そのプ
ログラムカウンタの示すアドレスの命令をROMIより
命令レジスタ部2に読み出し、命令制御部3により実行
される。
Add 1 to the value of stack pointer 6. Next, when returning from a subroutine call or interrupt, the value of the program counter is read from the RAM 5 indicated by the value of the stack pointer 6, inputted to the program counter 4, and the instruction at the address indicated by the program counter is sent from the ROMI to the instruction register section 2. The command is read out and executed by the command control unit 3.

(発明が解決しようとする課題) しかしながら、上記のような構成では、外部からのノイ
ズ等の要因でスタックポインタ6が狂ってしまうと、第
2図に示すようにスタック用エリアとユーザー用のデー
タエリアとを分けて利用していたものが、第3図に示す
ようにスタックエリアとユーザー用データエリアとが重
なり、その結果、他の用途に利用されているRAMが常
に破壊され、ワンチップマイクロコンピュータの機能が
正常に働かず、ビデオテープレコーダ等の機器が正常動
作しなくなる。また、ワンチップマイクロコンピュータ
が電池等でバックアップされていると、電池等の放電が
行われない間は、電源コードを抜いても機器は正常に復
帰しないという欠点を有していた。
(Problem to be Solved by the Invention) However, in the above configuration, if the stack pointer 6 goes out of order due to factors such as external noise, the stack area and user data will be lost as shown in Figure 2. The stack area and the user data area overlap, as shown in Figure 3, and as a result, the RAM used for other purposes is constantly destroyed and the one-chip micro Computer functions do not function properly, and devices such as video tape recorders do not function properly. Furthermore, if the one-chip microcomputer is backed up by a battery or the like, there is a drawback that the device will not return to normal even if the power cord is disconnected until the battery or the like is not discharged.

本発明の目的は、従来の欠点を解消し、外部からのノイ
ズ等によりスタック用エリアがずれ、ユーザー用データ
エリアに重なり、その結果、ワンチップマイクロコンピ
ュータが正常動作せず機器全体として機能不能状態に陥
ることを防止でき、機器自体の信頼性を向上させること
ができるワンチップマイクロコンピュータを提供するこ
とである。
The purpose of the present invention is to eliminate the drawbacks of the conventional technology, in which the stack area shifts due to external noise, overlaps the user data area, and as a result, the one-chip microcomputer does not operate normally and the entire device becomes inoperable. It is an object of the present invention to provide a one-chip microcomputer that can prevent the device from falling into this state and improve the reliability of the device itself.

(課題を解決するための手段) 本発明のワンチップマイクロコンピュータでは、スタッ
クポインタの監視を行い異常が生じた場合には、強制的
にワンチップマイクロコンピュータにリセットをかける
機能を備えたものである・(作 用) 本発明は、上記した構成によって、外部からのノイズ等
によりスタックエリアがずれユーザ用データエリアに重
なり、その結果、ワンチップマイクロコンピュータが正
常動作せず機器全体として機能不能状態に陥ることを防
止でき、機器自体の信頼性を向上させることができる。
(Means for Solving the Problems) The one-chip microcomputer of the present invention has a function of monitoring the stack pointer and forcibly resetting the one-chip microcomputer when an abnormality occurs. - (Function) With the above-described configuration, the stack area shifts and overlaps the user data area due to external noise, and as a result, the one-chip microcomputer does not operate normally and the entire device becomes inoperable. The reliability of the device itself can be improved.

(実施例) 以下本発明の一実施例のフンチップマイクロコンピュー
タについて、図面を参照しながら説明する。第1図は本
発明の実施例におけるワンチップマイクロコンピュータ
の構成を示すものである。
(Embodiment) A microcomputer according to an embodiment of the present invention will be described below with reference to the drawings. FIG. 1 shows the configuration of a one-chip microcomputer in an embodiment of the present invention.

第1図において、従来例に示したものと同じ構成部品に
ついては同一符号を付し、その説明を省略する。7はワ
ンチップマイクロコンピュータのリセット制御部であり
、8はスタックポインタ6の許容される範囲を示すスタ
ックポインタ許容範囲記憶部で、9はスタックポインタ
監視部である。
In FIG. 1, the same components as those shown in the conventional example are denoted by the same reference numerals, and the explanation thereof will be omitted. 7 is a reset control section of the one-chip microcomputer, 8 is a stack pointer permissible range storage section that indicates the permissible range of the stack pointer 6, and 9 is a stack pointer monitoring section.

以上のように構成されたワンチップマイクロコンピュー
タについて、以下第1図、第2図、第3図、第4図を用
いて説明する。ワンチップマイクロコンピュータは、通
常、サブルーチンコールや割り込みが発生すると、その
時点のプログラムカウンタ4の値をRAM5に書き込む
とともに、スタックポインタ6の値を+1する。次に、
サブルーチンコールや割り込みから復帰するときには、
スタックポインタ6の値の示すRAM5よりプログラム
カウンタの値を読み出し、プログラムカウンタ4に入力
し、そのプログラムカウンタの示すアドレスの命令をR
OM1より命令レジスタ部2に読み出し、命令制御部3
により実行している。
The one-chip microcomputer configured as described above will be explained below with reference to FIGS. 1, 2, 3, and 4. Normally, when a subroutine call or an interrupt occurs, a one-chip microcomputer writes the current value of the program counter 4 to the RAM 5 and increments the value of the stack pointer 6 by 1. next,
When returning from a subroutine call or interrupt,
The value of the program counter is read from the RAM 5 indicated by the value of the stack pointer 6, inputted to the program counter 4, and the instruction at the address indicated by the program counter is read out.
Read from OM1 to instruction register section 2, and instruction control section 3
It is executed by

この場合には、第2図に示すようにスタック用エリアと
ユーザー用のデータエリアが分けて利用されていて、正
常に動作する。しかし、外部からのノイズ等により、ス
タックポインタ6が破壊されると、スタックポインタの
値が、スタックポインタ許容範囲記憶部8で許可されて
いるスタックポインタ値以外となる。スタックポインタ
監視部9は常にスタックポインタを監視しており、上記
の状態になるとリセット指令をリセット制御部7に出力
する。この結果、ワンチップマイクロコンピュータは、
−瞬誤動作をするが、初期化され、再び正常動作を行う
。この様子を第4図に示す。
In this case, the stack area and the user data area are used separately as shown in FIG. 2, and the system operates normally. However, if the stack pointer 6 is destroyed due to external noise or the like, the value of the stack pointer becomes a value other than the stack pointer value permitted in the stack pointer tolerance storage unit 8. The stack pointer monitoring section 9 constantly monitors the stack pointer, and outputs a reset command to the reset control section 7 when the above state occurs. As a result, the one-chip microcomputer
- It malfunctions momentarily, but it is initialized and operates normally again. This situation is shown in FIG.

(発明の効果) 本発明によれば、スタックポインタ許容範囲記憶部とス
タックポインタの監視部を設けることにより、外来ノイ
ズの発生によりワンチップマイクロコンピュータが機能
停止し、機器が機能不能に陥ることを防止でき、より信
頼性の高い機器を実現でき、その実用上の効果は大であ
る。
(Effects of the Invention) According to the present invention, by providing the stack pointer tolerance storage unit and the stack pointer monitoring unit, the one-chip microcomputer will stop functioning due to the occurrence of external noise, and the equipment will become inoperable. It is possible to prevent this and realize a more reliable device, which has great practical effects.

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

第1図は1本発明の一実施例におけるワンチップマイク
ロコンピュータの構成図、第2図は、第1図のワンチッ
プマイクロコンピュータのRAMの正常時の利用状態を
示し、第3図は第5図の従来型のワンチップマイクロコ
ンピュータのRAMの異常時の状態を示し、第4図はス
タックポインタが異常になったときのワンチップマイク
ロコンピュータの動きを示し、第5図は従来型のワンチ
ップマイクロコンピュータの構成図である。 1・・・リードオンリメモリ(ROM)、  2・・・
命令レジスタ部、 3・・・命令制御部、4・・・プロ
グラムカウンタ、  5・・・ランダムアクセスメモリ
(RAM)、 6・・・スタックポインタ、  7・・
・リセット制御部、8・・・スタックポインタ許容範囲
記憶部、9・・・スタックポインタ監視部。 特許出願人 松下電器産業株式会社
FIG. 1 is a block diagram of a one-chip microcomputer according to an embodiment of the present invention, FIG. 2 is a diagram showing how the RAM of the one-chip microcomputer shown in FIG. Figure 4 shows the state of the RAM in the conventional one-chip microcomputer when it becomes abnormal, Figure 4 shows the movement of the one-chip microcomputer when the stack pointer becomes abnormal, and Figure 5 shows the state of the conventional one-chip microcomputer when the RAM becomes abnormal. FIG. 2 is a configuration diagram of a microcomputer. 1... Read only memory (ROM), 2...
Instruction register unit, 3... Instruction control unit, 4... Program counter, 5... Random access memory (RAM), 6... Stack pointer, 7...
- Reset control unit, 8... Stack pointer tolerance storage unit, 9... Stack pointer monitoring unit. Patent applicant Matsushita Electric Industrial Co., Ltd.

Claims (1)

【特許請求の範囲】[Claims] 割り込みやサブルーチンコール時のリターンアドレスや
引数等の記憶用として用いられるスタックメモリと、前
記スタックメモリのアドレスを示すスタックポインタと
、前記スタックポインタの範囲を与えるスタックポイン
タ許容範囲記憶部と、前記スタックポインタの値を、前
記スタックポインタ許容範囲記憶部の値と比較し、前記
スタックポインタが許可外の値をとったとき、リセット
信号を発するスタックポインタ監視部と、前記リセット
信号に基づいてリセット動作を行わせるリセット制御部
とを備えたことを特徴とするワンチップマイクロコンピ
ュータ。
a stack memory used for storing return addresses, arguments, etc. during interrupts and subroutine calls; a stack pointer indicating the address of the stack memory; a stack pointer permissible range storage section giving the range of the stack pointer; a stack pointer monitoring unit that compares the value of the stack pointer with the value of the stack pointer permissible range storage unit and issues a reset signal when the stack pointer takes an unpermitted value, and performs a reset operation based on the reset signal. A one-chip microcomputer characterized in that it is equipped with a reset control section.
JP2108873A 1990-04-26 1990-04-26 One-chip microcomputer Pending JPH047755A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2108873A JPH047755A (en) 1990-04-26 1990-04-26 One-chip microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2108873A JPH047755A (en) 1990-04-26 1990-04-26 One-chip microcomputer

Publications (1)

Publication Number Publication Date
JPH047755A true JPH047755A (en) 1992-01-13

Family

ID=14495757

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2108873A Pending JPH047755A (en) 1990-04-26 1990-04-26 One-chip microcomputer

Country Status (1)

Country Link
JP (1) JPH047755A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05250221A (en) * 1992-03-10 1993-09-28 Nec Corp Simulator execution system
US10344824B2 (en) 2015-10-20 2019-07-09 Thiele Gmbh & Co. Kg Pivotable block lock

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05250221A (en) * 1992-03-10 1993-09-28 Nec Corp Simulator execution system
US10344824B2 (en) 2015-10-20 2019-07-09 Thiele Gmbh & Co. Kg Pivotable block lock

Similar Documents

Publication Publication Date Title
JPS6159531A (en) Microprogram loader
JPH047755A (en) One-chip microcomputer
JP2870250B2 (en) Microprocessor runaway monitor
CN117762705A (en) System for exporting debugging data
JP3166167B2 (en) Microcomputer
JP3003197B2 (en) Robot numerical controller
JPS58109957A (en) Single chip microcomputer system
KR970008509B1 (en) Resetting apparatus for micom
JPH0316647B2 (en)
JPS61279940A (en) Fault detector for computer
JPS6378212A (en) Semiconductor device
JPS58200355A (en) Operation monitoring system of cpu
JPS6117475Y2 (en)
JPH0268634A (en) Spare system for electronic computer
JPS644212B2 (en)
JP3033640B2 (en) CPU operation monitoring circuit
JPH01312637A (en) System controlling detection of processor runaway
JPH01251240A (en) Runaway detecting system
JPS61163452A (en) Central controller
JPS62102314A (en) Protecting device for microcomputer operation in case of momentary power failure
JPS62123531A (en) Cpu supervisory unit
KR19980085727A (en) How to Prevent Stack Overflow Using the Watchdog Timer's Lighting Values
JPH0784813A (en) Cpu malfunction preventing circuit
JPH039487B2 (en)
JPS62209627A (en) Data processor