JPH0821027B2 - Microcomputer with built-in A / D converter - Google Patents

Microcomputer with built-in A / D converter

Info

Publication number
JPH0821027B2
JPH0821027B2 JP1272891A JP27289189A JPH0821027B2 JP H0821027 B2 JPH0821027 B2 JP H0821027B2 JP 1272891 A JP1272891 A JP 1272891A JP 27289189 A JP27289189 A JP 27289189A JP H0821027 B2 JPH0821027 B2 JP H0821027B2
Authority
JP
Japan
Prior art keywords
conversion
register
input terminal
converter
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.)
Expired - Lifetime
Application number
JP1272891A
Other languages
Japanese (ja)
Other versions
JPH03134782A (en
Inventor
里佳 薮井
昌弘 野村
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)

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、アナログ入力信号をデジタル値に変換する
A/D変換装置を内蔵したマイクロコンピュータに関す
る。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention converts an analog input signal into a digital value.
The present invention relates to a microcomputer including an A / D conversion device.

〔従来の技術〕[Conventional technology]

今日、マイクロコンピュータは、LSI技術の進歩によ
り高集積化が進み、各種の周辺ハードウェアをワンチッ
プに搭載するようになってきた。
Nowadays, microcomputers have been highly integrated due to the progress of LSI technology, and various kinds of peripheral hardware have been mounted on one chip.

なかでも、A/D変換器は、自動車制御やACサーボ制御
などの分野には不可欠なもので、A/D変換器内蔵マイク
ロコンピュータの需要は、非常に高いものである。以下
では、第6図用いて従来の技術を説明する。
Among them, the A / D converter is indispensable in fields such as automobile control and AC servo control, and the demand for a microcomputer with a built-in A / D converter is extremely high. The conventional technique will be described below with reference to FIG.

マイクロコンピュータ060は、中央処理装置(以下CPU
と略す)080と、A/D変換装置600と、前記CPU080とA/D変
換装置600とのデータのやりとりを行う内部バス090から
なる。
The microcomputer 060 is a central processing unit (hereinafter CPU
080), 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 performs a read / write operation of data with respect to the A / D conversion device 600 by executing a program, and also performs a process of receiving an interrupt signal 170 from the A / D conversion device.

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に対
して選択する入力端子を指定する入力端子指定信号線19
0,レジスタ140〜147の内1つを選択するアドレス指定信
号線195,A/D変換の動作指定を司どる動作指定レジスタ1
51,変換するべき入力端子を指定する端子指定レジスタ1
53から構成される。
The A / D converter 600 is an analog multiplexer (hereinafter abbreviated as multiplexer) that selects one of the signals from the input terminals 110 to 117 and the input terminals 110 to 117 for inputting an analog signal and transmits it to the A / D converter. ) 120, A / D converter 130 for A / D converting the output signal of the multiplexer 120, A / D conversion result storage register (hereinafter abbreviated as register) 140 to 147 for storing the conversion result of the A / D converter 130, A / D conversion operation control unit (hereinafter abbreviated as operation control unit) 650 that controls the operation of A / D conversion, interrupt signal line for requesting interrupt processing to CPU080 when a predetermined A / D conversion operation is completed 170, input terminal designation signal line 19 that designates the input terminal selected for the multiplexer 120
0, address specification signal line 195 for selecting one of registers 140 to 147, operation specification register 1 for controlling operation specification of A / D conversion
51, pin specification register 1 that specifies the input terminal to be converted
It consists of 53.

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

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

レジスタ140〜147はA/D変換器130の変換結果を動作制
御部650の出力するアドレス指定信号線195の指定するレ
ジスタに格納する。
The registers 140 to 147 store the conversion result of the A / D converter 130 in the register designated by the addressing signal line 195 output from the operation control unit 650.

また、レジスタ140〜147の何れのレジスタもCPU080か
ら読み出し可能である。
Further, any of the registers 140 to 147 can be read from the CPU 080.

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

前述の動作指定レジスタ151及び端子指定レジスタ153
は、CPU080からアクセス可能である。
The above-mentioned operation designation register 151 and pin designation register 153
Are accessible from the CPU080.

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

続いてA/D変換装置600の動作と前記動作制御部650,動
作指定レジスタ151,端子指定レジスタ153の関係を詳細
に説明する。
Next, the relationship between the operation of the A / D converter 600 and the operation control unit 650, the operation designation register 151, and the terminal designation register 153 will be described in detail.

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

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

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

