JPH05291957A - One-chip comparator with comparison reference changeover switch - Google Patents

One-chip comparator with comparison reference changeover switch

Info

Publication number
JPH05291957A
JPH05291957A JP32428691A JP32428691A JPH05291957A JP H05291957 A JPH05291957 A JP H05291957A JP 32428691 A JP32428691 A JP 32428691A JP 32428691 A JP32428691 A JP 32428691A JP H05291957 A JPH05291957 A JP H05291957A
Authority
JP
Japan
Prior art keywords
comparator
voltage
comparison
reference voltage
internal reference
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
JP32428691A
Other languages
Japanese (ja)
Inventor
Fumitake Takami
文猛 高見
Minoru Abe
稔 阿部
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP32428691A priority Critical patent/JPH05291957A/en
Publication of JPH05291957A publication Critical patent/JPH05291957A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To allow the comparator to make voltage comparison with high accuracy while receiving an input reference voltage in matching with an analog input voltage by setting two-way of comparison being comparison between external two input voltages and comparison between an external input voltage and an internal reference voltage as a comparison reference input to the comparator. CONSTITUTION:When a comparison start signal is outputted from a comparator control circuit 12, comparison is implemented between analog input voltages V1 and V2 independently of an internal reference voltage Vr. The result is stored to a bit (n) of a comparator register 14 as 1-bit digital value. A CPU reads the data via a data bus 13 to recognize the result of comparison. When a terminal 11c is thrown to the position of a terminal 11b in a switch 11, an analog input voltage V1 and the internal reference voltage Vr are given to inputs to the comparator. In this case, a digital value corresponding to the internal reference signal Vr is set to the register 14, and the comparator 10 receiving the internal reference voltage Vr by a resistor ladder 16 and a switch tree 15 makes voltage comparison of the voltage Vr with the analog input voltage V1.

Description

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

【0001】[0001]

【産業上の利用分野】この発明は、比較基準を自由に設
定できるワンチップ・コンパレータに関するものであ
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a one-chip comparator whose comparison standard can be set freely.

【0002】[0002]

【従来の技術】コンパレータとは、周知のようにアナロ
グの2入力電圧に対し、大小関係を判定して結果を出力
する装置または回路である。図4はコンパレータ回路の
時間的な動作変化を示す図であり、図において、動作は
以下のようになる。即ちVinは外部からの入力電圧で
あり、時間と共に変動する。一方、Vrは基準電圧であ
り、コンパレータの電圧比較の判定基準となる。そし
て、toにおいてコンパレータの出力が反転する。入力
電圧Vinが、時間t<toの場合、基準電圧Vrより
も低いあるいは小さいため、コンパレータ出力は、この
例では”0”である。時間t>toとなると、入力電圧
Vinは基準電圧Vrよりも高いためコンパレータ出力
は反転して”1”となる。
2. Description of the Related Art As is well known, a comparator is a device or circuit that determines the magnitude relationship between two analog input voltages and outputs the result. FIG. 4 is a diagram showing a temporal change in operation of the comparator circuit. In the figure, the operation is as follows. That is, Vin is an input voltage from the outside and changes with time. On the other hand, Vr is a reference voltage, which serves as a judgment reference for voltage comparison of the comparator. Then, the output of the comparator is inverted at to. When the input voltage Vin is lower than or equal to the reference voltage Vr when the time t <to, the comparator output is “0” in this example. When time t> to, since the input voltage Vin is higher than the reference voltage Vr, the comparator output is inverted and becomes “1”.

