用户名: 密码: 验证码:
基于单片机的蓝牙接口设计及数据传输的实现
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
蓝牙技术作为一种无线数据与语音通信的开放性全球规范,可提供低功耗、短距离的无线空中接口,在各种固定与移动设备之间实现无线通信。在移动通信、无线数据采集、无线遥控与遥测、计算机网络及自动控制等多种领域,蓝牙技术都有着广泛的应用。
     蓝牙协议规范具有多个层次,完整的蓝牙协议栈的开发是一项很复杂的工程,而在大多数嵌入式应用中,只是需要实现基本的无线数据传输功能,并不需要实现全部的蓝牙协议栈。针对此类应用,若是能提供一套实用的蓝牙无线接口、实现一个通用的无线数据传输模块,就可以比较有效地缩短开发周期,降低开发成本。
     本文正是基于此目标,首先介绍了蓝牙技术的背景和现状,分析了蓝牙系统组成,比较了蓝牙与其他无线技术,并在此基础上,分析了蓝牙协议体系结构,并针对其在嵌入式系统中的实用性,着重剖析了蓝牙主机控制器接口HCI(HostController Interface)层协议。然后,参照HCI协议规范,设计了基于单片机控制蓝牙模块的硬件接口方案,并详细剖析了一个蓝牙HCI层通信实例的实验数据,随后给出了一套基于单片机实现蓝牙无线数据传输的软件接口方案。
     应用上述设计的蓝牙软硬件接口,本文开发了一个在单片机与PC之间实现无线数据传输的蓝牙数据传输系统。在单片机端利用Keil下的C编程开发了蓝牙数据传输模块,并作为一个子模块集成到了计算机高级接口实验平台上,在PC端通过USB控制蓝牙适配器,编写了一个基本的蓝牙控制程序,从而实现了实验台与PC之间的蓝牙无线数据传输。然后,在实现基本数据传输的基础上,进一步开发了通过蓝牙进行文件传输的功能模块,在单片机端实现了一个简单的嵌入式FAT16文件系统,通过蓝牙从PC接收文件并以FAT16格式存储到外接的MMC卡上。
     本文提供的蓝牙软硬件接口方案及数据传输模块,不仅可以用来进一步开发蓝牙高层协议,而且还可作为通用的接口函数和模块应用到多种无线场合。
As a globally open wireless data and speech communication specification,Bluetoo-th technology can provide low-power、short-distance wireless air interface and implement wireless communication between various fixed and mobile equipments.Bluetooth technology has a wide range of applications in mobile communications、wireless data collections、wireless remote control and sensing、computer network and automatic control and other areas.
     Bluetooth protocol norms have multiple levels.The development of the complete Bluetooth protocol stack is a very complicated project.In most of the embedded applications,it is only need to realize the basic wireless data transimission,so it's not necessory to implement all of the Bluetooth protocols.If we can provide a practical Bluetooth wireless interface and then a universal wireless data transmission module, the development cycle of the Bluetooth embedded applications can be effectively shortened and the development costs will also be reduced.
     Based on this objective,this paper firstly introduces the background and present situation of Bluetooth technology,analyzes the components of the Bluetooth system,compares Bluetooth technology with other wireless technologies.On this basis,this paper analyzes the Bluetooth protocol architecture,and then,against the practicality of its application in embedded system,emphasizes the Bluetooth Host Controller Interface Protocol. After that,based on the Bluetooth HCI protocol specification,this paper designs the hardware interface used by MCU to control the Bluetooth Module,and then through the analysis of the experimental datas of an example of Bluetooth HCI communication,supplys the software interface of Bluetooth wireless data transmisson based on MCU.
     Using the Bluetooth hardware and software interface designed above,the paper develops a Bluetooth data transmission system which can be used to wirelessly transmit data between MCU and PC.On the MCU, the Bluetooth data reveiving and sending module is impletmented through embedded C programming in Keil IDE,and then the module is embeded into the Advanced Computer Interface Experiment Platform as a sub-module.On PC,a Bluetooth USB Dongle is connected to PC through the USB interface,and a basic Bluetooth control program is implemented through C++ programming in Visual C++ 6.0 IDE.And then,data can be transmitted between the two parts. After that,a further development which is file transmission is implemented.Firstly, an embeded FAT16 file system is realized in MCU so that the file received from PC can be storaged correctly into MMC card which is connected to the MCU in SPI mode. And then,the file transmission is realized beteen MCU and PC .
     The Bluetooth hardware and software interface and data transmission module this paper provids not only can be used to further developments of Bluetooth high-level protocols, but can be applied into a variety of wirless occasions used as a series of common interface and module.
引文
[1]钱志鸿,杨帆,周求湛.蓝牙技术原理、开发与应用[M].北京.北京航空航天大学出版社.2006
    [2]朱刚,谈振辉,周贤伟.蓝牙技术原理与协议[M].北京.北京交通大学出版社.2002
    [3]吴雪琴.基于蓝牙技术的计算机间通信[D].西北工业大学.2003
    [4]冯睿.蓝牙系统核心协议栈的研究与实现[D].南京邮电学院.2002
    [5]金纯,林金朝,万宝红.蓝牙协议及其源代码分析[M].北京.国防工业出版社.2006
    [6]张晶,李铁盘.蓝牙HCI传输层流量控制的研究[J].计算机工程与设计.2006.27(23).4500-4503
    [7]董自健.用单片机实现HCI层的蓝牙数据传输[J].淮海工学院学报.2003.12(2).25-27
    [8]Bluetooth SIG.Specification of the Bluetooth System.Version 1.0B[DB].www.bluetooth.org.1999
    [9]陈连坤.嵌入式系统的设计与开发[M].北京.清华大学出版社,北京交通大学出版社.2005
    [10]CYGNAL Intergrated Products.Inc.C8051F120/1/2/3/4/5/6/7High-Speed Mixed-Signal ISP FLASH MCU Data Sheet.www.cygnal.com.2003
    [11]杨战社.基于蓝牙技术的数据传输[D].西安科技大学.2005
    [12]Ericsson Microelectronics.ROK101008 Bluetooth Module Data Sheet.www.ericsson.com.2001
    [13]丛延奇,刘诗笺,刘英莉.基于MCU实现蓝牙与PC机之间HCl层传输[J].2004.30(11).43-44
    [14]童长飞.C8051F系列单片机开发与C语言编程[M].北京.北京航空航天大学出版社.2005
    [15]闫文婷.基于蓝牙技术的数据传输的研究与实现[D].南京理工大学.2004
    [16]段琪炜,周洪利.基于MMC卡的嵌入式文件系统的设计与实现[J].现代计算机.2006.7.94-96
    [17]Microsoft Corporation.FAT:General Overview of On-Disk Format.Version 1.02[DB].www.mic-rosoft.com.1999
    [18]MMCA Technical Committee.The MultiMediaCard FAT16 File System Specification,Version 1.0[DB].www.cs.cmu.edu.2003
    [19]邓荣华,范赣军.基于BlueCore2-External蓝牙芯片的USB接口的设计和实现[J].2005.28(6).110-112
    [20]CSR.CSR BlueCore USB Kernel Device Driver Interface[DB].www.bluetoothchina.com.2005
    [21]孙鑫,余安萍.VC++深入详解[M].北京.电子工业出版社.2006
    [22]Per Haglund.Bluetooth Software and Hardware Development[D].University of London.2001

© 2004-2018 中国地质图书馆版权所有 京ICP备05064691号 京公网安备11010802017129号

地址:北京市海淀区学院路29号 邮编:100083

电话:办公室:(+86 10)66554848;文献借阅、咨询服务、科技查新:66554700