JPH0248720A - One chip microcomputer and its operation control method - Google Patents

One chip microcomputer and its operation control method

Info

Publication number
JPH0248720A
JPH0248720A JP63200558A JP20055888A JPH0248720A JP H0248720 A JPH0248720 A JP H0248720A JP 63200558 A JP63200558 A JP 63200558A JP 20055888 A JP20055888 A JP 20055888A JP H0248720 A JPH0248720 A JP H0248720A
Authority
JP
Japan
Prior art keywords
voltage
circuit
chip microcomputer
detection
detection circuit
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.)
Granted
Application number
JP63200558A
Other languages
Japanese (ja)
Other versions
JP2735838B2 (en
Inventor
Toru Watanabe
徹 渡辺
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.)
Sanyo Electric Co Ltd
Original Assignee
Sanyo Electric 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 Sanyo Electric Co Ltd filed Critical Sanyo Electric Co Ltd
Priority to JP63200558A priority Critical patent/JP2735838B2/en
Publication of JPH0248720A publication Critical patent/JPH0248720A/en
Application granted granted Critical
Publication of JP2735838B2 publication Critical patent/JP2735838B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Microcomputers (AREA)
  • Power Sources (AREA)

Abstract

PURPOSE:To simply produce various types of one chip microcomputers by selecting a function which resets an internal part and a function which detects the drop of a power voltage by means of a program in a means selecting whether to impress the detection output of a voltage drop detection circuit on a gate circuit or on a flag. CONSTITUTION:In a specification which resets an internal circuit when the drop of the power voltage is detected, a switching means 6 connects the detection output of a voltage detection circuit 1 to gate circuit, and in a specification which detects the drop of the power voltage by the program, the switching means 6 connects the detection output of the voltage detection circuit 1 to the flag 19 so as to select the function. When the detection voltage selection means 14 and 15 solidly select plural detection voltages of the voltage detection circuit 1 and the detection voltage can be set by the program, the drop of the voltage can be discriminated stepwise and a processing according to the voltage can be executed. Thus, the one chip microcomputer which can respond to various purposes can be obtained.

Description

【発明の詳細な説明】 (イ)産業上の利用分野 本発明は、ワンチップマイクロコンピュータ及びその動
作制御方法に関し、特に電圧低下検出回路を内蔵するワ
ンチップマイクロコンピュータに関する。
DETAILED DESCRIPTION OF THE INVENTION (A) Field of Industrial Application The present invention relates to a one-chip microcomputer and its operation control method, and more particularly to a one-chip microcomputer incorporating a voltage drop detection circuit.

(ロ)従来の技術 通常、ワンチップマイクロコンピュータは、電源電圧が
最小動作電圧以下に低下すると動作が不定となり、ワン
チップマイクロコンピュータの外部端子に接続きれる被
制御機器等の動作が不確定となるため非常に危険な状態
となることが考えられる。そこで、電源電圧が最小動作
電圧よりやや高い電圧に低下したことを外部の検出回路
によって検出し、外部から強制的にリセットをかける方
法が採用されている。また、ワンチップマイクロコンピ
ュータによっては、電源電圧の検出回路を内蔵し、電源
電圧が低下した際には自分自身でリセットをかけるもの
もある。
(b) Conventional technology Normally, a one-chip microcomputer becomes unstable when the power supply voltage drops below the minimum operating voltage, and the operation of controlled devices that can be connected to the external terminals of the one-chip microcomputer becomes uncertain. This could lead to an extremely dangerous situation. Therefore, a method has been adopted in which an external detection circuit detects that the power supply voltage has dropped to a voltage slightly higher than the minimum operating voltage, and a reset is forcibly applied externally. Furthermore, some one-chip microcomputers have a built-in power supply voltage detection circuit and reset themselves when the power supply voltage drops.

(ハ)発明が解決しようとする課題 電源電圧の検出回路を内蔵するワンチップマイクロコン
ピュータに於いて、電源電圧を商用電源から得ている場
合には、停電等によって電源電圧が急激に低下するため
、検出回路の検出出力で内部をリセットすることは有効
であるが、停電時のバックアップ1源を有する場合、あ
るいは、電源に電池を使用するものに於いては、電源電
圧は緩やかに低下するため、電源電圧の低下をプログラ
ムによって検出し、ワンチップマイクロコンピュータの
動作速度を低下して消費電力の減少を図ったり、あるい
は、ホールトモードにして動作を停止したりする要求が
あり、内部リセットをかけることは必ずしも必要ではな
い。
(c) Problems to be solved by the invention In a one-chip microcomputer with a built-in power supply voltage detection circuit, if the power supply voltage is obtained from a commercial power supply, the power supply voltage will drop suddenly due to a power outage, etc. Although it is effective to reset the internal components using the detection output of the detection circuit, in cases where there is one backup source in the event of a power outage, or where a battery is used as a power source, the power supply voltage will gradually drop. , there is a need to detect a drop in the power supply voltage through a program and reduce the operating speed of the one-chip microcomputer to reduce power consumption, or to put it in halt mode and stop the operation, so an internal reset is required. It is not always necessary to apply.

