JP3830199B2 - A / D converter and microcontroller - Google Patents

A / D converter and microcontroller Download PDF

Info

Publication number
JP3830199B2
JP3830199B2 JP07874996A JP7874996A JP3830199B2 JP 3830199 B2 JP3830199 B2 JP 3830199B2 JP 07874996 A JP07874996 A JP 07874996A JP 7874996 A JP7874996 A JP 7874996A JP 3830199 B2 JP3830199 B2 JP 3830199B2
Authority
JP
Japan
Prior art keywords
conversion
channel
input channel
input
channels
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP07874996A
Other languages
Japanese (ja)
Other versions
JPH09269870A (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.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Electric Industry Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oki Electric Industry Co Ltd filed Critical Oki Electric Industry Co Ltd
Priority to JP07874996A priority Critical patent/JP3830199B2/en
Publication of JPH09269870A publication Critical patent/JPH09269870A/en
Application granted granted Critical
Publication of JP3830199B2 publication Critical patent/JP3830199B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、複数のアナログ入力を切り換えてA/D変換するA/D変換装置に関する。本発明はまた、A/D変換装置を備えたマイクロコントローラに関する。
【0002】
【従来の技術】
マルチプレクサを用いて入力を切り換えることにより、1つのA/D変換部で複数のチャネルの電流あるいは電圧等を測定可能としたA/D変換装置が知られている。このようなA/D変換装置は、機器の制御等を行うマイクロコントローラ(以下、マイコンという)等に用いられる。また、このようなA/D変換装置は、A/D変換結果を保持するリザルトレジスタを備えている。このリザルトレジスタの数はA/D変換装置の用途、価格等によって異なっている。
【0003】
リザルトレジスタを1つしか持たないA/D変換装置により複数のチャネルの測定を行う場合には、図2(A)に示すように所定時間毎にA/D変換するチャネルを切り換え、各々のチャネルの電流あるいは電圧等をA/D変換した後、同図(B)に示すように外部の機器(マイコン、パーソナルコンピュータ等)に対してA/D変換データの読み出しを要求するための割り込みを発生する。従って、外部の機器は各々のチャネルのA/D変換が終了する度に、割り込みに応じてA/D変換装置からのデータを取り込む必要がある。このような割り込みが頻繁に発生すると、割り込み処理のためのオーバーヘッドにより、外部の機器がA/D変換以外の処理を行う処理能力が著しく低下する。
【0004】
これに対し、マルチプレクサのチャネル数分のリザルトレジスタを設けたA/D変換装置を用いる場合では、マルチプレクサを切り換えて全てのチャネルのA/D変換が終了した後、A/D変換データの読み出しを指示する割り込みを発生し、外部の機器が各リザルトレジスタから各チャネルのデータを読み出す構成とすることができるため、割り込みの発生頻度を低下させることができる。外部の機器の処理能力の低下を低減させることができる。
【0005】
しかしながら、この場合、全てのチャネル毎にリザルトレジスタを設ける構成となるため、チャネル数が増加すると回路規模が大きくなり、また、用途によってはマルチプレクサの全てのチャネルを使用するとは限らないため、使用しないリザルトレジスタは無駄になってしまう。従って、A/D変換装置のコストが必要以上に上昇してしまう。
【0006】
また、マルプレクサのチャネル数より少ない数のリザルトレジスタを設けたA/D変換装置では、全てのチャネルを幾つかのグループに分けて扱うようになっている。例えば16チャネルの入力に対して4チャネル分のリザルトレジスタを備えるA/D変換装置では、16チャネル分の入力が図3に示すような4つのグループ(グループ0〜グループ3)に分けられている。
【0007】
例えばこれらのグループのうちのグループ0(チャネル0〜チャネル3)が指定されると、このような構成のA/D変換装置は、例えば図2(A)に示すように、グループ0のチャネル0〜チャネル3の信号を順次A/D変換し、最後のチャネル3のA/D変換が終了した後、同図(C)に示すように、A/D変換データの読み出しを要求する割り込みを発生し、外部の機器によりリザルトレジスタからA/D変換データが読み出された後、チャネル0〜チャネル3の信号のA/D変換を繰り返す。このような動作は連続モードと呼ばれる。
【0008】
連続モードの動作では、同一のグループのチャネルのみを繰り返してA/D変換しているだけなので、全てのチャネルの信号をA/D変換するためには、外部の機器がグループの切り換えを行う必要がある。
【0009】
例えば上述のような各々4つのチャネルからなる4つのグループ(グループ0〜グループ3)を切り換えてA/D変換する場合には、図4(A)に示すように、まず、外部の機器は時刻t0においてグループ0のA/D変換を指示する。A/D変換装置は指示されたグループ0のA/D変換を開始し、チャネル0〜チャネル3のA/D変換を行った後、同図(B)に示すように、時刻t1においてA/D変換データの読み出しを要求する割り込みを発生してA/D変換を停止する。外部の機器はリザルトレジスタからA/D変換データを読み出し、次のグループであるグループ1のA/D変換を指示する。A/D変換装置は時刻t2においてグループ1のA/D変換を開始し、チャネル4〜チャネル7でのA/D変換を行い、グループ0の場合と同様に割り込みを発生し、A/D変換を停止する。同様に、順次各グループのA/D変換を行って全てのチャネルのA/D変換を行う。
【0010】
【発明が解決しようとする課題】
上述のように、複数のグループを切り換えてA/D変換を行う場合には、各グループのチャネルのA/D変換が終了する度に、A/D変換を一旦停止してグループの切り換えを行う必要がある。従って、外部の機器は各グループ毎にA/D変換データの読み出しに加えてグループの切り換えを行わなければならず、処理負荷が増加する。また、グループの切り換えのための時間が増加すると、A/D変換のサンプリング周期を短縮したい場合等に障害となる。
【0011】
本発明は上述のような問題点に鑑みてなされたものであり、外部機器の処理負荷を低減することができるA/D変換装置を提供することを目的とする。
【0012】
【課題を解決するための手段】
本発明は、
複数の入力チャネルを選択する入力切り換え手段と、
該入力切り換え手段により選択された入力チャネルの入力信号をA/D変換するA/D変換手段と、
該A/D変換手段のA/D変換結果を保持する上記入力チャネルの数より少ない複数の保持手段と、
上記入力切り換え手段を制御して所定数の入力チャネルを順次選択し、上記A/D変換手段にA/D変換を指示する選択制御手段と、
上記選択制御手段により選択した入力チャネルのA/D変換結果を格納する保持手段を選択する保持部選択手段と、
上記複数の保持手段の内の第1の所定数の保持手段にA/D変換結果が格納されたときに外部の機器に上記保持手段からのA/D変換結果の読み出しを要求して読み出しを行わせる読み出し要求手段と、
上記保持手段のうちの第2の所定数の保持手段を上記複数の入力チャネルの内の特定の入力チャネルに割り当てる割り当て手段とを備え、
上記保持部選択手段は、上記選択制御手段により選択した入力チャネルが特定の入力チャネルであるときはA/D変換結果を上記特定の入力チャネルに割り当てられた保持手段に格納し、上記選択制御手段により選択した入力チャネルが特定の入力チャネルでないときはA/D変換結果を上記特定の入力チャネルに割り当てられた保持手段以外の保持手段に格納し、
上記選択制御手段は、上記特定の入力チャネル以外の入力チャネルを、複数のグループに分割し、各グループの入力チャネルを順次選択してA/D変換させ、
上記選択制御手段は、上記特定の入力チャネル以外の入力チャネルのすべてを選択してA/D変換させた後、上記特定の入力チャネルを選択してA/D変換させ、
上記読み出し要求手段は、各グループのすべての入力チャネルについてA/D変換が終わったら、当該グループのA/D変換の結果の読み出し要求を行って読み出しを行わせ
上記読み出し要求手段は、すべてのグループのすべての入力チャンネルについてのA/D変換の結果の読み出しが終わったら、上記特定の入力チャネルについてのA/D変換の結果の読み出し要求を行って読み出しを行わせる
ことを特徴とするA/D変換装置を提供する。
本発明はまた
複数の入力チャネルを選択する入力切り換え手段と、
該入力切り換え手段により選択された入力チャネルの入力信号をA/D変換するA/D変換手段と、
該A/D変換手段のA/D変換結果を保持する上記入力チャネルの数より少ない複数の保持手段と、
上記入力切り換え手段を制御して所定数の入力チャネルを順次選択し、上記A/D変換手段にA/D変換を指示する選択制御手段と、
上記選択制御手段により選択した入力チャネルのA/D変換結果を格納する保持手段を選択する保持部選択手段と、
上記複数の保持手段の内の第1の所定数の保持手段にA/D変換結果が格納されたときに外部の機器に上記保持手段からのA/D変換結果の読み出しを要求して読み出しを行わせる読み出し要求手段と、
上記保持手段のうちの第2の所定数の保持手段を上記複数の入力チャネルの内の特定の入力チャネルに割り当てる割り当て手段とを備え、
上記保持部選択手段は、上記選択制御手段により選択した入力チャネルが特定の入力チャネルであるときはA/D変換結果を上記特定の入力チャネルに割り当てられた保持手段に格納し、上記選択制御手段により選択した入力チャネルが特定の入力チャネルでないときはA/D変換結果を上記特定の入力チャネルに割り当てられた保持手段以外の保持手段に格納し、
上記選択制御手段は、第1のモードにおいては、各グループのすべての入力チャネルが選択されるごとに上記特定の入力チャネルを選択してA/D変換させ、これにより上記特定の入力チャネルの選択の周期を、上記特定の入力チャネル以外の入力チャネルの選択の周期よりも短くし、第2のモードにおいては、上記特定の入力チャネル以外の入力チャネルのすべてを選択してA/D変換させた後、上記特定の入力チャネルを選択してA/D変換させ、
上記読み出し要求手段は、上記第1のモードにおいては、各グループのすべての入力チャネルについてA/D変換が終わったら、当該グループのすべての入力チャンネル及び上記特定の入力チャンネルのA/D変換の結果の読み出し要求を行って読み出しを行わせ、
上記読み出し要求手段は、上記第2のモードにおいては、各グループのすべての入力チャネルについてA/D変換が終わったら、当該グループのすべての入力チャンネルのA/D変換の結果の読み出し要求を行って読み出しを行わせ、すべてのグループのすべての入力チャンネルについてのA/D変換の結果の読み出しが終わったら、上記特定の入力チャネルについてのA/D変換の結果の読み出し要求を行って読み出しを行わせる
ことを特徴とするA/D変換装置を提供する。
【0013】
さらに、選択制御手段を制御して、所定の周期で各入力チャネルのA/D変換を繰り返し、A/D変換結果を更新する構成としてもよい。
【0015】
さらに、各保持手段に保持されているA/D変換データにA/D変換データに関する付加情報を付加する付加情報付加手段を備える構成としてもよい。
【0016】
【発明の実施の形態】
本発明の第1の実施形態に係るA/D変換装置は、図1に示すように、n個の入力端子AI0〜AIn-1から入力されるnチャネルの信号のうちの1つを選択して出力するアナログマルチプレクサ1と、アナログマルチプレクサ1から供給される信号をA/D変換して出力するA/Dコンバータ2と、A/D変換後のデータを保持するA/Dリザルトレジスタ3と、バスを介してCPU等から動作指示等が供給されるレジスタ4とを備えている。また、このA/D変換装置はレジスタの値に基づいてアナログマルチプレクサ1、A/Dコンバータ2、A/Dリザルトレジスタ3等を制御するシーケンサ5、シーケンサ5からの指示に応じて、それぞれアナログマルチプレクサ1、A/Dリザルトレジスタ3の切り換えを制御するためのデコーダ6、7とを備えている。さらに、このA/D変換装置はA/Dリザルトレジスタ3からのA/D変換データに付加情報を付加して出力する付加情報付加部8を備えている。
【0017】
アナログマルチプレクサ1は、n個のアナログ入力端子AI0〜AIn-1を備え、デコーダ6を介してシーケンサ5から指示されるチャネルからの入力をA/Dコンバータ2に供給する。A/Dコンバータ2は、シーケンサ5からの制御によってアナログ信号を所定ビット数のデジタル値に変換する。このA/Dコンバータ2のA/D変換方法はとくに限定されず、一般のA/Dコンバータを用いることができる。A/Dリザルトレジスタ3は、p個のレジスタADCR0〜ADCR(p−1)からなる。このレジスタの数pは、アナログマルチプレクサ1の入力チャネルの数nより少なくなっている。以下、例えばアナログマルチプレクサ1の入力チャネル数が16チャネルで4チャネル分のレジスタADCR0、ADCR1、ADCR2、ADCR3を備えている場合について説明する。
【0018】
レジスタ4は、A/D変換の起動及び停止の指示を入力するためのA/D起動・停止指示レジスタ4aと、変換クロック数を指定するための変換クロック数指定レジスタ4bと、変換モードを設定するための変換モード設定レジスタ4cと、割り込み周期を設定するための割り込み周期設定レジスタ4d等からなる。これらのレジスタには、バス9を介して外部の機器から変換モード等を示すデータが供給される。
【0019】
シーケンサ5は、アナログマルチプレクサ1、A/Dリザルトレジスタ3等の切り換えを制御するための切り換え制御部と、クロックCLKに基づいてアナログマルチプレクサ1の切り換え、A/Dコンバータ2のA/D変換等のタイミングを制御するためのクロックを発生するクロック発生部と、A/Dコンバータ2の各ビット毎の変換タイミング等を制御するための変換タイミング生成部と、外部の機器に対してA/DリザルトレジスタからのA/D変換データの読み出しを要求する割り込みを発生する割り込み処理部と、動作モードを設定するためのモード設定部等を備えている。
【0020】
また、シーケンサ5のモード設定部で設定されるモードは連続スキャンモード、特定チャネル指定モード等からなる。連続スキャンモードでは、例えばレジスタADCR0〜3を測定対象となる全てのチャネルに割り当てておき、図5に示すように、測定対象のチャネルの信号を4チャネル分ずつA/D変換し、得られた4チャネル分のA/D変換データをレジスタADCR0〜3に格納して割り込みを発生し、外部の機器が割り込みに応じてレジスタADCR0〜3に格納されたA/D変換データを読み出す。全てのチャネルを全てのレジスタADCR0〜3に割り当てる必要はなく、一部のチャネルを一部のレジスタに割り当ててもよい。
【0021】
また特定チャネル指定モードでは、特定のレジスタ、図6及び図7に示すように、レジスタADCR0を特定のチャネル、例えばチャネル0に割り当てておき、残りのレジスタADCR1〜3を他のチャネルに割り当てて順次A/D変換を行い、チャネル0のA/D変換データはレジスタADCR0に格納し、チャネル0以外のA/D変換データは3チャネルずつADCR0〜3に格納する。
【0022】
特定チャネル指定モードで特定のレジスタに割り当てる特定のチャネルの数は、リザルトレジスタの数以下であればいくつでも良く、例えばリザルトレジスタ数と同じにすることもできる。この場合は、A/D変換するチャネルに各々レジスタを割り当てた状態と同様に動作する。また、連続スキャンモードは、特定チャネル固定モードの特殊な形態、すなわち特定のチャネルの指定がない場合とも言える。
【0023】
この特定チャネル指定モードには、さらに各割り込み毎に1回の頻度で特定のチャネル(チャネル0)の信号をA/D変換するCモードと、他のチャネルの信号が各々1回ずつA/D変換される間に1回の頻度で特定のチャネル(チャネル0)の信号をA/D変換するDモードとがある。
【0024】
Cモードでは、図6に示すように、各割り込み発生時毎に、チャネル0のA/D変換データを更新する。従って、チャネル0のサンプリング周期が他のチャネルに比較して短くなっている。このようなモードは特定のチャネルの変化を特に詳しく調べる必要がある場合等に用いられる。
【0025】
また、Dモードでは、図7に示すように、各割り込み発生時にはチャネル0以外のA/D変換データのみを読み出し、全てのチャネルのA/D変換データが読み出されるまでの間、例えば他の全てのチャネルのA/D変換データの読み出しが終了した後にチャネル0のA/D変換データの読み出しを行う。このようなモードは、各割り込み毎に全てのレジスタADCR0〜3からA/D変換データを読み出すことが難しい場合等に用いられる。
【0026】
これらのモードの切り換えは、シーケンサ5が、バス9を介して外部の機器により設定されたレジスタの値を参照して行うようになっている。具体的にはシーケンサ5は上述のモード選択部として、図8に示すように、特定チャネルを割り当てるレジスタを設定する特定チャネル指定部11と、特定チャネルのA/D変換周期を設定して上述のCモードとDモードの切り換えを制御する頻度設定部12と、特定チャネル指定部11で設定されたレジスタを排他制御するレジスタ排他制御部13と、特定チャネルが割り当てられたレジスタ以外のレジスタに割り当てるチャネルを設定するチャネル割り当て部14と、A/D変換時にA/D変換するチャネルを選択するA/D変換チャネル選択部15と、A/D変換結果を格納するレジスタを選択するA/D変換結果格納レジスタ選択部16とを備えている。
【0027】
上述のような構成のA/D変換装置は、例えば図9に示すマイクロコントローラ(マイコン)に用いることができる。このマイコンは、CPU21と、ROM22、RAM23と、シリアルI/F、パラレルI/F等を有するI/O制御部24と、上述の図1に示すA/D変換装置と同様に構成されたA/D変換部25と、CPU21〜A/D変換部25が接続されているバス26を備えている。また、このマイコンは、CPU21、ROM22及びRAM23の一部、I/O制御部24、A/D変換部25等が1つの素子として形成されている。なお、上述の図1に示す構成の内、A/Dリザルトレジスタ3は、図9中ではRAM23の一部に対応し、バス9はバス26に対応し、他の構成要素はA/D変換部25に対応する。また、この場合、CPU21が上述の外部の機器に対応している。
【0028】
CPU21のメモリ空間上には、図10に示すような制御用メモリ領域が設けられている。このような制御用メモリ空間上には、上述のI/O制御部24のシリアルI/F及びパラレルI/FあるいはA/D変換部25等の動作を制御するための256バイト程度の制御用レジスタが割り付けられている。上述のリザルトレジスタ3(レジスタADCR1〜3)及びレジスタ4(A/D起動レジスタ4a〜割り込み同期設定レジスタ4d)は、例えばそれぞれアドレスF010以降、F020以降に割り付けられている。このような制御用レジスタに用いることのできるメモリ領域には制限があるため、他のデバイスが多い場合等にはレジスタ数を増加させることは困難である。
【0029】
また、A/D変換部のチャネル数の異なるマイコンファミリの展開を考える場合等で、リザルトレジスタ等の制御用レジスタの数及びレジスタのマッピング等の構成を共通としておけば、A/D変換部25のアナログマルチプレクサのチャネル数等の構成のみを変更することにより、用途に適した仕様のマイコンを容易に設計、製造することができる。このようにリザルトレジスタ等の制御用レジスタの数及び割り当て位置等の構成を共通とすれば、アナログマルチプレクサのチャネル数等が異なるマイコンにおいてもコンパイラ、制御用プログラム等のソフトウェアを共通とすることができ、総合的な製品コストを低減することができる。
【0030】
このようなマイコンは、制御プログラムを実行することにより、A/D変換装置を制御して複数のA/D変換処理を実行することができるようになっている。
【0031】
以下、このようなマイコンによりA/D変換を行う場合について説明する。
【0032】
まず、A/D変換を行う場合にマイコンのCPU21は、バス26を介してA/D変換部25のモード設定部に動作モードを指示する。具体的には、連続スキャンモードでA/D変換を行う際には、CPU21は、バス26、A/D変換部25を構成する変換モード設定レジスタ4c(図1)を介して、シーケンサ5のチャネル割り当て部14(図8)に、A/D変換するチャネルと、使用するレジスタ等を指示する。
【0033】
また、特定チャネル指定モードでは、CPU21は、シーケンサ5を構成する特定チャネル指定部11に、固定する特定チャネルと、この特定チャネルを割り当てるレジスタを指示し、チャネル割り当て部14に、A/D変換するチャネルと、使用するレジスタ等を指示する。さらに、特定チャネル指定モードの動作をさせる場合、CPU21は頻度設定部12に、上述のCモードあるいはDモードの動作を指示する。
【0034】
また、CPU21は、上述の図1に示す変換クロック数指定レジスタ4bを介してシーケンサ5のクロック発生部にA/D変換の1チャネル当たりの変換周期を例えばクロックCLK数として指示し、また、割り込み周期設定レジスタ4dを介してシーケンサ5の割り込み処理部に、割り込みを発生する周期、タイミングを、例えばそれぞれチャネル数、クロックCLK数等として指示する。
【0035】
動作モード等の設定が終了すると、CPU21は、図1及び図10に示すA/D起動・停止指示レジスタ4aを介してシーケンサ5にA/D変換の開始を指示する。A/D変換の開始が指示されると、A/D変換部25は、CPU21からA/D変換の停止が指示されるまでの間、シーケンサ5の制御により独立して動作する。従って、CPU21はシーケンサ5から供給されるA/D変換データの読み出しを要求する割り込みに応答して各レジスタADCR0〜3に保持されているデータを読み出すだけでよい。
【0036】
連続スキャンモードが指示された場合には、特定チャネル指定部11にはいずれのチャネルも設定されていないため、レジスタ排他制御部13によるレジスタの排他制御は行われず、A/D変換チャネル選択部15はクロック発生部からのクロックに基づいて、順次、チャネル割り当て部14に設定されているチャネルの信号が選択されるように図1中のデコーダ6に選択信号を供給する。これにより、デコーダ6が選択信号のデコード出力をアナログマルチプレクサ1に供給し、このデコード出力によって、例えば図5(A)に示すように、順次、チャネル0、チャネル1、チャネル2、チャネル3、チャネル4・・・が選択される。また、このとき、A/D変換チャネル選択部15は選択したチャネルを順次A/D変換結果格納レジスタ選択部16に通知する。
【0037】
A/D変換結果格納レジスタ選択部16は、A/D変換チャネル選択部15から現在選択されているチャネルが通知されると、通知されたチャネルのA/D変換データが、順次、チャネル割り当て部14よって割り当てられているレジスタに格納されるように、A/D変換データを格納するレジスタを示す選択信号を図1に示すデコーダ7に供給する。これにより、デコーダ7が選択信号をデコードし、このデコード出力により、A/Dリザルトレジスタ3の中からA/D変換データを格納するレジスタが選択され、例えば図5(C)〜同図(F)に示すように、チャネル0、チャネル1、チャネル2、チャネル3、チャネル4・・・のA/D変換データが順次、レジスタADCR0、ADCR1、ADCR2、ADCR3、ADCR0、ADCR1・・・に格納される。
【0038】
また、A/D変換結果格納レジスタ選択部16は、A/D変換チャネル選択部15から通知されたチャネルの数を計数しており、この計数結果により、使用可能なレジスタADCR0〜3に全てA/D変換データが格納されたことを検出すると、割り込み処理部を制御してA/D変換データの読み出しを要求する割り込みを発生させる。例えば図5(A)に示すように、チャネル3(あるいはチャネル7)のA/D変換が終了し、同図(C)〜同図(F)に示すようにレジスタADCR0〜3にチャネル0〜3(あるいはチャネル4〜7)が供給された時に、同図(B)に示すように割り込みを発生させる。
【0039】
割り込みが発生すると、図9に示すCPU21は割り込みに応答してレジスタADCR0〜3に保持されているデータを読み出し、各チャネル毎のA/D変換データに分離する。
【0040】
このような連続モードでは、上述のようにモード設定を行った後、A/D変換の開始を指示するとA/D変換部25が独立して動作する。従って、CPU21が動作モードを制御する場合あるいはリザルトレジスタが1つしかない場合等に比較してCPU21の処理負荷を大幅に低減することができる。また、このような連続モードではシーケンサ5が入力チャネルを自動的に切り換える構成となっているため、CPUが入力チャネルあるいは入力チャネルグループを切り換える構成とした場合のように、A/D変換を一旦停止する必要がないため、A/D変換周期を短縮することが容易となる。
【0041】
また、このA/D変換装置は、各入力チャネル毎にリザルトレジスタを設けた場合に比較して、装置の回路規模を小さくすることができ、装置の小型化、コストの低減等が容易となる。
【0042】
一方、CPU21から特定チャネル指定モードが指示された場合には、特定チャネル固定部11に設定されたチャネルは特定のレジスタ、例えばレジスタADCR0に割り当てられる。レジスタ排他制御部13は、この特定のレジスタADCR0がA/D変換結果格納レジスタ選択部16において他のチャネルに割り当てられないように制御する。
【0043】
この特定チャネル指定モードが指示された場合には、A/D変換チャネル選択部15は頻度設定部12を参照して上述のCモード又はDモードのいずれに設定されているかを確認する。
【0044】
Cモードに設定されているときは、A/D変換チャネル選択部15はクロック発生部からのクロックに基づいて、各割り込み毎にチャネル0が選択された後、チャネル割り当て部14に設定されているチャネルの信号が順次選択されるようにデコーダ6に選択信号を供給する。
【0045】
これにより、デコーダ6が選択信号のデコード出力をアナログマルチプレクサ1に供給し、このデコード出力によって、例えば図6(A)に示すように、順次、チャネル0、チャネル1、チャネル2、チャネル3、チャネル0、チャネル4、チャネル5・・・が選択される。また、このとき、A/D変換チャネル選択部15は選択したチャネルを順次A/D変換結果格納レジスタ選択部16に通知する。
【0046】
A/D変換結果格納レジスタ選択部16は、A/D変換チャネル選択部15から現在選択されているチャネルが通知されると、特定チャネルであるチャネル0のA/D変換データがレジスタADCR0に格納され、残りのチャネルのA/D変換データが、順次、チャネル割り当て部14よって割り当てられているレジスタに格納されるように、A/D変換データを格納するレジスタを示す選択信号をデコーダ7に供給する。これにより、デコーダ7が選択信号をデコードし、このデコード出力により、A/Dリザルトレジスタ3の中からA/D変換データを格納するレジスタが選択され、例えば図6(B)〜(E)に示すように、チャネル0、チャネル1、チャネル2、チャネル3、チャネル0、チャネル4・・・のA/D変換データが順次、レジスタADCR0、ADCR1、ADCR2、ADCR3、ADCR0、ADCR1・・・に格納される。
【0047】
また、A/D変換結果格納レジスタ選択部16は、A/D変換チャネル選択部15から通知されたチャネルの数を計数しており、この計数結果により、使用可能なレジスタADCR0〜3に全てA/D変換データが格納されたことを検出すると、割り込み処理部を制御してA/D変換データの読み出しを要求する割り込みを発生させる。例えば図6(A)に示すように、チャネル3(あるいはチャネル6、チャネル9、チャネル12、チャネル15)のA/D変換が終了し、同図(B)〜(E)に示すようにレジスタADCR0にチャネル0、レジスタADCR1〜3にチャネル1〜3(あるいはチャネル4〜6、チャネル7〜9、チャネル10〜12、チャネル13〜15)が供給された時に、同図(F)に示すように割り込みを発生させる。
【0048】
割り込みが発生すると、CPU21は上述の連続スキャンモードと同様に割り込みに応答してレジスタADCR0〜3に保持されているデータを読み出し、各チャネル毎のA/D変換データに分離する。
【0049】
なお、特定レジスタ及び特定チャネルの数は1つでなくともよくレジスタADCR0にチャネル0、レジスタADCR1にチャネル1を割り当てる等、適宜変更することができる。
【0050】
このCモードでは、上述したように特定のチャネルのA/D変換周期を他のチャネルに対して短くすることができるため、CPU21の処理負荷を増加させることなく測定対象となるチャネルの信号の特性に適した測定を行うことができる。また、2つの異なるA/D変換周期でA/D変換を行うことができるため、A/D変換装置の自由度を向上させることができる。
【0051】
また、頻度設定部12を参照した際に、Dモードに設定されているときは、A/D変換チャネル選択部15はクロック発生部からのクロックに基づいて、特定チャネル指定部11及びチャネル割り当て部14に設定されているチャネルの信号が順次選択されるようにデコーダ6に選択信号を供給する。これにより、例えば図7(A)に示すように、順次、チャネル0、チャネル1、チャネル2、チャネル3、チャネル4・・・が選択される。なお、この順序は上述の連続スキャンモードと同じである。このとき、A/D変換チャネル選択部15は選択したチャネルを順次A/D変換結果格納レジスタ選択部16に通知する。
【0052】
A/D変換結果格納レジスタ選択部16は、A/D変換チャネル選択部15から現在選択されているチャネルが通知されると、上述のCモードの場合と同様に、チャネル0のA/D変換データがレジスタADCR0に格納され、残りのチャネルのA/D変換データが、順次、レジスタADCR1〜3に格納されるように、A/D変換データを格納するレジスタを選択する。これにより、A/Dリザルトレジスタ3の中からA/D変換データを格納するレジスタが選択され、例えば図7(B)〜(E)に示すように、チャネル0のA/D変換データがレジスタADCR0に、チャネル1、チャネル2、チャネル3、チャネル4、チャネル5・・・のA/D変換データが順次、レジスタADCR1、ADCR2、ADCR3、ADCR1、ADCR2・・・に格納される。
【0053】
A/D変換結果格納レジスタ選択部16は、A/D変換チャネル選択部15から通知されたチャネルの数を計数しており、この計数結果により、使用可能なレジスタADCR0〜3に全てA/D変換データが格納されたことを検出すると、割り込み処理部を制御してA/D変換データの読み出しを要求する割り込みを発生させる。
【0054】
割り込みが発生すると、CPU21は上述のCモードと同様に割り込みに応答してレジスタADCR0〜3に保持されているデータを読み出し、各チャネル毎のA/D変換データに分離する。
【0055】
ここで、レジスタADCR0がチャネル0に割り当てられているため、レジスタADCR0の内容は、1度チャネル0のA/D変換データを格納してから、次にチャネル0のA/D変換データが格納される間での間、変更されない。従って、CPU25はチャネル3、チャネル6、チャネル9、チャネル12のA/D変換後の割り込み発生時には、レジスタADCR0に保持されているA/D変換データを読み出す必要がなく、他の3つのレジスタADCR1〜3に保持されているA/D変換データのみを読み出し、最後のチャネル15のA/D変換後の割り込み発生時にのみ全てのレジスタADCR0〜3に保持されているA/D変換データを読み出すだけでよい。
【0056】
このDモードでは、連続スキャンモードに比較して割り込み回数が増加するが、1回の割り込み当たりにレジスタから読み出すデータ数が減少する。このため、例えばバス26の速度が遅い等の理由により、CPU21が各割り込み時に全てのレジスタの内容を読み出す時間的余裕が無い場合等に、このDモードに設定することにより、1回の割り込みで読み出すレジスタの数を減少させることができる。このDモードでは上述したように、各割り込み毎に読み出すチャネル数を減少させることにより、CPU21の処理能力、バス26の性能等に適した処理を行うことができる。
【0057】
従って、このCモード、Dモードからなる特定レジスタ指定モードでは、特定レジスタに割り当てられたチャネルとそれ以外のチャネルとで異なる処理を施すことができ、A/D変換の自由度を向上させることができる。
【0058】
また、上述の付加情報付加部8は、図11に示すように、上述のシーケンサ5のA/D変換チャネル選択部15からのチャネル選択データをラッチして上述のリザルトレジスタ3に供給するラッチ32から構成されている。このラッチ32にはラッチタイミング入力としてシーケンサ5からA/Dコンバータ2のA/D変換が終了したことを示すA/D完了信号が供給されている。
【0059】
また、リザルトレジスタ3には、A/Dコンバータ2からの10ビットのA/D変換データをラッチするラッチ31からの出力が供給されている。このラッチ31にはラッチ32と同様に、ラッチタイミング入力としてシーケンサ5からA/D完了信号が供給されている。
【0060】
上述のようにA/D変換を行う際には、A/D変換チャネル選択部15がA/D変換を選択する。この選択データはラッチ32に供給されており、A/D変換が終了した際にA/D変換完了信号に応じてラッチ32によってラッチされる。同様にA/Dコンバータ2からのA/D変換データはラッチ31によってラッチされる。
【0061】
これらのラッチ31、32にラッチされたデータはA/D変換結果格納レジスタ選択部16からの選択信号によって選択されたレジスタに供給される。これにより、リザルトレジスタ3の各レジスタADCR0〜ADCR(p−1)には図12に示すようにA/D変換データとこのA/D変換データのチャネルを示すチャネルデータ(付属情報)が格納される。
【0062】
このように各チャネルのA/D変換データに各チャネルを示すチャネルデータを付加することにより、CPU21は各レジスタから読み出したA/D変換データがどのチャネルのものであるか容易に判断することができる。従って、各チャネルのデータの分離を確実に行うことができる。
【0063】
なお、 この付加情報付加部8において、A/D変換データに付加する付加情報は、上述のチャネルを示すチャネルデータの他に、A/D変換のサンプリング周期、サンプルホールド時間、時刻を表すタイムスタンプ、動作モード等を示す情報であってもよい。これらの付属情報はシーケンサ5の内部で用いられているため、チャネルデータの場合と同様に、これらの付属情報をA/D変換完了信号に応じてラッチし、このラッチ出力をリザルトレジスタ3に供給すればよい。
【0064】
また、このようにシーケンサ5中で用いられているデータをA/D変換データに付加する場合は、上述のようにラッチを設けるといった単純な構成の変更により、機能を追加することができる。
【0065】
【発明の効果】
本発明に係るA/D変換装置では、選択制御手段が入力切り換え手段を制御して所定数の入力チャネルを順次選択し、A/D変換手段にA/D変換を指示し、保持部選択手段が選択制御手段により選択した入力チャネルのA/D変換結果を格納する保持手段を選択することにより、自動的に各チャネルのA/D変換結果が所定数の保持手段に格納される。従って、外部の機器は、読み出し要求手段からの読み出し要求に応じて保持手段からA/D変換結果を読み出すだけでよく、外部の機器が入力チャネルの切り換え等を制御する場合に比較して、外部の機器の処理負荷を低減させることができる。
【0066】
また、選択制御手段を制御して、所定の周期で各入力チャネルのA/D変換を繰り返し、A/D変換結果を更新する構成とすれば、自動的にA/D変換結果が更新されるため、外部の機器の処理負荷をさらに低減させることができる。
【0067】
また、選択制御手段が所定数の入力チャネルを、各々所定数の保持手段の数以下の入力チャネルからなる複数のグループに分割し、各グループ毎に入力チャネルの選択を行い、読み出し要求手段が各グループのA/D変換結果毎に読み出し要求を行う構成とすれば、保持手段の数及び外部の機器の処理負荷を増加させずに入力チャネルを増加させることができる。
【0068】
また、割り当て手段により保持手段のうちの所定数を特定の入力チャネルに割り当て、残りの保持手段を他の入力チャネルに割り当て、保持部選択手段が、特定の入力チャネルのA/D変換結果を所定数の保持手段に格納し、他の入力チャネルのA/D変換結果を残りの保持手段に格納することにより、特定のチャネルとそれ以外のチャネルとで異なる処理を施すことができ、A/D変換の自由度を向上させることができる。
【0069】
また、各保持手段に保持されているA/D変換データにA/D変換データに関する付加情報を付加する付加情報付加手段を備える構成とすれば、外部の装置は、読み出したA/D変換データの識別を容易に行うことができる。
【図面の簡単な説明】
【図1】 本発明の一実施形態に係るA/D変換装置の構成を示すブロック図である。
【図2】 従来のA/D変換装置のA/D変換動作を示すタイミングチャートである。
【図3】 上記従来のA/D変換装置において測定するチャネルをグループ化する場合の各グループに対するチャネルの割り当てを示す図である。
【図4】 上記従来のA/D変換装置のA/D変換動作を示すタイミングチャートである。
【図5】 上記本発明の実施形態に係るA/D変換装置の連続スキャンモードでA/D変換を行うときの動作を示すタイミングチャートである。
【図6】 上記A/D変換装置の特定チャネル指定モードでA/D変換を行うときの動作を示すタイミングチャートである。
【図7】 上記A/D変換装置の特定チャネル指定モードでA/D変換を行うときの動作を示すタイミングチャートである。
【図8】 上記A/D変換装置において動作モードを選択するモード選択部の構成を示す図である。
【図9】 上記A/D変換装置を用いたマイコンの構成を示すブロック図である。
【図10】 上記マイコンを構成するCPUのメモリ空間上に設けられた制御用メモリ領域を示すメモリマップである。
【図11】 上記A/D変換装置を構成する付加情報付加部の構成を示すブロック図である。
【図12】 上記付加情報付加部により付加情報が付加されたA/D変換データを示す図である。
【符号の説明】
1 アナログマルチプレクサ、2 A/Dコンバータ、3 A/Dリザルトレジスタ、4 レジスタ、5 シーケンサ、8 付加情報付加部
[0001]
BACKGROUND OF THE INVENTION
  The present invention relates to an A / D converter that performs A / D conversion by switching a plurality of analog inputs.The invention also relates to a microcontroller comprising an A / D conversion device.
[0002]
[Prior art]
2. Description of the Related Art An A / D conversion device is known in which a single A / D conversion unit can measure currents or voltages of a plurality of channels by switching inputs using a multiplexer. Such an A / D conversion device is used in a microcontroller (hereinafter referred to as a microcomputer) that controls devices and the like. Moreover, such an A / D conversion device includes a result register that holds an A / D conversion result. The number of result registers differs depending on the use of the A / D converter, the price, and the like.
[0003]
When a plurality of channels are measured by an A / D conversion apparatus having only one result register, the channels for A / D conversion are switched every predetermined time as shown in FIG. After A / D conversion of the current or voltage, etc., an interrupt is issued to request the external device (microcomputer, personal computer, etc.) to read the A / D conversion data as shown in FIG. To do. Therefore, it is necessary for an external device to take in data from the A / D converter in response to an interrupt every time A / D conversion of each channel is completed. If such an interrupt occurs frequently, the processing capability of an external device to perform processing other than A / D conversion is significantly reduced due to the overhead for interrupt processing.
[0004]
On the other hand, in the case of using an A / D converter provided with result registers as many as the number of channels of the multiplexer, after the A / D conversion of all channels is completed by switching the multiplexer, the A / D conversion data is read out. Since an interrupt to be instructed can be generated and an external device can read data of each channel from each result register, the frequency of occurrence of the interrupt can be reduced. It is possible to reduce a decrease in processing capacity of an external device.
[0005]
However, in this case, since a result register is provided for every channel, the circuit scale increases as the number of channels increases, and depending on the application, not all channels of the multiplexer are used. The result register is wasted. Therefore, the cost of the A / D converter increases more than necessary.
[0006]
Further, in an A / D conversion apparatus provided with a smaller number of result registers than the number of channels of the multiplexer, all channels are handled in several groups. For example, in an A / D converter provided with a result register for four channels with respect to 16-channel input, the input for 16 channels is divided into four groups (group 0 to group 3) as shown in FIG. .
[0007]
For example, when group 0 (channel 0 to channel 3) of these groups is designated, the A / D converter having such a configuration, for example, as shown in FIG. ~ Sequential A / D conversion of channel 3 signal, and after the last channel 3 A / D conversion is completed, an interrupt requesting reading of A / D conversion data is generated as shown in FIG. Then, after the A / D conversion data is read from the result register by an external device, the A / D conversion of the signals of channel 0 to channel 3 is repeated. Such an operation is called a continuous mode.
[0008]
In continuous mode operation, only the channels of the same group are repeatedly A / D converted, so external devices need to switch groups in order to A / D convert the signals of all channels. There is.
[0009]
For example, when A / D conversion is performed by switching four groups (group 0 to group 3) each having four channels as described above, first, the external device is set to the time as shown in FIG. Instructs group 0 A / D conversion at t0. The A / D conversion apparatus starts A / D conversion of the instructed group 0, performs A / D conversion of channel 0 to channel 3, and then performs A / D conversion at time t1 as shown in FIG. An interrupt requesting reading of D conversion data is generated to stop A / D conversion. The external device reads A / D conversion data from the result register, and instructs the A / D conversion of the next group, group 1. The A / D converter starts group 1 A / D conversion at time t2, performs A / D conversion on channel 4 to channel 7, generates an interrupt in the same manner as in group 0, and performs A / D conversion. To stop. Similarly, A / D conversion of each group is sequentially performed to perform A / D conversion of all channels.
[0010]
[Problems to be solved by the invention]
As described above, when A / D conversion is performed by switching a plurality of groups, the A / D conversion is temporarily stopped and the group is switched each time the A / D conversion of the channel of each group is completed. There is a need. Therefore, an external device must perform group switching in addition to reading A / D conversion data for each group, increasing the processing load. Further, when the time for group switching increases, it becomes an obstacle when it is desired to shorten the sampling period of A / D conversion.
[0011]
The present invention has been made in view of the above-described problems, and an object thereof is to provide an A / D conversion device that can reduce the processing load of an external device.
[0012]
[Means for Solving the Problems]
  The present invention
  An input switching means for selecting a plurality of input channels;
  A / D conversion means for A / D converting the input signal of the input channel selected by the input switching means;
  A plurality of holding means smaller than the number of the input channels holding the A / D conversion results of the A / D conversion means;
  Selection control means for controlling the input switching means to sequentially select a predetermined number of input channels and instructing the A / D conversion means to perform A / D conversion;
  Holding unit selecting means for selecting holding means for storing the A / D conversion result of the input channel selected by the selection control means;
  Of the plurality of holding meansFirstWhen A / D conversion results are stored in a predetermined number of holding means, request external device to read A / D conversion results from the holding meansTo readA read request means;
  Of the holding meansSecondAllocating means for allocating a predetermined number of holding means to a specific input channel among the plurality of input channels,
  When the input channel selected by the selection control unit is a specific input channel, the holding unit selection unit stores an A / D conversion result in a holding unit assigned to the specific input channel, and the selection control unit When the input channel selected by the above is not a specific input channel, the A / D conversion result is stored in the holding means other than the holding means assigned to the specific input channel.
  The selection control means divides input channels other than the specific input channel into a plurality of groups, sequentially selects the input channels of each group, performs A / D conversion,
  The selection control means selects all of the input channels other than the specific input channel and performs A / D conversion, then selects the specific input channel and performs A / D conversion,
  The read request means is used for each group.AllWhen A / D conversion is completed for the input channel, a request to read the A / D conversion result of the group is made.Read,
When the reading request means has finished reading the A / D conversion results for all the input channels of all the groups, the reading request means makes a read request for the A / D conversion results for the specific input channel and performs reading. Make
  An A / D converter characterized by the above is provided.
  The present inventionAlso,
  An input switching means for selecting a plurality of input channels;
  A / D conversion means for A / D converting the input signal of the input channel selected by the input switching means;
  A plurality of holding means smaller than the number of the input channels holding the A / D conversion results of the A / D conversion means;
  Selection control means for controlling the input switching means to sequentially select a predetermined number of input channels and instructing the A / D conversion means to perform A / D conversion;
  Holding unit selecting means for selecting holding means for storing the A / D conversion result of the input channel selected by the selection control means;
  Of the plurality of holding meansFirstWhen A / D conversion results are stored in a predetermined number of holding means, request external device to read A / D conversion results from the holding meansTo readA read request means;
  Of the holding meansSecondAllocating means for allocating a predetermined number of holding means to a specific input channel among the plurality of input channels,
  When the input channel selected by the selection control unit is a specific input channel, the holding unit selection unit stores an A / D conversion result in a holding unit assigned to the specific input channel, and the selection control unit When the input channel selected by the above is not a specific input channel, the A / D conversion result is stored in the holding means other than the holding means assigned to the specific input channel.
In the first mode, the selection control means selects the specific input channel and performs A / D conversion every time all the input channels of each group are selected, thereby selecting the specific input channel. In the second mode, all of the input channels other than the specific input channel are selected and A / D converted in the second mode. Then, select the specific input channel and perform A / D conversion.
  The read request means isIn the first mode,For each groupAllWhen A / D conversion is completed for the input channel,All input channels and specific input channels aboveRequest to read A / D conversion resultRead out,
In the second mode, when the A / D conversion is completed for all the input channels of each group, the read request unit issues a read request for the results of the A / D conversion of all the input channels of the group. When the reading is performed and the reading of the A / D conversion results for all the input channels of all the groups is finished, the reading of the result of the A / D conversion for the specific input channel is performed to perform the reading.
  An A / D converter characterized by the above is provided.
[0013]
  Further, the selection control means may be controlled to repeat the A / D conversion of each input channel at a predetermined cycle and update the A / D conversion result.Yes.
[0015]
Furthermore, it is good also as a structure provided with the additional information addition means which adds the additional information regarding A / D conversion data to the A / D conversion data currently hold | maintained at each holding means.
[0016]
DETAILED DESCRIPTION OF THE INVENTION
As shown in FIG. 1, the A / D converter according to the first embodiment of the present invention includes n input terminals AI.0~ AIn-1An analog multiplexer 1 that selects and outputs one of n-channel signals input from the analog multiplexer 1, an A / D converter 2 that performs A / D conversion and outputs a signal supplied from the analog multiplexer 1, and A / An A / D result register 3 that holds data after D conversion and a register 4 to which an operation instruction or the like is supplied from a CPU or the like via a bus are provided. The A / D conversion device also includes an analog multiplexer 1, an A / D converter 2, an A / D result register 3, and the like that control the analog multiplexer 1, the A / D result register 3, and the like. 1. Decoders 6 and 7 for controlling switching of the A / D result register 3 are provided. Further, the A / D conversion device includes an additional information adding unit 8 that adds the additional information to the A / D conversion data from the A / D result register 3 and outputs it.
[0017]
The analog multiplexer 1 has n analog input terminals AI.0~ AIn-1And an input from a channel designated by the sequencer 5 via the decoder 6 is supplied to the A / D converter 2. The A / D converter 2 converts the analog signal into a digital value having a predetermined number of bits under the control of the sequencer 5. The A / D conversion method of the A / D converter 2 is not particularly limited, and a general A / D converter can be used. The A / D result register 3 includes p registers ADCR0 to ADCR (p-1). The number p of registers is smaller than the number n of input channels of the analog multiplexer 1. Hereinafter, for example, the case where the number of input channels of the analog multiplexer 1 is 16 and the registers ADCR0, ADCR1, ADCR2, and ADCR3 for four channels are provided will be described.
[0018]
The register 4 sets an A / D start / stop instruction register 4a for inputting A / D conversion start / stop instructions, a conversion clock number specifying register 4b for specifying the number of conversion clocks, and a conversion mode. A conversion mode setting register 4c for setting the interrupt cycle, an interrupt cycle setting register 4d for setting the interrupt cycle, and the like. Data indicating a conversion mode or the like is supplied to these registers from an external device via the bus 9.
[0019]
The sequencer 5 includes a switching control unit for controlling switching of the analog multiplexer 1, the A / D result register 3 and the like, switching of the analog multiplexer 1 based on the clock CLK, A / D conversion of the A / D converter 2, etc. A clock generator for generating a clock for controlling timing, a conversion timing generator for controlling the conversion timing for each bit of the A / D converter 2, and an A / D result register for an external device An interrupt processing unit that generates an interrupt requesting reading of A / D conversion data from the A / D converter, a mode setting unit for setting an operation mode, and the like.
[0020]
The mode set by the mode setting unit of the sequencer 5 includes a continuous scan mode, a specific channel designation mode, and the like. In the continuous scan mode, for example, registers ADCR0 to ADCR3 are assigned to all the channels to be measured, and the signals of the channels to be measured are obtained by A / D conversion for four channels as shown in FIG. A / D conversion data for four channels is stored in the registers ADCR0 to ADCR0 to generate an interrupt, and an external device reads the A / D conversion data stored in the registers ADCR0 to ADC3 in response to the interrupt. It is not necessary to assign all channels to all registers ADCR0 to ADCR0-3, and some channels may be assigned to some registers.
[0021]
In the specific channel designation mode, as shown in FIGS. 6 and 7, a register ADCR0 is assigned to a specific channel, for example, channel 0, and the remaining registers ADCR1 to ADCR1 to other channels are assigned sequentially. A / D conversion is performed, A / D conversion data of channel 0 is stored in register ADCR0, and A / D conversion data other than channel 0 is stored in ADCR0 to ADC3 for every three channels.
[0022]
The number of specific channels assigned to specific registers in the specific channel designation mode may be any number as long as it is less than or equal to the number of result registers, and may be the same as the number of result registers, for example. In this case, the operation is performed in the same manner as when each register is assigned to a channel to be A / D converted. The continuous scan mode can also be said to be a special form of the specific channel fixed mode, that is, when there is no specific channel designation.
[0023]
The specific channel designation mode further includes a C mode in which a signal of a specific channel (channel 0) is A / D converted at a frequency of once for each interrupt, and a signal of another channel is A / D once each. There is a D mode in which a signal of a specific channel (channel 0) is A / D converted at a single frequency during conversion.
[0024]
In C mode, as shown in FIG. 6, the A / D conversion data of channel 0 is updated every time an interrupt occurs. Therefore, the sampling period of channel 0 is shorter than that of other channels. Such a mode is used when a specific channel change needs to be examined in detail.
[0025]
Further, in the D mode, as shown in FIG. 7, when each interrupt occurs, only A / D conversion data other than channel 0 is read and A / D conversion data of all channels is read, for example, all other After reading the A / D conversion data of the channel 0, the A / D conversion data of the channel 0 is read. Such a mode is used when it is difficult to read A / D conversion data from all the registers ADCR0 to ADCR3 for each interrupt.
[0026]
These modes are switched by the sequencer 5 with reference to register values set by an external device via the bus 9. Specifically, as shown in FIG. 8, the sequencer 5 sets a specific channel designating unit 11 for setting a register for assigning a specific channel and sets an A / D conversion cycle for the specific channel as the mode selection unit. Frequency setting unit 12 that controls switching between the C mode and the D mode, a register exclusive control unit 13 that exclusively controls the register set by the specific channel specifying unit 11, and a channel that is allocated to a register other than the register to which the specific channel is allocated A channel allocating section 14 for setting A / D conversion, an A / D conversion channel selecting section 15 for selecting a channel for A / D conversion at the time of A / D conversion, and an A / D conversion result for selecting a register for storing the A / D conversion result And a storage register selector 16.
[0027]
The A / D converter configured as described above can be used in, for example, a microcontroller (microcomputer) shown in FIG. This microcomputer has a CPU 21, a ROM 22, a RAM 23, an I / O control unit 24 having a serial I / F, a parallel I / F, and the like, and an A configured similarly to the A / D converter shown in FIG. A / D conversion unit 25 and a bus 26 to which the CPU 21 to A / D conversion unit 25 are connected are provided. In this microcomputer, a part of the CPU 21, the ROM 22, and the RAM 23, the I / O control unit 24, the A / D conversion unit 25, and the like are formed as one element. In the configuration shown in FIG. 1, the A / D result register 3 corresponds to a part of the RAM 23 in FIG. 9, the bus 9 corresponds to the bus 26, and the other components are A / D conversions. This corresponds to unit 25. In this case, the CPU 21 corresponds to the external device described above.
[0028]
A control memory area as shown in FIG. 10 is provided in the memory space of the CPU 21. In such a control memory space, a control of about 256 bytes for controlling the operation of the serial I / F and parallel I / F or A / D conversion unit 25 of the I / O control unit 24 described above. A register is allocated. The result register 3 (registers ADCR1 to ADCR3) and the register 4 (A / D activation register 4a to interrupt synchronization setting register 4d) are assigned to addresses F010 and later and F020 and later, respectively. Since the memory area that can be used for such a control register is limited, it is difficult to increase the number of registers when there are many other devices.
[0029]
Further, when considering the development of microcomputer families with different numbers of channels of the A / D conversion unit, the A / D conversion unit 25 can be obtained by sharing the number of control registers such as the result register and the register mapping. By changing only the configuration of the analog multiplexer, such as the number of channels, it is possible to easily design and manufacture a microcomputer having specifications suitable for the application. In this way, if the configuration such as the number of control registers such as the result register and the allocation position are made common, the microcomputer, the number of channels of the analog multiplexer, etc. can share software such as compilers and control programs. , Overall product cost can be reduced.
[0030]
Such a microcomputer can control the A / D converter and execute a plurality of A / D conversion processes by executing a control program.
[0031]
Hereinafter, a case where A / D conversion is performed by such a microcomputer will be described.
[0032]
First, when performing A / D conversion, the CPU 21 of the microcomputer instructs an operation mode to the mode setting unit of the A / D conversion unit 25 via the bus 26. Specifically, when A / D conversion is performed in the continuous scan mode, the CPU 21 uses the conversion mode setting register 4c (FIG. 1) constituting the bus 26 and the A / D conversion unit 25 to The channel assignment unit 14 (FIG. 8) is instructed on the channel to be A / D converted and the register to be used.
[0033]
In the specific channel designation mode, the CPU 21 instructs the specific channel designation unit 11 constituting the sequencer 5 about a specific channel to be fixed and a register to which the specific channel is allocated, and performs A / D conversion on the channel allocation unit 14. Indicates the channel and the register to be used. Further, when the operation in the specific channel designation mode is performed, the CPU 21 instructs the frequency setting unit 12 to operate in the above-described C mode or D mode.
[0034]
Further, the CPU 21 instructs the clock generation unit of the sequencer 5 through the conversion clock number designation register 4b shown in FIG. 1 described above, for example, the conversion cycle per channel of A / D conversion as the number of clock CLKs, and interrupts. The period and timing for generating an interrupt are instructed to the interrupt processing unit of the sequencer 5 via the period setting register 4d, for example, as the number of channels and the number of clock CLK, respectively.
[0035]
When the setting of the operation mode and the like is completed, the CPU 21 instructs the sequencer 5 to start A / D conversion via the A / D start / stop instruction register 4a shown in FIGS. When the start of A / D conversion is instructed, the A / D conversion unit 25 operates independently under the control of the sequencer 5 until the CPU 21 instructs to stop the A / D conversion. Therefore, the CPU 21 only needs to read the data held in the registers ADCR0 to ADCR3 in response to an interrupt requesting reading of the A / D conversion data supplied from the sequencer 5.
[0036]
When the continuous scan mode is instructed, since no channel is set in the specific channel designating unit 11, the register exclusive control by the register exclusive control unit 13 is not performed, and the A / D conversion channel selection unit 15 is not performed. 1 sequentially supplies a selection signal to the decoder 6 in FIG. 1 so that the signals of the channels set in the channel assignment unit 14 are selected based on the clock from the clock generation unit. As a result, the decoder 6 supplies the decode output of the selection signal to the analog multiplexer 1, and by this decode output, for example, as shown in FIG. 5A, channel 0, channel 1, channel 2, channel 3, channel 4 ... is selected. At this time, the A / D conversion channel selection unit 15 sequentially notifies the A / D conversion result storage register selection unit 16 of the selected channel.
[0037]
When the A / D conversion result storage register selection unit 16 is notified of the currently selected channel from the A / D conversion channel selection unit 15, the A / D conversion data of the notified channel is sequentially transmitted to the channel allocation unit. 14, a selection signal indicating a register for storing A / D conversion data is supplied to the decoder 7 shown in FIG. As a result, the decoder 7 decodes the selection signal, and a register for storing the A / D conversion data is selected from the A / D result register 3 by this decoded output. For example, FIG. 5C to FIG. ), The A / D conversion data of channel 0, channel 1, channel 2, channel 3, channel 4... Are sequentially stored in registers ADCR0, ADCR1, ADCR2, ADCR3, ADCR0, ADCR1,. The
[0038]
In addition, the A / D conversion result storage register selection unit 16 counts the number of channels notified from the A / D conversion channel selection unit 15, and according to the counting result, all of the available registers ADCR0 to ADCR0 are registered with A. When it is detected that the / D conversion data is stored, the interrupt processing unit is controlled to generate an interrupt requesting reading of the A / D conversion data. For example, as shown in FIG. 5A, the A / D conversion of channel 3 (or channel 7) is completed, and as shown in FIG. 5C to FIG. When 3 (or channels 4 to 7) is supplied, an interrupt is generated as shown in FIG.
[0039]
When an interrupt occurs, the CPU 21 shown in FIG. 9 reads the data held in the registers ADCR0 to ADCR3 in response to the interrupt and separates them into A / D conversion data for each channel.
[0040]
In such a continuous mode, after setting the mode as described above, the A / D conversion unit 25 operates independently when an instruction to start A / D conversion is given. Therefore, the processing load on the CPU 21 can be greatly reduced as compared with the case where the CPU 21 controls the operation mode or the case where there is only one result register. In such a continuous mode, the sequencer 5 is configured to automatically switch the input channel, so that the A / D conversion is temporarily stopped as in the case where the CPU is configured to switch the input channel or the input channel group. Therefore, it is easy to shorten the A / D conversion cycle.
[0041]
In addition, this A / D conversion device can reduce the circuit scale of the device as compared with the case where a result register is provided for each input channel, and it is easy to reduce the size of the device and reduce costs. .
[0042]
On the other hand, when the specific channel designation mode is instructed from the CPU 21, the channel set in the specific channel fixing unit 11 is assigned to a specific register, for example, the register ADCR0. The register exclusive control unit 13 performs control so that the specific register ADCR0 is not assigned to another channel in the A / D conversion result storage register selection unit 16.
[0043]
When the specific channel designation mode is instructed, the A / D conversion channel selection unit 15 refers to the frequency setting unit 12 and confirms whether the C mode or the D mode is set.
[0044]
When the C mode is set, the A / D conversion channel selection unit 15 is set in the channel allocation unit 14 after channel 0 is selected for each interrupt based on the clock from the clock generation unit. A selection signal is supplied to the decoder 6 so that the channel signals are sequentially selected.
[0045]
As a result, the decoder 6 supplies the decode output of the selection signal to the analog multiplexer 1, and by this decode output, for example, as shown in FIG. 6A, channel 0, channel 1, channel 2, channel 3, channel 0, channel 4, channel 5... Are selected. At this time, the A / D conversion channel selection unit 15 sequentially notifies the A / D conversion result storage register selection unit 16 of the selected channel.
[0046]
When the A / D conversion result storage register selection unit 16 is notified of the currently selected channel from the A / D conversion channel selection unit 15, the A / D conversion data of channel 0, which is a specific channel, is stored in the register ADCR0. Then, a selection signal indicating a register for storing the A / D conversion data is supplied to the decoder 7 so that the A / D conversion data of the remaining channels are sequentially stored in the registers allocated by the channel allocation unit 14. To do. As a result, the decoder 7 decodes the selection signal, and a register for storing the A / D conversion data is selected from the A / D result register 3 based on the decoded output. For example, as shown in FIGS. As shown, the A / D conversion data of channel 0, channel 1, channel 2, channel 3, channel 0, channel 4... Are sequentially stored in registers ADCR0, ADCR1, ADCR2, ADCR3, ADCR0, ADCR1,. Is done.
[0047]
In addition, the A / D conversion result storage register selection unit 16 counts the number of channels notified from the A / D conversion channel selection unit 15, and according to the counting result, all of the available registers ADCR0 to ADCR0 are registered with A. When it is detected that the / D conversion data is stored, the interrupt processing unit is controlled to generate an interrupt requesting reading of the A / D conversion data. For example, as shown in FIG. 6A, the A / D conversion of channel 3 (or channel 6, channel 9, channel 12, and channel 15) is completed, and registers as shown in FIGS. When channel 0 is supplied to ADCR0 and channels 1 to 3 (or channels 4 to 6, channels 7 to 9, channels 10 to 12, and channels 13 to 15) are supplied to registers ADCR1 to ADCR3, as shown in FIG. Generate an interrupt.
[0048]
When an interrupt occurs, the CPU 21 reads the data held in the registers ADCR0 to ADCR3 in response to the interrupt in the same manner as in the above-described continuous scan mode, and separates it into A / D conversion data for each channel.
[0049]
Note that the number of specific registers and specific channels need not be one, and can be changed as appropriate, such as assigning channel 0 to register ADCR0 and channel 1 to register ADCR1.
[0050]
In this C mode, since the A / D conversion cycle of a specific channel can be shortened with respect to other channels as described above, the characteristics of the signal of the channel to be measured without increasing the processing load of the CPU 21 Measurement suitable for Further, since A / D conversion can be performed at two different A / D conversion periods, the degree of freedom of the A / D conversion device can be improved.
[0051]
When the frequency setting unit 12 is referred to and the D mode is set, the A / D conversion channel selection unit 15 determines the specific channel designation unit 11 and the channel allocation unit based on the clock from the clock generation unit. The selection signal is supplied to the decoder 6 so that the signals of the channels set to 14 are sequentially selected. As a result, for example, as shown in FIG. 7A, channel 0, channel 1, channel 2, channel 3, channel 4... Are sequentially selected. This order is the same as the above-described continuous scan mode. At this time, the A / D conversion channel selection unit 15 sequentially notifies the A / D conversion result storage register selection unit 16 of the selected channel.
[0052]
When the A / D conversion result storage register selection unit 16 is notified of the currently selected channel from the A / D conversion channel selection unit 15, the A / D conversion of channel 0 is performed as in the above-described C mode. The register for storing the A / D conversion data is selected so that the data is stored in the register ADCR0 and the A / D conversion data of the remaining channels are sequentially stored in the registers ADCR1 to ADCR1. As a result, a register for storing A / D conversion data is selected from the A / D result register 3, and the A / D conversion data of channel 0 is registered as shown in FIGS. 7B to 7E, for example. The A / D conversion data of channel 1, channel 2, channel 3, channel 4, channel 5,... Are sequentially stored in ADCR0 in registers ADCR1, ADCR2, ADCR3, ADCR1, ADCR2,.
[0053]
The A / D conversion result storage register selection unit 16 counts the number of channels notified from the A / D conversion channel selection unit 15, and according to the counting result, all of the available registers ADCR0 to ADCR0-3 are A / D converted. When it is detected that the conversion data has been stored, the interrupt processing unit is controlled to generate an interrupt requesting reading of the A / D conversion data.
[0054]
When an interrupt occurs, the CPU 21 reads the data held in the registers ADCR0 to ADCR3 in response to the interrupt in the same manner as in the above-described C mode, and separates it into A / D conversion data for each channel.
[0055]
Here, since the register ADCR0 is assigned to the channel 0, the contents of the register ADCR0 store the A / D conversion data of the channel 0 once and then store the A / D conversion data of the channel 0. It is not changed for a while. Therefore, the CPU 25 does not need to read the A / D conversion data held in the register ADCR0 when an interrupt occurs after the A / D conversion of the channel 3, channel 6, channel 9, and channel 12, and the other three registers ADCR1. Read only the A / D conversion data held in .about.3, and only read the A / D conversion data held in all the registers ADCR0 to ADCR3 when an interrupt occurs after the A / D conversion of the last channel 15. It's okay.
[0056]
In this D mode, the number of interrupts increases as compared to the continuous scan mode, but the number of data read from the register per interrupt decreases. For this reason, for example, when the CPU 21 has no time to read the contents of all registers at the time of each interrupt due to the low speed of the bus 26, etc., by setting this D mode, the interrupt can be performed once. The number of registers to be read can be reduced. In the D mode, as described above, by reducing the number of channels read for each interrupt, it is possible to perform processing suitable for the processing capacity of the CPU 21, the performance of the bus 26, and the like.
[0057]
Therefore, in the specific register designation mode including the C mode and the D mode, different processing can be performed on the channel assigned to the specific register and other channels, and the degree of freedom of A / D conversion can be improved. it can.
[0058]
Further, as shown in FIG. 11, the additional information adding unit 8 latches the channel selection data from the A / D conversion channel selection unit 15 of the sequencer 5 and supplies it to the result register 3. It is composed of The latch 32 is supplied with an A / D completion signal indicating that the A / D conversion of the A / D converter 2 is completed from the sequencer 5 as a latch timing input.
[0059]
The result register 3 is supplied with an output from a latch 31 that latches 10-bit A / D conversion data from the A / D converter 2. Similar to the latch 32, the latch 31 is supplied with an A / D completion signal from the sequencer 5 as a latch timing input.
[0060]
As described above, when A / D conversion is performed, the A / D conversion channel selection unit 15 selects A / D conversion. This selection data is supplied to the latch 32, and is latched by the latch 32 in response to the A / D conversion completion signal when the A / D conversion is completed. Similarly, A / D conversion data from the A / D converter 2 is latched by a latch 31.
[0061]
The data latched by these latches 31 and 32 is supplied to the register selected by the selection signal from the A / D conversion result storage register selection unit 16. As a result, A / D conversion data and channel data (attachment information) indicating the channel of the A / D conversion data are stored in the registers ADCR0 to ADCR (p-1) of the result register 3 as shown in FIG. The
[0062]
Thus, by adding channel data indicating each channel to the A / D conversion data of each channel, the CPU 21 can easily determine which channel the A / D conversion data read from each register belongs to. it can. Therefore, the data of each channel can be reliably separated.
[0063]
In the additional information adding unit 8, the additional information added to the A / D conversion data includes the A / D conversion sampling period, the sample hold time, and the time stamp indicating the time, in addition to the channel data indicating the channel. Information indicating an operation mode or the like may be used. Since the attached information is used inside the sequencer 5, the attached information is latched in accordance with the A / D conversion completion signal and the latch output is supplied to the result register 3 as in the case of the channel data. do it.
[0064]
Further, when data used in the sequencer 5 is added to the A / D conversion data as described above, a function can be added by a simple configuration change such as providing a latch as described above.
[0065]
【The invention's effect】
In the A / D conversion apparatus according to the present invention, the selection control means controls the input switching means to sequentially select a predetermined number of input channels, instructs the A / D conversion means to perform A / D conversion, and holds unit selection means. By selecting the holding means for storing the A / D conversion results of the input channels selected by the selection control means, the A / D conversion results for each channel are automatically stored in a predetermined number of holding means. Therefore, the external device only needs to read the A / D conversion result from the holding unit in response to the read request from the read request unit, and compared with the case where the external device controls switching of the input channel, etc. The processing load on the equipment can be reduced.
[0066]
Also, if the selection control means is controlled to repeat the A / D conversion of each input channel at a predetermined cycle and update the A / D conversion result, the A / D conversion result is automatically updated. Therefore, the processing load on the external device can be further reduced.
[0067]
The selection control means divides the predetermined number of input channels into a plurality of groups each composed of input channels equal to or less than the predetermined number of holding means, selects the input channel for each group, and the read request means If the read request is made for each A / D conversion result of the group, the number of input channels can be increased without increasing the number of holding means and the processing load of external devices.
[0068]
Further, the assigning means assigns a predetermined number of holding means to a specific input channel, assigns the remaining holding means to other input channels, and the holding unit selecting means assigns the A / D conversion result of the specific input channel to a predetermined value. By storing the A / D conversion results of other input channels in the remaining holding means, it is possible to perform different processing for a specific channel and other channels by storing them in the number holding means. The degree of freedom of conversion can be improved.
[0069]
Further, if the configuration includes an additional information adding means for adding additional information related to the A / D conversion data to the A / D conversion data held in each holding means, the external device can read the A / D conversion data read out. Can be easily identified.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of an A / D converter according to an embodiment of the present invention.
FIG. 2 is a timing chart showing an A / D conversion operation of a conventional A / D converter.
FIG. 3 is a diagram showing channel assignment to each group when channels to be measured are grouped in the conventional A / D converter.
FIG. 4 is a timing chart showing an A / D conversion operation of the conventional A / D converter.
FIG. 5 is a timing chart showing an operation when A / D conversion is performed in a continuous scan mode of the A / D conversion device according to the embodiment of the present invention.
FIG. 6 is a timing chart showing an operation when A / D conversion is performed in a specific channel designation mode of the A / D converter.
FIG. 7 is a timing chart showing an operation when A / D conversion is performed in a specific channel designation mode of the A / D converter.
FIG. 8 is a diagram illustrating a configuration of a mode selection unit that selects an operation mode in the A / D converter.
FIG. 9 is a block diagram showing a configuration of a microcomputer using the A / D converter.
FIG. 10 is a memory map showing a control memory area provided on a memory space of a CPU constituting the microcomputer.
FIG. 11 is a block diagram illustrating a configuration of an additional information adding unit included in the A / D conversion apparatus.
FIG. 12 is a diagram showing A / D conversion data to which additional information is added by the additional information adding unit.
[Explanation of symbols]
1 Analog multiplexer, 2 A / D converter, 3 A / D result register, 4 register, 5 sequencer, 8 additional information adding section

