JPH0712148B2 - Method of receiving data from successive approximation A / D converter - Google Patents
Method of receiving data from successive approximation A / D converterInfo
- Publication number
- JPH0712148B2 JPH0712148B2 JP61289679A JP28967986A JPH0712148B2 JP H0712148 B2 JPH0712148 B2 JP H0712148B2 JP 61289679 A JP61289679 A JP 61289679A JP 28967986 A JP28967986 A JP 28967986A JP H0712148 B2 JPH0712148 B2 JP H0712148B2
- Authority
- JP
- Japan
- Prior art keywords
- data
- converter
- successive approximation
- conversion
- cpu
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Lifetime
Links
- 238000000034 method Methods 0.000 title claims description 8
- 238000006243 chemical reaction Methods 0.000 claims description 27
- 238000004891 communication Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 4
- 101150042711 adc2 gene Proteins 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 238000002485 combustion reaction Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000007257 malfunction Effects 0.000 description 1
- 230000001681 protective effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
Landscapes
- Communication Control (AREA)
- Analogue/Digital Conversion (AREA)
Description
【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、逐次比較型A/D変換器の変換データをシリア
ル受信割込みで受信するデータ受信方法に関する。The present invention relates to a data receiving method for receiving conversion data of a successive approximation A / D converter by a serial reception interrupt.
CPUからA/D変換開始の指令を出し、これを受けた逐次比
較型のA/D変換器(以下ADCと略す)が変換データをシリ
アルに出力すると、CPU側のシリアル受信レジスタに所
定ビット数の変換データが取込まれた段階でCPUにシリ
アル割込みがかかる。CPUはこの割込みを持って変換デ
ータを取込み、1回のA/D変換を完了する。When the A / D conversion start command is issued from the CPU and the successive approximation type A / D converter (hereinafter abbreviated as ADC) that receives the command outputs the conversion data serially, a predetermined number of bits is output to the serial reception register on the CPU side. Serial interrupt is applied to the CPU when the conversion data of is acquired. The CPU takes in the conversion data with this interrupt and completes one A / D conversion.
第3図はこの種のシステムの構成図で、1はCPU、2は
逐次比較型ADC、3はシリアルデータライン、4はシリ
アル受信レジスタである。CPU1からADC2へはアナログ入
力のCH(チャネル)選択信号、ADスタート信号、クロッ
ク信号が出力される。ADC2は3ビットのCH選択信号をア
ドレスラッチ21に保持し、該当するアナログ入力(CH0
〜CH7の1つ)をマルチプレクサ22で選択する。逐次比
較レジスタ(SAR)23はADスタート信号を受けると、先
ず最大基準電圧REFの1/2をD/A変換器(DAC)24に与え、
そのアナログ変換値を比較器25でアナログ入力と比較さ
せる。そして、マルチプレクサ22を通して該当するチャ
ネルの比較結果(大小に応じて1,0となる)がSAR23に入
力されると、SAR23は次の比較値2-2REFをDAC24に与え、
以下クロックが入力する毎に2-3REF,2-4REF,……と比較
値を変更する。そして、最後の比較値2-8REFに対する比
較結果が得られたら、2-1REF〜2-8REFに対する8ビット
のA/D変換データにスタートビットとストップビットを
加えてシフトレジスタ26からデータライン3にシリアル
に送出し、CPU側のシリアル受信レジスタ4へ転送す
る。FIG. 3 is a block diagram of this type of system, in which 1 is a CPU, 2 is a successive approximation ADC, 3 is a serial data line, and 4 is a serial reception register. An analog input CH (channel) selection signal, an AD start signal, and a clock signal are output from the CPU1 to the ADC2. The ADC2 holds the 3-bit CH selection signal in the address latch 21, and the corresponding analog input (CH0
~ CH7) is selected by the multiplexer 22. When the successive approximation register (SAR) 23 receives the AD start signal, it first applies 1/2 of the maximum reference voltage REF to the D / A converter (DAC) 24,
The analog conversion value is compared with the analog input by the comparator 25. Then, when the comparison result (1,0 depending on the size) of the corresponding channel is input to the SAR23 through the multiplexer 22, the SAR23 gives the next comparison value 2 -2 REF to the DAC24,
The following 2 -3 whenever the clock is input REF, 2 -4 REF, to change the comparison value with .... Then, when the comparison result for the final comparison value 2 -8 REF is obtained, the start bit and the stop bit are added to the 8-bit A / D conversion data for 2 -1 REF to 2 -8 REF to add the data from the shift register 26. It is sent serially to line 3 and transferred to serial reception register 4 on the CPU side.
第4図はクロック周波数を250KHzとしてアナログ入力を
8ビットにAD変換する場合のタイムチャートである。1
クロック周期は4μsであるので8ビットのAD変換には
8×4μs=32μs要し、またデータ送信にはスター
ト、ストップの各1ビットを付加するため(8+2)×
4μs=40μs要す。従って、ADスタート信号の立ち上
りから一定時間T(=72μs)後にCPU1に受信割込みが
かかる。FIG. 4 is a time chart when an analog input is AD-converted into 8 bits with a clock frequency of 250 KHz. 1
Since the clock cycle is 4 μs, 8 × 4 μs = 32 μs is required for 8-bit AD conversion, and (8 + 2) × to add 1 bit for each of start and stop for data transmission.
4 μs = 40 μs is required. Therefore, after a certain time T (= 72 μs) from the rise of the AD start signal, the CPU 1 receives a reception interrupt.
第5図(a)はクロックとシリアル転送データの関係を
示しており、この例ではシリアル受信レジスタ4はクロ
ックの立下りでデータを取込むことができる。FIG. 5A shows the relationship between the clock and the serial transfer data. In this example, the serial reception register 4 can take in the data at the falling edge of the clock.
ところで、内燃機関を制御する電子制御装置では、制御
内容が複雑になるにつれてA/D変換の高速化の要求が生
じ、上述した様な逐次比較型のADCを用いるケースが増
えている。しかしながら、第3図で説明した様なシリア
ル受信はノイズに弱いため誤つたデータを受信する可能
性が強い。例えば、第5図(b)に示すようにデータラ
イン3にノイズ(特に点火ノイズ)が混入してA/D変換
データの送出時でもないのに一時的にデータライン3の
レベルが変化すると、これがスタートビットとして読取
られる結果、ノイズによる誤ったデータが受信される。By the way, in an electronic control device for controlling an internal combustion engine, there is a demand for higher speed A / D conversion as the control content becomes more complicated, and the number of cases in which the successive approximation type ADC as described above is used is increasing. However, since serial reception as described with reference to FIG. 3 is vulnerable to noise, there is a strong possibility that incorrect data will be received. For example, as shown in FIG. 5 (b), when noise (especially ignition noise) is mixed in the data line 3 and the level of the data line 3 temporarily changes even when the A / D conversion data is not transmitted, As a result of being read as the start bit, erroneous data due to noise is received.
一般にADC2側ではADスタート信号を受けないときに出力
が変化しないようにデータライン3をプルアップする保
護措置を講じている。そして、CPU1もADスタートを出さ
なければ変換データは送られて来ないとの観点から、常
に受信割込を受付け得る状態にしている。このため第5
図(b)のようなケースではオール1が誤受信される。In general, the ADC2 side takes a protective measure to pull up the data line 3 so that the output does not change when the AD start signal is not received. From the viewpoint that the conversion data will not be sent unless the CPU 1 also issues AD start, it is always ready to accept the reception interrupt. Therefore, the fifth
In the case shown in FIG. 6B, 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, if a filter is used, high-speed transmission cannot be performed due to its time constant, and there is a drawback that the control response cannot be sufficiently improved. Further, a filter using an analog circuit is not preferable because it increases the amount of hardware.
本発明はかかる誤受信の確率をフィルタを用いることな
く低下させようとするものである。The present invention seeks to reduce the probability of such erroneous reception without using a filter.
〔問題点を解決するための手段〕 本発明は、CPUから逐次比較型A/D変換器へ変換開始指令
を出し、該指令を受けた該変換器がアナログ入力を基準
値と逐次比較して所定ビット数のデジタルデータに変換
し、更に該データをシリアル通信でCPU側のシリアル受
信レジスタに転送し終るとCPUに対し受信割込がかかる
逐次比較型A/D変換器からのデータ受信方法において、
前記変換開始指令の送出後一定期間内に発生した受信割
込で得られたデータだけを正常データとして扱うことを
特徴とするものである。[Means for Solving Problems] The present invention outputs a conversion start command from a CPU to a successive approximation A / D converter, and the converter receiving the command sequentially compares an analog input with a reference value. A method of receiving data from a successive approximation A / D converter that converts a digital data of a predetermined number of bits, and then transfers the data by serial communication to the serial reception register on the CPU side, which causes a reception interrupt to the CPU. ,
It is characterized in that only the data obtained by the reception interrupt generated within a certain period after the conversion start command is transmitted is treated as normal data.
受信割込によって得られたデータのうち変換開始指令の
送出後一定期間内の受信割込によるデータだけを正常な
ものとして扱うと、他の期間にノイズによって受信割込
が発生してもそのデータは無視できるので、ノイズによ
る異常データで誤動作する確率は著しく低下する。この
方法は受信割込そのものを禁止しないので、ノイズが多
発すると処理時間は長くなるが、ノイズ対策の処理とし
ては簡単(時間管理の別処理が不要)であるので、プロ
グラムの追加で使用するメモリ領域が少なくて済む利点
がある。しかも、フィルタ等は使用しないのでボーレイ
トの低下は避けることができる。If only the data generated by the reception interrupt within a certain period after the conversion start command is sent out of the data obtained by the reception interrupt is treated as normal, even if the reception interrupt occurs due to noise in other periods, that data Is negligible, the probability of malfunction due to abnormal data due to noise is significantly reduced. Since this method does not prohibit the reception interrupt itself, the processing time will be long if there is a lot of noise, but since it is simple as a noise countermeasure process (no separate processing for time management is required), the memory used by adding a program There is an advantage that the area is small. Moreover, since a filter or the like is not used, a decrease in baud rate can be avoided.
第1図は本発明の一実施例を示すフローチャートで、第
3図のCPU1の処理の一部を示している。COMP1は2ms毎に
発生する割込ルーチンで、「変換CHセット」は第3図の
CH選択信号送出、「AD変換開始」はADスタート信号送出
に相当する。本例では、このADスタート(変換開始指
令)から72μs経過前および200μs経過後の受信割込
によるデータを無視し、その間の受信割込によるデータ
を正常とする。第2図はこのタイムチャートである。FIG. 1 is a flow chart showing an embodiment of the present invention and shows a part of the processing of the CPU 1 in FIG. COMP1 is an interrupt routine that occurs every 2ms. "Conversion CH set" is shown in Fig. 3.
Sending a CH selection signal, "AD conversion start" corresponds to sending an AD start signal. In this example, the data due to the reception interrupt before 72 μs and after the passage of 200 μs from this AD start (conversion start command) is ignored, and the data due to the reception interrupt during that period is made normal. FIG. 2 is this time chart.
第4図で示したように変換開始から72μs後に変換デー
タの送信が完了すると、その時点でシリアル受信割込が
発生する。第1図のシリアル受信割込ルーチンではAD変
換結果に伴う処理をする前にその割込発生がADスタート
後72μs経過後、200μs経過前であるか判断し、イエ
ス(Y)であれば該処理をし、ノー(N)であればその
処理をしない。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 time. In the serial reception interrupt routine shown in FIG. 1, it is judged whether the interrupt has occurred 72 μs after AD start and 200 μs before AD conversion result processing, and if yes (Y), the processing is executed. If no (N), the process is not performed.
以上述べたように本発明によれば、逐次変換型ADCの変
換データをシリアル通信で受信する際に、受信割込によ
り得られるデータの正異常をA/D変換開始時点を基準に
した時間帯によって区別するようにしたので、ボーレイ
トを低下させることなくノイズによる誤受信の確率を低
下させることができる。As described above, according to the present invention, when the conversion data of the successive conversion type ADC is received by serial communication, the normality of the data obtained by the reception interrupt is a time zone based on the A / D conversion start time point. Since the distinction is made by the above, the probability of erroneous reception due to noise can be reduced without reducing the baud rate.
第1図は本発明の実施例を示すフローチャート、第2図
はその動作説明図、第3図は逐次比較型A/D変換器から
データ受信するシステムの構成図、第4図はA/D変換動
作のタイムチャート、第5図はA/D変換データの説明図
である。 図中、1はCPU、2は逐次比較型A/D変換器、3はシリア
ルデータライン、4はシリアル受信レジスタである。FIG. 1 is a flow chart showing an embodiment of the present invention, FIG. 2 is an operation explanatory diagram thereof, FIG. 3 is a block diagram of a system for receiving data from a successive approximation A / D converter, and FIG. 4 is an A / D. A time chart of the conversion operation, and FIG. 5 is an explanatory diagram of A / D conversion data. In the figure, 1 is a CPU, 2 is a successive approximation A / D converter, 3 is a serial data line, and 4 is a serial reception register.
Claims (1)
令を出し、該指令を受けた該変換器がアナログ入力を基
準値と逐次比較して所定ビット数のデジタルデータに変
換し、更に該データをシリアル通信でCPU側のシリアル
受信レジスタに転送し終るとCPUに対し受信割込がかか
る逐次比較型A/D変換器からのデータ受信方法におい
て、 前記変換開始指令の送出後一定期間内に発生した受信割
込で得られたデータだけを正常データとして扱うことを
特徴とする逐次比較型A/D変換器からのデータ受信方
法。1. A conversion start command is issued from a CPU to a successive approximation A / D converter, and the converter which receives the command sequentially compares an analog input with a reference value and converts the analog input into digital data of a predetermined number of bits. In the method of receiving data from the successive approximation type A / D converter in which a reception interrupt is given to the CPU when the data is further transferred to the serial reception register on the CPU side by serial communication, after the conversion start command is transmitted, a constant value is obtained. A method of receiving data from a successive approximation type A / D converter characterized in that only the data obtained by the reception interrupt that occurred within the period is treated as normal data.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP61289679A JPH0712148B2 (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 |
|---|---|---|---|
| JP61289679A JPH0712148B2 (en) | 1986-12-04 | 1986-12-04 | Method of receiving data from successive approximation A / D converter |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS63142723A JPS63142723A (en) | 1988-06-15 |
| JPH0712148B2 true JPH0712148B2 (en) | 1995-02-08 |
Family
ID=17746340
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP61289679A Expired - Lifetime JPH0712148B2 (en) | 1986-12-04 | 1986-12-04 | Method of receiving data from successive approximation A / D converter |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0712148B2 (en) |
-
1986
- 1986-12-04 JP JP61289679A patent/JPH0712148B2/en not_active Expired - Lifetime
Also Published As
| Publication number | Publication date |
|---|---|
| JPS63142723A (en) | 1988-06-15 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CA1287905C (en) | Method and apparatus for detecting a rate of data transmission | |
| US4620179A (en) | Method for successive approximation A/D conversion | |
| US4408272A (en) | Data control circuit | |
| JP2851879B2 (en) | Data communication device | |
| US5991686A (en) | Vehicle electronic control using one A/D converter for time-synchronous and time-asynchronous A/D converter | |
| JPH0624356B2 (en) | Data transfer method | |
| US5125089A (en) | Asynchronous-to-synchronous parallel word transfer circuit for preventing incoming asyncronous parallel byte data from interfering with outgoing synchronous data | |
| JPH0712148B2 (en) | Method of receiving data from successive approximation A / D converter | |
| JPH0664518B2 (en) | Method of receiving data from successive approximation A / D converter | |
| EP0111251B1 (en) | Data transmission system | |
| US5229770A (en) | Analog/digital converter with advanced conversion termination notice | |
| US4977559A (en) | Improper bit combination detection circuit | |
| US5778201A (en) | Clock and counter for bit cell determination and timeout timing for serial data signaling on an apple desktop bus | |
| JP3249710B2 (en) | Analog / digital converter | |
| US5095481A (en) | Technique for active synchronization of the content induced transaction overlap (CITO) communication channel | |
| JP2664239B2 (en) | Parallel / serial data converter | |
| US6944560B2 (en) | Method for eliminating noise signals in radio signal receiving devices | |
| JPS6347294B2 (en) | ||
| JPS63164639A (en) | Serial data transmission method | |
| JPH0342559Y2 (en) | ||
| JP2865117B2 (en) | A / D conversion circuit | |
| JP4665744B2 (en) | A / D converter and A / D conversion system | |
| JPH0447503B2 (en) | ||
| JPH0628312A (en) | Serial data transfer method | |
| JPS62171248A (en) | Line speed detection system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| EXPY | Cancellation because of completion of term |