よって、上述した用途に応じて各種のワンチップマイク
ロコンピュータを用意しなければならず不経済であった
Therefore, various one-chip microcomputers had to be prepared depending on the above-mentioned uses, which was uneconomical.

(ニ)課題を解決するための手段 本発明は、上述した点に鑑みて創作されたものであり、
電圧検出回路の検出出力によってセットされ、所定命令
の実行によりリセットされ、その状態を内部データバス
に取り込むことの可能なフラグと、内部回路を初期状態
に設定する信号径路中に設けられたゲート回路と、前記
電圧検出回路の検出出力を前記ゲート回路に印加するか
前記フラグに印加するかを選択する選択手段を備えるこ
と、及び、前記電圧検出回路に異なる基準電圧を切換え
印加する基準電圧発生回路と、内部データバスに接続さ
れ前記異なる基準電圧を選択するデータを保持するレジ
スタと、前記基準電圧の切換えに前記レジスタの出力信
号を使用するか、あるいは、固定的に基準電圧を設定す
るかを選択する検出電圧選択手段とを備えること、更に
は、前記電圧検出回路の電源のオン及びオフを行うスイ
ッチ回路と、内部データバスに接続され、前記スイッチ
回路を制御する動作制御レジスタとを備えることにより
、各種用途に応じられるワンチップマイクロコンピュー
タを得ることを目的とする。
(d) Means for solving the problems The present invention was created in view of the above points,
A flag that is set by the detection output of the voltage detection circuit, reset by the execution of a predetermined command, and whose state can be imported into the internal data bus, and a gate circuit provided in the signal path that sets the internal circuit to the initial state. and a selection means for selecting whether to apply the detection output of the voltage detection circuit to the gate circuit or the flag, and a reference voltage generation circuit that switches and applies different reference voltages to the voltage detection circuit. and a register connected to an internal data bus to hold data for selecting the different reference voltages, and a register that determines whether to use the output signal of the register to switch the reference voltage or to set the reference voltage fixedly. A detection voltage selection means for selecting the voltage detection circuit, and further comprising a switch circuit that turns on and off the power of the voltage detection circuit, and an operation control register that is connected to an internal data bus and controls the switch circuit. The objective is to obtain a one-chip microcomputer that can be used for various purposes.

(ホ)作用 電源電圧の低下を検出したときに内部回路をリセットす
る仕様には、切換手段によって電圧検出回路の検出出力
をゲート回路に接続し、プログラムによって電源電圧の
低下を検出する仕様には、切換手段によって電圧検出回
路の検出出力をフラグに接続することにより、機能が選
択できる。また、検出電圧選択手段により、電圧検出回
路の検出電圧を固定的に複数選択することができると共
にプログラムによって検出電圧を設定できるようにする
ことで、電圧の低下が段階的に判別でき、その電圧に応
じた処理を行えるようになる。更に、電圧の低下を検出
したときにスイッチ回路を開くことで電圧検出回路に流
れる電流を遮断し、消費電流を減少することも可能とな
る。
(E) For specifications that reset the internal circuit when a drop in the operating power supply voltage is detected, the detection output of the voltage detection circuit is connected to the gate circuit by a switching means, and for specifications that detect a drop in the power supply voltage by a program. The function can be selected by connecting the detection output of the voltage detection circuit to the flag using the switching means. In addition, by using the detection voltage selection means, it is possible to fixedly select a plurality of detection voltages of the voltage detection circuit, and the detection voltage can be set by a program. You will be able to perform processing accordingly. Furthermore, by opening the switch circuit when a voltage drop is detected, it is possible to cut off the current flowing to the voltage detection circuit and reduce current consumption.

