JPH09261061A - Analog/digital conversion circuit - Google Patents

Analog/digital conversion circuit

Info

Publication number
JPH09261061A
JPH09261061A JP8071704A JP7170496A JPH09261061A JP H09261061 A JPH09261061 A JP H09261061A JP 8071704 A JP8071704 A JP 8071704A JP 7170496 A JP7170496 A JP 7170496A JP H09261061 A JPH09261061 A JP H09261061A
Authority
JP
Japan
Prior art keywords
voltage
conversion
width
setting
transformation
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
JP8071704A
Other languages
Japanese (ja)
Inventor
Akihiro Hashimoto
明宏 橋本
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 JP8071704A priority Critical patent/JPH09261061A/en
Publication of JPH09261061A publication Critical patent/JPH09261061A/en
Pending legal-status Critical Current

Links

Landscapes

  • Microcomputers (AREA)
  • Analogue/Digital Conversion (AREA)

Abstract

PROBLEM TO BE SOLVED: To reduce time necessary for A/D conversion processing without requiring the setting of a voltage changing width by means of software by equipping a mechanism part executing the setting of the voltage changing width by means of a switching circuit controlled by a successive approximating register and a means executing judgment in the range of an A/D conversion voltage. SOLUTION: A comparator part 7 executes the comparison of the voltage values of an analog voltage line 14 inputted from an analog voltage converter 10 and a Vref voltage line 6 inputted from a switch tree part 4 with each other. An A/D converting logic controls the successive approximating register 8 depending on the result of the comparator part 7. The switching circuit 12 consists of a switch circuit controlled by the voltage changing width control signal of the register 8, and a voltage changing width setting voltage line 13 is selected by this switching circuit 12, inputted to the converter 10 to execute voltage changing operation.

Description

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

【0001】[0001]

【発明の属する技術分野】この発明は、A/D変換回路
を内蔵したマイコン(マイクロコンピュータ)に係わ
り、特にそのA/D変換方式の改良に関するものであ
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microcomputer (microcomputer) incorporating an A / D conversion circuit, and more particularly to improvement of its A / D conversion system.

【0002】[0002]

【従来の技術】従来の技術では、例えば特開平3−27
426号公報記載のように、A/D変換を実行する際
に、変換すべきアナログ電圧幅を任意に選択することが
できる、変圧幅設定レジスタを設けることにより、A/
D変換ブロックは従来のままで、A/D変換実行可能な
アナログ電圧の範囲制限を無くすとともに、変換精度を
上げる技術がある。
2. Description of the Related Art In the prior art, for example, Japanese Patent Laid-Open No. 3-27 is used.
As described in Japanese Patent No. 426, by providing a voltage conversion width setting register that can arbitrarily select an analog voltage width to be converted when performing A / D conversion, A / D conversion is performed.
The D conversion block is the same as the conventional one, and there is a technique for increasing the conversion accuracy while eliminating the range limitation of the analog voltage capable of performing A / D conversion.

【0003】従来技術の例を図1に基づいて説明する。An example of the prior art will be described with reference to FIG.

【0004】図1は下記の機能部より構成されている。FIG. 1 is composed of the following functional parts.

【0005】即ち、VREF電圧入力線1、VSS電圧
入力線2、ラダー抵抗3、スイッチツリー4、D/Aコ
ンバータブロック5、Vref電圧線6、コンパレータ
7、逐次近似レジスタ8、アナログ電圧入力線9、アナ
ログ電圧変換装置10、変圧幅設定レジスタ11、スイ
ッチング回路12、変圧幅設定電圧線13、変圧後のア
ナログ電圧線14より成る。これらの構成に基づいて、
以下に説明する。
That is, VREF voltage input line 1, VSS voltage input line 2, ladder resistor 3, switch tree 4, D / A converter block 5, Vref voltage line 6, comparator 7, successive approximation register 8, analog voltage input line 9 , An analog voltage conversion device 10, a voltage transformation width setting register 11, a switching circuit 12, a voltage transformation width setting voltage line 13, and an analog voltage line 14 after transformation. Based on these configurations,
This will be described below.

【0006】図1では、A/D変換回路内蔵マイコンに
おいて、逐次近似型A/D変換回路に、アナログ電圧入
力線9にアナログ電圧変換装置10を備えるとともに、
そのアナログ電圧変圧幅を任意に設定できるように、複
数の入力端子から入力される変圧幅設定電圧を選択でき
る変圧幅設定レジスタ11と、それに対応してスイッチ
ングするスイッチング回路12を備えたものである。
In FIG. 1, in a microcomputer with a built-in A / D conversion circuit, a successive approximation type A / D conversion circuit is provided with an analog voltage conversion device 10 on an analog voltage input line 9, and
In order to be able to arbitrarily set the analog voltage transformation width, a transformation width setting register 11 capable of selecting a transformation width setting voltage input from a plurality of input terminals, and a switching circuit 12 switching corresponding thereto are provided. .

【0007】従来の技術におけるアナログ電圧がVRE
F電圧を越えない時のA/D変換実行(変圧幅設定動作
以外のA/D変換動作)を以下に説明する。
The analog voltage in the prior art is VRE.
The A / D conversion execution (A / D conversion operation other than the transform width setting operation) when the F voltage is not exceeded will be described below.

【0008】A/D変換を開始すると、逐次近似レジス
タ8は00Hに設定される。その後、逐次近似レジスタ
8の最上位ビットに1が設定される。この逐次近似レジ
スタ8の値に従って、ラダー抵抗3、スイッチツリー4
からなるA/Dコンバーター5からVREF電圧入力線
1から入力されるVREF電圧と、VSS電圧入力線2
から入力されるVSS電圧間の電圧幅を抵抗分割して得
られる比較電圧が、Vref電圧線6を経由してコンパ
レータ7に出力される。
When the A / D conversion is started, the successive approximation register 8 is set to 00H. After that, 1 is set to the most significant bit of the successive approximation register 8. According to the value of the successive approximation register 8, the ladder resistance 3 and the switch tree 4
VREF voltage input from the VREF voltage input line 1 from the A / D converter 5 and the VSS voltage input line 2
A comparison voltage obtained by resistance-dividing the voltage width between the VSS voltages input from is output to the comparator 7 via the Vref voltage line 6.

【0009】コンパレータ7はこの比較電圧(Vref
電圧線6)と、アナログ電圧入力線14から入力される
アナログ電圧との比較を行い、アナログ電圧の方が小さ
ければ逐次近似レジスタ8の最上位ビットに0が設定さ
れ、アナログ電圧の方が大きければ1のままになる。そ
して、次のビットに1を設定し、この逐次近似レジスタ
8の値により得られる比較電圧とアナログ電圧との比較
を行い、結果を逐次近似レジスタ8に設定し、次のビッ
トを1に設定する。
The comparator 7 uses the comparison voltage (Vref
The voltage line 6) is compared with the analog voltage input from the analog voltage input line 14. If the analog voltage is smaller, 0 is set in the most significant bit of the successive approximation register 8 and the analog voltage is larger. If it remains 1, Then, the next bit is set to 1, the comparison voltage obtained from the value of the successive approximation register 8 is compared with the analog voltage, the result is set to the successive approximation register 8, and the next bit is set to 1. .

【0010】以下、同様にこの動作を繰り返し、最下位
ビットまで実行し、A/D変換を終了する。この時の逐
次近似レジスタ8の値がA/D変換結果となる。
Thereafter, this operation is similarly repeated until the least significant bit is executed and the A / D conversion is completed. The value of the successive approximation register 8 at this time becomes the A / D conversion result.

【0011】ここで、アナログ電圧がVREF電圧を越
えるときのA/D変換動作、即ち変圧幅設定動作を以下
で説明する。
The A / D conversion operation when the analog voltage exceeds the VREF voltage, that is, the transformation width setting operation will be described below.

【0012】従来の技術においては、アナログ電圧がV
REF電圧を越えるとき、A/D変換を実行するため、
アナログ電圧入力線9にアナログ電圧変圧装置10を備
えるとともに、そのアナログ電圧変圧幅を任意に設定で
きるように、複数の入力端子から入力される変圧幅設定
電圧13を選択できる変圧幅設定レジスタ11と、それ
に対応してスイッチングするスイッチング回路12を備
えたものである。
In the prior art, the analog voltage is V
When the REF voltage is exceeded, A / D conversion is executed.
An analog voltage transformer 10 is provided on the analog voltage input line 9, and a transformer width setting register 11 capable of selecting a transformer width setting voltage 13 input from a plurality of input terminals so that the analog voltage transformer width can be arbitrarily set. , A switching circuit 12 that switches in accordance with it.

