JP2735838B2 - One-chip microcomputer - Google Patents

One-chip microcomputer

Info

Publication number
JP2735838B2
JP2735838B2 JP63200558A JP20055888A JP2735838B2 JP 2735838 B2 JP2735838 B2 JP 2735838B2 JP 63200558 A JP63200558 A JP 63200558A JP 20055888 A JP20055888 A JP 20055888A JP 2735838 B2 JP2735838 B2 JP 2735838B2
Authority
JP
Japan
Prior art keywords
voltage
circuit
reference voltage
output
detection
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.)
Expired - Lifetime
Application number
JP63200558A
Other languages
Japanese (ja)
Other versions
JPH0248720A (en
Inventor
徹 渡辺
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 Denki Co Ltd
Original Assignee
Sanyo Denki 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 Denki Co Ltd filed Critical Sanyo Denki 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)

Description

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

(ロ)従来の技術 通常、ワンチップマイクロコンピュータは、電源電圧
が最小動作電圧以下に低下すると動作が不定となり、ワ
ンチップマイクロコンピュータの外部端子に接続される
被制御機器等の動作が不確定となるため非常に危険な状
態となることが考えられる。そこで、電源電圧が最小動
作電圧よりやや高い電圧に低下したことを外部の検出回
路によって検出し、外部から強制的にリセットをかける
方法が採用されている。また、ワンチップマイクロコン
ピュータによっては、電源電圧の検出回路を内蔵し、電
源電圧が低下した際には自分自身でリセットをかけるも
のもある。
(B) Conventional technology Normally, the operation of a one-chip microcomputer becomes unstable when the power supply voltage falls below the minimum operating voltage, and the operation of a controlled device or the like connected to an external terminal of the one-chip microcomputer is uncertain. Therefore, it can be considered as a very dangerous state. 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 forcibly resets the power supply from the outside. Also, some one-chip microcomputers have a built-in power supply voltage detection circuit and reset themselves when the power supply voltage drops.

(ハ)発明が解決しようとする課題 電源電圧の検出回路を内蔵するワンチップマイクロコ
ンピュータに於いて、電源電圧を商用電源から得ている
場合には、停電等によって電源電圧が急激に低下するた
め、検出回路の検出出力で内部をリセットすることは有
効であるが、停電時のバックアップ電源を有する場合、
あるいは、電源に電池を使用するものに於いては、電源
電圧は緩やかに低下するため、電源電圧の低下をプログ
ラムによって検出し、ワンチップマイクロコンピュータ
の動作速度を低下して消費電力の減少を図ったり、ある
いは、ホールトモードにして動作を停止したりする要求
があり、内部リセットをかけることは必ずしも必要では
ない。
(C) Problems to be Solved by the Invention In a one-chip microcomputer having a built-in power supply voltage detection circuit, when the power supply voltage is obtained from a commercial power supply, the power supply voltage suddenly drops due to a power failure or the like. It is effective to reset the inside with the detection output of the detection circuit, but if you have a backup power supply at the time of power failure,
Alternatively, in the case where a battery is used as the power supply, the power supply voltage gradually decreases. Therefore, the decrease in the power supply voltage is detected by a program, and the operating speed of the one-chip microcomputer is reduced to reduce the power consumption. There is a request to stop the operation in the halt mode, or it is not always necessary to perform an internal reset.

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

