JPH077422A - A-D conversion method - Google Patents

A-D conversion method

Info

Publication number
JPH077422A
JPH077422A JP14466493A JP14466493A JPH077422A JP H077422 A JPH077422 A JP H077422A JP 14466493 A JP14466493 A JP 14466493A JP 14466493 A JP14466493 A JP 14466493A JP H077422 A JPH077422 A JP H077422A
Authority
JP
Japan
Prior art keywords
conversion
dedicated
chip microcomputer
circuit
processing device
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
JP14466493A
Other languages
Japanese (ja)
Inventor
Tsuneo Sato
恒夫 佐藤
Kazuyasu Kitazawa
和保 北沢
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.)
PFU Ltd
Original Assignee
PFU Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by PFU Ltd filed Critical PFU Ltd
Priority to JP14466493A priority Critical patent/JPH077422A/en
Publication of JPH077422A publication Critical patent/JPH077422A/en
Pending legal-status Critical Current

Links

Landscapes

  • Analogue/Digital Conversion (AREA)

Abstract

(57)【要約】 【目的】本発明はA−D変換部を搭載して制御を行う1
チップマイコンにおけるA−D変換方式に関し,一定範
囲の電圧で動作可能なA−D変換部を備える1チップマ
イコンの動作電圧が低くてA−D変換精度が要求される
場合にも高精度のA−D変換値を得ることができると共
に無駄な電力を消費しないことを目的とする。 【構成】1チップマイコンの外部に内部のA−D変換部
より高精度のA−D変換を行う専用A−D変換回路を設
け,要求指示により内部のA−D変換部を駆動するか外
部の専用A−D変換回路を駆動させるかを要求判別手段
により選択する。内部のA−D変換部を駆動する時は外
部の専用A−D変換回路を停止し,外部の専用A−D変
換回路を駆動する時は内部のA−D変換部を停止させ,
外部の専用A−D変換回路を駆動した場合,A−D変換
値の読み取り指示を発生してA−D変換値を読み取るよ
う構成する。
(57) [Abstract] [Purpose] The present invention is equipped with an A / D converter to perform control.
Regarding the A / D conversion method in the chip microcomputer, even if the A-D conversion accuracy is required because the operation voltage of the one-chip microcomputer provided with the A-D conversion unit that can operate at a certain range of voltage is low, the high accuracy A The purpose is to be able to obtain a -D conversion value and not to waste power. [Structure] A dedicated A / D conversion circuit for performing highly accurate A / D conversion from an internal A / D conversion unit is provided outside the one-chip microcomputer, and the internal A / D conversion unit is driven according to a request instruction. The request discriminating means selects whether to drive the dedicated A-D conversion circuit. When driving the internal A-D conversion unit, the external dedicated A-D conversion circuit is stopped, when driving the external dedicated A-D conversion circuit, the internal A-D conversion unit is stopped,
When an external dedicated A-D conversion circuit is driven, an A-D converted value reading instruction is generated to read the A-D converted value.

Description

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

【産業上の利用分野】本発明はA−D変換機能を備えた
1チップマイコンを用いたA−D変換方式に関し,特に
内部と外部にA−D変換機能を備え幅広い動作電圧に対
してA−D変換の精度を向上することができるA−D変
換方式に関する。動作電圧が高い状態で使用する1チッ
プマイコンでは,A−D変換値の精度は高くなるが,逆
に動作電圧が低い状態で使用する1チップマイコンはA
−D変換精度が悪くなる。そのため,A−D変換機能を
備えた1チップマイコンを種々の装置に使用する場合
に,動作電圧が低くてもA−D変換精度を高くすると共
に省電力化することが要求されている。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an A-D conversion system using a one-chip microcomputer having an A-D conversion function, and more particularly, it has an A-D conversion function internally and externally and has a wide operating voltage range. The present invention relates to an AD conversion method capable of improving the accuracy of D conversion. A one-chip microcomputer used at a high operating voltage has a high accuracy of AD conversion value, but on the contrary, a one-chip microcomputer used at a low operating voltage is at A
-D conversion accuracy deteriorates. Therefore, when a one-chip microcomputer having an A-D conversion function is used in various devices, it is required to improve the A-D conversion accuracy and save power even if the operating voltage is low.