(へ)実施例 第1図は本発明の実施例を示すブロック図であり、ワン
チップマイクロコンピュータの一部回路を示すものであ
る。(1〉は電圧検出回路、(2)は基準電圧発生回路
、(3)はスイッチ回路であり、電圧検出回路(1)は
、スイッチ回路(3)のMOSトランジスタ(4)を介
して電源電圧VDDが印加される抵抗R5及びR2と、
該抵抗R0とR8で分割された電圧が一端子に印加され
、子端子に基準電圧Vrefが印加されたコンパレータ
(5)とから構成され、フンパレータ(5)の出力、即
ち、検出出力が切換手段(6)に出力されている。基準
電圧発生回路(2)は、異なる2つの基準電圧Vref
 、とVref 、を発生するものであり、電源電圧V
D++と接地間に直列接続されるデプレッション型のM
OSトランジスタ(7)、エンハンスメント型のMOS
トランジスタ(8)(9)の直列回路と、デプレッショ
ン型のMOSトランジスタ(10)とエンハンスメント
型のMOSトランジスタ(11)の直列回路と、直列回
路によって発生させられる基準電圧Vref 、とVr
ef 、を選択出力するMOSトランジスタ(12)(
13)とから構成きれている。基準電圧Vref 、は
、MOS)−ランジスタ(8)(9)のスレッショルド
電圧の和によって決定され、基準電圧Vref 、はM
O8I−ランジスタ(11)のスレッショルド電圧によ
って決定きれる。Vref+>Vref、であり、基準
電圧Vref 、がMOSトランジスタ(12)で選択
されてコンパレータ(5)に印加されると検出電圧は4
vに設定され、基準電圧Vref。
(f) Embodiment FIG. 1 is a block diagram showing an embodiment of the present invention, and shows a part of the circuit of a one-chip microcomputer. (1) is a voltage detection circuit, (2) is a reference voltage generation circuit, and (3) is a switch circuit. resistors R5 and R2 to which VDD is applied;
It consists of a comparator (5) to which the voltage divided by the resistors R0 and R8 is applied to one terminal, and a reference voltage Vref is applied to the child terminal, and the output of the comparator (5), that is, the detection output is the switching means It is output in (6). The reference voltage generation circuit (2) generates two different reference voltages Vref.
, and Vref , and the power supply voltage V
Depletion type M connected in series between D++ and ground
OS transistor (7), enhancement type MOS
A series circuit of transistors (8) and (9), a series circuit of a depletion type MOS transistor (10) and an enhancement type MOS transistor (11), and reference voltages Vref and Vr generated by the series circuit.
MOS transistor (12) that selects and outputs ef (
13). The reference voltage Vref is determined by the sum of the threshold voltages of the MOS transistors (8) and (9), and the reference voltage Vref is M
It can be determined by the threshold voltage of the O8I transistor (11). Vref+>Vref, and when the reference voltage Vref is selected by the MOS transistor (12) and applied to the comparator (5), the detection voltage is 4.
v, and the reference voltage Vref.

がMOSトランジスタ(13)で選択きれてコンパレー
タ(5)に印加されると検出電圧は3vに設定されるよ
う設計されている。MOSトランジスタ(12)(13
)のゲートは、各々検出電圧選択手段(14)(15)
に接続される。スイッチ回路(3)を構成するMOSト
ランジスタ(4)(16)(17)は、電圧検出回路(
1)及び基準電圧発生回路(2)への電源電圧v0の印
加を制御するものであ6る。
is selected by the MOS transistor (13) and applied to the comparator (5), the detection voltage is set to 3V. MOS transistor (12) (13
) are the detection voltage selection means (14) and (15), respectively.
connected to. MOS transistors (4) (16) (17) constituting the switch circuit (3) are connected to a voltage detection circuit (
1) and the reference voltage generation circuit (2).

(18)は、ワンチップマイクロコンピュータ内のデー
タ転送を行うデータバスであり、データバス(18)に
は、フラグ(19)及びレジスタ(20)が接続される
。フラグ(19)は、R−Sフリップフロップで構成さ
れ、セット人力Sには、電圧検出回路(1)の検出出力
が印加芒れ、リセット入力Rには、所定のリセット命令
が実行されたときに命令を解読するインストラクション
デコーダ(21)から出力される制御信号RPDFが印
加きれる。レジスタ(20)は、基準電圧Vref 、
とVref 、を選択するレジスタを構成するラッチ回
路(22)(23)と、電圧検出回路(1)及び基準電
圧発生回路(2)への電源電圧印加を指示する動作制御
レジスタとなるラッチ回路(24)とから構成される。
(18) is a data bus for transferring data within the one-chip microcomputer, and a flag (19) and a register (20) are connected to the data bus (18). The flag (19) is composed of an R-S flip-flop, the detection output of the voltage detection circuit (1) is applied to the set input S, and the reset input R is applied when a predetermined reset command is executed. A control signal RPDF output from an instruction decoder (21) that decodes instructions is applied to the instruction decoder (21). The register (20) has a reference voltage Vref,
and Vref, and a latch circuit (22) (23) that constitutes a register that selects Vref, and a latch circuit (22) (23) that serves as an operation control register that instructs the application of power supply voltage to the voltage detection circuit (1) and reference voltage generation circuit (2). 24).

