【正文】
總之,從這次的課程設(shè)計(jì)中,我真真正正的意識(shí)到,在以后的學(xué)習(xí)中,要理論聯(lián)系實(shí)際,把我們所學(xué)的理論知識(shí)用到實(shí)際當(dāng)中,學(xué)習(xí)單機(jī)片機(jī)更是如此。復(fù)位要求主CPU 將數(shù)據(jù)線下拉500 微秒,然后釋放,DS18B20 收到信號(hào)后等待16~60 微秒左右,后發(fā)出60~240 微秒的存在低脈沖,主CPU 收到此信號(hào)表示復(fù)位成功( 3 )動(dòng)態(tài)顯示方式,在某一瞬時(shí)顯示一位,依次循環(huán)掃描,輪流顯示,由于人的視覺(jué)滯留效應(yīng),人們看到的是多位同時(shí)穩(wěn)定顯示六、設(shè)計(jì)體會(huì) 為期1周的課程設(shè)計(jì)已經(jīng)接近尾聲,在完成設(shè)計(jì)的同時(shí),我還在不斷的學(xué)習(xí)新知識(shí)和鞏固已有的知識(shí)。延時(shí) CLR 。讀下一位 SETB RET HBCD: MOV A,TEMP6 MOV B,10 DIV AB MOV TEMP3,B 。把要寫(xiě)的字節(jié)的最低位右環(huán)移到C中 NOP 。十位為0也不是NEXT: RETMULD: MOV R3,A MOV B,71H MUL AB MOV R7,A MOV R6,B MOV B,02H MOV A,R3 MUL AB ADD A,R6 MOV R6,A RETWRITE: MOV R3,8 。換到高4位 ORL A,R5 。將結(jié)果的千位百位取出 ANL A,0F0H 。調(diào)用一字節(jié)的16進(jìn)制轉(zhuǎn)換BCD數(shù)的子程序 MOV TEMP1,0BH 。保留高字節(jié)的低四位 SWAP A 。將結(jié)果的千位百位取出 ANL A,0F0H 。將溫度的高字節(jié)取出 JNB ,ZHENG 。初始化DS18B20 MOV A,0CCH 。保持15US60US CLR C ORL C, 。調(diào)用溫度計(jì)算函數(shù) LCALL DISP 。如EA端保持高電平(接VCC端),CPU則執(zhí)行內(nèi)部程序存儲(chǔ)器中的指令。如有必要,可通過(guò)對(duì)特殊功能寄存器(SFR)區(qū)中的8EH單元的D0位置位,可禁止ALE操作。RST:復(fù)位輸入。P2口:P2口是一個(gè)帶有內(nèi)部上拉電阻的8位雙向I/O口, P2口的輸出緩沖級(jí)可驅(qū)動(dòng)(吸收或輸出電流)4個(gè)TTL邏輯門(mén)電路。同時(shí)該芯片還具有PDIP、TQFP和PLCC等三種封裝形式,以適應(yīng)不同產(chǎn)品的需求 AT89C51引腳P0口:P0口為一個(gè)8位漏級(jí)開(kāi)路雙向I/O口,也即地址/數(shù)據(jù)總線復(fù)用口。 重調(diào) EEPROM 0B8H 將EEPROM中內(nèi)容恢復(fù)到RAM中的第3 、4字節(jié)。為操作各器件作好準(zhǔn)備。 ?。?)將數(shù)據(jù)線拉低“0”。 ?。?) 延時(shí)確定的時(shí)間為15微秒。 ?。?) 延時(shí)(該時(shí)間要求的不是很嚴(yán)格,但是盡可能的短一點(diǎn)) ?。?) 數(shù)據(jù)線拉到低電平“0”。 DS18B20的使用方法由于DS18B20采用的是1-Wire總線協(xié)議方式,即在一根數(shù)據(jù)線實(shí)現(xiàn)數(shù)據(jù)的雙向傳輸,而對(duì)AT89S51單片機(jī)來(lái)說(shuō),硬件上并不支持單總線協(xié)議,因此,我們必須采用軟件的方法來(lái)模擬單總線的協(xié)議時(shí)序來(lái)完成對(duì)DS18B20芯片的訪問(wèn)。表2: DS18B20溫度數(shù)據(jù)表(3)DS18B20溫度傳感器的存儲(chǔ)器DS18B20溫度傳感器的內(nèi)部存儲(chǔ)器包括一個(gè)高速暫存RAM和一個(gè)非易失性的可電擦除的EEPRAM,后者存放高溫度和低溫度觸發(fā)器TH、TL和結(jié)構(gòu)寄存器。同時(shí)51單片機(jī)在現(xiàn)代電子產(chǎn)品中廣泛應(yīng)用以及其技術(shù)已經(jīng)非常成熟,DS18B20可以直接讀出被測(cè)溫度值,而且采用一線制與單片機(jī)相連,減少了外部的硬件電路,具有低成本和易使用的特點(diǎn) 關(guān)鍵詞: 單片機(jī)控制、溫度檢測(cè)、溫度傳感器、溫度報(bào)警、低成本、易使用 Abstract With the continuous improvement of living standard, single chip technology has spread to our lives, work, research and other is undoubtedly one of the goals people pursue, the convenience it brings is not negative, in which digital thermometer is a typical example, but it requires more and more people to work for the modern man, research, provide a better life, more convenient facilities need to start from a few microcontroller technology, all toward the digital control, intelligent control this paper, bined with sensor technology development and design of single chip, the sensor application of theory and practical bination of SCM in detail about the use of temperature sensors measure the ambient temperature DS18B20, set the upper and lower alarm temperature range when the temperature is not set is for the police. 51 Micro also widely used in modern electronic products and its technology is well established. DS18B20 can directly read the measured temperature, and the use of frontline system is connected with the microcontroller, reducing the external hardware circuit, the characteristics of low cost and ease of use.Keywards: SCM control 、temperature measure、temperature sensors temperature alarming