JPH05307618A - Microcomputer - Google Patents

Microcomputer

Info

Publication number
JPH05307618A
JPH05307618A JP4137811A JP13781192A JPH05307618A JP H05307618 A JPH05307618 A JP H05307618A JP 4137811 A JP4137811 A JP 4137811A JP 13781192 A JP13781192 A JP 13781192A JP H05307618 A JPH05307618 A JP H05307618A
Authority
JP
Japan
Prior art keywords
conversion
converter
signal
input
microcomputer
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
JP4137811A
Other languages
Japanese (ja)
Inventor
Takashi Fujii
岳志 藤井
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP4137811A priority Critical patent/JPH05307618A/en
Publication of JPH05307618A publication Critical patent/JPH05307618A/en
Pending legal-status Critical Current

Links

Landscapes

  • Microcomputers (AREA)

Abstract

PURPOSE:To prevent an A/D converter from being dropped at its A/D conversion accuracy by allowing a central processing unit(CPU) to queue during the A/D conversion of an A/D converter. CONSTITUTION:When the A/D converter 8 stops its operation, the CPU 5 executes convensional operation. When an A/D conversion start signal is inputted to the converter 8, the converter 8 outputs a signal indicating the execution of A/D conversion to the CPU 5 through a signal line (r). The CPU 5 receiving the signal stops the execution of operation and executes queuing processing. At the time of completing A/D conversion, the converter 8 releases the signal indicating the execution of A/D conversion through the signal line (r) and then the CPU 5 restarts operation. Since the CPU 5 stops its operation during the period from the start of operation of the converter 8 up to its end, a memory is not accessed.

Description

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

【0001】[0001]

【産業上の利用分野】この発明は、AD変換器を内蔵し
たマイクロコンピュータに関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a microcomputer incorporating an AD converter.

【0002】[0002]

【従来の技術】マイクロコンピュータに内蔵のAD変換
器は、マイクロコンピュータの外部から入力されたアナ
ログ信号を、外部から別に入力された基準電圧と比較
し、基準電圧との比率にもとづいた複数ビットのディジ
タルデータに変換する動作を行っている。図5は、従来
技術の一例を示すAD変換器を内蔵したマイクロコンピ
ュータを使用したシステムのブロック図である。図5に
おいて、1で示した枠の内部はマイクロコンピュータ、
2は周辺デバイス、3は周辺システムアドレスバス、4
は周辺システムデータバス、5はCPU(中央処理装
置)、6はROM(読み出し専用メモリ)、7はRAM
(読み書き可能メモリ)、58はAD変換器、9はアド
レスポート、10はデータポート、11は4ビットのプ
ログラマブル入出力ポート、12はアドレスバス、13
はデータバスである。aはCPU5のアドレス出力線、
bはCPU5のデータ入出力線、cはROM6のアドレ
ス入力線、dはROM6のデータ出力線、eはRAM7
のアドレス入力線、fはRAM7のデータ入出力線、g
はAD変換器58のアドレス入力線、hはAD変換器5
8のデータ入出力線、iはアドレスポート9のアドレス
信号線、jはデータポート10のデータ信号線、kはプ
ログラマブル入出力ポート11のアドレス信号線、lは
プログラマブル入出力ポート11へのデータ信号線、m
はアドレスポート9から外部へのアドレス出力線、nは
データポート10と外部とのデータ入出力線、oは周辺
デバイス2のアドレス入力線、pは周辺デバイス2のデ
ータ入出力線、q0 〜q3 はそれぞれプログラマブル入
出力ポート11のビット0、ビット1、ビット2、ビッ
ト3を示している。図6は、マイクロコンピュータに内
蔵されている8ビットのAD変換器58の一例を示すブ
ロック図である。図6において、18はADラダー抵
抗、19は逐次比較レジスタ、20はADレジスタ、2
1はAD変換制御回路、23は比較器である。Aは外部
から入力される基準電圧線、Bは外部から入力されるG
ND線、Cは外部から入力されるアナログ入力線、D0
〜D7は逐次比較レジスタ19からADラダー抵抗18
への8ビットデータ入力線、EはADラダー抵抗18か
らの比較電圧出力線、Fは比較器23の制御信号線、G
は比較器23の比較結果信号線、Hは逐次比較レジスタ
19の制御信号線、IはAD変換結果をADレジスタ2
0に入力する信号線、JはADレジスタ20のデータ出
力線である。
2. Description of the Related Art An AD converter incorporated in a microcomputer compares an analog signal input from the outside of the microcomputer with a reference voltage separately input from the outside, and a plurality of bits based on the ratio with the reference voltage. It is converting to digital data. FIG. 5 is a block diagram of a system using a microcomputer having a built-in AD converter showing an example of a conventional technique. In FIG. 5, the inside of the frame indicated by 1 is a microcomputer,
2 is a peripheral device, 3 is a peripheral system address bus, 4
Is a peripheral system data bus, 5 is a CPU (central processing unit), 6 is a ROM (read-only memory), and 7 is a RAM
(Read-write memory), 58 is an AD converter, 9 is an address port, 10 is a data port, 11 is a 4-bit programmable input / output port, 12 is an address bus, and 13
Is a data bus. a is the address output line of the CPU 5,
b is a data input / output line of the CPU 5, c is an address input line of the ROM 6, d is a data output line of the ROM 6, and e is a RAM 7.
Address input line, f is a data input / output line of RAM 7, g
Is an address input line of the AD converter 58, h is the AD converter 5
8 data input / output lines, i is an address signal line of the address port 9, j is a data signal line of the data port 10, k is an address signal line of the programmable input / output port 11, and 1 is a data signal to the programmable input / output port 11. Line, m
Is an address output line from the address port 9 to the outside, n is a data input / output line between the data port 10 and the outside, o is an address input line of the peripheral device 2, p is a data input / output line of the peripheral device 2, and q0 to q3 Indicate bit 0, bit 1, bit 2 and bit 3 of the programmable input / output port 11, respectively. FIG. 6 is a block diagram showing an example of an 8-bit AD converter 58 incorporated in the microcomputer. 6, 18 is an AD ladder resistor, 19 is a successive approximation register, 20 is an AD register, 2
Reference numeral 1 is an AD conversion control circuit, and 23 is a comparator. A is a reference voltage line input from the outside, B is G input from the outside
ND line, C is an analog input line input from the outside, D0
˜D7 are from the successive approximation register 19 to the AD ladder resistor 18
8-bit data input line to E, E is a comparison voltage output line from the AD ladder resistor 18, F is a control signal line of the comparator 23, and G is a control signal line.
Is the comparison result signal line of the comparator 23, H is the control signal line of the successive approximation register 19, I is the AD conversion result in the AD register 2
A signal line input to 0, and J is a data output line of the AD register 20.

