您好,欢迎访问三七文档
当前位置:首页 > 电子/通信 > 综合/其它 > 基于AVR单片机的485通信系统设计
目录摘要..................................................................-1-Abstract..............................................................-2-1引言...........................................................-3-2系统总体方案确定...................................................-4-2.1设计方案选择......................................................-4-2.2设计的内容以及要求................................................-4-2.2.1设计的内容......................................................-4-2.2.2设计的要求......................................................-4-3系统的组成及其工作的原理...........................................-4-3.1系统的组成........................................................-5-3.2工作原理..........................................................-5-4硬件电路方案设计...................................................-6-4.1系统硬件的介绍....................................................-6-4.2主机电路控制模块..................................................-6-4.2.1ATmega16AVR单片机介绍.........................................-7-4.3数据显示模块......................................................-8-4.4键盘输入模块......................................................-9-4.5通信电路模块......................................................-9-4.5.1RS-485协议....................................................-10-4.6从机控制模块.....................................................-10-4.6.1单片机最小系统.................................................-10-5软件设计.........................................................................................................................................-12-5.1IARFORAVR软件的介绍........................................................................................................-12-5.2通信协议......................................................................................................................................-13-5.2.1串行通信协议RS232和RS485的比较...........................................................................-13-5.2.2通信过程..................................................................................................................................-13-5.3主机程序......................................................................................................................................-14-5.3.1主程序总流程图....................................................................................................................-14-5.3.2键盘输入的子程序................................................................................................................-15-5.3.3用数码管显示子程序...........................................................................................................-16-5.4从机程序......................................................................................................................................-16-5.4.1从机总流程图.........................................................................................................................-16-5.4.2接收并且显示主程序...........................................................................................................-17-6实验调试和测试结果与分析.....................................................................................................-18-总结...............................................................................................................................................-18-谢辞...............................................................................................................................................-18-参考文献.........................................................................................................................................-20-蚌埠学院本科毕业设计(论文)-1-基于AVR单片机的485通信系统设计摘要:现在的社会是一个数字化的时代,多机通信系统的应用已经广泛渗透到人们生活的方方面面,在科学研究的军事技术领域、文化艺术领域、工程设计领域都有它的应用。通过通讯方式交换信息、资源共享已经成为了一种必然的趋势。为了使系统中的多个计算机之间的数据通信都可以实现,它们必须根据实际需要并且按照某种形式的网络来进行,工程中经常用的是使一个完整的主站发送,然后正确的从多机通信模式接收的信号,同时要防止总线上的信号冲突。本文讨论了用ATmega16AVR单片机来控制RS485串行接口与主机系统进行数据交换,ATmega16为核心芯片,它与MAX485转换器连接实现远距离传输,同时ATmega16作为主控芯片控制按键电路与数据显示电路,系统主要由主机控制模块、通信模块、数据输入模块、数据显示模块和模数转换模块五个部分组成,实现了利用RS-485实现单片机通信,通过键盘实现从机的选择、发送数据,从机显示发送的数据。该系统是一个单片机发送另一个单片机接收的单向、平衡传输标准,具有强抗干扰能力,易于使用,易于维护,操作简单等优点,在现实生活中也拥有广泛的应用。关键字:多机通信、RS485接口、AVR单片机张苹苹:基于AVR单片机的485通信系统设计-2-Designof485CommunicationSystembasedonAVRMicro-controllerAbstract:Today'ssocietyisadigitalera,theapplicationofmuch-machinecommunicationsystemshavebeenwidelyseepedintothescientificresearchinallfields,suchas:militarytechnology,cultureandthearts,engineeringandpeople'sdailylife.Bymeansofcommunicationtoexchangeinformation,shareresourceshasbecomeaninevitabletrend.Tomakethesystemindatacommunicationbetweenmultiplecomputeraremet,theymustbecomposedaccordingtotheactualneedssomeformofnetworkengineeringisoftenusedtomakeacompletemastersendsandreceivessignalsfromthemuch-machinecommunicationmode,correctandpreventthesignalcollisiononthebusisguaranteed;ThisarticlediscussestheuseATmega16AVRmicro-controllertocontrolRS485serialinterfacewiththehostsystemfordataexchange,ATmega16corechip,whichisconnectedmakeremotedistancetransmissiontruthandMAX485converters,whileATmega16asthemainchipcircuitcontrolbuttonsa
本文标题:基于AVR单片机的485通信系统设计
链接地址:https://www.777doc.com/doc-2533519 .html