JPH04128981A - Microcomputer - Google Patents

Microcomputer

Info

Publication number
JPH04128981A
JPH04128981A JP2250872A JP25087290A JPH04128981A JP H04128981 A JPH04128981 A JP H04128981A JP 2250872 A JP2250872 A JP 2250872A JP 25087290 A JP25087290 A JP 25087290A JP H04128981 A JPH04128981 A JP H04128981A
Authority
JP
Japan
Prior art keywords
conversion
timer
microcomputer
register
result
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2250872A
Other languages
Japanese (ja)
Inventor
Shinichiro Takahashi
高橋 愼一郎
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 IC Microcomputer Systems Co Ltd
Original Assignee
NEC IC Microcomputer Systems 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 NEC IC Microcomputer Systems Co Ltd filed Critical NEC IC Microcomputer Systems Co Ltd
Priority to JP2250872A priority Critical patent/JPH04128981A/en
Publication of JPH04128981A publication Critical patent/JPH04128981A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To contrive highly accurate timing of A/D conversion input of a microcomputer by providing the microcomputer with a means of transmitting a signal bilaterally or unilaterally between an A/D conversion block and a timer block without intervention of internal bus. CONSTITUTION:A microcomputer has a mixing circuit 6 that carries out logical operation on a conversion start demand signal from timer 4 and a setting signal from mode register 3 and that outputs a result of the logic operation to an A/D conversion circuit 1, sets a timing of A/D conversion input in a compare register 5 by means of program, and makes a timer 4 start counting. When a value on timer 4 coincides with a value in compare register 5, the microcomputer generates a start demand signal 9, inputs it in the mixing circuit 6, carries out logic operation on a setting signal from mode register 3 and the start demand signal 9, and demands the A/D conversion circuit 1 to start conversion operation. Further, the microcomputer inputs analog data in the A/D conversion circuit 1 from an external input terminal 7, and when the conversion ends, the microcomputer loads a result register with a digital value of a result of the conversion. For this season, highly accurate timing of A/D conversion can be done eliminating troublesome treatment of program.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はマイクロコンピュータに関し、の内部のA/D
変換装置に関する。
[Detailed Description of the Invention] [Industrial Application Field] The present invention relates to a microcomputer, and an internal A/D of a microcomputer.
This invention relates to a conversion device.

〔従来の技術〕[Conventional technology]

特にそ 従来のマイクロコンピュータのA/D変換装置について
、第2図を用いて説明する。第2図において、このA/
D変換装置の動作は、外部入力端子7より電圧値等のア
ナログデータを入力する。
In particular, the conventional A/D converter for a microcomputer will be explained with reference to FIG. In Figure 2, this A/
The D converter operates by inputting analog data such as voltage values from the external input terminal 7.

このアナログデータは、A/D変換回路1によりデジタ
ルデータに変換され、その結果が結果レジスタ2に格納
される。
This analog data is converted into digital data by the A/D conversion circuit 1, and the result is stored in the result register 2.

外部入力端子7の電圧値を結果レジスタ2に格納するま
でに要する時間を変換時間と呼ぶことにする。(この時
間は、一般に数十マイクロ秒である。) 内部バス10は、結果レジスタ2の他に、モードレジス
タ3.比較レジスタ5にも連絡する。
The time required to store the voltage value of the external input terminal 7 in the result register 2 will be referred to as conversion time. (This time is generally several tens of microseconds.) In addition to result register 2, internal bus 10 also includes mode registers 3. The comparison register 5 is also contacted.

A/D変換値の入力は、一般に前記変換時間より長い時
間間隔(数ms)で行なう、そこで、前述したA/D変
換装置をプログラム制御してA/D変換を行う順序を、
第4図を用いて説明する。
The input of A/D conversion values is generally performed at time intervals (several ms) longer than the conversion time. Therefore, the order in which A/D conversion is performed by controlling the above-mentioned A/D conversion device by a program is as follows.
This will be explained using FIG.

第2図、第4図において、数msのタイミング発生のた
めには一般にタイマ4を使い、タイマスタート11の時
点で、タイマ4を始動する。タイマ4が一定時間カウン
トすると、次の時点12でタイマ割り込み信号を発生す
る。
In FIGS. 2 and 4, a timer 4 is generally used to generate a timing of several ms, and is started at timer start 11. When the timer 4 counts for a certain period of time, a timer interrupt signal is generated at the next time point 12.

