【正文】
部上拉電阻的8位雙向I/O口,P1口的輸出緩沖級(jí)可驅(qū)動(dòng)(吸收或輸出電流)4個(gè)TTL邏輯門電路。作為輸出口用時(shí),能驅(qū)動(dòng)8個(gè)TTL邏輯門電路。 AT89C51功能 AT89S51提供以下標(biāo)準(zhǔn)功能:40個(gè)引腳、4K Bytes Flash片內(nèi)程序存儲(chǔ)器、128 Bytes的隨機(jī)存取數(shù)據(jù)存儲(chǔ)器(RAM)、32個(gè)外部雙向輸入/輸出(I/O)口、5個(gè)中斷優(yōu)先級(jí)2層中斷嵌套中斷、2個(gè)數(shù)據(jù)指針、2個(gè)16位可編 程定時(shí)/計(jì)數(shù)器、2個(gè)全雙工串行通信口、看門狗(WDT)電路、片內(nèi)振蕩器及時(shí)鐘電路。 讀供電方式 0B4H 讀DS1820的供電模式。結(jié)果存入內(nèi)部9字節(jié)RAM中。 跳過(guò) ROM 0CCH忽略 64 位 ROM 地址,直接向 DS1820 發(fā)溫度變換命令。 ?。?)延時(shí)60微秒。 ?。?)延時(shí)3微秒。 (7) 最后將數(shù)據(jù)線拉高。 ?。?) 按從低位到高位的順序發(fā)送字節(jié)(一次只發(fā)送一位)。 (7) 若CPU讀到了數(shù)據(jù)線上的低電平“0”后,還要做延時(shí),其延時(shí)的時(shí)間從發(fā)出的高電平算起(第(5)步的時(shí)間算起)最少要480微秒。 (4) 延時(shí)750微秒(該時(shí)間的時(shí)間范圍可以從480到960微秒)。而每一次命令和數(shù)據(jù)的傳輸都是從主機(jī)主動(dòng)啟動(dòng)寫(xiě)時(shí)序開(kāi)始,如果要求單總線器件回送數(shù)據(jù),在進(jìn)行寫(xiě)命令后,主機(jī)需啟動(dòng)讀時(shí)序完成數(shù)據(jù)接收。 由于DS18B20是在一根I/O線上讀寫(xiě)數(shù)據(jù),因此,對(duì)讀寫(xiě)的數(shù)據(jù)位有著嚴(yán)格的時(shí)序要求。當(dāng)被用著在寄生電源下,也可以向器件提供電源。(4)配置寄存器該字節(jié)各位的意義如下:TMR1R011111 表3: 配置寄存器結(jié)構(gòu)低五位一直都是1,TM是測(cè)試模式位,用于設(shè)置DS18B20在工作模式還是在測(cè)試模式。(2)DS18B20中的溫度傳感器可完成對(duì)溫度的測(cè)量,以12位轉(zhuǎn)化為例:用16位符號(hào)擴(kuò)展的二進(jìn)制補(bǔ)碼讀數(shù)形式提供,℃/LSB形式表達(dá),其中S為符號(hào)位。計(jì)數(shù)器1和溫度寄存器被預(yù)置在-55℃所對(duì)應(yīng)的一個(gè)基數(shù)值。二、芯片資料DS18B20 DS18B20的工作原理DS18B20的讀寫(xiě)時(shí)序和測(cè)溫原理與DS1820相同,只是得到的溫度值的位數(shù)因分辨率不同而不同,且溫度轉(zhuǎn)換時(shí)的延時(shí)時(shí)間由2s 減為750ms?;贒S18B20的溫度采集系統(tǒng)設(shè)計(jì) 課 程 設(shè) 計(jì) 任 務(wù) 書(shū)題 目 基于DS18B20的溫度采集系統(tǒng)(數(shù)碼管顯示)的設(shè)計(jì)系 (部) 信息科學(xué)與電氣工程學(xué)院 專 業(yè) 電子信息工程 班 級(jí) 電信091 學(xué)生姓名 學(xué) 號(hào) 12 月 26 日至 12 月 30 日 共 1 周指導(dǎo)教師(簽字) 系 主 任(簽字) 年 月 日 目錄摘要 2一、設(shè)計(jì)任務(wù)和要求 4二、芯片資料 4DS18B20 4 DS18B20的工作原理 4 DS18B20的使用方法 6AT89C51 8 AT89C51簡(jiǎn)介 8 AT89C51功能 8 AT89C51引腳 9三、系統(tǒng)流程 10讀轉(zhuǎn)換溫度子程序 10讀、寫(xiě)DS18B20的子程序 11四、電路與程序設(shè)計(jì) 12程序 12電路圖 17五、系統(tǒng)調(diào)試與分析 19六、設(shè)計(jì)體會(huì)及參考文獻(xiàn) 19 摘要隨著人們生活水平的不斷提高,單片機(jī)技術(shù)已經(jīng)普及到我們生活,工作,科研等各個(gè)領(lǐng)域。同時(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 、low cost 、 ease of use 一、設(shè)計(jì)內(nèi)容及要求利用DS18B20實(shí)現(xiàn)溫度采集,并用數(shù)碼管顯示(用proteus實(shí)現(xiàn))。高溫度系數(shù)晶振 隨溫度變化其振蕩率明顯改變,所產(chǎn)生的信號(hào)作為計(jì)數(shù)器2的脈沖輸入。光刻ROM的作用是使每一個(gè)DS18B20都各不相同,這樣就可以實(shí)現(xiàn)一根總線上掛接多個(gè)DS18B20