JPS58214863A - Apparatus for detecting analogue voltage - Google Patents

Apparatus for detecting analogue voltage

Info

Publication number
JPS58214863A
JPS58214863A JP9818582A JP9818582A JPS58214863A JP S58214863 A JPS58214863 A JP S58214863A JP 9818582 A JP9818582 A JP 9818582A JP 9818582 A JP9818582 A JP 9818582A JP S58214863 A JPS58214863 A JP S58214863A
Authority
JP
Japan
Prior art keywords
output
voltage
comparator
analog
latch
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
JP9818582A
Other languages
Japanese (ja)
Inventor
Hisashi Saito
斉藤 寿士
Mikio Takuwa
宅和 幹雄
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.)
Sharp Corp
Original Assignee
Sharp 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 Sharp Corp filed Critical Sharp Corp
Priority to JP9818582A priority Critical patent/JPS58214863A/en
Publication of JPS58214863A publication Critical patent/JPS58214863A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R19/00Arrangements for measuring currents or voltages or for indicating presence or sign thereof
    • G01R19/175Indicating the instants of passage of current or voltage through a given value, e.g. passage through zero

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Measurement Of Current Or Voltage (AREA)

Abstract

PURPOSE:To detect the arrival of an analogue input level inputted to a microcomputer to a predetermined level without delay, by indicating the output reversion of a comparator for comparing reference voltage and an input analogue signal. CONSTITUTION:A value set to a latch 1 corresponding to a program comes to reference voltage VR by a D/A converter 2 to be compared to the voltage V1 of an analogue signal inputted to a comparator 3 and the comparison output of the comparator 3 is reversed to either one of high and low outputs corresponding to whether the voltage V1 is equal to or higher than the voltage VR or not. This output and either one of high and low set values set to a latch are treated by an exclusive logical circuit 5 and FF 6 to indicate the reversion of the comparison output and the arrival of the inputted analogue input level to a predetermined level is detected without delay because of no sampling.

Description

【発明の詳細な説明】 本発明はアナログ電圧検出装置に関するものであり、特
にアナログ入力端子を備えたマイクロコンピュータにお
いて入力されたアナログ信号が予め設定された電圧レベ
ルと等しくなったか否かを検出する装置に関するもので
ある。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to an analog voltage detection device, and in particular detects whether an analog signal input to a microcomputer equipped with an analog input terminal becomes equal to a preset voltage level. It is related to the device.

CPU、RAM、ROM、 ■、10等を備えてなるマ
イクロコンピュータは、ディジタル信号を入力とするも
のが大部分であるが、アナログ信号を取り込んで処理し
得る回路も開発されている。このようなアナログ入力を
備えた従来のマイクロコンピュータでは、入力されたア
ナログ信号の電圧を検知する場合、命令によってA−D
変換(アナログ信号をディジタル信号に変換)を行って
いる。A−D変換に際して、一つの方法として予め専用
のハードウェアを設け、該専用ハードウェアを用いて行
う方法があり、この方法ではA−D変換命令実行後にA
−D変換器の分解能に応じたビット数のレジスタに変換
結果が格納される。他の方法としてソフトウェアで行う
方法も提案されており、この方法によれば、入力された
アナログ信号とあらかじめ設定した電圧とを比較し、そ
の結果をプログラムによってテストすることによりA−
D変換がなされる。上記専用ハードウェアで行う場合及
びソフトウェアで行う場合のいずれにしても、従来の方
法ではA−D変換に関する命令を実行した時点のアナロ
グ入力信号の電圧レベルを知ることができるだけで、刻
−刻と変化するアナログ入力信号がいつある特定の電圧
に達したのかを知ることができない。変化するアナログ
入力信号が特定の電圧に達したのを知るためには、メイ
ンプログラム中に何度もA−D変換命令及びその結果が
特定の電圧に達しているかどうかの判定処理ルーチンを
組み込んでおかねばならず、多くのプログラムエリアを
必要とし、メンプログラムの実行に必要以上の時間が掛
るという問題がある。またA−D変換命令はメインプロ
グラムの実行中にある周期で行われるため、変化するア
ナログ入力がある特定の電圧に達したと判定されても、
サンプリング周期の時間差は必ず存在し、速やかなタイ
ミングでアナログ入力信号のレベルを検知することがで
きないという欠点がある。
Most microcomputers equipped with a CPU, RAM, ROM, 1, 10, etc. receive digital signals as input, but circuits that can receive and process analog signals have also been developed. In a conventional microcomputer equipped with such an analog input, when detecting the voltage of an input analog signal, the A-D
Performs conversion (converting analog signals to digital signals). One method for A-D conversion is to provide dedicated hardware in advance and use the dedicated hardware to perform the A-D conversion.
- The conversion result is stored in a register with the number of bits depending on the resolution of the D converter. Another method has been proposed in which the input analog signal is compared with a preset voltage and the result is tested by a program.
A D conversion is performed. Regardless of whether the above-mentioned dedicated hardware or software is used, the conventional method only allows you to know the voltage level of the analog input signal at the time when an instruction related to A-D conversion is executed; It is not possible to know when a changing analog input signal has reached a certain voltage. In order to know when a changing analog input signal has reached a specific voltage, the main program must include multiple A-D conversion instructions and a processing routine to determine whether the result has reached a specific voltage. There is a problem in that it requires a lot of program area, and it takes more time than necessary to execute the main program. Also, since the A-D conversion command is executed at certain intervals during the execution of the main program, even if it is determined that the changing analog input has reached a certain voltage,
There is always a time difference in the sampling period, and the disadvantage is that the level of the analog input signal cannot be detected at a prompt timing.