(ニ)課題を解決するための手段 本発明は、上述した点に鑑みて創作されたものであ
り、電源電圧が予め定められた基準電圧以下になったこ
とを検出する電圧低下検出回路と、前記電圧低下検出回
路の検出出力でセットされ、セット出力が内部データバ
スに取り込まれて所定命令が実行されることによりリセ
ットされるフラグと、内部回路を初期状態に設定する信
号経路に介挿され、一方の入力にリセット信号が印加さ
れるゲート回路と、前記電圧低下検出回路の出力と前記
ゲート回路の他方の入力との間に設けられ、製造時のマ
スク配線で開状態又は閉状態に設定される切換手段と、
を備え、前記切換手段がマスクで閉状態となっている場
合は、前記電圧低下検出回路の検出出力が前記ゲート回
路を通過することにより前記内部回路を初期状態にハー
ド的に設定し、前記切換手段がマスクで開状態となって
いる場合は、前記電圧低下検出回路の検出出力で前記フ
ラグがセットされることにより電源電圧の低下をプログ
ラムで検出する様にしたことを特徴とする。
(D) Means for Solving the Problems The present invention has been made in view of the above points, and has a voltage drop detection circuit for detecting that a power supply voltage has become equal to or lower than a predetermined reference voltage, A flag which is set by a detection output of the voltage drop detection circuit, is set by being taken into an internal data bus, and is reset when a predetermined command is executed, and is inserted into a signal path for setting the internal circuit to an initial state. Is provided between a gate circuit to which a reset signal is applied to one input and an output of the voltage drop detection circuit and the other input of the gate circuit, and is set to an open state or a closed state by a mask wiring at the time of manufacture. Switching means,
When the switching means is closed by a mask, the detection output of the voltage drop detection circuit passes through the gate circuit to set the internal circuit to an initial state by hardware, and When the means is in the open state by the mask, the flag is set by the detection output of the voltage drop detection circuit, thereby detecting a drop in the power supply voltage by a program.

また、前記電圧低下検出回路に第1基準電圧又は前記
第1基準電圧より低い第2基準電圧を供給する基準電圧
発生回路と、前記フラグの出力状態に応じて所定命令を
実行することにより、前記基準電圧発生回路から前記電
圧低下検出回路へ、前記第1基準電圧又は前記第2基準
電圧の何れか一方を供給させる為の選択データがセット
されるレジスタと、前記レジスタの出力と前記基準電圧
発生回路の入力との間に設けられ、前記基準電圧発生回
路の入力を、製造時のマスク配線で、前記第1基準電圧
又は前記第2基準電圧の何れか一方を発生する為の電源
電圧又は前記レジスタの出力と接続させる検出電圧選択
手段と、を備え、前記検出電圧選択手段が前記電源電圧
と接続されている場合は、前記基準電圧発生回路から前
記第1基準電圧又は前記第2基準電圧の何れか一方を固
定的に発生させ、前記検出電圧選択手段が前記レジスタ
の出力と接続されている場合は、前記レジスタの選択デ
ータに応じて前記第1基準電圧又は前記第2基準電圧の
何れか一方を選択的に発生させることを特徴とする。
A reference voltage generating circuit that supplies a first reference voltage or a second reference voltage lower than the first reference voltage to the voltage drop detection circuit; and a predetermined command according to an output state of the flag, thereby executing the predetermined command. A register in which selection data for supplying one of the first reference voltage and the second reference voltage from the reference voltage generation circuit to the voltage drop detection circuit is set, and an output of the register and the reference voltage generation Provided between the input of the circuit and the input of the reference voltage generating circuit, a mask wiring at the time of manufacturing, the power supply voltage for generating either the first reference voltage or the second reference voltage or the Detection voltage selection means for connecting to the output of the register, wherein when the detection voltage selection means is connected to the power supply voltage, the reference voltage generation circuit outputs the first reference voltage or In the case where one of the second reference voltages is fixedly generated and the detection voltage selection means is connected to the output of the register, the first reference voltage or the second reference voltage is selected according to the selection data of the register. One of the two reference voltages is selectively generated.

また、少なくとも前記電圧低下検出回路の電源のオン
及びオフを行うスイッチ回路と、前記内部データバスに
接続され前記スイッチ回路を制御する動作制御レジスタ
と、を設けたことを特徴とする。
Further, a switch circuit for turning on and off the power supply of the voltage drop detection circuit and an operation control register connected to the internal data bus and controlling the switch circuit are provided.

そして、各種用途に応じることが可能なワンチップマ
イクロコンピュータを提供することを目的とする。
It is another object of the present invention to provide a one-chip microcomputer applicable to various uses.

