JPH03134782A - Microcomputer incorporating a/d converter - Google Patents

Microcomputer incorporating a/d converter

Info

Publication number
JPH03134782A
JPH03134782A JP1272891A JP27289189A JPH03134782A JP H03134782 A JPH03134782 A JP H03134782A JP 1272891 A JP1272891 A JP 1272891A JP 27289189 A JP27289189 A JP 27289189A JP H03134782 A JPH03134782 A JP H03134782A
Authority
JP
Japan
Prior art keywords
conversion
converter
register
input terminal
terminal
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.)
Granted
Application number
JP1272891A
Other languages
Japanese (ja)
Other versions
JPH0821027B2 (en
Inventor
Rika Yabui
薮井 里佳
Masahiro Nomura
昌弘 野村
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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP1272891A priority Critical patent/JPH0821027B2/en
Publication of JPH03134782A publication Critical patent/JPH03134782A/en
Publication of JPH0821027B2 publication Critical patent/JPH0821027B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To prevent the degradation in performance of the whole of a controller by providing an A/D converter with the function which automatically starts the successive A/D conversion operation of plural input terminals after the end of A/D conversion of a signal input terminal. CONSTITUTION:When '1' is only written in an operation designating register 152, an A/D converter 100 starts A/D conversion terminal designated by a terminal designating register 153. Consequently, a CPU 080 switches the A/D converter 100 to A/D conversion of all input terminals after A/D conversion of the single analog input terminal designated by the terminal designating register 153 when only one write operation to the operation designating register 152 is performed. Further, it is unnecessary to perform the masking/mask releasing operation of an interrupt signal accompanied with a series of these operations. Thus, the controller copes with the complicated A/D conversion operation without degrading the instruction execution efficiency of the CPU.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、アナログ入力信号をデノタル値に変換するA
/D変換装置を内蔵したマイクロコンピュータに関する
[Detailed Description of the Invention] [Industrial Application Field] The present invention provides an A method for converting an analog input signal into a digital value.
The present invention relates to a microcomputer with a built-in /D converter.

〔従来の技術〕[Conventional technology]

今日、ヤイクロコンピュータは、LSI技術の進歩によ
り高集積化が進み、各種の周辺ノ・−ドウエアをワンチ
ップに搭載するようになってきた。
Today, computer computers have become highly integrated due to advances in LSI technology, and various peripheral hardware has come to be mounted on a single chip.

なかでも、A/D変換器は、自動車制御やACサーボ制
御などの分野には不可欠なもので、A/D変換器内蔵マ
イクロコンピュータの需要は、非常に高いものである。
Among these, A/D converters are indispensable in fields such as automobile control and AC servo control, and the demand for microcomputers with built-in A/D converters is extremely high.

以下では、第6図用いて従来の技術を説明する。The conventional technique will be explained below using FIG. 6.

マイクロコンピュータ060は、中央処理装置(以下C
PUと略す)080と、A/D変換装置600と、前記
CPU080とA/D変換装置600とのデータのやり
とりを行う内部バス090からなる。
The microcomputer 060 is a central processing unit (hereinafter referred to as C
It consists of a CPU 080 (abbreviated as PU), an A/D conversion device 600, and an internal bus 090 for exchanging data between the CPU 080 and the A/D conversion device 600.

CPU080は、プログラム実行によってA/D変換装
置600に対するデータのリード、ライト動作を行う他
にA/D変換装置からの割り込み信号170を受は付け
る処理も行う。
The CPU 080 not only reads and writes data to the A/D converter 600 by executing a program, but also processes to accept and accept an interrupt signal 170 from the A/D converter.

A/D変換装置600は、アナログ入力を入力するため
の入力端子110〜117.入力端子110〜117の
信号の内1つを選択してA/D変換器に伝えるアナログ
マルチプレクサ(以下マルチプレクサと略す)120.
マルチプレクサ120の出力信号をA/D変換するA/
D変換器130、A/D変換器130の変換結果を格納
するA/D変換結果格納レジスタ(以下レジスタと略す
)140〜147.A/D変換の動作を制御するA/D
変換動作制御部(以下動作制御部と略す)650.所定
のA/D変換動作が終了するとCPU080に対して割
り込み処理を要求するための割り込み信号線170.マ
ルチプレクサ120に対して選択する入力端子を指定す
る入力端子指定信号線190.レジスタ140〜147
の内1つを選択する。アドレス指定信号線195.A/
D変換の動作指定を司どる動作指定レジスタ151゜変
換するべき入力端子を指定する端子指定レジスタ153
から構成される。
The A/D converter 600 has input terminals 110 to 117 . for inputting analog inputs. An analog multiplexer (hereinafter abbreviated as multiplexer) 120 that selects one of the signals at input terminals 110 to 117 and transmits it to the A/D converter.
An A/D converter for A/D converting the output signal of the multiplexer 120
A/D conversion result storage registers (hereinafter abbreviated as registers) 140 to 147 that store the conversion results of the D converter 130 and the A/D converter 130. A/D that controls A/D conversion operation
Conversion operation control section (hereinafter abbreviated as operation control section) 650. An interrupt signal line 170 is used to request interrupt processing from the CPU 080 when a predetermined A/D conversion operation is completed. An input terminal designation signal line 190 for designating the input terminal to be selected for the multiplexer 120. Registers 140-147
Choose one. Addressing signal line 195. A/
Operation specification register 151 that controls operation specification of D conversion Terminal specification register 153 that specifies input terminal to be converted
It consists of

マルチプレクサ120は、動作制御部650の指定する
入力端子を選択して、A/D変換器130にアナログ入
力信号を伝える。
Multiplexer 120 selects an input terminal specified by operation control section 650 and transmits an analog input signal to A/D converter 130 .

A/D変換器130は、マルチプレクサ】20の出力す
るアナログ信号のA/D変換を行う。
The A/D converter 130 performs A/D conversion of the analog signal output from the multiplexer 20.

レジスタ140〜147はA/D変換器130の変換結
果を動作制御部650の出力するアドレス指定信号線1
95の指定するレジスタに格納する。
Registers 140 to 147 are connected to the address designation signal line 1 through which the operation control section 650 outputs the conversion result of the A/D converter 130.
Store it in the register specified by 95.

また、レジスタ140〜147の何れのレジスタもCP
U080から読み出し可能である。
Also, any of the registers 140 to 147 is set to CP.
It can be read from U080.

動作制御部650は、A/D変換の動作を指定する動作
指定レジスタ151.変換する入力端子を指定する端子
指定レジスタ153を有する。
The operation control unit 650 includes an operation designation register 151 . It has a terminal designation register 153 that designates the input terminal to be converted.

前述の動作指定レジスタ151及び端子指定レジスタ1
53は、CPU080からアクセス可能である。
The aforementioned operation specification register 151 and terminal specification register 1
53 is accessible from the CPU 080.

動作制御部650は前記の動作指定レジスタ151及び
端子指定レジスタ153によってマルチプレクサ120
に対して選択する入力信号の指定、レジスタ140〜1
47に対してA/D変換結果を格納するレジスタを指定
する。
The operation control unit 650 controls the multiplexer 120 by using the operation designation register 151 and the terminal designation register 153.
Specifying the input signal to be selected for, registers 140 to 1
47, specifies the register that stores the A/D conversion result.

続いてA/D変換装置600の動作と前記動作制御部6
50.動作指定レジスタ151.端子指定レジスタ15
3の関係を詳細に説明する。
Next, the operation of the A/D converter 600 and the operation control section 6
50. Operation specification register 151. Terminal specification register 15
3 will be explained in detail.

通常、A/D変換装置は1つのアナログ入力端子を継続
してA/D変換し続ける場合と、復数のアナログ入力端
子を順次A/D変換して行く場合の2つの場合に対応し
ての2つの動作を行う」Yが一般的である。
Normally, an A/D converter can handle two cases: when one analog input terminal is continuously A/D converted, and when multiple analog input terminals are sequentially A/D converted. "Y" is common.

この動作切り換えを行うレジスタとして、動作指定レジ
スタ151は機能する。
The operation designation register 151 functions as a register that performs this operation switching.

(1)動作指定レジスタ151が゛″00パ、A/D変
換装置600は端子指定レジスタ153の指定する単一
のアナログ入力端子を継続してA/D変換し続ける。
(1) When the operation designation register 151 is ``0'', the A/D converter 600 continues to A/D convert the single analog input terminal specified by the terminal designation register 153.

端子指定し・シスタ153の値と端子の対応は、端子指
定レジスタ153の値がそのまま端子の番号に対応する
。即ち端子指定レジスタ153が5°゛ならば、入力端
子115を、端子指定レジスタ153が“7”なら入力
端子117を指定する。A/D変換結果は、アナログ入
力端子に対応したレジスタ(例えば、アナログ入力端子
が110ならレジスタ140、アナログ入力端子が11
5ならレジスタ145)に格納する。
Regarding the correspondence between the value of the terminal designation register 153 and the terminal, the value of the terminal designation register 153 directly corresponds to the terminal number. That is, if the terminal designation register 153 is 5°, the input terminal 115 is designated, and if the terminal designation register 153 is "7", the input terminal 117 is designated. The A/D conversion result is stored in the register corresponding to the analog input terminal (for example, if the analog input terminal is 110, register 140;
If it is 5, it is stored in the register 145).

1回のA/D変換が終了するたびに割り込み信号線17
0をアクティブ(1′′)にする。これによりレジスタ
140〜147内のA/D変換結果をCPU080に引
き取ることを要請し、再びA/D変換動作を開始し、上
記動作を繰り返す。
Interrupt signal line 17 every time one A/D conversion is completed.
Make 0 active (1''). This requests the CPU 080 to receive the A/D conversion results in the registers 140 to 147, starts the A/D conversion operation again, and repeats the above operation.

(2)動作指定レジスタ151が″1”の時、A/D変
換装置600は、全アナログ入力端子を順次A7D変換
して行く動作を行い、この場合、端子指定レジスタ15
3は無効となる。
(2) When the operation designation register 151 is "1", the A/D converter 600 performs an operation of sequentially A7D converting all analog input terminals; in this case, the terminal designation register 151
3 is invalid.

具体的には、A/D変換装置600は、アナログ入力端
子110を変換し、レジスタ140に変換結果を格納し
、続いてアナログ入力端子111を変換し、レジスタ1
41に変換結果を格納し、以下同様にして変換を行い、
アナログ入力端子117の変換を終了すると、割り込み
信号線170をアクティブ(“1“)にする。
Specifically, the A/D converter 600 converts the analog input terminal 110, stores the conversion result in the register 140, then converts the analog input terminal 111, and stores the conversion result in the register 140.
Store the conversion result in 41, perform the conversion in the same manner,
When the conversion of the analog input terminal 117 is completed, the interrupt signal line 170 is activated (“1”).

以後、再びA/D変換動作をアナログ入力端子110か
ら開始し、繰り返す。
Thereafter, the A/D conversion operation is started again from the analog input terminal 110 and repeated.

次に、A/D変換装置全体の動作をCPUの命令実行と
あわせて説明する。
Next, the operation of the entire A/D conversion device will be explained together with the execution of instructions by the CPU.

通常、各種の制御の為のA/D変換は、各入力端子を順
次A/D変換して、各入力端子の最新のA/D変換結果
を通常読み込み可能にしておく場合と、内外部の発生す
るタイミングに基いて特定端子のA/D変換を行う場合
があり、両者は混在して使用される。
Normally, A/D conversion for various types of control is carried out in two ways: one is to sequentially A/D convert each input terminal so that the latest A/D conversion result of each input terminal can be read, and the other is to A/D conversion of a specific terminal may be performed based on the timing of occurrence, and both are used in combination.

この例をとって説明すると、CPU080は、まず端子
の最新の状態を読み込み可能にできるように各入力端子
110〜117を順次A/D変換してゆく動作をさせる
為に、前述の動作指定レジスタ151に“1″を設定す
る。この動作指定により、A/D変換装置600は、各
入力端子110〜117の最新のA/D変換値をレジス
タ140〜147に保持できる。
Taking this example, the CPU 080 first registers the operation specification register described above in order to perform an operation of sequentially A/D converting each input terminal 110 to 117 so that the latest state of the terminal can be read. 151 is set to "1". This operation designation allows the A/D conversion device 600 to hold the latest A/D conversion values of each input terminal 110 to 117 in the registers 140 to 147.

尚、A/D変換装置600は、8回のA/D変換終了毎
に割り込み信号170をアクティブにし、CPU080
に割り込み処理を要求するが、特に必要な処理はない為
、CPU080側で割り込みをマスクしておく。(図5
には記述していない)次に、CPU080がプログラム
を実行中にA/D変換サブルーチンコールによってサブ
ルーチンコール時の特定端子の状態を知る為に、C,P
U080は動作指定レジスタ151に“0″を設定する
と共に変換するべき入力端子の番号を端子指定レジスタ
153に設定して、A/D変換装置を1つのアナログ入
力端子をA/D変換する動作に移行させる。
Note that the A/D conversion device 600 activates the interrupt signal 170 every time eight A/D conversions are completed, and the CPU 080 activates the interrupt signal 170.
interrupt processing is requested, but since there is no particular processing required, interrupts are masked on the CPU 080 side. (Figure 5
) Next, while the CPU 080 is executing the program, the C, P
U080 sets "0" in the operation specification register 151 and sets the number of the input terminal to be converted in the terminal specification register 153, and sets the A/D converter to the operation of A/D converting one analog input terminal. Migrate.

A/D変換装置600は、1変換終了毎に割り込み信号
170を、アクティブ(“1′”)するため、ここでは
CPU080は、割り込みをマスクせず、割り込み信号
170がアクティブ(” l ” )になる度に、A/
D変換結果をCPU080に取込み、必要な数だけA/
D変換を行った後、再び動作指定レジスタ151に“1
′”を設定して、前述の各入力端子110〜117を順
次A/D変換する動作に切り換えると同時に割り込みを
マスクする。
Since the A/D converter 600 activates (“1′”) the interrupt signal 170 every time one conversion is completed, the CPU 080 does not mask the interrupt and makes the interrupt signal 170 active (“l”). Every time, A/
Load the D conversion results into the CPU080 and convert as many A/
After performing D conversion, “1” is written to the operation specification register 151 again.
``'' to switch to the operation of sequentially A/D converting each of the input terminals 110 to 117, and at the same time mask interrupts.

以上の動作をプログラム上のA/D変換サブルーチンコ
ールの度に実行する。
The above operations are executed every time the A/D conversion subroutine is called on the program.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

従来のA/D変換装置は、特定端子のA/D変換と全端
子順次A/D変換の両方の動作をさせる場合に、CPU
の命令によって動作を切り換える操作を行う必要があり
、また割り込みフラグのマスク、マスク解除といった処
理が必要である。
In conventional A/D conversion devices, when performing both A/D conversion of a specific terminal and sequential A/D conversion of all terminals, the CPU
It is necessary to perform an operation to switch the operation according to the instruction, and it is also necessary to perform processing such as masking and unmasking of interrupt flags.

この操作は、A/D変換の動作を切り換える度に付きま
とう為、A/D変換動作の切り換えが多発すると、前述
の動作切り換え操作のための命令実行が多くなり、CP
Uが本来実行するべき制御のためのプログラム実行に対
して有効な処理の割合が低下し、制御装置全体の性能低
下を招いてしまう。
This operation is involved every time the A/D conversion operation is switched, so if the A/D conversion operation is switched frequently, the number of commands executed for the above-mentioned operation switching operation increases, and the CP
The ratio of effective processing to the program execution for control that U should originally execute decreases, resulting in a decrease in the performance of the entire control device.

〔課題を解決するための手段〕[Means to solve the problem]

本発明は、中央処理装置と、複数のアナログ入力端子と
、複数のアナログ入力端子のうちの1つを選択するアナ
ログ入力選択手段と、アナログ入力選択手段によって選
択されたアナログ入力端子のアナロタ値をデジタル値に
変換するA/D変換器と、A/D変換器の変換結果を格
納する複数の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変換起動要求手段によって切り替るA/
D変換動作制御手段を有する。
The present invention includes a central processing unit, a plurality of analog input terminals, an analog input selection means for selecting one of the plurality of analog input terminals, and an analog value of the analog input terminal selected by the analog input selection means. An A/D converter that converts into a digital value, a plurality of A/D conversion result storage registers that store the conversion results of the A/D converter, and a plurality of A/D conversion result storage registers that store the conversion results of the A/D converter.
A/D that specifies one of the /D conversion result storage registers
Conversion result storage destination designation means, A/D conversion start request means for requesting the A/D converter to start A/D conversion, and A/D conversion operation designation register for designating the conversion operation of the A/D converter. and, by sequentially selecting a plurality of analog input terminals by the analog input selection means based on the specification of the A/D conversion operation specification register, the analog inputs from the plurality of analog input terminals are selected by the A/D converter. Sequential A
A/D conversion activation requesting means switches between an operation of A/D conversion and an operation of selectively A/D converting one of the plurality of analog input terminals by the A/D converter.
It has D conversion operation control means.

さらに、本発明では、上記A/D変換器に、複数のアナ
ログ入力端子に対応したA/D変換の開始を要求する複
数のA/D変換起動要求手段と、前記複数のA/D変換
起動要求手段からの複数のA/D変換の要求に対して、
所定の優先順位に基づいてその1つを選択するA/D変
換起動要求判定手段を有する。
Furthermore, in the present invention, a plurality of A/D conversion start request means for requesting the A/D converter to start A/D conversion corresponding to the plurality of analog input terminals; In response to multiple A/D conversion requests from the requesting means,
It has A/D conversion activation request determination means for selecting one of them based on a predetermined priority order.

さらにまた、本発明では、中央処理装置によって書き換
え可能な優先順位指定レジスタと、複数のA/D変換起
動要求手段からの複数のA/D変換の要求に対して優先
順位指定レジスタで指定された優先順位に基づいてその
1つを選択するA/D変換起動要求判定手段を有する。
Furthermore, in the present invention, the priority designation register is rewritable by the central processing unit, and the priority designation register specifies a plurality of A/D conversion requests from a plurality of A/D conversion activation request means. It has A/D conversion activation request determination means for selecting one of them based on the priority order.

したがって、 ■ 特定端子のA/D変換動作が終了後にCPUの命令
実行の依らず、自動的に入力端子を順次A/D変換する
動作に移行する機能を持つことにより、A/D変換の動
作切り換えのためのCPUのオーバーヘッドを低減させ
ることができる。
Therefore, by having a function that automatically shifts to sequential A/D conversion of input terminals without depending on the execution of instructions by the CPU after the A/D conversion operation of a specific terminal is completed, the A/D conversion operation can be improved. CPU overhead for switching can be reduced.

■ 個々のアナログ入力端子に対応する外部からのA/
D変換要求信号線により発生した、個々のアナログ人力
シン子についてのA/D変換の要求に対して、CPUの
命令実行の依らず、所定の優先順位に基すいて、常によ
り優先順位の高い要求を受は付けてA/D変換を起動す
る機能を持つことにより、外部からの要求だけで、全て
の入力端子の中から、常により重要度の高い入力端子に
ついてのA/D変換を優先的に実行できる。
■ External A/A corresponding to each analog input terminal
Regarding A/D conversion requests for individual analog human-powered synchronizers generated by the D conversion request signal line, requests with higher priority are always issued based on a predetermined priority order, regardless of CPU instruction execution. By having the function to start A/D conversion by accepting the input terminal, A/D conversion can always be given priority to the input terminal with higher importance from among all input terminals just by an external request. can be executed.

■ 個々のアナログ入力端子に対応する外部からのA/
D変換要求信号により発生した、個々のアナログ入力端
子についてのA/D変換の要求に対して、必要に応じて
プログラマブルに優先順位を実行中に書き換えることが
可能で、その優先順位の高い要求を受けてA/D変換を
起動する機能を持つことにより、外部がらの要求だけで
、全ての入力端子の中からCPUによって指定された重
要度の高い入力端子についてA/D変換を優先的に実行
できる。
■ External A/A corresponding to each analog input terminal
For A/D conversion requests for individual analog input terminals generated by D conversion request signals, the priorities can be rewritten programmably during execution as necessary, and requests with higher priorities can be By having the function to start A/D conversion in response to a request from an external source, A/D conversion can be performed preferentially for input terminals with high importance specified by the CPU from among all input terminals. can.

〔実施例〕〔Example〕

次に、本発明の実施例について図面を参照して説明する
Next, embodiments of the present invention will be described with reference to the drawings.

第1図は、本発明の第1の実施例で、マイクロコンピュ
ータ010は、CPU080と、A/D変換装置100
と、前記CPU080とA/D変換装置100とのデー
タのやりとりを行う内部バス090からなる。
FIG. 1 shows a first embodiment of the present invention, in which a microcomputer 010 includes a CPU 080 and an A/D converter 100.
and an internal bus 090 for exchanging data between the CPU 080 and the A/D conversion device 100.

CPU080は、プログラム実行によってA/D変換装
置100に対するデータのリード、ライト動作を行う他
にA/D変換装置からの割り込み信号170を受は付け
る処理も行う。
The CPU 080 not only reads and writes data to the A/D converter 100 by executing a program, but also processes to accept and accept an interrupt signal 170 from the A/D converter.

A/D変換装置100は、アナログ信号を大刀するため
の入力端子110〜117、マルチプレクサ120、マ
ルチプレクサ120の出力信号をA/D変換するA/D
変換器130、A/D変換器130の変換結果を格納す
るレジスタ140〜147、A/D変換の動作を制御す
る動作制御部150、A/D変換の開始を要求するA/
D変換要求信号線160、所定のA/D変換動作が終了
するとCPU080に対して割り込み処理を要求するた
めの割り込み信号線170、マルチプレクサ120に対
して選択する入力端子を指定する入力端子指定信号線1
90、レジスタ140〜147の内1つを選択するアド
レス信号線195、A/D変換の制御を司どる動作指定
レジスタ151゜152)変換するべき入力端子を指定
する端子指定レジスタ153、動作指定レジスタ152
に1′を書き込む動作を検出する書込み検出回路(以下
検出回路と略す)180、前記動作制御レジスタ152
に“1“が書込まれたことを示す信号線(以下変換信号
線と略す)185から構成される。
The A/D conversion device 100 includes input terminals 110 to 117 for converting analog signals, a multiplexer 120, and an A/D converter for A/D converting the output signal of the multiplexer 120.
converter 130, registers 140 to 147 that store the conversion results of the A/D converter 130, an operation control unit 150 that controls the operation of A/D conversion, and an A/D converter that requests the start of A/D conversion.
A D conversion request signal line 160, an interrupt signal line 170 for requesting interrupt processing from the CPU 080 when a predetermined A/D conversion operation is completed, and an input terminal designation signal line for specifying an input terminal to be selected for the multiplexer 120. 1
90, address signal line 195 for selecting one of the registers 140 to 147, operation specification register 151 for controlling A/D conversion, 152) terminal specification register 153 for specifying the input terminal to be converted, operation specification register 152
a write detection circuit (hereinafter abbreviated as a detection circuit) 180 that detects an operation of writing 1' to the operation control register 152;
A signal line (hereinafter abbreviated as a conversion signal line) 185 indicates that "1" has been written to the signal line.