ラッチ回路(22) (23)の各出力Qは、検出電圧
選択手段(14>(15)の切換端子すに各々延在され
、ラッチ回路(24)の出力Qは、電圧検出回路(1)
及び基準電圧発生回路(2)の電源を制御するMOSト
ランジスタ(4)(16)(17)のゲートに各々接続
される。検出電圧選択手段(14)(15)は、各々、
電源電圧VDDに接続された端子aと、ラッチ回路(2
2)と(23)の出力に接続された端子すと、接地され
た端子Cとを備えており、基準電圧発生回路(2)のM
OSトランジスタ(12)と(13)のゲートに印加す
る電圧を端子a、b、cの中から選択する。この切換え
は、マイクロコンピュータを製造する工程中の、配線を
行うためのマスクを変更することによって行われる。即
ち、半導体チップ上において配線を切換えるのである。
Each output Q of the latch circuit (22) (23) is extended to the switching terminal of the detection voltage selection means (14>(15)), and the output Q of the latch circuit (24) is connected to the voltage detection circuit (1).
and the gates of MOS transistors (4), (16), and (17) that control the power supply of the reference voltage generation circuit (2). The detection voltage selection means (14) and (15) each include:
Terminal a connected to power supply voltage VDD and latch circuit (2
The terminals connected to the outputs of (2) and (23) are equipped with a grounded terminal C, and the M of the reference voltage generation circuit (2)
The voltage to be applied to the gates of OS transistors (12) and (13) is selected from among terminals a, b, and c. This switching is performed by changing the mask for wiring during the process of manufacturing the microcomputer. That is, the wiring is switched on the semiconductor chip.

検出電圧選択手段(14)ではa、検出電圧選択手段(
15)ではCに切換えると基準電圧Vref 、が選択
されて、電圧検出回路(1)の検出電圧が4Vに設定さ
れる。検出電圧選択手段(14)でC1検出電圧選択手
段(15)でaが選択されると基準電圧Vref 、が
選択されて、電圧検出回路(1)の検出電圧が3■に設
定される。また、検出電圧選択手段(14)と(15)
で共にbが選択されると、レジスタ(20)の内容に基
いて検出電圧が選択される。即ち、ラッチ回路(22)
に“1”、ラッチ回路(23)に“0”が保持されれば
、検出電圧が4vに設定でき、逆に、ラッチ回路(22
)に′0”、ラッチ回路(23)に“1′′が保持され
れば、検出電圧が3vに設定できる。
In the detection voltage selection means (14), a, the detection voltage selection means (
15), when switching to C, the reference voltage Vref is selected and the detection voltage of the voltage detection circuit (1) is set to 4V. When a is selected by the C1 detection voltage selection means (15) in the detection voltage selection means (14), the reference voltage Vref is selected and the detection voltage of the voltage detection circuit (1) is set to 3. Further, detection voltage selection means (14) and (15)
When b is selected in both, the detection voltage is selected based on the contents of the register (20). That is, the latch circuit (22)
If “1” is held in the latch circuit (23) and “0” is held in the latch circuit (23), the detection voltage can be set to 4V;
) is held at '0' and the latch circuit (23) holds '1'', the detection voltage can be set to 3V.

また、切換手段(6)も検出電圧選択手段(14)(1
5)と同様にマスクによって配線を端子aに接続するか
否かが選択されるものであり、端子aは、ワンチップマ
イクロコンピュータの内部回路をリセットするリセット
信号RESと共にORゲート(25)の入力に接続され
る。ORゲート(25)の出力は、パルス幅伸長回路(
26)に印加され十分な長さに伸長されたパルスがワン
チップマイクロコンピュータの各内部回路に供給される
。従って、切換手段(6)で端子aとの接続をしなけれ
ば、電圧検出回路(1)の検出出力によりフラグ(19
)がセットされ、プログラムによる判定が可能となるが
、切換手段(6)で端子aとの接続を行えば、電圧検出
回路(1)の検出出力によりワンチップマイクロコンピ
ュータがリセットされることになる。
Further, the switching means (6) also detects the voltage selecting means (14) (1).
Similarly to 5), whether or not to connect the wiring to terminal a is selected by the mask, and terminal a is used as the input of the OR gate (25) together with the reset signal RES that resets the internal circuit of the one-chip microcomputer. connected to. The output of the OR gate (25) is sent to the pulse width expansion circuit (
The pulse applied to 26) and extended to a sufficient length is supplied to each internal circuit of the one-chip microcomputer. Therefore, if the switching means (6) is not connected to the terminal a, the detection output of the voltage detection circuit (1) will cause the flag (19
) is set, making it possible to make a determination by program, but if the switching means (6) is connected to terminal a, the one-chip microcomputer will be reset by the detection output of the voltage detection circuit (1). .

