M.Zhu(Ed.):ICCIC2011,PartVI,CCIS236,pp.232–238,2011.©Springer-VerlagBerlinHeidelberg2011IntelligentTrafficControlSystemDesignBasedonSingleChipMicrocomputerXuLei,YeSheng,LuGuilin,andZhangZhenSchoolofMechanicsandCivilEngineering,ChinaUniversityofMiningandTechnology,Xuzhou(221008),Jiangsu,Chinaxukeixulei@sina.comAbstract.Thispapermainlyintroducesmicrocontrollerofcountertoimplementanintelligenttrafficcontrolsystem.Thesystemusesanexternaltriggeredpulsestosimulate,throughtraffictotiming/countercarcollection,soastorealizetheflowoftrafficinformationdigitization.Meanwhile,accordingtohistoricalstoreddataandautomaticdetectiontocartrafficinformation,microcontrollerwillbecompared,andthecontrolmodelalgorithmcontrolschemebysettingpropersignalratio,realizingtheintelligentcontroltrafficsignals.Keywords:microcontroller,intelligentcontrolsystem,timing⁄counters.1IntroductionUrbantrafficcontrolsystemismainlyusedincitytrafficdatamonitoring,trafficlightcontrolandtrafficpersuationcomputerintegratedmanagementsystem,ithasbecomethemostimportantpartofthemodernurbantrafficcontrolcommandsystem.Therefore,eachintersectioninstallationtrafficlightshasbecomethemostrelievestrafficvehiclesandpedestriansmostcommonandmosteffectivemanagementmeans,andhowtouseadvancedinformationtechnologytransformurbantrafficsystemhasbecometheconsensusofurbantrafficmanagement.2SystemCompisitionThetrafficlightcontrolsystemisusedtoreceive,processingintersectiontrafficdatasystem,andaccordingtothetrafficflowconditionstobeintelligenttoadjustthetrafficlightslightdestroytimelength.Thepurposeofthedesignofthecontrolsystemhastwomainfunction:Firstly,finishingcrossingtheeast-westandsouth-northtwodirectionsoftrafficflowdetectionbasedonexperimentaldata,soastoprovidedatamodelingmethod;Secondly,byusingthecontrolsystemforintelligentcontroloftrafficlights.Consideringtheactualfeasibility,thissystemusesLEDtoreplacetheactualtrafficlights,andthetrafficflowwithexternalinputdataissimulatedthepulses.Fromthefunctioncanbemainlythewholecontrolsystempointsoftrafficflowcontrolmodule,inspectionmoduleandtrafficlightcontrolmodule.Thetrafficlightscontrolsystemofgeneralfunctionstructureisasshowninfigure1.IntelligentTrafficControlSystemDesignBasedonSingleChipMicrocomputer233Ascanbeseenfromthefigure,andconventionaltrafficcontrolsystem,thissystemmainlycomparedwiththefollowingfeatures:•Controlmodulebyasinglechipmicro-controller,everyfunctionmodulesinICchipsarebasedondevelopment,eachmoduleandICchipsfrombuswaybetweenconnectednearly;•Controlsystem,signalanddataflowisone-sided.Countersystemprovidestrafficdata,aftermicrocontrolleroperationaltreatment,becomethetrafficlightscontrolinstructions,theoutputtolightcontrolsystem;•Microcontrollercanbetimelytovarioussignalprocessed;•Betweeneachdevicewithbuswaysharedata,systemstructurecompact,datasecuritygood;•Itcanbeusedasmoreintelligentcontrolsystemhardwarefoundation.Fig.1.Compositionofregulationsystem3SystemDesignThissystemhardwarecomponentsselectionismainlymadebyATMELcompanyintheUnitedStates,theIntelcompanyAT89S52SCM8255programmablegeneralparallelinterfaceandprogrammabletiming/counter8253.AT89S52SCMislowpower,high-performanceCMOS8-bitmicrocontroller.SlicetheFlashmemorywith8KBwithin,allowingwithinthesystemwithprogrammerprogrammingrewritetheor.AT89S52instructionsystemand80C52fullycompatiblewithpins,256BRAMpieces(andtheI/O,32mouthline,316timing/counters,thewatchdog,sixinterruptsource,afull-duplexserialport,etc,andcanmeetthepracticalneedsofthesystem.3.1CounterAdoptingsingleexternalcountchips,suchas82C53,82C54asspecialcountertoexternalinputpulsesignalascountchips,torealizethecountofexternalpulsepulsedigital.ThusmakingroadtrafficflowintoSCM,itcanidentifythepulsecountforthesingle-chipcomputercompletescontrolproceduresandtheoutputofthecontrolordertoprovidebasicdata.234X.Leietal.Usingexternalcounterconcreteprocessofrealizingcountasfollows:Usingexternalcrystalsproduceacertainfrequencycountscircuitimpulse;Makethisfrequencyasthecountofthecounttomeasuringpulsesignal,asanexternalcountercountpulse,externalchipindoorcontrolcyclecounttocountpulse;Incountends,externalchipoutputproduceslowlevelwouldtriggerMCUdisruptions,thespecialchipmicrocontrollerwillreadbackthecountvalue,andcontrolalgorithmofcomputing.Countingpulsefrequencyrelyonexternalcrystalfrequency,althoughexternalcrystalshasthehigherfrequencyofthemorehelptoimprovetheaccuracyofpulsecount,buteventuallyinputtoexternalcounterpulsefrequencyhadbetternotexceed10MHz.Usingsinglechipexternalcountertorealizepulsecountmethodhastwomaininsidelet:thefirstisthehardwarecircuitdesign,includingthemicrocontrollereachportconnection,theinterruptsignaldesignetc;Onceagain,isMCUcountprogram,mainlyresponsibleforcontroleachinterruptandthetimercompletecorrespondingpulsecountprocess.3.2TrafficSignalControlModuleThetrafficlightscontrolmoduledrivestrafficlightsandkillsbrightbyreceivingtotrafficlightcontrollermicrocontrollerissuedinstructionsaccordingtotherequirementofthemodule,microcomputerintheflowoftrafficinformationobtainedthroughcontrolalgorithm,after