JPH0664518B2 - Method of receiving data from successive approximation A / D converter - Google Patents
Method of receiving data from successive approximation A / D converterInfo
- Publication number
- JPH0664518B2 JPH0664518B2 JP61289678A JP28967886A JPH0664518B2 JP H0664518 B2 JPH0664518 B2 JP H0664518B2 JP 61289678 A JP61289678 A JP 61289678A JP 28967886 A JP28967886 A JP 28967886A JP H0664518 B2 JPH0664518 B2 JP H0664518B2
- Authority
- JP
- Japan
- Prior art keywords
- converter
- data
- reception interrupt
- successive approximation
- 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 - Fee Related
Links
- 238000000034 method Methods 0.000 title claims description 5
- 238000006243 chemical reaction Methods 0.000 claims description 26
- 238000004891 communication Methods 0.000 claims description 3
- 101150042711 adc2 gene Proteins 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 3
- 230000008054 signal transmission Effects 0.000 description 2
- 238000002485 combustion reaction Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000009191 jumping Effects 0.000 description 1
- 230000001681 protective effect Effects 0.000 description 1
Landscapes
- Safety Devices In Control Systems (AREA)
Description
【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、逐次比較型A/D変換器の変換データをシリ
アル受信割込み受信するデータ受信方法に関する。TECHNICAL FIELD The present invention relates to a data receiving method for receiving serial reception interrupt of conversion data of a successive approximation A / D converter.
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 A / D converter (hereinafter abbreviated as ADC) that receives the command outputs the conversion data serially, the serial reception register on the CPU side has a predetermined number of bits. CPU when conversion data is captured
Serial interrupt occurs on. 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に保持し、該当するアナログ入力(CH
0〜CH7の1つ)をマルチプレクサ22で選択する。逐次比
較レジスタ(SAR)23はADスタート信号を受けると、先
ず最大基準電圧REFの1/2をD/A変換器(DAC)24に
与え、そのアナログ変換値を比較器25でアナログ入力と
比較させる。そして、マルチプレクサ22を通して該当す
るチャネルの比較結果(大小に応じて1,0となる)がSAR
23に入力されると、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 (CH
0 to one of 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, and the analog conversion value is compared with the analog input by the comparator 25. Let Then, through the multiplexer 22, the comparison result (1,0 depending on the size) of the corresponding channel is the SAR.
When input to 23, SAR23 gives the next comparison value 2 -2 REF to DAC 24, and then 2 -3 REF, 2 -4 REF, ...
And change the comparison value. Then, when the comparison result for the final comparison value 2 -8 REF is obtained, 8 for 2 -1 REF to 2 -8 REF is obtained.
A start bit and a stop bit are added to the bit A / D converted data, which are serially transmitted from the shift register 26 to the data line 3 and transferred to the 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スタート信号の立上
りから一定時間(=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 (= 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 the electronic control device for controlling the internal combustion engine, as the control content becomes more complicated, a demand for higher speed A / D conversion is generated, 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 of receiving erroneous data. For example, as shown in FIG. 5 (b), noise (especially ignition noise) is mixed in the data line 3 and A / D
When the level of the data line 3 temporarily changes even when the converted data is not transmitted, this is read as a start bit, and as a result, 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-apple the data line 3 so that the output does not change when it does not receive the AD start signal. And from the viewpoint that the conversion data will not be sent unless the CPU1 also issues an AD start,
It is always ready to receive reception interrupts. 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, 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変換器からのデータ受信方法にお
いて、前記開始指令出力時前記受信割込を許可するステ
ップと、該受信割込による処理の終了時に前記受信割込
を禁止するステップと、前記変換開始指令出力後所定時
間経過したときに前記受信割込を禁止するステップを設
け、CPUによる受信割込の受付けを変換開始指令の送出
後一定期間に制限することを特徴とするもである。According to the present invention, 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 having a predetermined number of bits, Further, in the data receiving method from the successive approximation type A / D converter in which the CPU receives a reception interrupt when the data is transferred to the serial reception register on the CPU side by serial communication, the reception interrupt at the time of outputting the start command Is provided, a step of prohibiting the reception interrupt at the end of the processing by the reception interrupt, and a step of prohibiting the reception interrupt when a predetermined time has elapsed after the conversion start command is output. It is also characterized in that the reception of the reception interrupt is limited to a certain period after the conversion start command is transmitted.
CPUによる受信割込の受付けが変換開始指令の送出後一
定期間に制限されていると、他の期間にノイズによって
シリアル受信レジスタに誤ったデータが入力して受信割
込の要求が発生してもCPUは受付けないので、ノイズに
よる誤受信の確率は著しく低下する。しかも、CPUが無
駄な割込処理をしないので、ノイズの有無によらず処理
時間を一定に保つことができる。また、フィルタ等は使
用しないのでボーレイトは低下せずに済む。If the reception interrupt reception by the CPU is limited to a certain period after the conversion start command is sent, even if incorrect data is input to the serial reception register due to noise during other periods, a reception interrupt request is generated. Since the CPU does not accept, the probability of false reception due to noise is significantly reduced. Moreover, since the CPU does not perform unnecessary interrupt processing, the processing time can be kept constant regardless of the presence or absence of noise. Moreover, since no filter is used, the baud rate does not decrease.
第1図は本発明の一実施例をフローチャートで、第3図
のCPU1の処理の一部を示している。COMP1は2ms毎に発生
する割込ルーチンで、「変換CHセット」は第3図のCH選
択信号送出、「AD変換開始」はADスタート信号送出に相
当する。本例では、このADスタート(変換開始指令)と
同時にシリアル受信割込を許可する。第2図はこのタイ
ムチャートである。FIG. 1 is a flowchart 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 2 ms. "Conversion CH set" corresponds to CH selection signal transmission in FIG. 3, and "AD conversion start" corresponds to AD start signal transmission. In this example, the serial reception interrupt is permitted at the same time as this AD start (conversion start command). FIG. 2 is this time chart.
第4図で示したように変換開始から72μs後に変換デー
タの送信が完了すると、その時点でシリアル受信割込が
発生する。第1図のシリアル受信割込ルーチンではAD変
換結果に伴う処理をし、その後シリアル受信割込を禁止
する。従って、本例では割込ルーチンCOMP1のシリアル
受信割込許可からシリアル受信割込ルーチンのシリアル
受信割込禁止までの時間(100μs程度)が受信割込の
許容される時間となり、その他の期間(2ms−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 time. In the serial reception interrupt routine of FIG. 1, processing is performed according to the AD conversion result, and then the serial reception interrupt is prohibited. Therefore, in this example, the time from the serial reception interrupt permission of the interrupt routine COMP1 to the serial reception interrupt prohibition of the serial reception interrupt routine (about 100 μs) is the time allowed for the reception interrupt, and the other period (2 ms -100μs)
Is prohibited from receiving interrupts.
但し、ADC2の故障を考慮してADスタートから200μs経
ても受信割込が発生しないときは、COMP2で強制的にシ
リアル受信割込を禁止し、メインルーチンに影響を与え
ないようにする。第2図の破線部はこれである。この20
0μsは他の割込によってシリアル割込ルーチンにとび
込むのが遅れることを考慮した長さで、それがなければ
72μs+数μsで良い。However, if a reception interrupt does not occur within 200 μs after AD start considering the failure of ADC2, the serial reception interrupt is forcibly prohibited by COMP2 so that the main routine is not affected. This is the broken line part in FIG. This 20
0 μs is a length that takes into account the delay in jumping to the serial interrupt routine due to another interrupt, and if it is not present,
72 μs + several μs is sufficient.
以上述べたように本発明によれば、逐次変換型ADCの変
換データをシリアル通信で受信する際に、受信割込の許
可期間をプログラムで制限したので、ボーレイトを低下
させることなくノイズによる誤受信の確率を低下させる
ことができ、誤まったA/D変換データが使用されるこ
とがなくなる。As described above, according to the present invention, when the conversion data of the successive-approximation-type ADC is received by serial communication, the reception interrupt permission period is limited by the program, so that erroneous reception due to noise can be achieved without reducing the baud rate. Can be reduced, and erroneous A / D conversion data will not be used.
【図面の簡単な説明】 第1図は本発明の実施例を示すフローチャート、第2図
はその動作説明図、第3図は逐次比較型A/D変換器か
らデータ受信するシステムの構成図、第4図はA/D変
換動作のタイムチャート、第5図はA/D変換データの
説明図である。 図中、1はCPU、2は逐次比較型A/D変換器、3はシ
リアルデータライン、4はシリアル受信レジスタであ
る。BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a flow chart showing an embodiment of the present invention, FIG. 2 is an operation explanatory diagram thereof, and FIG. 3 is a configuration diagram of a system for receiving data from a successive approximation A / D converter, FIG. 4 is a time chart of A / D 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変換器からのデータ受信方法にお
いて、 前記開始指令出力時前記受信割込を許可するステップ
と、該受信割込による処理の終了時に前記受信割込を禁
止するステップと、前記変換開始指令出力後所定時間経
過したとき前記受信割込を禁止するステップを設け、 CPUによる受信割込の受付けを変換開始指令の送出後一
定期間に制限することを特徴とする逐次比較型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. Further, in the data receiving method 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, the reception interrupt at the time of outputting the start command Is provided, a step of prohibiting the reception interrupt at the end of the processing by the reception interrupt, and a step of prohibiting the reception interrupt when a predetermined time has elapsed after the conversion start command is output, A method for receiving data from a successive approximation A / D converter, characterized in that acceptance of an interrupt is limited to a certain period after sending a conversion start command.
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 JPS63142402A (en) | 1988-06-14 |
JPH0664518B2 true 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) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4875687B2 (en) * | 2008-11-15 | 2012-02-15 | 東芝機械株式会社 | Hydraulic control device |
Family Cites Families (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
Also Published As
Publication number | Publication date |
---|---|
JPS63142402A (en) | 1988-06-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP0281307B1 (en) | Asynchronous interface and method for coupling data between a data module and a serial asynchronous peripheral | |
US4408272A (en) | Data control circuit | |
JP2851879B2 (en) | Data communication device | |
JP3791139B2 (en) | Vehicle control device | |
US6163586A (en) | Autobaud/autoecho method | |
EP0260889B1 (en) | Full-duplex modem | |
JPH0664518B2 (en) | Method of receiving data from successive approximation A / D converter | |
JPH0712148B2 (en) | Method of receiving data from successive approximation A / D converter | |
US5229770A (en) | Analog/digital converter with advanced conversion termination notice | |
JPH0591146A (en) | Serial data transfer device | |
JPS62141875A (en) | Decoding error propagation prevention method | |
CN115657567B (en) | Method and control system for transmitting control signal by single pin | |
JP2664239B2 (en) | Parallel / serial data converter | |
JP3123998B2 (en) | Single-chip microcomputer with built-in A / D conversion function | |
JPS63164639A (en) | Serial data transmission method | |
JPS6347294B2 (en) | ||
JPH0570169B2 (en) | ||
JPH0447503B2 (en) | ||
CN117614592A (en) | Data transmission method, device, electronic equipment and storage medium | |
JPS62269539A (en) | Communication controller | |
KR100585900B1 (en) | Communication interface circuit and controlling method thereof, and microcomputer | |
JPS58165433A (en) | Conveyance control method using phase pulse signals | |
JPH0470947A (en) | Signal processing circuit | |
JPH08153060A (en) | Picture data processor | |
JP2003179587A (en) | Data input equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
LAPS | Cancellation because of no payment of annual fees |