(ホ)作用 電源電圧の低下を検出したときに内部回路をリセット
する仕様には、切換手段によって電圧検出回路の検出出
力をゲート回路に接続し、プログラムによって電源電圧
の低下を検出する仕様には、切換手段によって電圧検出
回路の検出出力をフラグに接続することにより、機能が
選択できる。また、検出電圧選択手段により、電圧検出
回路の検出電圧を固定的に複数選択することができると
共にプログラムによって検出電圧を設定できるようにす
ることで、電圧の低下が段階的に判別でき、その電圧に
応じた処理を行えるようになる。更に、電圧の低下を検
出したときにスイッチ回路を開くことで電圧検出回路に
流れる電流を遮断し、消費電流を減少することも可能と
なる。
(E) Function In the specification for resetting the internal circuit when a drop in the power supply voltage is detected, the switching output connects the detection output of the voltage detection circuit to the gate circuit, and in the specification for detecting the 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 by the switching means. In addition, the detection voltage selection means allows a plurality of detection voltages of the voltage detection circuit to be fixedly selected and the detection voltage can be set by a program, so that a decrease in the voltage can be determined in a stepwise manner. Can be performed. Furthermore, by opening the switch circuit when the voltage drop is detected, the current flowing through the voltage detection circuit can be cut off, and the current consumption can be reduced.

(ヘ)実施例 第1図は本発明の実施例を示すブロック図であり、ワ
ンチップマイクロコンピュータの一部回路を示すもので
ある。(1)は電圧検出回路、(2)は基準電圧発生回
路、(3)はスイッチ回路であり、電圧検出回路(1)
は、スイッチ回路(3)のMOSトランジスタ(4)を介
して電源電圧VDDが印加される抵抗R1及びR2と、該抵抗R
1とR2で分割された電圧が−端子に印加され、+端子に
基準電圧Vrefが印加されたコンパレータ(5)とから構
成され、コンパレータ(5)の出力、即ち、検出出力が
切換手段(6)に出力されている。基準電圧発生回路
(2)は、異なる2つの基準電圧Vref1とVref2を発生す
るものであり、電源電圧VDDと接地間に直列接続される
デプレッション型のMOSトランジスタ(7)、エンハン
スメント型のMOSトランジスタ(8)(9)の直列回路
と、デプレッション型のMOSトランジスタ(10)とエン
ハンスメント型のMOSトランジスタ(11)の直列回路
と、直列回路によって発生させられる基準電圧Vref1とV
ref2を選択出力するMOSトランジスタ(12)(13)とか
ら構成されている。基準電圧Vref1は、MOSトランジスタ
(8)(9)のスレッショルド電圧の和によって決定さ
れ、基準電圧Vref2はMOSトランジスタ(11)のスレッシ
ョルド電圧によって決定される。Vref1>Vref2であり、
基準電圧Vref1がMOSトランジスタ(12)で選択されてコ
ンパレータ(5)に印加されると検出電圧は4Vに設定さ
れ、基準電圧Vref2がMOSトランジスタ(13)で選択され
てコンパレータ(5)に印加されると検出電圧は3Vに設
定されるよう設計されている。MOSトランジスタ(12)
(13)のゲートは、各々検出電圧選択手段(14)(15)
に接続される。スイッチ回路(3)を構成するMOSトラ
ンジスタ(4)(16)(17)は、電圧検出回路(1)及
び基準電圧発生回路(2)への電源電圧VDDの印加を制
御するものである。
(F) Embodiment FIG. 1 is a block diagram showing an embodiment of the present invention, and shows a partial circuit of a one-chip microcomputer. (1) is a voltage detection circuit, (2) is a reference voltage generation circuit, (3) is a switch circuit, and the voltage detection circuit (1)
Includes resistors R 1 and R 2 which supply voltage V DD via a MOS transistor (4) of the switch circuit (3) is applied, the resistance R
1 and divided voltage by R 2 is - applied to the terminal, + reference voltage Vref is configured from a comparator (5) which is applied to the terminal, the output of the comparator (5), i.e., the detection output switching means ( 6). Reference voltage generating circuit (2) is to generate the two different reference voltages Vref 1 and Vref 2, MOS transistor (7) of the depletion type connected in series between ground and supply voltage V DD, the enhancement type A series circuit of MOS transistors (8) and (9), a series circuit of a depression type MOS transistor (10) and an enhancement type MOS transistor (11), and reference voltages Vref 1 and V generated by the series circuit.
MOS transistors (12) and (13) for selectively outputting ref 2 . Reference voltage Vref 1 is determined by the sum of the threshold voltage of the MOS transistor (8) (9), the reference voltage Vref 2 is determined by the threshold voltage of the MOS transistor (11). Vref 1 > Vref 2 and
When the reference voltage Vref 1 is selected by the MOS transistor (12) and applied to the comparator (5), the detection voltage is set to 4 V, and the reference voltage Vref 2 is selected by the MOS transistor (13) and is applied to the comparator (5). When applied, the detection voltage is designed to be set at 3V. MOS transistor (12)
The gates of (13) are detection voltage selection means (14) and (15), respectively.
Connected to. The MOS transistors (4), (16), and (17) constituting the switch circuit (3) control application of the power supply voltage V DD to the voltage detection circuit (1) and the reference voltage generation circuit (2).