【0003】次に、従来のAD変換器を内蔵したマイク
ロコンピュータを使用したシステムの動作について図5
を用いて説明する。マイクロコンピュータが内部ROM
6を使用して動作している場合、CPU5はアドレス出
力線a→アドレスバス12→アドレス入力線cを介して
アドレスをROM6に出力し、ROM6からのプログラ
ムを信号線d→データバス13→データ入出力線bを介
して取り込む事によって演算を行う。CPU5がマイク
ロコンピュータ内部1のROM6を使用して演算を行っ
ている場合には、常に上記に示すような動作を行ってお
り、アドレスバス12やデータバス13は常に“L”→
“H”、“H”→“L”に変化している。マイクロコン
ピュータ内部1において、アドレスバス12やデータバ
ス13は大きな容量を持っており、またこれらをドライ
ブするトランジスタはドライブ能力の高い物が使用され
ているので、CPU5が演算している時にはマイクロコ
ンピュータ内部の電源にはノイズがのる事がある。ま
た、マイクロコンピュータが周辺デバイス2の1つとし
て接続されている図示しない外部メモリを使用して動作
する場合など、外部メモリをアクセスする場合には、ア
ドレス出力線a→アドレスバス12→アドレス信号線i
→アドレスポート9→アドレス出力線m→周辺システム
アドレスバス3→アドレス入力線oを介して外部メモリ
にアドレスを出力し、外部メモリからのデータをデータ
入出力線p→周辺システムデータバス4→データ入出力
線n→データポート10→出力線j→データバス13→
データ入出力線bを介してCPU5に取り込む事によっ
て演算を行う。外部メモリをアクセスするような場合に
は、マイクロコンピュータ内部1の電源にノイズがのる
事に加え、周辺システムバスが“L”→“H”、“H”
→“L”に変化する事や、周辺デバイスでの電流消費の
ために、周辺基板の電源にもノイズがのる事がある。以
上に示したように、マイクロコンピュータのCPUが演
算を行っている時には、色々な影響によってマイクロコ
ンピュータ内部、及び周辺基板の電源にノイズがのる事
が考えられる。
Next, the operation of a system using a conventional microcomputer with a built-in AD converter is shown in FIG.
Will be explained. Microcomputer has internal ROM
6, the CPU 5 outputs the address to the ROM 6 through the address output line a → address bus 12 → address input line c, and the program from the ROM 6 is transmitted through the signal line d → data bus 13 → data. The calculation is performed by fetching it through the input / output line b. When the CPU 5 is using the ROM 6 in the microcomputer 1 to perform an operation, the operation as described above is always performed, and the address bus 12 and the data bus 13 are always "L" →
It changes from "H", "H" to "L". In the inside 1 of the microcomputer, the address bus 12 and the data bus 13 have a large capacity, and the transistors for driving these have a high driving capability. Therefore, when the CPU 5 is operating, inside the microcomputer There may be noise on the power supply. When accessing the external memory, such as when the microcomputer operates using an external memory (not shown) connected as one of the peripheral devices 2, the address output line a → the address bus 12 → the address signal line. i
→ Address port 9 → Address output line m → Peripheral system address bus 3 → Address is output to external memory via address input line o, and data from external memory is input / output line p → Peripheral system data bus 4 → Data Input / output line n → data port 10 → output line j → data bus 13 →
The calculation is performed by loading the data into the CPU 5 via the data input / output line b. When an external memory is accessed, noise is added to the power supply inside the microcomputer 1 and the peripheral system bus is "L" → "H", "H".
→ There may be noise on the power supply of the peripheral board due to the change to "L" and current consumption in peripheral devices. As described above, when the CPU of the microcomputer is performing an operation, it is possible that noise is applied to the power supply inside the microcomputer and the power supply of the peripheral board due to various influences.

【0004】次に、マイクロコンピュータ内部における
従来のAD変換器の動作について図6を用いて説明す
る。初めに、基準電圧線Aには5.12[V]、GND
線Bには0[V]、アナログ入力線Cには2.00
[V]が入力されているものとする。ADラダー抵抗1
8では、基準電圧線Aに入力された電圧を256ステッ
プに分解し、逐次比較レジスタ19から入力される8ビ
ットデータD0〜D7の値によって選択された電圧を比
較電圧出力線Eに出力する。ここで、出力される比較電
圧は、“比較電圧=(基準電圧/256)×逐次比較レ
ジスタ値−基準電圧/512”となる。AD変換のスタ
ート時には、逐次比較レジスタには初期値としてビット
7(8ビットデータ入力線D7)に“1”、ビット0〜
6(8ビットデータ入力線D0〜D6)に“0”、すな
わち“10000000B”(2進数)がセットされ、
比較電圧出力線Eにはそれに対応した比較電圧として
2.55[V]が出力され、比較器23に入力される。
比較器23はAD変換制御回路21からの制御信号線F
によって上記比較電圧と、アナログ入力線Cの電圧を比
較する。そして、比較電圧(2.55[V])>アナロ
グ入力電圧(2.00[V])であるので、比較結果信
号線Gを介してAD変換制御回路21に比較電圧の方が
高いという信号を出力する。この結果、AD変換制御回
路21は、比較電圧が高いので、制御信号線Hを介して
逐次比較レジスタ19に対してビット7(8ビットデー
タ入力線D7)を“0”に変更し、ビット6(8ビット
データ入力線D6)に“1”をセットする制御信号を出
力する。そして、逐次比較レジスタ19には、今回“0
1000000B”がセットされるので、ADラダー抵
抗18はそれに対応した比較電圧として1.27[V]
を出力する。比較器23によって比較電圧と入力電圧を
比較した結果、比較電圧(1.27[V])<アナログ
入力電圧(2.00[V])であるので、AD変換制御
回路21に比較電圧の方が低いという信号を出力する。
この結果、AD変換制御回路21は比較電圧が低いの
で、逐次比較レジスタ19に対してビット6(8ビット
データ入力線D6)はそのまま変更せず、ビット5(8
ビットデータ入力線D5)に“1”をセットする制御信
号を出力する。以上の動作をビット0が決定するまで合
計8回繰り返し、8ビットのデータが決定した後、逐次
比較レジスタの内容をADレジスタに出力し、AD変換
を終了する。このように、以上に示す方法によって、ア
ナログ入力電圧を8ビットディジタルデータに変換する
わけであるが、8ビットAD変換器の最小分解能は20
[mV]であるので、マイクロコンピュータにおけるA
D変換器は、電源の変動の影響を受けやすい。
Next, the operation of the conventional AD converter in the microcomputer will be described with reference to FIG. First, the reference voltage line A has 5.12 [V], GND
0 [V] for line B and 2.00 for analog input line C
It is assumed that [V] is input. AD ladder resistance 1
In 8, the voltage input to the reference voltage line A is decomposed into 256 steps, and the voltage selected by the value of the 8-bit data D0 to D7 input from the successive approximation register 19 is output to the comparison voltage output line E. Here, the output comparison voltage is “comparison voltage = (reference voltage / 256) × successive comparison register value−reference voltage / 512”. At the start of AD conversion, bit 7 (8-bit data input line D7) is set to “1” and bits 0 to 0 are set as initial values in the successive approximation register.
6 (8-bit data input lines D0 to D6) is set to "0", that is, "10000000B" (binary number),
The comparison voltage output line E outputs a corresponding comparison voltage of 2.55 [V], which is input to the comparator 23.
The comparator 23 controls the control signal line F from the AD conversion control circuit 21.
The above comparison voltage is compared with the voltage of the analog input line C. Since the comparison voltage (2.55 [V])> analog input voltage (2.00 [V]), the signal indicating that the comparison voltage is higher is sent to the AD conversion control circuit 21 via the comparison result signal line G. Is output. As a result, the AD conversion control circuit 21 changes the bit 7 (8-bit data input line D7) to “0” for the successive approximation register 19 via the control signal line H because the comparison voltage is high, and the bit 6 A control signal for setting "1" to (8-bit data input line D6) is output. Then, the successive approximation register 19 stores "0
Since 1000000B "is set, the AD ladder resistor 18 has a corresponding comparison voltage of 1.27 [V].
Is output. As a result of comparison between the comparison voltage and the input voltage by the comparator 23, the comparison voltage (1.27 [V]) <analog input voltage (2.00 [V]). Outputs a signal that is low.
As a result, since the AD conversion control circuit 21 has a low comparison voltage, the bit 6 (8-bit data input line D6) is not changed to the successive approximation register 19 and the bit 5 (8
A control signal for setting "1" to the bit data input line D5) is output. The above operation is repeated eight times in total until bit 0 is determined, and after the 8-bit data is determined, the contents of the successive approximation register are output to the AD register, and the AD conversion is completed. As described above, the analog input voltage is converted into 8-bit digital data by the method described above, but the minimum resolution of the 8-bit AD converter is 20.
Since it is [mV], A in the microcomputer
The D converter is easily affected by fluctuations in the power supply.

【0005】[0005]