割り込み信号が発生したら、ライン13で示される割り
込み動作への遷移をへて、A/D変換閘始14の割り込
み処理に至り、A/D変換開始処理を行なう、その後A
/D変換が終了し、変換終了信号が発生したら、次の時
点16で示すA/D変換終了割り込み信号として用いら
れ、変換結果人力17のプロセスで、変換結果を所定の
メモリに格納する。
When an interrupt signal is generated, a transition is made to the interrupt operation indicated by line 13, and the interrupt processing is reached at A/D conversion start 14, where A/D conversion start processing is performed.
When the A/D conversion is completed and a conversion end signal is generated, it is used as an A/D conversion end interrupt signal shown at the next time point 16, and the conversion result is stored in a predetermined memory in the process of the conversion result manual 17.

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

前述した処理手順では、時点12のタイマ割り込みと時
点16のA/D変換終了割り込みの2つの割り込みを使
うため、プログラム制御による負担が大きく、わずられ
しいという欠点がある。
The above-described processing procedure uses two interrupts, the timer interrupt at time 12 and the A/D conversion end interrupt at time 16, and therefore has the disadvantage that the program control burden is large and cumbersome.

また、タイマ4が一定時間カウントした直後からA/D
変換動作を開始させるまでに、ライン13の部分におい
てマイコンの割り込み処理移行による遅れ、ばらつきが
生じる。従って、外部からのアナログデータの受付はタ
イミングも追従して遅れ、ばらつきが生じる。それゆえ
に、受付タイミングの精度の要求されるシステムにおい
ては、このA/D変換装置では仕様を十分に満足するこ
とができないという欠点もある。
Also, immediately after timer 4 counts for a certain period of time, the A/D
Before starting the conversion operation, delays and variations occur in the line 13 due to transition to interrupt processing by the microcomputer. Therefore, the timing of reception of analog data from the outside is delayed and variations occur. Therefore, in systems that require precision in reception timing, this A/D converter has the disadvantage that it cannot fully satisfy the specifications.

本発明の目的は、前記欠点が解決され、一定間隔の時間
をおいてA/D変換を行ない、値を入力する場合のソフ
トウェア・プログラムの負担を軽減し、A/D変換入力
のタイミングの精度を良くしたマイクロコンピュータを
提供することにある。
It is an object of the present invention to solve the above-mentioned drawbacks, perform A/D conversion at regular intervals, reduce the burden on software programs when inputting values, and improve the accuracy of the timing of A/D conversion input. Our goal is to provide a microcomputer with improved functionality.

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

本発明のマイクロコンピュータの構成は、A/D変換回
路、その変換結果を格納する結果レジスタ、前記A/D
変換回路の動作制御を行なうモードレジスタを有するA
/D変換ブロックと、タイマ、比較レジスタを有するタ
イマブロックとの間に、内部バスを介せずに信号を相互
に伝達又は−方向に伝達する手段を設けたA/D変換装
置を備えたことを特徴とする。
The configuration of the microcomputer of the present invention includes an A/D conversion circuit, a result register for storing the conversion result, and the A/D conversion circuit.
A having a mode register that controls the operation of the conversion circuit.
An A/D conversion device is provided between the /D conversion block and the timer block having a timer and a comparison register, which is provided with means for mutually transmitting signals or transmitting signals in the - direction without going through an internal bus. It is characterized by

〔実施例〕〔Example〕

次に本発明について図面を参照して説明する。 Next, the present invention will be explained with reference to the drawings.

第1図は本発明の一実施例のマイクロコンピュータのA
/D変換装置のブロック図である。
FIG. 1 shows A of a microcomputer according to an embodiment of the present invention.
FIG. 2 is a block diagram of a /D conversion device.

第1図において、本実施例のA/D変換装置は、従来の
ものに加えて、タイマ4からの変換開始要求信号とモー
ドレジスタ3の設定信号との論理演算を行ない、A/D
変換回FIIr1にその結果を出力する混合回路6を設
けている。比較レジスタ5にA/D変換入力のタイミン
グをプログラムで設定し、タイマ4をカウントさせる。
In FIG. 1, the A/D converter of this embodiment performs a logical operation on the conversion start request signal from the timer 4 and the setting signal of the mode register 3, in addition to the conventional A/D converter.
A mixing circuit 6 is provided at the conversion circuit FIIr1 to output the result. The timing of A/D conversion input is set in the comparison register 5 by a program, and the timer 4 is caused to count.