【従来の技術】図8は従来のA−D変換部の構成図であ
る。動作を説明すると,バス80を介してA−D変換レ
ジスタ81に対しチャネル選択指示やA−D変換動作の
開始や終了を制御するデータが入力される。チャネル選
択指示のデータは,チャネルセレクタ82に与えられA
−D変換の対象となるアナログ信号が入力する8つのA
−Dポート#1乃至#8の一つを選択する。選択された
A−Dポートのアナログ信号はコンパレータ83で抵抗
ラダー86の出力と比較され,A−D制御回路84の制
御によりA−D変換レジスタ85,抵抗ラダー86を切
替えることにより実行され,A−D変換値はA−D変換
レジスタ85にセットされる。このようなA−D変換部
のA−D変換用の電圧としてVREF がコンパレータ83
に供給され,このVREF に対応したA−D変換動作が行
われる。一方,携帯型パソコン等の電子機器には充電可
能なバッテリ(二次電池)が搭載されており,このよう
なバッテリはAC電源により発生した直流電源により充
電動作が行われる(電子機器を使用しながら行うことも
できる)。この充電動作は,バッテリが満充電になった
ことを検出すると終了する。そのためにバッテリの充電
中にバッテリの電圧をA−D変換により検出して充電制
御を行う必要がある。図9は二次電池(例えば,ニッカ
ド電池)の充電特性を示す図であり,縦軸が電圧
(V),横軸が時間を表し,充電を開始して図のように
バッテリの電圧が上昇する。満充電の検出方法として,
図に示すようにピークを過ぎて−ΔVだけ降下すると満
充電検出をする方法がある。この−ΔVは,微弱な電圧
(例えば,電池1セル当たり20ミリボルト)である。
図10はバッテリの充電状態を検出して制御を行うため
のブロック構成である。図中,90はバッテリ,91は
電圧のレベルシフトを行うオペアンプ,92はA−D変
換部93を内蔵し,RAM,ROM,CPUを含む1チ
ップマイコン(マイクロコンピュータ)である。図10
の動作は,バッテリ90には図示されない充電用電源が
印加されることにより充電が行われ,バッテリ90の電
圧は充電制御を行う1チップマイコン92のA−D変換
部93へ入力する。この場合,バッテリ90の電圧は1
チップマイコン92の動作電圧(2.5V〜5.5V)
よりかなり高い電圧のため,オペアンプ91によりレベ
ルシフトされて,1チップマイコン92へ供給される。
一方,従来の技術として,LSIの内部にA−D変換部
を設け,その外部に高精度(高価格)のA−D変換部を
設けて,2つのA−D変換部を常に動作させて,2つの
A−D変換値の両方をLSIで取り込んだ上で切り換え
により一方の変換値を使用する方法がある(特開平4−
196720号公報参照)。
2. Description of the Related Art FIG. 8 is a block diagram of a conventional AD converter. To explain the operation, a channel selection instruction and data for controlling the start and end of the AD conversion operation are input to the AD conversion register 81 via the bus 80. The data of the channel selection instruction is given to the channel selector 82 A
Eight A input analog signals to be converted
Select one of D ports # 1 to # 8. The analog signal of the selected A-D port is compared with the output of the resistance ladder 86 by the comparator 83 and executed by switching the A-D conversion register 85 and the resistance ladder 86 under the control of the A-D control circuit 84. The −D conversion value is set in the AD conversion register 85. As a voltage for A / D conversion of such an A / D converter, V REF is a comparator 83.
And the A-D conversion operation corresponding to this V REF is performed. On the other hand, a rechargeable battery (secondary battery) is installed in an electronic device such as a portable personal computer, and such a battery is charged by a DC power source generated by an AC power source (using the electronic device You can also do it while). This charging operation ends when it is detected that the battery is fully charged. Therefore, it is necessary to detect the voltage of the battery by A-D conversion during charging of the battery to control charging. FIG. 9 is a diagram showing the charging characteristics of a secondary battery (for example, a NiCd battery), where the vertical axis represents voltage (V) and the horizontal axis represents time. When charging is started, the battery voltage rises as shown in the figure. To do. As a method of detecting full charge,
As shown in the figure, there is a method of detecting full charge when the peak is passed and -ΔV is dropped. This −ΔV is a weak voltage (for example, 20 millivolts per battery cell).
FIG. 10 is a block configuration for detecting the state of charge of the battery and performing control. In the figure, 90 is a battery, 91 is an operational amplifier for performing voltage level shifting, and 92 is a one-chip microcomputer (microcomputer) including an A / D converter 93 and including a RAM, a ROM and a CPU. Figure 10
In this operation, charging is performed by applying a charging power source (not shown) to the battery 90, and the voltage of the battery 90 is input to the AD converter 93 of the one-chip microcomputer 92 that controls charging. In this case, the voltage of the battery 90 is 1
Operating voltage of the chip microcomputer 92 (2.5V to 5.5V)
Since the voltage is considerably higher, it is level-shifted by the operational amplifier 91 and supplied to the one-chip microcomputer 92.
On the other hand, as a conventional technique, an A-D converter is provided inside the LSI, and a high-precision (high-priced) A-D converter is provided outside the LSI so that the two A-D converters are always operated. , There is a method in which both of the two A-D converted values are fetched by the LSI and then one of the converted values is used by switching (Japanese Patent Laid-Open No. Hei.
196720).