【0003】図5は従来のコンパレータ回路の代表的な
構成図である。図中の10は電圧比較を行うコンパレー
タ、12はコンパレータの動作と停止を制御するコンパ
レータ制御回路である。13はワンチップマイクロコン
ピュータの中央演算処理装置(図示せず:以下CPUと
略す)とを結ぶデータバス、14は任意のディジタル値
が設定できるn+1ビット長のコンパレータレジスタで
ある。15はコンパレータレジスタに設定したビットの
値によりON/OFFするスイッチツリー、16は電源
電圧Vcc−Vss間電圧を抵抗分割する抵抗ラダー
で、このスイッチツリー15と抵抗ラダー16によっ
て、任意の内部基準電圧Vrを発生する。
FIG. 5 is a typical block diagram of a conventional comparator circuit. In the figure, 10 is a comparator for performing voltage comparison, and 12 is a comparator control circuit for controlling the operation and stop of the comparator. Reference numeral 13 is a data bus connecting to a central processing unit (not shown: hereinafter abbreviated as CPU) of the one-chip microcomputer, and 14 is an n + 1-bit length comparator register capable of setting an arbitrary digital value. Reference numeral 15 is a switch tree that is turned on / off according to the value of the bit set in the comparator register, and 16 is a resistor ladder that divides the voltage between the power supply voltage Vcc and Vss by resistance. Generate Vr.

【0004】従来のワンチップマイクロコンピュータに
内蔵されているコンパレータ回路の動作を説明する。最
初にコンパレータレジスタ14に対して比較したい内部
基準電圧Vrに対応するディジタル値を書き込む。コン
パレータ10には、電源電圧と選択された抵抗ラダー値
で決る内部基準電圧Vrが比較基準として与えられる。
コンパレータ制御回路12により比較開始信号がでるこ
とにより電圧比較を開始する。コンパレータ10は入力
電圧Vinと内部基準電圧Vrとの比較を行い結果をデ
ィジタル値でコンパレータレジスタ14のビットnに格
納する。このビットnの値を読み出せば、内部基準電圧
に対して入力電圧が高いのか低いのかがわかる。
The operation of the comparator circuit incorporated in the conventional one-chip microcomputer will be described. First, the digital value corresponding to the internal reference voltage Vr to be compared is written in the comparator register 14. An internal reference voltage Vr determined by the power supply voltage and the selected resistance ladder value is given to the comparator 10 as a comparison reference.
When the comparison start signal is output by the comparator control circuit 12, the voltage comparison is started. The comparator 10 compares the input voltage Vin with the internal reference voltage Vr and stores the result as a digital value in bit n of the comparator register 14. By reading the value of this bit n, it can be known whether the input voltage is higher or lower than the internal reference voltage.

【0005】[0005]

【発明が解決しようとする課題】従来のマイクロコンピ
ュータに内蔵されているコンパレータは、以上のように
構成されているので、内部の基準電圧に対してのみ入力
電圧の比較判定が可能で、外部からの2入力電圧間での
電圧比較が行えないという課題があった。
Since the comparator incorporated in the conventional microcomputer is configured as described above, the input voltage can be compared and judged only with respect to the internal reference voltage, and the comparator can be externally determined. There was a problem that the voltage comparison between the two input voltages cannot be performed.

【0006】この発明は上記の課題を解決するためにな
されたもので、マイクロコンピュータ等に組込まれたワ
ンチップ・コンパレータで、従来の内部基準電圧による
比較と、外部からの2入力電圧間での比較という両方の
電圧比較が可能なワンチップ・コンパレータを得ること
を目的とする。
The present invention has been made in order to solve the above problems, and is a one-chip comparator incorporated in a microcomputer or the like, which compares a conventional internal reference voltage and two external input voltages. It is an object of the present invention to obtain a one-chip comparator capable of both voltage comparisons.

【0007】[0007]

【課題を解決するための手段】この発明に係るワンチッ
プ・コンパレータは、比較のための基準入力として、内
部基準電圧か、外部からの基準電圧かを選択するスイッ
チを設けた。
The one-chip comparator according to the present invention has a switch for selecting an internal reference voltage or an external reference voltage as a reference input for comparison.

【0008】[0008]