次にA/D変換装置100の各部の説明をする。Next, each part of the A/D converter 100 will be explained.

マルチプレクサ120は、動作制御部150の指定する
入力端子を選択して、A/D変換器130にアナログ入
力信号を伝える。
Multiplexer 120 selects an input terminal designated by operation control section 150 and transmits an analog input signal to A/D converter 130 .

A/D変換器130は、マルチプレクサ120の出力す
るアナログ信号のA/D変換を行う。
The A/D converter 130 performs A/D conversion of the analog signal output from the multiplexer 120.

レジスタ140〜147はA/D変換器130の変換結
果を動作制御部150の出力するアドレス指定信号線1
95の指定するレジスタに格納する。
Registers 140 to 147 are connected to address designation signal lines 1 through which the operation control section 150 outputs the conversion results of the A/D converter 130.
Store it in the register specified by 95.

また、レジスタ140〜147の何れのレジスタもCP
U080から読み出し可能である。
Also, any of the registers 140 to 147 is set to CP.
It can be read from U080.

動作制御部150は、A/D変換の動作を指定する2つ
の動作指定レジスタ151,152)及び変換するべき
入力端子を指定する端子指定レジスタ153を有し、動
作指定レジスタ151゜152)端子指定レジ7!、夕
153はCPUO8,0からアクセス可能である。
The operation control unit 150 has two operation specification registers 151 and 152) that specify the operation of A/D conversion and a terminal specification register 153 that specifies the input terminal to be converted. Cash register 7! , 153 can be accessed from CPUO8,0.

動作制御部150は前記の動作指定レジスタ151 、
 端子指定レジスタ153によってマルチプレクサ12
0に対して選択する入力信号の指定、レジスタ140〜
147に対してA/D変換結果を格納するレジスタを指
定する。
The operation control unit 150 includes the operation specification register 151,
Multiplexer 12 by terminal designation register 153
Designation of input signal to select for 0, registers 140~
147, specifies the register that stores the A/D conversion result.

また、A/D変換要求信号線160は、動作制御部15
0に対してA/D変換動作の切り換えタイミングを与え
る。
Further, the A/D conversion request signal line 160 is connected to the operation control unit 15.
0 to give the switching timing of the A/D conversion operation.

端子指定レジスタ153は、単一の端子をA/D変換す
る場合に変換するべき入力端子を指定するレジスタで、
端子指定レジスタ153の値がそのまま入力端子を指定
する。
The terminal designation register 153 is a register that designates an input terminal to be converted when a single terminal is A/D converted.
The value of the terminal designation register 153 directly designates the input terminal.

即ち、端子指定レジスタ153が“3′″なら入力端子
113を指定し、端子指定レジスタ153が°6″なら
入力端子116を指定する。
That is, if the terminal designation register 153 is "3'", the input terminal 113 is designated, and if the terminal designation register 153 is "6", the input terminal 116 is designated.

検出回路180は、上記の動作制御レジスタ152に′
1゛°を書込む動作を検出すると、変換信号線185を
アクティブ(” l ” )にして動作制御部150に
対し動作制御レジスタ152に“1″”が書込まれたこ
とを伝える。
The detection circuit 180 inputs '' to the operation control register 152 described above.
When the operation of writing 1° is detected, the conversion signal line 185 is activated (“l”) to inform the operation control unit 150 that “1” has been written to the operation control register 152.

続いてA/D変換装置100の動作と動作制御部150
、動作指定レジスタ151,152)端子指定レジスタ
153、A/D変換要求信号線160、変換信号線18
5の関係を詳細に説明する。
Next, the operation of the A/D converter 100 and the operation control section 150
, operation specification register 151, 152) terminal specification register 153, A/D conversion request signal line 160, conversion signal line 18
5 will be explained in detail.

通常、A/D変換装置は1つのアナログ入力端子を継続
してA/D変換し続ける場合と、複数のアナログ入力端
子を順次A/D変換して行く場合の2つの場合に対応し
ての2つの動作を行う事が一般的である。
Normally, an A/D converter can handle two cases: when one analog input terminal is continuously A/D converted, and when multiple analog input terminals are sequentially A/D converted. It is common to perform two operations.

この動作切り換えを行うレジスタとして、動作指定レジ
スタ151,152は機能する。以下に動作指定レジス
タの値とA/D変換動作の関係を説明する。
Operation designation registers 151 and 152 function as registers that perform this operation switching. The relationship between the value of the operation designation register and the A/D conversion operation will be explained below.

(1)  動作指定レジスタ152が“I Q 、+1
、動作指定レジスタ151が°“0′”の時、 A/D変換装置100は前述の端子指定レジスタ153
の指定する単一のアナログ入力端子を継続してA/D変
換し続ける。A/D変換結果は、アナログ入力端子に対
応したレジスタ(例えば、アナログ入力端子が114な
らレジスタ144)に格納する。
(1) The operation specification register 152 is “IQ, +1
, when the operation designation register 151 is "0'", the A/D converter 100 registers the terminal designation register 153 described above.
A/D conversion continues for the single analog input terminal specified by . The A/D conversion result is stored in a register corresponding to the analog input terminal (eg, register 144 if the analog input terminal is 114).

1回のA/D変換が終了するたびに割り込み信号線17
0をアクティブ(′″1′”)にする。これによりレジ
スタ140〜147内のA/D変換結果をCPU080
に引き取ることを要請し、再びA/D変換動作を開始し
、上記動作を繰り返す。
Interrupt signal line 17 every time one A/D conversion is completed.
Make 0 active (''1''). This allows the A/D conversion results in registers 140 to 147 to be sent to the CPU080.
The A/D conversion operation is started again, and the above operation is repeated.

(2)動作指定レジスタ152が°“0゛、動作指定レ
ジスタ151が“Ill“の時、 A/D変換装置100は、全アナログ入力端子を順次A
/D変換して行く動作を行い、この場合、端子指定レジ
スタ153は無効となる。
(2) When the operation specification register 152 is “0” and the operation specification register 151 is “Ill”, the A/D converter 100 sequentially inputs all analog input terminals to A.
/D conversion is performed, and in this case, the terminal designation register 153 becomes invalid.

具体的には、アナログ入力端子110を変換し、レジス
タ140に変換結果を格納し、続いてアナログ入力端子
111を変換し、レジスタ141に変換結果を格納し、
以下同様にして変換を行い、アナログ入力端子117の
変換を終了すると、割り込み信号線170をアクティブ
(“1パ)にする。
Specifically, the analog input terminal 110 is converted, the conversion result is stored in the register 140, the analog input terminal 111 is converted, the conversion result is stored in the register 141,
Thereafter, conversion is performed in the same manner, and when the conversion of the analog input terminal 117 is completed, the interrupt signal line 170 is activated (“1 pass”).

以後、再びA/D変換動作をアナログ入力端子110か
ら開始し、繰り返す。
Thereafter, the A/D conversion operation is started again from the analog input terminal 110 and repeated.