処でアナログ入力信号のレベル検出が要求される場合、
必ずしも入力されたアナログ信号の電圧レベル自身の値
が要求される場合ばかりではなく、電位変化の途中経過
に拘わらずある電圧に等しくなった状態で何らかの処理
を実行させるだめの信号とする場合がしばしばある。
Where analog input signal level detection is required,
It is not always the case that the voltage level itself of the input analog signal is required, but it is often the case that the signal is required to perform some processing when the voltage is equal to a certain voltage regardless of the progress of the potential change. be.

例えば温度或いは湿度等の制御を行う場合において、一
定の温度(湿度)範囲になるように制御する場合がある
。温度あるいは湿度等のこの種の情報は通常センサーに
よりアナログ電圧に変換して入力される。今所定の温度
よりも低くて加熱中であったとすると、制御側としては
所定温度になり次第加熱中止の指示を与えればよく、そ
の途中経過は特に要求されない。
For example, when controlling temperature or humidity, there are cases where the temperature (humidity) is controlled to be within a certain range. This type of information, such as temperature or humidity, is usually input by converting it into an analog voltage using a sensor. Assuming that the temperature is currently lower than a predetermined temperature and heating is in progress, the control side only needs to give an instruction to stop heating as soon as the predetermined temperature is reached, and there is no particular requirement for any progress during the heating process.

本発明は入力されたアナログ信号がある電位に達するま
では処理を必要としないアナログ電圧検出装置において
予め設定した特定の電圧とアナログ入力信号との差が零
になるまではプログラム上の配慮は全く必要とせず、両
者の差が零になった時点で時間遅れなく直ちにその状態
を検知することができ、アナログ入力信号のレベルを検
出するだめの処理ルーチンに入って検出信号を出力し得
るマイクロコンピュータにおける簡易型の信号レベル検
出装置を提供するものである。
The present invention does not require any processing until the input analog signal reaches a certain potential.In the analog voltage detection device, no consideration is required in the program until the difference between the specific voltage set in advance and the analog input signal becomes zero. A microcomputer that can immediately detect the state without any time delay when the difference between the two becomes zero, enter a processing routine to detect the level of the analog input signal, and output a detection signal. The present invention provides a simple signal level detection device.

第1図は本発明の一実施例を示すブロック図で、CPt
J、メモリ、入力部及び出力部等を備えたマイクロコン
ピュータにおいて、nビットからなる第1ラツチlが設
けられ、該ラッチlには予めプログラムで基準となる特
定の値が設定される。上記ラッチlにはnピッ)D−A
変換器2が接続され、ラッテ1に収納されたディジタル
信号の特定値に応じた基準電圧VRがアナログ信号とし
て出力される。上記基準電圧VRはコンパレーター3の
一方の入力端子e側に与えられ、他方の入力端子θ側に
与えられた被検出アナログ入力信号V1との比較がコン
パレーター3において実行される。
FIG. 1 is a block diagram showing one embodiment of the present invention.
In a microcomputer equipped with J, a memory, an input section, an output section, etc., a first latch 1 consisting of n bits is provided, and a specific value serving as a reference is set in advance in the latch 1 by a program. The above latch l has n pins)D-A
A converter 2 is connected, and a reference voltage VR corresponding to a specific value of the digital signal stored in the ratte 1 is output as an analog signal. The reference voltage VR is applied to one input terminal e side of the comparator 3, and a comparison with the detected analog input signal V1 applied to the other input terminal θ side is performed in the comparator 3.