【0013】アナログ電圧がVREF電圧を越えると
き、アナログ電圧の変圧を実施しない場合は、A/D変
換結果は最大値となり、実際のアナログ電圧をA/D変
換結果から判断することができないが、アナログ電圧か
ら変圧幅設定電圧線13の一本から入力される変圧幅設
定電圧を差し引いた電圧がVSS電圧2からVREF電
圧1の間となるように、あらかじめ外部より変圧幅設定
電圧を入力しておき、変圧幅設定レジスタ11をその変
圧幅設定電圧線13がスイッチング回路12に選択され
るように設定する。
When the analog voltage exceeds the VREF voltage, if the analog voltage is not transformed, the A / D conversion result becomes the maximum value, and the actual analog voltage cannot be judged from the A / D conversion result. Input the transformer width setting voltage from the outside in advance so that the voltage obtained by subtracting the transformer width setting voltage input from one of the transformer width setting voltage lines 13 from the analog voltage is between VSS voltage 2 and VREF voltage 1. Then, the transformer width setting register 11 is set so that the transformer width setting voltage line 13 is selected by the switching circuit 12.

【0014】このことにより、アナログ電圧変圧装置1
0は変圧後のアナログ電圧線14に、アナログ電圧から
変圧幅設定電圧を差し引いた電圧を出力する。
As a result, the analog voltage transformer 1
0 outputs a voltage obtained by subtracting the transformer width setting voltage from the analog voltage to the analog voltage line 14 after transformation.

【0015】その後、A/D変換を実行することによ
り、実際のアナログ電圧は選択した変圧幅設定電圧にA
/D変換結果を加えた電圧と言うように判断が可能とな
る。
After that, by executing A / D conversion, the actual analog voltage is converted into the selected voltage range setting voltage by A / D conversion.
It is possible to make a judgment such as the voltage added with the / D conversion result.

【0016】次に、従来技術による変圧幅設定と、その
設定幅に対するA/D変換可能なアナログ電圧範囲を、
図2を例として説明する。
Next, the conversion width setting according to the prior art and the analog voltage range capable of A / D conversion with respect to the setting width are
2 will be described as an example.

【0017】図2は、変圧幅設定電圧線13へ7.5
V,5V,2.5V,0Vの4種類の電圧を入力し、V
REF電圧1へ5V,VSS電圧2へ0Vを入力したと
きの例を示している。
FIG. 2 shows that the voltage of the transformer width setting voltage line 13 is 7.5.
Input 4 kinds of voltage, V, 5V, 2.5V, 0V,
An example is shown in which 5 V is input to the REF voltage 1 and 0 V is input to the VSS voltage 2.

【0018】図2のAに示す電圧範囲は、変圧幅設定を
実施しない場合(変圧幅設定電圧線13から0Vの電圧
値を選択)に、A/D変換可能なアナログ入力電圧9の
電圧幅を示したもので、5V〜0Vの範囲でA/D変換
結果が得られることを示している。
The voltage range shown by A in FIG. 2 is the voltage range of the analog input voltage 9 that can be A / D converted when the voltage range setting is not performed (the voltage value of 0 V is selected from the voltage range setting voltage line 13). Shows that the A / D conversion result can be obtained in the range of 5V to 0V.

【0019】Bに示す電圧範囲は、変圧幅設定電圧線1
3から2.5Vの電圧値を選択した場合のA/D変換可
能なアナログ入力電圧9の電圧幅を示したもので、7.
5V〜2.5Vの範囲でA/D変換結果が得られること
を示している。
The voltage range indicated by B is the voltage range setting voltage line 1
The figure shows the voltage width of the analog input voltage 9 that can be A / D converted when a voltage value of 3 to 2.5 V is selected.
It shows that the A / D conversion result is obtained in the range of 5V to 2.5V.

【0020】Cに示す電圧範囲は、変圧幅設定電圧線1
3から5Vの電圧値を選択した場合の、A/D変換可能
なアナログ入力電圧9の電圧幅を示したもので、10V
〜5Vの範囲でA/D変換結果が得られることを示して
いる。
The voltage range indicated by C is the voltage-width setting voltage line 1
Indicates the voltage range of analog input voltage 9 that can be A / D converted when a voltage value of 3 to 5 V is selected.
It shows that the A / D conversion result is obtained in the range of up to 5V.

【0021】Dに示す電圧範囲は、変圧幅設定電圧線1
3から7.5Vの電圧値を選択した場合のA/D変換可
能なアナログ入力電圧9の電圧幅を示したもので、1
2.5V〜7.5Vの範囲でA/D変換結果が得られる
ことを示している。
The voltage range indicated by D is the voltage-width setting voltage line 1
It shows the voltage range of analog input voltage 9 that can be A / D converted when a voltage value of 3 to 7.5 V is selected.
It shows that the A / D conversion result can be obtained in the range of 2.5V to 7.5V.

【0022】このように図2においては、4種類の変圧
幅設定を例に上げて説明している。A/D変換するアナ
ログ電圧値を、A/D変換が可能な領域に設定する変圧
幅設定は、変圧幅設定電圧線13の選択により実施さ
れ、A/D変換実行可能な領域電圧間(VREF〜VS
S)に、設定されるように実施する。
As described above, in FIG. 2, four types of transformation width settings are described as an example. The transformation width setting for setting the analog voltage value for A / D conversion in the area where A / D conversion is possible is performed by selecting the transformation width setting voltage line 13, and the voltage between the area voltages (VREF) where A / D conversion can be performed is performed. ~ VS
S) is performed as set.

【0023】[0023]

【発明が解決しようとする課題】従来の技術において
は、変圧幅の設定が変圧幅設定レジスタにて行われるた
め、A/D変換の実行前に入力されるアナログ電圧値に
見当をつけ、変圧幅の設定をソフトウエアにより行った
後、A/D変換が実行される。
In the prior art, since the transformation width is set in the transformation width setting register, the analog voltage value input before the A / D conversion is performed is estimated and the transformation is performed. After the width is set by software, A / D conversion is executed.

【0024】不明なアナログ電圧が入力された場合、そ
の入力電圧に見当をつけ、A/D変換可能な電圧範囲に
変圧幅の設定を行うことは不可能で、アナログ入力電圧
9がA/D変換可能な電圧範囲にないと、A/D変換に
より変換データが得られないのは先に説明した通りであ
る。
When an unknown analog voltage is input, it is impossible to estimate the input voltage and set the voltage conversion width within the voltage range in which A / D conversion is possible. As described above, the converted data cannot be obtained by the A / D conversion unless the voltage is within the convertible voltage range.

【0025】そのため、変圧幅設定を最大のものから順
次変更し、その都度範囲内にあるか否か判断する方法で
実施される。この場合、変圧幅設定の度に多くの処理時
間を要する欠点が生じる。
Therefore, the method is carried out by sequentially changing the transformation width setting from the maximum setting and determining whether or not it is within the range each time. In this case, there is a drawback in that a long processing time is required each time the transformation width is set.

【0026】そこで、図3において従来の技術として、
不明なアナログ電圧の入力があった場合の変圧幅設定
と、A/D変換実施の流れ図を示して説明する。
Therefore, as a conventional technique in FIG.
A description will be given with reference to a flow chart for setting the voltage conversion width and performing A / D conversion when an unknown analog voltage is input.

【0027】不明なアナログ電圧が入力される場合、変
圧幅設定を最大のものに設定し、アナログ電圧入力9が
A/D変換可能な電圧範囲にあるか否か、判断されてか
らA/D変換が実施される。このときの判断は、その変
換結果が得られるか否か(00Hか否か)で評価され、
変換結果が得られなければ、ソフトウエアにより変圧幅
を次の電圧に設定し、再度A/D変換が実行されて、A
/D変換可能な電圧範囲にあるかいなかが判断される。
以下同様にして、A/D変換結果が得られるまで順次変
圧幅の設定を変えて、A/D変換が実行されて判断が行
われる。
When an unknown analog voltage is input, the voltage conversion width setting is set to the maximum value, and after it is judged whether or not the analog voltage input 9 is within the voltage range capable of A / D conversion, A / D The conversion is performed. The judgment at this time is evaluated by whether or not the conversion result is obtained (whether it is 00H or not),
If the conversion result is not obtained, the voltage conversion width is set to the next voltage by software, A / D conversion is executed again, and A
It is determined whether the voltage is within the voltage range capable of D / D conversion.
Similarly, the setting of the transformation width is sequentially changed until the A / D conversion result is obtained, the A / D conversion is executed, and the determination is performed.

【0028】このように従来の技術においては、変圧幅
設定及びA/D変換可能な電圧範囲にあるか否かの判断
は、全てソフトウエアに従って行われている。また、こ
こではA/D変換結果が得られるまで順次変圧幅の設定
を変えて、A/D変換が実行されるために、A/D変換
データを得るまでに多くの処理時間を要するという欠点
が生じてしまう。
As described above, in the conventional technique, the setting of the voltage transformation width and the judgment as to whether or not the voltage range is within the voltage range capable of A / D conversion are all performed according to the software. Further, here, since the setting of the transformation width is sequentially changed until the A / D conversion result is obtained and the A / D conversion is executed, it takes a lot of processing time to obtain the A / D conversion data. Will occur.