【発明が解決しようとする課題】従来のAD変換器を内
蔵したマイクロコンピュータにおいては、AD変換器は
周辺機能としてCPUの演算とは分離して動作していた
ため、AD変換を行っているサイクルにおいてもCPU
が演算を実行している事によってアドレスバス及びデー
タバスが“L”→“H”、“H”→“L”に反転し、マ
イクロコンピュータ内部、及び周辺基板の電源にノイズ
がのる。この結果、例えば、図6のAD変換器では、ア
ナログ入力線からアナログ入力電圧が入力され、このア
ナログ入力電圧が基準電圧線Aから入力された基準電圧
と比較器23で比較され、AD変換制御回路21によっ
て逐次比較レジスタ19にディジタル値がセットされ
る。ところが、このディジタル値が電源ノイズの影響に
よって、例えば“01111111B”をセットしなけ
ればならないのに、実際には、“10000000B”
となり、AD変換器におけるAD変換の精度が悪くなる
事があるという問題点があった。
In the conventional microcomputer having the built-in AD converter, the AD converter operates as a peripheral function separately from the operation of the CPU, and therefore, in the cycle in which AD conversion is performed. Also CPU
, The address bus and the data bus are inverted to "L" → "H", "H" → "L", and noise is applied to the power supply inside the microcomputer and the peripheral board. As a result, for example, in the AD converter of FIG. 6, the analog input voltage is input from the analog input line, the analog input voltage is compared with the reference voltage input from the reference voltage line A by the comparator 23, and AD conversion control is performed. The circuit 21 sets the digital value in the successive approximation register 19. However, this digital value has to be set to, for example, "01111111B" due to the influence of power supply noise, but actually "10000000B".
Therefore, there is a problem in that the accuracy of AD conversion in the AD converter may deteriorate.

【0006】この発明は、上記のような問題を解決する
ためになされてたもので、AD変換中はCPUを待機さ
せ、マイクロコンピュータ内部、及び周辺基板の電源に
ノイズがのる事を防ぐ事によって、AD変換の精度の低
下を防ぐことのできるマイクロコンピュータを得ること
を目的としている。
The present invention has been made in order to solve the above problems, and makes the CPU stand by during AD conversion to prevent noise from being applied to the power supply inside the microcomputer and the peripheral board. Therefore, it is an object of the present invention to obtain a microcomputer capable of preventing the deterioration of the accuracy of AD conversion.

【0007】[0007]

【課題を解決するための手段】この第1の発明に係るマ
イクロコンピュータでは、図1で示すように、演算,制
御等の処理を行うとともに、外部信号の入力によって待
機の処理を行う中央処理装置(CPU5)と、アナログ
信号をディジタル信号にAD変換するAD変換器8とを
少なくとも備えるマイクロコンピュータにおいて、上記
AD変換器がAD変換中である時に外部に信号を出力す
るAD変換検出手段を備え、上記AD変換器がAD変換
中である時には、上記AD変換検出手段の出力信号(信
号線rの信号)を上記中央処理装置に入力することによ
って、上記中央処理装置に待機の処理を行わせるように
した。この第2の発明に係るマイクロコンピュータで
は、図3で示すように、AD変換器8がAD変換中であ
る時に、上記AD変換器内のAD変換手段からのAD変
換中を示す信号線Sの信号を、中央処理装置(CPU
5)に入力するか否かを設定する設定手段(レジスタ1
4等)を備えた。この第3の発明に係るマイクロコンピ
ュータでは、図4で示すように、演算,制御等の処理を
行うとともに、外部信号の入力によって待機の処理を行
う中央処理装置(CPU5)と、上記外部信号を外部か
ら入力するために設けられた外部入力端子(入力端子1
7)と、アナログ信号をディジタル信号にAD変換する
AD変換器8とを少なくとも備えるマイクロコンピュー
タにおいて、上記AD変換器がAD変換中である時に外
部に信号線xの信号を出力するAD変換検出手段と、こ
のAD変換検出手段からの出力信号を外部に出力するた
めに設けられた外部出力端子(出力端子16)とを備
え、上記外部入力端子と上記外部出力端子とを接続する
ことにより、上記AD変換器がAD変換中である時に
は、上記中央処理装置に待機の処理を行わせるようにし
た。
In the microcomputer according to the first aspect of the present invention, as shown in FIG. 1, a central processing unit for performing processing such as calculation and control, and for performing standby processing by inputting an external signal. A microcomputer including at least a (CPU 5) and an AD converter 8 for AD-converting an analog signal into a digital signal, is provided with AD conversion detection means for outputting a signal to the outside when the AD converter is performing AD conversion. When the AD converter is in the process of AD conversion, the output signal of the AD conversion detection means (signal of the signal line r) is input to the central processing unit so that the central processing unit performs the standby processing. I chose In the microcomputer according to the second aspect of the present invention, as shown in FIG. 3, when the AD converter 8 is performing AD conversion, the signal line S indicating the AD conversion from the AD conversion means in the AD converter is being performed. The signal is sent to the central processing unit (CPU
5) Setting means (register 1) for setting whether or not to input
4 etc.). In the microcomputer according to the third aspect of the present invention, as shown in FIG. 4, a central processing unit (CPU5) that performs processing such as calculation and control and performs standby processing by inputting an external signal, and the external signal An external input terminal (input terminal 1) provided to input from the outside
7) and an AD converter 8 for AD-converting an analog signal into a digital signal, in a microcomputer, AD conversion detecting means for outputting a signal on the signal line x to the outside when the AD converter is performing AD conversion. And an external output terminal (output terminal 16) provided to output the output signal from the AD conversion detecting means to the outside, and by connecting the external input terminal and the external output terminal to each other, When the AD converter is in the process of AD conversion, the central processing unit is made to perform a standby process.

【0008】[0008]

【作用】この第1の発明によるマイクロコンピュータで
は、AD変換器8がアナログ信号からディジタル信号へ
のAD変換を行っている間、AD変換検出手段がAD変
換を検出して、信号を出力する。そのAD変換手段から
の出力信号は、中央処理装置(CPU5)の待機の処理
を行う入力端子に入力される。そして、上記中央処理装
置によって、待機の処理が行われる。この結果、AD変
換のAD変換中は、上記中央処理装置の演算処理等が原
因となる電源ノイズの発生がなくなり、AD変換器にお
けるAD変換精度の低下を防ぐことができる。この第2
の発明によるマイクロコンピュータでは、AD変換器が
AD変換中である時に、中央処理装置(CPU5)に待
機の処理を行わせるためのAD変換器からの信号を、上
記中央処理装置に入力するか否かが設定手段(レジスタ
14等)で設定する。この第3の発明によるマイクロコ
ンピュータでは、外部出力端子(出力端子16)と外部
入力端子(入力端子17)を接続し、第1の発明のマイ
クロコンピュータと同じ動作を行わせる。
In the microcomputer according to the first aspect of the present invention, while the AD converter 8 is performing the AD conversion from the analog signal to the digital signal, the AD conversion detecting means detects the AD conversion and outputs the signal. The output signal from the AD conversion means is input to the input terminal of the central processing unit (CPU 5) which performs a standby process. Then, the standby processing is performed by the central processing unit. As a result, during the AD conversion of the AD conversion, the power supply noise caused by the arithmetic processing of the central processing unit is eliminated, and the AD conversion accuracy in the AD converter can be prevented from being lowered. This second
In the microcomputer according to the invention, whether or not the signal from the AD converter for causing the central processing unit (CPU 5) to perform the standby processing is input to the central processing unit while the AD converter is performing AD conversion. It is set by the setting means (register 14 or the like). In the microcomputer according to the third aspect of the present invention, the external output terminal (output terminal 16) and the external input terminal (input terminal 17) are connected, and the same operation as the microcomputer of the first aspect is performed.

【0009】[0009]