端子指定レジスタ153の値と端子の対応は、端子指定
レジスタ153の値がそのまま端子の番号に対応する。即
ち端子指定レジスタ153が“5"ならば、入力端子115を、
端子指定レジスタ153が“7"なら入力端子117を指定す
る。A/D変換結果は、アナログ入力端子に対応したレジ
スタ(例えば、アナログ入力端子が110ならレジスタ14
0、アナログ入力端子が115ならレジスタ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,
If the terminal designation register 153 is "7", the input terminal 117 is designated. The A / D conversion result is registered in the register corresponding to the analog input terminal (for example, if the analog input terminal is 110, register 14
0, if the analog input terminal is 115, store it in register 145).

1回のA/D変換が終了するたびに割り込み信号線170を
アクティブ(“1")にする。これによりレジスタ140〜1
47内のA/D変換結果をCPU080に引き取ることを要請し、
再びA/D変換動作を開始し、上記動作を繰り返す。
The interrupt signal line 170 is activated (“1”) every time one A / D conversion is completed. This allows registers 140-1
Request to take the A / D conversion result in 47 to CPU080,
The A / D conversion operation is started again and the above operation is repeated.

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

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

以後、再びA/D変換動作をアナログ入力端子110から開
始し、繰り返す。
After that, 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 converter will be described together with the instruction execution of the CPU.

通常、各種の制御の為のA/D変換は、各入力端子を順
次A/D変換して、各入力端子の最新のA/D変換結果を通常
読み込み可能にしておく場合と、内外部の発生するタイ
ミングに基いて特定端子のA/D変換を行う場合があり、
両者は混在して使用される。
Normally, A / D conversion for various controls is performed by sequentially A / D converting each input terminal and making the latest A / D conversion result of each input terminal normally readable, and A / D conversion of a specific pin may be performed based on the timing of occurrence,
Both are used mixedly.

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

尚、A/D変換装置600は、8回のA/D変換終了毎に割り
込み信号170をアクティブにし、CPU080に割り込み処理
を要求するが、特に必要な処理はない為、CPU080側で割
り込みをマスクしておく。(図5には記述していない) 次に、CPU080がプログラムを実行中にA/D変換サブル
ーチンコールによってサブルーチンコール時の特定端子
の状態を知る為に、CPU080は動作指定レジスタ151に
“0"を設定すると共に変換するべき入力端子の番号を端
子指定レジスタ153に設定して、A/D変換装置を1つのア
ナログ入力端子をA/D変換する動作に移行させる。
The A / D converter 600 activates the interrupt signal 170 every eight A / D conversion ends and requests the CPU080 to perform interrupt processing. However, since there is no particular processing required, the interrupt is masked on the CPU080 side. I'll do it. (Not shown in FIG. 5) Next, in order for the CPU080 to know the state of the specific terminal at the time of the subroutine call by the A / D conversion subroutine call while the program is being executed, the CPU080 sets “0” in the operation designation register 151. Is set and the number of the input terminal to be converted is set in the terminal designation register 153, and the A / D conversion device shifts to the operation of A / D converting one analog input terminal.

A/D変換装置600は、1変換終了毎に割り込み信号170
をアクティブ(“1")するため、ここではCPU080は、割
り込みをマスクせず、割り込み信号170がアクティブ
(“1")になる度に、A/D変換結果をCPU080に取込み、
必要な数だけA/D変換を行った後、再び動作指定レジス
タ151に“1"を設定して、前述の各入力端子110〜117を
順次A/D変換する動作に切り換えると同時に割り込みを
マスクする。
The A / D converter 600 outputs an interrupt signal 170 every time one conversion is completed.
In this case, the CPU080 does not mask the interrupt, and fetches the A / D conversion result to the CPU080 every time the interrupt signal 170 becomes active (“1”).
After performing the necessary number of A / D conversions, set the operation specification register 151 to "1" again to switch the operation to the A / D conversion of each of the input terminals 110 to 117 described above and mask the interrupt at the same time. To do.

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

〔発明が解決しようとする課題〕[Problems to be Solved by the Invention]

従来のA/D変換装置は、特定端子のA/D変換と全端子順
次A/D変換の両方の動作をさせる場合に、CPUの命令によ
って動作を切り換える操作を行う必要があり、また割り
込みフラグのマスク,マスク解除といった処理が必要で
ある。
Conventional A / D converters need to switch operations according to CPU instructions when performing both A / D conversion of specific pins and sequential A / D conversion of all pins. Masking and unmasking are required.

この操作は、A/D変換の動作を切り換える度に付きま
とう為、A/D変換動作の切り換えが多発すると、前述の
動作切り換え操作のための命令実行が多くなり、CPUが
本来実行するべき制御のためのプログラム実行に対して
有効な処理の割合が低下し、制御装置全体の性能低下を
招いてしまう。
Since this operation is attached every time the A / D conversion operation is switched, if the switching of the A / D conversion operation occurs frequently, the number of instruction executions for the operation switching operation described above will increase, and the control of the CPU that should originally execute it will increase. As a result, the ratio of effective processing to the execution of the program is reduced, and the performance of the entire control device is degraded.

〔課題を解決するための手段〕[Means for solving 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 provides 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. A / D converter that converts to a digital value, multiple A / D conversion result storage registers that store the conversion results of the A / D converter, and one of multiple A / D conversion result storage registers A / D conversion result storage destination specifying means and A / D converter that requests the A / D converter to start A / D conversion
Specify D conversion start request means and conversion operation of A / D converter
Based on the designations of the A / D conversion operation designation register and the A / D conversion operation designation register, by sequentially selecting a plurality of analog input terminals by the analog input selection means, the analog inputs from the plurality of analog input terminals are selected. The operation of sequentially performing A / D conversion by the A / D converter and selectively selecting one of the plurality of analog input terminals by the A / D converter.
It has an A / D conversion operation control means for switching the operation of / D conversion by the A / D conversion activation request means.

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

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

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

個々のアナログ入力端子に対応する外部からのA/D
変換要求信号線により発生した、個々のアナログ入力端
子についてのA/D変換の要求に対して、CPUの命令実行の
依らず、所定の優先順位に基ずいて、常により優先順位
の高い要求を受け付けてA/D変換を起動する機能を持つ
ことにより、外部からの要求だけで、全ての入力端子の
中から、常により重要度の高い入力端子についてのA/D
変換を優先的に実行できる。
External A / D corresponding to each analog input terminal
With respect to the A / D conversion request for each analog input terminal generated by the conversion request signal line, a request with a higher priority is always issued based on a predetermined priority without depending on the CPU instruction execution. By having the function of accepting and activating A / D conversion, A / D for the input terminal of higher importance is always selected from all the input terminals only by an external request.
The conversion can be performed preferentially.

個々のアナログ入力端子に対応する外部からのA/D
変換要求信号線により発生した、個々のアナログ入力端
子についてのA/D変換の要求に対して、必要に応じてプ
ログラマブルに優先順位を実行中に書き換えることが可
能で、その優先順位の高い要求を受けてA/D変換を起動
する機能を持つことにより、外部からの要求だけで、全
ての入力端子の中からCPUによって指定された重要度の
高い入力端子についてA/D変換を優先的に実行できる。
External A / D corresponding to each analog input terminal
For the A / D conversion request for each analog input terminal generated by the conversion request signal line, the priority can be reprogrammed as needed during execution, and the request with higher priority can be rewritten. With the function to receive and activate A / D conversion, A / D conversion is preferentially executed for all the input pins with high importance specified by the CPU from all input pins, only by an external request. it can.

〔実施例〕〔Example〕

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

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

CPU080は、プログラム実行によってA/D変換装置100に
対するデータのリード,ライト動作を行う他にA/D変換
装置からの割り込み信号170を受け付ける処理も行う。
The CPU 080 performs a data read / write operation with respect to the A / D conversion device 100 by executing a program, and also performs a process of receiving an interrupt signal 170 from the A / D conversion device.

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

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

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

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

レジスタ140〜147はA/D変換器130に変換結果を動作制
御部150の出力するアドレス指定信号線195の指定するレ
ジスタに格納する。
The registers 140 to 147 store the conversion result in the A / D converter 130 in the register designated by the addressing signal line 195 output from the operation control unit 150.

また、レジスタ140〜147の何れのレジスタもCPU080か
ら読み出し可能である。
Further, any of the registers 140 to 147 can be read from the CPU 080.

動作制御部150は、A/D変換の動作を指定する2つの動
作指定レジスタ151,152、及び変換するべき入力端子を
指定する端子指定レジスタ153を有し、動作指定レジス
タ151,152、端子指定レジスタ153はCPU080からアクセス
可能である。
The operation control unit 150 has two operation specifying registers 151 and 152 for specifying an A / D conversion operation and a terminal specifying register 153 for specifying an input terminal to be converted. The operation specifying registers 151 and 152 and the terminal specifying register 153 are the CPU080. It is accessible from.

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

また、A/D変換要求信号線160は、動作制御部150に対
してA/D変換動作の切り換えタイミングを与える。
Further, the A / D conversion request signal line 160 gives the operation control section 150 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 / D-converting a single terminal, and 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をアクティブ
(“1")にして動作制御部150に対し動作制御レジスタ1
52に“1"が書込まれたことを伝える。
When the detection circuit 180 detects the operation of writing “1” in the operation control register 152, it activates the conversion signal line 185 (“1”) to the operation control unit 150.
Tell 52 that "1" has been written.

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

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

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

(1) 動作指定レジスタ152が“0"、動作指定レジス
タ151が“0"の時、 A/D変換装置100は前述の端子指定レジスタ153の指定
する単一のアナログ入力端子を継続してA/D変換し続け
る。A/D変換結果は、アナログ入力端子に対応したレジ
スタ(例えば、アナログ入力端子が114からレジスタ14
4)に格納する。
(1) When the operation specification register 152 is “0” and the operation specification register 151 is “0”, the A / D conversion device 100 continues to operate the single analog input terminal specified by the terminal specification register 153 as described above. Continue to / D conversion. The A / D conversion result is stored in the register corresponding to the analog input terminal (for example, the analog input terminal 114 to register 14
Store in 4).

1回のA/D変換が終了するたびに割り込み信号線170を
アクティブ(“1")にする。これによりレジスタ140〜1
47内のA/D変換結果をCPU080に引き取ることを要請し、
再びA/D変換動作を開始し、上記動作を繰り返す。
The interrupt signal line 170 is activated (“1”) every time one A / D conversion is completed. This allows registers 140-1
Request to take the A / D conversion result in 47 to CPU080,
The A / D conversion operation is started again and the above operation is repeated.

(2) 動作指定レジスタ152が“0"、動作指定レジス
タ151が“1"の時、 A/D変換装置100は、全アナログ入力端子を順次A/D変
換して行く動作を行い、この場合、端子指定レジスタ15
3は無効となる。
(2) When the operation specification register 152 is “0” and the operation specification register 151 is “1”, the A / D conversion device 100 performs an operation of sequentially A / D converting all analog input terminals. , Pin specification register 15
3 is 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, and then the analog input terminal 111 is converted.
Is converted, the conversion result is stored in the register 141, the 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”).

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

(3) 動作指定レジスタ152が、“1"の時 この動作指定レジスタ151の値に拘らず動作指定レジ
スタ152への書込み動作によって制御される。
(3) When the operation designation register 152 is "1" Regardless of the value of the operation designation register 151, the operation designation register 152 is controlled by the write operation.

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

これにより、A/D変換装置100は、端子指定レジスタ15
3の指定する入力端子のA/D変換を1回行う。
As a result, the A / D conversion device 100 causes the terminal designation register 15
Performs A / D conversion once for the input terminal specified in 3.

さらに、A/D変換結果を(1)の例に習って、入力端
子に対応したレジスタ140〜147の何れかの1つに格納す
ると、割り込み信号170をアクティブ(“1")にしてCPU
080に、変換結果の引き取りを要求する。
Furthermore, when the A / D conversion result is learned in the example of (1) and stored in any one of the registers 140 to 147 corresponding to the input terminal, the interrupt signal 170 is activated (“1”).
Request 080 to retrieve 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 the input terminals, the interrupt signal 170 is not activated (“1”).

また、動作制御部150は、A/D変換要求信号160によっ
て外部からのA/D変換の要求を受けると、A/D変換装置10
0に対して、CPU080が動作指定レジスタ152が“1"を書込
むことによって起動される動作、すなわち、CPU080が動
作指定レジスタ152に対して“1"を書込むと、検出回路1
80が“1"を書込まれたことを特徴とする検出して変換信
号線185アクティブ(“1")にし、これにより、A/D変換
装置100は、端子指定レジスタ153の指定する入力端子の
A/D変換を1回行う、という動作と同様の動作をさせ
る。
Further, when the operation control unit 150 receives an A / D conversion request from the outside by the A / D conversion request signal 160, the A / D conversion device 10
For 0, the operation started by the CPU080 by writing "1" in the operation designation register 152, that is, when the CPU080 writes "1" in the operation designation register 152, the detection circuit 1
The conversion signal line 185 is activated ("1") by detecting that "1" has been written in 80, whereby the A / D conversion device 100 causes the input terminal designated by the terminal designation register 153. of
The same operation as that of performing A / D conversion once is performed.

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

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

CPU080は、単に特定端子のA/D変換のみを実行したい
場合は、動作指定レジスタ152に“0"、動作指定レジス
タ152に“0"を設定すればよく、同様に複数の入力端子
のA/D変換を実行したい場合は、動作指定レジスタ152に
“0"、動作指定レジスタ151に“1"を設定すればよい。
If the CPU080 only wants to execute A / D conversion of a specific terminal, it may set “0” in the operation specification register 152 and “0” in the operation specification register 152, and similarly, A / D conversion of a plurality of input terminals. When it is desired to execute D conversion, "0" may be set in the operation designation register 152 and "1" may be set in the operation designation register 151.

前述の両方の動作を行わせたい場合は、動作指定レジ
スタ152に“1"を設定すればよい。
When it is desired to perform both the operations described above, "1" may be set in the operation designation register 152.

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

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

しかも、この一連の動作に付随して割り込み信号のマ
スク,マスク解除の操作を行う必要がない。
Moreover, it is not necessary to perform the operation of masking and unmasking the interrupt signal accompanying this series of operations.

また、A/D変換要求信号線160によって、CPU080の命令
実行によらず、外部事象の変化に同期して上記動作を行
うことも可能であり、この場合、CPUは単にA/D変換結果
を引き取る動作のみを行う。
Further, by the A / D conversion request signal line 160, the above operation can be performed in synchronization with the change of the external event without depending on the instruction execution of the CPU 080. In this case, the CPU simply displays the A / D conversion result. Only take action.

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

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

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

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

マルチプレクサ120,A/D変換器130,レジスタ140〜147,
割り込み信号線170,入力信号指定線190,アドレス信号線
指定195の動作は、実施例1と同様であるため、ここで
の説明は省略する。
Multiplexer 120, A / D converter 130, registers 140 to 147,
The operations of the interrupt signal line 170, the input signal designating line 190, and the address signal line designating 195 are the same as those in the first embodiment, and the description thereof is omitted here.

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

(1) 動作指定レジスタ152が“0"、動作指定レジス
タ151が“0"の時、 (2) 動作指定レジスタ152が“0"、動作指定レジス
タ151が“1"の時、 (3) 動作指定レジスタ152が“1"、動作指定レジス
タ151が“0"の時、 以上の場合については、実施例1における(1),
(2),(3)と同様であるので、説明は省略する。
(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) Operation When the designation register 152 is “1” and the operation designation register 151 is “0”, the above case is (1) in the first embodiment,
The description is omitted because it is the same as (2) and (3).

(4) 動作指定レジスタ152が“1"、動作指定レジス
タ151が“1"の時、 このとき、A/D変換装置200においてCPU080が動作指定
レジスタ152に対して“1"を書込む動作を行うと、検出
回路180が“1"を書込まれたことを検出し、変換信号線1
85をアクティブ(“1")にする。
(4) When the operation specification register 152 is “1” and the operation specification register 151 is “1”, at this time, in the A / D converter 200, the CPU080 writes the operation specification register 152 with “1”. Then, the detection circuit 180 detects that "1" has been written, and the conversion signal line 1
Make 85 active (“1”).

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

以後A/D変換装置200は、入力端子114〜117を順次A/D
変換する動作に移行し、変換結果は、レジスタ144〜147
に格納する。
After that, the A / D converter 200 sequentially inputs / outputs the input terminals 114 to 117.
The operation proceeds to conversion, and the conversion result is stored in registers 144 to 147.
To be stored.

但し、入力端子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が動作指定レジスタ152に“1"を書込むこ
とによって起動される動作、すなわち、CPU080が動作指
定レジスタ152に対して“1"を書き込むと、検出回路180
が“1"を書き込まれたことを検出して変換信号線185を
アクティブ(“1")にし、これにより、A/D変換装置200
は、端子指定レジスタ153の指定する入力端子のA/D変換
を4回行う、という動作と同様の動作をさせる。
Further, when the operation control unit 250 receives an A / D conversion request from the outside by the A / D conversion request signal 160, the A / D conversion device 200
On the other hand, when the CPU starts an operation by writing “1” in the operation specifying register 152, that is, when the CPU 080 writes “1” in the operation specifying register 152, the detection circuit 180
Detects that the "1" has been written, activates the conversion signal line 185 ("1"), and thereby the A / D converter 200
Performs an operation similar to the operation of performing A / D conversion of the input terminal designated by the terminal designation register 153 four times.

即ち、A/D変換装置200は、A/D変換要求信号160がアク
ティブ(“1")になると、前述の(3)または、(4)
の動作を行う。
That is, when the A / D conversion request signal 160 becomes active (“1”), the A / D conversion device 200 returns to the above (3) or (4).
The operation of.

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

CPU080は、単に特定端子のA/D変換のみを実行したい
場合は、実施例1と同様に、動作指定レジスタ152に
“0"、動作指定レジスタ151に“0"を設定すればよく、
同様に複数の入力端子のA/D変換のみを実行したい場合
は、動作指定レジスタ152に“0"、動作指定レジスタ151
に“1"を設定すればよい。また、前述の両方の動作を行
わせたい場合は、動作指定レジスタ152に“1"、動作指
定レジスタ151に“0"を設定すればよい。
When the CPU080 only wants to execute A / D conversion of a specific terminal, it may set “0” in the operation designation register 152 and “0” in the operation designation register 151, as in the first embodiment.
Similarly, if you want to execute only A / D conversion for multiple input terminals, set the operation specification register 152 to "0" and the operation specification register 151.
Set “1” to. Further, when it is desired to perform both the operations described above, "1" may be set in the operation designation register 152 and "0" may be set in the operation designation register 151.

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

この時、CPU080は、動作指定レジスタ151,152ともに
“1"、を設定すればよい。
At this time, the CPU 080 may set "1" to both the operation designation registers 151 and 152.

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

従ってCPU080は、ただ1回の動作指定レジスタ151,15
2の書き込み操作のみで、A/D変換装置に1つのアナログ
入力端子を4回A/D変換させて、その後に複数の入力端
子をA/D変換する動作に移行させるうえに割り込み信号
のマスク,マスク解除の操作を一切必要としない。
Therefore, the CPU080 has only one operation specification register 151,15.
With only 2 write operations, the A / D converter causes one analog input terminal to A / D convert four times, and then shifts to the operation of A / D converting multiple input terminals. , No need to unmask.

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

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

CPU080は、プログラム実行によってA/D変換装置300に
対するデータのリード,ライト動作を行う他にA/D変換
装置からの割り込み信号170を受け付ける処理も行う。
The CPU 080 performs a data read / write operation with respect to the A / D conversion device 300 by executing a program, and also performs a process of receiving an interrupt signal 170 from the A / D conversion device.

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

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

マルチプレクサ120、A/D変換器130、レジスタ140〜14
7、割込み信号線170、入力信号指定線190、アドレス指
定信号線195、検出回路180、変換信号線185の動作は、
実施例1と同様であるため、ここでの説明は省略する。
Multiplexer 120, A / D converter 130, registers 140-14
7, the operation of the interrupt signal line 170, the input signal designation line 190, the address designation signal line 195, the detection circuit 180, the conversion signal line 185,
Since it is the same as the first embodiment, the description thereof is omitted here.

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

端子指定レジスタ153は、その値がそのまま入力端子
を指定していて、例えば、端子指定レジスタ153が“3"
なら入力端子113を指定し、端子指定レジスタ153が“6"
なら入力端子116を指定する。
The value of the pin designation register 153 directly designates the input pin. For example, if the pin designation register 153 is "3".
If so, specify input terminal 113 and set terminal specification register 153 to "6".
Then, the input terminal 116 is designated.

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

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

また動作制御部350はA/D変換要求信号線160〜167によ
るA/D変換の要求によって、その要求に対応する入力端
子の値を端子指定レジスタ153に書き込み、A/D変換装置
300に対して、CPU080が動作指定レジスタ152に対して
“1"を書き込む動作と同様の動作を行なわせる。
Further, the operation control unit 350 writes the value of the input terminal corresponding to the request in the terminal designation register 153 in response to the A / D conversion request from the A / D conversion request signal lines 160 to 167, and the A / D conversion device.
CPU 300 is caused to perform the same operation as the operation in which CPU 080 writes "1" to operation designation register 152.

例えば、動作制御部350にA/D変換要求信号162が入力
されると、動作制御部350は端子指定レジスタ153に“2"
を書き込み、A/D変換要求信号165が入力されると、端子
指定レジスタ153に“5"を書き込む。
For example, when the A / D conversion request signal 162 is input to the operation control unit 350, the operation control unit 350 causes the terminal designation register 153 to indicate “2”.
When the A / D conversion request signal 165 is input, “5” is written in the pin designation register 153.

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

以下では本実施例における、動作指定レジスタ151,15
2の値、A/D変換要求信号線160〜167と端子指定レジスタ
153およびA/D変換装置300の間の動作関係を説明する。
In the following, the operation designation registers 151 and 15 in this embodiment will be described.
Value of 2, A / D conversion request signal lines 160-167 and pin specification register
An operational relationship between the 153 and the A / D conversion device 300 will be described.

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

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

(2) 動作指定レジスタ152が“0"、動作指定レジス
タ151が“1"の時、 A/D変換装置300は、全アナログ入力端子を順次A/D変
換して行く動作を行い、この場合、端子指定レジスタ15
3は無効となる。従って、A/D変換要求信号線160〜167の
状態には影響を受けない。
(2) When the operation specification register 152 is “0” and the operation specification register 151 is “1”, the A / D conversion device 300 performs the operation of sequentially A / D converting all analog input terminals. , Pin specification register 15
3 is invalid. Therefore, the states of the A / D conversion request signal lines 160 to 167 are not affected.

この時の基本動作は、実施例1の(2)の場合におけ
る動作と同様であるので説明は省略する。
Since the basic operation at this time is the same as the operation in the case of (2) of the first embodiment, description thereof 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, the CPU080 sets the operation designation register 152 to "1".
When the write operation is performed, the detection circuit 180 detects that "1" has been written and activates the conversion signal line 185 ("1").
To

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

さらに、A/D変換終了後、A/D変換結果を入力端子に対
応したレジスタ140〜147の何れかの1つに格納すると、
割り込み信号170をアクティブ(“1")にしてCPU080
に、変換結果の引き取りを要求する。
Further, when the A / D conversion result is stored in any one of the registers 140 to 147 corresponding to the input terminal after the A / D conversion is completed,
CPU080 with interrupt signal 170 active (“1”)
Request 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 the input terminals, the interrupt signal 170 remains inactive (“0”).

また、A/D変換要求信号線160〜167は、端子指定レジ
スタ153で指定した入力端子に対応するA/D変換要求信号
線だけが受け付けを許可されていて、この時、端子指定
レジスタ153で指定した入力端子に対応するA/D変換要求
信号線がアクティブ(“1")になることでその入力端子
についてのA/D変換の要求が行われ、この要求により動
作制御部350はA/D変換装置300に対して、CPU080が動作
指定レジスタ152に“1"を書込むことによって起動され
る動作、すなわち、CPU080が動作指定レジスタ152に
“1"を書き込むと、検出回路180が“1"を書込まれたこ
とを検出して変換信号線185をアクティブ(“1")に
し、これによりA/D変換装置300は端子指定レジスタ153
で指定される入力端子のA/D変換を1回行なう、という
動作と同様の動作をさせる。
Further, as for the A / D conversion request signal lines 160 to 167, only the A / D conversion request signal line corresponding to the input terminal designated by the terminal designation register 153 is permitted to be accepted. When the A / D conversion request signal line corresponding to the specified input terminal becomes active (“1”), an A / D conversion request for that input terminal is made. For the D converter 300, an operation started by the CPU 080 writing “1” to the operation designation register 152, that is, when the CPU 080 writes “1” to the operation designation register 152, the detection circuit 180 outputs “1”. It is detected that "" has been written, and the conversion signal line 185 is activated ("1"), whereby the A / D conversion device 300 causes the terminal designation register 153
Performs the same operation as performing the A / D conversion once on the input terminal specified by.

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

(4) 動作指定レジスタ152が、“1"、動作指定レジ
スタ152が、“1"の時、 まずCPU080は、A/D変換しようとする入力端子の値を
あらかじめ端子指定レジスタ153に書き込んでおく。
(4) When the operation specification register 152 is "1" and the operation specification register 152 is "1", the CPU080 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, the CPU080 sets the operation designation register 152 to "1".
Is performed, the detection circuit 180 detects that "1" has been written, and activates the conversion signal line 185 ("1").

これにより、A/D変換装置300は、端子指定レジスタ15
3で指定される入力端子のA/D変換1回行う。
As a result, the A / D conversion device 300 operates in the pin designation register 15
Performs A / D conversion once for the input terminal specified in 3.

さらにA/D変換結果を、入力端子に対応したレジスタ1
40〜147のいずれかの1つに格納すると、割り込み信号1
70をアクティブ(“1")にして、CPU080に変換結果の引
き取りを要求する。
In addition, the A / D conversion result is sent to the register 1 corresponding to the input terminal.
When stored in one of 40 to 147, interrupt signal 1
70 is activated (“1”) and CPU080 is requested to receive the conversion result.

この時、CPU080はまず端子指定レジスタ153の内容を
読み込み、直前に行ったA/D変換の入力端子を特定する
ことによって、変換結果の格納位置を知り変換結果の読
み出しを行う。
At this time, the CPU 080 first reads the contents of the pin designation register 153 and identifies the input terminal of the A / D conversion performed immediately before to know the storage position of the conversion result and read 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 the 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, the A / D conversion request signal lines 160 to 167 are all permitted to be accepted by the operation control unit 350, and the A / D conversion request signal line becomes active (“1”) to an external input terminal. If a request for A / D conversion is made, the operation control unit 350
Writes the value of the input terminal for which A / D conversion is requested to the terminal designation register 153.

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

さらに、上記の動作と同期して、A/D変換装置300に対
し、CPU080が動作指定レジスタ152に“1"を書き込むこ
とによって起動される動作、すなわち、CPU080が動作指
定レジスタ152に“1"を書き込むと、検出回路180が“1"
を書込まれたことを検出して変換信号線185をアクティ
ブ(“1")にし、これによりA/D変換装置300は端子指定
レジスタ153で指定される入力端子のA/D変換を1回行な
う、という動作と同様の動作をさせ、A/D変換の要求の
あった入力端子の値を書き込まれている、端子指定レジ
スタ153の示す入力端子についてのA/D変換を起動する。
Further, in synchronization with the above operation, the operation started by the CPU080 writing "1" to the operation designation register 152 in the A / D converter 300, that is, the CPU080 writes "1" to the operation designation register 152. Is written, the detection circuit 180 turns to "1".
Is detected and the conversion signal line 185 is activated (“1”), whereby the A / D conversion device 300 performs A / D conversion of the input terminal specified by the terminal specification register 153 once. The same operation as that of performing is performed, and A / D conversion is started for the input terminal indicated by the terminal designation register 153 in which the value of the input terminal for which A / D conversion is requested is 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変換要求信
号線がアクティブ(“1")になると、この要求を受けた
動作制御部350が要求のあった入力端子の値を端子指定
レジスタ153に書込み、この端子指定レジスタ153の指定
する入力端子のA/D変換を行い、1変換が終了すると再
び全入力端子をA/D変換する動作に移行する。
That is, when any A / D conversion request signal line becomes active (“1”), the A / D conversion device 300 causes the operation control unit 350 that receives this request to specify the value of the requested input terminal as a terminal. Writing to the register 153, A / D conversion of the input terminal designated by the terminal designation register 153 is performed, and when one conversion is completed, the operation shifts to the A / D conversion of all the input terminals again.

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

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

CPU080は、 (1) 単に端子指定レジスタ153で指定する入力端子
をA/D変換する動作のみを実行したい場合は、 動作指定レジスタ152に“0"、動作指定レジスタ151に
“0"を設定する。
The CPU080 sets (1) “0” to the operation specification register 152 and “0” to the operation specification register 151 when only performing the operation of A / D converting the input terminal specified by the terminal specification register 153. .

(2) 複数の入力端子を順次A/D変換する動作のみを
実行したい場合は、 動作指定レジスタ152に“0"、動作指定レジスタ151に
“1"を設定する。
(2) To perform only the operation of sequentially A / D converting a plurality of input terminals, set "0" in the operation designation register 152 and "1" in the operation designation register 151.

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

(4) CPU080が端子指定レジスタ153に指定する特定
の入力端子または外部の複数のA/D変換要求信号線によ
ってA/D変換の要求のなされた入力端子をA/D変換する動
作と、全入力端子を順次A/D変換動作を併せて実行した
い場合は、 動作指定レジスタ152に“1"、動作指定レジスタ151に
“1"を設定する。
(4) The CPU080 performs A / D conversion on a specific input terminal specified in the terminal specification register 153 or an input terminal for which A / D conversion is requested by a plurality of external A / D conversion request signal lines. When it is desired to sequentially perform A / D conversion operations on the input terminals, set "1" in the operation designation register 152 and "1" in the operation designation register 151.

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

CPU080は、プログラム実行によってA/D変換装置400に
対するデータのリード,ライト動作を行う他にA/D変換
装置400からの割り込み信号170を受け付ける処理も行
う。
The CPU 080 performs a data read / write operation with respect to the A / D conversion device 400 by executing the program, and also performs a process of receiving an interrupt signal 170 from the A / D conversion device 400.

A/D変換装置400は、アナログ信号を入力するための入
力端子110〜117、マルチプレクサ120、マルチプレクサ1
20の出力信号をA/D変換するA/D変換器130、A/D変換器13
0の変換結果を格納するレジスタ140〜147、A/D変換の動
作を制御する動作制御部450、入力端子110〜117につい
てのA/D変換の開始を要求するA/D変換要求信号線160〜1
67、所定のA/D変換動作が終了するとCPU080に対して割
り込み処理を要求するための割り込み信号線170、マル
チプレクサ120に対して選択する入力端子を指定する入
力端子指定信号線190、レジスタ140〜147の内1つを選
択するアドレス指定信号線195、A/D変換の制御を司どる
動作指定レジスタ151,152、変換するべき入力端子を指
定する端子指定レジスタ153、A/D変換要求信号線160〜1
67によるA/D変換要求のうち優先的に受け付けるべきA/D
変換要求を判定する優先順位判定回路(以下判定回路と
略す)154、判定回路154による判定の結果である判定結
果信号(以下判定信号と略す)155、端子指定レジスタ1
53の内容を判定回路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 a multiplexer 1.
A / D converter 130 and A / D converter 13 for A / D converting 20 output signals
Registers 140 to 147 that store the conversion result of 0, an operation control unit 450 that controls the operation of A / D conversion, and an A / D conversion request signal line 160 that requests the start of A / D conversion for the input terminals 110 to 117. ~ 1
67, an interrupt signal line 170 for requesting interrupt processing to the CPU 080 when a predetermined A / D conversion operation is completed, an input terminal designation signal line 190 for designating an input terminal to be selected for the multiplexer 120, and a register 140 to Address designation signal line 195 for selecting one of 147, operation designation registers 151, 152 for controlling A / D conversion, terminal designation register 153 for designating an input terminal to be converted, A / D conversion request signal line 160 to 1
A / D to be preferentially accepted among A / D conversion requests by 67
A priority determination circuit (hereinafter abbreviated as a determination circuit) 154 for determining a conversion request, a determination result signal (hereinafter abbreviated as a determination signal) 155 as a result of the determination by the determination circuit 154, a terminal designation register 1
A content display signal (hereinafter abbreviated as display signal) 156 for displaying the contents of 53 on the determination circuit 154, a write detection circuit (hereinafter abbreviated as detection circuit) 180 for detecting the operation of writing "1" to the operation designation register 152, operation The control register 152 includes a signal line (hereinafter, referred to as a conversion signal line) 185 indicating that "1" is written.

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

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

A/D変換要求信号線160〜167は、動作制御部450に対し
て、入力端子110〜117のA/D変換を要求する信号線で、
それぞれアナログ信号の入力端子110〜117に対応してい
る。
A / D conversion request signal lines 160 to 167 are signal lines that request the operation control unit 450 to perform A / D conversion of the input terminals 110 to 117,
Each corresponds to an analog signal input terminal 110-117.

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

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

動作指定レジスタ151,152はCPU080からアクセス可能
であり、端子指定レジスタ153はCPU080からアクセス可
能であるとともに、動作制御部450によっても書き込み
が可能である。
The operation designation registers 151 and 152 can be accessed by the CPU 080, the terminal designation register 153 can be accessed by the CPU 080, and the operation control unit 450 can also write them.

端子指定レジスタ153は、その値がそのまま入力端子
を指定していて、例えば、端子指定レジスタ153が“3"
なら入力端子113を指定し、端子指定レジスタ153が“6"
なら入力端子116を指定する。
The value of the pin designation register 153 directly designates the input pin. For example, if the pin designation register 153 is "3".
If so, specify input terminal 113 and set terminal specification register 153 to "6".
Then, the input terminal 116 is designated.

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

説明を簡単にするため、本実施例では、A/D変換の優
先順位が、A/D変換要求信号線160が一番低く、161,…,1
67の順で優先順位が高くなる場合について説明するが、
本発明における優先順位の設定がこの場合に限られるわ
けではない。
In order to simplify the explanation, in the present embodiment, the priority order of A / D conversion is that the A / D conversion request signal line 160 has the lowest priority, 161, ..., 1.
I will explain the case where the priority becomes higher in the order of 67,
The setting of the priority order in the present invention is not limited to this case.

また、判定回路154の動作を説明するために、A/D変換
要求信号線160〜167に対しそれぞれ数値“0"〜“7"を割
当て、入力端子110〜117を表わすものとして説明する。
Further, in order to describe the operation of the determination circuit 154, it is assumed that the numerical values “0” to “7” are assigned to the A / D conversion request signal lines 160 to 167 and the input terminals 110 to 117 are represented.

判定回路154は、上記のの場合には、要求を行なっ
た複数のA/D変換要求信号線に対応した入力端子の値に
よりその優先順位を判定して、その結果受け付けを行な
ったA/D変換要求に対応する入力端子の値を判定信号155
として端子指定レジスタ153に書き込む。
In the above case, 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 the A / D that received the result. The value of the input terminal corresponding to the conversion request is determined by the judgment signal 155
Is written in the pin designation register 153 as

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

との両方の場合には、それぞれの動作を併せて行
なう。
In both cases, the respective operations are performed together.

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

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

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

(1) 動作指定レジスタ152が“0"、動作指定レジス
タ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 "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) Operation When the designation register 152 is "1" and the operation designation register 151 is "0", the determination circuit 154 of the operation control unit 450 does not operate at this time, and therefore the basic operation is the same as in (1) of the first embodiment. , (2)
Since the operation is the same as that in the case (2) of the third embodiment, the description thereof will be omitted.

(4) 動作指定レジスタ152が“1"、動作指定レジス
タ151が“1"の時、 この時、CPU080が動作指定レジスタ152に対して“1"
を書き込む動作を行うと、検出回路180が“1"を書き込
まれたことを検出し、変換信号線185をアクティブ
(“1")にする。
(4) When the operation specification register 152 is "1" and the operation specification register 151 is "1", at this time, the CPU080 sets the operation specification register 152 to "1".
Is performed, the detection circuit 180 detects that "1" has been written, and activates the conversion signal line 185 ("1").

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

これにより、A/D変換装置400は入力端子110のA/D変換
を1回行う。
As a result, the A / D conversion device 400 performs the 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”), and the CPU 080 is requested to take 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 the input terminals, the interrupt signal line 170 remains inactive (“0”).

また、A/D変換要求信号線160〜167はすべて動作制御
部450で受け付けが許可されており、この状態におい
て、任意の入力端子に対して外部からのA/D変換の要求
が生じた場合、動作制御部450は、判定回路154で、その
A/D変換の要求のあった入力端子の値からその要求を受
け付けの可否を判定して、要求を受け付ける場合には、
その要求に対応する入力端子の値を端子指定レジスタ15
3に書き込み、これと同期してA/D変換装置400に対し
て、CPU080が動作指定レジスタ152に“1"を書き込むこ
とによって起動される動作、すなわち、CPU080が動作指
定レジスタ152に対して“1"を書込むと、検出回路180が
“1"を書込まれたことを検出して変換信号線185をアク
ティブ(“1")にし、これによりA/D変換装置400は端子
指定レジスタ153で指定される入力端子のA/D変換を1回
行う、という動作と同様の動作をさせて、要求のあった
入力端子のA/D変換を起動し、要求を受け付けない場合
には、A/D変換装置400に対してなにも変化を与えさせな
い。
In addition, the A / D conversion request signal lines 160 to 167 are all permitted to be accepted by the operation control unit 450, and in this state, when an external A / D conversion request is made to an arbitrary input terminal. The operation control unit 450 uses the determination circuit 154 to
When accepting the request is judged from the value of the input terminal for which the A / D conversion was requested, and when accepting the request,
The value of the input pin corresponding to the request is set to the pin specification register 15
3 is written, and in synchronization with this, an operation started by the CPU 080 writing “1” to the operation designation register 152 in the A / D conversion device 400, that is, the CPU 080 sends “1” to the operation designation register 152. When 1 "is written, the detection circuit 180 detects that" 1 "has been written and activates the conversion signal line 185 (" 1 "), whereby the A / D conversion device 400 causes the pin designation register 153. Performs the same operation as performing the A / D conversion of the input terminal specified in step 1 once, activates the A / D conversion of the requested input terminal, and if the request is not accepted, A No change is applied to the / D converter 400.

そして、1回のA/D変換の後、A/D変換装置400に対し
て、全入力端子を順次A/D変換する動作に移行させる。
Then, after one A / D conversion, the A / D conversion device 400 is shifted to the operation of sequentially A / D converting all the input terminals.

CPU080は、外部からのA/D変換の要求により、特定端
子についてのA/D変換を行った場合には、その変換終了
後に、まず端子指定レジスタ153の内容を読み込み、直
前に行ったA/D変換の入力端子を知ることによって、変
換結果格納レジスタ140〜147からの読み出し位置すなわ
ちアドレス指定信号線195を決定し、変換結果の読み出
しを行う。
When the CPU080 performs A / D conversion on a specific pin in response to an A / D conversion request from the outside, after the conversion is completed, the contents of the pin designation register 153 are first read and the A / D conversion performed immediately before is performed. By knowing the input terminal for D conversion, the read 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.

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

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

CPU080は、 (1) 単に端子指定レジスタ153で指定する入力端子
をA/D変換する動作のみを実行したい場合は、 動作指定レジスタ152に“0"、動作指定レジスタ151に
“0"を設定する。
The CPU080 sets (1) “0” to the operation specification register 152 and “0” to the operation specification register 151 when only performing the operation of A / D converting the input terminal specified by the terminal specification register 153. .

(2) 複数の入力端子を順次A/D変換する動作のみを
実行したい場合は、 動作指定レジスタ152に“0"、動作指定レジスタ151に
“1"を設定する。
(2) To perform only the operation of sequentially A / D converting a plurality of input terminals, set "0" in the operation designation register 152 and "1" in the operation designation register 151.

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

(4) CPU080が端子指定レジスタ153に指定する特定
の入力端子または、外部からの複数のA/D変換要求の中
から規定の優先順位を基に選んだA/D変換の要求に対応
する入力端子についてのA/D変換をする動作と、全入力
端子を順次A/D変換動作を併せて実行したい場合は、 動作指定レジスタ152に“1"、動作指定レジスタ151に
“1"を設定する。
(4) A specific input terminal specified by the CPU080 in the terminal specification register 153 or an input corresponding to an A / D conversion request selected from a plurality of external A / D conversion requests based on a specified priority. When you want to perform the A / D conversion operation for a pin and the A / D conversion operation for all input pins in sequence, set the operation specification register 152 to "1" and the operation specification register 151 to "1". .

次に、本発明の第5の実施例について第5図を参照し
て説明する。マイクロコンピュータ050は、CPU080と、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 has CPU080 and A
It comprises an / D converter 500 and an internal bus 090 for exchanging data between the CPU 080 and the A / D converter 500.

CPU080は、プログラム実行によってA/D変換装置500に
対するデータのリード,ライト動作を行う他にA/D変換
装置500からの割り込み信号170を受け付ける処理も行
う。
The CPU 080 performs a data read / write operation with respect to the A / D conversion device 500 by executing a program, and also performs a process of receiving an interrupt signal 170 from the A / D conversion device 500.

A/D変換装置500は、アナログ信号を入力するための入
力端子110〜117、マルチプレクサ120、マルチプレクサ1
20の出力信号をA/D変換するA/D変換器130、A/D変換器13
0の変換結果を格納するレジスタ140〜147、A/D変換の動
作を制御する動作制御部550、入力端子110〜117につい
てのA/D変換の開始を要求するA/D変換要求信号線160〜1
67、所定の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に“1"を書込む動作を検
出する書込み検出回路(以下検出回路と略す)180、動
作制御レジスタ152に“1"が書込まれたことを示す信号
線(以下変換信号線と略す)185から構成される。
The A / D conversion device 500 includes input terminals 110 to 117 for inputting an analog signal, a multiplexer 120, and a multiplexer 1.
A / D converter 130 and A / D converter 13 for A / D converting 20 output signals
Registers 140 to 147 that store the conversion result of 0, an operation control unit 550 that controls the operation of A / D conversion, an A / D conversion request signal line 160 that requests the start of A / D conversion for the input terminals 110 to 117. ~ 1
67, an interrupt signal line 170 for requesting interrupt processing to the CPU 080 when a predetermined A / D conversion operation is completed, an input terminal designation signal line 190 for designating an input terminal to be selected for the multiplexer 120, and registers 14 to Address designation signal line 195 for selecting one of 147, operation designation registers 151, 152 for controlling A / D conversion, terminal designation register 153 for designating an input terminal to be converted, A / D conversion request signal line 160 to 167
Priority specification register 158 that specifies the priority order for accepting A / D conversion requests by the A / D conversion request by the A / D conversion request lines 160 to 167. Rank judgment circuit (hereinafter abbreviated as judgment circuit)
154, a determination result signal (hereinafter abbreviated as a determination signal) 155 which is a result of the determination by the determination circuit 154, a content display signal (hereinafter abbreviated as a display signal) 156 for displaying the contents of the terminal designation register 153 on the determination circuit 154, and a priority order. A content display signal (hereinafter abbreviated as display signal) 157 for displaying the contents of the designated register 158 on the determination circuit 154, and a write detection circuit (hereinafter abbreviated as detection circuit) 180 for detecting the operation of writing "1" to the operation designation register 152. , A signal line (hereinafter abbreviated as a conversion signal line) 185 indicating that “1” is written in the operation control register 152.

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

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

A/D変換要求信号線160〜167は、動作制御部550に対し
て、入力端子110〜117のA/D変換を要求する信号線で、
それぞれアナログ信号の入力端子110〜117に対応してい
る。
A / D conversion request signal lines 160 to 167 are signal lines that request the operation control unit 550 to perform A / D conversion of the input terminals 110 to 117,
Each corresponds to an analog signal input terminal 110-117.

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

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

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

端子指定レジスタ153は、その値がそのまま入力端子
を指定していて、例えば、端子指定レジスタ153が“3"
なら入力端子113を指定し、端子指定レジスタ153が“6"
なら入力端子116を指定する。
The value of the pin designation register 153 directly designates the input pin. For example, if the pin designation register 153 is "3".
If so, specify input terminal 113 and set terminal specification register 153 to "6".
Then, the input terminal 116 is designated.

実施例3,4で記したように、動作指定レジスタ152に
“1"、動作指定レジスタ151に“1"が設定されることに
より、特定の入力端子をA/D変換する動作と、全入力端
子を順次A/D変換する動作を併せて実行する場合に於い
て、判定回路154は、A/D変換要求信号線160〜167によっ
て、 異なる入力端子についてのA/D変換要求が同時にな
された場合、あるいは、 A/D変換の要求によって起動された、ある入力端子
についてのA/D変換実行中に、新たに別の入力端子につ
いてのA/D変換要求がなされた場合に、 それらのA/D変換要求の中から優先順位指定レジスタ1
58により指定された優先順位に基づいて、より高い優先
順位を持つ入力端子を判定し、その結果優先順位の高い
方の入力端子の値を判定信号155として端子指定レジス
タ153に伝える。
As described in the third and fourth embodiments, by setting "1" in the operation designation register 152 and "1" in the operation designation register 151, the operation of A / D converting a specific input terminal and all inputs In the case where the operation of sequentially performing A / D conversion on the terminals is also executed, the determination circuit 154 determines that the A / D conversion request signal lines 160 to 167 simultaneously make A / D conversion requests for different input terminals. Or if a new A / D conversion request is made for another input pin while the A / D conversion is being performed for one input pin that was activated by the A / D conversion request, those A Priority designation register 1 from among / D conversion requests
Based on the priority designated by 58, the input terminal having the higher priority is determined, and as a result, the value of the input terminal having the higher priority is transmitted to the terminal designation register 153 as the determination signal 155.

判定回路154は、上記のの場合には、要求を行なっ
た複数のA/D変換要求信号線に対応した入力端子の値を
優先順位指定レジスタ158に指定した優先順位に基づい
てその優先順位を判定して、その結果より高い優先順位
を持つ入力端子の値を判定信号155として端子指定レジ
スタ153に書き込む。
In the above case, the determination circuit 154 determines the priority order 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 order specified in the priority order specification register 158. The value of the input terminal having a higher priority than the result of the determination is written as the determination signal 155 in the terminal designation register 153.

上記のの場合には、A/D変換要求がなされた入力端
子の値と、端子指定レジスタ153の内容を示している表
示信号156の値とを優先順位指定レジスタ158に指定され
た優先順位に基づき、どちらの優先順位がより高いかを
判定して、 a) 新たにA/D変換の要求がなされた入力端子より、
表示信号156に示された入力端子の方が、優先順位指定
レジスタ158に指定された優先順位が低いときには、そ
の入力端子の値を判定信号155として出力して端子指定
レジスタ153に書き込み、 b) 新たにA/D変換の要求がなされた入力端子より、
表示信号156に示された入力端子の方が、優先順位指定
レジスタ158に指定された優先順位が高いときには、表
示信号156の値を判定信号155として出力するが、端子指
定レジスタ153には書き込みを行なわない。
In the above case, the value of the input terminal for which the A / D conversion request is made and the value of the display signal 156 indicating the contents of the terminal designation register 153 are set to the priority designated by the priority designation register 158. Based on which, the higher priority is determined, and a) From the input terminal newly requested for A / D conversion,
When the input terminal indicated by the display signal 156 has a lower priority designated by the priority designation register 158, the value of the input terminal is output as the determination signal 155 and written in the terminal designation register 153, b). From the input terminal for which a new A / D conversion request was made,
When the input terminal indicated by the display signal 156 has a higher priority designated by the priority designation register 158, the value of the display signal 156 is output as the determination signal 155, but the terminal designation register 153 is not written. Do not do.

との両方の場合には、それぞれの動作を併せて行
なう。
In both cases, the respective operations are 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の示す入力端子113とを優先順位
指定レジスタ158に基づき、どの入力端子がより優先順
位が高いかを判定して、その判定の結果より優先順位の
高い入力端子115についてのA/D変換の要求を受け付け、
判定結果である判定信号155として入力端子115を表す
“5"という値を出力し、これを端子指定レジスタ153に
書き込む。
Specifically, in the priority designation register 158, the input terminal 110 as the highest priority input terminal, the input terminal 111 as the second highest priority input terminal, the input terminal 115 as the third highest priority input terminal, The input terminal 112 is the fourth highest priority input terminal, the input terminal 116 is the fifth highest priority input terminal, the input terminal 114 is the sixth highest priority input terminal, and the seventh highest priority input terminal. Is designated as the input terminal 113, and the input terminal 117 is designated as the input terminal having the eighth highest priority, and the input terminal is requested by the A / D conversion request signal line 163 for the A / D conversion.
When performing A / D conversion for 113, a request for A / D conversion for the input terminal 115 by the A / D conversion request signal line 165 and a request for input terminal 116 by the A / D conversion request signal line 166 are performed. When the A / D conversion requests are made at the same time, the input terminal 115, the input terminal 116, and the input terminal 113 indicated by the display signal 156 indicating the content of the terminal designation register 153 are set on the basis of the priority designation register 158. It is determined which input terminal has a higher priority, and the A / D conversion request for the input terminal 115 having a higher priority than the result of the determination is accepted.
A value "5" representing the input terminal 115 is output as the judgment signal 155 which is the judgment result, and this is written in the terminal designation register 153.

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

以下では本実施例における、A/D変換要求信号線160〜
167、動作制御部550における動作指定レジスタ151,15
2、端子指定レジスタ153、優先順位指定レジスタ158、
およびA/D変換装置500の間の動作関係を説明する。
The A / D conversion request signal line 160-
167, operation designation registers 151 and 15 in the operation control unit 550
2, pin specification register 153, priority specification register 158,
The operation relationship between the A / D converter 500 and the A / D converter 500 will be described.

(1) 動作指定レジスタ152が“0"、動作指定レジス
タ151が“0"の時、 (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 "0", (2) When the operation specification register 152 is "0" and the operation specification register 151 is "1", (3) Operation When the designation register 152 is "1" and the operation designation register 151 is "0", at this time, the determination circuit 154 of the operation control unit 550 does not operate at all. Therefore, the basic operation is (1) of the first embodiment. , (2)
Since the operation is the same as that in the case (2) of the third embodiment, the description thereof will be omitted.

(4) 動作指定レジスタ152が“1"、動作指定レジス
タ151が“1"の時、 この時、CPU080が動作指定レジスタ152に対して“1"
を書き込む動作を行うと、検出回路180が“1"を書き込
まれたことを検出し、変換信号線185をアクティブ
(“1")にする。
(4) When the operation specification register 152 is "1" and the operation specification register 151 is "1", at this time, the CPU080 sets the operation specification register 152 to "1".
Is performed, the detection circuit 180 detects that "1" has been written, and activates the conversion signal line 185 ("1").

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

これにより、A/D変換装置500は入力端子110のA/D変換
を1回行う。
As a result, the A / D conversion device 500 performs the 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”), and the CPU 080 is requested to take 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 the input terminals, the interrupt signal line 170 remains inactive (“0”).

また、A/D変換要求信号線160〜167はすべて動作制御
部550で受け付けが許容されており、この状態におい
て、任意の入力端子に対して外部からのA/D変換の要求
が生じた場合、動作制御部550は、判定回路154で、その
A/D変換の要求のあった入力端子の値からその要求の受
け付けの可否を判定して、要求を受け付ける場合には、
その要求に対応する入力端子の値を端子指定レジスタ15
3に書き込み、これと同期してA/D変換装置500に対し
て、CPU080が動作指定レジスタ152に“1"を書き込むこ
とによって、検出回路180が“1"を書込まれたことを検
出して変換信号線185をアクティブ(“1")にし、これ
によりA/D変換装置500は端子指定レジスタ153で指定さ
れる入力端子のA/D変換を1回行う、という動作と同様
の動作をさせて、要求のあった入力端子のA/D変換を起
動し、要求を受け付けない場合には、A/D変換装置500に
対してなにも変化を与えさせない。
Also, the A / D conversion request signal lines 160 to 167 are all allowed to be accepted by the operation control unit 550, and in this state, when an external A / D conversion request is made to any input terminal. The operation control unit 550 uses the determination circuit 154 to
If the acceptance of the request is judged from the value of the input terminal for which the A / D conversion was requested, and if the request is accepted,
The value of the input pin corresponding to the request is set to the pin specification register 15
3 is written to the A / D converter 500 in synchronization with this, the CPU 080 writes “1” to the operation designation register 152 to detect that the detection circuit 180 has written “1”. The conversion signal line 185 is activated (“1”) by this, whereby the A / D conversion device 500 performs the same operation as the operation of performing A / D conversion of the input terminal specified by the terminal specification register 153 once. Then, the A / D conversion of the requested input terminal is activated, and when the request is not accepted, the A / D conversion device 500 is not changed.

そして、1回のA/D変換の後、A/D変換装置500に対し
て、全入力端子を順次A/D変換する動作に移行させる。
Then, after one A / D conversion, the A / D converter 500 is caused to shift to an operation of sequentially A / D converting all the input terminals.

CPU080は、外部からのA/D変換の要求により、特定端
子についてのA/D変換を行った場合には、その変換終了
後に、まず端子指定レジスタ153の内容を読み込み、直
前に行ったA/D変換の入力端込を知ることによって、変
換結果格納レジスタ140〜147からの読み出し位置すなわ
ちアドレス指定信号線195を決定し、変換結果の読み出
しを行う。
When the CPU080 performs A / D conversion on a specific pin in response to an A / D conversion request from the outside, after the conversion is completed, the contents of the pin designation register 153 are first read and the A / D conversion performed immediately before is performed. By knowing the input end of the D conversion, the read 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.

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

〔発明の効果〕〔The invention's effect〕

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

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

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

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

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

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

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

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】中央処理装置と、複数のアナログ入力端子
と、A/D変換器と、A/D変換動作指定レジスタと、前記複
数のアナログ入力端子の内の1つを選択し当該選択した
アナログ入力を前記A/D変換器によりA/D変換させる第1
の動作、前記複数のアナログ入力端子を順次選択してそ
れぞれ前記A/D変換器にA/D変換させる第2の動作および
前記第1の動作を行うとともに前記第2の動作を行う第
3の動作の中から1つの動作を、前記中央処理装置で書
き換えられる前記A/D変換動作指定レジスタの内容に基
づき選択して実行させるA/D変換動作制御手段とを有す
ることを特徴とするA/D変換装置内蔵マイクロコンピュ
ータ。
1. A central processing unit, a plurality of analog input terminals, an A / D converter, an A / D conversion operation designation register, and one of the plurality of analog input terminals are selected and selected. First A / D conversion of analog input by the A / D converter
Operation, the second operation of sequentially selecting the plurality of analog input terminals and causing the A / D converter to perform A / D conversion, and the third operation of performing the second operation. A / D conversion operation control means for selecting and executing one operation from among the operations based on the contents of the A / D conversion operation designation register rewritten by the central processing unit Microcomputer with built-in D converter.
【請求項2】特許請求の範囲第1項記載のA/D変換装置
内蔵マイクロコンピュータにおいて、前記A/D変換器にA
/D変換の開始を要求するA/D変換起動要求手段をさらに
有し、前記A/D変換動作制御手段は、前記A/D変換起動要
求手段によるA/D変換開始要求にさらに基づき前記第3
の動作を選択し実行させることを特徴とするA/D変換装
置内蔵マイクロコンピュータ。
2. The microcomputer with a built-in A / D conversion device according to claim 1, wherein the A / D converter has an A
Further comprising A / D conversion start request means for requesting the start of / D conversion, wherein the A / D conversion operation control means is further based on the A / D conversion start request by the A / D conversion start request means. Three
A microcomputer with a built-in A / D converter characterized by selecting and executing the operation of.
【請求項3】特許請求の範囲第1項記載のA/D変換装置
内蔵マイクロコンピュータにおいて、前記複数のアナロ
グ入力端子にそれぞれ対応して設けられそれぞれ前記A/
D変換器にA/D変換の開始を要求する複数A/D変換起動要
求手段と、前記複数のA/D変換起動要求手段から所定の
優先順位に基づき、A/D変換起動要求手段を1つ選択す
るA/D変換起動要求判定手段とをさらに有し、前記A/D変
換動作制御手段は、前記選択されたA/D変換起動要求手
段によるA/D変換起動要求にさらに対応して、前記選択
されたA/D変換起動要求手段に対応する前記アナログ入
力端子のアナログ入力に対し前記第3の動作を選択し実
行させることを特徴とするA/D変換装置内蔵マイクロコ
ンピュータ。
3. A microcomputer with a built-in A / D converter according to claim 1, wherein the A / D converter is provided corresponding to each of the plurality of analog input terminals.
A plurality of A / D conversion activation requesting means for requesting the D converter to start A / D conversion, and one A / D conversion activation requesting means based on a predetermined priority from the plurality of A / D conversion activation requesting means. A / D conversion start request determining means for selecting one of the A / D conversion start request determining means, and the A / D conversion operation control means further corresponds to the A / D conversion start request by the selected A / D conversion start request means. A microcomputer with a built-in A / D conversion device, characterized in that the third operation is selected and executed for an analog input of the analog input terminal corresponding to the selected A / D conversion activation requesting means.
【請求項4】特許請求の範囲第3項記載のA/D変換装置
内蔵マイクロコンピュータにおいて、前記所定の優先順
位を示す情報を格納する優先順位指定レジスタをさらに
有し、前記優先順位指定レジスタは前記中央処理装置に
よってこの内容が書き換え可能となっていることを特徴
とするA/D変換装置内蔵マイクロコンピュータ。
4. The microcomputer with a built-in A / D conversion device according to claim 3, further comprising a priority order specification register for storing information indicating the predetermined priority order, and the priority order specification register. A microcomputer with a built-in A / D converter, wherein the contents can be rewritten by the central processing unit.
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 JPH03134782A (en) 1991-06-07
JPH0821027B2 true 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)

Families Citing this family (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
JPH03134782A (en) 1991-06-07

Similar Documents

Publication Publication Date Title
JP2002533807A (en) Interrupt / software control thread processing
JP2001265609A (en) Arithmetic processor
US5600807A (en) Programmable controller capable of updating a user program during operation by switching between user program memories
JPH10207717A (en) Microcomputer
JPH10171665A (en) Jump code generator, interrupt program selection device and system, and computer
JP2005057374A (en) Analog/digital converter and micro controller
JP3980901B2 (en) Digital signal processor
JPH0916409A (en) Microcomputer
JPH0821027B2 (en) Microcomputer with built-in A / D converter
US7076641B2 (en) Programmable controller
EP0811922A1 (en) Peripheral device control
JP3323009B2 (en) Data processing device
EP0510617B1 (en) Data processing apparatus with high-speed "macroservice" interrupt
JP2004534985A (en) Interrupt control device
JPH0821026B2 (en) Microcomputer
JP2918570B2 (en) Central processing unit
JPH09160786A (en) Microprocessor
JP3430075B2 (en) Data transfer method
JPH0756633B2 (en) Task switching method
JP3197045B2 (en) Extended central processing unit
JPH02110739A (en) Central processing unit for multi-task
JPH10143376A (en) Information processing device
JPS635790B2 (en)
JPH06149593A (en) Multitask executive device
JPH0531170B2 (en)

Legal Events

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

Free format text: PAYMENT UNTIL: 20080304

Year of fee payment: 12

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

Free format text: PAYMENT UNTIL: 20090304

Year of fee payment: 13

FPAY Renewal fee payment (prs 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 (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100304

Year of fee payment: 14