【0029】次に従来の技術において、不明なアナログ
電圧が入力された場合に、変圧幅が最大のものから順次
設定され、A/D変換を実施する時の変圧幅設定と、A
/D変換可能な電圧範囲がどの様に変化するのかを、図
4に従って説明する。
Next, in the prior art, when an unknown analog voltage is input, the maximum transformation width is sequentially set, and the transformation width setting when performing A / D conversion and A
How the voltage range capable of D / D conversion changes will be described with reference to FIG.

【0030】図4は、変圧幅設定電圧線13へ7.5
V,5V,2.5V,0Vの4種類の電圧を入力し、V
REF電圧1へ5V,VSS電圧2へ0Vを入力したと
きの例を示している。ここでは不定のアナログ電圧が入
力され、A/D変換時の変圧幅を最大値から設定し、A
/D変換の実行が行われることを示している。
FIG. 4 shows that the voltage range setting voltage line 13 is 7.5.
Input 4 kinds of voltage, V, 5V, 2.5V, 0V,
An example is shown in which 5 V is input to the REF voltage 1 and 0 V is input to the VSS voltage 2. Here, an indefinite analog voltage is input, and the width of the A / D conversion is set from the maximum value.
It indicates that the / D conversion is executed.

【0031】図のAは、変圧幅設定を最大のものに設定
した時を示した図であり、変圧幅設定が7.5V時、A
/D変換を実施するアナログ電圧値が12.5V〜7.
5Vであることを示している。この場合、入力されるア
ナログ電圧値が1V付近であると仮定すると、変圧幅が
最大(7.5V)では、A/D変換を実施すると変換デ
ータが00Hであり、変換結果が得られないため、変圧
幅の変更を行う。
A of the figure shows a case where the maximum voltage change width setting is set. When the voltage change width setting is 7.5 V, A
The analog voltage value for performing the D / D conversion is 12.5V to 7.
It shows that it is 5V. In this case, assuming that the input analog voltage value is around 1V, the conversion data is 00H when A / D conversion is performed when the conversion width is maximum (7.5V), and the conversion result cannot be obtained. , Change the width of voltage transformation.

【0032】次に変圧幅設定を、最大からその次の変圧
幅に設定した時の、様子を示したのが図のBである。変
圧幅設定が5V時、A/D変換を実施するアナログ電圧
値が10V〜5Vであることを示している。この場合、
入力されるアナログ電圧値が1V付近であり、変圧幅設
定が5Vであるので、A/D変換を実施すると変換デー
タが00Hであり、変換結果が得られないため、やはり
変圧幅の変更を行う。
Next, FIG. 6B shows the state when the transformation width is set from the maximum to the next transformation width. It shows that when the voltage width setting is 5V, the analog voltage value for performing A / D conversion is 10V to 5V. in this case,
Since the input analog voltage value is around 1V and the transformation width setting is 5V, the transformation data is 00H when A / D conversion is performed, and the transformation result cannot be obtained, so the transformation width is also changed. .

【0033】同様にして変圧幅設定を、次の変圧幅にし
たときを示したのが、図のCである。変圧幅設定が2.
5V時、A/D変換を実施するアナログ電圧値が7.5
V〜2.5Vであることを示している。この場合、入力
されるアナログ電圧値が1V付近であり、変圧幅設定が
2.5Vであるので、A/D変換を実施すると変換デー
タが00Hであり、変換結果が得られないため、やはり
変圧幅の変更を行う。
Similarly, FIG. 6C shows the case where the transformation width is set to the next transformation width. Transform width setting is 2.
At 5V, the analog voltage value for A / D conversion is 7.5
It has shown that it is V-2.5V. In this case, the input analog voltage value is around 1V and the transformation width setting is 2.5V. Therefore, if A / D conversion is performed, the conversion data will be 00H, and the conversion result cannot be obtained. Change the width.

【0034】図のDは変圧幅設定を、変圧無しに設定し
た時を示した図である。変圧幅設定が0V時、A/D変
換を実施するアナログ電圧値が5V〜0Vであることを
示している。この場合、入力されるアナログ電圧値が1
V付近であり、A/D変換を実施すると変換データに結
果が得られる。
D in the figure is a diagram showing a case in which the transformer width is set to be without transformer. It shows that when the voltage width setting is 0V, the analog voltage value for performing A / D conversion is 5V to 0V. In this case, the input analog voltage value is 1
It is near V, and when A / D conversion is performed, a result is obtained in the converted data.

【0035】このようにして、不明なアナログ電圧のA
/D変換を実施する場合、変圧幅の設定を順次変更さ
れ、その都度A/D変換を実施する必要があり、A/D
変換結果により変圧幅の変更が決定される。
In this way, the unknown analog voltage A
When performing A / D conversion, it is necessary to sequentially change the setting of the voltage conversion width and perform A / D conversion each time.
The conversion result determines the change of the conversion width.

【0036】図4に示す例では、変圧幅設定を最大のも
のから実施しているが、最小のものから実施した場合に
おいても、入力されるアナログ電圧値が不明な場合に
は、同様の処理が必要になるのは言うまでもない。
In the example shown in FIG. 4, the transformation width setting is performed from the maximum setting, but even when the setting is performed from the minimum setting, the same processing is performed when the input analog voltage value is unknown. Needless to say, is necessary.

【0037】変圧幅設定により測定されたA/D変換デ
ータは、変圧幅設定電圧が加えられて実際のアナログ電
圧値となる。よって、変圧幅設定により得られたA/D
変換データは、ソフトウエアにより変圧幅設定電圧分の
データの、補正処理が必要である。
The A / D conversion data measured by the voltage conversion width setting becomes an actual analog voltage value by applying the voltage conversion width setting voltage. Therefore, the A / D obtained by the transformation width setting
The conversion data requires correction processing of the data corresponding to the transformation width set voltage by software.

【0038】[0038]

【課題を解決するための手段】本発明は上記課題に鑑み
てなされたものであり、A/D変換ロジックに構成され
ている逐次近似レジスタにより制御される、スイッチン
グ回路により変圧幅設定を実施できる機構部と、A/D
変換電圧範囲の判断を実施する手段とを具備することに
より、ソフトウエアによる変圧幅設定を必要としないの
で、A/D変換処理に要する時間を大幅に短縮できる、
A/D変換回路を提供できる。
SUMMARY OF THE INVENTION The present invention has been made in view of the above-mentioned problems, and the switching width can be set by a switching circuit which is controlled by the successive approximation register configured in the A / D conversion logic. Mechanism part and A / D
By providing the means for determining the conversion voltage range, it is not necessary to set the conversion width by software, so that the time required for the A / D conversion processing can be greatly shortened.
An A / D conversion circuit can be provided.

【0039】更に、A/D変換実行時に逐次近似レジス
タに対して、変圧幅に応じた補正動作を行う機構部を具
備することにより、ソフトウエアによる変圧幅設定を必
要としない補正が可能な、A/D変換回路を提供するこ
とができる。
Further, by providing the mechanism for performing the correction operation according to the transformation width to the successive approximation register at the time of executing the A / D conversion, it is possible to perform the correction without setting the transformation width by software. An A / D conversion circuit can be provided.

【0040】[0040]

【発明の実施の形態】BEST MODE FOR CARRYING OUT THE INVENTION

(発明の実施の形態1)本発明によるA/D変換回路の
ブロック図を図5に示す。図5は、次に示す機構部より
構成される。
(First Embodiment of the Invention) FIG. 5 shows a block diagram of an A / D conversion circuit according to the present invention. FIG. 5 is composed of the following mechanical parts.

【0041】即ち、VREF電圧入力線1、VSS電圧
入力線2、ラダー抵抗3、スイッチツリー4、D/Aコ
ンバータブロック5、Vref電圧線6、コンパレータ
7、逐次近似レジスタ8、アナログ電圧入力線9、アナ
ログ電圧変換装置10、スイッチング回路12、変圧幅
設定電圧線13、変圧後のアナログ電圧線14、逐次近
似レジスタによるスイッチング回路の制御線15、変換
結果16より成る。以下、各機構部について説明する。
That is, VREF voltage input line 1, VSS voltage input line 2, ladder resistor 3, switch tree 4, D / A converter block 5, Vref voltage line 6, comparator 7, successive approximation register 8, analog voltage input line 9 , Analog voltage conversion device 10, switching circuit 12, transformation width setting voltage line 13, analog voltage line 14 after transformation, control line 15 of switching circuit by successive approximation register, and conversion result 16. Hereinafter, each mechanism will be described.

