JPS63142402A - Method for data reception from successive comparison type a/d converter - Google Patents
Method for data reception from successive comparison type a/d converterInfo
- Publication number
- JPS63142402A JPS63142402A JP28967886A JP28967886A JPS63142402A JP S63142402 A JPS63142402 A JP S63142402A JP 28967886 A JP28967886 A JP 28967886A JP 28967886 A JP28967886 A JP 28967886A JP S63142402 A JPS63142402 A JP S63142402A
- Authority
- JP
- Japan
- Prior art keywords
- reception
- serial
- cpu
- data
- converter
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Landscapes
- Safety Devices In Control Systems (AREA)
Abstract
Description
【発明の詳細な説明】
〔産業上の利用分野〕
本発明は、逐次比較型A/D変換器の変換データをシリ
アル受信割込みで受信するデータ受信方法に関する。DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a data reception method for receiving conversion data of a successive approximation type A/D converter using a serial reception interrupt.
CPUからA/D変換開始の指令を出し、これを受けた
逐次比較型のA/D変換器(以下ADCと略す)が変換
データをシリアルに出力すると、CP U IIJのシ
リアル受信レジスタに所定ビット数の変換データが取込
まれた段階でCPUにシリアル割込みがかかる。CPU
はこの割込みを待って変換データを取込み、1回のA/
D変換を完了する。When the CPU issues a command to start A/D conversion and the successive approximation type A/D converter (hereinafter referred to as ADC) that receives the command outputs converted data serially, a predetermined bit is sent to the serial reception register of the CPU IIJ. A serial interrupt is issued to the CPU at the stage when the number of conversion data has been taken in. CPU
waits for this interrupt, takes in the conversion data, and performs one A/
Complete D conversion.
第3図はこの種のシステムの構成図で、1はCPU、2
は逐次比較型ADC,3はシリアルデータライン、4は
シリアル受信レジスタである。CPUIからADC2へ
はアナログ入力のCH(チャネル)選択信号、ADスタ
ート信号、クロック信号が出力される。ADC2は3ビ
ツトのCH選択信号をアドレスラッチ21に保持し、該
当するアナログ入力(CHO〜CH7の1つ)をマルチ
プレクサ22で選択する。逐次比較レジスタ(SAR)
23はADスタート信号を受けると、先ず最大基準電圧
REFの1/2をD/A変換器(DAC)24に与え、
そのアナログ変換値を比較器25でアナログ入力と比較
させる。そして、マルチプレクサ22を通して該当する
チャネルの比較結果(大小に応じて1,0となる)が5
AR23に入力されると、5AR23は次の比較値2R
EFをDAC24に与え、以下クロックが入力する毎に
2−3REF、2 ’REF、・・・・・・と比較値を
変更する。そして、最後の比較値2−8RE Fに対す
る比較結果が得られたら、2 REF〜2REFに対
する8ビツトのA/D変換データにスタートビットとス
トップビットを加えてシフトレジスタ26からデータラ
イン3にシリアルに送出し、CPU側のシリアル受信レ
ジスタ4へ転送する。Figure 3 is a configuration diagram of this type of system, where 1 is the CPU, 2
is a successive approximation type ADC, 3 is a serial data line, and 4 is a serial reception register. An analog input CH (channel) selection signal, AD start signal, and clock signal are output from the CPUI to the ADC2. The ADC 2 holds a 3-bit CH selection signal in an address latch 21, and selects a corresponding analog input (one of CHO to CH7) with a multiplexer 22. Successive approximation register (SAR)
Upon receiving the AD start signal, 23 first applies 1/2 of the maximum reference voltage REF to the D/A converter (DAC) 24,
The analog converted value is compared with the analog input by a comparator 25. Then, through the multiplexer 22, the comparison result of the corresponding channel (1 or 0 depending on the size) is 5.
When input to AR23, 5AR23 receives the next comparison value 2R
EF is given to the DAC 24, and thereafter the comparison value is changed to 2-3 REF, 2' REF, . . . every time a clock is input. Then, when the comparison result for the last comparison value 2-8REF is obtained, a start bit and a stop bit are added to the 8-bit A/D conversion data for 2REF to 2REF, and the data is serially transferred from the shift register 26 to the data line 3. The data is sent and transferred to the serial reception register 4 on the CPU side.
第4図はクロック周波数を250KHzとしてアナログ
入力を8ビツトにAD変換する場合のタイムチャートで
ある。1クロック周期は4μsであるので8ピツI・の
AD変換には8×4μ5=32μs要し、またデータ送
信にはスタート、ストップの各1ビツトを付加するため
(8+2)x4μ5−40μs要す。従って、ADスタ
ート信号の立上りから一定時間T(=72μs)後にC
PU1に受信割込みがかかる。FIG. 4 is a time chart when analog input is AD converted into 8 bits with a clock frequency of 250 KHz. Since one clock period is 4 .mu.s, AD conversion of 8 pins I requires 8.times.4 .mu.5=32 .mu.s, and data transmission requires (8+2).times.4 .mu.5 - 40 .mu.s since one start bit and one stop bit are added. Therefore, after a certain time T (=72 μs) from the rise of the AD start signal, C
A reception interrupt is applied to PU1.
第5図(a)はクロックとシリアル転送データの関係を
示しており、この例ではシリアル受信レジスタ4はクロ
ックの立下りでデータを取込むことができる。FIG. 5(a) shows the relationship between the clock and serial transfer data, and in this example, the serial reception register 4 can take in data at the falling edge of the clock.
ところで、内燃機関を制御する電子制御装置では、制御
内容が複雑になるにつれてA/D変換の高速化の要求が
生じ、上述した様な逐次比較型のADCを用いるケース
が増えている。しかしながら、第3図で説明した様なシ
リアル受信はノイズに弱いため誤ったデータを受信する
可能性が強い。By the way, as control contents become more complex in electronic control units that control internal combustion engines, there is a demand for faster A/D conversion, and successive approximation type ADCs as described above are increasingly used. However, since serial reception as explained in FIG. 3 is susceptible to noise, there is a strong possibility that erroneous data will be received.
剥えば、第5図(blに示すようにデータライン3にノ
イズ(特に点火ノイズ)が混入してA / D変換デー
タの送信時でもないのに一時的にデータライン3のレベ
ルが変化すると、これがスタートビットとして読取られ
る結果、ノイズによる誤ったデータが受信される。In other words, as shown in Figure 5 (bl), if noise (especially ignition noise) mixes into data line 3 and the level of data line 3 changes temporarily even when A/D conversion data is not being transmitted, This is read as a start bit, resulting in incorrect data being received due to noise.
一般にADCZ側ではADスタート信号を受けないとき
に出力が変化しないようにデータライン3をプルアップ
する保護措置を講じている。そして、CPUIもADス
タートを出さなければ変換データは送られて来ないとの
観点から、常に受信割込を受付は得る状態にしている。Generally, on the ADCZ side, a protection measure is taken to pull up the data line 3 so that the output does not change when the AD start signal is not received. Also, from the viewpoint that conversion data will not be sent unless the CPU issues an AD start, the reception interrupt is always accepted.
このため第5図(b)のようなケースではオール1が誤
受信される。Therefore, in the case shown in FIG. 5(b), all 1's are erroneously received.
この点を改善するために、従来はデータライン3の受端
側にフィルタを設けて該ノイズを除去するようにしてい
る。しかし、フィルタを用いるとその時定数のために高
速送信できなくなり、制御の応答性を十分に高められな
い難点がある。また、アナログ回路によるフィルタはハ
ード量を増大させるので好ましくない。In order to improve this point, conventionally, a filter is provided on the receiving end side of the data line 3 to remove the noise. However, when a filter is used, high-speed transmission is not possible due to its time constant, and control responsiveness cannot be sufficiently improved. Further, a filter using an analog circuit is not preferable because it increases the amount of hardware.
本発明はかかる誤受信の確率をフィルタを用いることな
(低下させようとするものである。The present invention attempts to reduce the probability of such erroneous reception without using a filter.
本発明は、CPUから逐次比較型A/D変換器へ変換開
始指令を出し、該指令を受けた該変換器がアナログ入力
を基準値と逐次比較して所定ビット数のデジタルデータ
に変換し、更に該データをシリアル通信でCPU側のシ
リアル受信レジスタに転送し終るとCPUに対し受信割
込がかかる逐次比較型A/D変換器からのデータ受信方
法において、CPUによる受信割込の受付けを変換開始
指令の送出後一定期間に制限することを特徴とするもの
である。The present invention issues a conversion start command from a CPU to a successive approximation type A/D converter, and upon receiving the command, the converter successively compares an analog input with a reference value and converts it into digital data of a predetermined number of bits. Furthermore, in a method for receiving data from a successive approximation type A/D converter in which a reception interrupt is generated to the CPU when the data is transferred to the serial reception register on the CPU side by serial communication, the reception of reception interrupt by the CPU is converted. This is characterized by being limited to a certain period of time after sending the start command.
CPUによる受信割込の受付けが変換開始指令の送出後
一定期間に制限されていると、他の期間にノイズによっ
てシリアル受信レジスタに誤ったデータが入力して受信
割込の要求が発生してもCPUは受付けないので、ノイ
ズによる誤受信の確率は著しく低下する。しかも、CP
Uが無駄な割込処理をしないので、ノイズの有無によら
ず処理時間を一定に保つことができる。また、フィルタ
等は使用しないのでボーレイトは低下せずに済む。If reception of reception interrupts by the CPU is limited to a certain period after sending the conversion start command, even if incorrect data is input to the serial reception register due to noise and a reception interrupt request occurs during another period, Since the CPU does not accept it, the probability of erroneous reception due to noise is significantly reduced. Moreover, C.P.
Since U does not perform unnecessary interrupt processing, the processing time can be kept constant regardless of the presence or absence of noise. Furthermore, since no filter or the like is used, the baud rate does not decrease.
第1図は本発明の一実施例を示すフローチャートで、第
3図のCPUIの処理の一部を示している。COMP
1は2ms毎に発生する割込ルーチンで、「変換CH上
セツトは第3図のCH選沢信号送出、rAD変換開始」
はADスタート信号送出に相当する。本例では、このA
Dスタート(変換開始指令)と同時にシリアル受信割込
を許可する。第2図はこのタイムチャートである。FIG. 1 is a flowchart showing one embodiment of the present invention, and shows a part of the processing of the CPUI shown in FIG. COMP
1 is an interrupt routine that occurs every 2ms, and "conversion CH upper set sends CH selection signal in Figure 3 and starts rAD conversion"
corresponds to sending an AD start signal. In this example, this A
Enable serial reception interrupt at the same time as D start (conversion start command). FIG. 2 is this time chart.
第4図で示したように変換開始から72μs後に変換デ
ータの送信が完了すると、その時点でシリアル受信割込
が発生する。第1図のシリアル受信割込ルーチンではA
D変換結果に伴う処理をし、その後シリアル受信割込を
禁止する。従って、本(Jiでは割込ルーチンCOMP
1のシリアル受信割込許可からシリアル受信割込ルー
チンのシリアル受信割込禁止までの時間(100μs程
度)が受信割込の許容される時間となり、その他の期間
(2m 5−100μs)は受信割込が禁止される。As shown in FIG. 4, when the transmission of the converted data is completed 72 μs after the start of conversion, a serial reception interrupt occurs at that point. In the serial reception interrupt routine in Figure 1, A
Performs processing associated with the D conversion result, and then disables serial reception interrupts. Therefore, the book (in Ji, the interrupt routine COMP
The time from serial reception interrupt enable in step 1 to serial reception interrupt disable in the serial reception interrupt routine (approximately 100 μs) is the allowable time for reception interrupt, and the other period (2m 5-100 μs) is the time for reception interrupt. is prohibited.
但し、ADC2の故障を考慮してADスタートから20
0μs経ても受信割込が発生しないときは、COMP
2で強制的にシリアル受信割込を禁止し、メインルーチ
ンに影響を与えないよ、うにする。第2図の破線部はこ
れである。この200μsは他の割込によってシリアル
割込ルーチンにとび込むのが遅れることを考慮した長さ
で、それがなりれば72μs+数μsで良い。However, considering the failure of ADC2, 20
If no reception interrupt occurs after 0μs, COMP
Step 2 forcibly disables serial reception interrupts so that they do not affect the main routine. This is the broken line in FIG. This 200 μs is a length that takes into consideration the delay in jumping into the serial interrupt routine due to other interrupts, and if that happens, 72 μs+several μs is enough.
以上述べたように本発明によれば、逐次変換型ADCの
変換データをシリアル通信で受信する際に、受信割込の
許可期間をプログラムで制限したので、ボーレイトを低
下させることなくノイズによる誤受信の確率を低下させ
ることができる。As described above, according to the present invention, when receiving conversion data of a successive conversion type ADC via serial communication, the period of permission for reception interrupts is limited by a program, so that erroneous reception due to noise can be avoided without reducing the baud rate. can reduce the probability of
第1図は本発明の実施例を示すフローチャート、第2図
はその動作説明図、第3図は逐次比較型A/D変換器か
らデータ受信するシステムの構成図、第4図はA/D変
換動作のタイムチャート、第5図はA/D変換データの
説明図である。
図中、1はCPU、2は逐次比較型A/D変換器、3は
シリアルデータライン、4はシリアル受信レジスタであ
る。
出 願 人 富士通テン株式会社
代理人弁理士 青 柳 稔
竿1図
第2図
変換開始
(+1)正常麦信詩
(b)tへうtイ息時
第5図Fig. 1 is a flowchart showing an embodiment of the present invention, Fig. 2 is an explanatory diagram of its operation, Fig. 3 is a block diagram of a system for receiving data from a successive approximation type A/D converter, and Fig. 4 is an A/D converter. A time chart of the conversion operation, FIG. 5 is an explanatory diagram of A/D conversion data. In the figure, 1 is a CPU, 2 is a successive approximation type A/D converter, 3 is a serial data line, and 4 is a serial reception register. Applicant Fujitsu Ten Ltd. Representative Patent Attorney Ao Yanagi Minoru 1 Figure 2 Conversion start (+1) Normal Mugi Shin Poem (b) tHe t I Breathing Figure 5
Claims (1)
し、該指令を受けた該変換器がアナログ入力を基準値と
逐次比較して所定ビット数のデジタルデータに変換し、
更に該データをシリアル通信でCPU側のシリアル受信
レジスタに転送し終るとCPUに対し受信割込がかかる
逐次比較型A/D変換器からのデータ受信方法において
、CPUによる受信割込の受付けを変換開始指令の送出
後一定期間に制限することを特徴とする逐次比較型A/
D変換器からのデータ受信方法。The CPU issues a conversion start command to a successive approximation type A/D converter, and upon receiving the command, the converter successively compares the analog input with a reference value and converts it into digital data of a predetermined number of bits.
Furthermore, in a method for receiving data from a successive approximation type A/D converter in which a reception interrupt is generated to the CPU when the data is transferred to the serial reception register on the CPU side by serial communication, the reception of reception interrupt by the CPU is converted. Successive approximation type A/
How to receive data from a D converter.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP61289678A JPH0664518B2 (en) | 1986-12-04 | 1986-12-04 | Method of receiving data from successive approximation A / D converter |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP61289678A JPH0664518B2 (en) | 1986-12-04 | 1986-12-04 | Method of receiving data from successive approximation A / D converter |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS63142402A true JPS63142402A (en) | 1988-06-14 |
| JPH0664518B2 JPH0664518B2 (en) | 1994-08-22 |
Family
ID=17746326
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP61289678A Expired - Fee Related JPH0664518B2 (en) | 1986-12-04 | 1986-12-04 | Method of receiving data from successive approximation A / D converter |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0664518B2 (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2009079769A (en) * | 2008-11-15 | 2009-04-16 | Toshiba Mach Co Ltd | Hydraulic control device |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS5755437A (en) * | 1980-09-19 | 1982-04-02 | Canon Inc | Interrupting signal detector |
-
1986
- 1986-12-04 JP JP61289678A patent/JPH0664518B2/en not_active Expired - Fee Related
Patent Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPS5755437A (en) * | 1980-09-19 | 1982-04-02 | Canon Inc | Interrupting signal detector |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2009079769A (en) * | 2008-11-15 | 2009-04-16 | Toshiba Mach Co Ltd | Hydraulic control device |
Also Published As
| Publication number | Publication date |
|---|---|
| JPH0664518B2 (en) | 1994-08-22 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CA1287905C (en) | Method and apparatus for detecting a rate of data transmission | |
| JP2641999B2 (en) | Data format detection circuit | |
| US4620179A (en) | Method for successive approximation A/D conversion | |
| US6366610B1 (en) | Autobauding with adjustment to a programmable baud rate | |
| JPS6340080B2 (en) | ||
| US6170027B1 (en) | LPC/ISA bridge and its bridging method | |
| JPS63142402A (en) | Method for data reception from successive comparison type a/d converter | |
| US5229770A (en) | Analog/digital converter with advanced conversion termination notice | |
| JPS63142723A (en) | Method for receiving data from successive comparison type a/d converter | |
| US5003540A (en) | Error correction coding and decoding circuit for digitally coded information | |
| US6088400A (en) | Receiving device for synchronous serial transmission data | |
| JPH03272224A (en) | Information signal processing method | |
| JP2664239B2 (en) | Parallel / serial data converter | |
| KR100191724B1 (en) | Data receiver | |
| RU2220502C2 (en) | Serial-binary-to-parallel-serial code converter | |
| JP2865117B2 (en) | A / D conversion circuit | |
| JPH0332138A (en) | Interface controller | |
| JPS5977745A (en) | Transmission control system | |
| KR880000162B1 (en) | Programmable multi-frequency tone receiver | |
| JPS60193061A (en) | Data transmission method | |
| JPH07129485A (en) | Serial transmitting device | |
| JPH0528930B2 (en) | ||
| JPH04364623A (en) | Communication speed detection method in start-stop synchronization communication system | |
| JPH0312494B2 (en) | ||
| JPS63166331A (en) | Output system for ad converter |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| LAPS | Cancellation because of no payment of annual fees |