【正文】
屆別 20xx 屆 學號 20xx14240144 畢業(yè)設計 基于 nRF905 單片機控制的遙控車 姓 名 郭雪平 系 別 物理與電子信息工程系 專 業(yè) 電氣工程及其自動化 指導教師 李欣茂 職 稱 講師 完成時間 20xx 年 5 月 10 號 目錄 摘 要 ..................................................... I ABSTRACT .................................................. II 1. 遙控車的課題背景與發(fā)展趨勢 ................................ 1 課題背景 ............................................ 1 發(fā)展趨 勢 ............................................ 1 無線遙控的應用范圍 .................................. 2 系統(tǒng)設計方案 ......................................... 2 2 硬件系統(tǒng)設計 ............................................. 3 硬件組成 ............................................. 3 小車主體模塊 ......................................... 3 信息產(chǎn)生模塊 ......................................... 3 信息的發(fā)送與接收模塊 .................................. 4 電機驅(qū)動模塊 ......................................... 5 單片機最小系統(tǒng) ....................................... 6 電源模塊電路 ........................................ 6 3 系統(tǒng)的軟件設計 ........................................... 7 C 語言簡介 ........................................... 7 主控程序流程圖 ....................................... 8 發(fā)送模塊程序流程圖 ................................... 9 接收模塊程序流程圖 .................................. 10 系統(tǒng)的仿真 ......................................... 12 系統(tǒng)檢測與調(diào)試 ....................................... 13 總 結(jié) ..................................................... 14 參考文獻 .................................................. 15 致 謝 ..................................................... 16 附錄一: .................................................. 17 附錄二: .................................................. 18 實物圖: .................................................. 28 I 摘 要 隨著電子技術(shù)的飛速發(fā)展,新型大規(guī)模遙控集成電路的不斷出現(xiàn),使得遙控技術(shù)有了日新月異的發(fā)展。遙控裝置的中心控制部件已從早期的分立元件、集成電路逐步發(fā)展到現(xiàn)在的單片微型計算機,智能化程度大大提高。近年來,遙控技術(shù)在工業(yè)生產(chǎn)、家用電器、安 全保衛(wèi)以及人們的日常生活中使用越來越廣泛。無線電遙控技術(shù)的誕生,起源于無線電通信技術(shù),最初的構(gòu)想是無線電報技術(shù)的建立,真空電子管的發(fā)明使得無線電技術(shù)的應用和普及很快應用在民用和軍用等各個領域。 自從愛迪生發(fā)明電燈以來,人類對照明電器的開啟和關(guān)斷控制主要使用手動機械開關(guān)。隨著無線電的發(fā)展,從上個世紀 60 年代開始,相繼出現(xiàn)了無線電遙控的小車。 本次設計的無線遙控車 系統(tǒng)以 STC89C52 單片機為核心。 主要是有發(fā)射部分、接收部分和電機控制三部分組成。 無線模塊 nRF905 通過發(fā)射頻率為 433MHz 的無線波段來發(fā)送控制信號,通過 STC89C52 單片機的解碼,實現(xiàn)控制信號的輸出。電機驅(qū)動電路接到控制信號后,經(jīng)過驅(qū)動芯片 L298 進行控制小車的電機動作。 主要是有發(fā)射部分、接收部分和電機控制三部分組成。發(fā)送和接收部分是采用專用的 nRF905 無線模塊進行數(shù)據(jù)的傳輸和控制的。 關(guān)鍵詞: 單片機;無線模塊; 驅(qū)動 II ABSTRACT With the rapid development of electronic technology, the appearance of new largescale remote control integrated circuit, remote control technology has a rapid development. The center of the remote control device control unit has been from the early separation of ponents, integrated circuit gradually developed to the present single c hip microputer, intelligent degree is greatly increased. In recent years, remote control technology in industrial production, household appliances, security and People39。s Daily life more and more widely used. The birth of the wireless remote control technology, originated in the radio munication technology, the original idea is the establishment of a wireless telegraphy, the invention of the vacuum tube makes the application and popularity of radio technology quickly applied in civilian and military and other fields. Since Thomas Edison invented the electric light, human being turned on and off control of lighting is mainly use the manual mechanical switch. With the development of the radio, from last century 60 s, there appeared the wireless remote control design of the wireless remote control car system to STC89C52 singlechip microputer as the core. Main is transmitting part, receiving part and motor control in three parts. NRF905 wireless module through the transmission frequency to 433 MHZ wireless band to send control signal, through the STC89C52 microcontroller decoding, for the control signal output. Motor driver circuit to control signal, after a driver chip L298 motor to control the car. Main is transmitting part, receiving part and motor control in three parts. Send and receive part adopts special nRF905 wireless module for data transmission and control. Key words: single chip microputer 。 nRF905 wireless module。 Driver 1 1. 遙控車的課題背景與發(fā)展趨勢 課題背景 無線通信主要包括微波通信和衛(wèi)星通信。微波是一種無線電 波,它傳送的距離一般只有幾十千米。但微波的頻帶很寬,通信容量很大。微波通信每隔幾十千米要建一個微波中繼站。衛(wèi)星通信是利用通信衛(wèi)星作為中繼站在地面上兩個或多個地球站之間或移動體之間建立微波通信聯(lián)系。無線通信 (Wireless Communication)是利用電磁波信號可以在自由空間中傳播的特性進行信息交換的一種通信方式,近些年信息通信領域中,發(fā)展最快、應用最廣的就是無線通信技術(shù)。在移動中實現(xiàn)的無線通信又通稱為移動通信,人們把二者合稱為無線移動通信。 nRF905 采用 Nordic 公司的 VLSI ShockBurst 技術(shù)。 ShockBurst 技術(shù)使 nRF905 能夠提供高速的數(shù)據(jù)傳輸,而不需要昂貴的高速 MCU 來進行數(shù)據(jù)處理 /時鐘覆蓋。通過將與 RF 協(xié)議有關(guān)的高速信號處理放到芯片內(nèi), nRF905 提供給應用的微控制器一個 SPI 接口,速率由微控制器自己設定的接口速度決定。 nRF905 通過 ShockBurst 工作模式在 RF以最大速率進行連接時降低數(shù)字應用部分的速度來降低在應用中的平均電流消耗。在ShockBurst RX 模式中,地址匹配 AM 和數(shù)據(jù)準備就緒 DR 信號通知 MCU 一個有效的地址和數(shù)據(jù)包已經(jīng)各自接收完成。在 ShockBurst TX 模式中, nRF905 自動產(chǎn)生前導碼和 CRC校驗碼,數(shù)據(jù)準備就緒 DR 信號通知 MCU 數(shù)據(jù)傳輸已經(jīng)完成??傊@意味著降低 MCU的存儲器需求也就是說降低 MCU 成本,又同時縮短軟件開發(fā)時間。而且在 433MHz 的頻段它是可以免費的使用,最高的共工作速率達到 50kbps,高效的 GFSK 調(diào)制,