【0042】図6に逐次近似レジスタ8の実施例を示
す。逐次近似レジスタ8は、A/D変換ロジックにより
制御されるレジスタ部で、スイッチツリー制御信号部と
変圧幅の制御を行う変圧幅制御信号部からなる。従来の
技術では、逐次近似レジスタには、スイッチツリー部の
制御を実施する、スイッチツリー制御信号部しか存在せ
ず、本発明において変圧幅の制御を実施する、変圧幅制
御信号部を持つ逐次近似レジスタとなっている。逐次近
似レジスタは、先に説明した従来の技術での動作に加
え、本発明における変圧幅設定を逐次近似レジスタで実
施する。
FIG. 6 shows an embodiment of the successive approximation register 8. The successive approximation register 8 is a register unit controlled by the A / D conversion logic, and includes a switch tree control signal unit and a transformation width control signal unit for controlling the transformation width. In the conventional technique, the successive approximation register has only a switch tree control signal portion for controlling the switch tree portion, and a successive approximation having a transform width control signal portion for controlling the transform width in the present invention. It is a register. The successive approximation register performs the transformation width setting in the present invention by the successive approximation register in addition to the operation in the conventional technique described above.

【0043】スイッチツリー部4は、逐次近似レジスタ
8のスイッチツリー制御信号で制御されるスイッチ素子
で構成される。スイッチツリー部4は、ラダー抵抗部3
により発生する、VREF−VSS電圧間の電圧幅を抵
抗分割した、複数の電圧値からVref電圧線6へ出力
する電圧値の選択を実施する。ここでスイッチツリー部
4の実施例を図7に示す。
The switch tree unit 4 is composed of switch elements controlled by the switch tree control signal of the successive approximation register 8. The switch tree section 4 is the ladder resistance section 3
A voltage value to be output to the Vref voltage line 6 is selected from a plurality of voltage values obtained by dividing the voltage width between the VREF-VSS voltages generated by the above. An example of the switch tree unit 4 is shown in FIG.

【0044】ラダー抵抗部3は、VREF電圧とVSS
電圧の間に直列に接続される、複数の抵抗素子で構成さ
れる。VREF電圧入力線1から入力されるVREF電
圧と、VSS電圧入力線2から入力されるVSS電圧間
の電圧幅を、抵抗分割して得られる電圧がスイッチツリ
ー部へ接続されており、スイッチツリー部4により選択
された電圧がVref電圧線6を経由して、コンパレー
タ部7に出力される。更にラダー抵抗部3の実施例を図
8に示す。
The ladder resistor section 3 is connected to the VREF voltage and the VSS.
It is composed of a plurality of resistance elements connected in series between voltages. The voltage obtained by resistance division of the voltage width between the VREF voltage input from the VREF voltage input line 1 and the VSS voltage input from the VSS voltage input line 2 is connected to the switch tree unit. The voltage selected by 4 is output to the comparator unit 7 via the Vref voltage line 6. Further, an embodiment of the ladder resistance section 3 is shown in FIG.

【0045】コンパレータ部7は、アナログ電圧変換装
置10から入力されるアナログ電圧線14と、スイッチ
ツリー部4より入力される、Vref電圧線6の電圧値
の比較を実施する。A/D変換ロジックは、コンパレー
タ部7の結果により、逐次近似レジスタ8を制御する。
スイッチング回路12は、逐次近似レジスタ8の変圧幅
制御信号により制御される、スイッチ回路により構成さ
れる。スイッチング回路12により変圧幅設定電圧線1
3が選択され、アナログ電圧変換装置10に入力され、
変圧動作が実施される。ここで、図9にスイッチング回
路12の実施例を示す。
The comparator section 7 compares the voltage values of the analog voltage line 14 input from the analog voltage conversion device 10 and the Vref voltage line 6 input from the switch tree section 4. The A / D conversion logic controls the successive approximation register 8 according to the result of the comparator unit 7.
The switching circuit 12 is composed of a switch circuit which is controlled by the voltage conversion width control signal of the successive approximation register 8. Transform width setting voltage line 1 by switching circuit 12
3 is selected and input to the analog voltage converter 10,
The transformation operation is performed. Here, FIG. 9 shows an embodiment of the switching circuit 12.

【0046】アナログ電圧変換装置10は、アンプ回路
で構成される差動増幅回路で、入力されるアナログ電圧
入力線9を、変圧幅設定電圧線13より入力される、電
圧値の変圧動作を実施する。変圧動作実施後のアナログ
電圧14は、コンパレータ7へ入力され、スイッチツリ
ー部4より入力されるVref電圧線6と電圧値の比較
を実施する。また、アナログ電圧変換装置10の実施例
を図10に示す。
The analog voltage conversion device 10 is a differential amplifier circuit composed of an amplifier circuit, and carries out a voltage value transformation operation for the inputted analog voltage input line 9 through the transformation width setting voltage line 13. To do. The analog voltage 14 after the transformation operation is input to the comparator 7, and the voltage value is compared with the Vref voltage line 6 input from the switch tree unit 4. An example of the analog voltage converter 10 is shown in FIG.

【0047】図10に示すアナログ電圧変換装置10の
差動増幅回路では、抵抗値(R1,R1’,Rf)が全
て同じ値の場合、アナログ電圧EO=(アナログ電圧入
力−電圧域設定電圧)の出力電圧が得られる。
In the differential amplifier circuit of the analog voltage converter 10 shown in FIG. 10, when the resistance values (R1, R1 ', Rf) are all the same value, analog voltage EO = (analog voltage input-voltage range set voltage) The output voltage of is obtained.

【0048】更に本発明を詳述する。The present invention will be further described in detail.

【0049】従来技術では、A/D変換回路内蔵マイコ
ンの逐次近似型A/D変換回路に、アナログ電圧変圧幅
を任意に設定できるように、複数の入力端子から入力さ
れる変圧幅設定電圧を選択できる、変圧幅設定レジスタ
11とそれに対応してスイッチングする、スイッチング
回路12を備えたものであり、変圧幅の設定及び変圧幅
設定後のアナログ電圧入力が、A/D変換可能電圧範囲
にあるか判断を実施する手段が具備されたもので、全て
ハードウエアにて実施される。
In the prior art, in order to arbitrarily set the analog voltage transformer width, the transformer width setting voltage input from a plurality of input terminals can be set in the successive approximation type A / D converter circuit of the microcomputer with a built-in A / D converter circuit. It is provided with a selectable transformer width setting register 11 and a switching circuit 12 that switches correspondingly, and the setting of the transformer width and the analog voltage input after the transformer width setting are within the A / D convertible voltage range. It is provided with a means for making a judgment, and is entirely implemented by hardware.

【0050】次に本発明における、変圧幅設定動作を説
明する。
Next, the transformation width setting operation in the present invention will be described.

【0051】図11に変圧幅設定時の逐次近似レジスタ
8の動作を示す。本発明のA/D変換回路において、A
/D変換を開始するとまず、逐次近似レジスタ8の変圧
幅制御信号部において、スイッチング回路12に対して
変圧幅が一番大きくなる、変圧幅設定電圧線13が選ば
れるビットが、1に設定される。アナログ電圧変換装置
10には、変圧幅が一番大きくなる変圧幅設定電圧13
が入力され、変圧動作が実施されたアナログ電圧14
が、コンパレータ7に入力される。
FIG. 11 shows the operation of the successive approximation register 8 when the transformation width is set. In the A / D conversion circuit of the present invention, A
When the / D conversion is started, first, in the transforming width control signal portion of the successive approximation register 8, the bit for which the transforming width setting voltage line 13 having the largest transforming width with respect to the switching circuit 12 is selected is set to 1. It The analog voltage converter 10 has a transformer width setting voltage 13 that maximizes the transformer width.
Is input, and the analog voltage 14 that has been transformed
Is input to the comparator 7.

【0052】図11(1)に示すように、逐次近似レジ
スタ8のスイッチツリー制御信号部は、最下位ビットが
1に設定され、最小比較電圧をコンパレータ7に入力
し、最大の変圧幅が設定されたアナログ電圧14との比
較が実施される。
As shown in FIG. 11A, in the switch tree control signal section of the successive approximation register 8, the least significant bit is set to 1, the minimum comparison voltage is input to the comparator 7, and the maximum transformation width is set. The comparison with the analog voltage 14 carried out is carried out.

【0053】変圧幅設定後のアナログ電圧入力が、A/
D変換可能電圧範囲にある否かの判断をするために、逐
次近似レジスタのスイッチツリー制御信号部を最小値に
し、コンパレータ7において変圧後のアナログ電圧との
比較が実施され、その結果最小比較電圧6よりもアナロ
グ電圧の方が小さければ、変圧幅設定が大きすぎると判
断し、次の変圧幅へ設定を変更する。変圧幅設定が大き
すぎると判断されれば、逐次近似レジスタ8の変圧幅制
御信号部において、スイッチング回路12に対して変圧
幅が次に大きい、変圧幅設定電圧線13を選択するビッ
トが、1に設定される。
After setting the transformer width, the analog voltage input is A /
In order to determine whether or not the voltage is within the D-convertible voltage range, the switch tree control signal portion of the successive approximation register is set to the minimum value, and the comparator 7 compares the analog voltage after the transformation, and as a result, the minimum comparison voltage. If the analog voltage is smaller than 6, it is determined that the transformer width setting is too large, and the setting is changed to the next transformer width. If it is determined that the transformer width setting is too large, in the transformer width control signal portion of the successive approximation register 8, the bit that selects the transformer width setting voltage line 13 having the next largest transformer width with respect to the switching circuit 12 is 1 Is set to.

【0054】アナログ電圧変換装置10には、変圧幅が
次に大きくなる変圧幅設定電圧13が入力され、変圧動
作が実施されたアナログ電圧14が、コンパレータ7に
入力される。
The analog voltage converter 10 is supplied with a transformer width setting voltage 13 having the next largest transformer width, and the analog voltage 14 subjected to the transformer operation is input to the comparator 7.

【0055】図11(2)に示すように、逐次近似レジ
スタ8のスイッチツリー制御信号部は、最下位ビットが
1に設定され、最小比較電圧をコンパレータ7に入力
し、次の変圧幅が設定された、アナログ電圧14との比
較が実施される。その結果、比較電圧6よりもアナログ
電圧の方が小さければ、変圧幅設定が大きすぎると判断
し、次の変圧幅へ設定を変更する。
As shown in FIG. 11B, in the switch tree control signal section of the successive approximation register 8, the least significant bit is set to 1, the minimum comparison voltage is input to the comparator 7, and the next transformation width is set. The comparison with the analog voltage 14 is performed. As a result, if the analog voltage is smaller than the comparison voltage 6, it is determined that the transformer width setting is too large, and the setting is changed to the next transformer width.

【0056】以下、同様にして変圧幅設定を順次小さい
ものへ変更し、変更毎にスイッチツリー制御信号部の最
小ビットのみ、1の設定による最小比較電圧値との比較
を実施し、比較結果がアナログ電圧の方の結果が大きく
なるまで実施される(図11中に点線の矢印で示す)。
In the same manner, the transformation width setting is sequentially changed to a smaller value, and only the smallest bit of the switch tree control signal portion is compared with the smallest comparison voltage value by setting 1 for each change. It is carried out until the result of the analog voltage becomes larger (indicated by a dotted arrow in FIG. 11).

【0057】以上の変圧幅設定における比較動作で、ア
ナログ電圧の方が大きいと判断されると、逐次近似レジ
スタ8は変圧制御信号部のビットをそのまま保持し、ス
イッチツリー制御部の最上位を1に設定し、逐次比較動
作を実施する。
When it is determined that the analog voltage is larger in the comparison operation in the above-described voltage transformation width setting, the successive approximation register 8 holds the bit of the voltage transformation control signal section as it is, and the highest level of the switch tree control section is set to 1. And the successive approximation operation is performed.

【0058】次に、変圧幅設定とその設定幅に対する、
A/D変換可能なアナログ電圧範囲を示した例を、図1
2で説明する。
Next, for the transformation width setting and the setting width,
An example showing an analog voltage range that can be A / D converted is shown in FIG.
It will be explained in 2.

【0059】図12は、変圧幅設定電圧線13へ7.5
V,5V,2.5V,0Vの4種類の電圧を入力し、V
REF電圧1へ5V,VSS電圧2へ0Vを入力したと
きの例を示している。
FIG. 12 shows that the voltage range setting voltage line 13 is changed to 7.5.
Input 4 kinds of voltage, V, 5V, 2.5V, 0V,
An example is shown in which 5 V is input to the REF voltage 1 and 0 V is input to the VSS voltage 2.

【0060】図12のAに示す電圧範囲は、変圧幅設定
電圧線13から最大の変圧幅を持った電圧値(7.5
V)を選択した場合のA/D変換可能なアナログ電圧入
力9の電圧幅を示したもので、12.5V〜7.5Vの
範囲でA/D変換結果が得られることを示している。
The voltage range indicated by A in FIG. 12 is a voltage value (7.5) having the maximum voltage range from the voltage range setting voltage line 13.
This shows the voltage width of the analog voltage input 9 capable of A / D conversion when V) is selected, and shows that the A / D conversion result can be obtained in the range of 12.5V to 7.5V.