Claims (7)

複数の入力チャネルを選択する入力切り換え手段と、
該入力切り換え手段により選択された入力チャネルの入力信号をA/D変換するA/D変換手段と、
該A/D変換手段のA/D変換結果を保持する上記入力チャネルの数より少ない複数の保持手段と、
上記入力切り換え手段を制御して所定数の入力チャネルを順次選択し、上記A/D変換手段にA/D変換を指示する選択制御手段と、
上記選択制御手段により選択した入力チャネルのA/D変換結果を格納する保持手段を選択する保持部選択手段と、
上記複数の保持手段の内の第1の所定数の保持手段にA/D変換結果が格納されたときに外部の機器に上記保持手段からのA/D変換結果の読み出しを要求して読み出しを行わせる読み出し要求手段と、
上記保持手段のうちの第2の所定数の保持手段を上記複数の入力チャネルの内の特定の入力チャネルに割り当てる割り当て手段とを備え、
上記保持部選択手段は、上記選択制御手段により選択した入力チャネルが特定の入力チャネルであるときはA/D変換結果を上記特定の入力チャネルに割り当てられた保持手段に格納し、上記選択制御手段により選択した入力チャネルが特定の入力チャネルでないときはA/D変換結果を上記特定の入力チャネルに割り当てられた保持手段以外の保持手段に格納し、
上記選択制御手段は、上記特定の入力チャネル以外の入力チャネルを、複数のグループに分割し、各グループの入力チャネルを順次選択してA/D変換させ、
上記選択制御手段は、上記特定の入力チャネル以外の入力チャネルのすべてを選択してA/D変換させた後、上記特定の入力チャネルを選択してA/D変換させ、
上記読み出し要求手段は、各グループのすべての入力チャネルについてA/D変換が終わったら、当該グループのA/D変換の結果の読み出し要求を行って読み出しを行わせ
上記読み出し要求手段は、すべてのグループのすべての入力チャンネルについてのA/D変換の結果の読み出しが終わったら、上記特定の入力チャネルについてのA/D変換の結果の読み出し要求を行って読み出しを行わせる
ことを特徴とするA/D変換装置。
An input switching means for selecting a plurality of input channels;
A / D conversion means for A / D converting the input signal of the input channel selected by the input switching means;
A plurality of holding means smaller than the number of the input channels holding the A / D conversion results of the A / D conversion means;
Selection control means for controlling the input switching means to sequentially select a predetermined number of input channels and instructing the A / D conversion means to perform A / D conversion;
Holding unit selecting means for selecting holding means for storing the A / D conversion result of the input channel selected by the selection control means;
When an A / D conversion result is stored in a first predetermined number of holding means among the plurality of holding means, an external device is requested to read the A / D conversion result from the holding means and read out. a reading requesting means for causing,
Assigning means for assigning a second predetermined number of holding means of the holding means to a specific input channel of the plurality of input channels,
When the input channel selected by the selection control unit is a specific input channel, the holding unit selection unit stores an A / D conversion result in a holding unit assigned to the specific input channel, and the selection control unit When the input channel selected by the above is not a specific input channel, the A / D conversion result is stored in the holding means other than the holding means assigned to the specific input channel.
The selection control means divides input channels other than the specific input channel into a plurality of groups, sequentially selects the input channels of each group, performs A / D conversion,
The selection control means selects all of the input channels other than the specific input channel and performs A / D conversion, then selects the specific input channel and performs A / D conversion,
It said read request means, once finished the A / D conversion for all the input channels of each group, to perform the read I line results read request of A / D conversion of the group,
When the reading request means has finished reading the A / D conversion results for all the input channels of all the groups, the reading request means makes a read request for the A / D conversion results for the specific input channel and performs reading. An A / D conversion device characterized in that
複数の入力チャネルを選択する入力切り換え手段と、
該入力切り換え手段により選択された入力チャネルの入力信号をA/D変換するA/D変換手段と、
該A/D変換手段のA/D変換結果を保持する上記入力チャネルの数より少ない複数の保持手段と、
上記入力切り換え手段を制御して所定数の入力チャネルを順次選択し、上記A/D変換手段にA/D変換を指示する選択制御手段と、
上記選択制御手段により選択した入力チャネルのA/D変換結果を格納する保持手段を選択する保持部選択手段と、
上記複数の保持手段の内の第1の所定数の保持手段にA/D変換結果が格納されたときに外部の機器に上記保持手段からのA/D変換結果の読み出しを要求して読み出しを行わせる読み出し要求手段と、
上記保持手段のうちの第2の所定数の保持手段を上記複数の入力チャネルの内の特定の入力チャネルに割り当てる割り当て手段とを備え、
上記保持部選択手段は、上記選択制御手段により選択した入力チャネルが特定の入力チャネルであるときはA/D変換結果を上記特定の入力チャネルに割り当てられた保持手段に格納し、上記選択制御手段により選択した入力チャネルが特定の入力チャネルでないときはA/D変換結果を上記特定の入力チャネルに割り当てられた保持手段以外の保持手段に格納し、
上記選択制御手段は、上記特定の入力チャネル以外の入力チャネルを、複数のグループに分割し、各グループの入力チャネルを順次選択してA/D変換させ、
上記選択制御手段は、第1のモードにおいては、各グループのすべての入力チャネルが選択されるごとに上記特定の入力チャネルを選択してA/D変換させ、これにより上記特定の入力チャネルの選択の周期を、上記特定の入力チャネル以外の入力チャネルの選択の周期よりも短くし、第2のモードにおいては、上記特定の入力チャネル以外の入力チャネルのすべてを選択してA/D変換させた後、上記特定の入力チャネルを選択してA/D変換させ、
上記読み出し要求手段は、上記第1のモードにおいては、各グループのすべての入力チャネルについてA/D変換が終わったら、当該グループのすべての入力チャンネル及び上記特定の入力チャンネルのA/D変換の結果の読み出し要求を行って読み出しを行わせ、
上記読み出し要求手段は、上記第2のモードにおいては、各グループのすべての入力チャネルについてA/D変換が終わったら、当該グループのすべての入力チャンネルのA/D変換の結果の読み出し要求を行って読み出しを行わせ、すべてのグループのすべての入力チャンネルについてのA/D変換の結果の読み出しが終わったら、上記特定の入力チャネルについてのA/D変換の結果の読み出し要求を行って読み出しを行わせる
ことを特徴とするA/D変換装置。
An input switching means for selecting a plurality of input channels;
A / D conversion means for A / D converting the input signal of the input channel selected by the input switching means;
A plurality of holding means smaller than the number of the input channels holding the A / D conversion results of the A / D conversion means;
Selection control means for controlling the input switching means to sequentially select a predetermined number of input channels and instructing the A / D conversion means to perform A / D conversion;
Holding unit selecting means for selecting holding means for storing the A / D conversion result of the input channel selected by the selection control means;
When an A / D conversion result is stored in a first predetermined number of holding means among the plurality of holding means, an external device is requested to read the A / D conversion result from the holding means and read out. a reading requesting means for causing,
Assigning means for assigning a second predetermined number of holding means of the holding means to a specific input channel of the plurality of input channels,
When the input channel selected by the selection control unit is a specific input channel, the holding unit selection unit stores an A / D conversion result in a holding unit assigned to the specific input channel, and the selection control unit When the input channel selected by the above is not a specific input channel, the A / D conversion result is stored in the holding means other than the holding means assigned to the specific input channel.
The selection control means divides input channels other than the specific input channel into a plurality of groups, sequentially selects the input channels of each group, performs A / D conversion,
In the first mode, the selection control means selects the specific input channel and performs A / D conversion every time all the input channels of each group are selected, thereby selecting the specific input channel. In the second mode, all of the input channels other than the specific input channel are selected and A / D converted in the second mode. Then, select the specific input channel and perform A / D conversion.
In the first mode, when the A / D conversion is completed for all the input channels of each group, the read request unit performs the A / D conversion result of all the input channels of the group and the specific input channel. to perform the read out of the read request I row,
In the second mode, when the A / D conversion is completed for all the input channels of each group, the read request unit issues a read request for the results of the A / D conversion of all the input channels of the group. When the reading is performed and the reading of the A / D conversion results for all the input channels of all the groups is finished, the reading of the result of the A / D conversion for the specific input channel is performed to perform the reading. An A / D converter characterized by the above.
さらに、上記選択制御手段を制御して、所定の周期で各入力チャネルのA/D変換を繰り返し、A/D変換結果を更新することを特徴とする請求項1又は2に記載のA/D変換装置。 3. The A / D according to claim 1 , further comprising: controlling the selection control unit to repeat A / D conversion of each input channel at a predetermined period and update an A / D conversion result. Conversion device. さらに、上記各保持手段に保持されているA/D変換データに該A/D変換データに関する付加情報を付加する付加情報付加手段を備えることを特徴とする請求項1乃至請求項のいずれか1項に記載のA/D変換装置。Further, any of claims 1 to 3, characterized in that it comprises the additional information addition means for adding the additional information relating to the A / D conversion data to the A / D conversion data held in each holding means 2. The A / D conversion device according to item 1. 上記付加情報付加手段が、上記保持手段から上記A/D変換結果を受けるとともに、上記選択制御手段から選択された入力チャネルを示すデータを受け、各入力チャネルの上記A/D変換結果に、対応する入力チャネルを示すチャネルデータを付加する
ことを特徴とする請求項4に記載のA/D変換装置。
The additional information adding means receives the A / D conversion result from the holding means and receives data indicating the input channel selected from the selection control means, and responds to the A / D conversion result of each input channel. The A / D converter according to claim 4 , wherein channel data indicating an input channel to be added is added.
請求項1に記載のA/D変換装置と、
CPUと、RAMとを有し、
上記A/D変換装置のうちの上記保持手段が上記RAMの一部により構成され、
上記CPUが上記外部の機器を構成し、
上記CPUが上記選択制御手段に対して上記特定の入力チャネルを指定するとともに、上記保持部選択手段に対して上記保持手段のうちの上記第2の所定数の保持手段を上記特定の入力チャネルに割り当てることを指示する
ことを特徴とするマイクロコントローラ。
An A / D conversion device according to claim 1 ,
A CPU and a RAM;
The holding means of the A / D conversion device is constituted by a part of the RAM,
The CPU constitutes the external device,
The CPU designates the specific input channel to the selection control means, and sets the second predetermined number of holding means among the holding means to the specific input channel to the holding unit selection means. A microcontroller characterized by directing assignment.
請求項2に記載のA/D変換装置と、
CPUと、RAMとを有し、
上記A/D変換装置のうちの上記保持手段が上記RAMの一部により構成され、
上記CPUが上記外部の機器を構成し、
上記CPUが上記選択制御手段に対して上記特定の入力チャネルを指定するとともに、上記保持部選択手段に対して上記保持手段のうちの上記第2の所定数の保持手段を上記特定の入力チャネルに割り当てることを指示し、
上記CPUがさらに、上記第1のモードと上記第2のモードのいずれかを選択して指定する
ことを特徴とするマイクロコントローラ。
An A / D conversion device according to claim 2 ,
A CPU and a RAM;
The holding means of the A / D conversion device is constituted by a part of the RAM,
The CPU constitutes the external device,
The CPU designates the specific input channel to the selection control means, and sets the second predetermined number of holding means among the holding means to the specific input channel to the holding unit selection means. To assign,
The microcontroller further comprises selecting and specifying one of the first mode and the second mode.
JP07874996A 1996-04-01 1996-04-01 A / D converter and microcontroller Expired - Fee Related JP3830199B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP07874996A JP3830199B2 (en) 1996-04-01 1996-04-01 A / D converter and microcontroller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP07874996A JP3830199B2 (en) 1996-04-01 1996-04-01 A / D converter and microcontroller