【作用】この発明におけるワンチップ・コンパレータ
は、切換スイッチで設定された入力の比較基準電圧が、
他方の測定入力に対する基準となる。
In the one-chip comparator according to the present invention, the input comparison reference voltage set by the changeover switch is
It serves as a reference for the other measurement input.

【0009】[0009]

【実施例】実施例1.以下、この発明の一実施例を図面
に基づいて説明する。図1はこの発明の一実施例である
コンパレータ回路のブロック図である。11はアナログ
入力電圧V2と内部基準電圧Vrとを切り替えるスイッ
チ回路であり、11aはアナログ入力電圧端子、11b
は内部基準電圧端子、11cはコンパレータへの入力端
子である。
EXAMPLES Example 1. An embodiment of the present invention will be described below with reference to the drawings. 1 is a block diagram of a comparator circuit according to an embodiment of the present invention. Reference numeral 11 is a switch circuit for switching between the analog input voltage V2 and the internal reference voltage Vr, 11a is an analog input voltage terminal, and 11b.
Is an internal reference voltage terminal, and 11c is an input terminal to the comparator.

【0010】スイッチ11において、端子11cが端子
11aに接続されているとき、コンパレータ10の入力
にはアナログ入力電圧V1およびV2が接続されてい
る。この状態でコンパレータ制御回路12から比較開始
信号が出力されれば、内部基準電圧Vrとはまったく無
関係にアナログ入力電圧V1とV2間で比較が行われ
る。その結果はコンパレータレジスタ14のビットnに
1ビットディジタル値で格納される。CPU(図示せ
ず)がデータバス13を介して読み出すことにより、比
較結果を知ることができる。
In the switch 11, when the terminal 11c is connected to the terminal 11a, the analog input voltages V1 and V2 are connected to the input of the comparator 10. If the comparison start signal is output from the comparator control circuit 12 in this state, the analog input voltages V1 and V2 are compared regardless of the internal reference voltage Vr. The result is stored in bit n of the comparator register 14 as a 1-bit digital value. The comparison result can be known by the CPU (not shown) reading through the data bus 13.

【0011】スイッチ11において、端子11cが端子
11bに接続されていた場合、コンパレータの入力には
アナログ入力電圧V1と内部基準電圧Vrが接続され
る。この場合コンパレータレジスタ14に内部基準電圧
Vrに対応するディジタル値を設定しておき、抵抗ラダ
ー16とスイッチツリー15によって内部基準電圧Vr
が発生する。コンパレータ10は内部基準電圧Vrに対
するアナログ入力電圧V1との電圧比較を行う。この状
態では従来と全く同じ測定回路となる。以上のようにス
イッチ11を切り換えることにより、外部2入力と、従
来の内部基準電圧に対する比較という、両方の比較方法
が選択可能である。
In the switch 11, when the terminal 11c is connected to the terminal 11b, the analog input voltage V1 and the internal reference voltage Vr are connected to the input of the comparator. In this case, a digital value corresponding to the internal reference voltage Vr is set in the comparator register 14, and the internal reference voltage Vr is set by the resistor ladder 16 and the switch tree 15.
Occurs. The comparator 10 compares the internal reference voltage Vr with the analog input voltage V1. In this state, the measurement circuit is exactly the same as the conventional one. By switching the switch 11 as described above, it is possible to select both of the two external inputs and the conventional internal reference voltage.

【0012】実施例2.なお、上記実施例1ではアナロ
グ入力電圧V2と内部基準電圧Vrの切り換えを単なる
スイッチ11と示したが、図2に示す電圧制御スイッチ
による選択回路を用いてもよい。
Example 2. In the first embodiment, the switching between the analog input voltage V2 and the internal reference voltage Vr is shown as a simple switch 11, but the selection circuit using the voltage control switch shown in FIG.