【0061】Aに示す変圧幅設定後、スイッチツリー制
御信号部の最小ビットのみ、1の設定による最小比較電
圧値との比較により、変圧後のアナログ電圧がこの範囲
にあるか否かの判断を実施し、アナログ電圧の方が大き
いと判断されれば、変圧後のアナログ電圧がこの範囲に
あると判断して、スイッチツリー制御信号部による逐次
比較動作を実施する。アナログ電圧の方が小さいと判断
されると、変圧幅の変更を実施する。
After setting the transformation width shown in A, only the minimum bit of the switch tree control signal portion is compared with the minimum comparison voltage value by setting 1 to judge whether or not the transformed analog voltage is within this range. If it is determined that the analog voltage is higher, the analog voltage after transformation is determined to be within this range, and the successive comparison operation by the switch tree control signal unit is performed. If it is determined that the analog voltage is smaller, the transformation width is changed.

【0062】Bに示す電圧範囲は、上記電圧範囲Aにお
いてアナログ電圧の方が小さいと判断される、次の変圧
幅に設定した時の電圧範囲を示したものである。変圧幅
設定電圧線13から5Vの電圧値に変更し、A/D変換
可能なアナログ電圧入力9の電圧幅を示したもので、1
0V〜5Vの範囲でA/D変換結果が得られることを示
している。
The voltage range indicated by B shows the voltage range in which the analog voltage is judged to be smaller in the voltage range A and when the next transformation width is set. The voltage width of the analog voltage input 9 that can be A / D converted by changing the voltage value from the voltage setting width line 13 to 5 V is shown as 1
It shows that the A / D conversion result can be obtained in the range of 0V to 5V.

【0063】Bに示す変圧幅変更後は、上記Aの設定時
と同様に、変圧後のアナログ電圧がこの範囲にあるか否
かの判断を実施し、アナログ電圧の方が大きいと判断さ
れれば、変圧後のアナログ電圧がこの範囲にあると判断
して、スイッチツリー制御信号部による逐次比較動作を
実施する。アナログ電圧の方が小さいと判断されると、
変圧幅の変更を実施する。
After the transformation width shown in B is changed, it is determined whether or not the transformed analog voltage is within this range as in the case of setting A above, and it is determined that the analog voltage is larger. For example, it is determined that the analog voltage after transformation is in this range, and the successive comparison operation by the switch tree control signal unit is performed. If it is determined that the analog voltage is smaller,
Change the transformation width.

【0064】Cに示す電圧範囲は、上記電圧範囲A及び
Bにおいて、アナログ電圧の方が小さいと判断され、次
の変圧幅に設定した時の電圧範囲を示したものである。
変圧幅設定電圧線13から2.5Vの電圧値に変更し、
A/D変換可能なアナログ電圧入力9の電圧幅を示した
もので、7.5V〜2.5Vの範囲でA/D変換結果が
得られることを示している。
The voltage range indicated by C indicates the voltage range when the analog voltage is judged to be smaller in the voltage ranges A and B and the next voltage transformation range is set.
Change the voltage value from the voltage range setting voltage line 13 to 2.5V,
It shows the voltage width of the analog voltage input 9 capable of A / D conversion, and shows that the A / D conversion result can be obtained in the range of 7.5V to 2.5V.

【0065】Cに示す変圧幅変更後は、上記A及びBの
設定時と同様に、変圧後のアナログ電圧がこの範囲にあ
るか否かの判断を実施し、アナログ電圧の方が大きいと
判断されれば、変圧後のアナログ電圧がこの範囲にある
と判断して、スイッチツリー制御信号部による逐次比較
動作を実施する。アナログ電圧の方が小さいと判断され
ると、変圧幅の変更を実施する。
After the transformation width shown in C is changed, it is determined whether or not the transformed analog voltage is within this range as in the case of setting A and B, and it is determined that the analog voltage is larger. If so, the analog voltage after transformation is determined to be in this range, and the successive comparison operation by the switch tree control signal unit is performed. If it is determined that the analog voltage is smaller, the transformation width is changed.

【0066】Dに示す電圧範囲は、上記電圧範囲A,B
及びCにおいて、アナログ電圧の方が小さいと判断さ
れ、変圧幅設定電圧線13から変圧幅設定を実施しない
場合に、(このとき変圧幅設定電圧線13から0Vの電
圧値を選択)A/D変換可能なアナログ電圧入力9の電
圧幅を示したもので、5V〜0Vの範囲でA/D変換結
果が得られることを示している。
The voltage range indicated by D is the above voltage range A, B.
In C and C, when the analog voltage is determined to be smaller and the voltage width setting voltage line 13 is not used for voltage conversion width setting (at this time, the voltage value of 0V is selected from the voltage conversion width setting voltage line 13) A / D It shows the voltage width of the analog voltage input 9 that can be converted, and shows that the A / D conversion result can be obtained in the range of 5V to 0V.

