计算机控制系统课设报告
更新时间:2024-06-02 07:31:01 阅读量: 综合文库 文档下载
目录
目录 ·································································································································································· 1 1 题目背景与意义 ········································································································································· 2 2 设计题目介绍 ············································································································································· 3 2.1设计目的 ········································································································································ 3 2.2设计意义 ········································································································································ 3 3 系统总体框架 ············································································································································· 4 4 系统硬件设计 ············································································································································· 5 4.1单片机选型 ···································································································································· 5 4.1.1 AT89C51功能介绍: ············································································································ 5 4.1.2晶振电路 ································································································································· 6 4.1.3复位电路 ································································································································· 6 4.2 A/D转换电路 ································································································································ 7 4.2.1 ADC0809功能介绍: ············································································································ 7 4.2.2 A/D转换电路图 ····················································································································· 8 4.3 D/A转换电路 ································································································································ 9 4.3.1 DAC0832功能 ······················································································································· 9 4.3.2 D/A转换电路图 ··················································································································· 10 4.5调理电路 ······································································································································ 10 4.6 报警指示灯电路 ························································································································· 11 4.7 键盘、显示控制电路 ················································································································· 12 4.7.1键盘电路 ······························································································································· 12 4.7.2显示电路 ······························································································································· 12 5 系统软件设计 ··········································································································································· 14 5.1 主程序框图 ································································································································· 14 5.2数据程序框图 ······························································································································ 15 5.3 键盘程序框图 ····························································································································· 16 5.4显示程序框图 ······························································································································ 17 6 总结 ··························································································································································· 18 7总体设计电路原理图 ······························································································································· 19
1
1 题目背景与意义
在自动控制系统的实际工程中,经常需要检测被测对象的一些物理参数,如温度、流量、压力、速度等,这些参数都是模拟信号的形式。它们要由传感器转换成电压信号,再经A/D转换器变换成计算机能够处理的信号。同样,计算机控制外设,如电动调节阀、模拟调速系统时,就需要将计算机输出的数字信号经过D/A转换器变换成外设能接受的模拟信号。 本次《计算机控制系统》课程设计的目的就是让同学们在理论学习的基础上,通过完成一个涉及MCS-51单片机A/D和D/A多种资源应用并具有综合功能的小系统目标板的设计与编程应用,使我们不但能够将课堂上学到的理论知识与实际应用结合起来,而且能够对电子电路、电子元器件、等方面的知识进一步加深认识,同时在系统设计、软件编程、相关仪器设备的使用技能等方面得到较全面的锻炼和提高。帮助同学们增进对单片机的感性认识,加深对单片机理论方面的理解,从而更好的掌握单片机的内部功能模块的应用以及A/D和D/A功能的实现。使学生了解和掌握单片机应用系统的软硬件设计过程、方法及实现,为以后设计和实现单片机应用系统打下良好基础。
2
2 设计题目介绍
2.1设计目的
设计一个基于单片机的具有A/D和D/A功能的信号测控装置。要求该信号测控装置能够接入典型传感器、变送器信号,同时可输出标准电压/电流信号。并满足抗干扰、通用性、安全性、性价比等原则性要求。标准电压/电流信号定为:0~5V/4~20mA (0~20mA)
2.2设计意义
通过设计此信号测控装置,加深对控制系统的理解,全面掌握所学的知识并灵活运用起来。
3
3 系统总体框架
模拟量输入
模数转换模块 数模转换模块 键盘模块 模拟量输出
8051 声光报警 稳压电源 显示模块
图1 系统总体框架图
4
4 系统硬件设计
4.1单片机选型
由于80C51单片机采用的是CHMOS工艺,高速度、高密度、低功耗,具有
价格便宜、易上手、抗干扰能力强、稳定性好等优点,且满足我所设计的系统要求的条件,所以此次设计选用80C51单片机作为处理核心。其结构如图2所示:
U1119XTAL1P0.0/AD0P0.1/AD1P0.2/AD2P0.3/AD3P0.4/AD4P0.5/AD5P0.6/AD6P0.7/AD7P2.0/A8P2.1/A9P2.2/A10P2.3/A11P2.4/A12P2.5/A13P2.6/A14P2.7/A15P3.0/RXDP3.1/TXDP3.2/INT0P3.3/INT1P3.4/T0P3.5/T1P3.6/WRP3.7/RD39383736353433322122232425262728101112131415161718XTAL29RST293031PSENALEEA12345678P1.0P1.1P1.2P1.3P1.4P1.5P1.6P1.780C51 图2 80C51结构
4.1.1 AT89C51功能介绍:
Vss(20脚) : 接地。
VCC(40脚): 主电源+5V。
XTAL1(19脚):接外部晶体的一端。在片内它是振荡电路反相放大器的输入端。对于CHMOS单片机,此引脚作为驱动端。
XTAL2(18脚): 接外部晶体的另一端。在片内它是一个振荡电路反相放大器的输出端,振荡电路的频率是晶体振荡频率。对于CHMOS单片机,此引脚应悬浮。
RST(9脚): 单片机刚接上电源时,其内部各寄存器处于随机状态,在该脚输入24个时钟周期宽度以上的高电平将使单片机复位(RESET)。
PSEN(29脚): 外ROM读选通信号。
ALE/PROG(30脚): 地址锁存允许/片内EPROM编程脉冲。 EA/VPP(31脚): 当EA端输入高电平时,CPU从片内程序存储器地址0000H单元开始执行程序。当地址超出4KB时,将自动执行片外程序存储器的程序。当EA输入低电平时,CPU仅访问片外程序存储器。
输入/输出引脚:
(1)P0.0—P0.7 (39脚—32脚) 作为数据总线 (2)P1.0—P1.7 (1脚—8脚) (3)P2.0—P2.7 (26脚—21脚)
5
(4)P3.0—P3.7 (10脚—17脚)具有第二功能,用于特殊信号输入输出和控制信号,属控制总线。
4.1.2晶振电路
单片机是一种时序电路,必须供给脉冲信号才能正常工作,所以在XTAL1 XTAL2引脚接入一个振荡电路,电路如图3所示:
图3 晶振电路
4.1.3复位电路
单片机系统中需要一个硬件复位电路,用于用户的手动复位,80C51是高电平复位有效。最简单的复位电路由一个电阻、一个电解电容、一个按钮形成,电路如图4所示:
图4 复位电路
6
图 5 8051单片机最小系统
4.2 A/D转换电路
为了完成A/D转换功能,我选择的是A/D0809转换器,它具有易于和微处理器接口或独立使用,可满量程工作,可用地址逻辑多路器选通各输入通道,单5V供电,输入范围为0~5V,输入和输出与TTL、CMOS电平兼容等优点。
ADC0809是8通道8位CMOS逐次逼近式A/D转换芯片,可以和单片机直接接口,由一个8路模拟量通道选择开关、一个地址锁存与译码器、一个A/D转换器和一个三态输出锁存器组成。多路开关可选通8个模拟通道,允许8路模拟量分时输入,共用A/D转换器进行转换。三态输出锁器用于锁存A/D转换完的数字量,当OE端为高电平时,才可以从三态输出锁存器取走转换完的数据。因ADC0809的内部没有时钟电路,所需时钟信号必须由外界提供,通常使用频率为500KHZ。
4.2.1 ADC0809功能介绍:
7
图6 ADC0809芯片图
D7-D0:8 位数字量输出引脚。 IN0-IN7:8 位模拟量输入引脚。 VCC:+5V 工作电压。 GND:地。 REF(+):参考电压正端。 REF(-):参考电压负端。
START:A/D 转换启动信号输入端。 ALE:地址锁存允许信号输入端。 (以上两种信号用于启动A/D 转换).
EOC:转换结束信号输出引脚,开始转换时为低电平,当转换结束时为高电平。
OE:输出允许控制端,用以打开三态数据输出锁存器。 CLK:时钟信号输入端(一般为500KHz)。 4.2.2 A/D转换电路图
图7 A/D转换电路
8
4.3 D/A转换电路
D/A转换电路我选择的是DAC0832,它具有与微处理器完全兼容,价格低廉、接口简单、转换控制容易等优点。DAC0832是8位D/A转换器,它采用CMOS工艺制作,内部有两个寄存器,而这两个寄存器的控制信号有五个,输入寄存器由ILE、CS、WR1控制,DAC寄存器由WR2、Xref控制,用软件指令控制这五个控制端可实现三种工作方式:直通方式、单缓冲方式、双缓冲方式。
直通方式是将两个寄存器的五个控制端预先置为有效,两个寄存器都开通只要有数字信号输入就立即进入D/A转换。
单缓冲方式使DAC0832的两个输入寄存器中有一个处于直通方式,另一个处于受控方式,可以将WR2和Xfer相连在接到地上,并把WR1接到89C51的WR上,ILE接高电平,CS接高位地址或地址译码的输出端上。
双缓冲方式把DAC0832的输入寄存器和DAC寄存器都接成受控方式,这种方式可用于多路模拟量要求同时输出的情况下。
三种工作方式区别是:直通方式不需要选通,直接D/A转换;单缓冲方式一次选通;双缓冲方式二次选通。
4.3.1 DAC0832功能
图8 DAC0832芯片图
D0~D7:8位数据输入线,TTL电平,有效时间应大于90ns(否则锁存器的数据会出错)。
ILE:数据锁存允许控制信号输入线,高电平有效。 CS:片选信号输入线(选通数据锁存器),低电平有效。 WR1:数据锁存器写选通输入线,负脉冲(脉宽应大于500ns)有效。由ILE、CS、WR1的逻辑组合产生LE1,当LE1为高电平时,数据锁存器状态随输入数据线变换,LE1的负跳变时将输入数据锁存。
XFER:数据传输控制信号输入线,低电平有效,负脉冲(脉宽应大于500ns)有效。
WR2:DAC寄存器选通输入线,负脉冲(脉宽应大于500ns)有效。由WR2、XFER的逻辑组合产生LE2,当LE2为高电平时,DAC寄存器的输出随寄存器的输入而变化,LE2的负跳变时将数据锁存器的内容打入DAC寄存器并开始D/A转换。
9
IOUT1:电流输出端1,其值随DAC寄存器的内容线性变化。 IOUT2:电流输出端2,其值与IOUT1值之和为一常数。
Rfb:反馈信号输入线,改变Rfb端外接电阻值可调整转换满量程精度。 Vcc:电源输入端,Vcc的范围为+5V~+15V。
VREF:基准电压输入线,VREF的范围为-10V~+10V。 AGND:模拟信号地 。 DGND:数字信号地。
4.3.2 D/A转换电路图
图9 D/A转换电路
4.5调理电路
在工业控制中各类传感器常输出标准电流信号4~20mA,为此,常要先将其转换成0~5V的标准电压信号,以便送给各类设备进行处理。电路见图10所示。
10
图10 调理电路
4.6 报警指示灯电路
当系统正常运行时,绿灯亮。当传感器所采集的信息通过单片机处理,如果超过设置的上限值或低于下限值时,蜂鸣器进行报警,红灯亮起。其电路图如图11所示。
11
图11 报警电路
4.7 键盘、显示控制电路
加入键盘是为了便于人机互动,方便工作人员即时调整工况,调节系统的允
许工作范围。以AT89S51为核心,来完成键盘控制电路的设计,目的是当按下一个键时,数码管上要显示相应的数字。 4.7.1键盘电路
所用键盘是一种常开型按钮开关,常态时,键盘的两个触点处于断开状态;按下时,两个触点闭合。通过按键在常态与被按下时的通断,操作人员就可以通过键盘向微控制系统输入数据或者控制命令等,从而实现简单的人机通信。
\\
图12 键盘控制电路
4.7.2显示电路
加入LED显示是为了便于人机互动,方便工作人员及时了解此时工况。为了简化电路、降低成本,采用八位数码管,将所有位的段选线并联在一起,由一个8位的I/O口控制。结构如图13所示:
12
图13 数码管结构
(1)数码管功能介绍:
由于所有8位段选线皆由一个I/O口控制,因此,在每一瞬间,8位数码管会显示相同的字符。要想每位显示不同的字符,就必须采用扫描方法轮流点亮各位LED,即在每一瞬间只使某一位显示字符。在此瞬间,段选控制I/O口输出相应字符段选码,而每位选择控制I/O口在该显示位送入选通电平,以保证该位显示相的字符。如此轮流,是每位分时显示该位该显示字符。
图14 LED显示电路
13
5 系统软件设计
5.1 主程序框图
开始 开中断 设置报警电路初始值 设置上下限初始值 设置DPTR初始值 启动A/D转换,同时将A中的数据送入D/A启动转换 踏步等待
图15 主程序框图
14
5.2数据程序框图
开始 关中断保护现场 读取A/D转换的结果 结果是否大于上限 Y N 结果是否小于下限 Y N 调用显示子程序 报警 启动下一次转换 调用显示子程序 现场恢复返回
图16 数据转换框图
15
5.3 键盘程序框图
图17 键盘程序框图
16
5.4显示程序框图
开始 cp由高到底电平触发 发送显示数据 数据传送到数码管 在数码管中显示出传感器输入的数值 图18 显示程序框图
17
6 总结
面对课程设计,觉得自己的专业知识掌握的不够全面,对于各个芯片的了解不够充分,经过这次课程设计之后,使得自己对于所学的知识进行了一次综合性的整理,通过查阅相关资料,不仅学习了更多的知识,也提高了自己的实践能力。通过本次课程设计,我总结了以下几点:
(1)在开始课程设计之前,要对所选择的芯片内部结构有一个系统的了解,知道芯片内有哪些资源,各个引脚的功能是什么.
(2)在进行课程设计时,不能妄想一次就将整个程序设计好,\反复修改,不断改进\是程序设计的必经之路.
(3)在课程设计过程中遇到问题是正常的,我们应该积极寻找解决问题的办法,并分析清楚产生问题的原因,以免下次再碰到同样的问题.
(4)认真审题,不能盲目设计,要理解课程设计的方向,做到能把课题完成又能锻炼自己的能力。
(5)课程设计可以分块进行设计,之后再组合到一起完成整个的设计。 (6)自己完成了整个课程设计之后,不仅熟悉了课程设计的过程,更系统的锻炼了自己。
18
7总体设计电路原理图
图29 总电路图
19
参考文献
[1] J. Basak, B. Chanda, D.D. Manjumder, On edge and line linking with connectionist models,
IEEE Trans. Systems, Man Cybernet. 24 (3) 413–428, 1994.
[2] 冯显英, 葛荣雨. 基于数字温湿度传感器SHT11的温湿度测控系统. 自动化仪表, 2006,
27(1): 59-61
20
课 程 设 计 报 告
学生姓名院级目
: 学 : 班
: 题
:
单鲲鹏 学 号: 1007240313
自动化工程学院
自动103 计算机控制系统
指导教师: 李波 职称: 副教授
指导教师: 王恭 职称: 副教授
21
2013年6月21日
22
正在阅读:
计算机控制系统课设报告06-02
多一点宽容,《教书匠》读后感 代君焕04-18
小学科技节优秀作文06-15
英语学习资料03-08
工程建设项目廉政责任书06-12
实验教案05-01
《亲爱的》观后感文本优选07-30
- 多层物业服务方案
- (审判实务)习惯法与少数民族地区民间纠纷解决问题(孙 潋)
- 人教版新课标六年级下册语文全册教案
- 词语打卡
- photoshop实习报告
- 钢结构设计原理综合测试2
- 2014年期末练习题
- 高中数学中的逆向思维解题方法探讨
- 名师原创 全国通用2014-2015学年高二寒假作业 政治(一)Word版
- 北航《建筑结构检测鉴定与加固》在线作业三
- XX县卫生监督所工程建设项目可行性研究报告
- 小学四年级观察作文经典评语
- 浅谈110KV变电站电气一次设计-程泉焱(1)
- 安全员考试题库
- 国家电网公司变电运维管理规定(试行)
- 义务教育课程标准稿征求意见提纲
- 教学秘书面试技巧
- 钢结构工程施工组织设计
- 水利工程概论论文
- 09届九年级数学第四次模拟试卷
- 控制系统
- 计算机
- 报告
- 网吧主管测试题
- 不同钢号相焊时如何选用焊接材料推荐表
- 高处作业理论题(15套)
- 请假条怎么写事假示范
- 江门市促进高校毕业生就业创业扶持政策
- 这个寒假,语文学习这样度过……
- 4 曲折的中东和平进程 教学设计 教案
- 四级翻译每日一译6
- 高二语文同步检测七
- 高中物理人教版选修3-2课后训练:5.4 变压器 Word版含解析
- 心理测量
- 高三生物一轮复习第三单元第一讲酶和ATP课时跟踪检测新人教版必
- 财务汇总
- 选修排球试题库
- 基于plc的自动控制分拣系统的设计
- 苏教版 二年级上册数学第四单元表内除法(一)单元教案及教学反思
- 实验实训中心开展深入学习实践科学发展观活动学习调研阶段工作安
- 质量通病防治监理实施细则
- 2018年四川省成都市高考数学一诊试卷(理科)(附解析)
- 地热能开发及利用项目可行性研究报告 - 图文