(3)動作指定レジスタ152が、1′″の時この動作
指定レジスタ151の値に拘らず動作指定レジスタ15
2への書込み動作によって制御される。
(3) When the operation specification register 152 is 1'', regardless of the value of this operation specification register 151, the operation specification register 152
Controlled by write operations to 2.

即ち、CPU 080が動作指定レジスタ152に対し
て“′lパを書込む動作を行うと、検出回路180が“
1”を書込まれたことを検出し、変換信号線185をア
クティブ(“1″)にする。
That is, when the CPU 080 performs an operation of writing "'lpa" to the operation designation register 152, the detection circuit 180 writes "
It is detected that "1" has been written, and the conversion signal line 185 is made active ("1").

これにより、A/D変換装置100は、端子指定レジス
タ153の指定する入力端子のA/D変換を1回行う。
Thereby, the A/D conversion device 100 performs A/D conversion of the input terminal specified by the terminal specification register 153 once.

さらに、A/D変換結果を(1)の例に習って、入力端
子に対応したレジスタ140〜147の何れかの1つに
格納すると、割り込み信号170をアクティブ(” 1
 ” )にしてCPU080に、変換結果の引ぎ取りを
要求する。
Furthermore, following the example in (1), if the A/D conversion result is stored in one of the registers 140 to 147 corresponding to the input terminal, the interrupt signal 170 is activated (" 1
”) to request the CPU 080 to take over the conversion result.

次に全入力端子をA/D変換する動作に移行する。Next, the operation shifts to A/D conversion of all input terminals.

但し、全入力端子をA/D変換する動作では、割り込み
信号170はアクティブ(“1“)にしない。
However, in the operation of A/D converting all input terminals, the interrupt signal 170 is not activated (“1”).

また、動作制御部150は、A/D変換要求信号160
によって外部からのA/D変換の要求を受けると、A/
D変換装置100に対して、CPU080が動作指定レ
ジスタ152に“1′を当込むことによって起動される
動作、すなわち、CPU080が動作指定レジスタ15
2に対してII I nを書込むと、検出回路180が
1°゛を書込まれたことを特徴とする検出して変換信号
線185をアクティブ(°゛1”)にし、これにより、
A/D変換装置100は、端子指定レジスタ153の指
定する入力端子のA/D変換を1回行う、という動作と
同様の動作をさせる。
The operation control unit 150 also outputs an A/D conversion request signal 160.
When an external A/D conversion request is received by
An operation that is activated by the CPU 080 assigning "1" to the operation specification register 152 for the D conversion device 100;
When II I n is written for 2, the detection circuit 180 detects that 1° has been written and activates the conversion signal line 185 (°1”), thereby
The A/D conversion device 100 performs the same operation as performing A/D conversion of the input terminal specified by the terminal designation register 153 once.

即ち、A/D変換装置100は、A/D変換要求信号1
60がアクティブ(“’ l ” )になると、端子指
定レジスタ153の指定する入力端子のA/D変換を行
い、1変換が終了すると再び全入力端子をA/D変換す
る動作に移行する。
That is, the A/D conversion device 100 receives the A/D conversion request signal 1.
When 60 becomes active ("'l"), A/D conversion is performed on the input terminal designated by the terminal designation register 153, and when one conversion is completed, the operation shifts to A/D conversion on all input terminals again.

次に、本発明のA/D変換装置全体の動作について説明
する。
Next, the operation of the entire A/D conversion device of the present invention will be explained.

CPU080は、単に特定端子のA/D変換のみを実行
したい場合は、動作指定レジスタ152に“0”、動作
指定レジスタ151に“0”を設定すればよく、同様に
複数の入力端子のA/D変換のみを実行したい場合は、
動作指定レジスタ152に0′”、動作指定レジスタ1
51に1″を設定すればよい。
If the CPU 080 simply wants to perform A/D conversion of a specific terminal, it is sufficient to set "0" to the operation specification register 152 and "0" to the operation specification register 151. If you want to perform only D conversion,
0'” in operation specification register 152, operation specification register 1
51 may be set to 1''.

前述の両方の動作を行わせたい場合は、動作指定レジス
タ152に゛1パを設定すればよい。
If it is desired to perform both of the above-mentioned operations, the operation designation register 152 may be set to ``1''.

例えば、CPU080がプログラムを実行中にA/D変
換サブルーチンコールによってザブルーチンコール時の
特定端子の状態を知る場合には、単に動作指定レジスタ
152に″“1″を書き込む操作を行うだけでA/D変
換装置100は、端子指定レジスタ153の指定する入
力端子のA/D変換を行った後に、全入力端子のA/D
変換へ移行する。
For example, if the CPU 080 wants to know the state of a specific terminal at the time of a subroutine call by an A/D conversion subroutine call while executing a program, the CPU 080 can simply write ``1'' to the operation specification register 152. After performing A/D conversion on the input terminal specified by the terminal specification register 153, the D conversion device 100 performs A/D conversion on all input terminals.
Move to conversion.

従ってCPU080は、ただ1回の動作指定レジスタ1
52の書き込み操作のみで、A/D変換装置100を端
子指定レジスタ153の指定する単一のアナログ入力端
子をA/D変換する動作をさせた後に全入力端子をA/
D変換する動作に移行させることができる。
Therefore, the CPU 080 uses only one operation specification register 1.
52, the A/D converter 100 performs A/D conversion on a single analog input terminal specified by the terminal specification register 153, and then A/D converts all input terminals.
It is possible to shift to a D conversion operation.

しかも、この一連の動作に付随して割り込み信号のマス
ク、マスク解除の操作を行う必要がない。
Furthermore, there is no need to perform operations for masking and unmasking interrupt signals in conjunction with this series of operations.

また、A/D変換要求信号線160によって、CPU0
80の命令実行によらず、外部事象の変化に同期して上
記動作を行うことも可能であり、この場合、CPUは単
にA/D変換結果を引き取る動作のみを行う。
In addition, the A/D conversion request signal line 160 allows the CPU0
It is also possible to perform the above operations in synchronization with changes in external events, without depending on the execution of the instructions in step 80. In this case, the CPU simply performs the operation of receiving the A/D conversion results.

次に、本発明の第2の実施例について第2図を参照して
説明する。マイクロコンピュータ020は、CPU08
0と、A/D変換装置200と、前記CPU080とA
/D変換装置200とのデータのやりとりを行う内部バ
ス090からなる。
Next, a second embodiment of the present invention will be described with reference to FIG. The microcomputer 020 is a CPU08
0, the A/D converter 200, the CPU 080, and the A/D converter 200.
It consists of an internal bus 090 that exchanges data with the /D conversion device 200.

CPU080は、プログラム実行によってA/D変換装
置200に対するデータのリード、ライト動作を行う他
にA/D変換装置からの割り込み信号170を受は付け
る処理も行う。
The CPU 080 not only reads and writes data to the A/D converter 200 by executing a program, but also processes to accept and accept an interrupt signal 170 from the A/D converter.

A/D変換装置200は、アナログ信号を入力するため
の入力端子110〜117、マルチプレクサ120、マ
ルチプレクサ120の出力信号をA/D変換するA/D
変換器130、A/D変換器130の変換結果を格納す
るレジスタ140〜147、A/D変換の動作を制御す
る動作制御部250、A/D変換の開始を要求するA/
D変換要求信号線160、所定のA/D変換動作が終了
するとCPU080に対して割り込み処理を要求するた
めの割り込み信号線170、マルチプレクサ120に対
して選択する入力端子を指定する入力端子指定信号線1
90、レジスタ140−147の内1つを選択するアド
レス指定信号線195、A/D変換の制御を司どる動作
指定レジスタ151゜152)変換するべき入力端子を
指定する端子指定レジスタ153、動作指定レジスタ1
52に“I IIを書込む動作を検出する書込み検出回
路(以下検出回路と略す)180、前記動作制御レジス
タ152に“1″が書込まれたことを示す信号線(以下
変換信号線と略す)185から構成される。
The A/D conversion device 200 includes input terminals 110 to 117 for inputting analog signals, a multiplexer 120, and an A/D converter for A/D converting the output signal of the multiplexer 120.
converter 130, registers 140 to 147 that store the conversion results of the A/D converter 130, an operation control unit 250 that controls the operation of A/D conversion, and an A/D converter that requests the start of A/D conversion.
A D conversion request signal line 160, an interrupt signal line 170 for requesting interrupt processing from the CPU 080 when a predetermined A/D conversion operation is completed, and an input terminal designation signal line for specifying an input terminal to be selected for the multiplexer 120. 1
90, Address designation signal line 195 for selecting one of the registers 140-147, Operation designation register 151 for controlling A/D conversion, 152) Terminal designation register 153 for designating the input terminal to be converted, Operation designation register 1
52, a write detection circuit (hereinafter abbreviated as a detection circuit) 180 detects the operation of writing "I II", and a signal line (hereinafter abbreviated as a conversion signal line) indicating that "1" is written in the operation control register 152. )185.

次にA/D変換装置200の各部の説明をする。Next, each part of the A/D converter 200 will be explained.

マルチプレクサ120.A/D変換器130゜レジスタ
140〜1472割込み信号線170.入力信号指定線
190.アドレス信号線指定195の動作は、実施例1
と同様であるため、ここでの説明は省略する。
Multiplexer 120. A/D converter 130° registers 140-1472 interrupt signal line 170. Input signal designation line 190. The operation of the address signal line specification 195 is as follows in the first embodiment.
Since it is the same as that, the explanation here is omitted.

以下では本実施例における、動作指定レジスタ151.
152の値、端子指定レジスタ153と、A/D変換装
置200の動作関係を説明する。
In the following, the operation specification register 151.
The operational relationship between the value of 152, the terminal designation register 153, and the A/D conversion device 200 will be explained.

(1)  動作指定レジスタ152が“0°“、動作指
定レジスタ151が0”の時、 (2)動作指定レジスタ152が“0°′、動作指定レ
ジスタ151が“1″の時、 (3)動作指定レジスタ152が“1−動作指定レジス
タ151が“0″の時、 以上の場合については、実施例1における(1)。
(1) When the operation specification register 152 is “0°” and the operation specification register 151 is “0”, (2) When the operation specification register 152 is “0°” and the operation specification register 151 is “1”, (3) When the operation specification register 152 is "1" and the operation specification register 151 is "0", the above case is described in (1) in the first embodiment.

(2)、 (3)と同様であるので、説明は省略する。Since this is the same as (2) and (3), the explanation will be omitted.

(4)動作指定レジスタ152が°゛l−動作指定レジ
スタ151が°“1°“の時、 このとき、A/D変換装置200においてCPU080
が動作指定レジスタ152に対してl″を書込む動作を
行うと、検出回路180が“1”を書込まれたことを検
出し、変換信号線185をアクティブ(“l”)にする
(4) When the operation designation register 152 is “1°” and the operation designation register 151 is “1°”, at this time, the CPU 080 in the A/D converter 200
When the controller performs an operation of writing l″ into the operation designation register 152, the detection circuit 180 detects that “1” has been written and makes the conversion signal line 185 active (“l”).

これにより、A/D変換装置200は、端子指定レジス
タ153の指定する入力端子のA/D変換を4回行い、
変換結果をレジスタ140〜143に格納すると、割り
込み信号170をアクティブ(” 1 ” )にし、C
PU080に、4回の変換結果の引き取りを要求する。
As a result, the A/D conversion device 200 performs A/D conversion of the input terminal specified by the terminal specification register 153 four times, and
When the conversion results are stored in registers 140 to 143, the interrupt signal 170 is activated (“1”) and the C
Request the PU080 to receive the results of the four conversions.

以後A/D変換装置200は、入力端子114〜117
を順次A/D変換する動作に移行し、変換結果は、レジ
スタ144〜147に格納する。
Thereafter, the A/D converter 200 uses the input terminals 114 to 117.
The operation shifts to sequential A/D conversion of , and the conversion results are stored in registers 144 to 147.

但し、入力端子114〜117をA/D変換する動作で
は、割り込み信号170はアクティブ(“1”)にしな
い。
However, in the operation of A/D converting the input terminals 114 to 117, the interrupt signal 170 is not activated ("1").

また動作制御部250は、A/D変換要求信号160に
よって外部からのA/D変換の要求を受けると、A/D
変換装置200に対して、CPUが動作指定レジスタ1
52に“1″を書込むことによって起動される動作、す
なわち、CPU080が動作指定レジスタ152に対し
て°′1”を書き込むと、検出回路180が“l”を書
き込まれたことを検出して変換信号線185をアクティ
ブ(ビ)にし、これにより、A/D変換装置200は、
端子指定レジスタ153の指定する入力端子のA/D変
換を4回行う、という動作と同様の動作をさせる。
Further, when the operation control unit 250 receives an external A/D conversion request using the A/D conversion request signal 160, the operation control unit 250 converts the A/D conversion
For the conversion device 200, the CPU specifies operation specification register 1.
When the CPU 080 writes "1" to the operation designation register 152, the detection circuit 180 detects that "l" has been written. The conversion signal line 185 is activated (bi), and thereby the A/D conversion device 200
The same operation as performing A/D conversion of the input terminal designated by the terminal designation register 153 four times is performed.

即ち、A/D変換装置200は、A/D変換要求信号1
60がアクティブ(” l ” )になると、前述の(
3)または、(4)の動作を行う。
That is, the A/D conversion device 200 receives the A/D conversion request signal 1.
When 60 becomes active ("l"), the above-mentioned (
3) Or perform operation (4).

次に、本発明のA/D変換装置全体の動作について説明
する。
Next, the operation of the entire A/D conversion device of the present invention will be explained.

CPU080は、単に特定端子のA/D変換のみを実行
したい場合は、実施例1と同様に、動作指定レジスタ1
52に′0”、動作指定レジスタ151に”0“を設定
すればよく、同様に複数の入力端子のA/D変換のみを
実行したい場合は、動作指定レジスタ152に“0“、
動作指定レジスタ151に′1”を設定すればよい。ま
た、前述の両方の動作を行わせたい場合は、動作指定レ
ジスタ152に1″、動作指定レジスタ151に″゛0
0パ定すればよい。
When the CPU 080 simply wants to perform A/D conversion of a specific terminal, the CPU 080 sets the operation specification register 1 as in the first embodiment.
52 to '0' and the operation specification register 151 to '0'.Similarly, if you want to execute only A/D conversion of multiple input terminals, set the operation specification register 152 to '0',
All you need to do is set the operation specification register 151 to ``1''.Also, if you want to perform both of the above operations, set 1'' to the operation specification register 152 and ``0'' to the operation specification register 151.
Just set it to 0.

例えば、CPU080がプログラムを実行中にA/D変
換サブルーチンコールによってザブルーチンコール時の
特定端子の状態を知る場合に、入力端子のアナログ値の
誤差、ノイズなどの影響を取り除くために複数のA/D
変換結果を平均化することがある。
For example, when the CPU 080 uses an A/D conversion subroutine call to know the state of a specific terminal at the time of a subroutine call while executing a program, multiple A/D converter subroutines are D
Conversion results may be averaged.

