五邑大学本科毕业设计I摘要传统汽车的车灯控制系统一般采用继电器与独立模式控制,这使汽车内电线较多,造成严重的电磁干扰,使系统可靠性下降。因此考虑通过运用单片机控制汽车信号灯,简化电路,减少干扰,从而使系统实用可靠,并增加汽车的安全性能。“汽车转弯信号灯单片机控制系统”主要是对单片机并行输入/输出口电路的应用,即通过I/O口,增加复位电路、驱动电路、按键电路来模拟汽车转弯系统功能。由于汽车有左转弯、右转弯、刹车、合紧急开关等操作,而且可能会组合出多种操作情况。所以在编写程序时要多方面考虑信号灯存在的各种不同情况,希望能尽量包含多种功能,使控制系统能满足现实需要。本设计主要的工作是绘制电路原理图,分析设计输入与输出控制端的功能模块,通过编写程序代码控制亮灯键值及闪烁的效果,再进行仿真模拟汽车驾驶时信号灯的各种情况。仿真后对电路系统进行PCB图绘制,经过电路板实物制作及调试验证汽车信号灯单片机控制系统的操作可行性。观察分析设计的结果,进行反馈,完善该操作系统。关键词单片机;汽车转弯;信号灯;程序设计;调试五邑大学本科毕业设计IIAbstractTraditionalautolightcontrolsystemgenerallyusestherelaywiththeindependentmodecontrol,thismakesthewireinsidethecarmore,causesseriouselectromagneticinterference,andmakesthesystemreliabilitydescend.SoIconsiderusingsingle-chipmicrocomputercontrolcarlightstosimplifythecircuitandreducetheinterference,sothatthesystemispracticalandreliable,anditcanincreasethesafetyperformanceofcars.Carlightsturnsingle-chipmicrocomputercontrolsystemismainlytheapplicationofsinglechipmicrocomputerparallelinput/outputcircuit,namely,throughtheI/Oportresetcircuit,drivecircuit,keycircuittosimulatethevehicleturningsystemfunctions.Becausethecarhasleftturning,rightturning,braking,emergencyswitch,etc,anditcancomposeavarietyofoperatingconditions.Soinmanyrespectswhenyouwriteaprogramsignalsexistvarioussituation,hopetobeabletotrytocontainavarietyoffunctions,canthecontrolsystemmeettheneedsofthereality.Thisdesignistoplotcircuitprinciplediagram,analyzethedesigninputsandoutputstothecontrolfunctionmodule,bywritingtheprogramcodelightscontrolkeysandtheflashingeffect,andcarriesonthesimulationoflightwhenthecardrivingsituations.AftersimulationandPCBcircuitdiagramdrawing,itcantestcircuitboardanddebugtheoperationalfeasibilityofthecontrolsystem.Toobservetheresultoftheanalysisanddesign,feedback,willimprovetheoperatingsystem.KeywordsSinglechipmicrocomputerCarsturningSignallightProgrammingDebugging五邑大学本科毕业设计III目录摘要...................................................................................................................................................IABSTRACT.......................................................................................................................................II第1章绪论.......................................................................................................................................11.1选题背景..................................................................................................................................11.2研究目的与意义........................................................................................................................11.3技术现状分析...........................................................................................................................11.4论文的主要内容........................................................................................................................2第2章汽车信号灯系统设计原理.........................................................................................................32.1汽车信号灯系统控制要求...........................................................................................................32.2汽车信号灯系统设计方案...........................................................................................................32.3单片机AT89C52简介................................................................................................................42.3.1单片机AT89C52内部主要功能特性....................................................................................42.3.2单片机AT89C52主要引脚功能...........................................................................................52.4单片机AT89C52的工作原理及设计............................................................................................62.4.1开关状态检测.....................................................................................................................62.4.2输出控制...........................................................................................................................62.4.3定时器和计数器.................................................................................................................62.4.4定时器初始化.....................................................................................................................72.4.5中断系统...........................................................................................................................82.5本章小结..................................................................................................................................8第3章汽车转弯信号灯系统硬件设计..................................................................................................93.1汽车转弯信号灯系统电路...........................................................................................................93.1.1汽车转弯信号灯系统控制功能.............................................................................................93.1.2汽车转弯信号灯系统电路元件表........................................................................................103.1.3汽车转弯信号灯系统总电路图.....................................................................................