(27)は、ワンチップマイクロコンピュータの動作を
制御するシステムクロックを、発振回路(28)の出力
を分周する分周回路(29〉の出力に基いて発生するク
ロックジェネレータであり、クロックジェネレータ(2
7)は、動作速度の切換えを行う命令の実行時に出力さ
れる制御信号F/Sによって制御され、システムクロッ
クの周波数を変える。
(27) is a clock generator that generates a system clock that controls the operation of the one-chip microcomputer based on the output of the frequency dividing circuit (29) that divides the output of the oscillation circuit (28). 2
7) is controlled by a control signal F/S output when an instruction for switching the operating speed is executed, and changes the frequency of the system clock.

第1図に示された実施例によれば、電源電圧が低下した
ことを検出した場合に、これをプログラムによって判別
することができるようにするか、あるいは、ワンチップ
マイクロコンピュータをリセットするかを切換手段(6
)のマスク切換えによって選択することができる。更に
、電圧検出回路(1)の検出電圧をプログラムによって
選択できるか、あるいは、固定的に選択するかを検出電
圧選択手段(14)(15)のマスク切換えによって選
択することができる。
According to the embodiment shown in FIG. 1, when a drop in the power supply voltage is detected, it is possible to determine this through a program, or to reset the one-chip microcomputer. Switching means (6
) can be selected by switching the mask. Furthermore, whether the detection voltage of the voltage detection circuit (1) can be selected by a program or fixedly can be selected by mask switching of the detection voltage selection means (14) (15).

次に、第1図に示された実施例において、切換手段(6
)は端子aとの接続を断ち、検出電圧選択手段(14)
(15)は共に端子すを選択接続している場合について
のワンチップマイクロコンピュータの動作例を第2図に
示す。
Next, in the embodiment shown in FIG.
) is disconnected from terminal a, and the detection voltage selection means (14)
FIG. 2 shows an example of the operation of a one-chip microcomputer when (15) and terminals are selectively connected.

第2図は、電圧検出に係わるプログラムフローである。FIG. 2 is a program flow related to voltage detection.

先ず、ワンチップマイクロコンピュータの入力端子の1
つに、商用電源あるいは商用電源を整流して得た電圧を
印加しておき、(イ)において、この入力端子の信号レ
ベルを定期的に判定することによって、停電が発生した
か否かを検出する。停電が検出されなければ通常のプロ
グラム処理(ロ)を行い、停電が検出されると、(ハ)
に於いて、レジスタ(20)への転送命令を実行し、ラ
ッチ回路(22)に“1”、ラッチ回路(23)に“O
”を保持させ、基準電圧Vref 、を選択し、電圧検
出回路(1)の検出電圧を4vに設定する。そして、(
ニ)に於いて、フラグ(19)の判定命令を実行して、
フラグ(19)がセットされたか否か、即ち、電源電圧
VDDが4vに低下したか否かを判定する0通常、ワン
チップマイクロコンピュータの電源電圧VDDは、商用
電源を整流しコンデンサにより平滑して作成したもの、
あるいは、バックアップ電源を備えたものであるため、
停電直後に電源電圧■t1つが低下することはなく、4
V程度に低下するまでは通常と同じ動作を行うことがで
きる。従って、(ニ)に於いて、電圧低下が検出できな
かったときには、(ロ)の通常プログラムを実行する。
First, one of the input terminals of the one-chip microcomputer
A commercial power supply or a voltage obtained by rectifying the commercial power supply is applied to the input terminal, and in (a), it is detected whether a power outage has occurred by periodically determining the signal level of this input terminal. do. If a power outage is not detected, normal program processing (b) is performed; if a power outage is detected, (c)
At this point, the transfer command to the register (20) is executed, and the latch circuit (22) is set to "1" and the latch circuit (23) is set to "O".
", select the reference voltage Vref, and set the detection voltage of the voltage detection circuit (1) to 4V. Then, (
In step d), execute the determination instruction for flag (19),
Determines whether the flag (19) is set, that is, whether the power supply voltage VDD has decreased to 4 V. Normally, the power supply voltage VDD of a one-chip microcomputer is obtained by rectifying the commercial power supply and smoothing it with a capacitor. What you created,
Or, because it has a backup power source,
Immediately after a power outage, the power supply voltage ■t1 does not drop, and the
The same operation as normal can be performed until the voltage drops to about V. Therefore, when the voltage drop cannot be detected in (d), the normal program in (b) is executed.