この時、CPU080は、動作指定レジスタ151.1
52ともに“1″、を設定すればよい。
At this time, the CPU 080 selects the operation specification register 151.1.
52 may be set to "1".

上記動作指定レジスタ151,152に対する設定を行
うだけでA/D変換装置200は、端子指定レジスタの
指定する入力端子のA/D変換を4回行った後に複数の
入力端子のA/D変換動作へ移行する。
By simply setting the operation designation registers 151 and 152, the A/D conversion device 200 performs A/D conversion of the input terminal specified by the terminal designation register four times, and then performs A/D conversion of the plurality of input terminals. Move to.

従ってCPU080は、ただ1回の動作指定レジスタ1
51,152の書き込み操作のみで、A/D変換装置に
1つのアナログ入力端子を4回A/D変換させて、その
後に複数の入力端子なA/D変換する動作に移行させる
うえに割り込み信号のマスク、マスク解除の操作を一切
必要と、しない。
Therefore, the CPU 080 uses only one operation specification register 1.
51 and 152 write operations cause the A/D converter to A/D convert one analog input terminal four times, and then move on to A/D converting multiple input terminals, and also generates an interrupt signal. No masking or unmasking operations are required.

また、同様にしてA/D変換要求信号線160によって
、CPU080の命令実行によらず、外部事象の変化に
同期して上記の動作を行なうことも可能である。この場
合、CPUは単にA/D変換結果を引き取る動作のみを
行なう。
Similarly, the A/D conversion request signal line 160 allows the above operation to be performed in synchronization with changes in external events, without depending on the execution of instructions by the CPU 080. In this case, the CPU simply performs the operation of receiving the A/D conversion results.

次に、本発明の第3の実施例について第3図を参照して
説明する。マイクロコンピュータ030は、CPU08
0と、A/D変換装置300と、前記CPU080とA
/D変換装置300とのデータのやりとりを行う内部バ
ス090からなる。
Next, a third embodiment of the present invention will be described with reference to FIG. The microcomputer 030 is a CPU08
0, the A/D converter 300, the CPU 080, and the A/D converter 300.
It consists of an internal bus 090 that exchanges data with the /D conversion device 300.

CPU080は、プログラム実行によってA/D変換装
置300に対するデータのリード、ライト動作を行う他
にA/D変換装置からの割り込み信号170を受は付け
る処理も行う。
The CPU 080 not only reads and writes data to the A/D converter 300 by executing programs, but also performs processing to accept and accept interrupt signals 170 from the A/D converter.

A/D変換装置300は、アナログ信号を入力するため
の入力端子110〜117、マルチプレクサ120、マ
ルチプレクサ120の出力信号をA/D変換するA/D
変換器130、A/D変換器130の変換結果を格納す
るレジスタ140〜147、A/D変換の動作を制御す
る動作制御部350、入力端子110〜117について
のA/D変換の開始を要求するA/D変換要求信号線1
60〜167、所定のA/D変換動作が終了するとCP
U080に対して割り込み処理を要求するための割り込
み信号線170、マルチプレクサ120に対して選択す
る入力端子を指定する入力端子指定信号線19o、レジ
スタ140〜147の内1つを選択するアドレス指定信
号線195、A/D変換の制御を司どる動作指定レジス
タ151゜152)変換するべき入力端子を指定する端
子指定レジスタ153、動作指定レジスタ152に“l
”を書込む動作を検出する書込み検出回路(以下検出回
路と略す)180、前記動作制御レジスタ152に1′
°が書込まれたことを示す信号線(以下変換信号線と略
す)185から構成される。
The A/D conversion device 300 includes input terminals 110 to 117 for inputting analog signals, a multiplexer 120, and an A/D converter for A/D converting the output signal of the multiplexer 120.
Converter 130, registers 140 to 147 that store conversion results of A/D converter 130, operation control unit 350 that controls A/D conversion operations, and requests to start A/D conversion for input terminals 110 to 117. A/D conversion request signal line 1
60 to 167, when the predetermined A/D conversion operation is completed, CP
An interrupt signal line 170 for requesting interrupt processing from U080, an input terminal designation signal line 19o for designating the input terminal to be selected for the multiplexer 120, and an address designation signal line for selecting one of the registers 140 to 147. 195, operation specification register 151, which controls A/D conversion, 152) Terminal specification register 153, which specifies the input terminal to be converted, and operation specification register 152.
A write detection circuit (hereinafter abbreviated as a detection circuit) 180 that detects the operation of writing “1'
It is composed of a signal line 185 (hereinafter abbreviated as a conversion signal line) indicating that ° has been written.

次にA/D変換装置300の各部の説明をする。Next, each part of the A/D converter 300 will be explained.

マ/L、チプレクザ120、A/D変換器130、レジ
スタ140〜147、割込み信号線170、入力信号指
定線190、アドレス指定信号線195、検出回路18
0、変換信号線185の動作は、実施例1と同様である
ため、ここでの説明は省略する。
MA/L, multiplexer 120, A/D converter 130, registers 140 to 147, interrupt signal line 170, input signal designation line 190, address designation signal line 195, detection circuit 18
0. The operation of the conversion signal line 185 is the same as that in the first embodiment, so a description thereof will be omitted here.

動作制御部350は、動作指定レジスタ151゜152
)及び端子指定レジスタ153を有しており、動作指定
レジスタ151,152はCPU080からアクセス可
能であり、端子指定レジスタ153はCPU080から
アクセス可能であるとともに、動作制御部350によっ
ても書き込みが可能である。
The operation control unit 350 has operation specification registers 151 and 152.
) and a terminal designation register 153, the operation designation registers 151 and 152 are accessible from the CPU 080, and the terminal designation register 153 is accessible from the CPU 080 and can also be written by the operation control unit 350. .

端子指定レジスタ153は、その値がそのまま入力端子
を指定していて、例えば、端子指定レジスタ153が“
3″なら入力端子113を指定し、端子指定レジスタ1
53が6′なら入力端子116を指定する。
The value of the terminal specification register 153 directly specifies the input terminal. For example, if the terminal specification register 153 is “
3″, specifies input terminal 113 and registers terminal specification register 1.
If 53 is 6', input terminal 116 is designated.

A/D変換要求信号線160−167は、動作制御部3
50に対して、入力端子110〜117についてのA/
D変換を要求する信号で、それぞれアナログ信号の入力
端子110〜117に対応している。
The A/D conversion request signal lines 160-167 are connected to the operation control unit 3.
50, A/ for input terminals 110-117
These are signals requesting D conversion, and correspond to analog signal input terminals 110 to 117, respectively.

例えば、A/D変換要求信号線163は入力端子113
に関して、A/D変換要求信号線166は入力端子11
6に関しての変換の要求を行う。
For example, the A/D conversion request signal line 163 is connected to the input terminal 113.
Regarding, the A/D conversion request signal line 166 is connected to the input terminal 11.
Make a request for conversion regarding 6.

また動作制御部350はA/D変換要求信号線160〜
167によるA/D変換の要求によって、その要求に対
応する入力端子の値を端子指定レジスタ153に書き込
み、A/D変換装置30 ’Oに対して、CPU080
が動作指定レジスタ152に対して“l′”を書き込む
動作と同様の動作を行なわせる。
The operation control unit 350 also controls the A/D conversion request signal lines 160 to
167, the value of the input terminal corresponding to the request is written to the terminal designation register 153, and the CPU 080
causes the same operation as writing "l'" to the operation designation register 152 to be performed.

例えば、動作制御部350にA/D変換要求信号162
が入力されると、動作制御部350は端子指定レジスタ
153に″2゛′を四き込み、A/D変換要求信号16
5が入力されると、端子指定レジスタ153に“5′°
を書き込む。
For example, the operation control unit 350 receives the A/D conversion request signal 162.
When input, the operation control unit 350 writes "2" into the terminal designation register 153 and outputs the A/D conversion request signal 16.
When 5 is input, “5'° is written in the terminal designation register 153.
Write.

上記の動作と同時に動作制御部350は、この端子指定
レジスタ153の値に対応する入力端子のA/D変換を
起動する。
Simultaneously with the above operation, the operation control unit 350 starts A/D conversion of the input terminal corresponding to the value of the terminal designation register 153.

以下では本実施例における、動作指定レジスタ151.
152の値、A/D変換要求信号線160〜167と端
子指定レジスタ153およびA/I)変換装層300の
間の動作関係を説明する。
In the following, the operation specification register 151.
152, the operational relationship between the A/D conversion request signal lines 160 to 167, the terminal designation register 153, and the A/I converter layer 300.

(1)動作指定レジスタ152が0“′、動作指定レジ
スタ151が′0″の時、 A/D変換装置300は前述の端子指定レジスタ153
の指定する単一のアナログ入力端子を継続してA/D変
換し続ける。この場合は、A/D変換要求信号線160
〜167の入力は無視される。
(1) When the operation designation register 152 is 0"' and the operation designation register 151 is '0", the A/D converter 300 uses the terminal designation register 153 described above.
A/D conversion continues for the single analog input terminal specified by . In this case, the A/D conversion request signal line 160
Inputs from ~167 are ignored.

この時の基本動作は、実施例1の(1)の場合における
動作と同様であるので説明は省略する。
The basic operation at this time is the same as the operation in case (1) of the first embodiment, so the explanation will be omitted.

(2)動作指定レジスタ152が°゛0”′、動作指定
レジスタ151が゛1″の時、 A/D変換装置300は、全アナロク入力端子を順次A
/D変換して行く動作を行い、この場合、端子指定レジ
スタ153は無効となる。従って、A/D変換要求信号
線160〜167の状態には影響を受けない。
(2) When the operation specification register 152 is '0''' and the operation specification register 151 is '1'', the A/D converter 300 sequentially converts all analog input terminals to A.
/D conversion is performed, and in this case, the terminal designation register 153 becomes invalid. Therefore, it is not affected by the states of the A/D conversion request signal lines 160 to 167.

この時の基本動作は、実施例1の(2)の場合における
動作と同様であるので説明は省略する。
The basic operation at this time is the same as the operation in case (2) of the first embodiment, so the explanation will be omitted.

(3)動作指定レジスタ152が、“1″、動作指定レ
ジスタ151が、“0“の時、 まずCPU080は、A/D変換しようとする入力端子
の値をあらかじめ端子指定レジスタ153に書き込んで
おく。
(3) When the operation specification register 152 is “1” and the operation specification register 151 is “0”, the CPU 080 first writes the value of the input terminal to be A/D converted into the terminal specification register 153 in advance. .

そして、CPU080が動作指定レジスタ152に対し
て“1″を書込む動作を行うと、検出回路180が“1
″を書込まれたことを検出し、変換信号線185をアク
ティブ(1”)にする。
Then, when the CPU 080 performs an operation of writing "1" to the operation designation register 152, the detection circuit 180 writes "1".
It is detected that `` has been written, and the conversion signal line 185 is made active (1'').

これにより、A/D変換装置300は、CPU080が
端子指定レジスタ153に書込むことにより指定した入
力端子のA/D変換を1回行う。
Thereby, the A/D conversion device 300 performs one A/D conversion of the input terminal specified by the CPU 080 writing to the terminal specification register 153.

さらに、A/D変換終了後、A/D変換結果を入力端子
に対応したレジスタ140〜147の何れかの1つに格
納すると、割り込み信号170をアクティブ(1”°)
にしてCPU080に、変換結果の引き取りを要求する
Furthermore, after the A/D conversion is completed, when the A/D conversion result is stored in one of the registers 140 to 147 corresponding to the input terminal, the interrupt signal 170 is activated (1”).
and requests the CPU 080 to receive the conversion result.

次に全入力端子をA/D変換する動作に移行する。Next, the operation shifts to A/D conversion of all input terminals.

