首页 外文文献及翻译:基于STC89C52单片机的多路抢答器设计

外文文献及翻译:基于STC89C52单片机的多路抢答器设计

举报
开通vip

外文文献及翻译:基于STC89C52单片机的多路抢答器设计2010InternationalConferenceonIntelligentComputationTechnologyandAutomationDesignandImplementofResponderBasedonFreescaleHCS12SingleChipMicrocomputerChengQiming,ChengYinman,WangMingmei,ChangLinCollegeofElectricPowerandAutomationShanghaiUniversityofElectricPowerC...

外文文献及翻译:基于STC89C52单片机的多路抢答器设计
2010InternationalConferenceonIntelligentComputationTechnologyandAutomationDesignandImplementofResponderBasedonFreescaleHCS12SingleChipMicrocomputerChengQiming,ChengYinman,WangMingmei,ChangLinCollegeofElectricPowerandAutomationShanghaiUniversityofElectricPowerChangyang2588road,Yandpudistrict,Shanghai200090,ChinaE-mail:chengqiming@sina.com Abstract—An8-channelresponderbasedonFreescaleHCS12singlechipmicrocomputerisdesigned.Therespondercandisplaythenumberofthefirstplayercorrectly.Italsocancountthescoresandshowtheplayerwiththehighestscore.Thesystemincludesfourmodules:CPU12,theSCIserialcommunication,digitaldisplaytubeandtimer.Whencompetitionsignalinput,itisbeencaughtandthencauseinterruption,thetimerisusedtotimeaccurately,theserialportisusedtosendandreceivethestartanswersignal,judgmentsignalandothersignals,thedigitaldisplaytubeisusedtoshowthescoresofthecurrentplayer.LCDdisplaytubeshowssubjectsandanswers.Sothebasicfunctionsoftheresponderareachieved.Keywords--responder;singlechipmicrocomputer;timer;inputcapture;interruptionI. INTRODUCTIONResponderisalsoknownasthefirstsignaldiscriminator,whichiswidelyusedinvariouscompetitions.Itcanjudgethenumberofthefirstplayeraccurately,fairlyandintuitively.Currently,avarietyofquizresponderhasemergedonthemarket,inwhichasmallresponderiscommonlydesignedwithsmall-scaledigitalintegratedcircuit.Althoughthetechnologyhasbeenquitemature,butitissimplefunction,lowintelligence,highfault,simpledisplay,lessflexibility,notconvenienceforupgrade,ithasbeenunabletomeetallkindsofrequirementsforintellectualcompetitionsandvarietyshows.Therefore,itisnecessarytodevelopsomekindsofresponderwhicharemoresuitableforapplications.Inrecentyears,withtherapiddevelopmentofscienceandtechnology,theapplicationsofsingle-chipmicrocomputerarebecomingwidely,whichpromotesthedevelopmentoftraditionalmeasurementandcontroltechnology.Inthispaper,FreescaleHCS12[1-3]isdesignedasacorecomponenttoachieveanintelligentdigitalresponderwith8-channel[4-8],ithassomebreakthroughsontechnology,functionandotheraspects,comparingwiththepastresponder.Itischaracterizedbysimplestructure,powerful,goodreliability,practicability,sothatthecompetitioncanreallycarriedoutonjust,fairandopenrules.II. FUNCTIONOFRESPONDERThebasicfunctionsofresponderdesignedinthispaperare:(1) Thesystemcanlimitthecompetitiontimeandanswertimeofthealarm;1ThisworkissupportedbyLeadingAcademicDisciplineProjectofShanghaiMunicipalEducationCommission(ProjectNumber:J510301,J510303)978-0-7695-4077-1/10$26.00©2010IEEEDOI10.1109/ICICTA.2010.1281127(2) Thesystemcanidentifytheanswersignalandidentifytheplayer’snumber;(3) Thesystemcancalculatescoreforeachplayeranddisplaythescores.Respondercanaccommodate8playersnumbered1to8.Inaddition,LEDdigitaltubesaredesignedtodisplaythelatcheddata.Afterracehostclearsthesystem,ifparticipantspressswitch,andafteransweriscertificatedwhetheritiscorrectornot,thenumberoffirstplayertoanswerinactionisimmediatelyshownbydigitaltubes.Respondershouldhaveastrongabilitytodistinguishplayerstoanswerintheaction,itsresolutionreachesatleastafewms.III. IDEASOFRESPONDERDESIGNAftertherequirementsandfunctionsofresponderareanalyzed,thefollowingcircuitsarerequiredingeneral:A RespondercircuitThecircuithastwofunctions:oneistoidentifythenumberoftheplayerwhopressbutton,andtosavethenumber;theotheristoprohibittheotherplayersfrombuttoningortomakeotherbuttonsnotavailable.B TimingcircuitsHostcansetcompetitiontimeandanswertimebythetimepre-set-circuit.Ifnobodycananswerquestionwithinthesettime,allplayerswillnotgetscore,thenthehostwillannouncetheanswer.Besides,ifsomeonegetsthechancetoanswerthequestion,butdoesnotgivetherightresultbeforetheallowabletime,heorshewon’tgetthescore,theovertimesignalwillbealsosend,thehostwilldeclaretherightanswer.FreescaleHCS12containstimermodule,thetimermodulecanbedirectlyused.C OvertimecircuitHCS12willsendovertimesignalwhentimegoesbeyondthesettime,thissignalwillbetransferredtothePCcomputerbytheserialport.Thenextquestionwillbeproceededtoanswer.D Scorescountanddisplaycircuit.Whenhostpressestheanswerkey,itistimetostarttoanswer,ifoneplayerpressestheanswerkey,hisorhernumberwillberecorded,hisorherscorewillbecountedanddisplayedontheLEDdigitaltubes.Bedsidethecircuitsdesignedabove,somenecessarylogicdesignsarealsonecessary.Thelogicdesignsareasfollowing: First,thehostwillreadthequestionwhichwillshowintheLCD;next,thePCcomputerwillsendletter“k”,whichmeansthatplayisbeginningtocompetition.Atthesametime,timingcircuitstartstowork,ifnobodygetsthechancetoanswerthequestionwithinpermittedtime,microcontrollerwillsendtheword“chaoshi”toPCcomputer;Ifsomeonepressesthecompetitionkeywithinthespecifiedtime,microcontrollerwillsendhisorhernumber.Ifthetimegoesbeyondthepermittedtime,PCcomputerwillsend“next”whichmeansturningtothenextquestion,thenextquestionwillbeautomaticallyshowedtoanswer.Ifsomeplayergetsthechancetoanswerthequestion,hisorhernumberandscoreswilldecrease1automaticallyandshowinthedigitaltubes,thenmicrocontrollersends“next”togoonthenextquestion.Ifthescoreisfewthan0afterdecreasing,playeriseliminated.TherightanswerwillshowontheLCD.Finally,ifallthequestionsaredone,microcontrollerwillsend“e”toendthegame,thenthescoresofallplayerswillbecomputed,thehighestonewillbeshownonthedigitaltubes.IV. DESIGNOFRESPONDERHARDWAREResponderhardwareisfirstlydesigned;ResponderhardwareistakendirectlyfromthehardwareresourcesofFreescaleHCS12developmentboarddevelopedbySuzhouUniversity.ThedevelopmentboardtakesMC9S12DG128asthecore,usingmodulardesignapproach,itextractspartofI/Oresources,anditalsoprovideseachmodulewithacorrespondinginterfacecircuit.ItalsoprovidesA/Dinputchannels,PWMlow-passfiltercircuits,16-keykeyboardinputchannels,8-bitdigitalI/Ocircuits,SPII/Ocircuits,SCIcommunicationcircuits,I2CbusI/Oexpansioncircuitsandsoon.Inthispaper,thehardwaremodules,thepinconnectionsandthecorrespondinginterfacesofthedevelopmentboardarelistedandunifiedtoredesignbyactualneedsofthesystem.Figure1showsthehardwarestructurediagramoftheselectedpartofdevelopmentboard.Figure1.DiagramofhardwarestructureA SelectionofhardwaremodulesTheresponderdesignedinthispaperisrelativelysimple,theI/Oportsandthemodulesinvolvedarenotmany.(1) Thesystemusespush-buttonswitchasthecompetitionkey,whichisgenerallyusedasaswitchinput,thereare0and1.Here,thesystemneedknowwhetherthebuttonisswitchedbysomebody,thesystemneednotcareabouttheswitchonoroff.(2) Timermoduleisindispensableintimingcircuit.Here,thetimermodule'sfunctionsaretolimittime,andtocaptureinputsignals.Thiswillbefollowedsomeofthecircuitdesigndescribedindetail.(3) LEDdigitaltubesareusedtoshowtheparticipant’snumberandscoresinthedisplaycircuit.Thesystemrecordstheplayer'snumberandthecorrespondingscore,andthentransmitstotheLEDdigitaltubesthroughI/Oports.LCDisachievedbyexternalconnectionmodule;itisusedtodisplayquestionsandanswers.(4) LEDsmalllightisusedtoshowwhethersomebodypressesthecompetitionbutton.Ifplayeranswer,thesmalllightwillbebright,otherwise,itwillnotlight.(5) SCImoduleisnecessaryinserialcommunicationport.SincethesignalthatstartstoanswerneedstobesendbyPCcomputer,ifthereisnoserialcommunicationport,thewholesystemwillbeparalyzed.ThefunctionofSCImoduleisthatreceivesthesignaltoHCS12,andthensendstheplayer’snumbertoPC.B Designofhardwarecircuits1) CompetitioncircuitdesignCompetitioncircuitcapturescompetitionsignalsbymeansofinputcapturing;therewillbeainterruptiononcethepush-buttonswitchjumps.8push-buttonswitchesareconnectedwith8channels,sothesystemcanknowwhichplayercompetestoanswerthequestionbyreadingcorrespondingchannel.Inthispaper,the8channelsconnectwithinputcapturechannelsPT0~PT7ofHCS12.2) TimingcircuitAstheHCS12hasitsowntimingmodule,timingcircuitdon’tneedtobedesigned,andinternaltimingmoduleofHCS12canbedirectlyused.3) OvertimeremindingcircuitSmalllightorbuzzercouldconnectwithanyI/Oport,butthesystemshouldensuretheselectedI/OportshavenotconflictwiththeI/Oportsoccupiedbythemodule.Oncethespecifiedtimeisover,I/Oportsendahighlevel,andtheLEDsmalllightison.Inthispaper,thefirstpinofPAportischosenasthealarmsignalport;thispinisconnectedtothetestingofsmalllight.4) ElectroniccounteranddisplaycircuitThescoringscorescanberesolvedbyprogramming,butthedisplayingscoresneedshardwareconnection,LEDdigitaltubesandLCDareconnectedwithcorrespondingI/OportsofHCS12,externalLCDmoduleshouldhavethefunctionofdisplayingChinesecharacters.5) CommunicationconnectThedevelopmentboardhasa9-pincableofRS232serialport;itcanbeconnectedwithPCcomputerbythecable.V. DESIGNOFRESPONDERSOFTWAREA Designofsoftwaresubprogram1) SCIsubprogram(1) SCIinitializationfunctionSCIinitializationistosetcorrespondingregister,mainlytosetserialportbaudrate,herebaudrateissetto9600bps,thebaudrateis:Bt=fBUS/(16*BR) (1)where,BRissetbySCIbaudrateregister,anditisa16-bitregister,isassignedtwice,firstsetthelow8bits,andthenset thehigher5bits,thefirstthreeofhigh8bitsaremeaningless;fBUSisthebusfrequency.Thenextistosetcontrolregisters(SCICR1andSCICR2),hereSCIserialportbeallowedtorun,andthenormalcode,8-bit,noparitydataisoutput.TheD6bitoftheSCICR1(SCISWAI)isaSCIallowingbit,SCImoduleisprohibitedatSCISWAI=1,SCImoduleisallowedwhenSCISWAI=0;D4bit(Mbit)isachoicebitofpattern/characterlength,itisusedtodefinethesending/receivingdataformat,9-bitdatatransferisallowedatM=1,8-bitdatatransferisallowedatM=0;D1bit(PE)istheparityenablingbit,PE=1allowsparity,PE=0doesnotallowparity.SCICR2needsalsotobesetinordertoreceiveandsenddata,theD3bitofSCICR2(TE)isatransmitterallowingbit,TE=1allowstosend,TE=0prohibitstosend;D2bitisreceiverallowingbit,RE=1allowstoreceive,RE=0prohibitstoreceive.(2) SCIsendingfunctionFirstly,1bitsendingfunctionofserialportshouldbeprogrammed.Atthebeginning,SCIstatusregister1(SCISR1)needstobejudged,itsD7bit(TDRE)sendstheemptyflagofdataregisteratTDRE=1,whichmeansthatthedatatosendhasalreadymovedintothesendingshiftregister,ifthedataregisterisempty,thenewdatathatiswrittenintothedataregistercanbesent.Morebitsdatasendingfunctioncallsrepeatedly1bitsendingfunctionsuntilthesendingisover.(3) SCIreceivingfunctionSimilarly,1bitreceivingfunctionofserialportisprogrammed.Here,SCIstatusregister1(SCISR1)isjudged,itsD5bit(RDRF)representsthefullflagofthereceivingdataregister.RDRF=1meansthatthereceiverisfull,thereceiveddatacanbereadfromtheSCIdataregister,then,thedataneedstobereadoutfromdataregister(SCIDR).Thereceivingdataisonemorestepthanthesendingdata,whichitistodeterminewhetheranydatahasbeenreceived.Ifthereceivingprocessisfailed,FFHdatawillbereturned.Morebitsdatareceivingfunctioncallrepeatedly1bitreceivingfunction,andthesystemwillreportthereceivingerroraslongasthereis1bitreceivingfailure.2) Timersubprogram(1) TimerinitializationWhentimerisinitialized,timerisprohibitedtoworkuntiltimerisused.TheD7bit(TEN)oftimercontrolregister1(TSCR1)isanenablingbitoftimer,timerisenabledatTEN=1,andtimerisdisabledatTEN=0.Thefollowingstepistoallowthetimerinterruptandtoprohibitthetimerreset.TheD7bit(TOI)andtheD3bit(TCRE)oftimercontrolregister2(TSCR2)arerespectivelytheenablingbitoftimeroverflowinterruptandtheresetenablingbitoftimercounter,timerinterruptisallowedatTOI=1,otherwise,timerinterruptisnotallowedatTOI=0.WhenOC7issuccessfullycompared,thecountercanberesetatTCRE=1,itcan’tberesetatTCRE=0;D2~D0bits(PR2~PR0)ofTSCR2aretheselectionbitsoffrequencyfactor,theyareusedtosetthedivisionfactorofbusclockfrequency,frequencydivisionfactorpcanbe1,2,4,8,16,32,64or128.Theoverflowtimeoftimercanbedescribedasfollowing:t=np/fBUS (2)where,nisthecountvalueofcounter;fBUSisthebusclockfrequency;pisthefrequencydivisionfactor.Inthispaper,n=216=65536,pischosentobe2,t≈0.03s,tismuchclosedto1/38s,38interruptionsisabout1s.(2) InputcapturinginitializationFirst,theoptionistocaptureinputortocompareoutput.Theselectregisterofinputcapturing/outputcomparing(TIOS)isusedtodothiswork,theDxbit(IOSx)oftheregisteristheselectbitofxchannel,thexchannelissetastheoutputcomparingchannelatIOSx=1,anditissetastheinputcapturingchannelatIOSx=0.Inourdesign,because8playerstakepertinthecompetition,8channelsshouldallbesetasinputcapturingchannels,namelyTIOS=0x00.Afterinputcapturingisset,theinterruptionalsoneedstobeopen,whichitshouldbedoneafterthecompetitionisallowed.3) SubprogramofLEDdigitaltubes(1) InitializationofLEDdigitaltubesLEDdigitaltubesareusedtodynamicdisplay,itsinitializationistheI/Oportinitialization,thedirectionregistersofcorrespondingI/Oports(thepinsof8-bitdataportareconnectedwith7-segmentdigitsanddecimalpointofdigitaltubes;thepinsof4-bitbitchoiceareconnectedwith4digitaltubes)aresettobeoutput,thatis,dataportis0xFF,bitchoiceportis0xF0.(2) DisplayofLEDdigitaltubesThebasicideaofLEDdigitaltubesdisplayisthatthedisplaycodesofallthenumbersandthechipselectcodeofthedisplayingbitsarestoredintothecorrespondingregisters,whendisplayfunctionsarecalled,theparameternumbersoffunctionscanmatchwiththenumbersandthebitsinthetablesofnumberdisplaycodeandchipselectcode4) LCDdisplay(1) LCDinitializationThemoduleisenabledandthelatticesizeisdefinedas8*8or8*10,thedisplayformatisdefinedas1rowor2rows,thedisplayofChinesecharactersisused.(2) SubprogramofLCDdisplayTheemphasisoftheprogramisthedisplayofChinesecharacters.ChinesecharactersareidentifiedbytwoASCIIcodes.TheASCIIcodesofChinesecharacterstobedisplayedarerecordedintodataregisters.B Designofinterruptservicesubprogram1) SubprogramofoverflowinterruptionThefrequencydivisionfactorhasbeensetintheprogramoftimerinitialization,38interruptionsisabout1s,sothecountervariableneedstobeset,itadds1automaticallyaftereachinterruption,itcallsthesecondaccumulatingfunctionafter38interruptions.Itneedstobenotedthattheinterruptionflagregister2(TFLG2)issetto0aftereachoverflowinterruption.Otherwise,thesystemisalwaysidentifiedasoverflowinterrupt.D7bitoftheregisterisTOFbit,whenthe16-bitrunningcounterchangesfrom$FFFFto$0000,theoverflowinterruptoccurs,thisbitissetto1,thisbitcanbeclearedbywriting0toit,other7bitsareinvalid.TheflowofoverflowinterruptisshowninFigure2.2) SubprogramofinputcapturinginterruptionThemaintaskofinputcapturinginterruptionprogramistojudgewhetherplayercompetestoanswerandtorecordtheplayer’snumber.Theinterruptflagbitneedstobeset,itissetto1whenaninterrupthappens,whichmeansthatsomeone competestoanswer,andthenthepersonnumberwillberead.Interruptflagregister1(TFLG1)ofmaintimerisusedtoreadtheinterruptchannel.ItsDxbit(CxF)istheinterruptflagofinputcapturing/outputcomparingchannelx,whenaninputcapturing/outputcomparingeventhappen,thecorrespondingbitissetto1,thechannelnumberofcorrespondinginterruptingcanreadfromTFLG1registeranditisalsothenumberofcompetitionplayer.Tonotethat,theflagregisterneedstobeclearedaftertheflagregisterisread.Theflagregistercanbeclearedwhentheappropriatechannelissetto1.TheflowofinputcapturinginterruptisshowninFigure3.VI. CONCLUSIONSResponderisoneoftheessentialdevicesinvariousknowledgeandintellectualcontests,thedevelopmentofbetterandmoreintelligentdigitalresponderisverysignificant.Responderdesignedinthispapercanachievearesponder'sbasicfunctionsthroughexperimentalprototypetesting.Itreachesthedesigntargetwithreasonabledesign,simplestructure,goodcommonality,strongfunction,reliableanswerandquickreaction.However,ashardwarelimitationsofdevelopmentboard,somefunctionshavenotbeenabletoachieve,suchasthedevelopmentboarddoesnothaveenoughLEDdigitaltubestodisplayallplayer’sscoressimultaneously,thehostcannotadjustanswertimeaccordingthedifficultyofthequestionandsoon.Theseissueswillremaintobeaddressedinfuturedevelopment. Figure2.Flowofoverflow Figure3.Flowofinputcapturinginterrupt interrupt C ThemainprogramdesignBeforethestartofthemainprogram,thetotalinterruptionsareturnedoffandeachmoduleisinitialized.Theinitializationofeachmodulehasbeendoneinthecorrespondinginitializationsubprogramofeachmodule.Hereweonlyneedcallthecorrespondinginitializationsubprogram.Aftertheinitializationofeachmoduleiscompleted,thetotalinterruptionsshouldbeturnedon.Themainbodyofthemainprogramisaloopstructure;therearealsoseveralsub-cyclesinthemainloop,whichareusedforthecyclewaitingofeachloop.TheflowofthemainprogramisshowninFigure4.Afterthecompletionoftheinitialization,thesystemhasbeenwaitedforthesignalofcompetitionstartwiththecircularmodeuntilthesignalcomes.Whenthissignalisreceived,thesystemcheckswhetherthecycletimeisovertime,ifitisovertime,thesystemchangestothenextquestion,otherwise,thesystemchecksthecompetitionsignal,ifsomeplayercompetestoanswer,thenthesystemcheckswhethertheanswertimeisout,ifthetimeisnotout,thesystemjudgeswhethertheresultistrue,iftheresultisright,theplayerisadded1point,otherwise,theplayerissubtracted1point,andthesystementersthenextquestion.Totheplayerwhosescorewillbesubtracted,thesystemneedstocheckwhetherthescoreislowthan0,ifitdoes,thisplayer’sinputchannelisturnedoff.Tobenotedthat,ifthecompetitionflagis1,itshouldbecleared.Figure4.FlowofthemainprogramREFERENCES[1]StevenFB,DanielJP.Embeddedsystems–usingtheHCS12microcontrollerdesignandapplication[M].NewYork:PublishingHouseofElectronicsIndustry,America,2006.[2]WangYihuai,LiuXiao.Embeddedsystems–thedesignandapplicationofHCS12microcontroller[M].Beijing:BeijingUniversityofAeronauticsandAstronauticsPress,2008.[3]WangWei.PrincipleandapplicationsofHCS12microcontrollers[M].Beijing:BeijingUniversityofAeronauticsandAstronauticsPress,2007.[4]ZhangRuixi.Designofquizresponder[J].MechanicalandElectricalEngineeringandTechnology,2007,vol.36,no.8,pp.51-52.[5]LiMing,TanAndrew,ZhuShunli.8-wayintelligentresponderbasedontheLPC932singlechipmicrocontroller[J].OrdnanceAutomation,2007,vol.26,no.7,pp.70-71.[6]ChouKungming,ZhouChenchen.Designof9-waymulti-functionalquizresponderbasedonthesinglechipmicrocontrollerAT89C2051[J].Modernelectronictechnology,2006,vol.25,no.20,pp.4-6.[7]WangGongtang,YangShanying.16-wayresponderbasedonthePIC16F873[J].ComputerDevelopment&Applications,2006,vol.19,no.9,pp.9-13.[8]GongChanglay.Designofintelligentrespondercontrolledbysinglechipmicrocomputer[J].GuangdongAutomationandInformationEngineering,2003,no.3,pp.28-30. 基于飞思卡尔HCS12单片机设计和实施的抢答器程启明,程尹曼,汪明媚,常林上海电力学院电力与自动化 工程 路基工程安全技术交底工程项目施工成本控制工程量增项单年度零星工程技术标正投影法基本原理 学院,上海,200090摘要——基于飞思卡尔HCS12单片机的八通道抢答器设计。抢答器可以正确的显示首位成功抢答选手的号码。它还可以计算分数,并显示得分最高的选手。该系统包括四个模块:CPU12、SCI串行通信、数字显示管和计时器。抢答信号输入时将被锁定,然后引起中断、定时器准确的工作。串行端口用于开始应答信号的发送和接收,区分不同信号。数码管用于显示当前选手的分数,液晶显示管用于显示科目和 答案 八年级地理上册填图题岩土工程勘察试题省略号的作用及举例应急救援安全知识车间5s试题及答案 。所以抢答器的基本功能得以实现。关键词:抢答器;单片机;定时器;输入锁定;中断一、导言抢答器也被称为第一信号鉴别器,它广泛的用于各种比赛。它可以准确、公正、直观的判断首位成功抢答选手的号码。目前,市场上出现了各种小规模数字集成电路设计的抢答器,虽然该技术已经相当成熟,但是设计的抢答器功能简单,不智能,故障率高,显示简单,缺乏灵活性,改进又不方便。它已经无法满足各种知识竞赛和各种节目的需求。因此,有必要制造出一些更适合应用的抢答器。近年来,随着科学技术的迅猛发展,单片机的应用越来越广泛,这促进了传统测量和控制技术的飞速发展。在本文中,飞思卡尔的HCS12[1-3]单片机作为设计一个八通道[4-8]智能抢答器的核心部件,与过去的抢答器相比,它在技术、功能和其他方面都有了较大突破。它的特点是结构简单,功能强大,可靠性好,实用性强,这样的竞争才能真正公正、公平、公开的进行。二、抢答器功能本文设计的抢答器基本功能是:(1) 该系统可以调整比赛时间和答题倒计时提示时间;(2) 该系统能识别抢答信号并确定选手的号码;(3) 该系统可以计算出每位选手的得分并显示出来。抢答器可以提供8名选手使用编号为1至8。此外,LED数码管显示锁存数据。在主持人清除系统后,如果参与者按下抢答开关,并且无论答案正确与否,第一个抢答者的号码将立即由数码管显示。抢答器应该有很强的能力来区分选手抢答的先后顺序,其分辨率至少达到几毫秒。三、抢答器设计的思路对抢答器的 要求 对教师党员的评价套管和固井爆破片与爆破装置仓库管理基本要求三甲医院都需要复审吗 和功能进行分析后,一般需要以下电路:A响应电路该电路有两个功能:一个是识别抢答时该选手的号码并将其保存;另一个是在抢答成功时系统将禁止其他选手抢答。B时序电路主持人可以通过预先的电路来设置比赛时间和答题时间。如果在设定的时间内没有人回答问题,那么所有的选手将不会得分,然后主持人将公布答案。此外,如果有人获得回答这个问题的机会,但在规定的时间内给出的答案不正确,他也不能得分,若超过了时间也不得分,主持人将宣布正确的答案。飞思卡尔HCS12单片机包含定时器模块,并且可以直接使用。C超时电路若超出了设定的时间HCS12将发出超时信号,并把这个信号传送到PC计算机的串行端口,接下来将进行下一轮抢答。D分数计算和显示电路当主持人按下开始键就开始抢答,如果选手最先按下抢答键,他或她的号码将被记录下来,他或她的得分将被计算并用LED数码管显示出来。此外,一些逻辑设计也是必要的。逻辑设计如下:首先,主持人将读取液晶屏上显示的问题,接下来,PC电脑将发送字母“K”,这标志着比赛开始。同时,定时电路开始工作,如果在允许的时间内没有得到回答问题的机会,微控制器将给PC机发送“超时”,如果有人在指定的时间内按下抢答键,微控制器将发送他或她的号码。如果超出允许的时间,PC电脑将发送“下一步”,这意味着转向下一个问题,接下来该问题将自动显示回答。如果一些选手得到机会而回答错误,他或她的分数将减1并显示在数码管上,然后单片机发送“下一步”,进行下一个问题。如果得分在减少后小于0,该选手将被淘汰。正确的答案将显示在液晶屏上。最后,如果所有的问题都抢答完了,微控制器将发送“e”来结束游戏,然后计算所有选手的得分,并将得分最高的选手号码显示在数码管上。四、响应硬件设计抢答器的硬件要优先设计。抢答器的硬件资源直接由苏州大学开发的飞思卡尔HCS12开发板代替。开发板以MC9S12DG128为核心部件,采用模块化设计方法,它提取了I/O资源的一部分,也提供了每个模块相应的接口电路,它还提供了A/D输入通道,PWM低通滤波电路,16键的键盘输入通道,8位数字I/O电路,SPI的I/O电路,SCI通信电路,I2C总线I/O扩展电路等等。在这篇论文中,列出了硬件模块、引脚连接、相应的开发板接口及重新设计系统的实际需求。图1显示了开发板选定部分的硬件结构图。图1硬件结构图A硬件模块的选择本文设计的抢答器是比较简单的,涉及的I/O端口和模块并不多。(1)本系统采用按钮开关作为抢答的关键,0和1通常被用来作为开关的输入, 在这里,系统需要知道是否有人按了按钮,而不需要关心开关打开或关闭。(2)定时器模块是必不可少的时序电路。 在这里,定时器模块的功能是限制时间,和捕捉输入信号。之后,将详细介绍部分电路设计。(3
本文档为【外文文献及翻译:基于STC89C52单片机的多路抢答器设计】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: ¥20.0 已有0 人下载
最新资料
资料动态
专题动态
个人认证用户
徐姐2018
技术学院会计学毕业后掌握基本的会计知识技能,取得会计从业资格证,多年的财务工作经验,现认多家小企的财务会计!
格式:doc
大小:194KB
软件:Word
页数:13
分类:企业经营
上传时间:2018-05-16
浏览量:295