(18)は、ワンチップマイクロコンピュータ内のデー
タ転送を行うデータバスであり、データバス(18)に
は、フラグ(19)及びレジスタ(20)が接続される。フ
ラグ(19)は、R−Sフリップフロップで構成され、セ
ット入力Sには、電圧検出回路(1)の検出出力が印加
され、リセット入力Rには、所定のリセット命令が実行
されたときに命令を解読するインストラクションデコー
ダ(21)から出力される制御信号RPDFが印加される。レ
ジスタ(20)は、基準電圧Vref1とVref2を選択するレジ
スタを構成するラッチ回路(22)(23)と、電圧検出回
路(1)及び基準電圧発生回路(2)への電源電圧印加
を指示する動作制御レジスタとなるラッチ回路(24)と
から構成される。ラッチ回路(22)(23)の各出力Q
は、検出電圧選択手段(14)(15)の切換端子bに各々
延在され、ラッチ回路(24)の出力Qは、電圧検出回路
(1)及び基準電圧発生回路(2)の電源を制御するMO
Sトランジスタ(4)(16)(17)のゲートに各々接続
される。検出電圧選択手段(14)(15)は、各々、電源
電圧VDDに接続された端子aと、ラッチ回路(22)と(2
3)の出力に接続された端子bと、接地された端子cと
を備えており、基準電圧発生回路(2)のMOSトランジ
スタ(12)と(13)のゲートに印加する電圧を端子a,b,
cの中から選択する。この切換えは、マイクロコンピュ
ータを製造する工程中の、配線を行うためのマスクを変
更することによって行われる。即ち、半導体チップ上に
おいて配線を切換えるのである。検出電圧選択手段(1
4)ではa、検出電圧選択手段(15)ではcに切換える
と基準電圧Vref1が選択されて、電圧検出回路(1)の
検出電圧が4Vに設定される。検出電圧選択手段(14)で
c、検出電圧選択手段(15)でaが選択されると基準電
圧Vref2が選択されて、電圧検出回路(1)の検出電圧
が3Vに設定される。また、検出電圧選択手段(14)と
(15)で共にbが選択されると、レジスタ(20)の内容
に基いて検出電圧が選択される。即ち、ラッチ回路(2
2)に“1"、ラッチ回路(23)に“0"が保持されれば、
検出電圧が4Vに設定でき、逆に、ラッチ回路(22)に
“0"、ラッチ回路(23)に“1"が保持されれば、検出電
圧が3Vに設定できる。
(18) is a data bus for performing data transfer in the one-chip microcomputer, and a flag (19) and a register (20) are connected to the data bus (18). The flag (19) is formed of an RS flip-flop. The detection output of the voltage detection circuit (1) is applied to the set input S, and the reset input R is input when a predetermined reset instruction is executed. A control signal RPDF output from an instruction decoder (21) for decoding a command is applied. Register (20) includes a latch circuit (22) (23) constituting a register selects the reference voltage Vref 1 and Vref 2, a power supply voltage applied to the voltage detection circuit (1) and the reference voltage generating circuit (2) And a latch circuit (24) serving as an operation control register for instructing. Each output Q of latch circuit (22) (23)
Are respectively extended to the switching terminals b of the detection voltage selection means (14) and (15), and the output Q of the latch circuit (24) controls the power supply of the voltage detection circuit (1) and the reference voltage generation circuit (2). MO to do
Connected to the gates of the S transistors (4), (16) and (17), respectively. The detection voltage selection means (14) and (15) respectively include a terminal a connected to the power supply voltage V DD , a latch circuit (22), and (2)
3) a terminal b connected to the output and a terminal c grounded, and apply voltages applied to the gates of the MOS transistors (12) and (13) of the reference voltage generating circuit (2) to the terminals a and b,
Select from c. This switching is performed by changing the mask for wiring in the process of manufacturing the microcomputer. That is, the wiring is switched on the semiconductor chip. Detection voltage selection means (1
In 4), when the detection voltage selection means (15) is switched to c, the reference voltage Vref 1 is selected, and the detection voltage of the voltage detection circuit (1) is set to 4V. C detection voltage selection means (14), the reference voltage Vref 2 when a is selected is selected by detecting the voltage selection means (15), the detection voltage of the voltage detection circuit (1) is set to 3V. When b is selected by both the detection voltage selection means (14) and (15), the detection voltage is selected based on the contents of the register (20). That is, the latch circuit (2
If “1” is held in 2) and “0” is held in the latch circuit (23),
If the detection voltage can be set to 4V, and if the latch circuit (22) holds "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)
の検出出力によりワンチップマイクロコンピュータがリ
セットされることになる。
The switching means (6) is also provided with the detection voltage selecting means (14) (1
As in 5), whether or not the wiring is connected to the terminal a is selected by a mask. The terminal a is connected to the input of the OR gate (25) together with the reset signal RES for resetting the internal circuit of the one-chip microcomputer. Connected to. OR
The output of the gate (25) is applied to a pulse width expansion circuit (26), and a pulse expanded to a sufficient length is supplied to each internal circuit of the one-chip microcomputer. Therefore, if the connection to the terminal a is not made by the switching means (6), the flag (19) is set by the detection output of the voltage detection circuit (1), and the judgment by the program becomes possible. When the connection with the terminal a is made, the voltage detection circuit (1)
Will reset the one-chip microcomputer.

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

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

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