上記両人力信号のレベルがVR>Vlの状態でコンパレ
ーター3の出力は“H″(高電位)、VR<V工の状態
で出力は“L″(低電位)が導出され、コンパレーター
8の出力が“H″から“L”或いは“Lnから“H”に
変化した時点を検知することによってアナログ入力信号
■□が基準電圧■8に一致した時点を一応検出すること
ができる0 本実施例においては、上述のようにアナログ入力信号v
1が基準電圧vRより高いレベルから低いレベルに変化
する過程で両人力信号のレベル差が零になったか、或い
は逆にV□がv8より低いレベルから高いレベルに変化
する過程でレベル差が零になったかを併せて検知し得る
アナログ入力信号検出装置である。このような検出動作
を実行させるため第2のラッテ4が設けられている。該
第2のラッチ4は上記第1のラッチlと同様にプログラ
ムにより書込み可能な構成からなり、予めプログラムに
よって“H″(高電位)又は“L″(低電位)に設定さ
れている。第2ラツチ4の“Hll又は“L”の出力は
上記コンパレーター3の出力と共に排他的論理和回路5
に入力され、両人力信号の排峻的論理和がとられる。上
記第2ラツチ4がプログラムによって“H”に設定され
ている状態では、コンパレーター3の出力が“H’nか
ら“L”に変化したとき、即ちV工の時間に対する変化
を図示した第2図の直線2−1に示す如く、VR>v□
 からvRくV□ に変化する時間t1において、上記