【発明が解決しようとする課題】上記のようにA−D変
換部93を備える1チップマイコン92は2.5V〜
5.5Vまで動作可能であるが,A−D変換用電圧(V
REF )も動作電圧に対して変化する。このため,マイコ
ンが2.5Vで動作しなければならない場合(電子機器
の情報処理用のマイクロプロセッサが2.5V用の場合
等)には,その内部のA−D変換部のA−D変換用電圧
(VREF )も2.5Vに抑えられてしまう。図11は問
題点の説明図である。図に示すようにバッテリの充電電
圧値の幅0Vから18Vの場合,図10に示す構成にお
いて,オペアンプ91により9V以下をカットし,増幅
率を制御して1チップマイコン92のA−D変換部93
に入力している。この時,1チップマイコン92の動作
電圧が高い場合(例えば5.5V)は,A−D変換部9
3は5.5Vで動作(VREF が5.5V)し,1チップ
マイコン92の動作電圧が低い場合(例えば,2.5
V)はA−D変換部93は2.5Vで動作(VREF
2.5V)するので,オペアンプ91の増幅率は前者
(5.5Vに対応)の場合0.6(5.5V÷9V)
で,後者の場合0.27(2.5V÷9V)となるた
め,変換精度は動作電圧が高い場合に比べて低い場合は
半分以下になる。そして,1チップマイコン92の電源
は,この1チップマイコンを搭載する電子機器の電源の
関係から5.5Vを使用する場合もあるが,2.5Vの
場合にも同じ構成により対応する必要があり,2.5V
の電源を使用すると低精度のA−D変換値に基づいて動
作することになる。なお,A−D変換部にだけ1チップ
マイコンと異なる電源を供給して高精度の動作をするよ
うにすると,回路が複雑化すると共に電源の変化に対し
共通使用できないという問題がある。したがって,A−
D変換部が低いA−D変換用電圧(VREF )を使用し
て,上記図10に示すようなバッテリ充電時の満充電を
−ΔV検出により行うと,正常に満充電を検出すること
ができない可能性があり,その場合バッテリが過充電と
なって劣化する可能性がある。一方,上記従来の特開平
4−196720号公報の技術では,内部のA−D変換
値と外部のA−D変換値を同時に動作させて,切り換え
により一方を使用しているが,両方のA−D変換回路を
常時動作させているので消費電力が大きくなり,A−D
変換部を含むLSIを搭載する装置がバッテリで動作す
る場合,バッテリの動作時間を短くするという問題があ
る。本発明は一定範囲の電圧で動作可能なA−D変換部
を備える1チップマイコンで,A−D変換用電圧が低く
てA−D変換精度が要求される場合にも高精度のA−D
変換値を得ることができると共に無駄な電力を消費しな
いA−D変換方式を提供することを目的とする。
As described above, the one-chip microcomputer 92 provided with the A / D converter 93 has a voltage of 2.5 V or higher.
It can operate up to 5.5V, but the voltage for AD conversion (V
REF ) also changes with the operating voltage. For this reason, when the microcomputer has to operate at 2.5V (when the microprocessor for information processing of the electronic device is for 2.5V, etc.), the A-D conversion of the internal A-D converter is performed. The working voltage (V REF ) is also suppressed to 2.5V. FIG. 11 is an explanatory diagram of a problem. As shown in the figure, in the case where the range of the charging voltage value of the battery is 0V to 18V, in the configuration shown in FIG. 10, the operational amplifier 91 cuts 9V or less and controls the amplification factor to control the A-D converter of the one-chip microcomputer 92. 93
Are typing in. At this time, if the operating voltage of the one-chip microcomputer 92 is high (for example, 5.5 V), the AD converter 9
3 operates at 5.5 V (V REF is 5.5 V) and the operating voltage of the one-chip microcomputer 92 is low (for example, 2.5 V).
V), the A-D converter 93 operates at 2.5 V (V REF is 2.5 V), so the amplification factor of the operational amplifier 91 is 0.6 (5.5 V ÷ in the former case (corresponding to 5.5 V)). 9V)
In the latter case, the conversion accuracy is 0.27 (2.5V ÷ 9V), so that the conversion accuracy is half or less when the operating voltage is low compared to when the operating voltage is high. The power supply of the 1-chip microcomputer 92 may be 5.5V in consideration of the power supply of the electronic device in which the 1-chip microcomputer is mounted, but it is also necessary to support the same configuration for 2.5V. , 2.5V
When the power supply of 1 is used, it operates based on the low precision AD conversion value. If a power supply different from the one-chip microcomputer is supplied only to the A-D conversion unit to perform highly accurate operation, the circuit becomes complicated and it cannot be used in common even when the power supply changes. Therefore, A-
When the D conversion unit uses the low A-D conversion voltage (V REF ) to perform full charge during battery charging as shown in FIG. 10 by detecting -ΔV, the full charge can be normally detected. It may not be possible, in which case the battery may be overcharged and deteriorated. On the other hand, in the technique of the above-mentioned conventional Japanese Patent Laid-Open No. 4-196720, the internal AD conversion value and the external AD conversion value are simultaneously operated and one of them is used by switching, but both A Since the -D conversion circuit is always operating, power consumption increases, and
When a device including an LSI including a conversion unit operates on a battery, there is a problem that the operating time of the battery is shortened. The present invention is a one-chip microcomputer provided with an A-D conversion unit that can operate at a voltage in a certain range, and has a high precision A-D even when the A-D conversion voltage is low and A-D conversion accuracy is required.
It is an object of the present invention to provide an A-D conversion method that can obtain a conversion value and does not consume unnecessary power.

【課題を解決するための手段】図1は本発明の原理構成
図である。図1において,1は一定の電圧幅で動作する
1チップマイコン等の処理装置,2は処理装置1に備え
られ処理装置で使用する電源をA−D変換用電源として
動作するA−D変換部,3は外部に設けられた専用A−
D変換回路,4は処理装置1と専用A−D変換回路3の
間に設けられた信号線である。また,処理装置1におい
て,10は要求判別手段,11はA−D変換部駆動手
段,12は専用A−D変換回路駆動手段,13は内部A
−D変換値読み取り手段,14は専用A−D変換値読み
取り手段,15は読み取られた値を保持する保持手段で
ある。本発明は処理装置の外部に高いA−D変換用電圧
により高精度で動作する専用A−D変換回路を設け,処
理装置はアナログ信号のA−D変換値を,内部に備えら
れたA−D変換部を駆動して得るか外部の専用A−D変
換回路を駆動して得るか制御し,使用しない方のA−D
変換の機構は停止させるものである。
FIG. 1 is a block diagram showing the principle of the present invention. In FIG. 1, 1 is a processing device such as a one-chip microcomputer that operates with a constant voltage width, and 2 is an A-D conversion unit that is provided in the processing device 1 and that operates as a power supply for A-D conversion. , 3 are external dedicated A-
The D conversion circuit, 4 is a signal line provided between the processing device 1 and the dedicated A-D conversion circuit 3. Further, in the processing device 1, 10 is a request discriminating means, 11 is an AD converting section driving means, 12 is a dedicated AD converting circuit driving means, and 13 is an internal A.
The -D converted value reading means, 14 is a dedicated AD converted value reading means, and 15 is a holding means for holding the read value. According to the present invention, a dedicated A-D conversion circuit that operates with high accuracy by a high A-D conversion voltage is provided outside the processing device, and the processing device has an A-D conversion value of an analog signal provided inside thereof. A-D which is not used by controlling whether it is obtained by driving the D conversion unit or by driving an external dedicated A-D conversion circuit
The conversion mechanism stops.