4vの電圧低下が検出されたときは、(*)に於いて、
システムクロックの周波数を低下する命令を実行し、(
ニ)に於いて、レジスタ(20)への転送命令を実行す
る。これにより、制御信号F/Sがクロックジェネレー
タ(27)から出力されるシステムクロックの周波数を
低下させ、ワンチップマイクロコンピュータの動作速度
を遅くする。また、レジスタ(20)のラッチ回路(2
2)には“0”、ラッチ回路(23)には“1”が保持
され、基準電圧Vref 、が選択され、電圧検出回路
(1)の検出電圧が3Vに設定される。そして、(ト)
に於いて、フラグ(19)の判定命令を実行して、電源
電圧v0が3vに低下したか否かを判別する。電源電圧
v0の低下が検出されなかったときは、必要最小限のプ
ログラムくチ)のみを実行して(ト)の判定命令を繰り
返えす。
When a voltage drop of 4V is detected, in (*),
Execute an instruction to reduce the frequency of the system clock (
In step d), a transfer instruction to the register (20) is executed. As a result, the control signal F/S lowers the frequency of the system clock output from the clock generator (27), thereby slowing down the operating speed of the one-chip microcomputer. Also, the latch circuit (2) of the register (20)
2) is held at "0", the latch circuit (23) is held at "1", the reference voltage Vref is selected, and the detection voltage of the voltage detection circuit (1) is set to 3V. And (g)
At this point, the flag (19) determination instruction is executed to determine whether the power supply voltage v0 has decreased to 3V. When a drop in the power supply voltage v0 is not detected, only the minimum necessary program (g) is executed and the determination instruction in (g) is repeated.

これにより、ワンチップマイクロコンピュータの消費電
力が減少し、3〜4v程度の電源電圧が更に低下するの
を遅らせることができる。また、(ト)に於いて、電源
電圧v、11.l、が3vになったことが検出されると
、(す)に於いて、レジスタ(20)への転送命令を実
行し、ラッチ回路(24)に“O″を保持させる。これ
により、MOSトランジスタ(4)(16)及び(17
〉が才)し、電圧検出回路(1)及び基準電圧発生回路
(2)への電源供給が遮断され、消費電力の減少が図ら
れる。更に、(ス)に於いて、ホールト命令が実行され
ると、制御信号CLKSTOPがインストラクションデ
コーダ(21)から出力され、発振回路(28)の発振
動作が停止される。
As a result, the power consumption of the one-chip microcomputer is reduced, and further reduction of the power supply voltage of about 3 to 4 V can be delayed. In addition, in (g), the power supply voltage v, 11. When it is detected that l becomes 3V, in step (S), a transfer instruction to the register (20) is executed and the latch circuit (24) is made to hold "O". As a result, MOS transistors (4), (16) and (17)
), the power supply to the voltage detection circuit (1) and reference voltage generation circuit (2) is cut off, thereby reducing power consumption. Further, in (S), when the halt command is executed, a control signal CLKSTOP is output from the instruction decoder (21), and the oscillation operation of the oscillation circuit (28) is stopped.

これにより、ワンチップマイクロコンピュータは、動作
を止めてホールト状態となり、電力消費が大幅に削減さ
れる。よって、電源電圧VDDは、ワンチップマイクロ
フンピユータ内部のメモリのデータ保持のみの電源とし
て使われることになり、バックアップ電源の寿命の延長
が図られる。
As a result, the one-chip microcomputer stops operating and enters a halt state, significantly reducing power consumption. Therefore, the power supply voltage VDD is used as a power supply only for holding data in the memory inside the one-chip microcomputer, thereby extending the life of the backup power supply.

第2図に示される如く、ワンチップマイクロコンピュー
タを制御することで、停電直後であっても電源電圧v0
が所定の値に低下するまでは、その電源電圧VDDに応
じた速度で動作するので効率よくワンチップマイクロコ
ンピュータの動作を制御することができる。
As shown in Figure 2, by controlling the one-chip microcomputer, the power supply voltage v0 can be maintained even immediately after a power outage.
Until VDD drops to a predetermined value, it operates at a speed corresponding to the power supply voltage VDD, so the operation of the one-chip microcomputer can be efficiently controlled.

(ト)発明の効果 本発明によれば、ワンチップマイクロコンピュータに内
蔵された電圧検出回路が利用目的に合わせて、配線のマ
スクによって切換えられ、また、検出電圧も固定とする
かプログラムによって設定するかがマスクによって切換
えられるので、多機種のワンチップマイクロコンピュー
タを簡単に製造できる利点がある。更に、電源電圧の低
下検出をプログラムによって判定し、検出電圧をプログ
ラムによって設定することにより、効率よくワンチップ
マイクロコンピュータを制御することが可能となる利点
がある。
(G) Effects of the Invention According to the present invention, the voltage detection circuit built into the one-chip microcomputer can be switched by a wiring mask according to the purpose of use, and the detection voltage can also be fixed or set by a program. Since it can be switched using a mask, it has the advantage that a wide variety of one-chip microcomputers can be manufactured easily. Furthermore, there is an advantage that the one-chip microcomputer can be efficiently controlled by determining the detection of a drop in the power supply voltage by a program and setting the detected voltage by the program.

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