Publications (2)

Publication Number Publication Date
JPH09269870A JPH09269870A (en) 1997-10-14
JP3830199B2 true JP3830199B2 (en) 2006-10-04

Family

ID=13670550

Family Applications (1)

Application Number Title Priority Date Filing Date
JP07874996A Expired - Fee Related JP3830199B2 (en) 1996-04-01 1996-04-01 A / D converter and microcontroller

Country Status (1)

Country Link
JP (1) JP3830199B2 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4181482B2 (en) 2003-11-04 2008-11-12 株式会社日立製作所 Electronic control unit
JP4646285B2 (en) * 2004-03-26 2011-03-09 ルネサスエレクトロニクス株式会社 AD converter and AD conversion method
JP4599312B2 (en) 2006-02-02 2010-12-15 Okiセミコンダクタ株式会社 Analog / digital converter
JP2008301456A (en) * 2007-06-04 2008-12-11 Yamaha Motor Electronics Co Ltd A/d conversion apparatus
JP5327085B2 (en) * 2010-02-01 2013-10-30 株式会社デンソー A / D conversion processor
JP5813485B2 (en) * 2011-12-05 2015-11-17 日置電機株式会社 A / D converter
JP5997008B2 (en) * 2012-02-08 2016-09-21 ルネサスエレクトロニクス株式会社 Semiconductor integrated circuit device and data processing system
EP3114690B1 (en) * 2014-03-07 2020-02-12 Intel Corporation Physically unclonable function circuit using resistive memory device