【0013】以下図2について説明する。21はデータ
フリップフロップ(以下D・F/Fと略す)であり、2
2aおよび22bはトランスミッションゲートである。
そして制御端子11a、11bに印加される、制御信号
により、あたかもスイッチが接続/非接続するかのよう
にON/OFFする。23はインバータ素子であり、入
力信号を反転して出力し、この場合にはゲート22aと
22bのON/OFFの反転を保証している。なお、1
1a、11b、11cはそれぞれ図1中のスイッチ11
の端子と対応している。
FIG. 2 will be described below. Reference numeral 21 is a data flip-flop (hereinafter abbreviated as D / F / F), which is 2
2a and 22b are transmission gates.
Then, by the control signal applied to the control terminals 11a and 11b, the switch is turned on / off as if the switch is connected / disconnected. An inverter element 23 inverts the input signal and outputs it. In this case, the inversion of ON / OFF of the gates 22a and 22b is guaranteed. 1
1a, 11b and 11c are switches 11 in FIG.
Corresponds to the terminal.

【0014】CPU(図示せず)からデータバス13を
介してD・F/F21に対して”0”または”1”を設
定する。例えばD・F/F21が”0”に設定された場
合、トランスミッションゲート22aがアクティブとな
り、従って、トランスミッションゲート22bがノンア
クティブとなる。このときはゲート22aが導通し、ア
ナログ入力電圧V2のみがコンパレータ10に接続され
る。逆にD・F/F21が”1”に設定された場合、ト
ランスミッションゲート22aはノンアクティブ、トラ
ンスミッションゲート22bがアクティブとなり、ゲー
ト22bが導通して、内部基準電圧Vrがコンパレータ
10に接続される。
"0" or "1" is set in the D / F / F 21 from the CPU (not shown) via the data bus 13. For example, when the D / F / F 21 is set to "0", the transmission gate 22a becomes active, and therefore the transmission gate 22b becomes non-active. At this time, the gate 22a becomes conductive and only the analog input voltage V2 is connected to the comparator 10. Conversely, when the D / F / F 21 is set to "1", the transmission gate 22a becomes non-active, the transmission gate 22b becomes active, the gate 22b becomes conductive, and the internal reference voltage Vr is connected to the comparator 10.

【0015】以上のように、D・F/F21にディジタ
ル値を設定することによりアナログ電圧V2と内部基準
電圧Vrとのどちらかが選択可能で、ソフトウェア指定
で自由に選択することが可能である。
As described above, by setting a digital value in the D / F / F 21, either the analog voltage V2 or the internal reference voltage Vr can be selected, and can be freely selected by software designation. ..

【0016】実施例3.また、上記実施例1では比較基
準入力の設定に、アナログ入力電圧V2と内部基準電圧
Vrとの切り換えスイッチ11を付加したコンパレータ
回路を説明したが、抵抗ラダー16への供給電源を電源
電圧Vccと入力基準電圧Vrefとを切り換えるスイ
ッチ回路を付加したコンパレータ回路を説明する。以
下、実施例3を図に基づいて説明する。図3においてV
ref/V2は入力基準電圧Vrefとアナログ入力電
圧V2の両方を兼ねており、スイッチ31はVref/
V2端子と電源電圧Vcc端子を切り換えて抵抗ラダー
16への供給電圧を選択可能となっている。スイッチ3
1中の端子31aはVref/V2端子に、31bは電
源電圧Vccに、31cは抵抗ラダー16に接続されて
いる。
Embodiment 3. Further, in the first embodiment, the comparator circuit in which the switch 11 for switching the analog input voltage V2 and the internal reference voltage Vr is added to the setting of the comparison reference input has been described, but the power supply to the resistor ladder 16 is set to the power supply voltage Vcc. A comparator circuit to which a switch circuit for switching the input reference voltage Vref is added will be described. Example 3 will be described below with reference to the drawings. V in FIG.
ref / V2 serves as both the input reference voltage Vref and the analog input voltage V2, and the switch 31 is Vref / V2.
The voltage supplied to the resistance ladder 16 can be selected by switching the V2 terminal and the power supply voltage Vcc terminal. Switch 3
The terminal 31a in 1 is connected to the Vref / V2 terminal, 31b is connected to the power supply voltage Vcc, and 31c is connected to the resistance ladder 16.