【0067】上記A,B,Cに示す変圧幅変更により入
力される、アナログ電圧はこのDの範囲にあると判断さ
れ、スイッチツリー制御信号部の最小ビットのみ、1の
設定による最小比較電圧値との比較を実施する必要が無
く、変圧幅変更後に即時に逐次近似レジスタ8のスイッ
チツリー制御部による逐次比較動作を実施する。
It is determined that the analog voltage input by changing the transformation width shown in A, B, and C is in the range of D, and only the minimum bit of the switch tree control signal portion has the minimum comparison voltage value set to 1. It is not necessary to perform the comparison with the above, and the successive approximation operation by the switch tree control unit of the successive approximation register 8 is immediately performed after the change of the transformation width.

【0068】このように図12では、4種類の変圧幅設
定を例にあげて説明している。
As described above, in FIG. 12, four types of transformation width settings are described as an example.

【0069】A/D変換するアナログ電圧値を、A/D
変換が可能な領域に設定する変圧幅設定は、逐次近似レ
ジスタ8の変圧幅制御信号部により、変圧幅設定電圧線
13が選択され、変圧後のアナログ電圧がスイッチツリ
ー制御信号部の最小ビットのみ、1の設定による最小比
較電圧値との比較により、A/D変換実行可能な領域電
圧間(VREF〜VSS)の範囲にあるか否かの判断
が、実施される。
The analog voltage value to be A / D converted is A / D
For the transformation width setting in the conversion possible area, the transformation width setting voltage line 13 is selected by the transformation width control signal section of the successive approximation register 8, and the analog voltage after transformation is only the minimum bit of the switch tree control signal section. By the comparison with the minimum comparison voltage value set by 1, the judgment is made as to whether or not it is in the range between the region voltages (VREF to VSS) in which the A / D conversion can be performed.

【0070】次に、本発明により解決しようとする問題
点について説明する。
Next, problems to be solved by the present invention will be described.

【0071】従来の技術においては、不明なアナログ電
圧が入力される場合、先に説明したようにソフトウエア
によるデータ処理を行う必要があるため、A/D変換デ
ータを得るのに多くの処理時間を要する欠点があった。
In the prior art, when an unknown analog voltage is input, it is necessary to perform data processing by software as described above, so that it takes a lot of processing time to obtain A / D converted data. There was a drawback that required.

【0072】これに対して図13において、本発明にお
ける不明なアナログ電圧の入力があった場合のA/D変
換の流れ図を示して説明する。
On the other hand, referring to FIG. 13, a flow chart of A / D conversion when an unknown analog voltage is input according to the present invention will be shown and described.

【0073】本発明では従来の技術とは異なり、変圧幅
設定及び変圧後のアナログ電圧が、A/D変換実行可能
な電圧範囲に設定されているか否かの判断は、ハードウ
エアにより実施される。
In the present invention, unlike the prior art, the setting of the voltage transformation width and the determination of whether or not the analog voltage after the voltage transformation is set within the voltage range in which the A / D conversion can be executed are performed by hardware. .

【0074】本発明では、不明なアナログ電圧値が入力
される場合、変圧幅設定が最大のものから行われ、アナ
ログ電圧入力がA/D変換可能な電圧範囲に設定されて
いるか否かの判断を、コンパレータにおいて最小電圧値
01Hとの比較により実施するため、従来の技術のよう
に変圧幅設定後、逐次比較動作を実施する必要が無い。
In the present invention, when an unknown analog voltage value is input, the setting of the transformation width is performed from the maximum value, and it is judged whether or not the analog voltage input is set in the voltage range in which A / D conversion is possible. Is performed by comparison with the minimum voltage value 01H in the comparator, there is no need to perform the successive approximation operation after setting the transformation width as in the conventional technique.

【0075】また、変圧幅の設定後、変圧後のアナログ
電圧が、A/D変換実行可能な電圧範囲に設定されてい
ないと判断されると、変圧幅が変更されて再度A/D変
換可能な電圧範囲に設定されているか否かの判断を実施
し、変圧後のアナログ電圧が、A/D変換実行可能な電
圧範囲に設定されていると判断されてから、逐次比較動
作が実施される。
Further, if it is determined that the analog voltage after the transformation is not set within the voltage range in which the A / D conversion can be performed after the transformation width is set, the transformation width is changed and the A / D conversion can be performed again. It is determined whether the analog voltage after transformation is set to a voltage range in which A / D conversion can be performed, and then the successive approximation operation is performed. .

【0076】従って、不明なアナログ入力があった場
合、本発明では従来の技術の様に、ソフトウエアによる
判断及び処理が必要でない、変圧幅設定機能を備えた装
置となっている。また、従来の技術においては、変圧幅
設定後に逐次比較動作を実施するため、変換動作に多く
の時間を要するという欠点があったが、本発明では変圧
幅設定時にコンパレータにより、最小データ01Hとの
比較を行うだけで判断するため、従来よりもはるかに少
ない処理時間で、変圧幅を決定できる。
Therefore, when there is an unknown analog input, the present invention is a device having a transformation width setting function, which does not require judgment and processing by software as in the prior art. Further, in the conventional technique, since the successive approximation operation is performed after setting the transformation width, there is a drawback that it takes a lot of time for the conversion operation, but in the present invention, the minimum data 01H is set by the comparator when the transformation width is set. Since the judgment is made only by making the comparison, the transformation width can be determined in a processing time much shorter than the conventional one.

【0077】次に図14において、本発明での入力アナ
ログ電圧値が不明な場合の変圧幅設定と、A/D変換可
能なアナログ電圧範囲を示した例を示す。
Next, FIG. 14 shows an example showing the voltage conversion width setting and the analog voltage range that can be A / D converted in the present invention when the input analog voltage value is unknown.

【0078】図14は、変圧幅設定電圧線13へ7.5
V,5V,2.5V,0Vの4種類の電圧を入力し、V
REF電圧1へ5V,VSS電圧2へ0Vを入力したと
きの例を示している。
FIG. 14 shows that the voltage range setting voltage line 13 is changed to 7.5.
Input 4 kinds of voltage, V, 5V, 2.5V, 0V,
An example is shown in which 5 V is input to the REF voltage 1 and 0 V is input to the VSS voltage 2.

【0079】Aは、変圧幅設定を最大のものにした場合
を示す図であり、変圧幅設定が7.5VのときA/D変
換を実施するアナログ電圧が12.5V〜7.5Vであ
ることを示している。ここで入力されるアナログ電圧値
が、1V付近であると仮定すると、変圧幅が最大(7.
5V)であるので、最小の比較電圧値との比較が行わ
れ、アナログ電圧値の方が小さいと判断されて、変圧レ
ベルの設定を変更することになる。
A is a diagram showing a case where the voltage conversion width is set to the maximum value, and the analog voltage for performing the A / D conversion is 12.5V to 7.5V when the voltage conversion width is set to 7.5V. It is shown that. Assuming that the analog voltage value input here is in the vicinity of 1 V, the voltage conversion width is maximum (7.
5V), the comparison with the minimum comparison voltage value is performed, it is determined that the analog voltage value is smaller, and the setting of the transformation level is changed.

【0080】Bは、上記Aの次に変圧幅設定を1レベル
下げた時の、電圧値を示したものである。変圧幅設定が
5Vの時、A/D変換を実施するアナログ電圧値が、1
0V〜5Vであることを示している。ここで入力される
アナログ電圧値が、1V付近であると仮定すると、変圧
幅が5Vの時には、最小のVref電圧値との比較が行
われ、Vref電圧値の方が大きいと判断されて、変圧
レベルの設定を変更することになる。
B shows the voltage value when the voltage conversion width setting is lowered by one level after the above A. When the voltage width setting is 5V, the analog voltage value for A / D conversion is 1
It shows that it is 0V to 5V. Assuming that the analog voltage value input here is around 1V, when the transformation width is 5V, a comparison with the minimum Vref voltage value is performed, and it is determined that the Vref voltage value is larger, The level setting will be changed.

【0081】Cは、同様にして変圧幅設定を、次のレベ
ルのものにした場合を示す。変圧幅設定が2.5Vの時
には、A/D変換を実施するアナログ電圧値が、7.5
V〜2.5Vであることを示している。ここで入力され
るアナログ電圧値が、1V付近であると仮定すると、変
圧幅が2.5Vの時には、最小のVref電圧値との比
較が行われ、Vref電圧値の方が大きいと判断され
て、変圧レベルの設定を変更することになる。
C shows the case where the voltage conversion width setting is similarly set to the next level. When the voltage width setting is 2.5V, the analog voltage value for A / D conversion is 7.5.
It has shown that it is V-2.5V. Assuming that the analog voltage value input here is around 1 V, when the transformation width is 2.5 V, a comparison with the minimum Vref voltage value is performed, and it is determined that the Vref voltage value is larger. , The transformation level setting will be changed.