Also Published As

Publication number Publication date
JPH09269870A (en) 1997-10-14

Similar Documents

Publication Publication Date Title
JP3027970B2 (en) Digital signal processor memory management unit and method
US4454500A (en) Analog data acquisition device
US5166685A (en) Automatic selection of external multiplexer channels by an A/D converter integrated circuit
US7126522B2 (en) Apparatus and method of analog-to-digital conversion
TW498164B (en) Integrated circuit testing device with dual purpose analog and digital channels
JP3830199B2 (en) A / D converter and microcontroller
KR100255683B1 (en) Single-chip computer system having a direct memory access (dma) mode
JPH0488723A (en) A/d converter
US6701395B1 (en) Analog-to-digital converter that preseeds memory with channel identifier data and makes conversions at fixed rate with direct memory access
JPH0470946A (en) Processor containing dma controller
US5327565A (en) Data processing apparatus
JPH08272765A (en) Semiconductor integrated circuit and motor driving control circuit
JP3323009B2 (en) Data processing device
JP2797137B2 (en) Processing equipment for electronic musical instruments
JPS5826583B2 (en) Data collection
JP3791287B2 (en) Data converter
JP3698483B2 (en) Serial I / O
JP4905260B2 (en) A / D converter
JPS62297963A (en) Allocating circuit for time slot
JP2536609B2 (en) Bus selection circuit
JP2715656B2 (en) Analog-to-digital converter
JPH08316836A (en) Signal processing circuit
JP3430575B2 (en) Electronic music signal synthesizer
JPS63225821A (en) Signal processor
JPS61131026A (en) Ad-converted data recording device

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050301

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050419

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060425

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060615

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20060711

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20060711

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

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

Free format text: PAYMENT UNTIL: 20090721

Year of fee payment: 3

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees