【正文】
的特殊功能與P1口的空閑模式和掉電模式,根據(jù)其不同控制模式,實(shí)現(xiàn)半自動(dòng)控制、自動(dòng)控制、定時(shí)控制的相互轉(zhuǎn)換,智能的控制窗簾動(dòng)作。利用先進(jìn)的計(jì)算機(jī)技術(shù)、網(wǎng)絡(luò)通訊技術(shù)、綜合布線技術(shù)、將與家居生活有關(guān)的各種子系統(tǒng),有機(jī)地結(jié)合在一起,通過統(tǒng)籌管理,讓家居生活更加舒適、安全、有效。此次系統(tǒng)設(shè)計(jì)系統(tǒng)正是利用AT89C51 單片機(jī)的優(yōu)點(diǎn),順利的完成了本設(shè)計(jì)的要求。另外電話屬雙工通信手段。家居智能化技術(shù)起源于美國,它是以家為平臺(tái)進(jìn)行設(shè)計(jì)的。本文是從智能家居的一個(gè)項(xiàng)目——智能電動(dòng)窗簾的設(shè)計(jì)開始的。本章從系統(tǒng)功能需求出發(fā),規(guī)劃并確定了系統(tǒng)的總體結(jié)構(gòu),并在此基礎(chǔ)上考慮了系統(tǒng)的可擴(kuò)展性及可實(shí)現(xiàn)性。(3) 電動(dòng)窗簾控制器結(jié)構(gòu)框圖由光電傳感器來探測(cè)外界的光強(qiáng),從傳感器出來的信號(hào)經(jīng)過信號(hào)調(diào)理電路的放大,濾波調(diào)理后輸入到A/D轉(zhuǎn)換器,A/D轉(zhuǎn)換器件完成一個(gè)轉(zhuǎn)換過程需要一定時(shí)間,如果在這段時(shí)間內(nèi)信號(hào)的幅度發(fā)生變化,轉(zhuǎn)換結(jié)果將會(huì)受到影響,所以期間要用到采樣保持電路。 89C51單片機(jī)及相關(guān)電路89C51是一種帶4K字節(jié)閃爍可編程可擦除只讀存儲(chǔ)器(FPEROM—Falsh Programmable and Erasable Read Only Memory)的低電壓,高性能CMOS8位微處理器,俗稱單片機(jī)。由于石英晶體震蕩器具有非常好的頻率穩(wěn)定性和抗外界干擾的能力,所以,石英晶體震蕩器是用來產(chǎn)生基準(zhǔn)頻率的。晶體和電容應(yīng)該盡可能安裝得與單片機(jī)芯片靠近,以減少寄生電容,更好地保證振蕩器穩(wěn)定、可靠地工作。使用DS12887時(shí)應(yīng)注意以下幾點(diǎn):Vcc正常情況下為5V,所有的輸入被忽略,輸出為高阻狀態(tài),Vcc降至3V時(shí),外部電源被關(guān)斷,內(nèi)部鋰電池為實(shí)時(shí)時(shí)鐘和RAM供電,在斷電情況下,時(shí)鐘繼續(xù)運(yùn)行,其中的數(shù)據(jù)可保存十年以上不會(huì)丟失。 時(shí)鐘電路圖 電源電路單片機(jī)工作需要使用5V電壓,因此需要給單片機(jī)設(shè)計(jì)電源電路。176。此外,萬一驅(qū)動(dòng)電路發(fā)生故障,也不致讓功放中較高的電壓串入單片機(jī)而使其損壞。但由于其波形頂部呈現(xiàn)鋸齒形波動(dòng),所以產(chǎn)生較大的電磁噪聲。比如要定時(shí)3秒鐘打開,就連續(xù)按下3次K1按鍵即可。采用LED數(shù)碼管進(jìn)行顯示是一種經(jīng)濟(jì)實(shí)用的方法。光敏二極管是用光電導(dǎo)體制成的光電器件,又稱光導(dǎo)管,他是基于半導(dǎo)體光電效應(yīng)工作的。通常,光敏二極管器都制成薄片結(jié)構(gòu),以便吸收更多的光能。 光控電路原理圖應(yīng)用光控原理工作,天亮窗簾自動(dòng)打開,天黑窗簾自動(dòng)關(guān)閉。 主程序軟件設(shè)計(jì)主程序構(gòu)成無限循環(huán),主要完成單片機(jī)初始化,關(guān)中斷,菜單顯示內(nèi)容初始化,按鍵掃描,電機(jī)運(yùn)行,計(jì)時(shí)等功能。 步進(jìn)電機(jī)工作流程圖 顯示程序顯示程序開始后,起始地址60H發(fā)送到R0,01H發(fā)送至顯示位代碼R2,再將位代碼發(fā)送到單片機(jī)A口,單片機(jī)取顯示數(shù)據(jù)查表轉(zhuǎn)換成顯示代碼發(fā)送至單片機(jī)B口,延時(shí)2ms,指針R0加1,然后判斷6顯示是否完成。 鍵盤程序流程圖 定時(shí)程序設(shè)計(jì)定時(shí)的主要功能是在設(shè)定時(shí)間單片機(jī)能夠得到中斷信號(hào),從而控制窗簾的開關(guān)。這時(shí)候?qū)⒉皇芄饩€的影響。 定時(shí)關(guān)閉狀態(tài)此時(shí)按下復(fù)位鍵后,恢復(fù)原來狀態(tài)后,窗簾再次進(jìn)入光控狀態(tài)下。傳感器部分使用光敏二極管,可以持續(xù)性的檢測(cè)外界光強(qiáng)變化,通過電橋電路后的信號(hào)進(jìn)入比較器,可以得出一個(gè)信號(hào),通過單片機(jī)的脈沖信號(hào)進(jìn)而控制步進(jìn)電機(jī)的運(yùn)行。致 謝畢業(yè)設(shè)計(jì)即將完成,在這里要衷心感謝所有在設(shè)計(jì)過程中給我提供幫助的老師和同學(xué),沒有他們的幫助,畢業(yè)設(shè)計(jì)不可能這么順利的完成。參考文獻(xiàn)[1] 李廣第. 單片機(jī)基礎(chǔ). 北京:北京航空航天大學(xué)出版社,2001[2] 周航慈,朱兆優(yōu). 智能儀器原理與設(shè)計(jì). 北京:北京航空航天大學(xué)出版社,2005[3] 劉守義. 單片機(jī)應(yīng)用技術(shù). 陜西:西安電子科技大學(xué)出版社,2007[4] 胡漢才. 單片機(jī)原理及其接口技術(shù). 北京:清華大學(xué)出版社,2003[5] 王曉明. 電動(dòng)機(jī)的單片機(jī)控制. 北京:北京航空航天大學(xué)出版社,2002[6] 姚福安.電子電路設(shè)計(jì)與實(shí)踐.濟(jì)南:山東科學(xué)技術(shù)出版社,2005.[7] 張培志,陸偉. ,2008[8] ::航空工業(yè)出版社,1998附錄A 附錄A 英文文獻(xiàn)The General Situation of AT89C511 The application of AT89C51Microcontrollers are used in a multitude of mercial applications such as modems, motorcontrol systems, air conditioner control systems, automotive engine and among others. The high processing speed and enhanced peripheral set of these microcontrollers make them suitable for such highspeed eventbased applications. However, these critical application domains also require that these microcontrollers are highly reliable. The high reliability and low market risks can be ensured by a robust testing process and a proper tools environment for the validation of these microcontrollers both at the ponent and at the system level. Intel Platform Engineering department developed an objectoriented multithreaded test environment for the validation of its AT89C51 automotive microcontrollers. The goals of this environment was not only to provide a robust testing environment for the AT89C51 automotive microcontrollers, but to develop an environment which can be easily extended and reused for the validation of several other future microcontrollers. The environment was developed in conjunction with Microsoft Foundation Classes (AT89C51). The paper describes the design and mechanism of this test environment, its interactions with various hardware/software environmental ponents, and how to use AT89C51. IntroductionThe 8bit AT89C51 CHMOS microcontrollers are designed to handle highspeed calculations and fast input/output operations. MCS 51 microcontrollers are typically used for highspeed event control systems. Commercial applications include modems, motorcontrol systems, printers, photocopiers, air conditioner control systems, disk drives, and medical instruments. The automotive industry use MCS 51 microcontrollers in enginecontrol systems, airbags, suspension systems, and antilock braking systems (ABS). The AT89C51 is especially well suited to applications that benefit from its processing speed and enhanced onchip peripheral functions set, such as automotive powertrain control, vehicle dynamic suspension, antilock braking, and stability control applications. Because of these critical applications, the market requires a reliable costeffective controller with a low interrupt latency response, ability to service the high number of time and event driven integrated peripherals needed in real time applications, and a CPU with above average processing power in a single package. The financial and legal risk of having devices that operate unpredictably is very high. Once in the market, particularly in mission critical applications such as an autopilot or antilock braking system, mistakes are financially prohibitive. Redesign costs can run as high as a $500K, much more if the fix means 2 back annotating it across a product family that share the same core and/or peripheral design flaw. In addition, field replacements of ponents are extremely expensive, as the devices are typically sealed in modules with a total value several times that of the ponent. To mitigate these problems, it is essential that prehensive testing of the controllers be carried out at both the ponent level and system level under worst case environmental and voltage conditions. This plete and thorough validation necessitates not only a welldefined process but also a proper environment and tools to facilitate and execute the mission successfully. Intel Chandler Platform Engineering group provides post silicon system validation (SV) of various microcontrollers and processors. The system validation process can be broken into three major parts. The type of the device and its application requirements determine which types of testing are performed on the device. The AT89C51 provides the following standard features: 4Kbytes of flash, 128 bytes of RAM, 32 I/O lines, two 16bittimer/counters, five vector twolevel interrupt architecture, a full duple ser ail port, onchip oscillator and clock circuitry. In addition, the AT89C51 is designed with static logic for operation down to zero frequency and supports two