【実施例】以下、この発明の一実施例を、図について説
明する。図1は、この第1の発明の一実施例(実施例
1)によるAD変換器を内蔵したマイクロコンピュータ
を使用したシステムのブロック図である。尚、図1にお
いて、図5の従来例と同一のものは同一符号を付し、説
明を省略する。図1のrはAD変換中である事を中央処
理装置(CPU)に知らせる信号線である。図2は、図
1のマイクロコンピュータに内蔵されている、AD変換
中である事を外部に知らせる機能を持つ8ビットのAD
変換器の一例を示すブロック図である。図2において、
18はADラダー抵抗、19は逐次比較レジスタ、20
はADレジスタ、21はAD変換制御回路、23は比較
器、24はAD変換検出手段としてのAD変換スタート
レジスタである。AD変換器8は、ADラダー抵抗18
と、逐次比較レジスタ19と、ADレジスタ20と、A
D変換制御回路21と、比較器23と、AD変換レジス
タ24とから構成されている。Aは外部から入力される
基準電圧線、Bは外部から入力されるGND線、Cは外
部から入力されるアナログ入力線、D0〜D7は逐次比
較レジスタ19からADラダー抵抗18への8ビットデ
ータ入力線、EはADラダー抵抗18からの比較電圧出
力線、Fは比較器23の制御信号線、Gは比較器23の
比較結果信号線、Hは逐次比較レジスタ19の制御信号
線、IはAD変換結果をADレジスタ20に入力する信
号線、JはADレジスタ20のデータ出力線、KはAD
変換スタートレジスタ24への入力信号線、LはAD変
換開始信号、MはAD変換終了信号線、NはAD変換中
である事をAD変換器の外部に知らせる信号である。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram of a system using a microcomputer incorporating an AD converter according to an embodiment (embodiment 1) of the first invention. In FIG. 1, the same parts as those in the conventional example of FIG. Reference numeral r in FIG. 1 is a signal line for notifying the central processing unit (CPU) that AD conversion is in progress. FIG. 2 is an 8-bit AD which is built in the microcomputer of FIG. 1 and has a function of notifying externally that AD conversion is in progress.
It is a block diagram which shows an example of a converter. In FIG.
18 is an AD ladder resistor, 19 is a successive approximation register, 20
Is an AD register, 21 is an AD conversion control circuit, 23 is a comparator, and 24 is an AD conversion start register as AD conversion detection means. The AD converter 8 has an AD ladder resistor 18
, Successive approximation register 19, AD register 20, A
It is composed of a D conversion control circuit 21, a comparator 23, and an AD conversion register 24. A is a reference voltage line input from the outside, B is a GND line input from the outside, C is an analog input line input from the outside, D0 to D7 are 8-bit data from the successive approximation register 19 to the AD ladder resistor 18. An input line, E is a comparison voltage output line from the AD ladder resistor 18, F is a control signal line of the comparator 23, G is a comparison result signal line of the comparator 23, H is a control signal line of the successive approximation register 19, and I is A signal line for inputting the AD conversion result to the AD register 20, J is a data output line of the AD register 20, and K is AD.
An input signal line to the conversion start register 24, L is an AD conversion start signal, M is an AD conversion end signal line, and N is a signal notifying the outside of the AD converter that AD conversion is in progress.

【0010】次に、この実施例1の動作について、図1
を用いて説明する。AD変換器8が動作を停止している
時は、CPU5は従来例(図5)と同様動作を行う。A
D変換器8に対してAD変換スタート要求が入力される
と、信号線rを介してAD変換中である事を示す信号
を、CPU5に対して出力する。上記信号を受け取った
CPU5は演算の実行を停止して待機の処理をする。A
D変換が終了すると、AD変換器は、上記AD変換中で
ある事を示す信号線rの信号を解除し、それによってC
PU5は演算を再開する。これら一連の動作によって、
AD変換器8が動作を開始した時点から終了した時点ま
で、CPU5は演算を停止している事になり、メモリに
対するアクセスは行われない。CPU5がメモリをアク
セスしない、すなわち、待機の処理の時には、マイクロ
コンピュータ内部1のアドレスバス12、データバス1
3は“H”または“L”に固定されており、これらのバ
スが“L”→“H”、または“H”→“L”に反転しな
いために、電源のノイズは発生しない。また、周辺シス
テムアドレスバス3のレベルも固定されるため、外部メ
モリからのデータ出力も停止され、周辺システムデータ
バス4のレベルも固定される事になり、これらのバスが
変化する事によって発生する周辺基板の電源のノイズも
発生しない事となる。次に実施例1のAD変換器内部の
動作について、図2を用いて説明する。図2において、
AD変換中における動作は、図6のAD変換器と同一で
あるので説明を省略する。AD変換器の動作を開始する
時は、CPUが実行しているプログラムによりAD変換
スタートレジスタ24に“1”データを書き込む事によ
って、AD変換器8が動作を開始する。この場合、デー
タバス22から入力信号線Kを介して書き込まれた
“0”データは、AD変換スタートレジスタ24に保持
され、AD変換開始信号線Lを介してAD変換制御回路
21にAD変換開始信号として出力される。またAD変
換が終了し、AD変換器の動作が停止した時は、AD変
換制御回路21はAD変換終了信号線Mを介してAD変
換終了信号を出力し、その時のAD変換スタートレジス
タ24の値は“0”にクリアされる。上記動作によって
AD変換器が動作している時は、AD変換スタートレジ
スタ24の値は“1”となり、AD変換器が停止してい
る時は、AD変換スタートレジスタ24の値が“0”と
なる。このため、このAD変換スタートレジスタ24の
値を信号線Nを介して外部に出力する事によって、AD
変換中である事を外部に知らせることができる。以上の
ようにこの実施例1によれば、AD変換中にCPU5を
待機させる事によって、マイクロコンピュータ内部及び
周辺基板の電源のノイズを防止する事ができ、AD変換
精度の低下を防ぐ事ができる。また、この実施例1で
は、AD変換をスタートした事によってCPUの演算を
停止させ、AD変換が終了した事によってCPUの演算
を再開する例について説明を行ったが、逐次比較レジス
タによる比較サイクル等、ノイズの影響を受けやすいサ
イクルのみCPUの演算を停止してもよい。
Next, the operation of the first embodiment will be described with reference to FIG.
Will be explained. When the AD converter 8 is not operating, the CPU 5 operates similarly to the conventional example (FIG. 5). A
When an AD conversion start request is input to the D converter 8, a signal indicating that AD conversion is in progress is output to the CPU 5 via the signal line r. Upon receiving the above signal, the CPU 5 stops the execution of the calculation and performs the waiting process. A
When the D conversion is completed, the AD converter releases the signal on the signal line r indicating that the AD conversion is being performed, and thereby C
PU5 restarts the calculation. By these series of operations,
From the time when the AD converter 8 starts the operation to the time when it ends, the CPU 5 has stopped the operation, and the memory is not accessed. When the CPU 5 does not access the memory, that is, in the standby process, the address bus 12 and the data bus 1 in the microcomputer internal 1
No. 3 is fixed to "H" or "L", and these buses are not inverted from "L" to "H" or "H" to "L", so that noise of the power supply does not occur. Further, since the level of the peripheral system address bus 3 is also fixed, the data output from the external memory is also stopped, and the level of the peripheral system data bus 4 is also fixed, which occurs when these buses change. The noise of the power supply of the peripheral board does not occur. Next, the operation inside the AD converter according to the first embodiment will be described with reference to FIG. In FIG.
The operation during AD conversion is the same as that of the AD converter of FIG. When the operation of the AD converter is started, the AD converter 8 starts its operation by writing "1" data to the AD conversion start register 24 by the program executed by the CPU. In this case, the “0” data written from the data bus 22 via the input signal line K is held in the AD conversion start register 24, and the AD conversion control circuit 21 starts the AD conversion via the AD conversion start signal line L. It is output as a signal. When the AD conversion ends and the operation of the AD converter stops, the AD conversion control circuit 21 outputs an AD conversion end signal via the AD conversion end signal line M, and the value of the AD conversion start register 24 at that time. Is cleared to "0". When the AD converter is operating according to the above operation, the value of the AD conversion start register 24 is "1", and when the AD converter is stopped, the value of the AD conversion start register 24 is "0". Become. Therefore, by outputting the value of the AD conversion start register 24 to the outside through the signal line N, AD
It can notify the outside that conversion is in progress. As described above, according to the first embodiment, by making the CPU 5 stand by during the AD conversion, it is possible to prevent the noise of the power supply inside the microcomputer and the peripheral board and prevent the deterioration of the AD conversion accuracy. .. Further, in the first embodiment, an example in which the CPU operation is stopped when the AD conversion is started and the CPU operation is restarted when the AD conversion is completed has been described. The CPU calculation may be stopped only in a cycle susceptible to noise.

