【正文】
temp_lsb |=temp_msb。j++) {temp_lsb = temp_pad[j][0] 。j++) // prolong the time for 。 the same content is sent for three times 。 temperature_ vel[j] = temp_lsb。 //溫度值的數(shù)據(jù)轉(zhuǎn)換 temp_msb = temp_pad[j][1] 。j++) //延時(shí) ,等待轉(zhuǎn)換結(jié)束 {delay(1000)。 圖 8 系統(tǒng)軟件流程圖 采集和轉(zhuǎn)換部分啟動(dòng) DS18B20轉(zhuǎn)換,分組方式讀取溫度數(shù)據(jù),存儲(chǔ)數(shù)據(jù)等等。若超過 收到脈沖信號(hào),則使 89C52復(fù)位。由于瀝青轉(zhuǎn)運(yùn)車在高寒地區(qū)作業(yè)或運(yùn)送距離過長(zhǎng)時(shí)不可避免的產(chǎn)生溫降,這會(huì)影響路面的攤鋪質(zhì)基于 DS18B20 分組方式測(cè)溫系統(tǒng)設(shè)計(jì) 5 量,所以必須根據(jù)外殼的散熱情況采取具體的保溫措施。 線路連接如圖 2示(同組的 DS18B20信號(hào)線都連接在 P1口的一根總線上)。本文中,對(duì) DS18B20 平均分組并掛到多根 I/O 線上,通過同時(shí)讀取 DS18B20 的狀態(tài)得到轉(zhuǎn)換的溫度數(shù)據(jù),從而明顯提高交替檢測(cè)速度并降低系統(tǒng)開銷,同時(shí)又不影響轉(zhuǎn)換精度及可靠性。 學(xué)校代碼: 11517 學(xué) 號(hào): 202050712216 HENAN INSTITUTE OF ENGINEERING 文獻(xiàn)翻譯 題 目 電子萬(wàn)年歷的設(shè)計(jì)與實(shí)現(xiàn) 學(xué)生姓名 姚 俊 霞 專業(yè)班級(jí) 電氣工程及其自動(dòng)化 學(xué) 號(hào) 202050712216 系 (部) 電氣信息工程系 指導(dǎo)教師 (職稱 ) 李 娜(講師) 完成時(shí)間 2020年 2 月 17 日 基于 DS18B20 分組方式測(cè)溫系統(tǒng)設(shè)計(jì) 1 基于 DS18B20 分組方式 測(cè)溫 系統(tǒng)設(shè)計(jì) LI Ping ZHOU Yucai Xiangjun ZENG YANG Tingfang Changsha University of Science and Technology, Changsha 410077, Hunan, P. R. China. 摘 要: 當(dāng)用于多點(diǎn)測(cè)溫時(shí),所有的 DS18B20 傳感器都連接在單片機(jī)的某根總線上,采用輪流采集溫度數(shù)據(jù)的方式。本文實(shí)現(xiàn)了一套人工環(huán)境實(shí)驗(yàn)室的多 點(diǎn)溫度測(cè)試,明顯提高了原有測(cè)試系統(tǒng)的檢測(cè)效率。當(dāng)對(duì)DS18B20進(jìn)行讀寫時(shí),必須嚴(yán)格保持時(shí)序要求。本文設(shè)計(jì)了一套用于瀝青運(yùn)輸車外殼溫度分布的無(wú)線溫度測(cè)試系統(tǒng)基于 DS18B20分組方式,總共 120個(gè)點(diǎn)??紤]到系統(tǒng)須存取 120個(gè) DSl8820的序列號(hào)。以下程序?yàn)椴杉?,轉(zhuǎn)換模塊的主要內(nèi)容: void Get_ Temperature(void) 基于 DS18B20 分組方式測(cè)溫系統(tǒng)設(shè)計(jì) 7 { uchar i,j , temp_ lsb, temp_ msb。} For(j=0。 temp_lsb = 4 。}} 5 結(jié)論 本文作者創(chuàng)新點(diǎn): 1) 通過分析基于單總 線方式和分組方式的多點(diǎn)溫度測(cè)試系統(tǒng)的交替檢測(cè)時(shí)間的差別,得出分組方式能明顯提高交替檢測(cè)速度; 2) 設(shè)計(jì)了一套基于 DS18B20分組方式的無(wú)線多點(diǎn)溫度測(cè)試系統(tǒng),這套系統(tǒng)已經(jīng)用于一家大型機(jī)械公司的瀝青運(yùn)輸車的技術(shù)改造中,并取得良好的效果。 two out of three logic is performed according to the bit). 基于 DS18B20 分組方式測(cè)溫系統(tǒng)設(shè)計(jì) 16 The wireless module is set up as the sleep state during the conversion and the transforming state during the temperature data transmission. Packing sends the temperature data and the DS18B20 numbers in the system to epigenous machine. The parts of collection and conversion start the DS18B20 conversion, read the temperature data by grouping methods, store data and so on. The following procedure is the main content of collecting and conversion modules: void Get_ Temperature(void) { uchar i,j , temp_ lsb, temp_ msb。 wait for the end of conversion {delay(1000)。 //the data conversion of the temperature value temp_msb = temp_pad[j][1] 。 temperature_ vel[j] = temp_lsb。 temp_lsb %= 10 。j120。j100。 the span of writing or reading the next bit is 1us. As the A/D conversion time is (9 precisions), if it is counted by the shortest way, the total timeconsuming of alternate test is calculated respectively as follows: (1) Single bus 495us+2*(8*60+7)us++495us+100*(64*60+63+8*60+7+9*60+8)us=4ms (2) Grouping mode 495us+2*(8*60+7)us++20(64*60+63+8*60+7+9*60+8)us= 基于 DS18B20 分組方式測(cè)溫系統(tǒng)設(shè)計(jì) 12 Fig 3 the diagram of collecting temperature by grouped DS18B20 As the small proportion of the numeration system conversion and the storage time in the whole period, the unknown crystaloscillator frequency, the numeration system 基于 DS18B20 分組方式測(cè)溫系統(tǒng)設(shè)計(jì) 13 conversion and storage time is not counted. Accordingly, the alternate test time which grouping mode consumes is much shorter than single bus mode obviously Fig 4 DS18B20 reversion time sequenceFig 4 DS18B20 reversion time sequence IV.