【作用】図1において処理装置1には,A−D変換に高
精度が要求されている(処理装置の動作電圧が低い)
か,通常の精度(処理装置1の動作電圧が高い)でよい
かの何れかの要求指示が入力されている。処理装置1内
でA−D変換の動作周期毎に要求判別手段10が駆動さ
れると,要求指示を判別して選択動作を行う。すなわ
ち,高精度が指示されていると,専用A−D変換回路駆
動手段12を起動し,通常の精度(または低精度)が指
示されているとA−D変換部駆動手段11を起動する。
専用A−D変換回路駆動手段12が起動すると,信号線
4を介して専用A−D変換回路3を駆動する。専用A−
D変換回路3は入力するアナログ信号をA−D変換動作
し,A−D変換値を発生する。処理装置1では専用A−
D変換回路3が動作した後専用A−D変換値読み取り手
段14が駆動される。これにより読み取り指示信号が信
号線4を介して出力され,専用A−D変換回路3がこれ
を受け取るとその時のA−D変換値を信号線4を介して
処理装置1へ送出する。このA−D変換値は処理装置1
の保持手段15に保持されて,処理装置1における制御
に使用される。また,専用A−D変換回路駆動手段12
が起動するとA−D変換部2が駆動される。A−D変換
部2は入力するアナログ信号のA−D変換を行い,この
後内部A−D変換値読み取り手段13が駆動されるとA
−D変換部2で発生したA−D変換値を読み取り,読み
取られた値は保持手段15に保持される。この動作は一
定周期毎に実行され,処理装置1の電源の電圧値または
必要とする精度に応じて,内部のA−D変換部2と外部
の専用A−D変換回路3の中の一方だけが駆動され,駆
動されない他方はA−D変換動作をせず停止状態に維持
される。
In FIG. 1, the processing apparatus 1 is required to have high accuracy in AD conversion (the operating voltage of the processing apparatus is low).
A request instruction of either normal accuracy (the operating voltage of the processing device 1 is high) is sufficient. When the request determination means 10 is driven in each processing cycle of the A / D conversion in the processing device 1, the request instruction is determined and the selection operation is performed. That is, when high precision is instructed, the dedicated A-D conversion circuit drive means 12 is activated, and when normal precision (or low precision) is instructed, the A-D conversion section drive means 11 is activated.
When the dedicated A / D conversion circuit driving means 12 is activated, the dedicated A / D conversion circuit 3 is driven via the signal line 4. Dedicated A-
The D conversion circuit 3 performs an AD conversion operation on the input analog signal to generate an AD conversion value. Dedicated A-
After the D conversion circuit 3 operates, the dedicated AD conversion value reading means 14 is driven. As a result, the read instruction signal is output via the signal line 4, and when the dedicated A / D conversion circuit 3 receives this, the A / D conversion value at that time is sent to the processing device 1 via the signal line 4. This A-D converted value is the processing device 1
It is held by the holding means 15 and used for control in the processing apparatus 1. In addition, the dedicated A-D conversion circuit driving means 12
When is activated, the AD converter 2 is driven. The A / D conversion unit 2 performs A / D conversion of the input analog signal, and thereafter, when the internal A / D conversion value reading means 13 is driven, A / D conversion is performed.
The AD conversion value generated in the -D conversion unit 2 is read, and the read value is held in the holding unit 15. This operation is executed at regular intervals, and depending on the voltage value of the power supply of the processing device 1 or the required accuracy, only one of the internal A / D conversion unit 2 and the external dedicated A / D conversion circuit 3 is used. Is driven, and the other that is not driven is maintained in a stopped state without performing AD conversion operation.