【0011】図3はこの第2の発明の一実施例(実施例
2)によるAD変換器を内蔵したマイクロコンピュータ
を使用したシステムのブロック図である。図3におい
て、従来例(図5)と同一のものは同一符号を付して説
明を省略する。図3において、14は中央処理装置(C
PU)5の待機処理を設定する設定手段としての1ビッ
トのレジスタ、15は一致回路である。sはAD変換器
8がAD変換中である事を知らせる信号線、tはレジス
タ値を一致回路に入力する信号線、uはCPUを待機さ
せる信号線、vはレジスタに対するアドレス入力線、w
はレジスタのデータ入出力線である。次に、実施例2の
動作について図3を用いて説明する。1ビットのレジス
タ14は、CPU5の演算によってアドレス入力線vを
介してデコードアドレスが入力され、データ入出力線w
を介してデータが入力される事によって書き込まれる。
このレジスタに書き込まれる値は信号線tを介して一致
回路15に入力される。一致回路15は、このレジスタ
の値が“0”のときは信号線sを介して入力される信号
に関わらず、信号線uに対してCPU5を待機させる信
号を出力しない。レジスタの値が“1”で、信号線sを
介してAD変換中である事を示す信号が入力されていな
いときは、信号線uに対してCPUを待機させる信号を
出力しない。レジスタの値が“1”で、信号線sを介し
てAD変換中である事を示す信号が入力されているとき
は、信号線uを介してCPUを待機させる信号を出力す
る。これらの一致回路15の動作により、レジスタ値が
“0”のときは従来のAD変換器8を内蔵したマイクロ
コンピュータと同様な動作を行い、レジスタ値が“1”
のときは実施例1のAD変換器を内蔵したマイクロコン
ピュータと同様な動作を行う。以上のようにこの実施例
2によれば、レジスタ値が“1”のときはAD変換中に
CPUを待機させる事によって、マイクロコンピュータ
内部及び周辺基板の電源のノイズを防止する事ができ、
AD変換精度の低下を防ぐ事ができる。またレジスタ値
が“0”のときは従来のAD変換器を内蔵したマイクロ
コンピュータと同じ動作を行う事ができる。
FIG. 3 is a block diagram of a system using a microcomputer incorporating an AD converter according to an embodiment (embodiment 2) of the second invention. In FIG. 3, the same parts as those in the conventional example (FIG. 5) are designated by the same reference numerals and the description thereof will be omitted. In FIG. 3, 14 is a central processing unit (C
PU) 5 is a 1-bit register as setting means for setting standby processing, and 15 is a matching circuit. s is a signal line notifying that the AD converter 8 is performing AD conversion, t is a signal line for inputting the register value to the coincidence circuit, u is a signal line for making the CPU stand by, v is an address input line for the register, and w
Is a data input / output line of the register. Next, the operation of the second embodiment will be described with reference to FIG. The decode address is input to the 1-bit register 14 via the address input line v by the operation of the CPU 5, and the data input / output line w
It is written by inputting data via.
The value written in this register is input to the matching circuit 15 via the signal line t. When the value of this register is "0", the matching circuit 15 does not output a signal for making the CPU 5 stand by on the signal line u regardless of the signal input via the signal line s. When the value of the register is "1" and the signal indicating that AD conversion is being performed is not input through the signal line s, the signal for causing the CPU to stand by is not output to the signal line u. When the value of the register is "1" and a signal indicating that AD conversion is being performed is input through the signal line s, a signal for making the CPU stand by is output through the signal line u. Due to the operation of these coincidence circuits 15, when the register value is "0", the same operation as that of the microcomputer incorporating the conventional AD converter 8 is performed and the register value is "1".
In this case, the same operation as that of the microcomputer including the AD converter according to the first embodiment is performed. As described above, according to the second embodiment, when the register value is "1", by making the CPU stand by during the AD conversion, it is possible to prevent the noise of the power supply inside the microcomputer and the power supply of the peripheral board.
It is possible to prevent deterioration of AD conversion accuracy. Further, when the register value is "0", the same operation as the conventional microcomputer having the built-in AD converter can be performed.

【0012】図4はこの第3の発明の一実施例(実施例
3)によるAD変換器を内蔵したマイクロコンピュータ
を使用したシステムのブロック図である。図4におい
て、従来例(図5)と同一のものは同一符号を付して説
明を省略する。図4において、16はAD変換中である
事をマイクロコンピュータ外部に知らせるための外部出
力端子としての出力端子、17はこのマイクロコンピュ
ータに既存のCPUを待機させる機能を持った外部入力
端子としての入力端子である。また、xはAD変換中で
ある事を知らせる信号線、yはマイクロコンピュータ外
部の接続線、zはCPUを待機させる信号線である。次
に実施例4の動作について図4を用いて説明する。AD
変換器8が動作を開始すると、信号線xを介してAD変
換中である事を示す信号が出力端子16に出力される。
例えば、AD変換器8が動作を開始すると、出力端子1
6には“0”が出力され、AD変換器が動作していない
状態においては出力端子16には“1”が出力される。
また、入力端子17は、あるレベルになるとCPUを待
機させる機能を持った端子であり、例えば入力端子17
に“0”を入力すると、信号線zを介してCPUに対し
て演算を停止する信号を入力し、“1”を入力すると信
号線zを介してCPUに対して演算を実行する信号を入
力する機能を持っている。以上説明したように、上記の
ような機能を持った端子を内蔵するマイクロコンピュー
タにおいては、出力端子16と入力端子17を外部接続
線yによって接続する事によって、AD変換器が動作を
開始するとCPUは演算を停止し、AD変換器が動作を
停止するとCPUが演算を開始する。以上のように、こ
の実施例3によれば、実施例1と同様に、AD変換中に
CPUを待機させる事によって、マイクロコンピュータ
内部及び周辺基板の電源のノイズを防止する事ができ、
AD変換精度の低下を防ぐ事ができる。
FIG. 4 is a block diagram of a system using a microcomputer incorporating an AD converter according to an embodiment (embodiment 3) of the third invention. In FIG. 4, the same parts as those in the conventional example (FIG. 5) are designated by the same reference numerals and the description thereof will be omitted. In FIG. 4, reference numeral 16 is an output terminal as an external output terminal for notifying the outside of the microcomputer that AD conversion is in progress, and 17 is an input as an external input terminal having a function of making the existing CPU stand by in this microcomputer. It is a terminal. Further, x is a signal line notifying that AD conversion is in progress, y is a connection line outside the microcomputer, and z is a signal line for making the CPU stand by. Next, the operation of the fourth embodiment will be described with reference to FIG. AD
When the converter 8 starts operating, a signal indicating that AD conversion is being performed is output to the output terminal 16 via the signal line x.
For example, when the AD converter 8 starts operating, the output terminal 1
"0" is output to 6 and "1" is output to the output terminal 16 when the AD converter is not operating.
The input terminal 17 is a terminal having a function of making the CPU stand by at a certain level.
When "0" is input to, the signal for stopping the operation is input to the CPU via the signal line z, and when "1" is input, the signal for executing the operation is input to the CPU via the signal line z. Have the ability to As described above, in the microcomputer including the terminal having the above-mentioned function, the output terminal 16 and the input terminal 17 are connected by the external connection line y so that the CPU starts when the AD converter starts operating. Stops the operation, and when the AD converter stops operating, the CPU starts the operation. As described above, according to the third embodiment, as in the first embodiment, by making the CPU stand by during the AD conversion, it is possible to prevent the noise of the power supply inside the microcomputer and the power supply of the peripheral board.
It is possible to prevent deterioration of AD conversion accuracy.

【0013】[0013]

