温度控制系统硬件设计
摘 要 由于现代工艺越来越多的需要对实时温度进行监测和控制,而且需要的精度越来越高。所以温度控制系统国内外许多有关人员的重视,得到了十分广泛的应用。温度控制系统发展迅速,而且成果显著。 温度控制系统是利用下位机设置温度上下限,和实时温度的采集,传输到上位机。以达到对温度的比较、控制。本设计用MCS51单片机为主要硬件,并设计了相应的复位电路,振荡器和时钟电路。为实现设计目的此设计还设计了包括温度采集,温度显示,系统控制,串口通信等外围电路。而且对所设计电路给出了相应的软件设计,包括定时器初始化,串行口初始化和数据传输等程序。以简单说明了温度控制系统的工作原理。 关键词:MCS51单片机,温度采集,串口通信,定时器设置,温度设置。 ABSTRACT Because modern craft more and more many need carry on the monitor and the control to the real-time temperature, moreover needs the precision is more and more high. Therefore temperature control system,The domestic and foreign many concerned personnel's value, obtained the extremely widespread application,Temperature control system development rapid, moreover the achievement is remarkable. The temperature control system is uses in the lower position machine establishment temperature the lower limit, with real-time temperature gathering, transmits to on position machine. By achieves to the temperature comparison, the control,This design usesMCS51The monolithic integrated circuit is the main hardware, and has designed the corresponding replacement electric circuit, the oscillator and the clock electric circuit. In order to realize design goal this design also to design including temperature gathering, the temperature demonstrated that, the systems control, strung together periphery electric circuit and so on mouth correspondence. Moreover to designe the electric circuit to produce the corresponding software design, including timer initialization, serial procedure and so on mouth initialization and data transmission. By simply explained the temperature control system principle of work. Key word: MCS51The monolithic integrated circuit, temperature gathering, strings together the mouth correspondence, the timer establishment, the temperature establishment. 目 录 第1章 绪论 1 1.1 单片机的概述 1 1.2 单片机国内外发展现状及发展趋势 2 第2章 系统硬件的选择 6 2.1 MCS-51单片机的功能特性和引腿信号 6 2.2 MCS-51单片机存储器配置 8 2.2.1 程序存储器 9 2.2.2 数据存储器 10 2.3 系统的时序 10 2.3.1 机器周期和指令周期 10 2.3.2 系统指令的取指/执行时序 11 2.3.3 访问片外ROM的指令时序 11 2.4 8051单片机的复位状态 13 2.5 8051单片机指令系统分析 14 第3章 硬件电路的设计 17 3.1 电源设计 17 3.2 89C51单片机的系统电路设计 18 3.2.1 复位电路 18 3.2.2 振荡器和时钟电路 19 3.3 外围电路设计 20 3.3.1 温度采集 21 3.3.2 温度显示 23 3.3.3 系统控制 26 3.3.4 串口通信 27 3.4 本章小结 30 第4章 软件设计 31 4.1 概述 31 4.2 主程序设计 31 4.2.1 流程图 31 4.2.2 主程序 32 4.3定时器初始化 35 4.3.1 8051单片机的定时器/计数器 35 4.3.2 定时器的控制 36 4.3.3 定时器的工作模式 37 4.4串行口初始化 39 4.4.1串行接口 39 4.4.2 串行口的工作方式 42 结 论 47 致 谢 48 参考文献 49 第1章 绪论 1.1 单片机的概述 单片机是70年代中期发展起来的一种大规模集成电路芯片,是CPU、RAM、ROM、I/O接口和中断系统集成于同一硅片的器件。单片机发展迅速,各类产品不断涌现,出现了许多好性能新兴机种,现已成为工厂自动化和各控制领域的支柱产业之一。由于生产工艺和设计能力的不断提高,单片机也在向着更高集成化、更多位多功能,更强化处理控制问题的能力、更快的运算速度、更廉价低功耗、更兼容开发和更好的软件固有化的方向发展。 单片机是所有微处理机中性价比最高的一种,随着种类的不断增加,功能不断加强,其应用领域也迅速扩大。单片机在智能仪表、实时控制、机电一体化、办公机械、家用电器等方面都有相当的应用领域。当前,8位单片机主要用于工业控制,如温度、压力、流量、计量和机械加工的测量和控制场合;高效能的16位单片机(如MCS-96、MK-68200)可用在更复杂的计算机网络。单片机用于控制有利于实现系统控制的最小化和单片化,简化一些专用接口电路,如编程计数器、锁相环(PLL)、模拟开关、A/D和D/A变换器、电压比较器等组成的专用控制处理功能的单板式微系统。随着电子技术的飞速发展,电子控制器件不断向着小型化、智能化方向发展,同时可*性不断提高,单片机由于具有集成度高、功能强、通用性好、可*性高、抗干扰能力强、体积小、使用方便灵活等特点,无论是在国防工业、通讯尖端技术领域,还是在智能仪器、民用电器中都使用的越来越多。可以说,微机测控技术的应用已渗透到国民经济的各个部门,微机测控技术的应用是产品提高档次和推陈出新的有效途径。 1.2 单片机国内外发展现状及发展趋势 |