但し、全入力端子をA/D変換する動作では、割り込み
信号170はインアクティブ(“’O”)のままである
However, in the operation of A/D converting all input terminals, the interrupt signal 170 remains inactive (“'O”).

また、A/D変換要求信号線160〜167は、端子指
定レジスタ153で指定した入力端子に対応するA/D
変換要求信号線だけが受は付けを許可されていて、この
時、端子指定レジスタ153で指定した入力端子に対応
するA/D変換要求信号線がアクティブ(” l ” 
)になることでその入力端子についてのA/’D変換の
要求が行われ、この要求により動作制御部350はA/
D変換装置300に対して、CPU080が動作指定レ
ジスタ152に°1″を書込むことによって起動される
動作、すなわち、CPU080が動作指定レジスタ15
2に°“1“°を書き込むと、検出回路180が1“を
書込まれたことを検出して変換信号線185をアクティ
ブ(°″1″)にし、これによりA/D変換装置300
は端子指定レジスタ153で指定される入力端子のA/
D変換を1回行なう、という動作と同様の動作をさせる
Further, A/D conversion request signal lines 160 to 167 are connected to the A/D conversion request signal lines 160 to 167 that correspond to the input terminal specified by the terminal specification register 153.
Only the conversion request signal line is permitted to accept, and at this time, the A/D conversion request signal line corresponding to the input terminal specified by the terminal specification register 153 is active ("l"
), a request for A/'D conversion is made for that input terminal, and this request causes the operation control unit 350 to perform A/'D conversion.
An operation that is activated when the CPU 080 writes °1'' to the operation specification register 152 for the D conversion device 300;
When ``1'' is written to 2, the detection circuit 180 detects that 1'' has been written and makes the conversion signal line 185 active (°''1''), which causes the A/D converter 300 to
is the input terminal A/ specified by the terminal specification register 153.
An operation similar to that of performing D conversion once is performed.

即ち、A/D変換装置300は、端子指定レジスタ15
3で指定した入力端子に対応するA/D変換要求信号が
アクティブ(” l ’“)になると、端子指定レジス
タ153の指定する入力端子のA/D変換を行い、1変
換が終了すると再び全入力端子を順次A/D変換する動
作に移行する。その後、端子指定レジスタ153によっ
て受付けが許可されているA/D変換要求信号線かアク
ティブになる毎に上記の動作をくりかえす。
That is, the A/D converter 300 uses the terminal designation register 15
When the A/D conversion request signal corresponding to the input terminal specified in 3 becomes active ("l '"), A/D conversion is performed for the input terminal specified by the terminal specification register 153, and when one conversion is completed, all The operation shifts to sequential A/D conversion of the input terminals. Thereafter, the above operation is repeated every time the A/D conversion request signal line whose reception is permitted by the terminal designation register 153 becomes active.

(4)動作指定レジスタ152が、“I I I+、動
作指定レジスタ152が、01″の時、 まずCPU080は、A/D変換しようとする入力端子
の値をあらかじめ端子指定レジスタ153に書き込んで
おく。
(4) When the operation specification register 152 is “I I I+” and the operation specification register 152 is 01, the CPU 080 first writes the value of the input terminal to be A/D converted to the terminal specification register 153 in advance. .

そして、CPU080が動作指定レジスタ152に対し
て“1″を書き込む動作を行うと、検出回路180が1
”を書き込まれたことを検出し、変換信号線185をア
クティブ(“”l”)にする。
Then, when the CPU 080 performs an operation to write "1" to the operation designation register 152, the detection circuit 180
” is detected, and the conversion signal line 185 is made active (“1”).

これにより、A/D変換装置300は、端子指定レジス
タ153で指定される入力端子のA/D変換1回行う。
Thereby, the A/D conversion device 300 performs one A/D conversion of the input terminal specified by the terminal specification register 153.

さらに、A/D変換結果を、入力端子に対応したレジス
タ240〜147のいずれかの1つに格納すると、割り
込み信号170をアクティブ(“1′”)にして、CP
U080に変換結果の弓き取りを要求する。
Furthermore, when the A/D conversion result is stored in one of the registers 240 to 147 corresponding to the input terminal, the interrupt signal 170 is activated (“1'”) and the CP
Request U080 to convert the conversion result.

この時、CPU080はまず端子指定レジスタ153の
内容を読み込み、直前に行ったA/D変換の入力端子を
特定することによって、変換結果の格納位置を知り変換
結果の読み出しを行う。
At this time, the CPU 080 first reads the contents of the terminal designation register 153 and specifies the input terminal of the A/D conversion performed immediately before, thereby knowing the storage location of the conversion result and reading out the conversion result.

次に、全入力端子をA/D変換する動作に移行する。Next, the operation shifts to A/D conversion of all input terminals.

但し、全入力端子をA/D変換する動作では、割り込み
信号線170は、インアクティブ(“0″)のままであ
る。
However, in the operation of A/D converting all input terminals, the interrupt signal line 170 remains inactive (“0”).

また、A/D変換要求信号線160〜167はすべて動
作制御部350で受は付けが許可されており、A/D変
換要求信号線がアクティブ(°゛1”)になり外部から
ある入力端子に対してのA/D変換の要求がなされた場
合、動作制御部350は、端子指定レジスタ153に対
して、A/D変換の要求がなされた入力端子の値を書き
込む。
In addition, all of the A/D conversion request signal lines 160 to 167 are permitted to be accepted by the operation control unit 350, and the A/D conversion request signal line becomes active (°゛1'') and an external input terminal. When a request for A/D conversion is made for A/D conversion, the operation control unit 350 writes the value of the input terminal for which the A/D conversion request was made to the terminal designation register 153.

例えば、入力端子115に対してA/D変換の要求がな
された場合には“5″という値を、入力端子117に対
してA/D変換の要求がなされた場合には“7″という
値を、端子指定レジスタ153に書き込む。
For example, if an A/D conversion request is made to the input terminal 115, the value is "5", and if an A/D conversion request is made to the input terminal 117, the value is "7". is written to the terminal designation register 153.

さらに、上記の動作と同期して、A/D変換装置300
に対し、CPU080が動作指定レジスタ152に“1
“を書き込むことによって起動される動作、すなわち、
CPU080が動作指定レジスタ152に°゛1”を書
き込むと、検出回路180が“1”を書込まれたことを
検出して変換信号線185をアクティブ(“’ ] ”
 )にし、これによりA/D変換装置300は端子指定
レジスタ153で指定される入力端子のA/D変換を1
回行なう、という動作と同様の動作をさせ、A/D変換
の要求のあった入力端子の値を書き込まれている、端子
指定レジスタ153の示す入力端子についてのA/D変
換を起動する。
Furthermore, in synchronization with the above operation, the A/D converter 300
In response, the CPU 080 sets “1” to the operation specification register 152.
The operation triggered by writing “, i.e.
When the CPU 080 writes °゛1'' to the operation designation register 152, the detection circuit 180 detects that "1" has been written and activates the conversion signal line 185 (``']''
), thereby causing the A/D conversion device 300 to perform A/D conversion of the input terminal specified by the terminal specification register 153.
A/D conversion is started for the input terminal indicated by the terminal designation register 153 to which the value of the input terminal requested for A/D conversion has been written.

そして、1回のA/D変換の後、全入力端子をA/D変
換する動作に移行する。
After one A/D conversion, the operation shifts to A/D conversion of all input terminals.

すなわち、A/D変換装置300は、任意のA/D変換
要求信号線がアクティブ(“ビ)になると、この要求を
受けた動作制御部350が要求のあった入力端子の値を
端子指定レジスタ153に書込み、この端子指定レジス
タ153の指定する入力端子のA/D変換を行い、1変
換が終了すると再び全入力端子をA/D変換する動作に
移行する。
That is, in the A/D conversion device 300, when any A/D conversion request signal line becomes active (“BI”), the operation control unit 350 that received this request stores the value of the requested input terminal in the terminal designation register. 153, the input terminal designated by this terminal designation register 153 is A/D converted, and when one conversion is completed, the operation shifts to A/D conversion of all input terminals again.

その後、A/D変換要求信号線160〜167のうち、
いずれかのA/D変換要求信号線がアクティブになる毎
に上記の動作を繰り返す。
After that, among the A/D conversion request signal lines 160 to 167,
The above operation is repeated every time any A/D conversion request signal line becomes active.

最後に本実施例のA/D変換装置全体の動作について説
明する。
Finally, the operation of the entire A/D conversion device of this embodiment will be explained.

CPU080は、 (1)単に端子指定レジスタ153で指定する入力端子
をA/D変換する動作のみを実行したい場合は、 動作指定レジスタ152に0″′、動作指定レジスタ1
51に0″を設定する。
(1) If the CPU 080 simply wants to execute the operation of A/D converting the input terminal specified by the terminal specification register 153, set the operation specification register 152 to 0''' and the operation specification register 1.
51 is set to 0''.

(2)複数の入力端子を順次A/D変換する動作のみを
実行したい場合は、 動作指定レジスタ152に“0“、動作指定レジスタ1
51に“l”を設定する。
(2) If you want to execute only the operation of sequentially A/D converting multiple input terminals, set “0” to the operation specification register 152 and operation specification register 1.
51 is set to "l".

(3)端子指定レジスタ153で指定する特定の入力端
子を内外部からのA/D変換の要求によってA/D変換
する動作と、全入力端子を順次A/D変換する動作を併
せて実行したい場合は、動作指定レジスタ152に“1
”、動作指定レジスタ151に“0パを設定する。
(3) I want to perform both A/D conversion of a specific input terminal specified by the terminal specification register 153 based on an A/D conversion request from inside and outside, and operation of sequential A/D conversion of all input terminals. In this case, “1” is set in the operation specification register 152.
”, and set the operation designation register 151 to “0”.

(4)CPUO80が端子指定レジスタ153に指定す
る特定の入力端子または外部の複数のA/D変換要求信
号線によってA/D変換の要求のなされた入力端子をA
/D変換する動作と、全入力端子を順次A/D変換動作
を併せて実行したい場合は、 動作指定レジスタ152に″1″、動作指定レジスタ1
51に1 ”を設定する。
(4) The CPUO 80 selects the input terminal A/D conversion is requested by the specific input terminal specified in the terminal designation register 153 or by multiple external A/D conversion request signal lines.
If you want to perform A/D conversion operation and sequential A/D conversion operation for all input terminals, set "1" to operation specification register 152 and operation specification register 1.
Set 1” to 51.

次に、本発明の第4の実施例について第4図を参照して
説明する。マイクロコンピュータ040は、CPU08
0と、A/D変換装置400と、前記CPU080とA
/D変換装置400とのデータのやりとりを行う内部バ
ス090からなる。
Next, a fourth embodiment of the present invention will be described with reference to FIG. The microcomputer 040 is a CPU08
0, the A/D conversion device 400, the CPU 080 and the
It consists of an internal bus 090 that exchanges data with the /D conversion device 400.

CPU080は、プロクラム実行によってA/D変換装
置400に対するデータのリード、ライト動作を行う他
にA/D変換装置400からの割り込み信号170を受
は付ける処理も行う。
The CPU 080 not only reads and writes data to the A/D converter 400 by executing a program, but also performs processing for accepting and accepting interrupt signals 170 from the A/D converter 400.

A/D変換装置400は、アナログ信号を入力するため
の入力端子110〜117、マルチプレクサ120、マ
ルチプレクサ120の出力信号ヲA/D変換するA/D
変換器130、A/D変換器130の変換結果を格納す
るレジスタ140〜147、A/D変換の動作を制御す
る動作制御部450、入力端子110〜117について
のA/D変換の開始を要求するA/D変換要求信号線1
60〜167、所定のA/D変換動作が終了するとCP
U080に対して割り込み処理を要求するための割り込
み信号線170、マルチプレクサ)20に対して選択す
る入力端子を指定する入力端子指定信号線190、レジ
スタ140〜147の内1つを選択するアドレス指定信
号線195、A/D変換の制御を司どる動作指定レジス
タ151゜152)変換するべき入力端子を指定する端
子指定レジスタ153、A/D変換要求信号線160〜
167によるA/D変換要求のうち優先的に受は付ける
べきA/D変換要求を判定する優先順位判定回路(以下
判定回路と略す)154、判定回路154による判定の
結果である判定結果信号(以下判定信号と略す)155
、端子指定レジスタ153の内容を判定回路154に表
示する内容表示信号(以下表示信号と略す)156、動
作指定レジスタ152に“1′″を書込む動作を検出す
る書込み検出回路(以下検出回路と略す)180、動作
制御レジスタ152に“1″が書込まれたことを示す信
号線(以下変換信号線と略す)185から構成される。
The A/D conversion device 400 includes input terminals 110 to 117 for inputting analog signals, a multiplexer 120, and an A/D converter for A/D converting the output signal of the multiplexer 120.
Converter 130, registers 140 to 147 that store conversion results of A/D converter 130, operation control section 450 that controls A/D conversion operations, and requests to start A/D conversion for input terminals 110 to 117. A/D conversion request signal line 1
60 to 167, when the predetermined A/D conversion operation is completed, CP
An interrupt signal line 170 for requesting interrupt processing from U080, an input terminal designation signal line 190 for designating the input terminal to be selected for the multiplexer 20, and an address designation signal for selecting one of the registers 140 to 147. Line 195, operation designation register 151, 152) that controls A/D conversion, terminal designation register 153 that designates the input terminal to be converted, A/D conversion request signal line 160~
A priority determination circuit (hereinafter abbreviated as determination circuit) 154 determines which A/D conversion requests should be accepted preferentially among A/D conversion requests by 167, and a determination result signal (which is the result of determination by the determination circuit 154) (hereinafter abbreviated as judgment signal) 155
, a content display signal (hereinafter referred to as the display signal) 156 that displays the contents of the terminal designation register 153 to the determination circuit 154, and a write detection circuit (hereinafter referred to as the detection circuit) that detects the operation of writing "1'" to the operation designation register 152. (abbreviated) 180, and a signal line (hereinafter abbreviated as conversion signal line) 185 indicating that "1" is written in the operation control register 152.

次にA/D変換装置400の各部の説明をする。Next, each part of the A/D converter 400 will be explained.

マルチプレクサ120、A/D変換器130、レジスタ
140〜147、割込み信号線170、入力信号指定線
190、アドレス信号線195、検出回路180、変換
信号線185の動作は、実施例1と同様であるため、こ
こでの説明は省略する。
The operations of the multiplexer 120, A/D converter 130, registers 140 to 147, interrupt signal line 170, input signal designation line 190, address signal line 195, detection circuit 180, and conversion signal line 185 are the same as in the first embodiment. Therefore, the explanation here will be omitted.

A/D変換要求信号線160〜167は、動作制御部4
50に対して、入力端子110〜117のA/D変換を
要求する信号線で、それぞれアナログ信号の入力端子1
10〜117に対応している。
The A/D conversion request signal lines 160 to 167 are connected to the operation control unit 4.
50, signal lines that request A/D conversion of input terminals 110 to 117, and input terminals 1 of analog signals respectively.
It corresponds to numbers 10 to 117.

例えば、A/D変換要求信号線163は入力端子113
について、A/D変換要求信号線166は入力端子11
6についての変換の要求を行う。
For example, the A/D conversion request signal line 163 is connected to the input terminal 113.
, the A/D conversion request signal line 166 is connected to the input terminal 11.
Make a conversion request for 6.

動作制御部450は、動作指定レジスタ151゜152
)端子指定レジスタ153、および判定回路154を有
している。
The operation control unit 450 has operation specification registers 151 and 152.
) A terminal designation register 153 and a determination circuit 154 are included.

動作指定レジスタ151,152はCPU080からア
クセス可能であり、端子指定レジスタ153はCPU0
80からアクセス可能であるとともに、動作制御部45
0によっても書き込みが可能である。
Operation specification registers 151 and 152 are accessible from CPU080, and terminal specification register 153 is accessible from CPU0.
80 and is accessible from the operation control unit 45
Writing with 0 is also possible.

端子指定レジZり153は、その値がそのまま入力端子
を指定していて、例えば、端子指定レジスタ153が“
3″なら入力端子113を指定し、端子指定レジスタ1
53が6′′なら入力端子116を指定する。
The value of the terminal specification register 153 directly specifies the input terminal. For example, if the terminal specification register 153 is “
3″, specifies input terminal 113 and registers terminal specification register 1.
If 53 is 6'', input terminal 116 is designated.

判定回路154は、A/D変換要求信号線160〜16
7によって、 ■ 異なる入力端子についてのA/D変換要求が同時に
なされた場合、あるいは、 ■ A/D変換の要求によって起動された、ある入力端
子についてのA/D変換実行中に、新たに別の入力端子
についてのA/D変換要求がなされた場合に、 それらのA/D変換要求の中から受は付けるべきA/D
変換要求をあらかじめ各入力端子に規定された優先順位
に基すいて判定し、その結果を判定信号155として端
子指定レジスタ153に伝える。
The determination circuit 154 uses A/D conversion request signal lines 160 to 16.
7, ■ If A/D conversion requests for different input terminals are made at the same time, or ■ When A/D conversion is executed for a certain input terminal started by a request for A/D conversion, a new separate request is made. When an A/D conversion request is made for the input terminal of
The conversion request is determined based on the priority order defined in advance for each input terminal, and the result is transmitted to the terminal designation register 153 as a determination signal 155.

説明を簡単にするため、本実施例では、A/D変換の優
先順位が、A/D変換要求信号線160が一番低く、1
61.・・・、167の順で優先順位が高くなる場合に
ついて説明するが、本発明における優先順位の設定がこ
の場合に限られるわけではない。
To simplify the explanation, in this embodiment, the A/D conversion request signal line 160 has the lowest priority, and the A/D conversion request signal line 160 has the lowest priority.
61. . . , 167 will be described, but the setting of priorities in the present invention is not limited to this case.

また、判定回路154の動作を説明するために、A/D
変換要求信号線160〜167に対しそれぞれ数値゛0
“〜“7″′を割当て、入力端子110〜117を表わ
すものとして説明する。
Furthermore, in order to explain the operation of the determination circuit 154, the A/D
Value ``0'' for each conversion request signal line 160 to 167
"~"7''' will be assigned and will be explained as representing input terminals 110-117.

判定回路154は、上記の■の場合には、要求を行なっ
た複数のA/D変換要求信号線に対応した入力端子の値
によりその優先順位を判定して、その結果受は付けを行
なったA/D変換要求に対応する入力端子の値を判定信
号155として端子指定レジスタ153に書き込む。
In the case of (2) above, the determination circuit 154 determines the priority order based on the values of the input terminals corresponding to the plurality of A/D conversion request signal lines that have made the request, and as a result, accepts the requests. The value of the input terminal corresponding to the A/D conversion request is written into the terminal designation register 153 as the determination signal 155.

上記の■の場合には、A/D変換要求がなされた入力端
子の値と、端子指定レジスタ153の内容を示している
表示信号156の値とを比較して、a)新たにA/D変
換の要求がなされた入力端子の値が、表示信号156の
値より大、すなわち優先順位がより高いときには、その
入力端子の値を判定信号155として出力して端子指定
レジスタ153に書き込み、 b)新たにA/D変換の要求がなされた入力端子の値が
、表示信号156の値より小、すなわち優先順位がより
低いときには、表示信号156の値を判定信号155と
して出力するが、端子指定レジスタ153には書き込み
を行なわない。
In the case of (■) above, the value of the input terminal for which the A/D conversion request was made is compared with the value of the display signal 156 indicating the contents of the terminal designation register 153, and a) a new A/D conversion is performed. When the value of the input terminal for which conversion is requested is greater than the value of the display signal 156, that is, the priority is higher, the value of the input terminal is output as the judgment signal 155 and written to the terminal designation register 153, b) When the value of the input terminal for which a new A/D conversion request has been made is smaller than the value of the display signal 156, that is, the priority is lower, the value of the display signal 156 is output as the judgment signal 155, but the terminal specification register is 153 is not written to.