【発明の効果】以上のように、この第1の発明によれ
ば、AD変換器がAD変換中の時に中央処理装置を待機
させる構成としたため、マイクロコンピュータの内部及
び周辺基板の電源にノイズがのることを防ぐことがで
き、AD変換器のAD変換の精度の低下を防ぐ事ができ
る効果がある。この第2の発明によれば、中央処理装置
に待機させるか否かをユーザが自由に設定できる構成と
したため、第1の発明の効果に加えて、中央処理装置に
対する機能の処理を、必要に応じて自由に選択できる効
果がある。この第3の発明によれば、中央処理装置に待
機処理をさせるための信号を入力する外部入力端子を有
するマイクロコンピュータに、AD変換器がAD変換中
である時に外部に信号を出力するAD変換検出手段と、
このAD変換検出手段からの出力信号を外部に出力する
外部出力端子を設け、上記外部入力端子と上記外部出力
端子を接続する構成としたため、第1の発明の効果に加
えて、上記入力端子を有するマイクロコンピュータに容
易に用いることができる効果がある。
As described above, according to the first aspect of the present invention, since the central processing unit is made to stand by while the AD converter is performing AD conversion, noise is generated in the power source of the inside of the microcomputer and the peripheral board. It is possible to prevent this from happening, and it is possible to prevent a decrease in the accuracy of AD conversion of the AD converter. According to the second aspect of the present invention, the user can freely set whether or not the central processing unit should be on standby. Therefore, in addition to the effect of the first aspect, it is necessary to perform the function processing for the central processing unit. There is an effect that can be freely selected according to. According to the third aspect of the present invention, the AD conversion for outputting the signal to the outside while the AD converter is performing the AD conversion to the microcomputer having the external input terminal for inputting the signal for causing the central processing unit to perform the standby processing Detection means,
Since the external output terminal for outputting the output signal from the AD conversion detecting means to the outside is provided and the external input terminal and the external output terminal are connected, the input terminal is provided in addition to the effect of the first invention. It has an effect that it can be easily used in the microcomputer.

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

【図1】この第1の発明の一実施例を示すAD変換器を
内蔵したマイクロコンピュータを使用したシステムのブ
ロック図である。
FIG. 1 is a block diagram of a system using a microcomputer incorporating an AD converter showing an embodiment of the first invention.

【図2】図1のマイクロコンピュータに内蔵されている
AD変換器の一例を示すブロック図である。
FIG. 2 is a block diagram showing an example of an AD converter incorporated in the microcomputer of FIG.

【図3】この第2の発明の一実施例を示すAD変換器を
内蔵したマイクロコンピュータを使用したシステムのブ
ロック図である。
FIG. 3 is a block diagram of a system using a microcomputer incorporating an AD converter showing an embodiment of the second invention.

【図4】この第3の発明の一実施例を示すAD変換器を
内蔵したマイクロコンピュータを使用したシステムのブ
ロック図である。
FIG. 4 is a block diagram of a system using a microcomputer incorporating an AD converter showing an embodiment of the third invention.

【図5】従来技術におけるAD変換器を内蔵したマイク
ロコンピュータを使用したシステムのブロック図であ
る。
FIG. 5 is a block diagram of a system using a microcomputer having a built-in AD converter according to the related art.

【図6】図5のマイクロコンピュータに内蔵されている
AD変換器の一例を示すブロック図である。
FIG. 6 is a block diagram showing an example of an AD converter incorporated in the microcomputer of FIG.

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

1 マイクロコンピュータ内部 2 周辺デバイス 3 周辺システムアドレスバス 4 周辺システムデータバス 5 CPU 6 ROM 7 RAM 8,58 AD変換器 9 アドレスポート 10 データポート 11 プログラマブル入出力ポート 12 アドレスバス 13 データバス 14 1ビットレジスタ 15 一致回路 16 出力端子 17 入力端子 18 ADラダー抵抗 19 逐次比較レジスタ 20 ADレジスタ 21 AD変換制御回路 22 データバス 23 比較器 1 Microcomputer Internal 2 Peripheral device 3 Peripheral system address bus 4 Peripheral system data bus 5 CPU 6 ROM 7 RAM 8, 58 AD converter 9 Address port 10 Data port 11 Programmable input / output port 12 Address bus 13 Data bus 14 1-bit register 15 coincidence circuit 16 output terminal 17 input terminal 18 AD ladder resistance 19 successive approximation register 20 AD register 21 AD conversion control circuit 22 data bus 23 comparator

─────────────────────────────────────────────────────
─────────────────────────────────────────────────── ───

【手続補正書】[Procedure amendment]

【提出日】平成4年10月1日[Submission date] October 1, 1992

【手続補正1】[Procedure Amendment 1]

【補正対象書類名】明細書[Document name to be amended] Statement

【補正対象項目名】0004[Correction target item name] 0004

【補正方法】変更[Correction method] Change

【補正内容】[Correction content]

【0004】次に、マイクロコンピュータ内部における
従来のAD変換器の動作について図6を用いて説明す
る。初めに、基準電圧線Aには5.12[V]、GND
線Bには0[V]、アナログ入力線Cには2.00
[V]が入力されているものとする。ADラダー抵抗1
8では、基準電圧線Aに入力された電圧を256ステッ
プに分解し、逐次比較レジスタ19から入力される8ビ
ットデータD0〜D7の値によって選択された電圧を比
較電圧出力線Eに出力する。ここで、出力される比較電
圧は、“比較電圧=(基準電圧/256)×逐次比較レ
ジスタ値−基準電圧/512”となる。AD変換のスタ
ート時には、逐次比較レジスタには初期値としてビット
7(8ビットデータ入力線D7)に“1”、ビット0〜
6(8ビットデータ入力線D0〜D6)に“0”、すな
わち“10000000B”(2進数)がセットされ、
比較電圧出力線Eにはそれに対応した比較電圧として
2.55[V]が出力され、比較器23に入力される。
比較器23はAD変換制御回路21からの制御信号線F
によって上記比較電圧と、アナログ入力線Cの電圧を比
較する。そして、比較電圧(2.55[V])>アナロ
グ入力電圧(2.00[V])であるので、比較結果信
号線Gを介してAD変換制御回路21に比較電圧の方が
高いという信号を出力する。この結果、AD変換制御回
路21は、比較電圧が高いので、制御信号線Hを介して
逐次比較レジスタ19に対してビット7(8ビットデー
タ入力線D7)を“0”に変更し、ビット6(8ビット
データ入力線D6)に“1”をセットする制御信号を出
力する。そして、逐次比較レジスタ19には、今回“0
1000000B”がセットされるので、ADラダー抵
抗18はそれに対応した比較電圧として1.27[V]
を出力する。比較器23によって比較電圧と入力電圧を
比較した結果、比較電圧(1.27[V])<アナログ
入力電圧(2.00[V])であるので、AD変換制御
回路21に比較電圧の方が低いという信号を出力する。
この結果、AD変換制御回路21は比較電圧が低いの
で、逐次比較レジスタ19に対してビット6(8ビット
データ入力線D6)はそのまま変更せず、ビット5(8
ビットデータ入力線D5)に“1”をセットする制御信
号を出力する。以上の動作をビット0が決定するまで合
計8回繰り返し、8ビットのデータが決定した後、逐次
比較レジスタの内容をADレジスタに出力し、AD変換
を終了する。このように、以上に示す方法によって、ア
ナログ入力電圧を8ビットディジタルデータに変換する
わけであるが、基準電圧を5.12[V]としたとき、
8ビットAD変換器の最小分解能は20[mV]である
ので、マイクロコンピュータにおけるAD変換器は、電
源の変動の影響を受けやすい。
Next, the operation of the conventional AD converter in the microcomputer will be described with reference to FIG. First, the reference voltage line A has 5.12 [V], GND
0 [V] for line B and 2.00 for analog input line C
It is assumed that [V] is input. AD ladder resistance 1
In 8, the voltage input to the reference voltage line A is decomposed into 256 steps, and the voltage selected by the value of the 8-bit data D0 to D7 input from the successive approximation register 19 is output to the comparison voltage output line E. Here, the output comparison voltage is “comparison voltage = (reference voltage / 256) × successive comparison register value−reference voltage / 512”. At the start of AD conversion, bit 7 (8-bit data input line D7) is set to “1” and bits 0 to 0 are set as initial values in the successive approximation register.
6 (8-bit data input lines D0 to D6) is set to "0", that is, "10000000B" (binary number),
The comparison voltage output line E outputs a corresponding comparison voltage of 2.55 [V], which is input to the comparator 23.
The comparator 23 controls the control signal line F from the AD conversion control circuit 21.
The above comparison voltage is compared with the voltage of the analog input line C. Since the comparison voltage (2.55 [V])> analog input voltage (2.00 [V]), the signal indicating that the comparison voltage is higher is sent to the AD conversion control circuit 21 via the comparison result signal line G. Is output. As a result, the AD conversion control circuit 21 changes the bit 7 (8-bit data input line D7) to “0” for the successive approximation register 19 via the control signal line H because the comparison voltage is high, and the bit 6 A control signal for setting "1" to (8-bit data input line D6) is output. Then, the successive approximation register 19 stores "0
Since 1000000B "is set, the AD ladder resistor 18 has a corresponding comparison voltage of 1.27 [V].
Is output. As a result of comparison between the comparison voltage and the input voltage by the comparator 23, the comparison voltage (1.27 [V]) <analog input voltage (2.00 [V]). Outputs a signal that is low.
As a result, since the AD conversion control circuit 21 has a low comparison voltage, the bit 6 (8-bit data input line D6) is not changed to the successive approximation register 19 and the bit 5 (8
A control signal for setting "1" to the bit data input line D5) is output. The above operation is repeated eight times in total until bit 0 is determined, and after the 8-bit data is determined, the contents of the successive approximation register are output to the AD register, and the AD conversion is completed. In this way, the analog input voltage is converted into 8-bit digital data by the method described above. When the reference voltage is 5.12 [V],
Since the minimum resolution of the 8-bit AD converter is 20 [mV], the AD converter in the microcomputer is easily affected by the fluctuation of the power supply.

