文檔介紹:
計算機組成原理學****使用-AD轉換器及整數(shù)運算章亦葵天津大學軟件學院Analog-to-digitalconverter(AD轉換器)(ADC,A/D,orAtoD)Resolution:Q=Vref/2M?1LSB=QPopularADCtype:essive-approximationADC(逐次逼近模擬數(shù)字轉換器)Conversionrange(unipolar單極型ADC):0~Vref8bitADC,Vref=5V,?Q8=Vref/256=0.01953125(V)=19.53125mV10bitADC,Vref=5V,?Q10=Vref/1024=0.0048828125(V)=4.8828125mV12bitADC,Vref=5V,?Q12=Vref/4096=0.001220703125(V)=1.220703125mVM-bitdigitalADCAnalogVoltageVinVrefAnalogconvertertoDigitalVin=3.14V,Vref=5V,M=10DM=Vin/Q=Vin/(Vref/2M)=Vin*2M/Vref=3.14*1024/5=3decGalileoArduinoADC12bitADC,0-hangeto12bitADCbyres=12:voidanalogReadResolution(intres)GetConvertereddata:uint32_tanalogRead(uint32_tulPin)6multiplexedADCs探測溫度-使用NTC熱敏電阻(thermistor)NTC電阻特性RTH[Ω]T溫度下的基準電阻R0[Ω]T0溫度下的基準電阻B[K]:B常數(shù)T0[K]:標準溫度(25℃=298.15K)T[K]:熱敏電阻溫度實驗使用的熱敏電阻B常數(shù)=3435K,R0=10,000Ω測溫原理使用電阻分壓電路,將電阻隨溫度變化的特性轉變?yōu)殡妷弘S溫度變化特性Vth=Vcc*Rth/(R1+Rth)ADC轉換結果與溫度特性曲線實驗電路參數(shù)熱敏電阻Rth的B常數(shù)=3435K,R0=10,000Ω;R1=4,700Ω數(shù)值計算:exp運算太復雜需要簡化分段近似線性化:此處只對10~60℃進行近似使用整數(shù)的插值運算得到溫度的結果(A1,T0)(A0,T1)(A0,T0)(Ax,Tx)(A0,Tx)(Ax,T0)AdcTNo.TADC0**********Interpolation(插值)把公式變成C代碼shortintconvert_adc2temperature(shortintax,shortinta0,shortinta1,shortinttemp0,shortinttemp1){shortinttempx;tempx=temp0+(ax-a0)*(temp1-temp0)/(a1-a0);returntempx;}實物連接圖和電路原理圖
內容來自淘豆網(wǎng)www.taodocs.com轉載請標明出處.
因篇幅問題不能全部顯示,請點此查看更多更全內容
Copyright ? 2019- 91gzw.com 版權所有 湘ICP備2023023988號-2
違法及侵權請聯(lián)系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市萬商天勤律師事務所王興未律師提供法律服務