基于单片机的温度控制新版系统外文翻译.doc
外文原文: Design of the Temperature Control System Based on AT89C51 ABSTRACT The principle and functions of the temperature control system based on micro controller AT89C51 are studied, and the temperature measurement unit consists of the 1-Wire bus digital temperature sensor DS18B20. The system can be expected to detect the preset temperature, display time and save monitoring data. An alarm will be given by system if the temperature exceeds the upper and lower limit value of the temperature which can be set discretionarily and then automatic control is achieved, thus the temperature is achieved monitoring intelligently within a certain range. Basing on principle of the system, it is easy to make a variety of other non-linear control systems so long as the software design is reasonably changed. The system has been proved to be accurate, reliable and satisfied through field practice. KEYWORDS: AT89C51; micro controller; DS18B20; temperature 1 INTRODUCTION Temperature is a very important parameter in human life. In the modern society, temperature control (TC) is not only used in industrial production, but also widely used in other fields. With the improvement of the life quality, we can find the TC appliance in hotels, factories and home as well. And the trend that TC will better serve the whole society, so it is of great significance to measure and control the temperature. Based on the AT89C51 and temperature sensor DS18B20, this system controls the condition temperature intelligently. The temperature can be set discretionarily within a certain range. The system can show the time on LCD, and save monitoring data; and automatically control the temperature when the condition temperature exceeds the upper and lower limit value. By doing so it is to keep the temperature unchanged. The system is of high anti-jamming, high control precision and flexible design; it also fits the rugged environment. It is mainly used in people's life to improve the quality of the work and life. It is also versatile, so that it can be convenient to extend the use of the system. So the design is of profound importance. The general design, hardware design and software design of the system are covered. 1.1 Introduction The 8-bit AT89C51 CHMOS microcontrollers are designed to handle high-speed calculations and fast input/output operations. MCS 51 microcontrollers are typically used for high-speed event control systems. Commercial applications include modems, motor-control systems, printers, photocopiers, air conditioner control systems, disk drives, and medical instruments. The automotive industry use MCS 51 microcontrollers in engine-control systems, airbags, suspension systems, and antilock braking systems (ABS). The AT89C51 is especially well suited to applications that benefit from its processing speed and enhanced on-chip peripheral functions set, such as automotive power-train control, vehicle dynamic suspension, antilock braking, and stability control applications. Because of these critical applications, the market requires a reliable cost-effective controller with a low interrupt latency response, ability to service the high number of time and event driven integrated peripherals needed in real time applications, and a CPU with above average processing power in a single package. The financial and legal risk of having devices that operate unpredictably is very high. Once in the market, particularly in mission critical applications such as an autopilot or anti-lock braking system, mistakes are financially prohibitive. Redesign costs can run as high as a $500K, much more if the fix means 2 back annotating it across a product family that share the same core and/or peripheral design flaw. In addition, field replacements of components is extremely expensive, as the devices are typically sealed in modules with a total value several times that of the component. To mitigate these problems, it is essential that comprehensive testing of the controllers be carried out at both the component level and system level under worst case environmental and voltage conditions. This complete and thorough validation necessitates not only a well-defined process but also a proper environment and tools to facilitate and execute the mission successfully. Intel Chandler Platform Engineering group provides post silicon system validation (SV) of various micro-controllers and processors. The system validation process can be broken into three major parts. The type of the device and its application requirements determine which types of testing are performed on the device. 1.2 The AT89C51 provides the following standard features 4Kbytes of Flash, 128 bytes of RAM, 32 I/O lines, two 16-bittimer/counters, a five vector two-level interrupt architecture, a full duple ser-ial port, on-chip oscillator and clock circuitry. In addition, the AT89C51 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port and interrupt sys -tem to continue functioning. The Power-down Mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset. 1.3Pin Description VCC Supply voltage. GND Ground. Port 0:Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high impedance inputs. Port 0 may also be configured to be the multiplexed low order address/data bus during accesses to external program and data memory. In this mode P0 has internal pull ups. Port 0 also receives the code bytes during Flash programming, and outputs the code bytes during program verification. External pull ups are required during program verification. Port 1:Port 1 is an 8-bit bi-directional I/O port with internal pull ups. The Port 1 output buffers can sink/so -urce four TTL inputs. When 1s are written to Port 1 pins they are pulled high by the internal pull ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pullups. Port 1 also receives the low-order address bytes during Flash programming and verification. Port 2:Port 2 is an 8-bit bi-directional I/O port with internal pull ups. The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins they are pulled high by the internal pull ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull ups. Port 2 emits the high-order address byte during fetches from external program memory and during accesses to Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull ups. Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that use 16-bit addresses (MOVXDPTR). In this application, it uses strong internal pull-ups when emitting 1s. During accesses to external data memory that use 8-bit addresses (MOVX RI), Port 2 emits the contents of the P2 Special Function Register. Port 2 also receives the high-order address bits and some control signals durin Flash programming and verification. Port 3:Port 3 is an 8-bit bi-directional I/O port with internal pull ups. The Port 3 output buffers can sink/sou -rce four TTL inputs. When 1s are written to Port 3 pins they are pulled high by the internal pull ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pull ups. Port 3 also serves the functions of various special features of the AT89C51 as listed below: RST:Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device. ALE/PROG:Address Latch Enable output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation ALE is emitted at a constant rate of 1/6 the oscillator frequency, and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped duri-ng each access to external Data Memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode. PSEN:Program Store Enable is the read strobe to external program memory. When theAT89C51 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory. EA/VPP:External Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. This pin alsreceives the 12-volt programming enable voltage (VPP) during Flash programming, for parts that require 12-volt VPP. XTAL1:Input to the inverting oscillator amplifier and input to the internal clock operating circuit. XTAL2 :Output from the inverting oscillator amplifier. Oscillator CharacteristicsXTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier which can be configured for use as an on-chip oscillator, as shown in Figure 1. Either a quartz crystal or ceramic resonator may be used. To drive the device from an external clock source, XTAL2 should be left unconnected while XTAL1 is driven as shown in Figure 2.There are no requirements on the duty cycle of the external clock signal, since the input to the internal clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high and low time specifications must be observed. Idle Mode In idle mode, the CPU puts itself to sleep while all the on chip peripherals remain active. The mode is invoked by software. The content of the on-chip RAM and all the special functions registers remain unchanged during this mode. The idle mode can be terminated by any enabled interrupt or by a hardware reset. It should be noted that when idle is terminated by a hard ware reset, the device normally resumes program execution, from where it left off, up to two machine cycles before the internal reset algorithm takes control. On-chip hardware inhibits access to internal RAM in this event, but access to the port pins is not inhibited. To eliminate the possibility of an unexpected write to a port pin when Idle is terminated by reset, the instruction following the one that invokes Idle should not be one that writes to a port pin or to external memory. Power-down Mode In the power-down mode, the oscillator is stopped, and the instruction that invokes power-down is the last instruction executed. The on-chip RAM and Special Function Registers retain their values until the power-down mode is terminated. The only exit from power-down is a hardware reset. Reset redefines the SFRS but does not change the on-chip RAM. The reset should not be activated before VCC is restored to its normal operating level and must be held active long enough to allow the oscillator to restart and stabilize. The AT89C51 code memory array is programmed byte-by byte in either programming mode. To program any nonblank byte in the on-chip Flash Memory, the entire memory must be erased using the Chip Erase Mode. 2 Programming Algorithm Before programming the AT89C51, the address, data and control signals should be set up according to the Flash programming mode table and Figure 3 and Figure 4. To program the AT89C51, take the following steps.1. Input the desired memory location on the address lines.2. Input the appropriate data byte on the data lines. 3. Activate the correct combination of control signals. 4. Raise EA/VPP to 12V for the high-voltage programming mode. 5. Pulse ALE/PROG once to program a byte in the Flash array or the lock bits. The byte-write cycle is self-timed and typically takes no .翻译:温度控制系统设计 摘要 研究了基于AT89C51单片机温度控制系统原理和功能,温度测量单元由单总线数字温度传感器DS18B20构成。该系统可进行温度设定,时间显示和保存监测数据。如果温度超过任意设立上限和下限值,系统将报警并可以和自动控制实现,从而达到温度监测智能一定范畴内。基于系统原理,很容易使其她各种非线性控制系统,只要软件设计合理变化。该系统已被证明是精确,可靠和满意通过现场实践。 核心词:单片机;温度;温度 1 导言 温度是在人类生活中非常重要参数。在当代社会中,温度控制(TC)不但用于工业生产,还广泛应用于其他领域。随着生活质量提高,咱们可以发当前酒店,工厂和家庭,以及比赛设备。而比赛趋势将更好地服务于整个社会,因而它具备十分重要意义测量和控制温度。在AT89C51单片机和温度传感器DS18B20基本上,系统环境温度智能控制。温度可设定在一定范畴内动任意。该系统可以显示在液晶显示屏时间,并保存监测数据,并自动地控制温度,当环境温度超过上限和下限值。这样做是为了保持温度不变。该系统具备很高抗干扰能力,控制精度高,灵活设计,它也非常适合这个恶劣环境。它重要应用于人们生活,改进工作和生活质量。这也是通用,因而它可以以便地扩大使用该系统。因而,设计具备深刻重要性。普通设计,硬件设计和软件系统设计都涉及在内。 1.1 简介 8位AT89C51 CHMOS 工艺单片机被设计用于解决高速计算和迅速输入/输出。MCS51 单片机典型应用是高速事件控制系统。商业应用涉及调制解调器,电动机控制系统,打印机,影印机,空调控制系统,磁盘驱动器和医疗设备。汽车工业把MCS51 单片机用于发动机控制系统,悬挂系统和反锁制动系统。AT89C51 特别较好合用于得益于它解决速度和增强型片上外围功能集,诸如:汽车动力控制,车辆动态悬挂,反锁制动和稳定性控制应用。由于这些决定性应用,市场需要一种可靠具备低干扰潜伏响应费用-效能控制器,服务大量时间和事件驱动在实时应用需要集成外围能力,具备在单一程序包中高出平均解决功率中央解决器。拥有操作不可预测设备经济和法律风险是很高。一旦进入市场,特别任务决定性应用诸如自动驾驶仪或反锁制动系统,错误将是财力上所禁止。重新设计费用可以高达500K 美元,如果产品族享有同样内核或外围设计缺陷话,费用会更高。此外,部件代替品领域是极其昂贵,由于设备要用来把模块典型地焊接成一种总体价值比各个部件高几倍。为了缓和这些问题,在最坏环境和电压条件下对这些单片机进行无论在部件级别还是系统级别上综合测试是必须。Intel Chandler 平台工程组提供了各种单片机和解决器系统验证。这种系统验证解决可以被分解为三个重要某些。系统类型和应用需求决定了可以在设备上执行测试类型。 1.2 AT89C51提供如下原则功能 4k 字节FLASH 闪速存储器,128 字节内部RAM,32 个I/O 口线,2 个16 位定期/计数器,一种5 向量两级中断构造,一种全双工串行通信口,片内振荡器及时钟电路。同步,AT89C51 降至0Hz 静态逻辑操作,并支持两种可选节电工作模式。空闲方式体制CPU 工作,但容许RAM,定期/计数器,串行通信口及中断系统继续工作。掉电方式保存RAM 中内容,但振荡器体制工作并禁止其她所有不见工作直到下一种硬件复位。 1.3引脚功能阐明 ·Vcc:电源电压 ·GND:地 ·P0 口:P0 口是一组8 位漏极开路型双向I/O 口,也即地址/数据总线复用。作为输出口用时,每位能吸取电流方式驱动8 个TTL 逻辑门电路,对端口写“1”可作为高阻抗输入端用。在访问外部数据存储器或程序存储器时,这组口线分时转换地址(低8 位)和数据总线复用,在访问期间激活内部上拉电阻。在Flash 编程时,P0 口接受指令字节,而在程序校验时,输出指令字节,校验时,规定外接上拉电阻。 ·P1 口:P1 是一种带内部上拉电阻8 位双向I/O 口,P1 输出缓冲级可驱动(吸取或输出电流)4 个TTL 逻辑门电路。对端口写“1”,通过内部上拉电阻把端口拉到高电平,此时可作输入口。作为输入口使用时,由于内部存在上拉电阻,某个引脚被外部信号拉低时会输出一种电流(IIL)。Flash 编程和程序校验期间,P1 接受低8 位地址。 ·P2 口:P2 是一种带有内部上拉电阻8 位双向I/O 口,P2 输出缓冲级可驱动(吸取或输出电流)4 个TTL 逻辑门电路。对端口写“1”,通过内部上拉电阻把端口拉到高电平,此时可作输入口。作为输入口使用时,由于内部存在上拉电阻,某个引脚被外部信号拉低时会输出一种电流(IIL)。在访问外部程序存储器或16 位四肢外部数据存储器(例如执行MOVX DPTR指令)时,P2 口送出高8 位地址数据,在访问8 位地址外部数据存储器(例如执行MOVX RI 指令)时,P2 口线上内容(也即特殊功能寄存器(SFR)区中R2 寄存器内容),在整个访问期间不变化。Flash 编程和程序校验时,P2 也接受高位地址和其她控制信号。 ·P3 口:P3 是一种带有内部上拉电阻8 位双向I/O 口,P3 输出缓冲级可驱动(吸取或输出电流)4 个TTL 逻辑门电路。对端口写“1”,通过内部上拉电阻把端口拉到高电平,此时可作输入口。作为输入口使用时,由于内部存在上拉电阻,某个引脚被外部信号拉低时会输出一种电流(IIL)。P3 口还接受某些用于Flash 闪速存储器编程和程序校验控制信号。 ·RST:复位输入。当振荡器工作时,RST 引脚浮现两个机器周期以上高电平将使单片机复位。 ·ALE/PROG:当访问外部程序存储器或数据存储器时,ALE(地址锁存容许)输出脉冲用于锁存地址低8 位字节。虽然不访问外部存储器,ALE 仍以时钟振荡频率1/6 输出