




已阅读5页,还剩12页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
第1页外文文献资料TheSystemDesignofWirelessBasketballTimerBasedonMCUandNRF24L01Abstract:Currently,Basketballplayersmustknowtheprogresswellintimeinthegame,thepresenceofelectronictimerwithLEDdisplayinfluencesthebasketballgames.Thewiredoperationinfluencesthecontroldistance,controlreliability,controlefficiencyandsoon.Sohowtomakeitlonger,anti-interference,easyoperationandhighefficiencyisadifficultproblem.Akindofwirelessbasketballtimerisdesignedbasedonmicro-computerunit(MCU)andwirelessnRF24L01moduletocompensatefortheexistingdisadvantages,whichhasLEDdigitaltubeoflargesizeforthesectionnumberdisplayandmiddlesizeforgamedisplayand24sdisplay.Theuseriseasytocarryandcontrolthetimerwirelesslyatanyplaceinthebasketballcourtusingthesendingcontroldevice.Thetestresultsshowthatthesystem,easytocontrolandstabletooperate,isreliabletotransmitthewirelessdata.Keywords:Basketballtimer,MCU,nRF24L01,systemdesign,wirelesscommunication1.INTRODUCTIONInthecurrentbasketballgames,playersneedtoknow24secandtheremainingtimeofeachperiodmatchintime;electronictimerwiththeadvantagesofitsconvenientoperation,compactsizeandvisualizationhasbeenwidelyusedinbasketballgames.NBAtimingandscoresystemwas第2页designedbyachipcalled8031ofMCS-51.Thesystemconsistsoftimecounting,scorecounting,keyboardsanddisplaysub-systems(Luo-Sheng,2004).AnewtimingandscoringequipmentforbasketballmatchwasdesignedandmadebyChineseBasketballAssociation,usedin2004CBAleaguematchandNBAinBeijing,whichwashelpfulforthepresenttimingandscoringequipmentspecializedinsportvenuesandhasgreatroomfordevelopmentandapplication(Zhangetal.,2006).Thecontrolsystemofbasketballscoreboardwith16*16matrixLEDwasdesignedbasedonsingle-chipmicrocomputer,whichcouldbeoff-lineandcontinuouslong-termoperationandsoon(Wei-Yuetal.,2008).Thedesignofhardwareandsoftwareoftiming-scoresystemwasachievedusing89C51,whichhadthefunctionsofthetotaltimeandthetotalcountdown,withitsfeaturesofmodulardesign,simpleprocessstructure,clearmandateandeasytoprepare(Hanetal.,2009).ThedevicewasbasedonP89V51RB2single-chipmicrocomputer,whichcanshowthecurrentsection,theremainingtimeandthescore,accordingtoactualsituations,thetimeandscorecanbeamended(Rong-Jianetal.,2010).ThecountdowncircuitwasdesignedbasedonSTC89C52single-chipmicrocomputer,whichcancountdown999days,accuratetoseconds.Theresultoftheexperimentdemonstratesthecorrectnessandfeasibilityofthedesign(Ze-Shi,2011).Althoughthesetimerorscoresystemsareconvenienttouse,therearesomedisadvantagesduringtheuseofthem,someareinconvenientforbothplayersasaresultofsmallsizeandthepositionofuseandsomeareinconvenienttoinstallandrepairandlowefficiencyandreliabilityandsoon,becauseofthelongcableconnectofbetweensendingdeviceandreceivingdevice.InthecurrentChinesemarket,aelectronictimerincludesasendingdevicewhichcanbemovedandareceivingdevicewhichisfixedonoroverthebasketballframe,canprovidereal-timeinformationoftimeforplayersandaudiences.Stillitiseasytocausebadconnectbecauseofthefrequentconnectofsendingdeviceandreceivingdevice.Inthebasketballgame,thebasketballrefereecanneedtomovefrequently,whichisawayfromthesendingdeviceandcannotcarryitduetothewireandmustpasssomeinformationaboutthegametotheliveoperatoroperatingthesendingdevice,whichcanleadtoinaccurateandnotimelyinformation.Accordingtotheabovereasons,asystembasedonMCUand第3页wirelesschipcanbeputforwardwhichcansendtheinformationwirelesslyandeasytocarry,etc.2.BASKETBALLTIMERBasketballtimerisanindispensableinstrumentinbasketballgames,whichusedtoshowtheinformationoftimeandquarterofthegame.Inaddition,inordertoacceleratethegame,playersshouldshootatthebasketwithin24sec,otherwiseitwillbreaktherule.Incommon,baskettimerisconnectedwithreceiverfromtransmitterbyRS232serial.However,theelectriccablesarefragileanddifficulttooperate.So,wirelessdatatransmissionisabetterchoice.SomeshortdistancewirelessdatacommunicationsuchasBluetooth,Zigbee,Wi-Fithatworkon2.4GHz,butthesetechnologiesarecomplicatedandcostmore,itisdifficulttomeettherapiddevelopmentandlowcostrequirementingeneralapplications.nRF24L01moduleisanewsinglechipRFtransceiverdevicelaunchedbyNorwayNordicSemiconductor,built-infrequencysynthesizer,apoweramplifier,acrystaloscillator,amodulatormodule(Zhangetal.,2004)andfusedwithenhancedShockBursttechnology,withadvantagesofhightransmissionrate,smallvolumeandlowpowerconsumption.NRF24L01chipwithPCBantennahas100meterseffectivetransmissiondistance,whichwillbesatisfiedwiththedesignrequirement.LQ-nRF24L01moduleofBeijingLong-qiuIntelligentTechnologyCenterisusedinthissystem(Xiu-MeiandNai-an,2004).Inthissystem,theuser(operator)canset,modifyandhaltthematchtimebyusingitskeyboardmodule.Atthesametimethematchquarterschanged,24Sball-controltimestartedandstopped.Thesystemwaseasytocarry;anywherewithin100metersfromthetimerdisplaysystemitcanbeoperatedeffectively.TheoverallsystemblockdiagramisshowninFig.1.第4页Fig.1:Thesystemblockdiagram3.HARDWAREDESIGNOFTHESYSTEM3.1.Keyboardmodule:Thekeyboardmoduleismainlyusedtosetandmodifythesectionnumber,thegametimeandstoptimeofthesection,24secofthestartandstopoperation.Consideringtheelectronicbasketballtimerrequiredfunctionandeasytoextend,a4*4matrixkeyboardisused.MCUscansthematrixkeyboardandreadsthekeyvaluethroughP0portper100ms.TheinterfaceofthecircuitisshowninFig.2.第5页Fig.2:KeyboardandMCUinterfacecircuit3.2.Sendingandreceiving(LQ-nRF24L01)module:Thesystemproposedashortdistanceofwirelessdatatransmissiondesignmethodbasedonthe2.4GHznRF24L01chip,whichhastheadvantagesoflowcost,lowpowerconsumption,fastdevelopmentetc.nRF24L01isamonolithicRFtransceiverchip,withautomaticresponseandre-transmittingfunctionandthedatacanbewrotethroughtheSPIBus.nRF24L01chiphasverylowpowerconsumption,forexample,workingcurrentisonly9mAandreceivingcurrentonlyfor12.3mAwhile-6dBmpoweristransmitted.Andwith125channels第6页availableandavarietyoflowpowermodessothattheenergy-savingdesignmoreconvenient,whilethemarketshavemanyothermodulesbasedonnRF24L01andeasytobuy.LQ-nRF24L01moduleisusedinthedesign.NRF24L01hasseveralworkingmodes;sender-receivermodelisonlyintroduced,whichhasthreemodessuchasEnhancedShockBurstTM,ShockBurstTMandDirectmode.Andthatcanbedeterminedbyconfigurationregister.FortheEnhancedShockBurstTMmode,insideFIFOstackareaisusedandinordertominimizeenergyconsumptionthedataareinputwithlowspeed,butareemittedwithhighspeed(1Mbps).SoEnhancedShockBurstTMtechnologycanreduceaverageworkingcurrentofthesystem.Inthemode,nRF24L01canprocesstheprefixandCRCcheckcodeautomatically,whichiscompletedbyCRCencodinganddecodingcircuit(Hong-Cai,2008).Duringdatatransmission,thepredixandCRCcheckcodeareaddedautomatically,meanwhileCEsignalissethighfor10usuntilthecompletionofthetransmission.Whilereceivingdata,theprefixandCRCcheckcodewillbedeleted.InterfacecircuitdiagramisshowninFig.3betweenLQ-nRF24L01moduleandMCU,CSNportofthemoduleisachipselectwithactivelowlevel,SCKportforserialclock(SPIclock).DuetonostandardSPIbusinterfaceforATMEL89C51MCU,thefunctionofSPIBusissimulatedbythesoftware.MISOisahostinput/slaveoutputportandMOSIisaslaveinput/hostoutputdataport.IRQportistheinterruptsignalline,whiledataissentsuccessfullyIRQsignalchangedintolowlevel.CEportismodecontrolofthechip,undertheconditionoflowCSNlevel,nRF24L01statusisdecidedbyCEandnRF24L01configrationregister.Fig.3:LQ-nRF24L01moduleandMCUinterfacecircuit3.3.LEDdisplaymodule:第7页Inordertoimprovethedisplayeffectandincreasedvisibility,LEDdigitaldisplaydeviceisusedinthesystem.Accordingtothedisplayactualsituation,LEDdigitaltubesofmiddlesizeareadoptedtodisplaythesectionnumberandthegametimeandLEDdigitaltubesoflargesizeareadoptedtodisplaycontroltime.BecauseoftheseLEDdigitaltubesaredrovebyhighervoltwhich51-MCUcannotafford,ULN2803driverchipwithDarlingtontubeofsufficientmagnificationisused(Lietal.,2011)andtheschematicdiagramisshowninFig.4.Inordertoreducethecomplexityofthesystem,thedynamicscanmodeisusedtocontroltheLEDdisplayhere.ThevalidbitdisplaymethodcanimprovetheMCUefficiency,whereoncethebitisavalidvalueitcouldbedisplayed.Fig.4:LEDdigitaltubeandMCUinterfacecircuit4.SOFTWAREDESIGNOFTHESYSTEMCorAsmlanguagecanbeusedtodesigntheMCUprogramwith51kernels.AndClanguagewiththecharacteristicofsimpleandeasytounderstand,soitcouldacceleratethedevelopedprogramspeed,atthesametimeconvenienttransplantationbetweendifferentMCUs.Asmlanguageisrelativelydifficulttoreadandgraftandtherateofdevelopmentisslower,butithasthehighestexecutableprogramefficiency(Hong-Cai,2008;Yun-Xinetal.,2009).ClanguageischoseninthesystembecauseofthecurrentClanguageinthepowerfulcompilercanalreadyhasthesimilarefficiencycomparedwithassemblerlanguage.Wirelessbasketballtimersoftwaredesignmainlyincludesthetransmittingandreceivingparts.第8页4.1.Transmittingprogramdesign:Mainfunctionsofthetransmittingpartareasfollows:atfirst,theinitializationofMCUandnRF24L01moduleandnRF24L01issettransmittingmode,thenthekeyboardisscannedatfixedtimeandthekeyvalueisgotandthatistransmittedwirelesslywhichisencodedbythenRF24L01module.TransmittingmodeconfigurationofnRF24L01moduleisasfollows(ZhuandZhang,2011):(1)SetCSNhigh,CElowandconfiguringmode(2)Delayabove130us(3)ConfigurationdataiswrittentotheLQ-nRF24L01modulebyI/OportofMCU(4)SetCSNlow,completingconfiguration(5)SettheCEhigh,nRF24L01forTXmode(6)Delayabove130us(7)DatatobetransmittediswrittentotheLQ-nRF24L01FIFObufferbyI/OportofMCU(8)SetCEislow,transmittingthroughShockBurstTXmode(9)ClearFIFObufferaftercompletingtransmission(10)TheprogramdiagramisshowninFig.5.Fig.5:Transmittingprogramdiagram第9页4.2.Receivingprogramdesign:Mainfunctionsofthereceivingpartareasfollows:whileavalidpacketcouldnotbereceived,thedataofdifferentdisplaybuffersarereadanddisplayedonthecorrespondingLEDdigitaltube.Andwhileavalidpacketcouldbereceived,thereceivingcontrolsystemisinterruptedandthereceiveddatainthenRF24L01modulearereadandstoredtothecorrespondingdisplaybuffers.ProgramflowdiagramisshowninFig.6.Fig.6:Receivingprogramdiagram,(a)mainprogramdiagramofthecontrolsystem,(b)interruptserviceroutinediagramReceivingmodeconfigurationofnRF24L01moduleisasfollows(ZhuandZhang,2011):(1)SetCEhigh,nRF24L01forreceivingmode(2)WhileRX_DRbitoftheSTATUSregisterbecomestohighlevel,thatconfirmstheFIFObufferofnRF24L01hasreceivedthedataandMCUreadsthesedatabytheinterruptmode(3)ClearFIFObufferaftercompletingtoreaddata5.CONCLUSIONThestudyintroducedakindofwirelessbasketballtimerbasedontheMCUandnRF24L01module,thecurrentsomeproblemcanbesolvedsuchaswiringinconvenientansoon.Thesystemhastheadvantagesofsimplestructure,convenientinstallationandrepair,convenientoperation,lowcostand第10页flexiblelayout,soithasgreatvalueinpracticalgeneralizationandapplication.第11页中文翻译稿基于单片机和NRF24L01的无线篮球定时器的系统设计摘要:目前,篮球运动员必须及时地很好的知道比赛的进展情况,带有LED显示屏的电子定时器的存在对篮球比赛产生了很多影响。有限操作影响控制的距离,控制的可靠性和控制的有效性等等。因此如何使它更长距离控制,有更高的抗干扰性,有更简便的操作和高度的有效性是一个困难的问题。一种基于单片机(MCU)和无线芯片nRF24L01设计模块的无线篮球计时器可以用来补偿以上的缺点,它有大尺寸LED数码管用来段数显示和中型的尺寸作为比赛和24秒的显示。裁判可以在篮球场上任何地方使用发送装置对定时器进行控制,并且它很容易携带。试验结果表明,该系统稳定,易于控制和操作,使无线传输数据具有可靠性。关键词:篮球计时器,单片机,nRF24L01,系统设计,无线通信第1章引言在目前的篮球比赛中,运动员需要知道24秒,以及比赛期间每个时间段剩余时间;电子计时器以其简便的操作,体积小和易于观看的优势,已被广泛应用于篮球比赛。NBA使用由8031MCS-51构建的计时和评分系统。该系统由计时,计分,键盘和显示子系统构成。一个由中国篮球协会设计和制造的新的篮球比赛计时计分设备,用于2004年北京CBA和NBA联赛。这有助于在体育场馆的目前用于计时计分的专用设备的发展和应用,同业具有巨大的发展空间(张等人.2006)。16*16矩阵LED篮球计分牌控制系统是基于单片机设计的,并且可以长期连续地离线运作等。计时评分系统的硬件和软件的设计是采用89C51单片机实现的,具有总时间计算和倒计时功能,其设计模块化,程序结构简单,指令清晰并且容易配备。该设备是基于P89V51RB2单片机,它可以显示当前部分,剩余时间和得分,根据实际情况,时间和分数可以修改。倒计时电路是基于STC89C52单片机设计的,它可以倒计时999天,精确到秒。实验结果证明了设计的正确性和可行性。虽然这些定时器和评分系统方便使用,但他们在实际使用中仍然存在一些弊端,由于小尺寸和摆放位置导致了双方球员的不便,还有难以安装和修理的不便,这些都是发送装置和接收装置之间的长电缆导致的。在目前的中国市场,一个由可以移动的发送装置和一个固定在篮球框的接收装置制成的电子计时器,便可以为运动员和观众提供时间的实时信第12页息。还是很容易造成因为频繁地连接发送和接收设备而造成的接触不良。在篮球比赛中,篮球裁判可能需要经常移动,发送设备因为电线的缘故不能随身携带,但必须传递关于比赛的资料,这就要远离发送设备。只能由操作人员操作发送设备,这可能会导致信息的不准确和不具有实时性。基于以上原因,基于单片机和无线芯片可以做出具有无线传输和方便携带等功能的系统。第2章篮球计时器篮球计时器在篮球运动中是不可缺少的工具,用于显示时间和比赛阶段信息。此外,为了加快比赛节奏,选手必须在24秒内投篮,否则将算作犯规。一般而言,篮球定时器通过连接RS232串口进行信号收发。然后电缆是脆弱并且难以操控的。因此无线数据传输是更好的选择。一些短距离无线数据通信技术,如蓝牙,wifi等工作在2.4GHZ,但是这些技术复杂,成本高,难以满足快速发展的一般应用的低成本要求。NRF24L01模块是一个由挪威北欧半导体推出新的单片射频收发装置,内置频率合成器,功率放大器,晶体振荡器,调制器模块并融合增强的冲击地压技术,具有传输速率高,体积小,功耗低的优点。基于NRF24L01芯片的PCB天线有100米的有效传输距离,这满足设计要求。北京长秋智能技术中心的LQ-nRF24L01应用于本系统。在这个系统中,用户(操作员)可以通过使用键盘模块建立,修改和停止比赛的时间。包括比赛段的改变,24秒的开始和停止。该系统便于携带,在计时器显示系统100米范围内的任何地方都可以有效地操作。该系统总体框架如图1所示。电源模块时钟模块发送结束单片机控制系统键盘模块LED数码管显示接收结束单片机控制系统无线发送模块无线接收模块电源模块时钟模块接收和发送图1系统模块框图第3章该系统的硬件第13页第3.1.节键盘模块键盘模块主要用于设置和修改比赛的阶段,比赛开始时间和终止时间,24秒的启动和停止。考虑到电子篮球定时器所需要的功能和已与扩展的特性而使用了4*4的矩阵键盘。单片机扫描矩阵键盘通过P0口每100毫秒读取一次键值。该电路的接口,如图2所示。图2键盘和单片机的接口电路第3.2.节发送和接收(lq-nrf24l01)模块该系统提出了一种基于nRF24L01芯片工作频率为2.4GHz的短距离无线数据传输的第14页设计方案,具有成本低,功耗低,快速发展等特点。NRF24L01是单片射频收发芯片,具有自动应答、转发功能,可以通过SPI总线写入数据。NRF24L01具有非常低的功耗,例如当发送频率为-6dBm时工作电流只有9mA,接收时电流为12.3mA。有125个频道和多种低功耗模式,使节能设计更方便,而市场上也有许多其他基于NRF24L01的模块,并且很容易购买到。本设计中应用LQ-nrf24l01模块。NRF24L01具有多种工作模式,本课题只介绍信号收发模式,它还具有三种模式如增强型,节能型和直接模式。这可以通过配置寄存器确定。在增强模式下,在先进先出的堆栈区使用,以减少能量消耗,但是以高速发射的(速度高达1Mbps)。因此,增强型单片机TM技术可以降低系统的平均工作电流。在该模式下,nRF24L01的可自动加工前缀和CRC校验码,它是由CRC编码和解码电路完成。在数据的传输过程中,普迪斯科和CRC校验码会自动添加,同时CE信号被设置为持续10秒钟的高电平,直到数据传输完成。在数据接受时,普迪斯科和CRC校验码会被删除掉。接口电路在LQ-nRF24L01模块和单片机模块中间,如图3所示,该模块的CSN是一个低频片选端口,SCK是串行始终端口(SPI时钟)。由于没有标准的SPI总线接口用于ATMEL89C51MCU,SPI总线的功能是通过软件模拟。MISO是主机输入/从机输出端口,MOSI是一个从机输入、主机输出的数据端口。IRQ端口是中断信号线,当数据被成功发送时IRQ信号变为低电平。CE端口是芯片控制的模块,当CSN处于电平时,nRF24L01的状态是由CE和nRF24L01配置寄存器决定。图3LQ-nRF24L01模块和单片机的接口电
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
评论
0/150
提交评论