![溫濕度采集控制電路及C51程序_第1頁(yè)](http://file.renrendoc.com/FileRoot1/2019-6/20/7f417cd7-beeb-4ff4-a414-003ccea923d5/7f417cd7-beeb-4ff4-a414-003ccea923d51.gif)
![溫濕度采集控制電路及C51程序_第2頁(yè)](http://file.renrendoc.com/FileRoot1/2019-6/20/7f417cd7-beeb-4ff4-a414-003ccea923d5/7f417cd7-beeb-4ff4-a414-003ccea923d52.gif)
![溫濕度采集控制電路及C51程序_第3頁(yè)](http://file.renrendoc.com/FileRoot1/2019-6/20/7f417cd7-beeb-4ff4-a414-003ccea923d5/7f417cd7-beeb-4ff4-a414-003ccea923d53.gif)
![溫濕度采集控制電路及C51程序_第4頁(yè)](http://file.renrendoc.com/FileRoot1/2019-6/20/7f417cd7-beeb-4ff4-a414-003ccea923d5/7f417cd7-beeb-4ff4-a414-003ccea923d54.gif)
![溫濕度采集控制電路及C51程序_第5頁(yè)](http://file.renrendoc.com/FileRoot1/2019-6/20/7f417cd7-beeb-4ff4-a414-003ccea923d5/7f417cd7-beeb-4ff4-a414-003ccea923d55.gif)
已閱讀5頁(yè),還剩69頁(yè)未讀, 繼續(xù)免費(fèi)閱讀
版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
第一節(jié)電路圖和PCB 一 系統(tǒng)構(gòu)成1 溫度濕度采集控制電路2 集中顯示電路控制溫濕度采集控制電路二 溫度濕度采集控制電路溫度傳感器1 模擬接口2 數(shù)字接口18b20 三 集中顯示電路控制溫濕度采集控制電路1 鍵盤(pán)和數(shù)碼管顯示72792 單片機(jī)主控控制電路3 485通信 一 溫度濕度采集控制電路程序 main c主程序 含繼電器控制rs232 c rs232 h 485通信程序ds18b20 c ds18b20 h 溫度濕度采集程序 第二節(jié)器件介紹和C51編程 includevoidrelay control void externvoiddelay unsignedchar externvoidread tmp void externvoidread tmp 1 void externvoidread tmp 2 void externvoidread tmp 3 void sbitr control P3 5 sbitled P3 3 sbitptt P1 4 voidrev ptt void voidsend ptt void externunsignedchardata main c externunsignedchardatasenddata 16 externunsignedchardatarevdata 8 externunsignedchardata psenddata externunsignedchardata prevdata externunsignedchardatatmp l 4 externunsignedchardatatmp h 4 unsignedcharcodeme address 0 x81 unsignedcharcodetemp table l 21 33 31 30 28 28 28 28 25 25 25 25 25 25 25 21 21 21 21 21 21 21 unsignedcharcodetemp table h 21 35 33 32 30 30 30 30 28 28 28 28 28 28 28 27 27 27 27 27 27 27 unsignedchardatatemp time 20 unsignedinttmp v unsignedinttest time 0 externbitrev ok main ptt 0 TMOD 0 x20 TL1 0 xf4 TH1 0 xf4 SCON 0 x50 PCON 0 x00 TR1 1 ES 1 EA 1 led 0 prevdata revdata psenddata senddata while 1 read tmp read tmp 1 read tmp 2 read tmp 3 senddata 4 me address relay control if r control senddata 13 0 xaa elsesenddata 13 0 x00 if rev ok rev ok 0 delay 1 ptt 1 delay 1 TI 1 voidrelay control void tmp v tmp h 0 二 集中顯示電路控制程序 main c主程序rs232 c rs232 h 485通信程序7279 C 7279 h 鍵盤(pán)程序ds1302 c ds1302 h 時(shí)鐘程序24c64 c 24c64 h EEROM程序utility htemp h include include include includemain void main init I init ttt2 e read block ttt1 e write block if eromimager 0 0 xff senddata 5 20 else store true 1 senddata 5 eromimager 7 delay 20 main c while 1 v get1302 time precess if cur minute curtime 1 if number1 0 number2 0 key press1 0 key numcancel f2 precess delay 20 f3 precess delay 20 f4 precess delay 9000 voidmain init void hd7279 rst 0 delay 1500 hd7279 rst 1 led 0 psenddata senddata prevdata revdata send byte cmd reset pctime settime v set1302 pctime TMOD 0 x20 TL1 0 xf4 TH1 0 xf4 SCON 0 x50 PCON 0 x00 PS 1 EX0 1 TR1 1 ES 1 EA 1 ptt 1 TI 1 key press 0 v setcharge v get1302 cur second curtime 0 cur minute curtime 1 cur hour curtime 2 cur date curtime 3 cur month curtime 4 cur year curtime 7 delay 10000 key press3 1 unsignedcharh compute unsignedcharn w h unsignedcharn w l unsignedcharw h unsignedcharw l unsignedintt1 t2 unsignedcharsub val temp val t1 int n w h 16 n w l 0625 0 5 10 t2 int w h 16 w l 0 0625 0 5 10 sub val unsignedchar t1 t2 5 0 5 temp val unsignedchar t1 10 if sub val 0 return t h temp val 1 sub val 1 elsereturn 0 三 HD7279A器件介紹及C51編程 pindefinesbitcs P1 5 sbitclk P1 6 sbitdat P1 7 sbitkey P3 2 voidsend byte unsignedcharout byte unsignedchari cs 0 long delay for i 0 i 8 i if out byte unsignedcharreceive byte void unsignedchari in byte dat 1 long delay for i 0 i 8 i clk 1 short delay in byte in byte 2 if dat in byte in byte 0 x01 clk 0 short delay dat 0 return in byte voidwrite7279 unsignedcharcmd unsignedchardta send byte cmd send byte dta unsignedcharread7279 unsignedcharcommand send byte command return receive byte voidlong delay void unsignedchari for i 0 i 0 x10 i voidshort delay void unsignedchari for i 0 i 4 i voiddisplay uh tmp unsignedchars unsignedcharr inta b c unsignedchars1 c int s 16 r 0 0625 0 5 10 a int c 100 b int c a 100 10 s1 c a 100 b 10 b b 0 x80 write7279 0 x88 0 xff write7279 0 xcc 0 x0c write7279 0 x87 s1 write7279 0 x86 b write7279 0 x85 a voiddisplay d tmp unsignedchars unsignedcharr inta b c unsignedchars1 c s 16 r 0 0625 0 5 10 a int c 100 b int c a 100 10 s1 c a 100 b 10 b b 0 x80 write7279 0 xc8 0 x0b write7279 0 x83 s1 write7279 0 x82 b write7279 0 x81 a voidservice int0 void interrupt0 鍵盤(pán)中斷 readkey board voidreadkey board void 按鍵程序 unsignedcharkey r number if key key r number read7279 cmd read while key cur minute curtime 1 switch key r number case6 f1 key f1 break case38 f2 key f2 break case7 f3 key f3 break case39 f4 key f4 break case14 1 key num0 9 1 break case22 2 key num0 9 2 break case30 3 key num0 9 3 break case46 4 key num0 9 4 break case54 5 key num0 9 5 break case62 6 key num0 9 6 break case15 7 key num0 9 7 break case23 8 key num0 9 8 break case31 9 key num0 9 9 break case55 0 key num0 9 1 break case63 ok key numok break case47 cancel key numcancel break case255 break default break return 四 18b20及C51編程 ds18b20 c include include includevoiddelay unsignedchartime unsignedchars for s 0 s time s first18b20voidwrite bit unsignedcharbitval EA 0 DQ 0 nop nop if bitval 1 DQ 1 EA 1 delay 5 DQ 1 unsignedcharow reset void unsignedcharpresence DQ 0 delay 120 DQ 1 delay 10 presence DQ delay 20 return presence unsignedcharread byte void unsignedchari unsignedcharii 0 unsignedcharvalue 0 for i 0 i 8 i if read bit ii 0 x01 i value ii delay 5 return value bitread bit void bitdat EA 0 DQ 0 nop nop nop DQ 1 nop nop nop nop nop nop nop dat DQ EA 1 delay 5 return dat voidwrite byte unsignedcharval unsignedchari unsignedchartemp for i 0 i i temp voidread tmp void unsignedinta b temp ow reset write byte 0 xcc write byte 0 x44 delay 20 temp ow reset write byte 0 xcc write byte 0 xbe delay 20 tmp l 0 read byte tmp h 0 read byte include functiondefinevoiddelay unsignedchar first18b20voidwrite bit unsignedchar unsignedcharow reset void unsignedcharread byte void bitread bit void voidwrite byte unsignedchar voidread tmp void sbitDQ P1 0 ds18b20 h unsignedchardatatmp l 4 unsignedchardatatmp h 4 unsignedchardatatemp unsignedchardatatmp 0 unsignedchardataz 8 sbitled P3 3 sbitz1 P1 5 第三節(jié)12864M介紹和GAL邏輯 了解12864M液晶 理解單片機(jī)總線時(shí)序及12864M液晶接口時(shí)序?qū)W會(huì)使用GAL進(jìn)行接口邏輯的編程及應(yīng)用 modulewstitle ADDRESSENCODEdesigner YXMVER1 002003 9 01 wsdevice P22V10 ALE WR RD A8 A9 A10 A11 A12 A13 A14 A15pin1 2 3 4 5 6 7 8 9 10 11 EOC CSRAM CS0 CS1 CS2 CS3 CS4 CS5 ADALE ADOE INT0pin13 14 15 16 17 18 19 20 21 22 23 equationsCSRAM A15 CS0 WR A14 A13 A12 A15 CS1 WR A14 A13 A12 A15 CS2 WR A14 A13 A12 A15 CS3 WR A14 A13 A12 A15 CS4 RD A14 A13 A12 A15 CS5 RD A14 A13 A12 A15 ADALE WRendws
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年中國(guó)通信業(yè)務(wù)行業(yè)市場(chǎng)發(fā)展現(xiàn)狀及投資方向研究報(bào)告
- 2025年核桃新品種推廣與應(yīng)用技術(shù)合同
- 2025年度醫(yī)療設(shè)備采購(gòu)合同變更協(xié)議
- 2025年中國(guó)重型柴油車(chē)行業(yè)市場(chǎng)運(yùn)行態(tài)勢(shì)與投資戰(zhàn)略咨詢報(bào)告
- 加工產(chǎn)品訂單合同范例
- 個(gè)人借款收條合同范例
- 刷單合同范例
- 倉(cāng)庫(kù)及辦公室裝修合同范例
- 培養(yǎng)專家型校長(zhǎng)的創(chuàng)新思路
- 公司送車(chē)合同范例
- 緒論中國(guó)文化概論張岱年
- 發(fā)生輸液反應(yīng)時(shí)的應(yīng)急預(yù)案及處理方法課件
- 中國(guó)旅游地理(高職)全套教學(xué)課件
- 數(shù)字貨幣的匿名性與反洗錢(qián)
- 門(mén)脈高壓性消化道出血的介入治療課件
- 民航保密培訓(xùn)課件
- 血庫(kù)輸血培訓(xùn)課件
- 詩(shī)詞寫(xiě)作入門(mén)
- 學(xué)校教育中的STEM教育模式培訓(xùn)課件
- 電器整機(jī)新產(chǎn)品設(shè)計(jì)DFM檢查表范例
- 樁基礎(chǔ)工程文件歸檔內(nèi)容及順序表
評(píng)論
0/150
提交評(píng)論