タイマ4と比較レジスタ5との値が一致すると、開始要
求信号9を発生し、混合回路6に入力する。混合回路6
では、モードレジスタ3の設定信号と開始要求信号9と
の論理演算を行ない、A/D変換回路1に対して変換動
作の開始要求を行なう、A/D変換回路1は、外部入力
端子7よりアナログデータを入力し、変換が終了すると
、結果レジスタ2に変換結果のデジタル値を格納する0
本実施例に於いては、前記A/D変換入力タイミングの
設定以外の各動作は、ハード的に実行される。
When the values in the timer 4 and comparison register 5 match, a start request signal 9 is generated and input to the mixing circuit 6. Mixing circuit 6
Then, the A/D conversion circuit 1 performs a logical operation on the setting signal of the mode register 3 and the start request signal 9, and requests the A/D conversion circuit 1 to start a conversion operation. When analog data is input and conversion is completed, the digital value of the conversion result is stored in result register 2.
In this embodiment, each operation other than setting the A/D conversion input timing is executed by hardware.

本実施例のA/D変換装置を用いたプログラムによる制
臀例を、第3図も用いて説明する。
An example of control by a program using the A/D conversion device of this embodiment will be explained with reference to FIG.

従来と同様にタイミング発生のためにタイマスタート1
1の部分でタイマ4に値を設定する。
As before, timer start 1 is used to generate timing.
A value is set in timer 4 in part 1.

タイマ4が一定時間カウントすると、タイマ討つ込み1
2′が発生するが、これはA/D変換ブロックに、第1
図の開始要求信号9として直結されているため、同時に
A/D変換開始処理14を行なう、タイマ割り込み12
′からA/D変換開始処理14までは、部分15で示す
様に、ハードウェアで処理され、プログラムに対しては
何ら処理を与えない。
When timer 4 counts for a certain period of time, timer attack 1
2' is generated, which causes the A/D conversion block to
Since it is directly connected as the start request signal 9 in the figure, the timer interrupt 12 simultaneously performs the A/D conversion start processing 14.
The process from ' to A/D conversion start processing 14 is processed by hardware, as shown in section 15, and no processing is given to the program.

そして、A/D変換が終了したら、A/D変換終了割り
込み16を発生し、変換結果人力17の部分で変換結果
入力処理を行なうことになる。
When the A/D conversion is completed, an A/D conversion end interrupt 16 is generated, and the conversion result input process is performed by the conversion result manual section 17.

本実施例では、A/D変換ブロックに接続する信号とし
て、比較レジスタ5とタイマ4の一致信号を用いたが、
タイマの任意のビットが変化するタイミングや、タイマ
がカウントオーバーフローするタイミング等のタイマの
動作によって発生する信号を用いるものは、全て本発明
の実施例として適用される。
In this embodiment, the match signal of the comparison register 5 and timer 4 is used as the signal connected to the A/D conversion block.
Any method that uses a signal generated by the operation of a timer, such as the timing when an arbitrary bit of the timer changes or the timing when the timer overflows, can be applied as an embodiment of the present invention.

また第1図混合回路6の論理演算は、タイマブロックか
らの信号を用いるものであれば、どのようなものでもよ
い。
Further, the logical operation of the mixing circuit 6 in FIG. 1 may be of any type as long as it uses the signal from the timer block.

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

以上説明したように、本発明は、タイマから出力する信
号でもって変換動作の開始タイミングを決定しているか
ら、タイマから出力する信号をプログラムで検知してか
ら、A/D入力を行ないといったわずられしさが省け、
タイマ割り込みとA/D変換終了割り込みとを両方用い
るといったプログラムの煩雑さがなくなり、精度良く、
変換が行えるという効果がある。
As explained above, in the present invention, the start timing of the conversion operation is determined by the signal output from the timer, so the A/D input is performed after the signal output from the timer is detected by the program. Eliminate misalignment,
This eliminates the complexity of programs such as using both timer interrupts and A/D conversion end interrupts, resulting in improved accuracy and
This has the effect of allowing conversion.

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

