【正文】
s aperture (., shutter) is open. During this time, the input voltage being measured changes by dV, where V is given by:ta?dV/dtThe value of dV/dt is the slope of the graph. The change in the input, V, is called the amplitude uncertainty. A perfect, instantaneous digitizer has a zero aperture time and d V = 0, resulting in a spotsample of the input.Sampling a Timevarying SignalIntuitively, we would expect the rate at which a signal must be sampled to be closely related to the rate at which it is changing. For example, a puter controlling the temperature of a swimming pool might need to sample the temperature of the water no more than once every ten minutes. The thermal inertia of such a large body of water doesn’t permit sudden changes in temperature. Similarly, if a microputer is employed to analyze human speech with an upper frequency limit of 3,000 Hz, it is reasonable to expect that the input from a microphone must be sampled at a much greater rate than 3,000 times a second, simply because in the space of 1/3,000 second the signal can execute a plete sine wave.Fortunately for the designer of signal acquisition systems, a simple relationship exists between the rate at which a signal changes and the rate at which it must be sampled if it is to be reconstituted from the samples without any loss of information content. The so called Sampling Theorem states: 39。mV. Table 1 gives the basic characteristics of ADCs with digital outputs ranging from 4 to 16 bits.The column labeled value of Q for 10 V FS in table indicates the size of the step (., Q) if the maximum output of the ADC is 10 V. The abbreviation FS means fullscale.Figure 4 provides a graph of the difference or error between the analog input of a 3bit ADC and its digital output. Suppose that the analog input is V. The corresponding digital output is 110 which represents V。 for example, if the signal from the transducer contains useful frequency ponents only in the range 0 to 20 Hz (as one might expect from, say, an electrocardiogram), it is beneficial to filter out all signals of a higher frequency. These out of band signals represent unwanted noise and have no useful effect on the interpretation of the electrocardiogram. Moreover, it is necessary for the filter to cut out all frequencies above one half the rate at which the analog signal is sampled. The reasons for this are explained later.The outputs of the filters are fed to an electronic switch called a multiplexer that selects one of the analog input channels for processing. The multiplexer is controlled by the digital system to which the signal acquisition module is connected. The only purpose of the multiplexer is to allow one analogtodigital converter to be connected to several inputs.The analog output of the multiplexer is applied to the input of the last analog circuit in the acquisition module, the sample and hold (S/H) circuit. The sample and hold circuit takes an almost instantaneous sample of the ining analog signal and holds it constant while the analogtodigital converter, ADC, is busy determining the digital value of the signal. If the input signal is changing rapidly, the output of an ADC (which takes an appreciable time to perform its conversion) would be meaningless without a S/H circuit to staticize the input.The analogtodigital converter (DAC) transforms the voltage at its input into an mbit digital value, where m varies from typically 4 to 16 or more. Several types of analogtodigital converter are discussed at the end of this section.Analog signals are processed by analog circuits. The principal feature of an analog circuit is its ability to process an analog signal faithfully, without distorting it—hence the expression hifidelity. A typical analog signal is produced at the output terminals of a microphone as someone speaks into it. The voltage varies continuously over some finite range, depending only on the loudness of the speech and on the physical characteristics of the microphone. An amplifier may be used to increase the amplitude of this timevarying signal to a level suitable for driving a loudspeaker. If the voltage gain of the amplifier is A, and the voltage from the microphone V(t), the output of the amplifier is equal to A?V(t). The output signal from the amplifier, like the input, has an infinite range of values, but within a range A times that of the signal from the microphone.在畢業(yè)設(shè)計(jì)完成之際,我首先向我的指導(dǎo)老師鄧?yán)蠋熤乱陨钋械闹x意。采用多次采集方式,并同國外相關(guān)采集系統(tǒng)進(jìn)行比較,提高采集精度。 展望總結(jié)本文的工作,基于單片機(jī)的數(shù)據(jù)采集系統(tǒng)與傳統(tǒng)數(shù)據(jù)采集系統(tǒng)相比,具有分布廣泛、采集迅速、顯示直觀、操作簡(jiǎn)便、價(jià)格低廉等優(yōu)勢(shì),但在數(shù)據(jù)傳輸范圍及采集精度上仍存在不足。 系統(tǒng)精度最后做出的系統(tǒng)性能為:(1) 采集數(shù)據(jù)精度92%,0V準(zhǔn)確;(2) 串口發(fā)送給PC機(jī)有點(diǎn)雜波,但還比較準(zhǔn)確;(3) 采樣間隔100MS左右;(4) PC機(jī)軟件十進(jìn)制顯示采集的數(shù)據(jù),提供處理;4 結(jié)論與展望 結(jié)論本文構(gòu)建了一套基于單片機(jī)的數(shù)據(jù)采集系統(tǒng),主要研究結(jié)論可概括如下:(1)基于單片機(jī)的數(shù)據(jù)采集思想,使用Protel 99SE和Keil C51實(shí)現(xiàn)原理圖繪制與軟件編譯,具有實(shí)用性。程序見附錄。 SBUF=0x33。 TH1=0xfd。測(cè)試通過后,接著做第4步測(cè)試。i=100。}。b2=0。i=100。while(1){P0=0X66。sbit b2=P3^3。通過這一步測(cè)試,通過之后接著做下面的測(cè)試。//讀取編輯框內(nèi)容(COleVariant(m_strTXData))。Maps,選擇類CGc1Dlg,選擇IDC_BUTTON_MANUALSEND,雙擊BN_CLICKED添加OnButtonManualsend()函數(shù),并在函數(shù)中添加如下代碼:void //設(shè)置當(dāng)前接收區(qū)數(shù)據(jù)長(zhǎng)度為0()。(9600,n,8,1)。CGc1Dlg::OnButton1()打開串口,加入如下代碼:if(())(FALSE)。UpdateData(FALSE)。} //清空接收緩沖區(qū)if (strtemp==ffffff89) m_strRXData+=9。 if (strtemp==ffffff85) m_strRXData+=5。if (strtemp==ffffff81) m_strRXData+=1。chark++)(amp。k++)len=()。//VARIANT型變量轉(zhuǎn)換為ColeSafeArray型變量variant_inp=()。if(()==2)is//設(shè)置BYTElen,k。variant_inp。這個(gè)函數(shù)是用來處理串口消息事件的,如每當(dāng)串口接收到數(shù)據(jù),就會(huì)產(chǎn)生一個(gè)串口接收數(shù)據(jù)緩沖區(qū)中有字符的消息事件,我們剛才添加的函數(shù)就會(huì)執(zhí)行,我們?cè)贠nComm()函數(shù)加入相應(yīng)的處理代碼就能實(shí)現(xiàn)自已想要的功能了。()再打開ClassWizard-MemberViariables選項(xiàng)卡,選擇CGc1Dlg類,為IDC_MSCOMM1添加控制變量:m_ctrlComm,這時(shí)你可以看一看,在對(duì)話框頭文件中自動(dòng)加入了//{{AFX_INCLUDES()這時(shí)在ClassView視窗中就可以看到CMSComm類了,并且在控件工具欄Controls中出現(xiàn)了電話圖標(biāo)現(xiàn)在要做的是用鼠標(biāo)將此圖標(biāo)拖到對(duì)話框中,程序運(yùn)行后,這個(gè)圖標(biāo)是看不到的。CommunicationsActiveXProject子菜單中的這里采用靜態(tài)顯示原理,掃描顯示。使用定時(shí)器1 作波特率發(fā)生器當(dāng)定時(shí)器1 用作波特率發(fā)生器模式1 和3 中波特率由定時(shí)器1 的溢出速率和SMOD1 的值決定。兩者都滿足時(shí),停止位就進(jìn)入RB88, 位數(shù)據(jù)進(jìn)入SBUF,RI=1。當(dāng)數(shù)據(jù)位逐一由右邊移入時(shí),1從左邊被移出。在第9狀態(tài)時(shí),位檢測(cè)器