【0082】Dは、変圧幅設定を変圧無しのものにした
場合を示す図である。変圧幅設定が0Vの時には、A/
D変換を実施するアナログ電圧値が、5V〜0Vである
ことを示している。ここで入力されるアナログ電圧値
が、1V付近であると仮定すると、ここまでの変圧幅設
定の過程から、アナログ電圧の入力はこの範囲にあると
判断されて、A/D変換が実施されて変換結果が得られ
る。
D is a diagram showing a case in which the transformation width is set to one without transformation. When the transformer width setting is 0V, A /
It shows that the analog voltage value for performing D conversion is 5V to 0V. Assuming that the analog voltage value input here is around 1 V, the analog voltage input is judged to be in this range from the process of setting the voltage conversion width, and A / D conversion is performed. The conversion result is obtained.

【0083】このようにして、不明な電圧値のA/D変
換を実施する場合、変圧幅の設定を順次変更し、最小V
ref電圧値と比較し、Vref電圧値の方が大きいと
判断されると、変圧レベルの設定を変更するため、従来
の技術の様に変圧幅設定後にA/D変換を実施する必要
が無く、処理時間を大幅に短縮できる。更に、変圧幅設
定からA/D変換実施までは、A/D変換制御ロジック
により動作するため、全くソフトウエアを介さずに処理
が実施される。
In this way, when carrying out A / D conversion of an unknown voltage value, the setting of the transformation width is sequentially changed to obtain the minimum V
When it is determined that the Vref voltage value is larger than the ref voltage value, the setting of the transformation level is changed, so there is no need to perform A / D conversion after setting the transformation width as in the conventional technique. Processing time can be greatly reduced. Further, from the setting of the transformation width to the execution of the A / D conversion, since the operation is performed by the A / D conversion control logic, the processing is executed without any software.

【0084】本発明において、変圧幅設定後の逐次近似
レジスタ部の、スイッチツリー制御信号部による、逐次
比較動作を説明する。逐次比較動作は、変圧幅設定動作
において変圧幅が変更されてから、A/D変換可能な電
圧範囲に設定されているか否かの判断を行い、変圧後の
アナログ電圧が、A/D変換実行可能な電圧範囲に設定
されているか否かの判断を行ってから、実施される。
In the present invention, the successive approximation operation by the switch tree control signal unit of the successive approximation register unit after setting the transformation width will be described. In the successive approximation operation, after the transformation width is changed in the transformation width setting operation, it is judged whether or not the voltage range is set so that the A / D conversion is possible, and the analog voltage after the transformation is A / D conversion executed. It is executed after determining whether the voltage is set within the possible voltage range.

【0085】ここで図15に、逐次近似レジスタ8の動
作を示す。
FIG. 15 shows the operation of the successive approximation register 8.

【0086】変圧幅設定後、逐次近似レジスタ8のスイ
ッチツリー制御信号の、最上位ビットに1が設定され
る。この逐次近似レジスタ8の値に従って、ラダー抵抗
3、スイッチツリー4より構成されるD/Aコンバータ
5から、VREF電圧入力線1より入力されるVREF
電圧と、VSS電圧入力線2より入力されるVSS電圧
との間の電圧幅を、抵抗分割して得られる比較電圧が、
Vref電圧線6を経由してコンパレータ7に出力され
る。
After the transformation width is set, 1 is set in the most significant bit of the switch tree control signal of the successive approximation register 8. According to the value of the successive approximation register 8, the VREF input from the VREF voltage input line 1 from the D / A converter 5 including the ladder resistor 3 and the switch tree 4.
The comparison voltage obtained by resistance-dividing the voltage width between the voltage and the VSS voltage input from the VSS voltage input line 2 is
It is output to the comparator 7 via the Vref voltage line 6.

【0087】コンパレータ7は、この比較電圧とアナロ
グ電圧入力線から入力される、アナログ電圧との比較を
行い、アナログ電圧の方が小さければ、逐次近似レジス
タ8のスイッチツリー制御信号の、最上位ビットに0が
設定され、アナログ電圧の方が大きければ、1のままと
なる。そして次のビットに1を設定し、この逐次近似レ
ジスタ8の値により得られる比較電圧と、アナログ電圧
との比較を行い、その結果を逐次近似レジスタ8に設定
し、次のビットを1に設定する。
The comparator 7 compares the comparison voltage with the analog voltage input from the analog voltage input line. If the analog voltage is smaller, the most significant bit of the switch tree control signal of the successive approximation register 8 is compared. Is set to 0, and remains 1 when the analog voltage is larger. Then, the next bit is set to 1, the comparison voltage obtained by the value of the successive approximation register 8 is compared with the analog voltage, the result is set to the successive approximation register 8, and the next bit is set to 1. To do.

【0088】以下同様にしてこの動作を繰り返し、最下
位ビット迄実行してA/D変換を終了する。この時の逐
次近似レジスタ8の、スイッチツリー制御信号の値が、
変圧幅を持つA/D変換結果となる。よって実際のA/
D変換結果は、逐次近似レジスタのスイッチツリー制御
部のデータに、変圧幅設定部の電圧値の補正を実施した
値となる。
This operation is repeated in the same manner, and the A / D conversion is completed by executing the operation up to the least significant bit. At this time, the value of the switch tree control signal of the successive approximation register 8 is
The result is an A / D conversion result having a transformation width. Therefore, the actual A /
The D conversion result is a value obtained by correcting the voltage value of the transformation width setting unit on the data of the switch tree control unit of the successive approximation register.

【0089】(発明の実施の形態2)さて次に、本発明
の実施の形態で述べたことに加えて、変圧幅によって決
定された電圧値に基づいて、A/D変換値に対して補正
を実施した、変圧幅データ補正回路の例を図16に示
す。図16は次に示す機能部より構成される。
(Embodiment 2 of the Invention) Next, in addition to what has been described in the embodiment of the present invention, the A / D converted value is corrected on the basis of the voltage value determined by the transformation width. FIG. 16 shows an example of a transformation width data correction circuit that implements the above. FIG. 16 is composed of the following functional parts.

【0090】1〜16は図5の構成と同一の符号は同
じ、もしくは相当部分を示す。
Reference numerals 1 to 16 are the same as or similar to those in the configuration of FIG.

【0091】17はセレクト回路、18は変圧幅デー
タ、19は加算回路である。
Reference numeral 17 is a select circuit, 18 is transformation width data, and 19 is an addition circuit.

【0092】これらの動作を説明すると、まずセレクト
回路17は、スイッチング回路12と同様に、変圧幅設
定動作時に逐次近似レジスタ8の、変圧幅制御信号部か
ら出力される信号により、変圧幅データ18の選択を行
う。この場合の変圧幅設定動作及びA/D変換動作は、
既に本実施の形態で述べたとうりであるので、詳しい説
明は省略する。
Explaining these operations, first, like the switching circuit 12, the selection circuit 17 uses the signal output from the voltage conversion width control signal section of the successive approximation register 8 during the voltage conversion width setting operation to output the voltage conversion width data 18. Make a selection. In this case, the conversion width setting operation and the A / D conversion operation are
Since it is already described in the present embodiment, detailed description will be omitted.

【0093】このようにしてA/D変換を実施した後の
結果は、加算回路19により変圧幅データの補正が実施
される。即ち、逐次近似レジスタ8の、スイッチツリー
制御信号部のデータに対して、セレクト回路17により
選択された変圧幅データ18で補正され、A/D変換結
果16が得られる。
After the A / D conversion is performed in this manner, the adder circuit 19 corrects the transformation width data. That is, the data of the switch tree control signal portion of the successive approximation register 8 is corrected by the transformation width data 18 selected by the selection circuit 17, and the A / D conversion result 16 is obtained.

【0094】よって、A/D変換を実施した後に、ソフ
トウエアによる電圧値の計算処理の実施が必要でない、
A/D変換回路を提供できる。
Therefore, it is not necessary to carry out the calculation processing of the voltage value by the software after the A / D conversion is carried out.
An A / D conversion circuit can be provided.

【0095】さて、図16に示す本発明の実施の形態で
は、変圧幅設定電圧を規定せずに処理が開始されるた
め、変圧値の補正を行う為の変圧幅データが必要とな
り、予めこのデータを用意しておく必要がある。この時
に変圧幅設定電圧として、予め決まったものを使用する
ならば、わざわざこのデータを設定する必要が無く、加
算データを既に持っている加算回路にて構成できる。
In the embodiment of the present invention shown in FIG. 16, since the process is started without defining the voltage range setting voltage, the voltage range data for correcting the voltage value is required. It is necessary to prepare the data. At this time, if a predetermined voltage is used as the transformation width setting voltage, it is not necessary to set this data, and the addition circuit can already be configured with the addition data.

【0096】また変圧幅設定電圧が、VREF電圧の倍
数の設定であるならば、加算回路は不要となり、変圧幅
制御信号部データと、スイッチツリー制御信号部のビッ
トデータとの和が、そのままA/D変換結果として得ら
れる。
If the voltage transform width setting is a multiple of the VREF voltage, the adder circuit is not required, and the sum of the voltage transform width control signal portion data and the bit data of the switch tree control signal portion is A It is obtained as a / D conversion result.

【0097】[0097]