【0017】Vref/V2端子を、入力基準電圧Vr
efとして使用する場合には、スイッチ31において3
1aと31cとを接続するように切り換えることによっ
て内部基準電圧Vrは、Vref−Vss間でコンパレ
ータレジスタ14に設定した値に対応した電圧が発生す
る。コンパレータ10は、この内部基準電圧Vrに対し
てアナログ入力電圧V1との電圧比較を行う。アナログ
入力電圧V1が微小レベルの場合、入力基準電圧Vre
fには、アナログ電圧V1と比較するに最適な低い電圧
を入力することで、電圧比較はより精度よく行われる。
またスイッチ31において31bと31cとを接続する
ように切り換えると、電源電圧Vcc−Vss間で内部
基準電圧Vrが発生する。アナログ入力電圧V1がVc
c−Vss間で大きく振幅する場合に有効である。
The Vref / V2 terminal is connected to the input reference voltage Vr.
When used as ef, switch 31
By switching to connect 1a and 31c, the internal reference voltage Vr generates a voltage corresponding to the value set in the comparator register 14 between Vref and Vss. The comparator 10 compares the internal reference voltage Vr with the analog input voltage V1. When the analog input voltage V1 is a minute level, the input reference voltage Vre
By inputting a low voltage, which is optimal for comparison with the analog voltage V1, to f, the voltage comparison is performed more accurately.
When the switch 31 is switched to connect 31b and 31c, the internal reference voltage Vr is generated between the power supply voltage Vcc and Vss. Analog input voltage V1 is Vc
This is effective when there is a large amplitude between c and Vss.

【0018】実施例4.上記実施例3では、切換スイッ
チを2ケ設けたが1ケとしてもよい。即ち、切換スイッ
チ11をなくし、11cと11bを接続した状態とす
る。この場合には、切換スイッチ31を、31aと31
cを接続するように動作させると、Vref−Vss間
でレジスタ14で設定した値に対応した比較基準電圧が
得られる。なお、実施例3、実施例4において切換スイ
ッチは、実施例2で述べたソフトウェア指定で選択でき
るスイッチであってもよい。
Example 4. In the third embodiment, two changeover switches are provided, but one may be provided. That is, the changeover switch 11 is eliminated and 11c and 11b are connected. In this case, the changeover switch 31 is set to 31a and 31
When operated so as to connect c, a comparison reference voltage corresponding to the value set by the register 14 is obtained between Vref and Vss. The changeover switch in the third and fourth embodiments may be a switch that can be selected by the software designation described in the second embodiment.

【0019】[0019]

【発明の効果】以上のようにこの発明によれば、コンパ
レータの比較基準入力として、外部の2入力電圧間と、
内部基準電圧に対する比較との二通りの比較を切換て設
定できるようにしたので、アナログ入力電圧にみあった
入力基準電圧が与えられ、精度良く電圧比較が行えると
いう効果がある。
As described above, according to the present invention, as the comparison reference input of the comparator, between the two external input voltages,
Since two types of comparison, the comparison with the internal reference voltage, can be switched and set, an input reference voltage matching the analog input voltage is given, and there is an effect that the voltage comparison can be performed accurately.

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

【図1】本発明の一実施例によるワンチップ・コンパレ
ータ回路のブロック図である。
FIG. 1 is a block diagram of a one-chip comparator circuit according to an embodiment of the present invention.

【図2】ソフトウェア指定で切換が可能な切換スイッチ
の回路図である。
FIG. 2 is a circuit diagram of a changeover switch which can be changed over by software designation.

【図3】本発明の他の実施例であるワンチップ・コンパ
レータ回路のブロック図である。
FIG. 3 is a block diagram of a one-chip comparator circuit according to another embodiment of the present invention.

