您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 市场营销 > 电子存包柜--英文资料
DesignofelectronicstoragecabinetbasedonRTOSSmallDepartmentofelectronicsandcommunicationengineering,PSGcollege,CoimbatoreIndiaAbstract:ThispaperintroducesthedesignprincipleoftheelectronicstoragecontrolsystembasedonRTOSSmall,andintroducesthesystemusedinthissystemtomakethecontroller,whichcanmanagetheNstoragecabinetatthesametime.Thedoorlockiscontrolledbytheelectromagneticvalve,whencustomersneedtosavethepackage,cangotothelockersbeforepresstheopenbutton,themicrocontrollerreceivesapulsesignal,andthesystemI/Oporttosendcorrespondingsignalstocontroltheelectromagneticvalvelockdoorwillbeanemptyboxisopened,thecustomercansavethepackageandthedoorshut.Whenthecustomerneedstotakethepackage,willaslongasthebarcodeplacedinfrontofthebarcodereader,barcodereaderbarcodeinformationcollectedbytheoutputvoltagesignalcorrespondingtothemicrocontroller,thepasswordsystemisrelativelyconsistent,sendoutsignalstothesolenoidvalveisopen,thecustomercanremovethepackage.Keywords:SmallRTOS;electronicstoragecabinet;savepackage1、IntroductionRTOSRAMSmalldemandforsmall,verysuitableforsucharelativelysmallresourcesofthesystem.RTOShasamultitasking,strongreal-time,andcanbereducedtothekernel,makingthedesignofreal-timeapplications,expansionandmaintenanceeasier.TheintroductionoftheideaofRTOS,insteadofthetraditionalsoftwaredesignmethod,sothatitisnolongerasinglethreadstructure,throughtheapplicationisdividedintoseveralindependenttasks,RTOSmakesthedesignprocessofapplicationsystemissimplified.Inthispaper,thesoftwaredesignofelectronicstoragecabinetbasedonsinglechipmicrocomputeriscombined,thedesignideaofRTOSSmallandtheapplicationofmessagequeuecommunicationmechanismarebrieflyanalyzed.1.1basicprinciplesofRTOS51SmallRTOS51Smallisaverysmallkernel,fullyintegratedintheC51KEILcompiler,onlytakelessmemoryspace,youcanruninthe51singlechipmicrocomputersystemwithoutexternaldatamemory.Thekernelisresponsibleforinitializingandopen,othertasksschedulingsystem,accordingtothepriorityoftasks,areasonabledistributionofCPUindifferenttimebetweentasks,thekernelcangenerallyprovidetaskschedulingandinterruptservicefunction.Aprogramandatask,thetaskofeachseparate,independentimplementationofthepartcalledthread.Alleventdrivenandtimedrivenarereflectedinthesettingsofthecorrespondingtaskidentificationandthreadidentification.Whenthehardwareenvironment,onthebasisoftheidentification,byarrangingthesysteminterruptandtaskschedulingalgorithmadjusttheresponse,byusingthemethodofsettingupenvironmentalvariables,whichcaninterruptexitafterreturntoanymorethanonesetofentranceinonetoperform,andeffectivelysolvesthekeyproblemofflexibleswitchingofforegroundandbackgroundtasksthread.RTOSSmall51usertaskswitharunningstate,readystate,waitandsuspend,interruptserviceprogram.Atanymoment,thestateofthetaskisoneofthesefourstates.Inordertosavememory,createanddeletemissionOSdynamic,withthefunctionOSSTART()tostartamultitaskingenvironment,OStookallthetaskssetup,andsetthemasthereadystate,thehighestprioritytasktorun.Onlywhenallthepriorityishigherthanitstasktowait.Readytoenterastateofoperation.Theschedulerwillbethetoppriorityofthetaskreadylistasthenexttasktobeperformed.Taskcallos_waitfunction,pendingthecurrenttask,waitingforoneorseveralintervals(K_IVL),timeout(K_TMO),signal(K_SIG)events.Ifwaitingforeventhasoccurred,continuetoimplementthecurrenttask;ifwaitingforeventsdidnotoccur,thecorrespondingwaitingsign,suspendthetasktotaskswitchingprogramsegmentswitchtothenexttask.SmallRTOS51(init)byperformingafunctiontoregisterinitialization,callthefunctionOSSTart()toinitializeeachtaskstackandperformthefirsttask,andthechoiceofthefirsttaskforthereasonthatthetaskprioritylevel.Intheselectionprocesstocompletethetaskofscheduling.1.2communicationbetweentasksCommunicationbetweentasksusingthemessagequeue,after3steps:tocreateamessagequeueOSQCreate(),tothemessagequeuemessageOSQPost(),takemessageOSQPend().CalltheOSQPost()functiontosendthemessage,ifyoualreadyhaveataskwaitingforthemessage,immediatelyturntowaitforthenewstask,ifthemessagequeueisfull,isunabletodeliverthemessage,returnanerror.Ifthemessagequeueisnotfull,butthereisnoothertaskwaitingforthemessage,then.Itisworthnotingthat,whenthequeueisfull,thefunctiondoesnotsuspendthecurrenttask,socallthefunctionofthetaskshouldbejudgedtoreturnthecondition,ifthemessageisfull,itshouldbehungfromthecurrenttask.Whenreceivingamessage,ifthemessagequeueisempty,thetaskoftakingthemessagewillbesuspendeduntilamessageisreceivedinthemessagequeue.2.Applicationexamples2.1HardwareplatformForexample,thesystemblockdiagramisasfollows.Theelectronicstoragecabinetcancontrolthemaximumnumberofgoodsstorageboxis32,dividedintoabout16boxes,thepictureonlydraw16roadcontrol.ControlchipusingAT89C55microcontroller,withreal-timeclockmodule,barcodereader,liquidcrystaldisplaymodule,thermalprintercomposition,designedtothreePCBboard.1mastercontrolboard,theuser'sstorageandaccesstotheuserinterface,savethepackagepassword,displaytheuseraccesstothepasswordintheprocessofthepasswordinputandthestateofall32.The2doorcontrolpaneliscomposedofthreeparts,thefirstpartoftheb
本文标题:电子存包柜--英文资料
链接地址:https://www.777doc.com/doc-5076933 .html