第2図は、電圧検出に係わるプログラムフローであ
る。先ず、ワンチップマイクロコンピュータの入力端子
の1つに、商用電源あるいは商用電源を整流して得た電
圧を印加しておき、(イ)において、この入力端子の信
号レベルを定期的に判定することによって、停電が発生
したか否かを検出する。停電が検出されなければ通常の
プログラム処理(ロ)を行い、停電が検出されると、
(ハ)に於いて、レジスタ(20)への転送命令を実行
し、ラッチ回路(22)に“1"、ラッチ回路(23)に“0"
を保持させ、基準電圧Vref1を選択し、電圧検出回路
(1)の検出電圧を4Vに設定する。そして、(ニ)に於
いて、フラグ(19)の判定命令を実行して、フラグ(1
9)がセットされたか否か、即ち、電源電圧VDDが4Vに低
下したか否かを判定する。通常、ワンチップマイクロコ
ンピュータの電源電圧VDDは、商用電源を整流しコンデ
ンサにより平滑して作成したもの、あるいは、バックア
ップ電源を備えたものであるため、停電直後に電源電圧
VDDが低下することはなく、4V程度に低下するまでは通
常と同じ動作を行うことができる。従って、(ニ)に於
いて、電圧低下が検出できなかったときには、(ロ)の
通常プログラムを実行する。4Vの電圧低下が検出された
ときは、(ホ)に於いて、システムクロックの周波数を
低下する命令を実行し、(ニ)に於いて、レジスタ(2
0)への転送命令を実行する。これにより、制御信号F/S
がクロックジェネレータ(27)から出力されるシステム
クロックの周波数を低下させ、ワンチップマイクロコン
ピュータの動作速度を遅くする。また、レジスタ(20)
のラッチ回路(22)には“0"、ラッチ回路(23)には
“1"が保持され、基準電圧Vref2が選択され、電圧検出
回路(1)の検出電圧が3Vに設定される。そして、
(ト)に於いて、フラグ(19)の判定命令を実行して、
電源電圧VDDが3Vに低下したか否かを判別する。電源電
圧VDDの低下が検出されなかったときは、必要最小限の
プログラム(チ)のみを実行して(ト)の判定命令を繰
り返えす。これにより、ワンチップマイクロコンピュー
タの消費電力が減少し、3〜4V程度の電源電圧が更に低
下するのを遅らせることができる。また、(ト)に於い
て、電源電圧VDDが3Vになったことが検出されると、
(リ)に於いて、レジスタ(20)への転送命令を実行
し、ラッチ回路(24)に“0"を保持させる。これによ
り、MOSトランジスタ(4)(16)及び(17)がオフ
し、電圧検出回路(1)及び基準電圧発生回路(2)へ
の電源供給が遮断され、消費電力の減少が図られる。更
に、(ヌ)に於いて、ホールト命令が実行されると、制
御信号CLKSTOPがインストラクションデコーダ(21)か
ら出力され、発振回路(28)の発振動作が停止される。
これにより、ワンチップマイクロコンピュータは、動作
を止めてホールト状態となり、電力消費が大幅に削減さ
れる。よって、電源電圧VDDは、ワンチップマイクロコ
ンピュータ内部のメモリのデータ保持のみの電源として
使われることになり、バックアップ電源の寿命の延長が
図られる。
FIG. 2 is a program flow relating to voltage detection. First, a commercial power supply or a voltage obtained by rectifying a commercial power supply is applied to one of the input terminals of the one-chip microcomputer, and in (a), the signal level of this input terminal is periodically determined. Is detected as to whether or not a power failure has occurred. If no power outage is detected, the normal program processing (b) is performed, and if a power outage is detected,
In (c), the transfer instruction to the register (20) is executed, and the latch circuit (22) is set to “1” and the latch circuit (23) is set to “0”.
, The reference voltage Vref 1 is selected, and the detection voltage of the voltage detection circuit (1) is set to 4V. Then, in (d), the determination instruction of the flag (19) is executed, and the flag (1) is executed.
9) is set, that is, whether the power supply voltage V DD has dropped to 4V. Normally, the power supply voltage V DD of a one-chip microcomputer is obtained by rectifying a commercial power supply and smoothing it with a capacitor, or is provided with a backup power supply.
V DD does not decrease, and the same operation as usual can be performed until it decreases to about 4 V. Therefore, when the voltage drop cannot be detected in (d), the normal program in (b) is executed. When the voltage drop of 4V is detected, the instruction to decrease the frequency of the system clock is executed in (e), and the register (2) is executed in (d).
Execute the transfer instruction to 0). As a result, the control signal F / S
Reduces the frequency of the system clock output from the clock generator (27), and reduces the operating speed of the one-chip microcomputer. Also register (20)
The latch circuit (22) "0", the latch circuit (23) is held "1", the reference voltage Vref 2 is selected, the detection voltage of the voltage detection circuit (1) is set to 3V. And
In (g), the judgment instruction of the flag (19) is executed, and
It is determined whether or not the power supply voltage V DD has dropped to 3V. If a decrease in the power supply voltage V DD is not detected, only the necessary minimum program (H) is executed and the judgment instruction (G) is repeated. As a result, the power consumption of the one-chip microcomputer is reduced, and it is possible to delay a further decrease in the power supply voltage of about 3 to 4 V. Also, in (g), when it is detected that the power supply voltage V DD has become 3 V,
In (i), a transfer instruction to the register (20) is executed, and the latch circuit (24) holds "0". As a result, the MOS transistors (4), (16) and (17) are turned off, the power supply to the voltage detection circuit (1) and the reference voltage generation circuit (2) is cut off, and the power consumption is reduced. Further, when the halt instruction is executed in (N), the control signal CLKSTOP is output from the instruction decoder (21), and the oscillation operation of the oscillation circuit (28) is stopped.
As a result, the one-chip microcomputer stops operating and enters a halt state, and power consumption is greatly reduced. Therefore, the power supply voltage V DD is used as a power supply only for retaining data in the memory inside the one-chip microcomputer, and the life of the backup power supply is extended.

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

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

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