【発明の効果】本発明によればA/D変換において、ア
ナログ電圧の変圧幅設定を、A/D変換ロジックに構成
されるハードウエアによって、実施される。従来の技術
においては変圧幅設定時に、A/D変換可能な電圧範囲
に入っているか否かの判断は、ソフトウエアによってス
テップ毎に、A/D変換動作を行う必要があった。これ
に対して本発明では、変圧幅設定時に、A/D変換可能
な電圧範囲に入っているか否かの判断は、コンパレータ
の比較電圧(Vref電圧)を最小(01H)とし、変
圧後のアナログ電圧と比較することにより実施される
為、従来よりも判断に要する処理時間を大幅に短縮し
た、A/D変換回路を提供できる。
According to the present invention, in the A / D conversion, the conversion width of the analog voltage is set by the hardware configured in the A / D conversion logic. In the conventional technique, when setting the voltage conversion width, it is necessary to perform the A / D conversion operation for each step by software to determine whether or not the voltage range is within the A / D conversion possible voltage range. On the other hand, according to the present invention, when the voltage conversion width is set, the comparison voltage (Vref voltage) of the comparator is set to the minimum (01H) to determine whether or not the voltage is within the voltage range in which A / D conversion can be performed. Since it is performed by comparing with the voltage, it is possible to provide an A / D conversion circuit in which the processing time required for the judgment is significantly shortened as compared with the related art.

【0098】更にA/D変換ロジックに構成される、変
圧幅データ補正回路により、変圧幅の補正を実施できる
A/D変換回路を提供できる。
Furthermore, an A / D conversion circuit capable of correcting the voltage conversion width can be provided by the voltage conversion width data correction circuit configured in the A / D conversion logic.

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

【図1】従来の技術における構成の例を示す図である。FIG. 1 is a diagram showing an example of a configuration in a conventional technique.

【図2】従来の技術におけるアナログ電圧の変圧幅設定
と、A/D変換可能な電圧範囲を示す例を示す図であ
る。
FIG. 2 is a diagram showing an example of setting a voltage conversion width of an analog voltage and a voltage range in which A / D conversion can be performed in a conventional technique.

【図3】従来の技術におけるアナログ電圧の変圧幅設定
と、A/D変換実施を示す流れ図の例を示す図である。
FIG. 3 is a diagram showing an example of a flow chart showing analog voltage transformation width setting and A / D conversion implementation in the prior art.

【図4】従来の技術において、不明なアナログ電圧の入
力があった場合の、変圧幅設定とA/D変換可能な電圧
範囲を示す図である。
FIG. 4 is a diagram showing a voltage conversion range setting and a voltage range in which A / D conversion can be performed when an unknown analog voltage is input in the conventional technique.

【図5】本発明における変圧幅設定機能を持った場合の
例を示す図である。
FIG. 5 is a diagram showing an example of a case where the present invention has a transformation width setting function.

【図6】本発明での逐次近似レジスタ8の実施例を示す
図である。
FIG. 6 is a diagram showing an embodiment of a successive approximation register 8 according to the present invention.

【図7】スイッチング回路12の実施例を示す図であ
る。
FIG. 7 is a diagram showing an example of a switching circuit 12.

【図8】ラダー抵抗3の実施例を示す図である。FIG. 8 is a diagram showing an example of a ladder resistor 3;

【図9】スイッチング回路12の他の実施例を示す図で
ある。
9 is a diagram showing another embodiment of the switching circuit 12. FIG.

【図10】アナログ電圧変圧装置10の実施例を示す図
である。
10 is a diagram showing an embodiment of the analog voltage transformer 10. FIG.

【図11】本発明における逐次近似レジスタの動作を示
す図である。
FIG. 11 is a diagram showing an operation of a successive approximation register according to the present invention.

【図12】本発明におけるアナログ電圧の変圧幅設定
と、A/D変換可能な電圧範囲を示す例を示す図であ
る。
FIG. 12 is a diagram showing an example showing an analog voltage transformation width setting and an A / D convertible voltage range in the present invention.

【図13】本発明におけるアナログ電圧入力時の変圧幅
設定動作と、逐次比較動作とを示す流れ図である。
FIG. 13 is a flowchart showing a transformation width setting operation and a successive approximation operation when an analog voltage is input according to the present invention.

【図14】本発明における、不明なアナログ電圧の入力
があった場合の変圧幅設定と、A/D変換可能な電圧範
囲を示す図である。
FIG. 14 is a diagram showing a voltage conversion width setting and an A / D convertible voltage range when an unknown analog voltage is input according to the present invention.

【図15】本発明における逐次比較動作を示す図であ
る。
FIG. 15 is a diagram showing a successive approximation operation in the present invention.

【図16】本発明におけるA/D変換結果を、変圧幅デ
ータによって補正する場合を示す図である。
FIG. 16 is a diagram showing a case where the A / D conversion result according to the present invention is corrected by transforming width data.

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

1 VREF電圧入力線 2 VSS電圧入力線 3 ラダー抵抗 4 スイッチツリー 5 D/Aコンバータブロック 6 Vref電圧線 7 コンパレータ 8 逐次近似レジスタ 9 アナログ電圧入力線 10 アナログ電圧変換装置 11 変圧幅設定レジスタ 12 スイッチング回路 13 変圧幅設定電圧線 14 変圧後のアナログ電圧線 15 逐次近似レジスタによるスイッチング回路の制御
線 16 変換結果 17 セレクト回路 18 変圧幅データ 19 加算回路
1 VREF voltage input line 2 VSS voltage input line 3 ladder resistance 4 switch tree 5 D / A converter block 6 Vref voltage line 7 comparator 8 successive approximation register 9 analog voltage input line 10 analog voltage conversion device 11 voltage width setting register 12 switching circuit 13 Transform width setting voltage line 14 Analog voltage line after transform 15 Control line of switching circuit by successive approximation register 16 Conversion result 17 Select circuit 18 Transform width data 19 Adder circuit

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 アナログ電圧をデジタル信号に変換する
に際して、該アナログ電圧の変圧幅を、逐次自律的に動
作するレジスタ手段によって、変更するように成したA
/D変換回路。
1. When converting an analog voltage into a digital signal, the width of transformation of the analog voltage is changed by a register means that sequentially operates autonomously.
/ D conversion circuit.
【請求項2】 ワンチップマイクロコンピュータに内蔵
され、該ワンチップマイクロコンピュータのプログラム
とは、独立して動作する構成である、請求項1記載のA
/D変換回路。
2. The A according to claim 1, which is built in the one-chip microcomputer and operates independently of a program of the one-chip microcomputer.
/ D conversion circuit.
【請求項3】 該アナログ電圧の変圧幅は、変圧幅制御
データを有する該レジスタ手段によって設定される、請
求項1記載のA/D変換回路。
3. The A / D conversion circuit according to claim 1, wherein the transformation width of the analog voltage is set by the register means having transformation width control data.
JP8071704A 1996-03-27 1996-03-27 Analog/digital conversion circuit Pending JPH09261061A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8071704A JPH09261061A (en) 1996-03-27 1996-03-27 Analog/digital conversion circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8071704A JPH09261061A (en) 1996-03-27 1996-03-27 Analog/digital conversion circuit

Publications (1)

Publication Number Publication Date
JPH09261061A true JPH09261061A (en) 1997-10-03

Family

ID=13468204

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8071704A Pending JPH09261061A (en) 1996-03-27 1996-03-27 Analog/digital conversion circuit

Country Status (1)

Country Link
JP (1) JPH09261061A (en)

Similar Documents

Publication Publication Date Title
US7663520B2 (en) A/D conversion apparatus
CN110708045B (en) Waveform phase-shifting control circuit, method and timer
JP3819986B2 (en) Analog / digital converter control method
CN104702138A (en) PWM waveform correcting method in detection of direct bus current by single resistor
US5936564A (en) Digital to analog converter using pulse width modulation and the controlling method thereof
CN111628769B (en) Digital-to-analog converter device and correction method
JPH09258902A (en) Connected analog-digital and digital-analog conversion system
JPH09261061A (en) Analog/digital conversion circuit
JPS59128806A (en) Agc circuit
JPH05152960A (en) A/d converter
US6525573B1 (en) Signal processing architecture
EP1102404A2 (en) Analog-to-digital converter, microcomputer, and analog-to-digital conversion method
JP2002261610A (en) A/d converter
JPH07203672A (en) Power supply employing pwm control system
JPS59226514A (en) A-d converter
US6731230B1 (en) Method to smooth transitions in an ADC for current regulation
JP3645044B2 (en) Microcomputer
JPH04313918A (en) A/d converter
JPH0612502A (en) Microcomputer with built-in a/d conversion circuit
JP2002199742A (en) Pwm current control inductive load driver and its load current detecting method
US5610605A (en) Analog/digital converting circuit
JPH01250127A (en) Data input method
JPH04255116A (en) Analog/digital conversion circuit
JP2976447B2 (en) D / A converter
JP2021004843A (en) Angle detection circuit