■と■の両方の場合には、それぞれの動作を併せて行な
う。
In the case of both (1) and (2), each operation is performed together.

具体的には、A/D変換要求信号線163によるA/D
変換の要求により、入力端子113についてのA/D変
換を実行している時に、A/Di換要求信号線165に
よる入力端子115についてのA/D変換の要求と、A
/D変換要求信号線166による入力端子116につい
てのA/D変換の要求が同時になされた場合には、入力
端子115の値“5′”と入力端子116の値“6“お
よび端子指定レジスタ153の内容を示す表示信号15
6の値“3″とを比較して、より大きな値をもつすなわ
ちより優先順位の高い入力端子116についてのA/D
変換の要求を受は付け、判定結果である判定信号155
として6″′という値を出力し、これを端子指定レジス
タ153に書き込む。
Specifically, the A/D conversion request signal line 163
When A/D conversion is being executed for the input terminal 113 due to a conversion request, an A/D conversion request for the input terminal 115 via the A/Di conversion request signal line 165 and an A/D conversion request for the input terminal 115 are executed.
When A/D conversion requests are made for the input terminals 116 via the /D conversion request signal line 166 at the same time, the value "5'" of the input terminal 115, the value "6" of the input terminal 116, and the terminal designation register 153 Display signal 15 indicating the content of
6 and the value "3", the A/D for the input terminal 116 having a larger value, that is, having a higher priority.
The conversion request is accepted and a judgment signal 155 is sent as the judgment result.
outputs a value of 6″′ and writes this to the terminal designation register 153.

また動作制御部450は、判定回路154によって端子
指定レジスタ153の書き換えを行った時には、A/D
変換装置400に対して、CPU080が動作指定レジ
スタ152に1゛′を書込むことによって起動される動
作と同様の動作をさせる。
Further, when the determination circuit 154 rewrites the terminal designation register 153, the operation control unit 450 controls the A/D
The CPU 080 causes the conversion device 400 to perform the same operation as that activated when the CPU 080 writes 1' to the operation designation register 152.

以下では実施例における、A/D変換要求信号線160
〜167、動作制御部450における動作指定レジスタ
151,152)端子指定レジスタ153、およびA/
D変換装置400の間の動作関係を説明する。
In the following, the A/D conversion request signal line 160 in the embodiment will be described.
~167, operation specification registers 151, 152) in operation control unit 450) terminal specification register 153, and A/
The operational relationship between the D conversion devices 400 will be explained.

(1)動作指定レジスタ152が“I Q I+、動作
指定レジスタ151が“0”の時、 (2)動作指定レジスタ152が′″0°“、動作指定
レジスタ151が1”の時、 (3)動作指定レジスタ152が“1″、動作指定レジ
スタ151が“0°′の時、 このとき、動作制御部450の判定回路154はなにも
動作しないため、基本的動作は、実施例1の(1)、 
(2)及び実施例3の(2)の場合における動作と同様
であるので説明は省略する。
(1) When the operation specification register 152 is “I Q I+” and the operation specification register 151 is “0”, (2) When the operation specification register 152 is “0°” and the operation specification register 151 is “1”, (3 ) When the operation specification register 152 is "1" and the operation specification register 151 is "0°', the determination circuit 154 of the operation control section 450 does not operate at this time, so the basic operation is as in the first embodiment. (1),
Since the operation is the same as that in case (2) and case (2) of the third embodiment, the explanation will be omitted.

(4)動作指定レジスタ152がビ、動作指定レジスタ
151が“1パの時、 この時、CPU080が動作指定レジスタ152に対し
て“1″を書き込む動作を行うと、検出回路180が“
1パを書き込まれたことを検出し、変換信号線185を
アクティブ(′1”)にする。
(4) When the operation specification register 152 is ``BI'' and the operation specification register 151 is ``1PA'', when the CPU 080 writes ``1'' to the operation specification register 152, the detection circuit 180 outputs ``1''.
It is detected that 1 pass has been written, and the conversion signal line 185 is made active ('1'').

またCPU080は端子指定レジスタ153に、最低位
の優先順位の入力端子110を示す“0″という値を書
き込むことで、すべてのA/D変換の要求を受は付けら
れる状態にしておく。
Further, the CPU 080 writes a value of "0" indicating the input terminal 110 with the lowest priority to the terminal designation register 153, thereby making it possible to accept all A/D conversion requests.

コレにより、A/D変換装置400は入力端子110の
A/D変換を1回行う。
With this, the A/D conversion device 400 performs A/D conversion of the input terminal 110 once.

さらに、A/D変換結果を、入力端子に対応したレジス
タ140に格納すると、割り込み信号170をアクティ
ブ(” 1 ” )ニして、CPU080に変換結果の
引き取りを要求する。
Further, when the A/D conversion result is stored in the register 140 corresponding to the input terminal, the interrupt signal 170 is activated ("1") to request the CPU 080 to receive the conversion result.

次に、全入力端子をA/D変換する動作に移行する。Next, the operation shifts to A/D conversion of all input terminals.

但し、全入力端子をA/D変換する動作では、割り込み
信号線170は、インアクティブ(“0′”)のままで
ある。
However, in the operation of A/D converting all input terminals, the interrupt signal line 170 remains inactive ("0'").

また、A/D変換要求信号線160〜167はすべて動
作制御部450で受は付けが許可されており、この状態
において、任意の入力端子に対して外部からのA/D変
換の要求が生じた場合、動作制御部450は、判定回路
154で、そのA/D変換の要求のあった入力端子の値
からその要求を受は付けの可否を判定して、要求を受は
付ける場合には、その要求に対応する入力端子の値を端
子指定レジスタ153に書き込み、これと同期してA/
D変換装置400に対して、CPU080が動作指定レ
ジスタ152に“1″を書き込むことによって起動され
る動作、すなわち、CPU080が動作指定レジスタ1
52に対して“1″を書込むと、検出回路180が“1
″を書込まれたことを検出して変換信号線185をアク
ティブ(パ1″)にし、これによりA/D変換装置40
0は端子指定レジスタ153で指定される入力端子のA
/D変換を1回行う、という動作と同様の動作をさせて
、要求のあった入力端子のA/D変換を起動し、要求を
受は付けない場合には、A/D変換装置400に対して
なにも変化を与えさせない。
In addition, all A/D conversion request signal lines 160 to 167 are permitted to be accepted by the operation control unit 450, and in this state, an external A/D conversion request is made to any input terminal. In this case, the operation control unit 450 uses the determination circuit 154 to determine whether or not to accept the request based on the value of the input terminal at which the A/D conversion request was made. , writes the value of the input terminal corresponding to the request to the terminal specification register 153, and synchronizes with this.
An operation that is activated when the CPU 080 writes "1" to the operation specification register 152 for the D conversion device 400, that is, the CPU 080 writes the operation specification register 1
When "1" is written to 52, the detection circuit 180 becomes "1".
” is detected and the conversion signal line 185 is made active (P1”), whereby the A/D converter 40
0 is A of the input terminal specified by the terminal specification register 153
The A/D conversion of the requested input terminal is started by performing the same operation as performing A/D conversion once, and if the request is not accepted, the A/D conversion device 400 It doesn't make any changes to it.

そして、1回のA/D変換の後、A/D変換装置400
に対して、全入力端子を順次A/D変換する動作に移行
させる。
After one A/D conversion, the A/D converter 400
In contrast, all input terminals are sequentially A/D converted.

CPU080は、外部からのA/D変換の要求により、
特定端子についてのA/D変換を行った場合には、その
変換終了後に、まず端子指定レジスタ153の内容を読
み込み、直前に行ったA/D変換の入力端子を知ること
によって、変換結果格納レジスタ140〜147からの
読み出し位置すなわちアドレス指定信号線195を決定
し、変換結果の読み出しを行う。
In response to an external A/D conversion request, the CPU 080
When A/D conversion is performed on a specific terminal, after the conversion is completed, the contents of the terminal specification register 153 are first read, and by knowing the input terminal of the A/D conversion performed immediately before, the conversion result storage register is stored. The reading position from 140 to 147, that is, the addressing signal line 195 is determined, and the conversion result is read out.

その後、A/D変換要求信号線180〜167のうち、
いずれかのA/D変換要求信号線がアクティブになり、
これによってA/D変換の要求がなされる毎に、上記の
動作を繰り返す。
After that, among the A/D conversion request signal lines 180 to 167,
One of the A/D conversion request signal lines becomes active,
As a result, the above operation is repeated every time a request for A/D conversion is made.

最後に本実施例のA/D変換装置全体の動作について説
明する。
Finally, the operation of the entire A/D conversion device of this embodiment will be explained.

CPU080は、 (1)単に端子指定レジスタ153で指定する入力端子
をA/D変換する動作のみを実行したい場合は、 動作指定レジスタ152に“0′”、動作指定レジスタ
151に゛0パを設定する。
(1) If you simply want to execute the operation of A/D converting the input terminal specified by the terminal specification register 153, set the operation specification register 152 to "0'" and the operation specification register 151 to 0%. do.

(2)複数の入力端子を順次A/D変換する動作のみを
実行したい場合は、 動作指定レジスタ152に“0″、動作指定レジスタ1
51に°“1″を設定スる。
(2) If you want to execute only the operation of sequentially A/D converting multiple input terminals, set “0” to operation specification register 152 and operation specification register 1.
Set "1" to 51.

(3)端子指定レジスタ153で指定する特定の入力端
子を内外部からのA/D変換の要求によってA/D変換
する動作と、全入力端子を順次A/D変換する動作を併
せて実行したい場合は、動作指定レジスタ152に1″
′、動作指定レジスタ151に“0°°を設定する。
(3) I want to perform both A/D conversion of a specific input terminal specified by the terminal specification register 153 based on an A/D conversion request from inside and outside, and operation of sequential A/D conversion of all input terminals. In this case, set 1″ to the operation specification register 152.
', set the operation designation register 151 to "0°°."

(4)  CPU080が端子指定レジスタ153に指
定する特定の入力端子または、外部からの複数のA/D
変換要求の中から規定の優先順位を基に選んだA/D変
換の要求に対応する入力端子についてのA/D変換をす
る動作と、全入力端子を順次A/D変換動作を併せて実
行したい場合は、 動作指定レジスタ152に1”、動作指定レジスタ15
1に“1′”を設定する。
(4) A specific input terminal specified by the CPU 080 in the terminal specification register 153 or multiple A/Ds from the outside
Execute A/D conversion operation for the input terminal corresponding to the A/D conversion request selected from the conversion requests based on the specified priority order, and A/D conversion operation for all input terminals sequentially. If you want to do so, set 1" to operation specification register 152, and set 1" to operation specification register 15.
Set "1'" to 1.

次に、本発明の第5の実施例について第5図を参照して
説明する。マイクロコンピュータ050は、CPU08
0と、A/D変換装置500と、前記CPU080とA
/D変換装置500とのデータのやりとりを行う内部バ
ス090からなる。
Next, a fifth embodiment of the present invention will be described with reference to FIG. Microcomputer 050 is CPU08
0, the A/D converter 500, the CPU 080, and the A/D converter 500.
It consists of an internal bus 090 that exchanges data with the /D conversion device 500.

CPU080は、プログラム実行によってA/D変換装
置500に対するデータのリード、ライト動作を行う他
にA/D変換装置500からの割り込み信号170を受
は付ける処理も行う。
The CPU 080 not only reads and writes data to and from the A/D conversion device 500 by executing programs, but also performs processing for accepting and accepting interrupt signals 170 from the A/D conversion device 500.

A/D変換装置500は、アナログ信号を入力するため
の入力端子110〜117、マルチプレクサ120、マ
ルチプレクサ120の出力信号をA/D変換するA/D
変換器130、A/D変換器130の変換結果を格納す
るレジスタ140〜147、A/D変換の動作を制御す
る動作制御部550、入力端子11’ 0〜117につ
いてのA/D変換の開始を要求するA/D変換要求信号
線160〜167、所定のA/D変換動作が終了すると
CPU080に対して割り込み処理を要求するための割
り込み信号線170、マルチプレクサ120に対して選
択する入力端子を指定する入力端子指定信号線190、
レジスタ14〜147の内1つを選択するアドレス指定
信号線195、A/D変換の制御を司どる動作指定レジ
スタ151゜152)変換するへき入力端子を指定する
端子指定レジスタ153 A/D変換要求信号線160
〜167によるA/D変換要求を受付ける優先順位を指
定する優先順位指定レジスタ158、A/D変換要求信
号線160〜167によるA/D変換要求のうち優先的
に受は付けるべきA/D変換要求を判定する優先順位判
定回路(以下判定回路と略す)154、判定回路154
による判定の結果である判定結果信号(以下判定信号と
略す)155、端子指定レジスタ153の内容を判定回
路154に表示する内容表示信号(以下表示信号と略す
)156、優先順位指定レジスタ158の内容を判定回
路154に表示する内容表示信号(以下表示信号と略す
)157、動作指定レジスタ152に“l“を書込む動
作を検出する書込み検出回路(以下検出回路と略す)1
80、動作制御レジスタ152に“1”が書込まれたこ
とを示す信号線(以下変換信号線と略す)185から構
成される。
The A/D conversion device 500 includes input terminals 110 to 117 for inputting analog signals, a multiplexer 120, and an A/D converter for A/D converting the output signal of the multiplexer 120.
Converter 130, registers 140 to 147 that store conversion results of A/D converter 130, operation control section 550 that controls A/D conversion operations, and start of A/D conversion for input terminals 11' 0 to 117. A/D conversion request signal lines 160 to 167 for requesting A/D conversion, an interrupt signal line 170 for requesting interrupt processing from the CPU 080 when a predetermined A/D conversion operation is completed, and an input terminal to be selected for the multiplexer 120. Input terminal designation signal line 190 to be designated;
Address designation signal line 195 for selecting one of registers 14 to 147; operation designation register 151, 152 for controlling A/D conversion; terminal designation register 153 for designating the input terminal to be converted; A/D conversion request; signal line 160
A/D conversion that should be accepted preferentially among A/D conversion requests made by A/D conversion request signal lines 160 to 167. A priority determination circuit (hereinafter abbreviated as determination circuit) 154 that determines a request, determination circuit 154
A determination result signal (hereinafter abbreviated as a determination signal) 155 which is the result of the determination by , a content display signal (hereinafter abbreviated as a display signal) 156 that displays the contents of the terminal designation register 153 on the determination circuit 154, and a content of the priority designation register 158. a content display signal (hereinafter abbreviated as a display signal) 157 that displays on the determination circuit 154; a write detection circuit (hereinafter abbreviated as a detection circuit) 1 that detects an operation of writing "l" to the operation designation register 152;
80, and a signal line 185 (hereinafter abbreviated as conversion signal line) indicating that "1" is written in the operation control register 152.

