【正文】
作電源,電源電壓為 5V。 金屬熱電阻中屬鉑電阻和銅電阻最為常用,這里以鉑電阻 Pt1000為例。同樣,共陽極 LED顯示器的工作原理也一樣。這時即使控制電壓消失,仍然保持導(dǎo)通狀態(tài),所以控制電壓沒有必要一直存在,通常采用脈沖形式,以降低觸發(fā)功耗。當(dāng) DS18B20處于寫存儲器操作和溫度 A/D變換操作時,總線上必須有強(qiáng)的上拉,上拉開啟時間最大為 10μs 。 LED的動態(tài)顯示方式 : 數(shù)碼管動態(tài)顯示接口是單片機(jī)中應(yīng)用最為廣泛的一種顯示方式,動態(tài)驅(qū)動是將所有數(shù)碼管的 8個顯示筆劃 a,b,c,d,e,f,g,dp的同名端連在一起,另外為每個數(shù)碼管的公共極增加位選通控制電路,位選通由各自獨立的 I/O線控制,當(dāng)單片機(jī)輸出字形碼時,所有數(shù)碼管都接收到相同的字形碼,但究竟是那個數(shù)碼管會顯示出字形,取決于單片機(jī)對位選通端電路的控制,所以我們只要將需要顯示的數(shù)碼管的選通控制打開,該位就顯示出字形,沒有選通的數(shù)碼管就不會亮。 :利用電感和電容的阻抗特性,將整流后的單向脈動電流中的交流分量濾去,使單向脈動電流變換成平滑的直流電。電容 C5, C6 可以幫助起振,典型值為 33 pF,調(diào)節(jié)它們可以達(dá)到微調(diào)fosc的目的。 12 圖 31 主程序流程圖 DS18B20 的溫度采樣程序流程圖 CPU對 DS18B20的訪問流程是:先對 DS18B20初始化,再進(jìn)行 ROM操作命令,最后才能對存儲器和數(shù)據(jù)進(jìn)行操作。 // 返回溫度值 } void tem_deal(uint tem) /* 溫度數(shù)據(jù)顯示處理函數(shù) */ { if(tem6348) // 溫度值正負(fù)判斷 { tem=65536tem。 // 先判斷百位是否為 0 if(!Dis_play[1]) { Dis_play[1]=0x0a。 } /*****主函數(shù) *****/ void main(void) { EA=1。在課堂上,掌握的僅僅是專業(yè)基礎(chǔ)課的理論,如何把我們所學(xué)到的專業(yè)基礎(chǔ)理論知識用到實踐中去呢?如何去鍛煉我們的實踐的一面?這次做課程設(shè)計就為我提供了一個課外學(xué)習(xí)的好平臺。//顯示單元數(shù)據(jù),共 6個數(shù)據(jù)和一個運(yùn)算 第 4個數(shù)據(jù)為空,第 6 個數(shù)據(jù)顯示 C uchar data Dis_ram[1]={0x00}。y) for(Y=0。i) { DQ = 0。 // 初始化 DS18B20 delay_MS(200)。 flag1=1。 // 再判斷十位是否為 0 } } if(flag1) { Dis_play[0]=0x0b。 //允許 INT0 中斷 EX0=1。 for(k=10。 if(XX15) XX=24。 discan=0x00??傆X得自己自己似乎應(yīng)該去做點什么,或者寫點什么。 Those were broken into various shapes of stationery。也曾經(jīng)好像已經(jīng)下定了決心去做某件事,但更多的時候是最后又打起了退堂鼓。s actions. CSKA said they were surprised and disappointed by Toure39。 discan=0x00。 //顯示 C delay1(10)。 if(ADD==0) 28 { SX++ 。 //位選 Disdata=0xc6。 Dis_play[1]=Dis_play[2]/10。 temp1=temp1|temp_data[0]。 //寫入一位數(shù)據(jù) delay_MS(5)。 } 23 /* 讀字節(jié)子函數(shù) */ ReadOneChar(void) { uchar i = 0。 //列掃描控制字 void delay_MS(uint i) //delay 111 / 延時子程序 / { while(i)。 // P3 溫度輸入口 uint temp1。幾周的課程設(shè)計終于結(jié)束了,雖然很忙碌、很疲勞,但是收獲很大。 } 16 discan=scan_con[7]。 else Dis_play[5]=0 。 temp1=8。 主程序功能單一化,只對各子程序進(jìn)行控制、調(diào)動,使整個程序成為有機(jī)的整體。但是,當(dāng)交變電場的頻率為某一特定值時,振幅驟然增大,產(chǎn)生共振,稱之為壓電振蕩??梢?,將要顯示的存儲器單元的數(shù)據(jù)直接送到 P2 口去驅(qū)動 LED數(shù)碼管顯示是不能正確表達(dá)的,必須在系統(tǒng)內(nèi)部將要顯示的數(shù)據(jù)經(jīng)過 BCD碼轉(zhuǎn)換后,將各個單元數(shù)據(jù)的段選代碼送入 P2口,給 CD4511譯碼后去驅(qū)動數(shù)碼管顯示。這樣通過 P2口送出一個存儲單元的高位,低位 BCD顯示代碼,通過 P2口另幾位送出掃描選通代碼輪流點 7 亮 LED1至 LED4,就會將要顯示的數(shù)據(jù)在數(shù)碼管中顯示出來。在 DS18B20接入系統(tǒng)之前,應(yīng)分別從激光 ROM 中讀出其序號,然后分別賦予在系統(tǒng)中的編號 1~ n。用繼電器時要注意其電感的反向電動勢,和開關(guān)觸點對電源的影響,以及開關(guān)脈沖對整個電路的影響等,應(yīng)該加入必要的防止干擾的措施。 在本設(shè)計 中我采用的是集成溫度傳感器 DS18B20,其電路簡單可靠,不需要 A/D轉(zhuǎn)換,直接可以與單片機(jī)相連。按照熱電阻的性質(zhì)可以分為半導(dǎo)體熱電阻和金屬熱電阻兩大類,前者通常稱為熱敏電阻,后者稱為熱電阻。但其中的溫度測量電路、譯碼電路復(fù)雜,容易產(chǎn)生誤差和由電路復(fù)雜而導(dǎo)致的設(shè)備使用壽命低等一系列問題。就室內(nèi)居住環(huán)境而言,恒溫環(huán)境并非是衛(wèi)生和舒適的。 2 方案二 該方案采用的是 AT89C51單片機(jī)為核心控制器件,用它來處理各個單元電路的工作 以及檢測其運(yùn)行情況。 ~: P2 口 I/O 引腳,或高 8 位地址總線引腳。適合于各種環(huán)境的現(xiàn)場溫度測量,如:環(huán)境控制、設(shè)備或過程控制、測溫類消費(fèi)電子產(chǎn)品等。 這種顯示方式占用的 I/O口個數(shù)為 8+N( N為 LED顯示器的個數(shù)),相對靜態(tài)顯示少了很多,但需要占用 大量的 CPU資源,當(dāng) CPU處理別的事情時,顯示可能出現(xiàn)閃爍或者不顯示的情況。所以我采用的是光耦合雙向可控硅驅(qū)動電路。而顯示時間時第一、二位為小時,第三、四位為分鐘,顯示數(shù)據(jù)由 CD4511譯碼器輸出。 數(shù)據(jù)與代碼轉(zhuǎn)換。內(nèi)部震蕩方式的外部電路如圖 24所示: 圖 24 外部晶振電路 外部振蕩信號由 X2引入, X1和 X2:片內(nèi)振蕩電路輸入、輸出引腳,這兩個端子用來外接石英晶體和微調(diào)電容。在典型調(diào)試對話中,調(diào)試器提供對片內(nèi)所有外圍設(shè)備的訪問、單步和設(shè)置斷點的代碼執(zhí)行控制方式。 // 發(fā)送讀取數(shù)據(jù)命令 temp_data[0]=ReadOneChar()。 // 取后兩位數(shù)據(jù)暫存 if(Dis_play[2]=XX) Dis_play[4]=1 。} //小數(shù)點顯示 discan=scan_con[k+3]。 else LED2=1。 在此,我還要感謝在一起愉快的度過 畢業(yè)設(shè)計的同學(xué)們 ,正是由于你們的幫助和支持,我才能克服一個一個的困難和疑惑,直至本文的順利完成。 sbit DIN = P0^7。 //拉高總線 delay_MS(14)。 i) { DQ = 0。 // 連續(xù)讀兩個字節(jié)數(shù)據(jù) temp_data[1]=ReadOneChar()。 else Dis_play[4]=0 。 //位選 delay_MS(90)。 } while(1)。 discan=0x00。 P0=table[ge]。s about how he felt and I would like to speak to him first to find out what his experience was. Uefa has opened disciplinary proceedings against CSKA for the racist behaviour of their fans during City39。 A person39。t start planning... Those years, those days of do, finally, like youth, will end in our life. 此刻,天空是陰暗的,空氣里有著剛下過雨之后的清新因子。 Junior high school, thought to have a crush on just means that the real growth, but over the past three years later, his writing of alumni in peace, suddenly found that isn39。t appealed against the disciplinary action your employer has taken against you. However, if you win your case, the tribunal may reduce any pensation awarded to you as a result of your failure to appeal. Remember that in most cases you must make an application to an employment tribunal within three months of the date when the event you are plaining about happened. If your application is received after this time limit, the tribunal will not usually accept it. 30 If you are worried about how the time limits apply to you, take advice from one of the anisations listed under Further help. Employment tribunals are less formal than some other courts, but it is still a legal process and you will need to give evidence under an oath or affirmation. Most people find making a claim to an employment tribunal challenging. If you are thinking about making a claim to an employment tribunal, you should get help straight away from one of the anisations listed under Further help. If you are being represented by a solicitor at the tribunal, they may ask you to sign an agreement where you pay their fee out of your pensation if you win the case. This is known as a damagesbased agreement. In England and Wales, your solicitor can39。 for(k=10。 discan=scan_con[5]。 //溫度轉(zhuǎn)換 tem_deal(tmp())。 } void displ