【図4】コンパレータの時間的な動作変化を表した図で
ある。
FIG. 4 is a diagram showing a temporal change in operation of a comparator.

【図5】従来のワンチップマイクロコンピュータに内蔵
されるコンパレータ回路のブロック図である。
FIG. 5 is a block diagram of a comparator circuit incorporated in a conventional one-chip microcomputer.

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

10 コンパレータ 11 スイッチ回路 12 コンパレータ制御回路 14 コンパレータレジスタ 15 スイッチツリー 16 抵抗ラダー 21 データフリップフロップ 22 トランスミッションゲート 23 インバータ 31 スイッチ回路 10 Comparator 11 Switch Circuit 12 Comparator Control Circuit 14 Comparator Register 15 Switch Tree 16 Resistor Ladder 21 Data Flip-Flop 22 Transmission Gate 23 Inverter 31 Switch Circuit

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 比較のための基準入力に、内部基準電圧
と外部基準電圧を切換て設定するスイッチを備えた比較
基準切換スイッチ付ワンチップ・コンパレータ。
1. A one-chip comparator with a comparison reference changeover switch, comprising a switch for switching and setting an internal reference voltage and an external reference voltage to a reference input for comparison.
JP32428691A 1991-12-09 1991-12-09 One-chip comparator with comparison reference changeover switch Pending JPH05291957A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP32428691A JPH05291957A (en) 1991-12-09 1991-12-09 One-chip comparator with comparison reference changeover switch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP32428691A JPH05291957A (en) 1991-12-09 1991-12-09 One-chip comparator with comparison reference changeover switch

Publications (1)

Publication Number Publication Date
JPH05291957A true JPH05291957A (en) 1993-11-05

Family

ID=18164112

Family Applications (1)

Application Number Title Priority Date Filing Date
JP32428691A Pending JPH05291957A (en) 1991-12-09 1991-12-09 One-chip comparator with comparison reference changeover switch

Country Status (1)

Country Link
JP (1) JPH05291957A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007149260A (en) * 2005-11-29 2007-06-14 Toshiba Corp Light receiving element circuit, optical head device, and optical disk device
CN114499526A (en) * 2021-12-31 2022-05-13 杭州士兰微电子股份有限公司 Analog-to-digital conversion circuit

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007149260A (en) * 2005-11-29 2007-06-14 Toshiba Corp Light receiving element circuit, optical head device, and optical disk device
CN114499526A (en) * 2021-12-31 2022-05-13 杭州士兰微电子股份有限公司 Analog-to-digital conversion circuit

Similar Documents

Publication Publication Date Title
KR900008821B1 (en) Digital to analog converter
US5155386A (en) Programmable hysteresis comparator
US5262705A (en) IC device for drive control of small hard disk drive unit
KR0154844B1 (en) Output load detecting apparatus
US5598110A (en) Detector circuit for use with tri-state logic devices
JPH10271680A (en) Power supply circuit
JP3636232B2 (en) Integrated circuit capable of selecting function and method for selecting function
JPH05291957A (en) One-chip comparator with comparison reference changeover switch
JPH038126B2 (en)
US5757940A (en) Electric volume controller
JP2000111589A (en) Semiconductor integrated circuit
JPH04347922A (en) Clamping circuit
JPH04270969A (en) Input impedance measuring circuit of ic circuit
JP3092551B2 (en) D / A converter
JPH03172782A (en) Semiconductor integrated circuit
JP2793094B2 (en) Comparator circuit
SU1124334A1 (en) Amplifier-limiter
JP2000252822A (en) Interrupt circuit
SU1619319A1 (en) Device for determining absolute value of difference of two voltages
JPH05129956A (en) A/d converter circuit
KR930005167Y1 (en) Mode control logic switch circuit
KR950003138B1 (en) Device for determining circuit character
JP2751387B2 (en) Input circuit of ECL circuit
JPH04158632A (en) Semiconductor integrated circuit
JPH0529900A (en) Semiconductor integrated circuit