次にA/D変換装置500の各部の説明をする。Next, each part of the A/D converter 500 will be explained.

マルチプレクサ120、A/D変換器130、レジスタ
140〜147、割込み信号線170、入力指定信号線
190、アドレス信号線195、検出回路180、変換
信号線185の動作は、実施例1と同様であるため、こ
こでの説明は省略する。
The operations of the multiplexer 120, A/D converter 130, registers 140 to 147, interrupt signal line 170, input designation signal line 190, address signal line 195, detection circuit 180, and conversion signal line 185 are the same as in the first embodiment. Therefore, the explanation here will be omitted.

A/D変換要求信号線160〜167は、動作制御部5
50に対して、入力端子110〜117のA/D変換を
要求する信号線で、それぞれアナログ信号の入力端子1
10〜117に対応している。
The A/D conversion request signal lines 160 to 167 are connected to the operation control unit 5.
50, signal lines that request A/D conversion of input terminals 110 to 117, and input terminals 1 of analog signals respectively.
It corresponds to numbers 10 to 117.

例えば、A/D変換要求信号線163は入力端子113
について、A/D変換要求信号線166は入力端子11
6についての変換の要求を行う。
For example, the A/D conversion request signal line 163 is connected to the input terminal 113.
, the A/D conversion request signal line 166 is connected to the input terminal 11.
Make a conversion request for 6.

動作制御部550は、動作指定レジスタ151゜152
)端子指定レジスタ153、優先順位指定レジスタ15
8、および判定回路154を有している。
The operation control unit 550 has operation specification registers 151 and 152.
) Terminal specification register 153, priority specification register 15
8 and a determination circuit 154.

動作指定レジスタ151,152)優先順位指定レジス
タ158はCPU080からアクセス可能であり、端子
指定レジスタ153はCPU080からアクセス可能で
あるとともに、動作制御部550によっても口き込みが
可能である。
Operation designation registers 151, 152) The priority designation register 158 can be accessed from the CPU 080, and the terminal designation register 153 can be accessed from the CPU 080 and can also be controlled by the operation control unit 550.

端子指定レジスタ153は、その値がそのまま入力端子
を指定していて、例えば、端子指定レジスタ153が′
3゛′なら入力端子1 +−3を指定し、端子指定レジ
スタ153が゛6“′なら入力端子116を指定する。
The value of the terminal specification register 153 directly specifies the input terminal; for example, if the terminal specification register 153 is
If the terminal specification register 153 is ``6'', the input terminal 116 is specified.

実施例3,4で記したように、動作指定レジスタ152
に+ 1 ++、動作指定レジスタ151に1nが設定
されることにより、特定の入力端子をA/D変換する動
作と、全入力端子を順次A/D変換する動作を併せて実
行する場合に於いて、判定回路154は、A/D変換要
求信号線160〜167によって、 ■ 異なる入力端子についてのA/D変換要求が同時に
なされた場合、あるいは、 ■ A/D変換の要求によって起動された、ある入力端
子についてのA/D変換実行中に、新たに別の入力端子
についてのA/D変換要求がなされた場合に、 それらのA/D変換要求の中から優先順位指定レジスタ
158により指定された優先順位に基づいて、より高い
優先順位を持つ入力端子を判定し、その結果優先順位の
高い方の入力端子の値を判定信号155として端子指定
レジスタ153に伝える。
As described in the third and fourth embodiments, the operation specification register 152
+ 1 ++ and 1n is set in the operation specification register 151, when performing A/D conversion of a specific input terminal and operation of sequential A/D conversion of all input terminals. The determination circuit 154 uses the A/D conversion request signal lines 160 to 167 to determine whether (1) A/D conversion requests for different input terminals are made at the same time, or (2) activated by an A/D conversion request. If a new A/D conversion request is made for another input terminal while A/D conversion is being performed for a certain input terminal, the A/D conversion request specified by the priority specification register 158 from among those A/D conversion requests is Based on the priority order, an input terminal having a higher priority order is determined, and as a result, the value of the input terminal with a higher priority order is transmitted to the terminal designation register 153 as a determination signal 155.

判定回路154は、上記の■の場合には、要求を行なっ
た複数のA/D変換要求信号線に対応した入力端子の値
を優先順位指定レジスタ158に指定した優先順位に基
づいてその優先順位を判定して、その結果より高い優先
順位を持つ入力端子の値を判定信号155として端子指
定レジスタ153に書き込む。
In the case of (2) above, the determination circuit 154 determines the priority of the values of the input terminals corresponding to the plurality of A/D conversion request signal lines that have made the request based on the priority specified in the priority specification register 158. As a result, the value of the input terminal having a higher priority is written into the terminal designation register 153 as the determination signal 155.

上記の■の場合には、A/D変換要求がなされた入力端
子の値と、端子指定レジスタ153の内容を示している
表示信号156の値とを優先順位指定レジスタ158に
指定された優先順位に基づき、どちらの優先順位がより
高いかを判定して、a)新たにA/D変換の要求がなさ
れた入力端子より、表示信号156に示された入力端子
の方が、優先順位指定レジスタ158に指定された優先
順位が低いときには、その入力端子の値を判定信号15
5として出力して端子指定レジスタ153に書き込み、 b)新たにA/D変換の要求がなされた入力端子より、
表示信号156に示された入力端子の方が、優先順位指
定レジスタ158に指定された優先順位が高いときには
、表示信号156の値を判定信号155として出力する
が、端子指定レジスタ153には書き込みを行なわない
In the case of (■) above, the value of the input terminal for which the A/D conversion request was made and the value of the display signal 156 indicating the contents of the terminal designation register 153 are assigned the priority order specified in the priority designation register 158. Based on this, it is determined which has a higher priority, and a) the input terminal indicated by the display signal 156 is set in the priority order designation register more than the input terminal for which a new A/D conversion request has been made. When the priority specified in 158 is low, the value of that input terminal is determined by the judgment signal 15.
5 and write it to the terminal designation register 153, b) From the input terminal where the new A/D conversion request was made,
When the input terminal indicated by the display signal 156 has a higher priority specified in the priority order specification register 158, the value of the display signal 156 is output as the judgment signal 155, but no writing is performed in the terminal specification register 153. Don't do it.

■と■の両方の場合には、それぞれの動作を併せて行な
う。
In the case of both (1) and (2), each operation is performed together.

具体的には、優先順位指定レジスタ158に優先順位の
最も高い入力端子として入力端子110.2番目に優先
順位の高い入力端子として入力端子111.3番目優先
順位の高い入力端子として入力端子115.4番目に優
先順位の高い入力端子として入力端子112.5番目に
優先順位の高い入力端子として入力端子116.6番目
に優先順位の高い入力端子として入力端子114.7番
目優先順位の高い入力端子として入力端子113.8番
目優先順位の高い入力端子として入力端子117と指定
されており、A/D変換要求信号線163によるA/D
変換の要求により、入力端子113についてのA/D変
換を実行している時に、A/D変換要求信号線165に
よる入力端子115についてのA/D変換の要求と、A
/D変換要求信号線166による入力端子116につい
てのA/D変換の要求が同時になされた場合には、入力
端子115と、入力端子116、および端子指定レジス
タ153の内容を示す表示信号156の示す入力端子1
13とを優先順位指定レジスタ158に基づき、どの入
力端子がより優先順位が高し・かを判定して、その判定
の結果より優先順位の高い入力端子115についてのA
/D変換の要求を受は付け、判定結果である判定信号1
55として入力端子115を表す“5″という値を出力
し、これを端子指定レジスタ153に書き込む。
Specifically, the priority designation register 158 sets the input terminal 110 as the input terminal with the highest priority, the input terminal 111 as the input terminal with the second highest priority, and the input terminal 115 as the input terminal with the third highest priority. The fourth highest priority input terminal is the input terminal 112.The fifth highest priority input terminal is the input terminal 116.The sixth highest priority input terminal is the input terminal 114.The seventh highest priority input terminal The input terminal 113 is designated as the input terminal 113. The input terminal 117 is designated as the input terminal with the eighth highest priority, and the A/D conversion request signal line 163 is designated as the input terminal 117.
When A/D conversion is being executed for the input terminal 113 due to a conversion request, an A/D conversion request for the input terminal 115 via the A/D conversion request signal line 165 and an A/D conversion request for the input terminal 115 are executed.
When A/D conversion requests are made for the input terminals 116 via the /D conversion request signal line 166 at the same time, the display signal 156 indicating the contents of the input terminals 115, 116, and terminal designation register 153 Input terminal 1
13 and determines which input terminal has a higher priority based on the priority designation register 158, and as a result of that determination, A for the input terminal 115 with a higher priority.
/D conversion request is accepted and judgment signal 1 is the judgment result.
55, outputs the value "5" representing the input terminal 115, and writes this into the terminal designation register 153.

また動作制御部550は、判定回路154によって端子
指定レジスタ153の書き換えを行った時には、A/D
変換装置500に対して、CPU080が動作指定レジ
スタ152に“1 ”を書込むことによって起動される
動作と同様の動作をさせる。
Further, when the determination circuit 154 rewrites the terminal designation register 153, the operation control unit 550 controls the A/D
The CPU 080 causes the conversion device 500 to perform the same operation as that activated when the CPU 080 writes "1" to the operation designation register 152.

以下では本実施例における、A/D変換要求信号線16
0〜167、動作制御部550における動作指定レジス
タ151,152)端子指定レジスタ153、優先順位
指定レジスタ158、およびA/D変換装置500の間
の動作関係を説明する。
In the following, the A/D conversion request signal line 16 in this embodiment will be described.
0 to 167, operation designation registers 151 and 152 in operation control unit 550) The operational relationship among the terminal designation register 153, priority designation register 158, and A/D conversion device 500 will be described.

(1)動作指定レジスタ152が0”、動作指定レジス
タ151が“Onの時、 (2)動作指定レジスタ152が“0°“、動作指定レ
ジスタ151が“1“の時、 (3)動作指定レジスタ152が“+ 1 ++、動作
指定レジスタ151が゛0パの時、 このとき、動作制御部550の判定回路154はなにも
動作しないため、基本的動作は、実施例1の(1)、 
<2)及び実施例3の(2)の場合における動作と同様
であるので説明は省略する。
(1) When the operation specification register 152 is “0” and the operation specification register 151 is “On” (2) When the operation specification register 152 is “0°” and the operation specification register 151 is “1” (3) Operation specification When the register 152 is “+1++” and the operation designation register 151 is “0”, the determination circuit 154 of the operation control unit 550 does not operate at this time, so the basic operation is as in (1) of the first embodiment. ,
<2) and the operation in the case (2) of the third embodiment, so the explanation will be omitted.

(4)動作指定レジスタ152が“′ビ、動作指定レジ
スタ151が1′”の時、 この時、CPU080が動作指定レジスタ152に対し
て“1″を書き込む動作を行うと、検出回路180が“
1“′を書き込まれたことを検出し、変換信号線185
をアクティブ(“1”)にする。
(4) When the operation specification register 152 is "'BI' and the operation specification register 151 is 1'", at this time, when the CPU 080 performs an operation of writing "1" to the operation specification register 152, the detection circuit 180 reads "
It is detected that 1"' has been written, and the conversion signal line 185
is activated (“1”).

またCPU080は端子指定レジスタ153に、優先順
位指定レジスタ158で指定した最低位の優先順位の入
力端子を示す値を書き込むことで、すべてのA/D変換
の要求を受は付けられる状態にしておく。
In addition, the CPU 080 writes a value indicating the input terminal with the lowest priority specified in the priority order specification register 158 to the terminal specification register 153, thereby making it possible to accept all A/D conversion requests. .

これにより、A/D変換装置500は入力端子110の
A/D変換を1回行う。
Thereby, the A/D conversion device 500 performs A/D conversion of the input terminal 110 once.