第1図は本発明の実施例を示すブロック図、第2図は第
1図に示されたワンチップマイクロコンピュータを制御
するプログラムフロー図である。 (1)……電圧検出回路、(2)……基準電圧発生回
路、(3)……スイッチ回路、(6)……切換手段、
(18)……データバス、(19)……フラグ、(20)……
レジスタ、(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 chart 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, (20)
Register, (14) (15) ...... Detection voltage selection means, (25)
…… OR gate, (26)… Pulse width expansion circuit, (27)…
… Clock generator, (28) …… Oscillation circuit, (29)
.... Division circuit.

───────────────────────────────────────────────────── フロントページの続き (51)Int.Cl.6 識別記号 FI G06F 15/78 510 G06F 1/00 350B ──────────────────────────────────────────────────続 き Continued on the front page (51) Int.Cl. 6 Identification code FI G06F 15/78 510 G06F 1/00 350B

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】電源電圧が予め定められた基準電圧以下に
なったことを検出する電圧低下検出回路と、 前記電圧低下検出回路の検出出力でセットされ、セット
出力が内部データバスに取り込まれて所定命令が実行さ
れることによりリセットされるフラグと、 内部回路を初期状態に設定する信号経路に介挿され、一
方の入力にリセット信号が印加されるゲート回路と、 前記電圧低下検出回路の出力と前記ゲート回路の他方の
入力との間に設けられ、製造時のマスク配線で開状態又
は閉状態に設定される切換手段と、を備え、 前記切換手段がマスクで閉状態となっている場合は、前
記電圧低下検出回路の検出出力が前記ゲート回路を通過
することにより前記内部回路を初期状態にハード的に設
定し、前記切換手段がマスクで開状態となっている場合
は、前記電圧低下検出回路の検出出力で前記フラグがセ
ットされることにより電源電圧の低下をプログラムで検
出する様にしたことを特徴とするワンチップマイクロコ
ンピュータ。
1. A voltage drop detection circuit for detecting that a power supply voltage has become equal to or lower than a predetermined reference voltage, and a detection output of the voltage drop detection circuit is set, and the set output is taken into an internal data bus. A flag reset by execution of a predetermined command, a gate circuit inserted into a signal path for setting an internal circuit to an initial state, and a reset signal applied to one input, and an output of the voltage drop detection circuit Switching means provided between the gate circuit and the other input of the gate circuit, the switching means being set to an open state or a closed state by a mask wiring at the time of manufacture, wherein the switching means is closed by a mask. Is set when the detection output of the voltage drop detection circuit passes through the gate circuit to set the internal circuit to an initial state by hardware, and when the switching means is in an open state by a mask. In this case, a one-chip microcomputer is characterized in that a drop in the power supply voltage is detected by a program by setting the flag with a detection output of the voltage drop detection circuit.
【請求項2】請求項第1項記載のワンチップマイクロコ
ンピュータに於いて、 前記電圧低下検出回路に第1基準電圧又は前記第1基準
電圧より低い第2基準電圧を供給する基準電圧発生回路
と、 前記フラグの出力状態に応じて所定命令を実行すること
により、前記基準電圧発生回路から前記電圧低下検出回
路へ、前記第1基準電圧又は前記第2基準電圧の何れか
一方を供給させる為の選択データがセットされるレジス
タと、 前記レジスタの出力と前記基準電圧発生回路の入力との
間に設けられ、前記基準電圧発生回路の入力を、製造時
のマスク配線で、前記第1基準電圧又は前記第2基準電
圧の何れか一方を発生する為の電源電圧又は前記レジス
タの出力と接続させる検出電圧選択手段と、を備え、 前記検出電圧選択手段が前記電源電圧と接続されている
場合は、前記基準電圧発生回路から前記第1基準電圧又
は前記第2基準電圧の何れか一方を固定的に発生させ、
前記検出電圧選択手段が前記レジスタの出力と接続され
ている場合は、前記レジスタの選択データに応じて前記
第1基準電圧又は前記第2基準電圧の何れか一方を選択
的に発生させることを特徴とするワンチップマイクロコ
ンピュータ。
2. The one-chip microcomputer according to claim 1, wherein a reference voltage generating circuit that supplies a first reference voltage or a second reference voltage lower than the first reference voltage to the voltage drop detection circuit. Executing a predetermined command in accordance with the output state of the flag to cause the reference voltage generation circuit to supply either the first reference voltage or the second reference voltage to the voltage drop detection circuit. A register in which selection data is set, provided between an output of the register and an input of the reference voltage generation circuit, and the input of the reference voltage generation circuit is connected to the first reference voltage or A power supply voltage for generating any one of the second reference voltages or a detection voltage selection unit connected to an output of the register, wherein the detection voltage selection unit is connected to the power supply voltage. When connected, one of the first reference voltage and the second reference voltage is fixedly generated from the reference voltage generation circuit,
When the detection voltage selection means is connected to the output of the register, one of the first reference voltage and the second reference voltage is selectively generated according to the selection data of the register. And a one-chip microcomputer.
【請求項3】請求項第2項記載のワンチップマイクロコ
ンピュータに於いて、 少なくとも前記電圧低下検出回路の電源のオン及びオフ
を行うスイッチ回路と、 前記内部データバスに接続され前記スイッチ回路を制御
する動作制御レジスタと、 を設けたことを特徴とするワンチップマイクロコンピュ
ータ。
3. The one-chip microcomputer according to claim 2, wherein at least a switch circuit for turning on and off a power supply of said voltage drop detection circuit, and said switch circuit connected to said internal data bus to control said switch circuit. A one-chip microcomputer, comprising:
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 JPH0248720A (en) 1990-02-19
JP2735838B2 true 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)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2602824Y2 (en) * 1991-09-30 2000-01-31 三洋電機株式会社 Power supply circuit of microcomputer
JP3230502B2 (en) 1998-11-20 2001-11-19 日本電気株式会社 Voltage detection circuit
JP2010066809A (en) * 2008-09-08 2010-03-25 Sanyo Electric Co Ltd Microcomputer
JP5584527B2 (en) 2010-06-21 2014-09-03 ルネサスエレクトロニクス株式会社 Voltage detection system and control method thereof