【実施例】図2は実施例の構成図である。図2におい
て,20は1チップマイコン(図1の処理装置1に対
応),21はデータ転送制御部,22はA−D変換部,
23は専用A−D変換回路(図1の3に対応),24は
データ転送制御部,25はA−D変換部,26はデータ
制御線,27はバッテリ,28はレベルシフト部,29
はACアダプタ,30はDC−DCコンバータ,31は
バッテリ27またはACアダプタからの電源により動作
を行うパソコン等のシステム回路である。システム回路
31はAC電源に接続できる場合,AC電源がACアダ
プタ29で直流電圧に変換され,DC−DCコンバータ
30において電圧変換され,システム回路31に供給さ
れる。AC電源に接続されない場合,バッテリ27から
DC−DCコンバータ30を介して給電される。一方,
バッテリ27はAC電源が供給されていると,DC−D
Cコンバータ30から充電電圧が供給されて充電を実行
され,その充電電圧(アナログ値)を1チップマイコン
20のA−D変換部22または専用A−D変換回路23
のA−D変換部25で検出する。1チップマイコンの動
作の動作電圧が高い場合は,バッテリ27の充電電圧を
レベルシフト部28でレベルシフトした電圧を1チップ
マイコン20内のA−D変換部22で検出する。一方,
動作電圧が低い場合は,専用A−D変換回路23のA−
D変換部25で検出する。図3は1チップマイコンの処
理フローである。この処理フローは一定周期で起動し,
繰り返し動作を行う。最初にA−D変換に高精度が必要
か(または1チップマイコンの電源が低いか)の判断を
行う(図3のS1)。高精度が必要ない場合は,内部の
A−D変換部(図2の22)にクロックを供給してこれ
を起動し(図3のS2),内部A−D変換ポートを選択
する(同S3)。続いて,内部A−D変換部の動作がス
タートし(同S4),内部A−D変換動作中となり(同
S5)。続いて,内部A−D変換部の変換値をリードし
て変換値をメモリに記憶する(同S6)。次に内部A−
D変換部への動作を停止させる(同S7)。上記S1に
おいて,高精度が必要な場合(または1チップマイコン
の電源が高い場合),外部A−D変換部(図2の25)
へのクロック供給を開始する(図3のS8)。これによ
り外部A−D変換部が起動する。次に外部A−D変換部
のA−D変換ポート(複数の変換ポートがあるものとす
る)の中から特定のポート(充電電圧が入力するポー
ト)を選択し(同S9),A−D変換がスタートする
(同S10)。続いて変換動作中の状態になると(同S
11),外部A−D変換部の変換値をリードさせてメモ
リに記憶し(同S12),その後外部A−D変換部への
クロック供給を停止する(同S13)。図4はデータ制
御線とデータ転送の説明図である。図4のA.はデータ
制御線(図2の26)の構成を示し,B.はコマンドデ
ータとリードデータと各信号の波形を示す。データ制御
線は,1チップマイコン20のデータ転送制御部21と
専用A−D変換回路23のデータ制御部24の間に設け
られ,aは専用A−D変換回路の動作を制御するための
コマンドを送信するA−D制御コマンドデータの線であ
り,B.のに示すようにシリアルに8ビットのデータ
として送られる。A.のbはシリアルクロックの線であ
り,B.のに示す波形のクロック信号がに示すA−
D制御コマンドデータの各ビットに同期して送られ,専
用A−D変換回路でA−D制御コマンドデータを受信す
るのに利用される。A.のcはシリアルデータラッチの
線であり,B.のに示すような波形であり,A−D制
御コマンドが転送終了した時に1チップマイコンから専
用A−D変換回路に対して1パルス転送され,コマンド
データをラッチするのに使用する。A.のdはA−D変
換値リードデータの線であり,専用A−D変換回路のA
−D変換部(図2の25)で得られたA−D変換値を1
チップマイコンへシリアルに転送する線である。このA
−D変換値リードデータはB.のに示すように8ビッ
トで構成され,リードデータはB.のに示すように1
チップマイコンからのシリアルクロックに同期して転送
される。A.のeはA−D変換用クロックの線であり,
このクロックが専用A−D変換回路に送出されることに
より専用A−D変換回路内のA−D変換部(図2の2
5)が駆動されて,A−D変換動作を起動し,A−D変
換用クロックが供給されないと専用A−D変換回路のA
−D変換動作は停止状態のままである。図5はA−D変
換値リードの説明図,図6はコマンド及び変換値の構成
例を示す。専用A−D変換回路のA−D変換値を読み出
したい場合,1チップマイコン側から図4のA.のA−
D制御コマンドデータ線a上に図5のに示すようにA
−D変換スタート(図5のA)のコマンドが送られ,続
いてA−Dリード用ダミーデータ(図5のB)が送られ
る。A−D変換スタートのコマンドは,図6のAに構成
例を示すように,MSB(最上位ビット)にA−D変換
スタートを指示するビットが立ち,続く3ビットはA−
Dポートのセレクトを指定し,下位の4ビットは全て
“0”であり,これによりA−D変換スタートのコマン
ドコードを表示する。図5のBのA−Dリード(A−D
変換値リードの略)用ダミーデータは,図6のBに構成
例を示すように,先頭の4ビットはダミーデータが設定
され,後の4ビットはA−Dリード用ダミーデータを表
すコードが設定される。このデータは,A−D変換値の
読み取り時に1チップマイコンから送出され,このデー
タと並行して同時にA−D変換値のリードが行われる。
図6のCは,図5のに示すA−D変換値のリードデー
タでありAD0〜AD7の8ビットで構成する。図7は
A−D変換テーブル設定手順を示す図である。A−D変
換値は,上記図10,11に示すように1チップマイコ
ンの動作電圧によってA−D変換値が変わる。例を挙げ
て説明すると,1チップマイコンの動作電圧が5Vでア
ナログ入力電圧が1Vの場合,A−D変換値は,1チッ
プマイコンの分解能×0.2となる。一方,1チップマ
イコンの動作電圧が4Vで,アナログ入力電圧が1Vの
場合A−D変換値は,1チップマイコンの分解能×0.
25となる。このように,1チップマイコンの動作電圧
が変化すると,A−D変換値も変わってくるので,1チ
ップマイコンの動作電圧に対応して出力すべきA−D変
換値を変更する必要がある。そのため,A−D変換部内
にA−D変換値を発生するために設けられたA−D変換
テーブルを動作電圧に対応して設定する必要があり,A
−D変換テーブルへの設定動作はシステム回路(図2の
31)から行われる。図7に示すように,A−D変換テ
ーブルにデータを設定する場合,最初にA−D変換テー
ブル設定コマンド(図7のa)を転送し,そのコマンド
を受けることにより1チップマイコンは,変換テーブル
設定の準備を行い,次に複数個のA−D変換ポートがあ
るものとして,その中のどのA−D変換ポート用の変換
テーブルかを指定するA−Dポート選択コード(同b)
が送られ,特定のA−D変換ポートの変換テーブルが選
択される。次にA−D変換基準比較データ(同c)が転
送され,A−D変換値の標準となる値に対応する基準比
較値を表すデータが転送され,各基準比較データが順次
転送され,最後にA−D変換テーブル終了コード(同
d)が転送される。これらを受け取った1チップマイコ
ンは順次対応するA−D変換ポートのA−D変換テーブ
ルに設定を行う。
FIG. 2 is a block diagram of an embodiment. In FIG. 2, 20 is a one-chip microcomputer (corresponding to the processing device 1 of FIG. 1), 21 is a data transfer control unit, 22 is an A-D conversion unit,
23 is a dedicated A-D conversion circuit (corresponding to 3 in FIG. 1), 24 is a data transfer control unit, 25 is an A-D conversion unit, 26 is a data control line, 27 is a battery, 28 is a level shift unit, 29
Is an AC adapter, 30 is a DC-DC converter, and 31 is a system circuit of a personal computer or the like that operates by the power supply from the battery 27 or the AC adapter. When the system circuit 31 can be connected to an AC power source, the AC power source is converted into a DC voltage by the AC adapter 29, converted into a voltage by the DC-DC converter 30, and supplied to the system circuit 31. When not connected to the AC power source, power is supplied from the battery 27 via the DC-DC converter 30. on the other hand,
When the AC power is supplied to the battery 27, DC-D
The charging voltage is supplied from the C converter 30 to perform charging, and the charging voltage (analog value) is changed to the A / D conversion unit 22 of the one-chip microcomputer 20 or the dedicated A / D conversion circuit 23.
This is detected by the A-D converter 25. When the operating voltage of the operation of the one-chip microcomputer is high, the voltage obtained by level-shifting the charging voltage of the battery 27 by the level shift unit 28 is detected by the AD converter 22 in the one-chip microcomputer 20. on the other hand,
When the operating voltage is low, A- of the dedicated AD conversion circuit 23
The D conversion unit 25 detects this. FIG. 3 is a processing flow of the one-chip microcomputer. This processing flow starts at a fixed cycle,
Repeated operation. First, it is judged whether high accuracy is required for A-D conversion (or whether the power supply of the one-chip microcomputer is low) (S1 in FIG. 3). If high accuracy is not required, a clock is supplied to the internal A / D conversion unit (22 in FIG. 2) to activate it (S2 in FIG. 3) and the internal A / D conversion port is selected (S3 in the same figure). ). Then, the operation of the internal A-D conversion unit starts (at step S4), and the internal A-D conversion operation starts (at step S5). Then, the conversion value of the internal AD conversion unit is read and the conversion value is stored in the memory (at step S6). Then inside A-
The operation to the D converter is stopped (at step S7). In S1 above, when high accuracy is required (or when the power supply of the one-chip microcomputer is high), the external AD converter (25 in FIG. 2)
To start supplying clocks to (S8 in FIG. 3). This activates the external A / D converter. Next, a specific port (port to which the charging voltage is input) is selected from the A-D conversion ports (assuming that there are a plurality of conversion ports) of the external A-D conversion unit (at step S9), and A-D is selected. Conversion starts (at step S10). Then, when the conversion operation is in progress (see S
11), the conversion value of the external A-D converter is read and stored in the memory (at step S12), and then the clock supply to the external A-D converter is stopped (at step S13). FIG. 4 is an explanatory diagram of data control lines and data transfer. A. of FIG. Shows the structure of the data control line (26 in FIG. 2), and B. Shows the waveform of command data, read data, and each signal. The data control line is provided between the data transfer control unit 21 of the one-chip microcomputer 20 and the data control unit 24 of the dedicated A / D conversion circuit 23, and a is a command for controlling the operation of the dedicated A / D conversion circuit. Is a line of A-D control command data for transmitting B. The data is sent serially as 8-bit data, as shown in. A. B is a serial clock line, and B. The clock signal with the waveform shown in
It is sent in synchronization with each bit of the D control command data, and is used by the dedicated A / D conversion circuit to receive the A / D control command data. A. C is a line of the serial data latch, and B. The waveform is as shown in (1), and when the A-D control command is transferred, one pulse is transferred from the one-chip microcomputer to the dedicated A-D conversion circuit and used to latch the command data. A. D is a line of A / D conversion value read data, and is a line of the dedicated A / D conversion circuit.
The A-D conversion value obtained by the -D conversion unit (25 in FIG. 2) is set to 1
It is a line that transfers serially to the chip microcomputer. This A
The D-converted value read data is B. As shown in, the read data consists of 8 bits. As shown in 1
It is transferred in synchronization with the serial clock from the chip microcomputer. A. E is the line of the clock for AD conversion,
This clock is sent to the dedicated A / D conversion circuit, so that the A / D conversion unit (2 in FIG. 2) in the dedicated A / D conversion circuit.
5) is driven to start the A-D conversion operation, and if the A-D conversion clock is not supplied, A of the dedicated A-D conversion circuit is
The -D conversion operation remains stopped. FIG. 5 is an explanatory view of the A-D conversion value read, and FIG. 6 shows a configuration example of the command and the conversion value. When it is desired to read the A / D converted value of the dedicated A / D conversion circuit, the A.D. A-
D control command on the data line a as shown in FIG.
A -D conversion start (A in Fig. 5) command is sent, and subsequently, A-D read dummy data (B in Fig. 5) is sent. In the A / D conversion start command, as shown in the configuration example in A of FIG. 6, a bit indicating the start of A / D conversion is set in MSB (most significant bit), and the following 3 bits are A-
The D port select is designated, and the lower 4 bits are all "0", whereby the A-D conversion start command code is displayed. FIG. 5B A-D lead (A-D
As for the dummy data for abbreviation of conversion value), as shown in the configuration example in FIG. 6B, the leading 4 bits are set to the dummy data, and the subsequent 4 bits are a code representing the dummy data for AD reading. Is set. This data is sent from the one-chip microcomputer at the time of reading the A-D converted value, and the A-D converted value is simultaneously read in parallel with this data.
C in FIG. 6 is read data of the A-D converted value shown in FIG. 5, and is composed of 8 bits AD0 to AD7. FIG. 7 is a diagram showing an A-D conversion table setting procedure. As shown in FIGS. 10 and 11, the A / D converted value changes depending on the operating voltage of the one-chip microcomputer. Explaining with an example, when the operating voltage of the one-chip microcomputer is 5V and the analog input voltage is 1V, the AD conversion value is the resolution of the one-chip microcomputer × 0.2. On the other hand, when the operating voltage of the 1-chip microcomputer is 4V and the analog input voltage is 1V, the AD conversion value is the resolution of the 1-chip microcomputer x.
25. In this way, when the operating voltage of the one-chip microcomputer changes, the A-D converted value also changes, so it is necessary to change the A-D converted value to be output corresponding to the operating voltage of the one-chip microcomputer. Therefore, it is necessary to set the A-D conversion table provided in the A-D conversion unit to generate the A-D converted value in correspondence with the operating voltage.
The setting operation for the -D conversion table is performed from the system circuit (31 in FIG. 2). As shown in FIG. 7, when setting data in the AD conversion table, the A-D conversion table setting command (a in FIG. 7) is first transferred, and the 1-chip microcomputer converts by receiving the command. The table setting is prepared, and assuming that there are a plurality of A / D conversion ports, an A / D port selection code (the same b) that specifies which of the A / D conversion ports the conversion table is for
Is sent, and the conversion table of a specific A / D conversion port is selected. Next, the A-D conversion reference comparison data (same as c) is transferred, the data representing the reference comparison value corresponding to the standard value of the A-D conversion value is transferred, each reference comparison data is transferred sequentially, and finally The A-D conversion table end code (same as d) is transferred to. The one-chip microcomputer that receives them sequentially sets the A-D conversion table of the corresponding A-D conversion port.