さらに、A/D変換結果を、入力端子に対応したレジス
タ140に格納すると、割り込み信号170をアクティ
ブ(′1′′)にして、CPU O80に変換結果の引
き取りを要求する。
Further, when the A/D conversion result is stored in the register 140 corresponding to the input terminal, the interrupt signal 170 is made active ('1'') to request the CPU O80 to receive the conversion result.

次に、全入力端子をA/D変換する動作に移行する。Next, the operation shifts to A/D conversion of all input terminals.

但し、全入力端子をA/D変換する動作では、割り込み
信号線170は、インアクティフ(”0”)のままであ
る。
However, in the operation of A/D converting all input terminals, the interrupt signal line 170 remains inactive ("0").

また、A/D変換要求信号線160〜167はすべて動
作制御部550で受は付けが許可されており、この状態
において、任意の入力端子に対して外部からのA/D変
換の要求が生じた場合、動作制御部550は、判定回路
154で、そのA/D変換の要求のあった入力端子の値
からその要求の受は付けの可否を判定して、要求を受は
付ける場合には、その要求に対応する入力端子の値を端
子指定レジスタ153に書き込み、これと同期してA/
D変換装置500に対して、CPU080が動作指定レ
ジスタ152に′1“を書き込むことによって、検出回
路180が1”を書込まれたことを検出して変換信号線
185をアクティブ(“1”)にし、これによりA/D
変換装置500は端子指定レジスタ153で指定される
入力端子のA/D変換を1回行う、という動作と同様の
動作をさせて、要求のあった入力端子のA/D変換を起
動し、要求を受は付けない場合には、A/D変換装置5
00に対してなにも変化を与えさせない そして、1回のA/D変換の後、A/D変換装置500
に対して、全入力端子を順次A/D変換する動作に移行
させる。
In addition, all A/D conversion request signal lines 160 to 167 are permitted to be accepted by the operation control unit 550, and in this state, an external A/D conversion request is made to any input terminal. In this case, the operation control unit 550 uses the determination circuit 154 to determine whether or not the request should be accepted based on the value of the input terminal at which the A/D conversion request was made. , writes the value of the input terminal corresponding to the request to the terminal specification register 153, and synchronizes with this.
When the CPU 080 writes '1' to the operation designation register 152 for the D conversion device 500, the detection circuit 180 detects that '1' has been written and activates the conversion signal line 185 ('1'). and this allows A/D
The conversion device 500 performs the same operation as performing one A/D conversion of the input terminal specified by the terminal specification register 153, starts A/D conversion of the requested input terminal, and completes the requested input terminal. If no receiver is provided, the A/D converter 5
After one A/D conversion, the A/D converter 500
In contrast, all input terminals are sequentially A/D converted.

CPUO8,Oは、外部からのA/D変換の要求により
、特定端子についてのA/D変換を行った場合には、そ
の変換終了後に、まず端子指定レジスタ153の内容を
読み込み、直前に行ったA/D変換の入力端子を知るこ
とによって、変換結果格納レジスタ140〜147から
の読み出し位置すなわちアドレス指定信号線195を決
定し、変換結果の読み出しを行う。
When CPUO8, O performs A/D conversion on a specific terminal in response to an external A/D conversion request, after the conversion is completed, it first reads the contents of the terminal specification register 153, and then converts the contents of the terminal specification register 153 to the previous one. By knowing the input terminal of the A/D conversion, the reading position from the conversion result storage registers 140 to 147, that is, the addressing signal line 195 is determined, and the conversion result is read out.

その後、A/D変換要求信号線160〜167のうち、
いずれかのA/D変換要求信号線がアクティブになり、
これによってA/D変換の要求がなされる毎に、上記の
動作を繰り返す。
After that, among the A/D conversion request signal lines 160 to 167,
One of the A/D conversion request signal lines becomes active,
As a result, the above operation is repeated every time a request for A/D conversion is made.

〔発明の効果〕〔Effect of the invention〕

以上説明した様に、本発明は、 1、A/D変換装置が単一の入力端子のA/D変換終了
後に自動的に複数の入力端子を順次A/D変換する動作
に移行する機能を有することにより、単一の入力端子の
A/D変換動作と、複数の入力端子のA/D変換動作が
制御プロクラム内に混在した場合に、A/D変換の動作
切り換え、割込み信号のマスク、割込み信号のマスク解
除といった諸々の操作を不要にすることにより、CPU
の命令実行効率が低下することなく複雑なA/D変換動
作に対応することができる。
As explained above, the present invention has the following features: 1. The A/D converter has a function of automatically shifting to the operation of sequentially A/D converting a plurality of input terminals after completing A/D conversion of a single input terminal. By having A/D conversion operation of a single input terminal and A/D conversion operation of multiple input terminals mixed in a control program, it is possible to switch the A/D conversion operation, mask interrupt signals, By eliminating the need for various operations such as unmasking interrupt signals, the CPU
It is possible to handle complex A/D conversion operations without reducing instruction execution efficiency.

2)A/D変換の動作の切り替えを起動する外部からの
A/D変換要求信号線を、個々のアナログ入力端子に割
当てることによって、個々の入力端子ごとに独立した外
部からのA/D変換要求タイミンクに同期してA/D変
換を実行することができ、個々の入力端子毎に最適なタ
イミングでA/D変換処理の実行が可能である。
2) By assigning the external A/D conversion request signal line that starts switching the A/D conversion operation to each analog input terminal, independent external A/D conversion can be performed for each input terminal. A/D conversion can be performed in synchronization with request timing, and A/D conversion processing can be performed at optimal timing for each input terminal.

3、外部からの要求によって起動される、特定の入力端
子についてのA/D変換を実行しようとする時、すべて
の入力端子について、外部がら個4の入力端子について
のA/D変換が要求される毎に、それぞれのA/D変換
を、CPUの操作を介することなく、自動的にA/D変
換を実行することができるため、A/D変換を要求する
タイミングをCPUの操作によって発生しない、予めA
/D変換しようとする入力端子を指定することが困難で
あるような、外部がらのA/D変換要求のタイミングを
もつアナログソース群に対しても、すべての入力端子に
ついてのA/D変換処理を実行することが可能である。
3. When attempting to perform A/D conversion for a specific input terminal that is activated by an external request, A/D conversion for all 4 input terminals is requested from the outside. Each A/D conversion can be performed automatically without CPU operation, so the timing to request A/D conversion is not caused by CPU operation. , A in advance
A/D conversion processing for all input terminals even for analog sources with external A/D conversion request timing where it is difficult to specify the input terminal to be converted It is possible to execute

4、外部から特定の入力端子についてのA/D変換の要
求が同時になされた場合や、あるA/D変換の要求によ
って起動されたA/D変換の実行中に、新たにA/D変
換の要求がなされた場合に、CPUがその要求の受は付
けに関する判断を行わなくとも、自動的に、優先度の高
いアナログ入力端子についてのA/D変換の要求を選択
できる機能を有することにより、外部からの特定の入力
端子についてのA/D変換の要求に対して、全ての入力
端子の中から、常に、より重要度の高いアナログ入力端
子についてのA/D変換を優先的に実行することが可能
である。
4. When A/D conversion requests for specific input terminals are made from the outside at the same time, or during execution of A/D conversion started by a certain A/D conversion request, a new A/D conversion request is made. By having a function that automatically selects an A/D conversion request for a high-priority analog input terminal when a request is made, without the CPU having to make a decision regarding acceptance of the request, In response to an external A/D conversion request for a specific input terminal, always perform A/D conversion for the analog input terminal with higher importance from among all input terminals with priority. is possible.

5、外部から特定の入力端子についてのA/D変換の要
求が同時になされた場合や、あるA/D変換の要求によ
って起動されたA/D変換の実行中に、新たにA/D変
換の要求がなされた場合に、CPUがプログラマブルに
要求を受付ける優先順位を指定し、その優先順位に従っ
て、優先度の高いアナログ入力端子についてのA/D変
換の要求を選択できる機能を有することにより、外部か
らの特定の入力端子についてのA/D変換の要求に対し
て、全ての入力端子の中から、常にCPUが要求する、
より重要度の高いアナログ入力端子についてのA/D変
換を優先的に実行することが可能である。
5. When external A/D conversion requests for specific input terminals are made at the same time, or during execution of A/D conversion started by a certain A/D conversion request, a new A/D conversion request is made. When a request is made, the CPU programmably specifies the priority for accepting the request, and has a function that allows the CPU to select an A/D conversion request for a high-priority analog input terminal according to the priority. In response to a request for A/D conversion for a specific input terminal from the CPU, the CPU always requests it from among all input terminals.
It is possible to preferentially execute A/D conversion for analog input terminals with higher importance.

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

第1図は本発明の第1の実施例のフロ 第2図は本発明の第2の実施例のプロ 第3図は本発明の第3の実施例のプロ 第4図は本発明の第4の実施例のプロ 第5図は本発明の第5の実施例のプロ 第6図は従来例のブロック図である。 FIG. 1 shows the flowchart of the first embodiment of the present invention. FIG. 2 is a diagram illustrating a second embodiment of the present invention. FIG. 3 shows a third embodiment of the present invention. FIG. 4 is a diagram illustrating a fourth embodiment of the present invention. FIG. 5 is a diagram illustrating a fifth embodiment of the present invention. FIG. 6 is a block diagram of a conventional example.

Claims (3)

【特許請求の範囲】[Claims] (1)中央処理装置と、複数のアナログ入力端子と、前
記複数のアナログ入力端子のうちの1つを選択するアナ
ログ入力選択手段と、前記アナログ入力選択手段によっ
て選択されたアナログ入力端子のアナログ値をデジタル
値に変換するA/D変換器と、前記A/D変換器の変換
結果を格納する複数の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変換起
動要求手段によって切り替るA/D変換動作制御手段を
有し、前記中央処理装置の命令実行による、前記A/D
変換動作指定レジスタの書き換えを行う事なく、前記A
/D変換動作指定レジスタに基づく前記A/D変換動作
制御手段の制御によって、前記複数のアナログ入力端子
を前記アナログ入力選択手段により順次選択することに
より前記複数のアナログ入力端子からのアナログ入力を
前記A/D変換器によって順次A/D変換する動作と、
前記複数のアナログ入力端子の内の一つを選択的に前記
A/D変換器によってA/D変換する動作とを、前記A
/D変換起動要求手段によって切り替ることにより、前
記中央処理装置の命令実行と、前記A/D変換器の変換
動作の切替えを並列に行うことを特徴とするA/D変換
装置内蔵マイクロコンピュータ。
(1) A central processing unit, a plurality of analog input terminals, an analog input selection means for selecting one of the plurality of analog input terminals, and an analog value of the analog input terminal selected by the analog input selection means. an A/D converter that converts the A/D converter into a digital value, and a plurality of A/D conversion result storage registers that store the conversion results of the A/D converter;
A/D conversion result storage destination specifying means for specifying one of the plurality of A/D conversion result storage registers; and A/D conversion activation for requesting the A/D converter to start A/D conversion. a requesting means, an A/D conversion operation specification register for specifying a conversion operation of an A/D converter, and a plurality of analog input terminals selected by the analog input selection means based on the specification of the A/D conversion operation specification register. By sequentially selecting analog inputs from the plurality of analog input terminals,
The A/D conversion activation request performs an operation of sequentially A/D converting by a D converter and an operation of selectively A/D converting one of the plurality of analog input terminals by the A/D converter. The A/D conversion operation control means is configured to switch the A/D conversion operation by means of the A/D conversion operation control means, and
A without rewriting the conversion operation specification register.
The analog inputs from the plurality of analog input terminals are sequentially selected by the analog input selection means under the control of the A/D conversion operation control means based on the /D conversion operation specification register. An operation of sequentially performing A/D conversion by an A/D converter;
The operation of selectively A/D converting one of the plurality of analog input terminals by the A/D converter;
1. A microcomputer with a built-in A/D converter, characterized in that execution of commands by the central processing unit and switching of conversion operations by the A/D converter are performed in parallel by switching by a /D conversion start requesting means.
(2)特許請求の範囲第1項記載のA/D変換装置内蔵
マイクロコンピュータにおいて、前記A/D変換器に、
前記複数のアナログ入力端子に対応したA/D変換の開
始を要求する複数のA/D変換起動要求手段と、前記複
数の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変換装置内蔵マイクロコンピュータ。
(2) In the microcomputer with a built-in A/D converter according to claim 1, the A/D converter includes:
a plurality of A/D conversion start request means for requesting the start of A/D conversion corresponding to the plurality of analog input terminals; and a plurality of A/D conversion requests from the plurality of A/D conversion start request means; A/D conversion activation request determining means for selecting one of the A/D conversion activation requests based on a predetermined priority order;
Under the control of the A/D conversion operation control means based on the D conversion operation designation register, the A/D converter sequentially selects the plurality of analog input terminals by the analog input selection means. The operation of sequentially A/D converting analog inputs from the terminals and the operation of selectively A/D converting one of the plurality of analog input terminals are performed by the plurality of A/D conversion activation request means. A microcomputer with a built-in A/D conversion device, characterized in that switching is performed by an A/D conversion start request means selected from among them by the A/D conversion start request determination means.
(3)特許請求の範囲第1項又は第2項記載のA/D変
換装置内蔵マイクロコンピュータにおいて、前記中央処
理装置によって書き換え可能な優先順位指定レジスタと
、前記複数の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変換装置内蔵マイクロ
コンピュータ。
(3) A microcomputer with a built-in A/D conversion device according to claim 1 or 2, including a priority designation register that can be rewritten by the central processing unit, and a plurality of A/D conversion activation request means. Multiple A/ from
A/D conversion activation request determination means selects one of the D conversion requests based on the priority specified in the priority order designation register, and the Under the control of the A/D conversion operation control means, the A/D converter sequentially selects the plurality of analog input terminals by the analog input selection means, thereby sequentially converting analog inputs from the plurality of analog input terminals into A. A/D conversion operation and an operation of selectively A/D converting one of the plurality of analog input terminals are specified in the priority order designation register from among the plurality of A/D conversion activation request means. A microcomputer with a built-in A/D conversion device, characterized in that switching is performed by an A/D conversion activation requesting means selected by the A/D conversion activation request determining means based on the A/D conversion activation request determining means.
JP1272891A 1989-10-20 1989-10-20 Microcomputer with built-in A / D converter Expired - Lifetime JPH0821027B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1272891A JPH0821027B2 (en) 1989-10-20 1989-10-20 Microcomputer with built-in A / D converter

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1272891A JPH0821027B2 (en) 1989-10-20 1989-10-20 Microcomputer with built-in A / D converter

Publications (2)

Publication Number Publication Date
JPH03134782A true JPH03134782A (en) 1991-06-07
JPH0821027B2 JPH0821027B2 (en) 1996-03-04

Family

ID=17520199

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1272891A Expired - Lifetime JPH0821027B2 (en) 1989-10-20 1989-10-20 Microcomputer with built-in A / D converter

Country Status (1)

Country Link
JP (1) JPH0821027B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05315957A (en) * 1991-03-12 1993-11-26 Mitsubishi Electric Corp Analog/digital conversion device
JP2008278309A (en) * 2007-05-01 2008-11-13 Denso Corp Conversion controller

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05315957A (en) * 1991-03-12 1993-11-26 Mitsubishi Electric Corp Analog/digital conversion device
JP2008278309A (en) * 2007-05-01 2008-11-13 Denso Corp Conversion controller

Also Published As

Publication number Publication date
JPH0821027B2 (en) 1996-03-04

Similar Documents

Publication Publication Date Title
JPH0454255B2 (en)
JP4609113B2 (en) Processor
JP2005276097A (en) Interruption request program and microcomputer
JP2005057374A (en) Analog/digital converter and micro controller
JPH03134782A (en) Microcomputer incorporating a/d converter
JPH0916409A (en) Microcomputer
JP4451010B2 (en) Programmable controller
JPH05108380A (en) Data processing system
US20040093439A1 (en) Data processing control apparatus and DMA controller
JP3323009B2 (en) Data processing device
US5327565A (en) Data processing apparatus
JP2004118300A (en) Dma controller
JP2585905B2 (en) Multitask execution device
JP2666667B2 (en) Multitask execution device
JPH0821026B2 (en) Microcomputer
JP2918570B2 (en) Central processing unit
JP2991215B2 (en) Display system controller
JPH10143376A (en) Information processing device
JP2003228546A (en) Control device for direct memory access
JP2000172629A (en) Method and device for transfer data
JPS58225469A (en) Multi-processor controlling system
JPH09160786A (en) Microprocessor
EP0688449A1 (en) Method and apparatus for memory management
JPH06314249A (en) Data transfer equipment
JP2001306488A (en) Data transfer device

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080304

Year of fee payment: 12

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090304

Year of fee payment: 13

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100304

Year of fee payment: 14

EXPY Cancellation because of completion of term
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100304

Year of fee payment: 14