【手続補正2】[Procedure Amendment 2]

【補正対象書類名】明細書[Document name to be amended] Statement

【補正対象項目名】0005[Correction target item name] 0005

【補正方法】変更[Correction method] Change

【補正内容】[Correction content]

【0005】[0005]

【発明が解決しようとする課題】従来のAD変換器を内
蔵したマイクロコンピュータにおいては、AD変換器は
周辺機能としてCPUの演算とは分離して動作していた
ため、AD変換を行っているサイクルにおいてもCPU
が演算を実行している事によってアドレスバス及びデー
タバスが“L”→“H”、“H”→“L”に反転し、マ
イクロコンピュータ内部、及び周辺基板の電源にノイズ
がのる。この結果、例えば、図6のAD変換器では、ア
ナログ入力線からアナログ入力電圧が入力され、この
ナログ入力がADラダー抵抗18からの比較電圧と比較
器23で比較され、AD変換制御回路21によって逐次
比較レジスタ19にディジタル値がセットされる。とこ
ろが、このディジタル値が電源ノイズの影響によって、
例えば“01111111B”をセットしなければなら
ないのに、実際には、“10000000B”となり、
AD変換器におけるAD変換の精度が悪くなる事がある
という問題点があった。
In the conventional microcomputer having the built-in AD converter, the AD converter operates as a peripheral function separately from the operation of the CPU, and therefore, in the cycle in which AD conversion is performed. Also CPU
, The address bus and the data bus are inverted to "L" → "H", "H" → "L", and noise is applied to the power supply inside the microcomputer and the peripheral board. As a result, for example, in the AD converter 6, the analog input voltage is input from the analog input line, the A
The analog input is compared with the comparison voltage from the AD ladder resistor 18 by the comparator 23, and a digital value is set in the successive approximation register 19 by the AD conversion control circuit 21. However, due to the influence of power supply noise, this digital value
For example, "01111111B" must be set, but actually "10000000B",
There is a problem that the accuracy of AD conversion in the AD converter may deteriorate.

【手続補正3】[Procedure 3]

【補正対象書類名】明細書[Document name to be amended] Statement

【補正対象項目名】0010[Correction target item name] 0010

【補正方法】変更[Correction method] Change

【補正内容】[Correction content]

【0010】次に、この実施例1の動作について、図1
を用いて説明する。AD変換器8が動作を停止している
時は、CPU5は従来例(図5)と同様動作を行う。A
D変換器8に対してAD変換スタート要求が入力される
と、信号線rを介してAD変換中である事を示す信号
を、CPU5に対して出力する。上記信号を受け取った
CPU5は演算の実行を停止して待機の処理をする。A
D変換が終了すると、AD変換器は、上記AD変換中で
ある事を示す信号線rの信号を解除し、それによってC
PU5は演算を再開する。これら一連の動作によって、
AD変換器8が動作を開始した時点から終了した時点ま
で、CPU5は演算を停止している事になり、メモリに
対するアクセスは行われない。CPU5がメモリをアク
セスしない、すなわち、待機の処理の時には、マイクロ
コンピュータ内部1のアドレスバス12、データバス1
3は“H”または“L”に固定されており、これらのバ
スが“L”→“H”、または“H”→“L”に反転しな
いために、電源のノイズは発生しない。また、周辺シス
テムアドレスバス3のレベルも固定されるため、外部メ
モリからのデータ出力も停止され、周辺システムデータ
バス4のレベルも固定される事になり、これらのバスが
変化する事によって発生する周辺基板の電源のノイズも
発生しない事となる。次に実施例1のAD変換器内部の
動作について、図2を用いて説明する。図2において、
AD変換中における動作は、図6のAD変換器と同一で
あるので説明を省略する。AD変換器の動作を開始する
時は、CPUが実行しているプログラムによりAD変換
スタートレジスタ24に“1”データを書き込む事によ
って、AD変換器8が動作を開始する。この場合、デー
タバス22から入力信号線Kを介して書き込まれた
“1”データは、AD変換スタートレジスタ24に保持
され、AD変換開始信号線Lを介してAD変換制御回路
21にAD変換開始信号として出力される。またAD変
換が終了し、AD変換器の動作が停止した時は、AD変
換制御回路21はAD変換終了信号線Mを介してAD変
換終了信号を出力し、その時のAD変換スタートレジス
タ24の値は“0”にクリアされる。上記動作によって
AD変換器が動作している時は、AD変換スタートレジ
スタ24の値は“1”となり、AD変換器が停止してい
る時は、AD変換スタートレジスタ24の値が“0”と
なる。このため、このAD変換スタートレジスタ24の
値を信号線Nを介して外部に出力する事によって、AD
変換中である事を外部に知らせることができる。以上の
ようにこの実施例1によれば、AD変換中にCPU5を
待機させる事によって、マイクロコンピュータ内部及び
周辺基板の電源のノイズを防止する事ができ、AD変換
精度の低下を防ぐ事ができる。また、この実施例1で
は、AD変換をスタートした事によってCPUの演算を
停止させ、AD変換が終了した事によってCPUの演算
を再開する例について説明を行ったが、逐次比較レジス
タによる比較サイクル等、ノイズの影響を受けやすいサ
イクルのみCPUの演算を停止してもよい。
Next, the operation of the first embodiment will be described with reference to FIG.
Will be explained. When the AD converter 8 is not operating, the CPU 5 operates similarly to the conventional example (FIG. 5). A
When an AD conversion start request is input to the D converter 8, a signal indicating that AD conversion is in progress is output to the CPU 5 via the signal line r. Upon receiving the above signal, the CPU 5 stops the execution of the calculation and performs the waiting process. A
When the D conversion is completed, the AD converter releases the signal on the signal line r indicating that the AD conversion is being performed, and thereby C
PU5 restarts the calculation. By these series of operations,
From the time when the AD converter 8 starts the operation to the time when it ends, the CPU 5 has stopped the operation, and the memory is not accessed. When the CPU 5 does not access the memory, that is, in the standby process, the address bus 12 and the data bus 1 in the microcomputer internal 1
No. 3 is fixed to "H" or "L", and these buses are not inverted from "L" to "H" or "H" to "L", so that noise of the power supply does not occur. Further, since the level of the peripheral system address bus 3 is also fixed, the data output from the external memory is also stopped, and the level of the peripheral system data bus 4 is also fixed, which occurs when these buses change. The noise of the power supply of the peripheral board does not occur. Next, the operation inside the AD converter according to the first embodiment will be described with reference to FIG. In FIG.
The operation during AD conversion is the same as that of the AD converter of FIG. When the operation of the AD converter is started, the AD converter 8 starts its operation by writing "1" data to the AD conversion start register 24 by the program executed by the CPU. In this case, data was written from the data bus 22 via the input signal line K.
The “1” data is held in the AD conversion start register 24 and is output as an AD conversion start signal to the AD conversion control circuit 21 via the AD conversion start signal line L. When the AD conversion ends and the operation of the AD converter stops, the AD conversion control circuit 21 outputs an AD conversion end signal via the AD conversion end signal line M, and the value of the AD conversion start register 24 at that time. Is cleared to "0". When the AD converter is operating according to the above operation, the value of the AD conversion start register 24 is "1", and when the AD converter is stopped, the value of the AD conversion start register 24 is "0". Become. Therefore, by outputting the value of the AD conversion start register 24 to the outside through the signal line N, AD
It can notify the outside that conversion is in progress. As described above, according to the first embodiment, by making the CPU 5 stand by during the AD conversion, it is possible to prevent the noise of the power supply inside the microcomputer and the peripheral board and prevent the deterioration of the AD conversion accuracy. .. Further, in the first embodiment, an example in which the CPU operation is stopped when the AD conversion is started and the CPU operation is restarted when the AD conversion is completed has been described. The CPU calculation may be stopped only in a cycle susceptible to noise.