【発明の効果】本発明によれば動作電圧が一定範囲内で
動作可能で,A−D変換機能をもった1チップマイコン
において動作電圧が低くA−D変換精度が悪い場合は,
外部のA−D変換回路を切替えてA−D変換を行い,A
−D変換精度を高めることができる。更に1チップマイ
コン内のA−D変換部か外部のA−D変換回路の一方を
使用した時,他方は停止させて低消費電力化が実現でき
る。
According to the present invention, when the operating voltage can be operated within a certain range and the operating voltage is low and the AD converting accuracy is poor in the one-chip microcomputer having the AD converting function,
A-D conversion is performed by switching the external A-D conversion circuit.
-D conversion accuracy can be improved. Further, when one of the A / D conversion unit in the one-chip microcomputer or the external A / D conversion circuit is used, the other is stopped to realize low power consumption.

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

【図1】本発明の原理構成図である。FIG. 1 is a principle configuration diagram of the present invention.

【図2】実施例の構成図である。FIG. 2 is a configuration diagram of an embodiment.

【図3】1チップマイコンの処理フローである。FIG. 3 is a processing flow of a one-chip microcomputer.

【図4】データ制御線とデータ転送の説明図である。FIG. 4 is an explanatory diagram of data control lines and data transfer.

【図5】A−D変換値リードの説明図である。FIG. 5 is an explanatory diagram of AD conversion value read.