第1図は本発明の実施例を示すブロック図、第2図は第
1図に示されたワンチップマイクロコンピュータを制御
するプログラムフロー図である。 (1)・・・電圧検出回路、 (2)・・・基準電圧発
生回路、 (3)・・・スイッチ回路、 (6)・・・
切換手段、(18)・・・データバス、 (19)・・
・フラグ、 (2o)用レジスタ、 (14)(15)
・・・検出電圧選択手段、 (25)・・・ORゲート
、 (26)・・・パルス幅伸長回路、 (27)・・
・クロックジェネレータ、 (28)・・・発振回路、
(29)・・・分周回路。
FIG. 1 is a block diagram showing an embodiment of the present invention, and FIG. 2 is a program flow diagram for controlling the one-chip microcomputer shown in FIG. (1)...Voltage detection circuit, (2)...Reference voltage generation circuit, (3)...Switch circuit, (6)...
Switching means, (18)...data bus, (19)...
・Flag, register for (2o), (14) (15)
...detection voltage selection means, (25) ...OR gate, (26) ...pulse width expansion circuit, (27) ...
・Clock generator, (28)...oscillation circuit,
(29)...Frequency dividing circuit.

Claims (4)

【特許請求の範囲】[Claims] (1)電源電圧が所定電圧以下になったことを検出する
電圧低下検出回路を備えたワンチップマイクロコンピュ
ータに於いて、前記電圧低下検出回路の検出出力によっ
てセットされ所定命令の実行によりリセットされ、その
状態を内部データバスに取り込むことの可能なフラグと
、内部回路を初期状態に設定する信号径路中に設けられ
たゲート回路と、前記電圧低下検出回路の検出出力を前
記ゲート回路に印加するか前記フラグに印加するかを選
択する選択手段とを備え、電源電圧の低下により内部リ
セットを行う機能と電源電圧の低下をプラグラムで検出
する機能を選択可能としたことを特徴とするワンチップ
マイクロコンピュータ。
(1) In a one-chip microcomputer equipped with a voltage drop detection circuit that detects that the power supply voltage has fallen below a predetermined voltage, the voltage drop detection circuit is set by the detection output of the voltage drop detection circuit and reset by the execution of a predetermined command; A flag capable of importing the state into an internal data bus, a gate circuit provided in a signal path that sets the internal circuit to the initial state, and a detection output of the voltage drop detection circuit applied to the gate circuit. A one-chip microcomputer, characterized in that the one-chip microcomputer is equipped with a selection means for selecting whether to apply the voltage to the flag, and is capable of selecting between a function of performing internal reset due to a drop in power supply voltage and a function of detecting a drop in power supply voltage by a program. .
(2)請求項第1項記載のワンチップマイクロコンピュ
ータに於いて、前記電圧低下検出回路に異なる基準電圧
を切換印加する基準電圧発生回路と、前記内部データバ
スに接続され前記異なる基準電圧を選択するデータを保
持するレジスタと、前記基準電圧発生回路の基準電圧の
切換えに、前記レジスタの出力信号を使用するか、ある
いは、固定的に基準電圧を設定する検出電圧選択手段と
を設けたことを特徴とするワンチップマイクロコンピュ
ータ。
(2) The one-chip microcomputer according to claim 1, further comprising: a reference voltage generation circuit that switches and applies different reference voltages to the voltage drop detection circuit; and a reference voltage generation circuit that is connected to the internal data bus and selects the different reference voltage. and a detection voltage selection means that uses the output signal of the register to switch the reference voltage of the reference voltage generation circuit or sets the reference voltage fixedly. A one-chip microcomputer with special features.
(3)請求項第1項記載のワンチップマイクロコンピュ
ータに於いて、前記電圧低下検出回路及び基準電圧発生
回路の電源のオン及びオフを行うスイッチ回路と、前記
内部データバスに接続され前記スイッチ回路を制御する
動作制御レジスタとを設けたことを特徴とするワンチッ
プマイクロコンピュータ。
(3) The one-chip microcomputer according to claim 1, further comprising: a switch circuit that turns on and off power to the voltage drop detection circuit and the reference voltage generation circuit; and a switch circuit connected to the internal data bus. A one-chip microcomputer characterized by being provided with an operation control register for controlling.
(4)請求項第2項記載のワンチップマイクロコンピュ
ータは、内部回路の動作を司どるシステムクロックの周
波数を制御する機能と所定命令の実行時あるいは外部か
ら所定信号が印加されたとき、前記システムクロックの
発生を停止させるホールト又はホールド機能を更に有し
、停電発生時前記レジスタに所定値を設定し、該所定値
によって選択された電圧を前記電圧低下検出回路が検出
したことを前記フラグによって判別した後、前記システ
ムクロックの周波数を低下させると共に前記レジスタに
よって前記選択された電圧より低い電圧を設定し、該低
い電圧が検出されたとき、前記ホールト又はホールド機
能を動作させることを特徴とするマイクロコンピュータ
の動作制御方法。
(4) The one-chip microcomputer according to claim 2 has a function of controlling the frequency of a system clock that controls the operation of an internal circuit, and a function of controlling the frequency of a system clock that controls the operation of an internal circuit. It further has a halt or hold function to stop clock generation, sets a predetermined value in the register when a power outage occurs, and uses the flag to determine that the voltage drop detection circuit has detected a voltage selected by the predetermined value. After that, the frequency of the system clock is lowered and a voltage lower than the selected voltage is set by the register, and when the lower voltage is detected, the halt or hold function is activated. How to control computer operations.
JP63200558A 1988-08-10 1988-08-10 One-chip microcomputer Expired - Lifetime JP2735838B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63200558A JP2735838B2 (en) 1988-08-10 1988-08-10 One-chip microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63200558A JP2735838B2 (en) 1988-08-10 1988-08-10 One-chip microcomputer