排他的論理和回路5の出力は“L”から“H”に変化し
、また第2ラツチ4が“LITに設定されている状態で
は逆にV  (V  からvR>vlに変化したとき(
第I 2図の直線2−2に示す時間12)、排他的論理和回路
5の出力は同様に′L”から“H”に変化する。
When the levels of the two human power signals are VR>Vl, the output of comparator 3 is "H" (high potential), and when VR<V, the output is "L" (low potential), and comparator 8 By detecting the time when the output changes from "H" to "L" or from "Ln" to "H", the time when the analog input signal ■□ matches the reference voltage ■8 can be detected. In the example, the analog input signal v
The level difference between the two human power signals became zero in the process where V1 changed from a level higher than the reference voltage vR to a lower level, or conversely, the level difference became zero in the process where V□ changed from a level lower than v8 to a level higher. This is an analog input signal detection device that can also detect whether the A second ratte 4 is provided to perform such a detection operation. The second latch 4 has a programmable structure similar to the first latch 1, and is previously set to "H" (high potential) or "L" (low potential) by the program. The "Hll" or "L" output of the second latch 4 is sent to the exclusive OR circuit 5 along with the output of the comparator 3.
and the exclusive OR of both human power signals is taken. When the second latch 4 is set to "H" by the program, when the output of the comparator 3 changes from "H'n" to "L", that is, the second As shown in straight line 2-1 in the figure, VR>v□
At time t1 when the voltage changes from vR to V□, the output of the exclusive OR circuit 5 changes from "L" to "H", and vice versa when the second latch 4 is set to "LIT". V (When changing from V to vR>vl (
At time 12) shown by the straight line 2-2 in FIG. 12, the output of the exclusive OR circuit 5 similarly changes from 'L' to 'H'.

従ってアナログ入力信号V1が予め設定した基準電圧V
Rに低電位より接近している第2図の直線2−1のとき
には、第2のラッチ4を“H++に、逆に高電位より接
近している第2図の直線2−2のときには第2のラッチ
4を“LITに設定する。
Therefore, the analog input signal V1 is the preset reference voltage V
When the straight line 2-1 in FIG. 2 is closer to R than the low potential, the second latch 4 is set to "H++," and conversely, when the straight line 2-2 in FIG. Set the latch 4 of 2 to "LIT".

上記排他的論理和回路5の出力は立ち上りでセットされ
るフリップフロップ6の入力に与えられ、上記のような
入力が“L”から“H”に変化した時点で出力信号Qが
導出され、アナログ入力信号V工が第1ラツテlに設定
された基準レベルvRに達したことが検出される。上記
フリップフロップ6の出力信号Qは例えば各種の動作制
御回路へインタラブド制御信号として与えられ、検出さ
れたアナログ入力信号V□のレベルに対応して制御動作
を指令する。
The output of the exclusive OR circuit 5 is given to the input of a flip-flop 6 which is set at the rising edge, and when the input changes from "L" to "H" as described above, an output signal Q is derived and the analog It is detected that the input signal V has reached the reference level vR set at the first level. The output signal Q of the flip-flop 6 is given as an interwoven control signal to various operation control circuits, for example, and commands control operations in accordance with the level of the detected analog input signal V□.

上記アナログ電圧検出装置によれば、フリップ70ツブ
6の出力Qによってアナログ入力信号V1が基準電圧V
Rとの差が零になった時点がわかるだけでなく、第2ラ
ツテ4の状態をプログラムによってテストすることによ
り、V工がVRより小さい値からvRに等しくなったか
、またはV□がvRより大きい値からvRに等しくなっ
たかも併せて知ることができる。
According to the above analog voltage detection device, the analog input signal V1 is changed to the reference voltage V by the output Q of the flip 70 knob 6.
In addition to knowing when the difference from R becomes zero, by testing the state of the second ratte 4 by the program, it is possible to determine whether V has changed from a value smaller than VR to equal to vR, or whether V□ is greater than vR. From a larger value, it can also be determined whether the value is equal to vR.

上記電圧検出装置におけるコンパレーター3は、VR>
vl の状態で出力が“H”になる入出力関係の回路構
成に限られるものではなく、vR=v1の状態で“H″
22出力出される回路を用いても構成することができる
The comparator 3 in the above voltage detection device is VR>
The output is not limited to input/output related circuit configurations in which the output becomes "H" in the state of vl, but "H" in the state of vR=v1.
It can also be configured using a circuit that outputs 22 outputs.

上記第1図の回路において、第1ラッテ1.D−A変換
器2及びコンパレーター3はいずれも通常のアナログ入
力端子を備えたマイクロコンピュータでは必要なもので
あり、特別に付加されるものではない。わずかに第2ラ
ツチ4、排他的論理和回路5及びクリップフロップ6を
設け7リツプフロツプ6の出力をインタラブド制御回路
へ導くことによって実施することができる。
In the circuit shown in FIG. 1 above, the first latte 1. Both the DA converter 2 and the comparator 3 are necessary for a microcomputer equipped with a normal analog input terminal, and are not specially added. This can be implemented by providing only a second latch 4, an exclusive OR circuit 5 and a clip-flop 6, and guiding the output of the seven lip-flops 6 to the interlaced control circuit.

コンパレーター3の出力からインタラブド制御信号Qを
形成するための回路は上記実施例に限られるものではな
く、コンパレーター3の出力レベルの変化時点と共に変
化方向を検出し得るものでアレハ、マイクロコンピュー
タによるプログラム処理でも実施することができる。
The circuit for forming the interwoven control signal Q from the output of the comparator 3 is not limited to the above-mentioned embodiment, but is capable of detecting the change direction as well as the point of change in the output level of the comparator 3, and is implemented by a microcomputer. It can also be implemented by program processing.

以上本発明によれば、入力されたアナログ信号がある電
位になるまで処理を必要としないシステムにおいて、ア
ナログ入力信号が予め設定された電圧レベルに達した時
点を速やかに検知することができ、検知するまでのアナ
ログ入力信号がvRと等しくなるまではプログラム上の
配慮を必要とせず、マイクロコンピュータは電圧検出動
作にわずられされることなく他の制御を実行することが
できマイクロコンピュータの有効利用を図ることができ
る。従ってマイクロコンピュータにおけるプログラムエ
リアを大幅に減少させることができ、特にプログラムエ
リアが限られているワンチップマイクロコンピュータに
とって有益である。
As described above, according to the present invention, in a system that does not require processing until the input analog signal reaches a certain potential, it is possible to quickly detect the point in time when the analog input signal reaches a preset voltage level. No program consideration is required until the analog input signal becomes equal to vR, and the microcomputer can perform other controls without being bothered by voltage detection operations, making effective use of the microcomputer. can be achieved. Therefore, the program area of the microcomputer can be significantly reduced, which is particularly useful for one-chip microcomputers with limited program areas.

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

第1図は本発明による一実施例を示す要部ブロック図、
第2図は同実施例の動作を説明するためのVlの時間変
化図である。 l:第1ラツチ、2:D−A変換器、3:コンパレータ
ー、4:第2ラツチ、5:排他的論理和回路、6:7リ
ツプフロツプ。
FIG. 1 is a block diagram of main parts showing an embodiment according to the present invention,
FIG. 2 is a time change diagram of Vl for explaining the operation of the same embodiment. 1: first latch, 2: DA converter, 3: comparator, 4: second latch, 5: exclusive OR circuit, 6: 7 lip-flop.

Claims (1)

【特許請求の範囲】 l、予め設定された電圧を出力する基準電圧発生回路と
、該基準電圧発生回路の出力と入力されたアナログ信号
とを比較するコンパレーターと、該コンパレーター出力
の反転を検出して反転時点を指示するだめの信号を形成
する制御信号発生回路とを備えてなり、アナログ入力信
号が所定レベルを通過した点を検出することを特徴とす
るアナログ電圧検出装置。 2、前記制御信号発生回路は、出力状態が予め設された
ラッチと、該ラッチの出力が一方に入力され他方に上記
コンパレーターの出力が与えられた排他的論理和回路と
を含んでなり、排他的で入力されたアナログ信号が基準
電圧より高、
[Claims] l. A reference voltage generation circuit that outputs a preset voltage, a comparator that compares the output of the reference voltage generation circuit with an input analog signal, and an inversion of the comparator output. What is claimed is: 1. An analog voltage detection device comprising: a control signal generation circuit for detecting and forming a signal for instructing an inversion point, and detecting a point at which an analog input signal passes a predetermined level. 2. The control signal generation circuit includes a latch whose output state is set in advance, and an exclusive OR circuit in which the output of the latch is input to one side and the output of the comparator is applied to the other, exclusive and the input analog signal is higher than the reference voltage,
JP9818582A 1982-06-07 1982-06-07 Apparatus for detecting analogue voltage Pending JPS58214863A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9818582A JPS58214863A (en) 1982-06-07 1982-06-07 Apparatus for detecting analogue voltage

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9818582A JPS58214863A (en) 1982-06-07 1982-06-07 Apparatus for detecting analogue voltage

Publications (1)

Publication Number Publication Date
JPS58214863A true JPS58214863A (en) 1983-12-14

Family

ID=14212956

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9818582A Pending JPS58214863A (en) 1982-06-07 1982-06-07 Apparatus for detecting analogue voltage

Country Status (1)

Country Link
JP (1) JPS58214863A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS55164370A (en) * 1979-06-08 1980-12-22 Mitsubishi Electric Corp Detecting unit for rise time of analogue signal

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS55164370A (en) * 1979-06-08 1980-12-22 Mitsubishi Electric Corp Detecting unit for rise time of analogue signal

Similar Documents

Publication Publication Date Title
KR100267427B1 (en) Microcomputer having function of measuring maximum interrupt-disabled time period
KR960012838B1 (en) Controller for stop-clock and method therefor
JPS58214863A (en) Apparatus for detecting analogue voltage
JPH08139575A (en) Pulse output circuit
US6205192B1 (en) Clock input control circuit
JPS58182924A (en) Signal generating circuit
JPS6234355Y2 (en)
JPS5821281B2 (en) arithmetic device
JPH0333612A (en) Detecting method of rotating direction of rotary input means
JPS61209370A (en) Skew correction system
JPH03165123A (en) Automatic range-selecting measurement equipment
JP2760027B2 (en) I / O device
JPH0575462A (en) Parallel a/d converter
JPH0773212B2 (en) A / D converter
JPH01265307A (en) Analog/digital conversion unit for sequencer
JPH03274810A (en) Semiconductor integrated circuit
JPS62151031A (en) Data processor
JPH0434314A (en) Error detection circuit
JPS6412163B2 (en)
JPH0322623A (en) A/d converter circuit
JPS57178518A (en) Interruption control circuit
JPH0296844A (en) Test circuit
JPS6338727B2 (en)
JPH0192834A (en) Microprogram controller
JPS6079407A (en) Recognizing device for electrical signal