吉林化工学院信息与控制工程学院专业综合设计说明书吉林化工学院信控学院专业综合设计说明书基于RS-232的数据采集系统设计学生学号:学生姓名:专业班级:指导教师:职称:起止日期:吉林化工学院JilinInstituteofChemicalTechnology吉林化工学院信息与控制工程学院专业综合设计说明书-I-专业综合设计任务书一、设计题目:基于RS-232的数据采集系统设计二、设计目的1、掌握MAX232芯片的性能指标、特点及使用方法;2、掌握ADC0832和CD4051芯片的性能指标、特点及使用方法;3、掌握SST89E516RD单片机性能指标、特点及使用方法,了解SST89E516RD单片机控制ADC0832和CD4051的软件编程方法;4、了解7805构成直流稳压电源的电路组成及工作原理。三、设计任务及要求设计数据采集与RS-232通信硬件电路并完成以下任务:1、单片机为核心的数据采集器对八路模拟量和八路开关量进行实时采集,采集的数据由单片机处理后经RS-232串口线送PC机;2、PC机接收到采集数据后,由图形界面动态显示,当参数超限时进行声光报警。四、设计时间及进度安排设计时间共三周(2015.9.7–2015.9.25),具体安排如下表:周安排设计内容设计时间第一周硬件电路设计2015.9.7-2015.9.11第二周硬件电路焊接与调试2015.9.14-2015.9.18第三周编写课程设计说明书,课程设计答辩。2015.9.21-2015.9.25五、指导教师评语及学生成绩指导教师评语:年月日成绩指导教师(签字):基于RS-232的数据采集系统设计-II-目录专业综合设计任务书·······························································································I第1章绪论···································································································1第2章硬件系统设计·····························································································22.1SST89E516RD2单片机及其最小系统电路·························································22.1.1SST89E516RD2芯片简介······································································22.1.251系列最小系统电路组成·····································································32.2X5045看门狗电路························································································32.2.125045芯片简介···················································································32.2.2基本工作原理·····················································································42.3MAX232电平转换电路·················································································42.3.1MAX232芯片简介···············································································42.3.2电平转换原理·····················································································52.4AD0832模拟量采集电路···············································································52.4.1AD0832芯片简介················································································52.4.2CD4051芯片简介················································································62.4.3模拟量产生-采集电路··········································································62.5开关量采集电路··························································································72.6+5V直流电源设计电路·················································································82.6.17805简介···························································································82.6.2直流电源设计基本原理········································································8第3章软件系统设计·····························································································93.1系统程序流图·····························································································93.2关键程序示例·····························································································93.2.1AD0832采集程序················································································93.2.2串行发送程序···················································································113.3DXP软件介绍及使用··················································································113.4VisualBasic软件介绍及使用········································································123.5上位机与单片机通信的实现·········································································123.5.1程序下载到单片机············································································123.5.2数据采集到上位机············································································13结论·············································································································14参考文献·············································································································15附录(电路原理图)·······················································································16吉林化工学院信息与控制工程学院专业综合设计说明书-1-第1章绪论近年来,数据采集及其应用受到了人们越来越广泛的关注,数据采集系统也有了迅速的发展,它可以广泛的应用于各种领域。以微机为核心的可编程数据采集与处理采集技术的发展方向得到了迅速的发展,而且组成一个数据采集系统只需要一块数据采集卡,把它插在微机的扩展槽内并辅以应用软件,就能实现数据采集功能,但这并不会对基于单片机为核心的数据采集系统产生影响。相较于数据采集板卡成本和功能的限制,单片机具多功能、高效率、高性能、低电压、低功耗、低价格等优点,而双单片机又具有精度较高、转换速度快、能够对多点同时进行采集,因此能够开发出能满足实际应用要求的、电路结构简单的、可靠性高的数据采集系统。这就使得以单片机为核心的数据采集系统在许多领域得到了广泛的应用。本系统采用下位机负责模拟数据的采集,从单片机负责采集数据,并应答主机发送的命令,上位机即主机是负责处理接受过来的数字量的处理及显示,主机和从机之间用RS-232进行通信。这样用户可以在上位机上编写各种程序对文件中的数据进行有效查询和分析,有利于工业过程的长期正常运行和检查。该系统采用的是SST89E516RD2单片机,此芯片功能比较强大,能够满足设计要求。基于RS-232的数据采集系统设计-2-第2章硬件系统设计2.1SST89E516RD2单片机及其最小系统电路2.1.1SST89E516RD2芯片简介SST系列单片机是一款高性能的8051内核的单片机,属于8位FLASHFLEX51系列单片机。FLASHFLEX51是在高级FLASHCMOS半导体工艺下设计和生产出的单片机产品之一。器件都有相同的功能强大的指令系统,并且和8xC5x器件兼容。单片机有72K片内FLASHEEPROM程序存储器,它利用了SST的超级FLASH专利技术,这些都是SST的领先技术。超级FLASH存储器被分成两个独立的程序存储块,基本FLASHBlock0占用64/32K字节片内程序存储空间,二级FLASHBlock1占用8K字节的片内程序存储空间;8K字节的二级FLASH块能被映射到64/32K字节低地址空间它也能从程序计数器中被隐藏掉而用做一个独立的类似EEPROM的数据存储器。图2-1为51系列单片机引脚说明。图2-151系列单片机引脚说明基本特性如下:1.增强型8051单片机6时钟/机器周期和12时钟/机器周期可以任意选择,指令代码完全兼容传统8051;2.工作电压:5.5V~3.3V(5V单片机)/3.8V~2.0V(3V单片机);3.工作频率范围:0~4