第1図は本発明の一実施例のマイクロコンピュータのA
/D変換装置のブロック図、第2図は従来のマイクロコ
ンピュータのA/D変換装置のブロック図、第3図は第
1図のA/D変換装置のプログラムによる使用例を示す
フロー図、第4図は第2図のA/D変換装置のプログラ
ムによる使用例を示すフロー図である。 1・・・A/D変換回路、2・−・結果レジスタ、3・
−・モードレジスタ、4・・・タイマ、5・−・比較レ
ジスタ、6−・・混合回路、7・・・外部入力端子、8
・・・変換終了信号、9・・・閘始要求信号、10・・
・内部バス、11・・・タイマスタート、12・・・時
点、12′・・・タイマ割り込み、13・・・割り込み
移行、14・・・A/D変換開始、15・−・ハードウ
ェア処理部分、16・・−A/D変換終了割り込み、1
7・・・変換結果入力。
FIG. 1 shows A of a microcomputer according to an embodiment of the present invention.
2 is a block diagram of an A/D converter for a conventional microcomputer. FIG. 3 is a flow diagram showing an example of how the A/D converter shown in FIG. 1 is used by a program. FIG. 4 is a flow diagram showing an example of how the A/D converter shown in FIG. 2 is used by a program. 1...A/D conversion circuit, 2...Result register, 3...
- - Mode register, 4 - Timer, 5 - Comparison register, 6 - Mixing circuit, 7 - External input terminal, 8
... Conversion end signal, 9... Lock start request signal, 10...
・Internal bus, 11...Timer start, 12...Time point, 12'...Timer interrupt, 13...Interrupt transition, 14...A/D conversion start, 15...Hardware processing part , 16...-A/D conversion end interrupt, 1
7...Input conversion result.

Claims (1)

【特許請求の範囲】[Claims] A/D変換回路、その変換結果を格納する結果レジスタ
、前記A/D変換回路の動作制御を行なうモードレジス
タを有するA/D変換ブロックと、タイマ、比較レジス
タを有するタイマブロックとの間に、内部バスを介せず
に信号を相互に伝達又は一方向に伝達する手段を設けた
A/D変換装置を備えたことを特徴とするマイクロコン
ピュータ。
between an A/D conversion block that includes an A/D conversion circuit, a result register that stores the conversion result, and a mode register that controls the operation of the A/D conversion circuit; and a timer block that includes a timer and a comparison register; A microcomputer characterized by comprising an A/D conversion device provided with means for mutually or unidirectionally transmitting signals without going through an internal bus.
JP2250872A 1990-09-20 1990-09-20 Microcomputer Pending JPH04128981A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2250872A JPH04128981A (en) 1990-09-20 1990-09-20 Microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2250872A JPH04128981A (en) 1990-09-20 1990-09-20 Microcomputer

Publications (1)

Publication Number Publication Date
JPH04128981A true JPH04128981A (en) 1992-04-30

Family

ID=17214266

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2250872A Pending JPH04128981A (en) 1990-09-20 1990-09-20 Microcomputer

Country Status (1)

Country Link
JP (1) JPH04128981A (en)

Similar Documents

Publication Publication Date Title
JPH0268632A (en) Interruption controller
JPH02165721A (en) Pulse output device
JPH04128981A (en) Microcomputer
JPH06348507A (en) Microcomputer
JPH08139575A (en) Pulse output circuit
JPH05313776A (en) Pulse generation circuit
JP2738141B2 (en) Single chip microcomputer
JPS6229819B2 (en)
JPH0573296A (en) Microcomputer
JP2580575B2 (en) Moving object control device
JPH04192037A (en) Semiconductor integrated circuit
JPH0427730B2 (en)
JPS63153911A (en) Pulse output device
JPS6258003B2 (en)
JPH0767288B2 (en) Gate pulse controller for thyristor inverter
JPH0290234A (en) Interruption control circuit for microcomputer
JPH07120166B2 (en) Sequence control device
JPS6145333A (en) Fixing system of processing time
JPS62150454A (en) Direct memory access system
JPS62131756A (en) Triac controller
JPH03240830A (en) Microcontroller
JPH0474228A (en) Interruption circuit
JPH01207830A (en) Interrupt controller
JPH05333956A (en) Timer circuit
JPH0644180A (en) Dma device