【図6】コマンド及び変換値の構成例を示す図である。FIG. 6 is a diagram showing a configuration example of a command and a conversion value.

【図7】A−D変換テーブル設定手順を示す図である。FIG. 7 is a diagram showing an AD conversion table setting procedure.

【図8】従来のA−D変換部の構成図である。FIG. 8 is a configuration diagram of a conventional AD conversion unit.

【図9】二次電池(例えば,ニッカド電池)の充電特性
の例を示す図である。
FIG. 9 is a diagram showing an example of charging characteristics of a secondary battery (for example, a NiCd battery).

【図10】バッテリの充電状態を検出して制御を行うた
めのブロック構成である。
FIG. 10 is a block configuration for detecting and controlling a state of charge of a battery.

【図11】問題点の説明図である。FIG. 11 is an explanatory diagram of a problem.

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

1 処理装置 10 要求判別手段 11 A−D変換部駆動手段 12 専用A−D変換回路駆動手段 13 内部A−D変換値読み取り手段 14 専用A−D変換値読み取り手段 15 保持手段 2 A−D変換部 3 専用A−D変換回路 4 信号線 DESCRIPTION OF SYMBOLS 1 Processing device 10 Request determination means 11 A-D conversion part drive means 12 Dedicated A-D conversion circuit drive means 13 Internal A-D conversion value reading means 14 Dedicated A-D conversion value reading means 15 Holding means 2 A-D conversion Part 3 Dedicated A-D conversion circuit 4 Signal line

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 A−D変換部を内部に備え動作電圧が一
定範囲で動作可能な処理装置におけるA−D変換方式に
おいて, 高精度の専用A−D変換回路を処理装置の外部に設け, 前記処理装置に,A−D変換の精度として高精度が要求
されているか否かを判別して,内部のA−D変換部を起
動するか,前記外部の専用A−D変換回路を起動する要
求判別手段を備え, 前記要求判別手段により対応する内部のA−D変換部ま
たは外部の専用A−D変換回路の一方が駆動されると,
駆動されない他方の回路は停止状態を維持することを特
徴とするA−D変換方式。
1. In an A-D conversion method in a processing device having an A-D conversion unit inside and capable of operating in a fixed range of operating voltage, a highly accurate dedicated A-D conversion circuit is provided outside the processing device. It is determined whether or not high precision is required for the A / D conversion in the processing device, and the internal A / D conversion unit is activated, or the external dedicated A / D conversion circuit is activated. A request discriminating means is provided, and when one of the corresponding internal AD converting section or external dedicated AD converting circuit is driven by the request discriminating means,
The other circuit which is not driven maintains the stopped state, which is an A-D conversion method.
【請求項2】 請求項1において, 前記処理装置と前記外部の専用A−D変換回路との間に
少なくともA−D変換の動作を制御するA−D変換用ク
ロック線と,A−D変換値データを転送するデータ線,
指令を転送するためのコマンドデータ線を設け, 前記処理装置から前記A−D変換用クロック線へのクロ
ックの送出または停止により前記外部の専用A−D変換
回路を駆動または停止させることを特徴とするA−D変
換方式。
2. The A / D conversion clock line for controlling at least an A / D conversion operation between the processing device and the external dedicated A / D conversion circuit, and the A / D conversion according to claim 1. Data line for transferring value data,
A command data line for transferring a command is provided, and the external dedicated A-D conversion circuit is driven or stopped by sending or stopping a clock from the processing device to the A-D conversion clock line. A-D conversion method.
【請求項3】 請求項1または2において, 前記処理装置の内部のA−D変換部にA−D変換値発生
の基準となるデータを保持するA−D変換テーブルを設
け, 該A−D変換テーブルを外部からコマンドを含むデータ
を設定することにより動作電圧の変化に対応して高精度
のA−D変換値を発生させることを特徴とするA−D変
換方式。
3. The A / D conversion table for holding data serving as a reference for generating an A / D conversion value is provided in the A / D conversion unit inside the processing device according to claim 1 or 2, An A-D conversion method, wherein highly accurate A-D conversion values are generated in response to changes in operating voltage by externally setting data including a command in a conversion table.
JP14466493A 1993-06-16 1993-06-16 A-D conversion method Pending JPH077422A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP14466493A JPH077422A (en) 1993-06-16 1993-06-16 A-D conversion method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP14466493A JPH077422A (en) 1993-06-16 1993-06-16 A-D conversion method