Publications (2)

Publication Number Publication Date
JPH0248720A true JPH0248720A (en) 1990-02-19
JP2735838B2 JP2735838B2 (en) 1998-04-02

Family

ID=16426309

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63200558A Expired - Lifetime JP2735838B2 (en) 1988-08-10 1988-08-10 One-chip microcomputer

Country Status (1)

Country Link
JP (1) JP2735838B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0533650U (en) * 1991-09-30 1993-04-30 三洋電機株式会社 Microcomputer power supply circuit
US6222398B1 (en) 1998-11-20 2001-04-24 Nec Corporation Voltage detecting circuit
JP2010066809A (en) * 2008-09-08 2010-03-25 Sanyo Electric Co Ltd Microcomputer
JP2012003692A (en) * 2010-06-21 2012-01-05 Renesas Electronics Corp Voltage detection system and control method thereof

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61138356A (en) * 1984-12-10 1986-06-25 Nippon Denso Co Ltd One-chip microcontroller

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61138356A (en) * 1984-12-10 1986-06-25 Nippon Denso Co Ltd One-chip microcontroller

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0533650U (en) * 1991-09-30 1993-04-30 三洋電機株式会社 Microcomputer power supply circuit
US6222398B1 (en) 1998-11-20 2001-04-24 Nec Corporation Voltage detecting circuit
JP2010066809A (en) * 2008-09-08 2010-03-25 Sanyo Electric Co Ltd Microcomputer
JP2012003692A (en) * 2010-06-21 2012-01-05 Renesas Electronics Corp Voltage detection system and control method thereof
US9501113B2 (en) 2010-06-21 2016-11-22 Renesas Electronics Corporation Voltage detection system and controlling method of the same

Also Published As

Publication number Publication date
JP2735838B2 (en) 1998-04-02

Similar Documents

Publication Publication Date Title
US4590553A (en) Microcomputer with power-save output instructions
US4766567A (en) One-chip data processing device including low voltage detector
KR100277247B1 (en) How to optimize your processor and its performance
JP2004070805A (en) Semiconductor integrated circuit with controlled internal power source voltage
KR960003061B1 (en) Clock generator
JPH0248720A (en) One chip microcomputer and its operation control method
JPS6280716A (en) Reset circuit for backup
JP2000200110A (en) Voltage drop circuit
JPH0321928B2 (en)
JPS61262827A (en) Semiconductor integrated circuit device
EP0669568B1 (en) Microprocessor malfunction operation preventing circuit
JPH07253830A (en) Circuit and method for generating reset signal
CN112394804A (en) Power supply regulation and control device, computer system and related power supply regulation and control method thereof
JPH0519911A (en) Power supply circuit
JP4412141B2 (en) Power supply start / stop control circuit
JPH01241659A (en) Microcomputer
JPH0344719A (en) Integrated circuit with variable-frequency clock
JP3009236B2 (en) Hot maintenance of devices
JP2804119B2 (en) Fire detector with self-operation monitoring function
JP2001203324A (en) Integrated circuit and method for controlling its operation
JPS61121117A (en) Memory back-up controller
JPS6234359Y2 (en)
JPS63200220A (en) Switching system for working speed of electronic equipment
JPS5930284A (en) Chip selection controlling circuit
JPH04134508A (en) Clock frequency adjusting device for microcomputer system