电子存包柜--英文资料

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

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

1 / 6
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功