您好,欢迎访问三七文档
当前位置:首页 > 电子/通信 > 综合/其它 > 基于RS485多机通信的软件编程与系统调试
I摘要小局域网多机通信在如食堂刷卡收费管理系统、汽车加油刷卡系统、电能运输秒表管理系统等领域应用广泛。因此,开展本领域的研究有较好的应用前景。本文主要采用一种以PC机作为上位机,多台80C51单片机作为下位机,来进行上位机与下位机以及下位机与下位机的通信的研究。主要包括:系统总体方案设计;在PC机端,通过专用的RS232/485标准转换芯片S2-485将RS-232电平转换成RS-485电平,在80C51单片机端,通过MAX485转换芯片将TTL电平转换成RS-485电平,来实现上位机与下位机以及下位机与下位机的通信;在系统硬件设计的基础上,制定了通信协议。为了达到使传输数据的准确性,开展了数据传输的错误检查与纠正,以及系统可靠性方面的研究;进行了PC机与下位机,以及下位机与下位机的软件编程、程序调试,实现了系统多机通信的数据传输。关键词:PC机;单片机;RS-485;数据传输;多机通信IIAbstractMulti-machinecommunicationshaveawiderangeofapplicationsinsmalllocalnetwork,suchasmanagementsysteminthecanteenforchargesofcreditcard,inthegasstationforrefueling,inthetransportofenergyforstopwatchtiming.Therefore,therearegoodprospectstocarryoutresearchinthisarea.Thisarticleusespcmachineasahostcomputerandmultiple80C51single-chipsasslavemicrocomputerstocarryoutthestudyofcommunicationsbetweenPCandlowermachine,aswellaslowermachines.Thearticleincludesanoveralldesigningplan.IntheportofthePC,usingaS2-485,dedicatedRS232/485converterchip,convertstheRS-232levelintotheRS-485level.Intheportof80C51single-chip,MAX485willbeusedtoconvertTTLlevelintoRS-485level.Inthisway,communicationscanbeachievedbetweenPCandlowermachine,aswellaslowermachines.Inthebasisofhardwaredesign,thecommunicationalprotocoliscarriedout.Inordertoachievetheaccuracyofthedatatransmission,theerrorcheckingandcorrectionisimplemented,aswellasthestudyofreliability.Aftersoftwareprogrammingandprogramdebugging,thesystemcanachievedatatransmissionbetweenPCmachineandsingle-chip,aswellassingle-chips.Keywords:PCMachine;Single-chip;RS-485;DataTransmission;Multi-machineCommunication武汉工程大学毕业设计(论文)说明书目录摘要................................................................................................................................................................IABSTRACT.......................................................................................................................................................II第一章绪论........................................................................................................................................................11.1引言....................................................................................................................................................................11.2研究的背景及意义.......................................................................................................................................11.3论文的主要内容............................................................................................................................................2第二章多机通信基础..................................................................................................................................32.1数据通信基础.................................................................................................................................................32.2异步串行通信接口标准..............................................................................................................................52.3通信芯片的介绍............................................................................................................................................9第三章系统方案设计................................................................................................................................123.1系统总体设计...............................................................................................................................................123.2系统主要构成部分.....................................................................................................................................123.3系统主从通信的基本条件.......................................................................................................................14第四章系统软件设计与调试...............................................................................................................154.1PC机与多个80C51通信原理.................................................................................................................154.2通信状态的设置..........................................................................................................................................154.3PC机与多个80C51通信的控制............................................................................................................174.4通信协议........................................................................................................................................................184.5多机发送时的分时说、听.......................................................................................................................204.6差错控制........................................................................................................................................................224.7系统程序设计...............................................................................................................................................224.8程序调试........................................................................................................................................................29第五章系统可靠性分析........
本文标题:基于RS485多机通信的软件编程与系统调试
链接地址:https://www.777doc.com/doc-315411 .html