Publications (1)

Publication Number Publication Date
JPH077422A true JPH077422A (en) 1995-01-10

Family

ID=15367361

Family Applications (1)

Application Number Title Priority Date Filing Date
JP14466493A Pending JPH077422A (en) 1993-06-16 1993-06-16 A-D conversion method

Country Status (1)

Country Link
JP (1) JPH077422A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010134830A (en) * 2008-12-08 2010-06-17 Omron Corp Programmable controller, cpu unit, analog input unit, and analog output unit
JP2013529293A (en) * 2010-04-16 2013-07-18 エルジー・ケム・リミテッド Voltage management method and system for analog to digital conversion

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010134830A (en) * 2008-12-08 2010-06-17 Omron Corp Programmable controller, cpu unit, analog input unit, and analog output unit
JP2013529293A (en) * 2010-04-16 2013-07-18 エルジー・ケム・リミテッド Voltage management method and system for analog to digital conversion

Similar Documents

Publication Publication Date Title
US4454500A (en) Analog data acquisition device
EP0813706A1 (en) Microcontroller with analog front-end for providing intelligent battery management
KR910006824A (en) Intelligent power systems for portable computers
US6414466B1 (en) Device, method and computer readable recording medium for indicating charge information of a battery
JPH077422A (en) A-D conversion method
JP3342261B2 (en) Electronics
US5034674A (en) Motor driving voltage control device
KR100630964B1 (en) Adapters and electronics using them
JPH0819184A (en) Power supply device and method of displaying completion of installation
JPS63128266A (en) Substrate voltage measuring system
EP1102404A2 (en) Analog-to-digital converter, microcomputer, and analog-to-digital conversion method
JP2003169476A (en) Electronic equipment to which a power supply adapter can be connected
JPH06237542A (en) Battery backup-type information processor
JPH0750994B2 (en) Inverter operation command device
JP2837609B2 (en) Power control method
JP2832606B2 (en) Power circuit control device
EP1696571A1 (en) Battery-operated equipment
KR20010029233A (en) An apparatus and method for driving a optical disc based on remaining charge of a battery
JPH0595635A (en) Quick charger
JP3991854B2 (en) Vehicle power generation control device
JP3097811B2 (en) Power supply circuit for slave device
JPH05308729A (en) Cooling fan control method
JPH11206027A (en) Power control device, information processing device, and power control method
JPH05166542A (en) Power supply
JP2869248B2 (en) A / D converter