Family Cites Families (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

Also Published As

Publication number Publication date
JPH0248720A (en) 1990-02-19

Similar Documents

Publication Publication Date Title
US4766567A (en) One-chip data processing device including low voltage detector
CA2210024C (en) Method and apparatus for power supply switching with logic integrity protection
US7581128B2 (en) Microcomputer selecting operating condition
EP0132133B1 (en) Microcomputer
JP2643146B2 (en) Clock generation circuit of microcomputer
US6557107B1 (en) Power-saving mode release error detection and recovery logic circuit for microcontroller devices
JP2735838B2 (en) One-chip microcomputer
JPH09160785A (en) Apparatus and method for generation of interrupt
JP3214469B2 (en) Method and apparatus for controlling writing of flash EEPROM by microcomputer
JP2000200110A (en) Voltage drop circuit
JPS61285521A (en) Computer device of low power consumption
EP0669568B1 (en) Microprocessor malfunction operation preventing circuit
JPS61262827A (en) Semiconductor integrated circuit device
JPH0142015B2 (en)
JPH0512756B2 (en)
JPH0519911A (en) Power supply circuit
JP2000339068A (en) Method for accessing main atx output without monitoring all outputs
JP2005208939A (en) System for monitoring power supply voltage of microcomputer
JP3009236B2 (en) Hot maintenance of devices
JP2001273274A (en) Semiconductor integrated circuit and test mode setting circuit therefor
JP2926852B2 (en) Semiconductor memory
JPH0344719A (en) Integrated circuit with variable-frequency clock
JPH0516734Y2 (en)
JPH0434168B2 (en)
JPH0638219B2 (en) Memory back-up powered processor