【正文】
基礎(chǔ)課程,單片機教學(xué)尤其是實驗環(huán)節(jié)的安排又涌現(xiàn)出了一系列新的問題。C8051F單片機支持雙時鐘,~(端口I/O,RST和JTAG引腳的耐壓為5V)。在學(xué)院進行的特色教育的同時,通過開放實驗室,舉辦各類科技競賽活動,結(jié)合畢業(yè)設(shè)計對單片機實驗系統(tǒng)進行開發(fā)和設(shè)計,面向相關(guān)培訓(xùn)和考核訓(xùn)練的平臺。在就業(yè)形勢如此嚴峻的當(dāng)前,更易于提高學(xué)生的綜合能力,更有利于學(xué)生的就業(yè)。實驗箱特地設(shè)有觸摸屏、語音模塊,簡單而又直觀的向?qū)W員說明了他們工作的基本原理。綜合考慮,我們采用編程簡單的nRF905作無線數(shù)據(jù)收發(fā)芯片作為短距離無線數(shù)據(jù)傳輸設(shè)備。2 模塊電路設(shè)計 無線傳輸模塊 設(shè)計思路無線通信在現(xiàn)代生活中得到了越來越廣泛的應(yīng)用,它主要用于對機動性要求較強的設(shè)備中或人們不方便隨時到達現(xiàn)場的情況下,如無線數(shù)據(jù)采集、無線設(shè)備管理和監(jiān)控、汽車儀表數(shù)據(jù)的無線讀取等都是其典型應(yīng)用。下面簡要說明一下AT89S52單片機的基本情況:ATMEL公司的AT89系列單片機AT89S52單片機是一種新型的低功耗、高性能且內(nèi)含8K字節(jié)閃電存儲器的8位CMOS微控制器,與工業(yè)標準MCS51指令系列和引腳完全兼容。nRF905通過ShockBurst工作模式在RF以最大速率進行連接時降低數(shù)字應(yīng)用部分的速度來降低在應(yīng)用中的平均電流消耗。當(dāng)正在接收一個數(shù)據(jù)包時,TRX_CE或TX_EN引腳的狀態(tài)發(fā)生改變,nRF905立即把其工作模式改變,數(shù)據(jù)包則丟失。發(fā)射部分的nRF905模塊是由AT89S52單片機控制;接收模塊則有主控單片機C8051F020控制。3)單片機最小系統(tǒng)單片機最小系統(tǒng)一般應(yīng)該包括基本模塊:單片機、晶振電路、復(fù)位電路、調(diào)試接口和電源供入。s)來啟動一次系統(tǒng)復(fù)位。目前語音服務(wù)行業(yè)越來越廣,像電腦語音鐘、語音型數(shù)字萬用表、手機話費查詢系統(tǒng)、排隊機以及公共汽車報站器等都是兩者結(jié)合的產(chǎn)物。其集成度較高,內(nèi)部包括前置放大器、內(nèi)部時鐘、定時器、采樣時鐘、濾波器、自動增益控制、邏輯控制、模擬收發(fā)器、解碼器和480K字節(jié)的EEPROM。操作模式可由微控制器也可由硬件實現(xiàn)。 、芯片低功耗狀態(tài)控制端相連,用以控制錄放音狀態(tài)。 步進電機模塊 設(shè)計思路步進電機是數(shù)字控制電機,它將脈沖信號轉(zhuǎn)變成角位移,即給一個脈沖信號,步進電機就轉(zhuǎn)動一個角度,因此非常適合于單片機控制。當(dāng)它作電動機運行時是直流電動機,將電能轉(zhuǎn)換為機械能;作發(fā)電機運行時是直流發(fā)電機,將機械能轉(zhuǎn)換為電能。根據(jù)不同三極管對的導(dǎo)通情況,電流可能會從左至右或從右至左流過電機,從而控制電機的轉(zhuǎn)向。而2個非門通過提供一種方向輸入,可以保證任何時候在H橋的同側(cè)腿上都只有一個三極管能導(dǎo)通。3)電機正、反轉(zhuǎn)單片機程序通過I/O口給反相器的信號可以改變電機的轉(zhuǎn)向。排針3腳提供PWM脈沖,排針4腳通過光耦連接對電機的轉(zhuǎn)速進行測試。在該電路中設(shè)置了上拉電阻,設(shè)置上拉電阻的作用是當(dāng)按鍵無動作的時候保證它處在高電位。 無線傳輸模塊在無線傳輸模塊部分,PC機(或其他外部設(shè)備)有數(shù)據(jù)傳輸或需設(shè)置設(shè)備參數(shù)時,通過串口將數(shù)據(jù)發(fā)送給單片機,單片機在接收數(shù)據(jù)后,將需發(fā)送的數(shù)據(jù)(包括目標設(shè)備地址和所要發(fā)送的數(shù)據(jù))又通過SPI接口發(fā)送給nRF905,nRF905給數(shù)據(jù)加前導(dǎo)碼和CRC碼,將數(shù)據(jù)包發(fā)送。錄放音的操作采用的是M6模式,在M6模式下,/EOM作為操作指示信號,當(dāng)錄音或放音操作時,該引腳輸出高電平,在暫?;蛲V共僮鲿r,該引腳輸出低電平。通過改變各相通電的次序可以調(diào)整步進電機的運轉(zhuǎn)方向。③ 通過改變每步的延時時間來控制步進電機的速度調(diào)節(jié)。對特定的具體設(shè)計,主要問題是按照系統(tǒng)功能合理組織按鍵的組成。但具體那些由硬件完成由軟件完成,要看接口電路的情況。由于受時間限制,整個實驗箱的制作與完成都比較倉促,另外有的器件很不好找,所以實驗箱在功能實現(xiàn)方面還有點欠缺。劉老師在大局上指導(dǎo)我畢業(yè)設(shè)計的每一進程。由于我是初次擔(dān)負這樣的設(shè)計調(diào)試任務(wù),所以在設(shè)計思路和實現(xiàn)功能上難免有些不足之處,希望各位老師能夠批評指正。A Istbydclk Supply current in standby, uCLK enabled 2) 181。A StandBy 12OFF 27181。A StandBy 41 130181。A StandBy 202 210181。s nRF905 is monitoring the air for ining munication. 3. When the nRF905 senses a carrier at the receiving frequency, Carrier Detect (CD) pin is set high. 4. When a valid address is received, Address Match (AM) pin is set high. 5. When a valid packet has been received (correct CRC found), nRF905 removes the preamble, address and CRC bits, and the Data Ready (DR) pin is set high. 6. MCU sets the TRX_CE low to enter standby mode (low current mode). 7. MCU can clock out the payload data at a suitable rate via the SPI interface. 8. When all payload data is retrieved, nRF905 sets Data Ready (DR) and Address Match (AM) low again. 9. The chip is now ready for entering ShockBurst ?RX, ShockBurst ?TX or power down mode. If TX_EN is set high while TRX_CE is kept high, the nRF905 would enter ShockBurst?TX and start a transmission according to the present contents in the SPIregisters. If TRX_CE or TX_EN is changed during an ining packet, the nRF905 changes mode immediately and the packet is lost. However, if the MCU is sensing the Address Match (AM) pin, it knows when the chip is receiving an ining packet and can therefore decide whether to wait for the Data Ready (DR) signal or enter a different mode. To avoid spurious address matches it is remended 。A StandBy 84 275181。A StandBy 121 150181。A StandBy 20OFF 46181。A ISPI Supply current in SPI programming 3) 20 181。2002.145~152.[3] :中國電力出版社,~20.[4]黃智偉,:電子工業(yè)出版社,~192.[5] :北京理工大學(xué)出版社,2001. 92~94.[6] 何立明.單片機高級教程——應(yīng)用與設(shè)計,北京:北京航天航空大學(xué)出版社,~173.[7]康華光,陳大欽. 電子技術(shù)基礎(chǔ)—數(shù)字部分. 北京:高等教育出版社,2000. 29~31.[8] 吳景狄.,2001(4):30~31.[9] 求是科技. :人民郵電出版社,~91.[10] 劉光潭.中外集成電路簡明速察手冊,上海:電子工業(yè)出版社,1991.45~46.[11]李忠杰.步進 電動機應(yīng)用技術(shù)[M].北京:機械 工業(yè) 出版社,~25.[12]劉瑞新,趙全利,趙建軍等.單片機原理及應(yīng)用教程,北京:機械工業(yè)出版社,2003年7月,157~164.[13] 李光飛,:北京航空航天大學(xué)出版社,2004. 13~20.[14]張俊謨. MCS51和80C51系列單片機. 電子世界,2001年,第8期,30~38.[15] 李廣弟,朱月秀,王秀山.單片機基礎(chǔ)(修訂版),北京:北京航空航天大學(xué)出版社,2001年,16~17.[16]譚博學(xué),苗匯靜等.集及成電路原理應(yīng)用.電子工業(yè)出版社,2003.29~31.[17]AT89C51,AT89C52說明書[S] ATMEL公司提供[18]ISD Inc.ISD data book.April 1998 [19]Wind River System Inc.VxWorks NetWork Programmer’sGuide[Z] [20]Single chip 433/868/915MHz Transceiver nRF905.Nordic VLSI ASA.2004.1.附錄一:各模塊原理圖附錄二:實驗箱PCB圖附錄三:英文資料Single chip 433/868/915 MHz Transceiver nRF905 FEATURES ? True single chip GFSK transceiver in a small 32pin package (32L QFN 5x5mm) ? ShockBurst? mode for low power operation ? Power supply range to V ? Multi channel operation – ETSI/FCC Compatible ? Channel switching time 650us ? Extremely low cost Bill of Material (BOM) ? No external SAW filter ? Adjustable output power up to 10dBm ? Carrier detect for listen before transmit protocols ? Data Ready signal when a valid data packet is received or transmitted ? Address Match for detection of ining packet ? Automatic retransmission of data packet ? Automatic CRC and preamble generation ? Low supply current (TX), typical 9mA 10dBm output power ? Low supply current (RX), typical APPLICATIONS ? Wireless data munication ? Alarm and security systems ? Home Automation ? Remote control ? Surveillance ? Automotive ? Telemetry ? Industrial sensors ? Keyless entry ? Toys GENERAL DESCRIPTION nRF905 is a singlechip radio transceiver for the 433/868/915 MHz ISM band. The transceiver consists of a fully integrated frequency synthesiser, receiver chain with demodulator, a power amplifier, a crystal oscillator and a modulator. The ShockBurst? feature automatically handles preamble and CRC. Configuration is easily programmable by use of the SPI interface. Current consumption is very low, in transmit only 9mA at an output power of 10dBm, and in receive mode . Built in power down modes makes power saving easily realizable. QUICK REFERENCE DATA Table 1 nRF905 quick reference data.ParameterValueUnitMinimum supply voltage VMaximum transmit output power 10dBmData rate 50kbpsSupply current in transmit 10dBm output power 9mASupply current in receive mode mATemperature range 40 to +8