JP3001325B2 - Microcomputer - Google Patents
MicrocomputerInfo
- Publication number
- JP3001325B2 JP3001325B2 JP4079672A JP7967292A JP3001325B2 JP 3001325 B2 JP3001325 B2 JP 3001325B2 JP 4079672 A JP4079672 A JP 4079672A JP 7967292 A JP7967292 A JP 7967292A JP 3001325 B2 JP3001325 B2 JP 3001325B2
- Authority
- JP
- Japan
- Prior art keywords
- register
- circuit
- holding
- signal
- value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Landscapes
- Analogue/Digital Conversion (AREA)
Description
【0001】[0001]
【産業上の利用分野】本発明はマイクロコンピュータに
関し、特にマイクロコンピュータ内蔵のA/Dコンバー
タに関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microcomputer, and more particularly to an A / D converter with a built-in microcomputer.
【0002】[0002]
【従来の技術】従来のA/Dコンバータを内蔵したマイ
クロコンピュータは、図2に示すように、複数のアナロ
グ信号2を制御信号20で選択する選択回路3と、選択
されたアナログ信号を入力する入力回路1と、入力回路
1を通したアナログ信号を保持する電圧保持回路4と、
基準電圧6を生成する基準電圧生成回路5と、前記基準
電圧6と電圧保持回路4に保持されたアナログ信号とを
比較する比較器7と、比較器7より出力される比較結果
を格納するレジスタ回路8と、おのおのを制御する制御
回路21とを有する。2. Description of the Related Art A conventional microcomputer having a built-in A / D converter, as shown in FIG. 2, inputs a selection circuit 3 for selecting a plurality of analog signals 2 by a control signal 20 and a selected analog signal. An input circuit 1, a voltage holding circuit 4 for holding an analog signal passed through the input circuit 1,
A reference voltage generation circuit 5 for generating a reference voltage 6, a comparator 7 for comparing the reference voltage 6 with an analog signal held in a voltage holding circuit 4, and a register for storing a comparison result output from the comparator 7 It has a circuit 8 and a control circuit 21 for controlling each of them.
【0003】[0003]
【発明が解決しようとする課題】このような従来のマイ
クロコンピュータでは、複数の有効な入力レベルを有す
る信号が入力される様なシステム(たとえばキー入力)
において、A/Dコンバータを応用して、これらの入力
信号2を判別する場合、入力される信号毎にA/D変換
時間と有効信号か無効信号かの判定時間が必要になる。In such a conventional microcomputer, a system in which a signal having a plurality of valid input levels is input (for example, key input)
In the case where the input signal 2 is determined by applying an A / D converter, an A / D conversion time and a time for determining whether the signal is a valid signal or an invalid signal are required for each input signal.
【0004】有効な信号が多数ある場合(複数のキー入
力がある場合)、この判定時間がさらに増加することに
なる。また、入力信号がアナログであるため、あらかじ
め入力誤差を考慮する筆様もあり、低い入力精度が問題
点となる場合があった。さらに前記の入力精度を考慮す
るためプログラムが複雑になり、一層判定時間が増加す
ると言う問題点があった。When there are a large number of valid signals (when there are a plurality of key inputs), the determination time is further increased. In addition, since the input signal is analog, there is a brush in which an input error is considered in advance, and there is a case where low input accuracy is a problem. Further, there is a problem that the program becomes complicated because the above-mentioned input accuracy is taken into consideration, and the determination time is further increased.
【0005】本発明の目的は、前記問題点を解決し、精
度よく短時間で判定できるようにしたマイクロコンピュ
ータを提供することにある。An object of the present invention is to provide a microcomputer which solves the above-mentioned problem and enables accurate and short-time determination.
【0006】[0006]
【課題を解決するための手段】本発明の構成は、A/D
コンバータを内蔵するマイクロコンピュータにおいて、
有効とすべきA/D変換値をあらかじめ設定する基準値
レジスタと前記有効とすべきA/D変換値のバラツキの
有効範囲を設定する誤差レジスタとの内容を、入力変換
されたA/D変換値が格納されているレジスタ回路の内
容と比較演算する演算器と、前記レジスタ回路の内容が
有効なA/D変換値と判断すると有効信号を出力すると
共に前記有効信号により前記レジスタ回路の内容を保持
する保持レジスタを有する出力信号判定部と、前記有効
信号に同期して以前のレジスタの内容を保持している旧
保持レジスタと前記保持レジスタとの平均を取りその平
均値を出力する学習回路と、出力された前記平均値の情
報を格納する基準電圧レジスタを有する基準電圧生成部
とを有し、特に前記有効信号により割り込みを発生する
割り込み制御回路とを有することを特徴とする。According to the present invention, an A / D converter is provided.
In a microcomputer with a built-in converter,
The contents of a reference value register for preliminarily setting an A / D conversion value to be validated and an error register for setting an effective range of the variation of the A / D conversion value to be validated are input and converted by the A / D converter. An arithmetic unit that performs a comparison operation with the contents of the register circuit in which the value is stored, and outputs a valid signal when the contents of the register circuit are determined to be a valid A / D conversion value, and outputs the contents of the register circuit by the valid signal. An output signal determining unit having a holding register for holding, a learning circuit for taking an average of the old holding register and the holding register holding the contents of the previous register in synchronization with the valid signal and outputting an average value thereof; And a reference voltage generator having a reference voltage register for storing the output information of the average value, and in particular, an interrupt control circuit for generating an interrupt by the valid signal. Characterized in that it has a.
【0007】[0007]
【実施例】図1は本発明の一実施例のマイクロコンピュ
ータのブロック図である。FIG. 1 is a block diagram of a microcomputer according to an embodiment of the present invention.
【0008】図1において、本発明の構成は、アナログ
信号が入力される入力回路1と、変換すべきアナログ信
号を選択する選択回路3と、選択された前記アナログ信
号を入力回路1を通して保持する電圧保持回路4と、基
準電圧6を生成する基準電圧生成回路5と、前記基準電
圧6と入力される前記アナログ信号とを比較する比較器
7と、前記比較器7より出力される比較結果情報を格納
するレジスタ回路8と、前記おのおのを制御する制御回
路21とを有するA/Dコンバータを内蔵したマイクロ
コンピュータにおいて、有効な入力信号と判断するため
の基準値をあらかじめ設定する基準値レジスタ9と、入
力変換されたA/D変換値のバラツキの有効とする範囲
値を設定する誤差レジスタ10とを含む有効範囲設定部
と、前記レジスタ回路8に格納されたA/D変換値と前
記有効範囲設定部に設定された基準値及び範囲値とを比
較演算する演算器11と、前記演算器11の出力信号に
より前記レジスタ回路8に格納された比較結果情報を転
送し保持する保持レジスタ13とを含む有効信号判定部
と、前記有効信号の出力に同期し、前回の保持レジスタ
13の情報を保持している旧保持レジスタ14と前記保
持レジスタ13との相互の保持内容の平均を算出し平均
値情報を出力する学習回路15と、出力された平均値情
報を格納する基準電圧レジスタ17を含む基準電圧生成
部とを設け、特に前記有効信号により割り込みを発生す
る割り込み制御回路18を設けたことを特徴とする。In FIG. 1, according to the configuration of the present invention, an input circuit 1 to which an analog signal is input, a selection circuit 3 for selecting an analog signal to be converted, and holding the selected analog signal through the input circuit 1 A voltage holding circuit 4, a reference voltage generation circuit 5 for generating a reference voltage 6, a comparator 7 for comparing the reference voltage 6 with the input analog signal, and comparison result information output from the comparator 7 A reference value register 9 for setting a reference value for determining a valid input signal in a microcomputer having a built-in A / D converter having a register circuit 8 for storing data and a control circuit 21 for controlling each of them. An effective range setting unit including an error register 10 for setting a range value in which the variation of the input-converted A / D conversion value is valid; A computing unit 11 for comparing the A / D conversion value stored in the path 8 with a reference value and a range value set in the effective range setting unit, and storing in the register circuit 8 based on an output signal of the computing unit 11 A valid signal judging unit including a holding register 13 for transferring and holding the obtained comparison result information; an old holding register 14 for holding the information of the previous holding register 13 in synchronization with the output of the valid signal; A learning circuit 15 for calculating the average of the contents held by the register 13 and outputting the average value information and a reference voltage generator including a reference voltage register 17 for storing the output average value information are provided. An interrupt control circuit for generating an interrupt by a signal is provided.
【0009】まずアナログ信号2が選択回路3で選択さ
れた入力回路1より入力され、電圧保持回路4に保持さ
れる。First, the analog signal 2 is input from the input circuit 1 selected by the selection circuit 3 and is held in the voltage holding circuit 4.
【0010】一方、学習回路15により算出された有効
出力信号12のA/D変換値の平均値16は、基準電圧
生成回路5に含まれる基準電圧レジスタ17に格納さ
れ、前記アナログ信号2をA/D変換する際に比較器7
の基準電圧6として前記基準電圧生成回路5により生成
される。On the other hand, the average value 16 of the A / D conversion value of the effective output signal 12 calculated by the learning circuit 15 is stored in a reference voltage register 17 included in the reference voltage generation circuit 5, and converts the analog signal 2 into an analog signal. When performing the / D conversion, the comparator 7
Is generated by the reference voltage generation circuit 5 as the reference voltage 6.
【0011】次に基準電圧生成回路5によって生成され
た基準電圧6よりA/D変換された変換結果は、レジス
タ回路8に格納される。Next, the result of A / D conversion from the reference voltage 6 generated by the reference voltage generation circuit 5 is stored in the register circuit 8.
【0012】レジスタ回路8に格納されたA/D変換値
は、基準値レジスタと誤差レジスタ10とにあらかじめ
設定された有効とする信号の範囲データと、演算器11
によって比較演算を行い、演算結果として出力信号12
を出力する。この出力信号12の出力に応じて、割り込
みを発生する割り込み制御回路18は、割り込み要求信
号19を出力する。The A / D converted value stored in the register circuit 8 is based on the range data of a valid signal set in advance in a reference value register and an error register 10 and an arithmetic unit 11
A comparison operation is performed by using the output signal 12 as the operation result.
Is output. In response to the output of the output signal 12, the interrupt control circuit 18 that generates an interrupt outputs an interrupt request signal 19.
【0013】また出力信号12の出力に応じて、レジス
タ回路8の内容は、保持レジスタ13へ保持され、以前
のレジスタ回路8の内容を保持レジスタ13より、旧保
持レジスタ14へ移動し、前記保持レジスタ13と旧保
持レジスタ14との内容を学習回路15によって演算
し、平均値16を算出する。この平均値16は、基準電
圧生成回路5内の基準電圧レジスタ17に保持され、次
回のA/D変換時の基準電圧として用いる。Further, in response to the output of the output signal 12, the contents of the register circuit 8 are held in the holding register 13, and the contents of the previous register circuit 8 are moved from the holding register 13 to the old holding register 14, and are held. The contents of the register 13 and the old holding register 14 are operated by the learning circuit 15 to calculate an average value 16. This average value 16 is held in a reference voltage register 17 in the reference voltage generation circuit 5 and is used as a reference voltage at the next A / D conversion.
【0014】[0014]
【発明の効果】以上説明したように、本発明は、A/D
コンバータを内蔵したマイクロコンピュータにおいて、
有効と判断するアナログ信号のA/D変換値をあらか
じめ設定する基準値レジスタとA/D変換値を比較し有
効信号と判断する出力信号判断部、以前のA/D変換
値と今回のA/D変換値とを比較する比較器とその平均
値を算出する学習回路を内蔵する基準電圧生成部、及び
前記の有効信号と判断されると割り込みを発生させる
割り込み制御回路を内蔵することにより、A/D変換時
間,有効信号判定時間,及び割り込み発生タイミングが
それぞれ短縮されるという効果がある。As described above, according to the present invention, the A / D
In a microcomputer with a built-in converter,
A reference value register for presetting an A / D conversion value of an analog signal determined to be valid, an output signal determination unit for comparing the A / D conversion value and determining a valid signal, a previous A / D conversion value and a current A / D conversion value By incorporating a comparator for comparing the D-converted value and a reference voltage generator incorporating a learning circuit for calculating an average value thereof, and an interrupt control circuit for generating an interrupt when the signal is determined to be the valid signal, A This has the effect of reducing the / D conversion time, the valid signal determination time, and the interrupt generation timing.
【図1】本発明の一実施例のマイクロコンピュータを示
すブロック図である。FIG. 1 is a block diagram showing a microcomputer according to an embodiment of the present invention.
【図2】従来のマイクロコンピュータのA/Dコンバー
タを示すブロック図である。FIG. 2 is a block diagram showing an A / D converter of a conventional microcomputer.
【符号の説明】 1 入力回路 2 アナログ信号 3 選択回路 4 電圧保持回路 5 基準電圧生成回路 6 基準電圧 7 比較器 8 レジスタ回路 9 基準値レジスタ 10 誤差レジスタ 11 演算器 12 出力信号 13 保持レジスタ 14 旧保持レジスタ 15 学習回路 16 平均値 17 基準電圧レジスタ 18 割り込み制御回路 19 割り込み要求信号 20 制御信号 21 制御回路[Description of Signs] 1 input circuit 2 analog signal 3 selection circuit 4 voltage holding circuit 5 reference voltage generation circuit 6 reference voltage 7 comparator 8 register circuit 9 reference value register 10 error register 11 arithmetic unit 12 output signal 13 holding register 14 old Holding register 15 Learning circuit 16 Average value 17 Reference voltage register 18 Interrupt control circuit 19 Interrupt request signal 20 Control signal 21 Control circuit
Claims (2)
換すべきアナログ信号を選択する選択回路と、選択され
た前記アナログ信号を前記入力回路を介して保持する電
圧保持回路と、基準電圧を生成する基準電圧生成回路
と、前記基準電圧と入力される前記アナログ信号とを比
較する比較器と、前記比較器より出力される比較結果情
報を格納するレジスタ回路と、前記各回路及び比較器を
制御する制御回路とを有するA/Dコンバータを内蔵す
るマイクロコンピュータにおいて、前記A/Dコンバー
タに、有効な入力信号と判断するための基準値をあらか
じめ設定する基準値レジスタと入力変換されたA/D変
換値のバラツキの有効とする範囲値を設定する誤差レジ
スタとを含む有効範囲設定部を設け、前記レジスタ回路
に格納されたA/D変換値と前記有効範囲設定部に設定
された基準値及び範囲値とを比較演算する演算器と、前
記演算器の出力信号により前記レジスタ回路に格納され
た比較結果情報を転送し保持する保持レジスタとを含む
有効信号判定部を設け、前記有効信号の出力に同期し、
前回の保持レジスタの情報を保持している旧保持レジス
タと前記保持レジスタとの保持内容の平均を算出し平均
値情報を出力する学習回路を設け、出力された前記平均
値情報を格納する基準電圧レジスタを前記基準電圧生成
部が有していることを特徴とするマイクロコンピュー
タ。An input circuit for inputting an analog signal, a selection circuit for selecting an analog signal to be converted, a voltage holding circuit for holding the selected analog signal via the input circuit, and generating a reference voltage A reference voltage generation circuit, a comparator for comparing the reference voltage with the input analog signal, a register circuit for storing comparison result information output from the comparator, and controlling the circuits and the comparator. A microcomputer having an A / D converter having a control circuit for converting the A / D converter into a reference value register for presetting a reference value for determining a valid input signal; An effective range setting unit including an error register for setting a range value in which the variation of the conversion value is valid; An arithmetic unit for comparing the converted value with a reference value and a range value set in the effective range setting unit; and a holding register for transferring and holding the comparison result information stored in the register circuit by an output signal of the arithmetic unit. Providing a valid signal determination unit including, and synchronized with the output of the valid signal,
A learning circuit for calculating the average of the contents held in the old holding register holding the information of the previous holding register and the holding register and outputting the average value information is provided, and a reference voltage for storing the output average value information is provided. A microcomputer, wherein the register is included in the reference voltage generation unit.
り込みを発生する割り込み制御回路を有することを特徴
とする請求項1記載のマイクロコンピュータ。2. The microcomputer according to claim 1, further comprising: an interrupt control circuit for generating an interrupt according to a valid signal of said valid signal determining unit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP4079672A JP3001325B2 (en) | 1992-04-01 | 1992-04-01 | Microcomputer |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP4079672A JP3001325B2 (en) | 1992-04-01 | 1992-04-01 | Microcomputer |
Publications (2)
Publication Number | Publication Date |
---|---|
JPH05282100A JPH05282100A (en) | 1993-10-29 |
JP3001325B2 true JP3001325B2 (en) | 2000-01-24 |
Family
ID=13696683
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP4079672A Expired - Fee Related JP3001325B2 (en) | 1992-04-01 | 1992-04-01 | Microcomputer |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP3001325B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100553293B1 (en) | 1999-02-02 | 2006-02-22 | 로크웰삼성오토메이션 주식회사 | An apparatus for eliminating variable offset values of current detecting signals and its method |
-
1992
- 1992-04-01 JP JP4079672A patent/JP3001325B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JPH05282100A (en) | 1993-10-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2930611B2 (en) | Method and apparatus for determining correction values for self-calibrating AD and DA converters | |
JP3001325B2 (en) | Microcomputer | |
KR100310884B1 (en) | A microprocessor equipped with an a/d converter | |
US4535669A (en) | Touch response apparatus for electronic musical apparatus | |
US4644841A (en) | Electronic musical instrument | |
JPH10177403A (en) | A/d converter | |
JP3141561B2 (en) | Analog / digital conversion circuit | |
JPH0628339B2 (en) | Analog-to-digital converter | |
JPS6240733B2 (en) | ||
JP2530695Y2 (en) | Electronic musical instrument address controller | |
JPH06140932A (en) | Semiconductor integrated circuit | |
JP2575856B2 (en) | Arithmetic circuit | |
SU615518A1 (en) | Multichannel shaft angular position-to-code converter | |
JP4219434B2 (en) | Measurement data recording device | |
JPH05175837A (en) | A/d converter | |
JPH066193A (en) | Pulse width modulation circuit | |
JPS59194399A (en) | Propre waveform setter | |
JPH0612502A (en) | Microcomputer with built-in a/d conversion circuit | |
JPS6249636B2 (en) | ||
JPH0251723A (en) | Microcontroller | |
JPS5842477B2 (en) | electronic musical instruments | |
JPH043553B2 (en) | ||
JPS63209324A (en) | A/d converter | |
JP2001144616A (en) | Successive approximation type analog/digital converter | |
JPH03185930A (en) | A/d converter |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 19991026 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313113 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20071112 Year of fee payment: 8 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20081112 Year of fee payment: 9 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20081112 Year of fee payment: 9 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20091112 Year of fee payment: 10 |
|
LAPS | Cancellation because of no payment of annual fees |