【手続補正4】[Procedure amendment 4]

【補正対象書類名】図面[Document name to be corrected] Drawing

【補正対象項目名】図1[Name of item to be corrected] Figure 1

【補正方法】変更[Correction method] Change

【補正内容】[Correction content]

【図1】 [Figure 1]

【手続補正5】[Procedure Amendment 5]

【補正対象書類名】図面[Document name to be corrected] Drawing

【補正対象項目名】図3[Name of item to be corrected] Figure 3

【補正方法】変更[Correction method] Change

【補正内容】[Correction content]

【図3】 [Figure 3]

【手続補正6】[Procedure Amendment 6]

【補正対象書類名】図面[Document name to be corrected] Drawing

【補正対象項目名】図4[Name of item to be corrected] Fig. 4

【補正方法】変更[Correction method] Change

【補正内容】[Correction content]

【図4】 [Figure 4]

【手続補正7】[Procedure Amendment 7]

【補正対象書類名】図面[Document name to be corrected] Drawing

【補正対象項目名】図5[Name of item to be corrected] Figure 5

【補正方法】変更[Correction method] Change

【補正内容】[Correction content]

【図5】 [Figure 5]

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 演算,制御等の処理を行うとともに、外
部信号の入力によって待機の処理を行う中央処理装置
と、アナログ信号をディジタル信号にAD変換するAD
変換器とを少なくとも備えるマイクロコンピュータにお
いて、上記AD変換器がAD変換中である時に外部に信
号を出力するAD変換検出手段を備え、上記AD変換器
がAD変換中である時には、上記AD変換検出手段の出
力信号を上記中央処理装置に入力することによって、上
記中央処理装置に待機の処理を行わせるようにしたこと
を特徴とするマイクロコンピュータ。
1. A central processing unit that performs processing such as calculation and control and also performs standby processing by inputting an external signal, and an AD that performs AD conversion of an analog signal into a digital signal.
A microcomputer provided with at least a converter comprises AD conversion detection means for outputting a signal to the outside when the AD converter is performing AD conversion, and when the AD converter is performing AD conversion, the AD conversion detection is performed. A microcomputer, characterized in that the output signal of the means is input to the central processing unit to cause the central processing unit to perform standby processing.
【請求項2】 上記AD変換器がAD変換中である時
に、上記AD変換器からの上記AD変換検出手段の出力
信号を、上記中央処理装置に入力するか否かを設定する
設定手段を備えた請求項第1項記載のマイクロコンピュ
ータ。
2. A setting means for setting whether or not the output signal of the AD conversion detecting means from the AD converter is input to the central processing unit when the AD converter is performing AD conversion. The microcomputer according to claim 1, further comprising:
【請求項3】 演算,制御等の処理を行うとともに、外
部信号の入力によって待機の処理を行う中央処理装置
と、上記外部信号を外部から入力するために設けられた
外部入力端子と、アナログ信号をディジタル信号にAD
変換するAD変換器とを少なくとも備えるマイクロコン
ピュータにおいて、上記AD変換器がAD変換中である
時に外部に信号を出力するAD変換検出手段と、このA
D変換検出手段からの出力信号を外部に出力するために
設けられた外部出力端子とを備え、上記外部入力端子と
上記外部出力端子とを接続することにより、上記AD変
換器がAD変換中である時には、上記中央処理装置に待
機の処理を行わせるようにしたことを特徴とするマイク
ロコンピュータ。
3. A central processing unit that performs processing such as calculation and control and also performs standby processing by inputting an external signal, an external input terminal provided for externally inputting the external signal, and an analog signal. AD to digital signal
In a microcomputer including at least an AD converter for converting, AD conversion detecting means for outputting a signal to the outside when the AD converter is performing AD conversion, and A
An external output terminal provided to output the output signal from the D conversion detecting means to the outside, and by connecting the external input terminal and the external output terminal, the AD converter is performing AD conversion. A microcomputer characterized in that the central processing unit is made to perform a standby process at a certain time.
JP4137811A 1992-04-30 1992-04-30 Microcomputer Pending JPH05307618A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4137811A JPH05307618A (en) 1992-04-30 1992-04-30 Microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4137811A JPH05307618A (en) 1992-04-30 1992-04-30 Microcomputer

Publications (1)

Publication Number Publication Date
JPH05307618A true JPH05307618A (en) 1993-11-19

Family

ID=15207412

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4137811A Pending JPH05307618A (en) 1992-04-30 1992-04-30 Microcomputer

Country Status (1)

Country Link
JP (1) JPH05307618A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011178305A (en) * 2010-03-02 2011-09-15 Hitachi Automotive Systems Ltd On-vehicle control device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011178305A (en) * 2010-03-02 2011-09-15 Hitachi Automotive Systems Ltd On-vehicle control device

Similar Documents

Publication Publication Date Title
EP0221577B1 (en) Microprogram control unit
US5508951A (en) Arithmetic apparatus with overflow correction means
US6175890B1 (en) Device for efficiently handling interrupt request processes
EP0686910A1 (en) Data processing system having a saturation arithmetic operation function
JPH05307618A (en) Microcomputer
US6005502A (en) Method for reducing the number of bits needed for the representation of constant values in a data processing device
JPH0793178A (en) Microcomputer diagnostic device
JP3269435B2 (en) Bus interface unit
JP3210356B2 (en) Data zero judgment device
JP3442921B2 (en) Data inspection device
JP3078138B2 (en) Variable length code generator
JP3164445B2 (en) Decimal operation instruction processor
JP3182497B2 (en) Arithmetic processing unit and instruction conversion unit
JPH10311867A (en) Semiconductor device
JPH08129510A (en) Memory data correcting device
JP2002215601A (en) Microcomputer
JP2000283750A (en) Method for correcting detected-angle data
JPH1040019A (en) Microcomputer
JP2555171B2 (en) Bit judgment method
JPH0636164B2 (en) FFT operation device
JPH03233742A (en) Data check system
JPH06202810A (en) A/d converter
JPS60218135A (en) Data processor
JPH0226252B2 (en)
JP2000252822A (en) Interrupt circuit